Upload Tizen:Base source
[toolchains/python-lxml.git] / src / lxml / lxml.etree.c
1 /* Generated by Cython 0.11.3 on Fri Oct 30 14:33:22 2009 */
2
3 #define PY_SSIZE_T_CLEAN
4 #include "Python.h"
5 #include "structmember.h"
6 #ifndef Py_PYTHON_H
7     #error Python headers needed to compile C extensions, please install development version of Python.
8 #else
9 #ifndef PY_LONG_LONG
10   #define PY_LONG_LONG LONG_LONG
11 #endif
12 #ifndef DL_EXPORT
13   #define DL_EXPORT(t) t
14 #endif
15 #if PY_VERSION_HEX < 0x02040000
16   #define METH_COEXIST 0
17   #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
18 #endif
19 #if PY_VERSION_HEX < 0x02050000
20   typedef int Py_ssize_t;
21   #define PY_SSIZE_T_MAX INT_MAX
22   #define PY_SSIZE_T_MIN INT_MIN
23   #define PY_FORMAT_SIZE_T ""
24   #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
25   #define PyInt_AsSsize_t(o)   PyInt_AsLong(o)
26   #define PyNumber_Index(o)    PyNumber_Int(o)
27   #define PyIndex_Check(o)     PyNumber_Check(o)
28 #endif
29 #if PY_VERSION_HEX < 0x02060000
30   #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
31   #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
32   #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
33   #define PyVarObject_HEAD_INIT(type, size) \
34           PyObject_HEAD_INIT(type) size,
35   #define PyType_Modified(t)
36
37   typedef struct {
38        void *buf;
39        PyObject *obj;
40        Py_ssize_t len;
41        Py_ssize_t itemsize;
42        int readonly;
43        int ndim;
44        char *format;
45        Py_ssize_t *shape;
46        Py_ssize_t *strides;
47        Py_ssize_t *suboffsets;
48        void *internal;
49   } Py_buffer;
50
51   #define PyBUF_SIMPLE 0
52   #define PyBUF_WRITABLE 0x0001
53   #define PyBUF_FORMAT 0x0004
54   #define PyBUF_ND 0x0008
55   #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
56   #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
57   #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
58   #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
59   #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
60
61 #endif
62 #if PY_MAJOR_VERSION < 3
63   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
64 #else
65   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
66 #endif
67 #if PY_MAJOR_VERSION >= 3
68   #define Py_TPFLAGS_CHECKTYPES 0
69   #define Py_TPFLAGS_HAVE_INDEX 0
70 #endif
71 #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
72   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
73 #endif
74 #if PY_MAJOR_VERSION >= 3
75   #define PyBaseString_Type            PyUnicode_Type
76   #define PyString_Type                PyBytes_Type
77   #define PyString_CheckExact          PyBytes_CheckExact
78   #define PyInt_Type                   PyLong_Type
79   #define PyInt_Check(op)              PyLong_Check(op)
80   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
81   #define PyInt_FromString             PyLong_FromString
82   #define PyInt_FromUnicode            PyLong_FromUnicode
83   #define PyInt_FromLong               PyLong_FromLong
84   #define PyInt_FromSize_t             PyLong_FromSize_t
85   #define PyInt_FromSsize_t            PyLong_FromSsize_t
86   #define PyInt_AsLong                 PyLong_AsLong
87   #define PyInt_AS_LONG                PyLong_AS_LONG
88   #define PyInt_AsSsize_t              PyLong_AsSsize_t
89   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
90   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
91   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
92 #else
93   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
94   #define PyBytes_Type                 PyString_Type
95 #endif
96 #if PY_MAJOR_VERSION >= 3
97   #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func)
98 #endif
99 #if !defined(WIN32) && !defined(MS_WINDOWS)
100   #ifndef __stdcall
101     #define __stdcall
102   #endif
103   #ifndef __cdecl
104     #define __cdecl
105   #endif
106   #ifndef __fastcall
107     #define __fastcall
108   #endif
109 #else
110   #define _USE_MATH_DEFINES
111 #endif
112 #if PY_VERSION_HEX < 0x02050000
113   #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
114   #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
115   #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
116 #else
117   #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
118   #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
119   #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
120 #endif
121 #if PY_VERSION_HEX < 0x02050000
122   #define __Pyx_NAMESTR(n) ((char *)(n))
123   #define __Pyx_DOCSTR(n)  ((char *)(n))
124 #else
125   #define __Pyx_NAMESTR(n) (n)
126   #define __Pyx_DOCSTR(n)  (n)
127 #endif
128 #ifdef __cplusplus
129 #define __PYX_EXTERN_C extern "C"
130 #else
131 #define __PYX_EXTERN_C extern
132 #endif
133 #include <math.h>
134 #define __PYX_HAVE_API__lxml__etree
135 #include "string.h"
136 #include "stdio.h"
137 #include "stdlib.h"
138 #include "stdarg.h"
139 #include "etree_defs.h"
140 #include "lxml-version.h"
141 #include "libxml/xmlversion.h"
142 #include "libxml/encoding.h"
143 #include "libxml/chvalid.h"
144 #include "libxml/hash.h"
145 #include "libxml/tree.h"
146 #include "libxml/uri.h"
147 #include "libxml/HTMLtree.h"
148 #include "libxml/valid.h"
149 #include "libxml/xmlIO.h"
150 #include "libxml/xmlsave.h"
151 #include "libxml/globals.h"
152 #include "libxml/xmlstring.h"
153 #include "libxml/xmlmemory.h"
154 #include "pythread.h"
155 #include "libxml/xmlerror.h"
156 #include "libxml/xpath.h"
157 #include "libxml/xpathInternals.h"
158 #include "libxml/c14n.h"
159 #include "libxml/parser.h"
160 #include "libxml/parserInternals.h"
161 #include "libxml/HTMLparser.h"
162 #include "libxml/xinclude.h"
163 #include "libxslt/xslt.h"
164 #include "libxslt/xsltconfig.h"
165 #include "libxslt/xsltInternals.h"
166 #include "libxslt/extensions.h"
167 #include "libxslt/documents.h"
168 #include "libxslt/transform.h"
169 #include "libxslt/xsltutils.h"
170 #include "libxslt/security.h"
171 #include "libxslt/variables.h"
172 #include "libxslt/extra.h"
173 #include "libexslt/exslt.h"
174 #include "libxml/relaxng.h"
175 #include "libxml/xmlschemas.h"
176 #include "libxml/schematron.h"
177 #define __PYX_USE_C99_COMPLEX defined(_Complex_I)
178
179
180 #ifdef __GNUC__
181 #define INLINE __inline__
182 #elif _WIN32
183 #define INLINE __inline
184 #else
185 #define INLINE 
186 #endif
187
188 typedef struct {PyObject **p; char *s; long n; char is_unicode; char intern; char is_identifier;} __Pyx_StringTabEntry; /*proto*/
189
190
191
192 static int __pyx_skip_dispatch = 0;
193
194
195 /* Type Conversion Predeclarations */
196
197 #if PY_MAJOR_VERSION < 3
198 #define __Pyx_PyBytes_FromString          PyString_FromString
199 #define __Pyx_PyBytes_FromStringAndSize   PyString_FromStringAndSize
200 #define __Pyx_PyBytes_AsString            PyString_AsString
201 #else
202 #define __Pyx_PyBytes_FromString          PyBytes_FromString
203 #define __Pyx_PyBytes_FromStringAndSize   PyBytes_FromStringAndSize
204 #define __Pyx_PyBytes_AsString            PyBytes_AsString
205 #endif
206
207 #define __Pyx_PyBytes_FromUString(s)      __Pyx_PyBytes_FromString((char*)s)
208 #define __Pyx_PyBytes_AsUString(s)        ((unsigned char*) __Pyx_PyBytes_AsString(s))
209
210 #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
211 static INLINE int __Pyx_PyObject_IsTrue(PyObject*);
212 static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
213
214 #if !defined(T_PYSSIZET)
215 #if PY_VERSION_HEX < 0x02050000
216 #define T_PYSSIZET T_INT
217 #elif !defined(T_LONGLONG)
218 #define T_PYSSIZET \
219         ((sizeof(Py_ssize_t) == sizeof(int))  ? T_INT  : \
220         ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : -1))
221 #else
222 #define T_PYSSIZET \
223         ((sizeof(Py_ssize_t) == sizeof(int))          ? T_INT      : \
224         ((sizeof(Py_ssize_t) == sizeof(long))         ? T_LONG     : \
225         ((sizeof(Py_ssize_t) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1)))
226 #endif
227 #endif
228
229
230 #if !defined(T_ULONGLONG)
231 #define __Pyx_T_UNSIGNED_INT(x) \
232         ((sizeof(x) == sizeof(unsigned char))  ? T_UBYTE : \
233         ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
234         ((sizeof(x) == sizeof(unsigned int))   ? T_UINT : \
235         ((sizeof(x) == sizeof(unsigned long))  ? T_ULONG : -1))))
236 #else
237 #define __Pyx_T_UNSIGNED_INT(x) \
238         ((sizeof(x) == sizeof(unsigned char))  ? T_UBYTE : \
239         ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
240         ((sizeof(x) == sizeof(unsigned int))   ? T_UINT : \
241         ((sizeof(x) == sizeof(unsigned long))  ? T_ULONG : \
242         ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1)))))
243 #endif
244 #if !defined(T_LONGLONG)
245 #define __Pyx_T_SIGNED_INT(x) \
246         ((sizeof(x) == sizeof(char))  ? T_BYTE : \
247         ((sizeof(x) == sizeof(short)) ? T_SHORT : \
248         ((sizeof(x) == sizeof(int))   ? T_INT : \
249         ((sizeof(x) == sizeof(long))  ? T_LONG : -1))))
250 #else
251 #define __Pyx_T_SIGNED_INT(x) \
252         ((sizeof(x) == sizeof(char))  ? T_BYTE : \
253         ((sizeof(x) == sizeof(short)) ? T_SHORT : \
254         ((sizeof(x) == sizeof(int))   ? T_INT : \
255         ((sizeof(x) == sizeof(long))  ? T_LONG : \
256         ((sizeof(x) == sizeof(PY_LONG_LONG))   ? T_LONGLONG : -1)))))
257 #endif
258
259 #define __Pyx_T_FLOATING(x) \
260         ((sizeof(x) == sizeof(float)) ? T_FLOAT : \
261         ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1))
262
263 #if !defined(T_SIZET)
264 #if !defined(T_ULONGLONG)
265 #define T_SIZET \
266         ((sizeof(size_t) == sizeof(unsigned int))  ? T_UINT  : \
267         ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : -1))
268 #else
269 #define T_SIZET \
270         ((sizeof(size_t) == sizeof(unsigned int))          ? T_UINT      : \
271         ((sizeof(size_t) == sizeof(unsigned long))         ? T_ULONG     : \
272         ((sizeof(size_t) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1)))
273 #endif
274 #endif
275
276 static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
277 static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
278 static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
279
280 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
281
282
283 #ifdef __GNUC__
284 /* Test for GCC > 2.95 */
285 #if __GNUC__ > 2 ||               (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) 
286 #define likely(x)   __builtin_expect(!!(x), 1)
287 #define unlikely(x) __builtin_expect(!!(x), 0)
288 #else /* __GNUC__ > 2 ... */
289 #define likely(x)   (x)
290 #define unlikely(x) (x)
291 #endif /* __GNUC__ > 2 ... */
292 #else /* __GNUC__ */
293 #define likely(x)   (x)
294 #define unlikely(x) (x)
295 #endif /* __GNUC__ */
296     
297 static PyObject *__pyx_m;
298 static PyObject *__pyx_b;
299 static PyObject *__pyx_empty_tuple;
300 static PyObject *__pyx_empty_bytes;
301 static int __pyx_lineno;
302 static int __pyx_clineno = 0;
303 static const char * __pyx_cfilenm= __FILE__;
304 static const char *__pyx_filename;
305 static const char **__pyx_f;
306
307 static char __pyx_mdoc[] = "The ``lxml.etree`` module implements the extended ElementTree API\nfor XML.\n";
308
309
310 #ifdef CYTHON_REFNANNY
311 typedef struct {
312   void (*INCREF)(void*, PyObject*, int);
313   void (*DECREF)(void*, PyObject*, int);
314   void (*GOTREF)(void*, PyObject*, int);
315   void (*GIVEREF)(void*, PyObject*, int);
316   void* (*NewContext)(const char*, int, const char*);
317   void (*FinishContext)(void**);
318 } __Pyx_RefnannyAPIStruct;
319 static __Pyx_RefnannyAPIStruct *__Pyx_Refnanny = NULL;
320 #define __Pyx_ImportRefcountAPI(name)   (__Pyx_RefnannyAPIStruct *) PyCObject_Import((char *)name, (char *)"RefnannyAPI")
321 #define __Pyx_INCREF(r) __Pyx_Refnanny->INCREF(__pyx_refchk, (PyObject *)(r), __LINE__)
322 #define __Pyx_DECREF(r) __Pyx_Refnanny->DECREF(__pyx_refchk, (PyObject *)(r), __LINE__)
323 #define __Pyx_GOTREF(r) __Pyx_Refnanny->GOTREF(__pyx_refchk, (PyObject *)(r), __LINE__)
324 #define __Pyx_GIVEREF(r) __Pyx_Refnanny->GIVEREF(__pyx_refchk, (PyObject *)(r), __LINE__)
325 #define __Pyx_XDECREF(r) if((r) == NULL) ; else __Pyx_DECREF(r)
326 #define __Pyx_SetupRefcountContext(name)   void* __pyx_refchk = __Pyx_Refnanny->NewContext((name), __LINE__, __FILE__)
327 #define __Pyx_FinishRefcountContext()   __Pyx_Refnanny->FinishContext(&__pyx_refchk)
328 #else
329 #define __Pyx_INCREF(r) Py_INCREF(r)
330 #define __Pyx_DECREF(r) Py_DECREF(r)
331 #define __Pyx_GOTREF(r)
332 #define __Pyx_GIVEREF(r)
333 #define __Pyx_XDECREF(r) Py_XDECREF(r)
334 #define __Pyx_SetupRefcountContext(name)
335 #define __Pyx_FinishRefcountContext()
336 #endif /* CYTHON_REFNANNY */
337 #define __Pyx_XGIVEREF(r) if((r) == NULL) ; else __Pyx_GIVEREF(r)
338 #define __Pyx_XGOTREF(r) if((r) == NULL) ; else __Pyx_GOTREF(r)
339
340 static void __Pyx_RaiseDoubleKeywordsError(
341     const char* func_name, PyObject* kw_name); /*proto*/
342
343 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
344     Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
345
346 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,     const char* function_name); /*proto*/
347
348 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
349
350 static INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict,
351     const char* function_name, int kw_allowed); /*proto*/
352
353 static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
354
355 static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
356 static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
357
358
359 static INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
360     PyObject *r;
361     if (!j) return NULL;
362     r = PyObject_GetItem(o, j);
363     Py_DECREF(j);
364     return r;
365 }
366
367
368 #define __Pyx_GetItemInt_List(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \
369                                                     __Pyx_GetItemInt_List_Fast(o, i, size <= sizeof(long)) : \
370                                                     __Pyx_GetItemInt_Generic(o, to_py_func(i)))
371
372 static INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
373     if (likely(o != Py_None)) {
374         if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
375             PyObject *r = PyList_GET_ITEM(o, i);
376             Py_INCREF(r);
377             return r;
378         }
379         else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
380             PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
381             Py_INCREF(r);
382             return r;
383         }
384     }
385     return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i));
386 }
387
388 #define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \
389                                                     __Pyx_GetItemInt_Tuple_Fast(o, i, size <= sizeof(long)) : \
390                                                     __Pyx_GetItemInt_Generic(o, to_py_func(i)))
391
392 static INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
393     if (likely(o != Py_None)) {
394         if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
395             PyObject *r = PyTuple_GET_ITEM(o, i);
396             Py_INCREF(r);
397             return r;
398         }
399         else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
400             PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
401             Py_INCREF(r);
402             return r;
403         }
404     }
405     return __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i));
406 }
407
408
409 #define __Pyx_GetItemInt(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \
410                                                     __Pyx_GetItemInt_Fast(o, i, size <= sizeof(long)) : \
411                                                     __Pyx_GetItemInt_Generic(o, to_py_func(i)))
412
413 static INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
414     PyObject *r;
415     if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
416         r = PyList_GET_ITEM(o, i);
417         Py_INCREF(r);
418     }
419     else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
420         r = PyTuple_GET_ITEM(o, i);
421         Py_INCREF(r);
422     }
423     else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) {
424         r = PySequence_GetItem(o, i);
425     }
426     else {
427         r = __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i));
428     }
429     return r;
430 }
431
432 #define __Pyx_DelItemInt(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \
433                                                     __Pyx_DelItemInt_Fast(o, i, size <= sizeof(long)) : \
434                                                     __Pyx_DelItem_Generic(o, to_py_func(i)))
435
436 static INLINE int __Pyx_DelItem_Generic(PyObject *o, PyObject *j) {
437     int r;
438     if (!j) return -1;
439     r = PyObject_DelItem(o, j);
440     Py_DECREF(j);
441     return r;
442 }
443
444 static INLINE int __Pyx_DelItemInt_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
445     if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_ass_item && likely(i >= 0))
446         return PySequence_DelItem(o, i);
447     else {
448         PyObject *j = fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i);
449         return __Pyx_DelItem_Generic(o, j);
450     }
451 }
452
453 #if PY_VERSION_HEX < 0x02050000
454 #ifndef PyAnySet_CheckExact
455
456 #define PyAnySet_CheckExact(ob) \
457     ((ob)->ob_type == &PySet_Type || \
458      (ob)->ob_type == &PyFrozenSet_Type)
459
460 #define PySet_New(iterable) \
461     PyObject_CallFunctionObjArgs((PyObject *)&PySet_Type, (iterable), NULL)
462
463 #define Pyx_PyFrozenSet_New(iterable) \
464     PyObject_CallFunctionObjArgs((PyObject *)&PyFrozenSet_Type, (iterable), NULL)
465
466 #define PySet_Size(anyset) \
467     PyObject_Size((anyset))
468
469 #define PySet_Contains(anyset, key) \
470     PySequence_Contains((anyset), (key))
471
472 #define PySet_Pop(set) \
473     PyObject_CallMethod(set, (char *)"pop", NULL)
474
475 static INLINE int PySet_Clear(PyObject *set) {
476     PyObject *ret = PyObject_CallMethod(set, (char *)"clear", NULL);
477     if (!ret) return -1;
478     Py_DECREF(ret); return 0;
479 }
480
481 static INLINE int PySet_Discard(PyObject *set, PyObject *key) {
482     PyObject *ret = PyObject_CallMethod(set, (char *)"discard", (char *)"O", key);
483     if (!ret) return -1;
484     Py_DECREF(ret); return 0;
485 }
486
487 static INLINE int PySet_Add(PyObject *set, PyObject *key) {
488     PyObject *ret = PyObject_CallMethod(set, (char *)"add", (char *)"O", key);
489     if (!ret) return -1;
490     Py_DECREF(ret); return 0;
491 }
492
493 #endif /* PyAnySet_CheckExact (<= Py2.4) */
494
495 #if PY_VERSION_HEX < 0x02040000
496 #ifndef Py_SETOBJECT_H
497 #define Py_SETOBJECT_H
498
499 static PyTypeObject *__Pyx_PySet_Type = NULL;
500 static PyTypeObject *__Pyx_PyFrozenSet_Type = NULL;
501
502 #define PySet_Type (*__Pyx_PySet_Type)
503 #define PyFrozenSet_Type (*__Pyx_PyFrozenSet_Type)
504
505 #define PyAnySet_Check(ob) \
506     (PyAnySet_CheckExact(ob) || \
507      PyType_IsSubtype((ob)->ob_type, &PySet_Type) || \
508      PyType_IsSubtype((ob)->ob_type, &PyFrozenSet_Type))
509
510 #define PyFrozenSet_CheckExact(ob) ((ob)->ob_type == &PyFrozenSet_Type)
511
512 static int __Pyx_Py23SetsImport(void) {
513     PyObject *sets=0, *Set=0, *ImmutableSet=0;
514
515     sets = PyImport_ImportModule((char *)"sets");
516     if (!sets) goto bad;
517     Set = PyObject_GetAttrString(sets, (char *)"Set");
518     if (!Set) goto bad;
519     ImmutableSet = PyObject_GetAttrString(sets, (char *)"ImmutableSet");
520     if (!ImmutableSet) goto bad;
521     Py_DECREF(sets);
522
523     __Pyx_PySet_Type       = (PyTypeObject*) Set;
524     __Pyx_PyFrozenSet_Type = (PyTypeObject*) ImmutableSet;
525
526     return 0;
527
528  bad:
529     Py_XDECREF(sets);
530     Py_XDECREF(Set);
531     Py_XDECREF(ImmutableSet);
532     return -1;
533 }
534
535 #else
536 static int __Pyx_Py23SetsImport(void) { return 0; }
537 #endif /* !Py_SETOBJECT_H */
538 #endif /* < Py2.4  */
539 #endif /* < Py2.5  */
540
541 static INLINE void __Pyx_RaiseNoneNotIterableError(void);
542
543 static INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
544
545 static INLINE void __Pyx_RaiseTooManyValuesError(void);
546
547 static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/
548
549 static INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
550 static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
551
552 static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
553     const char *name, int exact); /*proto*/
554
555 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
556
557 static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
558
559 static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, const char *modname); /*proto*/
560
561 static int __Pyx_Print(PyObject *, int); /*proto*/
562 #if PY_MAJOR_VERSION >= 3
563 static PyObject* __pyx_print = 0;
564 static PyObject* __pyx_print_kwargs = 0;
565 #endif
566
567 static int __Pyx_PrintOne(PyObject *o); /*proto*/
568
569 #include "descrobject.h"
570 static PyObject* __Pyx_Method_ClassMethod(PyObject *method); /*proto*/
571
572 static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/
573 static int __Pyx_EndUnpack(PyObject *); /*proto*/
574
575 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
576
577 static PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /*proto*/
578
579 #ifndef __PYX_FORCE_INIT_THREADS
580 #if PY_VERSION_HEX < 0x02040200
581 #define __PYX_FORCE_INIT_THREADS 1
582 #else
583 #define __PYX_FORCE_INIT_THREADS 0
584 #endif
585 #endif
586
587 static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
588
589 static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
590
591 static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
592
593 static INLINE char __Pyx_PyInt_AsChar(PyObject *);
594
595 static INLINE short __Pyx_PyInt_AsShort(PyObject *);
596
597 static INLINE int __Pyx_PyInt_AsInt(PyObject *);
598
599 static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
600
601 static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
602
603 static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
604
605 static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
606
607 static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
608
609 static INLINE long __Pyx_PyInt_AsLong(PyObject *);
610
611 static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
612
613 static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
614
615 static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
616
617 static void __Pyx_WriteUnraisable(const char *name); /*proto*/
618
619 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /*proto*/
620
621 static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
622
623 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size);  /*proto*/
624
625 static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
626
627 static void __Pyx_AddTraceback(const char *funcname); /*proto*/
628
629 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
630
631 /* Type declarations */
632
633 typedef xmlNode *(*_node_to_node_function)(xmlNode *);
634
635 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":210
636  *         c_parent = c_parent.parent
637  * 
638  * ctypedef struct _nscache:             # <<<<<<<<<<<<<<
639  *     xmlNs** new
640  *     xmlNs** old
641  */
642
643 typedef struct {
644   xmlNs **new;
645   xmlNs **old;
646   size_t size;
647   size_t last;
648 } __pyx_t_4lxml_5etree__nscache;
649
650 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":291
651  *                                   _cstr(attr_name_utf), _cstr(value_utf))
652  * 
653  * ctypedef struct _ns_node_ref:             # <<<<<<<<<<<<<<
654  *     xmlNs* ns
655  *     xmlNode* node
656  */
657
658 typedef struct {
659   xmlNs *ns;
660   xmlNode *node;
661 } __pyx_t_4lxml_5etree__ns_node_ref;
662
663 typedef PyObject *(*_element_class_lookup_function)(PyObject *, struct LxmlDocument *, xmlNode *);
664
665 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":3
666  * # Custom resolver API
667  * 
668  * ctypedef enum _InputDocumentDataType:             # <<<<<<<<<<<<<<
669  *     PARSER_DATA_EMPTY
670  *     PARSER_DATA_STRING
671  */
672
673 typedef enum {
674   __pyx_e_4lxml_5etree_PARSER_DATA_EMPTY,
675   __pyx_e_4lxml_5etree_PARSER_DATA_STRING,
676   __pyx_e_4lxml_5etree_PARSER_DATA_FILENAME,
677   __pyx_e_4lxml_5etree_PARSER_DATA_FILE
678 } __pyx_t_4lxml_5etree__InputDocumentDataType;
679
680 typedef enum {
681   __pyx_e_4lxml_5etree_SAX_EVENT_START = 1,
682   __pyx_e_4lxml_5etree_SAX_EVENT_END = 2,
683   __pyx_e_4lxml_5etree_SAX_EVENT_DATA = 4,
684   __pyx_e_4lxml_5etree_SAX_EVENT_DOCTYPE = 8,
685   __pyx_e_4lxml_5etree_SAX_EVENT_PI = 16,
686   __pyx_e_4lxml_5etree_SAX_EVENT_COMMENT = 32
687 } __pyx_t_4lxml_5etree__SaxParserEvents;
688
689 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":7
690  *     """
691  * 
692  * cdef enum _OutputMethods:             # <<<<<<<<<<<<<<
693  *     OUTPUT_METHOD_XML
694  *     OUTPUT_METHOD_HTML
695  */
696
697 enum __pyx_t_4lxml_5etree__OutputMethods {
698   __pyx_e_4lxml_5etree_OUTPUT_METHOD_XML,
699   __pyx_e_4lxml_5etree_OUTPUT_METHOD_HTML,
700   __pyx_e_4lxml_5etree_OUTPUT_METHOD_TEXT
701 };
702
703 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":5
704  * DEF __ITERPARSE_CHUNK_SIZE = 32768
705  * 
706  * ctypedef enum _IterparseEventFilter:             # <<<<<<<<<<<<<<
707  *     ITERPARSE_FILTER_START     =  1
708  *     ITERPARSE_FILTER_END       =  2
709  */
710
711 typedef enum {
712   __pyx_e_4lxml_5etree_ITERPARSE_FILTER_START = 1,
713   __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END = 2,
714   __pyx_e_4lxml_5etree_ITERPARSE_FILTER_START_NS = 4,
715   __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END_NS = 8,
716   __pyx_e_4lxml_5etree_ITERPARSE_FILTER_COMMENT = 16,
717   __pyx_e_4lxml_5etree_ITERPARSE_FILTER_PI = 32
718 } __pyx_t_4lxml_5etree__IterparseEventFilter;
719
720 typedef int (*__pyx_t_4lxml_5etree__register_function)(void *, PyObject *, PyObject *);
721
722 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":236
723  * cdef public class _Document [ type LxmlDocumentType, object LxmlDocument ]
724  * cdef public class _Element [ type LxmlElementType, object LxmlElement ]
725  * cdef class _BaseParser             # <<<<<<<<<<<<<<
726  * cdef class QName
727  * ctypedef public xmlNode* (*_node_to_node_function)(xmlNode*)
728  */
729
730 struct __pyx_obj_4lxml_5etree__BaseParser {
731   PyObject_HEAD
732   struct __pyx_vtabstruct_4lxml_5etree__BaseParser *__pyx_vtab;
733   struct LxmlElementClassLookup *_class_lookup;
734   struct __pyx_obj_4lxml_5etree__ResolverRegistry *_resolvers;
735   struct __pyx_obj_4lxml_5etree__ParserContext *_parser_context;
736   struct __pyx_obj_4lxml_5etree__ParserContext *_push_parser_context;
737   int _parse_options;
738   int _for_html;
739   int _remove_comments;
740   int _remove_pis;
741   int _strip_cdata;
742   struct __pyx_obj_4lxml_5etree_XMLSchema *_schema;
743   PyObject *_filename;
744   PyObject *_target;
745   PyObject *_default_encoding;
746 };
747
748 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1006
749  * ############################################################
750  * 
751  * cdef class _FeedParser(_BaseParser):             # <<<<<<<<<<<<<<
752  *     cdef bint _feed_parser_running
753  * 
754  */
755
756 struct __pyx_obj_4lxml_5etree__FeedParser {
757   struct __pyx_obj_4lxml_5etree__BaseParser __pyx_base;
758   int _feed_parser_running;
759 };
760
761 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1185
762  *     )
763  * 
764  * cdef class XMLParser(_FeedParser):             # <<<<<<<<<<<<<<
765  *     u"""XMLParser(self, encoding=None, attribute_defaults=False, dtd_validation=False, load_dtd=False, no_network=True, ns_clean=False, recover=False, XMLSchema schema=None, remove_blank_text=False, resolve_entities=True, remove_comments=False, remove_pis=False, strip_cdata=True, target=None, compact=True)
766  * 
767  */
768
769 struct __pyx_obj_4lxml_5etree_XMLParser {
770   struct __pyx_obj_4lxml_5etree__FeedParser __pyx_base;
771 };
772
773 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1267
774  *                              target, None, encoding)
775  * 
776  * cdef class ETCompatXMLParser(XMLParser):             # <<<<<<<<<<<<<<
777  *     u"""ETCompatXMLParser(self, encoding=None, attribute_defaults=False, \
778  *                  dtd_validation=False, load_dtd=False, no_network=True, \
779  */
780
781 struct __pyx_obj_4lxml_5etree_ETCompatXMLParser {
782   struct __pyx_obj_4lxml_5etree_XMLParser __pyx_base;
783 };
784
785 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":14
786  * 
787  * 
788  * cdef class _NamespaceRegistry:             # <<<<<<<<<<<<<<
789  *     u"Dictionary-like namespace registry"
790  *     cdef object _ns_uri
791  */
792
793 struct __pyx_obj_4lxml_5etree__NamespaceRegistry {
794   PyObject_HEAD
795   struct __pyx_vtabstruct_4lxml_5etree__NamespaceRegistry *__pyx_vtab;
796   PyObject *_ns_uri;
797   PyObject *_ns_uri_utf;
798   PyObject *_entries;
799   char *_c_ns_uri_utf;
800 };
801
802 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":186
803  *         return registry
804  * 
805  * cdef class _FunctionNamespaceRegistry(_NamespaceRegistry):             # <<<<<<<<<<<<<<
806  *     def __setitem__(self, name, item):
807  *         if not callable(item):
808  */
809
810 struct __pyx_obj_4lxml_5etree__FunctionNamespaceRegistry {
811   struct __pyx_obj_4lxml_5etree__NamespaceRegistry __pyx_base;
812 };
813
814 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":199
815  *         return u"FunctionNamespace(%r)" % self._ns_uri
816  * 
817  * cdef class _XPathFunctionNamespaceRegistry(_FunctionNamespaceRegistry):             # <<<<<<<<<<<<<<
818  *     cdef object _prefix
819  *     cdef object _prefix_utf
820  */
821
822 struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry {
823   struct __pyx_obj_4lxml_5etree__FunctionNamespaceRegistry __pyx_base;
824   PyObject *_prefix;
825   PyObject *_prefix_utf;
826 };
827
828 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":11
829  *     SAX_EVENT_COMMENT = 32
830  * 
831  * cdef class _SaxParserTarget:             # <<<<<<<<<<<<<<
832  *     cdef int _sax_event_filter
833  *     cdef int _sax_event_propagate
834  */
835
836 struct __pyx_obj_4lxml_5etree__SaxParserTarget {
837   PyObject_HEAD
838   struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *__pyx_vtab;
839   int _sax_event_filter;
840   int _sax_event_propagate;
841 };
842
843 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":105
844  *             return ErrorLevels._getName(self.level, u"unknown")
845  * 
846  * cdef class _BaseErrorLog:             # <<<<<<<<<<<<<<
847  *     cdef _LogEntry _first_error
848  *     cdef readonly object last_error
849  */
850
851 struct __pyx_obj_4lxml_5etree__BaseErrorLog {
852   PyObject_HEAD
853   struct __pyx_vtabstruct_4lxml_5etree__BaseErrorLog *__pyx_vtab;
854   struct __pyx_obj_4lxml_5etree__LogEntry *_first_error;
855   PyObject *last_error;
856 };
857
858 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2097
859  * 
860  * 
861  * cdef public class _ElementTagMatcher [ object LxmlElementTagMatcher,             # <<<<<<<<<<<<<<
862  *                                        type LxmlElementTagMatcherType ]:
863  *     cdef object _pystrings
864  */
865
866 struct LxmlElementTagMatcher {
867   PyObject_HEAD
868   struct __pyx_vtabstruct_4lxml_5etree__ElementTagMatcher *__pyx_vtab;
869   PyObject *_pystrings;
870   int _node_type;
871   char *_href;
872   char *_name;
873 };
874
875 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":327
876  * 
877  * 
878  * cdef class XSLT:             # <<<<<<<<<<<<<<
879  *     u"""XSLT(self, xslt_input, extensions=None, regexp=True, access_control=None)
880  * 
881  */
882
883 struct __pyx_obj_4lxml_5etree_XSLT {
884   PyObject_HEAD
885   struct __pyx_vtabstruct_4lxml_5etree_XSLT *__pyx_vtab;
886   struct __pyx_obj_4lxml_5etree__XSLTContext *_context;
887   xsltStylesheet *_c_style;
888   struct __pyx_obj_4lxml_5etree__XSLTResolverContext *_xslt_resolver_context;
889   struct __pyx_obj_4lxml_5etree_XSLTAccessControl *_access_control;
890   struct __pyx_obj_4lxml_5etree__ErrorLog *_error_log;
891 };
892
893 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2203
894  *         self._storeNext(node)
895  * 
896  * cdef class ElementDepthFirstIterator(_ElementTagMatcher):             # <<<<<<<<<<<<<<
897  *     u"""ElementDepthFirstIterator(self, node, tag=None, inclusive=True)
898  *     Iterates over an element and its sub-elements in document order (depth
899  */
900
901 struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator {
902   struct LxmlElementTagMatcher __pyx_base;
903   struct LxmlElement *_next_node;
904   struct LxmlElement *_top_node;
905 };
906
907 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":101
908  *         return doc_ref
909  * 
910  * cdef class _ResolverRegistry:             # <<<<<<<<<<<<<<
911  *     cdef object _resolvers
912  *     cdef Resolver _default_resolver
913  */
914
915 struct __pyx_obj_4lxml_5etree__ResolverRegistry {
916   PyObject_HEAD
917   struct __pyx_vtabstruct_4lxml_5etree__ResolverRegistry *__pyx_vtab;
918   PyObject *_resolvers;
919   struct __pyx_obj_4lxml_5etree_Resolver *_default_resolver;
920 };
921
922 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":332
923  * ############################################################
924  * 
925  * cdef class TreeBuilder(_SaxParserTarget):             # <<<<<<<<<<<<<<
926  *     u"""TreeBuilder(self, element_factory=None, parser=None)
927  *     Parser target that builds a tree.
928  */
929
930 struct __pyx_obj_4lxml_5etree_TreeBuilder {
931   struct __pyx_obj_4lxml_5etree__SaxParserTarget __pyx_base;
932   struct __pyx_obj_4lxml_5etree__BaseParser *_parser;
933   PyObject *_factory;
934   PyObject *_data;
935   PyObject *_element_stack;
936   PyObject *_element_stack_pop;
937   struct LxmlElement *_last;
938   int _in_tail;
939 };
940
941 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":102
942  *     _XPATH_VERSION_WARNING_REQUIRED = 0
943  * 
944  * cdef class _XPathEvaluatorBase:             # <<<<<<<<<<<<<<
945  *     cdef xpath.xmlXPathContext* _xpathCtxt
946  *     cdef _XPathContext _context
947  */
948
949 struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase {
950   PyObject_HEAD
951   struct __pyx_vtabstruct_4lxml_5etree__XPathEvaluatorBase *__pyx_vtab;
952   xmlXPathContext *_xpathCtxt;
953   struct __pyx_obj_4lxml_5etree__XPathContext *_context;
954   PyThread_type_lock _eval_lock;
955   struct __pyx_obj_4lxml_5etree__ErrorLog *_error_log;
956 };
957
958 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":224
959  * 
960  * 
961  * cdef class XPathElementEvaluator(_XPathEvaluatorBase):             # <<<<<<<<<<<<<<
962  *     u"""XPathElementEvaluator(self, element, namespaces=None, extensions=None, regexp=True, smart_strings=True)
963  *     Create an XPath evaluator for an element.
964  */
965
966 struct __pyx_obj_4lxml_5etree_XPathElementEvaluator {
967   struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase __pyx_base;
968   struct LxmlElement *_element;
969 };
970
971 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":299
972  * 
973  * 
974  * cdef class XPathDocumentEvaluator(XPathElementEvaluator):             # <<<<<<<<<<<<<<
975  *     u"""XPathDocumentEvaluator(self, etree, namespaces=None, extensions=None, regexp=True, smart_strings=True)
976  *     Create an XPath evaluator for an ElementTree.
977  */
978
979 struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator {
980   struct __pyx_obj_4lxml_5etree_XPathElementEvaluator __pyx_base;
981 };
982
983 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":235
984  * # forward declarations
985  * cdef public class _Document [ type LxmlDocumentType, object LxmlDocument ]
986  * cdef public class _Element [ type LxmlElementType, object LxmlElement ]             # <<<<<<<<<<<<<<
987  * cdef class _BaseParser
988  * cdef class QName
989  */
990
991 struct LxmlElement {
992   PyObject_HEAD
993   PyObject *_gc_doc;
994   struct LxmlDocument *_doc;
995   xmlNode *_c_node;
996   PyObject *_tag;
997   PyObject *_attrib;
998 };
999
1000 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1349
1001  * 
1002  * 
1003  * cdef class __ContentOnlyElement(_Element):             # <<<<<<<<<<<<<<
1004  *     cdef int _raiseImmutable(self) except -1:
1005  *         raise TypeError, u"this element does not have children or attributes"
1006  */
1007
1008 struct __pyx_obj_4lxml_5etree___ContentOnlyElement {
1009   struct LxmlElement __pyx_base;
1010   struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement *__pyx_vtab;
1011 };
1012
1013 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1418
1014  *         return []
1015  * 
1016  * cdef class _Comment(__ContentOnlyElement):             # <<<<<<<<<<<<<<
1017  *     property tag:
1018  *         def __get__(self):
1019  */
1020
1021 struct __pyx_obj_4lxml_5etree__Comment {
1022   struct __pyx_obj_4lxml_5etree___ContentOnlyElement __pyx_base;
1023 };
1024
1025 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":379
1026  * 
1027  * 
1028  * cdef class XPath(_XPathEvaluatorBase):             # <<<<<<<<<<<<<<
1029  *     u"""XPath(self, path, namespaces=None, extensions=None, regexp=True, smart_strings=True)
1030  *     A compiled XPath expression that can be called on Elements and ElementTrees.
1031  */
1032
1033 struct __pyx_obj_4lxml_5etree_XPath {
1034   struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase __pyx_base;
1035   xmlXPathCompExpr *_xpath;
1036   PyObject *path;
1037 };
1038
1039 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":451
1040  * _find_namespaces = re.compile('({[^}]+})').findall
1041  * 
1042  * cdef class ETXPath(XPath):             # <<<<<<<<<<<<<<
1043  *     u"""ETXPath(self, path, extensions=None, regexp=True)
1044  *     Special XPath class that supports the ElementTree {uri} notation for namespaces.
1045  */
1046
1047 struct __pyx_obj_4lxml_5etree_ETXPath {
1048   struct __pyx_obj_4lxml_5etree_XPath __pyx_base;
1049 };
1050
1051 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":148
1052  * 
1053  * # class to store element class lookup functions
1054  * cdef public class ElementClassLookup [ type LxmlElementClassLookupType,             # <<<<<<<<<<<<<<
1055  *                                        object LxmlElementClassLookup ]:
1056  *     u"""ElementClassLookup(self)
1057  */
1058
1059 struct LxmlElementClassLookup {
1060   PyObject_HEAD
1061   _element_class_lookup_function _lookup_function;
1062 };
1063
1064 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":157
1065  *         self._lookup_function = NULL # use default lookup
1066  * 
1067  * cdef public class FallbackElementClassLookup(ElementClassLookup) \             # <<<<<<<<<<<<<<
1068  *          [ type LxmlFallbackElementClassLookupType,
1069  *            object LxmlFallbackElementClassLookup ]:
1070  */
1071
1072 struct LxmlFallbackElementClassLookup {
1073   struct LxmlElementClassLookup __pyx_base;
1074   struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup *__pyx_vtab;
1075   struct LxmlElementClassLookup *fallback;
1076   _element_class_lookup_function _fallback_function;
1077 };
1078
1079 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":347
1080  * #  custom class lookup based on node type, namespace, name
1081  * 
1082  * cdef class CustomElementClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<<
1083  *     u"""CustomElementClassLookup(self, fallback=None)
1084  *     Element class lookup based on a subclass method.
1085  */
1086
1087 struct __pyx_obj_4lxml_5etree_CustomElementClassLookup {
1088   struct LxmlFallbackElementClassLookup __pyx_base;
1089 };
1090
1091 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":3
1092  * # read-only tree implementation
1093  * 
1094  * cdef class _ReadOnlyElementProxy:             # <<<<<<<<<<<<<<
1095  *     u"The main read-only Element proxy class (for internal use only!)."
1096  *     cdef bint _free_after_use
1097  */
1098
1099 struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy {
1100   PyObject_HEAD
1101   struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *__pyx_vtab;
1102   int _free_after_use;
1103   xmlNode *_c_node;
1104   PyObject *_source_proxy;
1105   PyObject *_dependent_proxies;
1106 };
1107
1108 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":99
1109  *                 raise TypeError, "Invalid child type: %r" % type(child)
1110  * 
1111  * cdef class CommentBase(_Comment):             # <<<<<<<<<<<<<<
1112  *     u"""All custom Comment classes must inherit from this one.
1113  * 
1114  */
1115
1116 struct __pyx_obj_4lxml_5etree_CommentBase {
1117   struct __pyx_obj_4lxml_5etree__Comment __pyx_base;
1118 };
1119
1120 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":318
1121  * 
1122  * 
1123  * cdef class _XSLTQuotedStringParam:             # <<<<<<<<<<<<<<
1124  *     u"""A wrapper class for literal XSLT string parameters that require
1125  *     quote escaping.
1126  */
1127
1128 struct __pyx_obj_4lxml_5etree__XSLTQuotedStringParam {
1129   PyObject_HEAD
1130   PyObject *strval;
1131 };
1132
1133 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":31
1134  * # Base class for XSLT and XPath evaluation contexts: functions, namespaces, ...
1135  * 
1136  * cdef class _BaseContext:             # <<<<<<<<<<<<<<
1137  *     cdef xpath.xmlXPathContext* _xpathCtxt
1138  *     cdef _Document _doc
1139  */
1140
1141 struct __pyx_obj_4lxml_5etree__BaseContext {
1142   PyObject_HEAD
1143   struct __pyx_vtabstruct_4lxml_5etree__BaseContext *__pyx_vtab;
1144   xmlXPathContext *_xpathCtxt;
1145   struct LxmlDocument *_doc;
1146   PyObject *_extensions;
1147   PyObject *_namespaces;
1148   PyObject *_global_namespaces;
1149   PyObject *_utf_refs;
1150   PyObject *_function_cache;
1151   PyObject *_eval_context_dict;
1152   int _build_smart_strings;
1153   struct __pyx_obj_4lxml_5etree__TempStore *_temp_refs;
1154   struct __pyx_obj_4lxml_5etree__ExceptionContext *_exc;
1155 };
1156
1157 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":270
1158  * cdef dict EMPTY_DICT = {}
1159  * 
1160  * cdef class _XSLTContext(_BaseContext):             # <<<<<<<<<<<<<<
1161  *     cdef xslt.xsltTransformContext* _xsltCtxt
1162  *     cdef _ReadOnlyElementProxy _extension_element_proxy
1163  */
1164
1165 struct __pyx_obj_4lxml_5etree__XSLTContext {
1166   struct __pyx_obj_4lxml_5etree__BaseContext __pyx_base;
1167   xsltTransformContext *_xsltCtxt;
1168   struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *_extension_element_proxy;
1169   PyObject *_extension_elements;
1170 };
1171
1172 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":3
1173  * # XSLT extension elements
1174  * 
1175  * cdef class XSLTExtension:             # <<<<<<<<<<<<<<
1176  *     u"""Base class of an XSLT extension element.
1177  *     """
1178  */
1179
1180 struct __pyx_obj_4lxml_5etree_XSLTExtension {
1181   PyObject_HEAD
1182 };
1183
1184 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":208
1185  * 
1186  * # class for temporarily storing exceptions raised in extensions
1187  * cdef class _ExceptionContext:             # <<<<<<<<<<<<<<
1188  *     cdef object _exc_info
1189  *     cdef void clear(self):
1190  */
1191
1192 struct __pyx_obj_4lxml_5etree__ExceptionContext {
1193   PyObject_HEAD
1194   struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *__pyx_vtab;
1195   PyObject *_exc_info;
1196 };
1197
1198 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":148
1199  *         return repr(self._resolvers)
1200  * 
1201  * cdef class _ResolverContext(_ExceptionContext):             # <<<<<<<<<<<<<<
1202  *     cdef _ResolverRegistry _resolvers
1203  *     cdef _TempStore _storage
1204  */
1205
1206 struct __pyx_obj_4lxml_5etree__ResolverContext {
1207   struct __pyx_obj_4lxml_5etree__ExceptionContext __pyx_base;
1208   struct __pyx_obj_4lxml_5etree__ResolverRegistry *_resolvers;
1209   struct __pyx_obj_4lxml_5etree__TempStore *_storage;
1210 };
1211
1212 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":6
1213  * cimport htmlparser
1214  * 
1215  * cdef class _ParserContext(_ResolverContext)             # <<<<<<<<<<<<<<
1216  * cdef class _SaxParserContext(_ParserContext)
1217  * cdef class _TargetParserContext(_SaxParserContext)
1218  */
1219
1220 struct __pyx_obj_4lxml_5etree__ParserContext {
1221   struct __pyx_obj_4lxml_5etree__ResolverContext __pyx_base;
1222   struct __pyx_obj_4lxml_5etree__ErrorLog *_error_log;
1223   struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *_validator;
1224   xmlParserCtxt *_c_ctxt;
1225   PyThread_type_lock _lock;
1226 };
1227
1228 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":7
1229  * 
1230  * cdef class _ParserContext(_ResolverContext)
1231  * cdef class _SaxParserContext(_ParserContext)             # <<<<<<<<<<<<<<
1232  * cdef class _TargetParserContext(_SaxParserContext)
1233  * cdef class _ParserSchemaValidationContext
1234  */
1235
1236 struct __pyx_obj_4lxml_5etree__SaxParserContext {
1237   struct __pyx_obj_4lxml_5etree__ParserContext __pyx_base;
1238   struct __pyx_obj_4lxml_5etree__SaxParserTarget *_target;
1239   startElementNsSAX2Func _origSaxStart;
1240   endElementNsSAX2Func _origSaxEnd;
1241   startElementSAXFunc _origSaxStartNoNs;
1242   endElementSAXFunc _origSaxEndNoNs;
1243   charactersSAXFunc _origSaxData;
1244   cdataBlockSAXFunc _origSaxCData;
1245   internalSubsetSAXFunc _origSaxDoctype;
1246   commentSAXFunc _origSaxComment;
1247   processingInstructionSAXFunc _origSaxPi;
1248 };
1249
1250 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":8
1251  * cdef class _ParserContext(_ResolverContext)
1252  * cdef class _SaxParserContext(_ParserContext)
1253  * cdef class _TargetParserContext(_SaxParserContext)             # <<<<<<<<<<<<<<
1254  * cdef class _ParserSchemaValidationContext
1255  * cdef class _Validator
1256  */
1257
1258 struct __pyx_obj_4lxml_5etree__TargetParserContext {
1259   struct __pyx_obj_4lxml_5etree__SaxParserContext __pyx_base;
1260   PyObject *_python_target;
1261 };
1262
1263 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":15
1264  *     cdef object _file
1265  * 
1266  * cdef class Resolver:             # <<<<<<<<<<<<<<
1267  *     u"This is the base class of all resolvers."
1268  *     def resolve(self, system_url, public_id, context):
1269  */
1270
1271 struct __pyx_obj_4lxml_5etree_Resolver {
1272   PyObject_HEAD
1273 };
1274
1275 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1535
1276  * 
1277  * 
1278  * cdef public class _ElementTree [ type LxmlElementTreeType,             # <<<<<<<<<<<<<<
1279  *                                  object LxmlElementTree ]:
1280  *     cdef _Document _doc
1281  */
1282
1283 struct LxmlElementTree {
1284   PyObject_HEAD
1285   struct __pyx_vtabstruct_4lxml_5etree__ElementTree *__pyx_vtab;
1286   struct LxmlDocument *_doc;
1287   struct LxmlElement *_context_node;
1288 };
1289
1290 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":660
1291  *     return new_xslt
1292  * 
1293  * cdef class _XSLTResultTree(_ElementTree):             # <<<<<<<<<<<<<<
1294  *     cdef XSLT _xslt
1295  *     cdef _Document _profile
1296  */
1297
1298 struct __pyx_obj_4lxml_5etree__XSLTResultTree {
1299   struct LxmlElementTree __pyx_base;
1300   struct __pyx_obj_4lxml_5etree_XSLT *_xslt;
1301   struct LxmlDocument *_profile;
1302   char *_buffer;
1303   Py_ssize_t _buffer_len;
1304   Py_ssize_t _buffer_refcnt;
1305 };
1306
1307 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1448
1308  *             return u"<?%s?>" % self.target
1309  * 
1310  * cdef class _Entity(__ContentOnlyElement):             # <<<<<<<<<<<<<<
1311  *     property tag:
1312  *         def __get__(self):
1313  */
1314
1315 struct __pyx_obj_4lxml_5etree__Entity {
1316   struct __pyx_obj_4lxml_5etree___ContentOnlyElement __pyx_base;
1317 };
1318
1319 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":127
1320  *     """
1321  * 
1322  * cdef class EntityBase(_Entity):             # <<<<<<<<<<<<<<
1323  *     u"""All custom Entity classes must inherit from this one.
1324  * 
1325  */
1326
1327 struct __pyx_obj_4lxml_5etree_EntityBase {
1328   struct __pyx_obj_4lxml_5etree__Entity __pyx_base;
1329 };
1330
1331 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xinclude.pxi":10
1332  *     pass
1333  * 
1334  * cdef class XInclude:             # <<<<<<<<<<<<<<
1335  *     u"""XInclude(self)
1336  *     XInclude processor.
1337  */
1338
1339 struct __pyx_obj_4lxml_5etree_XInclude {
1340   PyObject_HEAD
1341   struct __pyx_obj_4lxml_5etree__ErrorLog *_error_log;
1342 };
1343
1344 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":234
1345  * 
1346  * # forward declarations
1347  * cdef public class _Document [ type LxmlDocumentType, object LxmlDocument ]             # <<<<<<<<<<<<<<
1348  * cdef public class _Element [ type LxmlElementType, object LxmlElement ]
1349  * cdef class _BaseParser
1350  */
1351
1352 struct LxmlDocument {
1353   PyObject_HEAD
1354   struct __pyx_vtabstruct_4lxml_5etree__Document *__pyx_vtab;
1355   int _ns_counter;
1356   PyObject *_prefix_tail;
1357   xmlDoc *_c_doc;
1358   struct __pyx_obj_4lxml_5etree__BaseParser *_parser;
1359 };
1360
1361 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":9
1362  *     PARSER_DATA_FILE
1363  * 
1364  * cdef class _InputDocument:             # <<<<<<<<<<<<<<
1365  *     cdef _InputDocumentDataType _type
1366  *     cdef object _data_bytes
1367  */
1368
1369 struct __pyx_obj_4lxml_5etree__InputDocument {
1370   PyObject_HEAD
1371   __pyx_t_4lxml_5etree__InputDocumentDataType _type;
1372   PyObject *_data_bytes;
1373   PyObject *_filename;
1374   PyObject *_file;
1375 };
1376
1377 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1426
1378  *         return u"<!--%s-->" % self.text
1379  * 
1380  * cdef class _ProcessingInstruction(__ContentOnlyElement):             # <<<<<<<<<<<<<<
1381  *     property tag:
1382  *         def __get__(self):
1383  */
1384
1385 struct __pyx_obj_4lxml_5etree__ProcessingInstruction {
1386   struct __pyx_obj_4lxml_5etree___ContentOnlyElement __pyx_base;
1387 };
1388
1389 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":113
1390  *     """
1391  * 
1392  * cdef class PIBase(_ProcessingInstruction):             # <<<<<<<<<<<<<<
1393  *     u"""All custom Processing Instruction classes must inherit from this one.
1394  * 
1395  */
1396
1397 struct __pyx_obj_4lxml_5etree_PIBase {
1398   struct __pyx_obj_4lxml_5etree__ProcessingInstruction __pyx_base;
1399 };
1400
1401 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":814
1402  *     return __findStylesheetByID(doc, id=id)
1403  * 
1404  * cdef class _XSLTProcessingInstruction(PIBase):             # <<<<<<<<<<<<<<
1405  *     def parseXSL(self, parser=None):
1406  *         u"""Try to parse the stylesheet referenced by this PI and return an
1407  */
1408
1409 struct __pyx_obj_4lxml_5etree__XSLTProcessingInstruction {
1410   struct __pyx_obj_4lxml_5etree_PIBase __pyx_base;
1411 };
1412
1413 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":330
1414  * #  per-parser lookup scheme
1415  * 
1416  * cdef class ParserBasedElementClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<<
1417  *     u"""ParserBasedElementClassLookup(self, fallback=None)
1418  *     Element class lookup based on the XML parser.
1419  */
1420
1421 struct __pyx_obj_4lxml_5etree_ParserBasedElementClassLookup {
1422   struct LxmlFallbackElementClassLookup __pyx_base;
1423 };
1424
1425 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":10
1426  * cdef class _TargetParserContext(_SaxParserContext)
1427  * cdef class _ParserSchemaValidationContext
1428  * cdef class _Validator             # <<<<<<<<<<<<<<
1429  * cdef class XMLSchema(_Validator)
1430  * 
1431  */
1432
1433 struct __pyx_obj_4lxml_5etree__Validator {
1434   PyObject_HEAD
1435   struct __pyx_obj_4lxml_5etree__ErrorLog *_error_log;
1436 };
1437
1438 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":22
1439  * # RelaxNG
1440  * 
1441  * cdef class RelaxNG(_Validator):             # <<<<<<<<<<<<<<
1442  *     u"""RelaxNG(self, etree=None, file=None)
1443  *     Turn a document into a Relax NG validator.
1444  */
1445
1446 struct __pyx_obj_4lxml_5etree_RelaxNG {
1447   struct __pyx_obj_4lxml_5etree__Validator __pyx_base;
1448   xmlRelaxNG *_c_schema;
1449 };
1450
1451 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":41
1452  * # Logging classes
1453  * 
1454  * cdef class _LogEntry:             # <<<<<<<<<<<<<<
1455  *     cdef readonly object domain
1456  *     cdef readonly object type
1457  */
1458
1459 struct __pyx_obj_4lxml_5etree__LogEntry {
1460   PyObject_HEAD
1461   struct __pyx_vtabstruct_4lxml_5etree__LogEntry *__pyx_vtab;
1462   PyObject *domain;
1463   PyObject *type;
1464   PyObject *level;
1465   PyObject *line;
1466   PyObject *column;
1467   PyObject *message;
1468   PyObject *filename;
1469 };
1470
1471 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":259
1472  * ############################################################
1473  * 
1474  * cdef class _FileReaderContext:             # <<<<<<<<<<<<<<
1475  *     cdef object _filelike
1476  *     cdef object _encoding
1477  */
1478
1479 struct __pyx_obj_4lxml_5etree__FileReaderContext {
1480   PyObject_HEAD
1481   struct __pyx_vtabstruct_4lxml_5etree__FileReaderContext *__pyx_vtab;
1482   PyObject *_filelike;
1483   PyObject *_encoding;
1484   PyObject *_url;
1485   PyObject *_bytes;
1486   struct __pyx_obj_4lxml_5etree__ExceptionContext *_exc_context;
1487   Py_ssize_t _bytes_read;
1488   char *_c_url;
1489 };
1490
1491 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":13
1492  *         self.result = result
1493  * 
1494  * cdef class _PythonSaxParserTarget(_SaxParserTarget):             # <<<<<<<<<<<<<<
1495  *     cdef object _target_start
1496  *     cdef object _target_end
1497  */
1498
1499 struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget {
1500   struct __pyx_obj_4lxml_5etree__SaxParserTarget __pyx_base;
1501   PyObject *_target_start;
1502   PyObject *_target_end;
1503   PyObject *_target_data;
1504   PyObject *_target_doctype;
1505   PyObject *_target_pi;
1506   PyObject *_target_comment;
1507   int _start_takes_nsmap;
1508 };
1509
1510 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2390
1511  * PI = ProcessingInstruction
1512  * 
1513  * cdef class CDATA:             # <<<<<<<<<<<<<<
1514  *     u"""CDATA(data)
1515  * 
1516  */
1517
1518 struct __pyx_obj_4lxml_5etree_CDATA {
1519   PyObject_HEAD
1520   PyObject *_utf8_data;
1521 };
1522
1523 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":62
1524  *     return count
1525  * 
1526  * cdef class _IterparseContext(_ParserContext):             # <<<<<<<<<<<<<<
1527  *     cdef xmlparser.startElementNsSAX2Func _origSaxStart
1528  *     cdef xmlparser.endElementNsSAX2Func   _origSaxEnd
1529  */
1530
1531 struct __pyx_obj_4lxml_5etree__IterparseContext {
1532   struct __pyx_obj_4lxml_5etree__ParserContext __pyx_base;
1533   startElementNsSAX2Func _origSaxStart;
1534   endElementNsSAX2Func _origSaxEnd;
1535   startElementSAXFunc _origSaxStartNoNs;
1536   endElementSAXFunc _origSaxEndNoNs;
1537   commentSAXFunc _origSaxComment;
1538   processingInstructionSAXFunc _origSaxPI;
1539   struct LxmlElement *_root;
1540   struct LxmlDocument *_doc;
1541   int _event_filter;
1542   PyObject *_events;
1543   int _event_index;
1544   PyObject *_ns_stack;
1545   PyObject *_pop_ns;
1546   PyObject *_node_stack;
1547   PyObject *_pop_node;
1548   PyObject *_tag_tuple;
1549   char *_tag_href;
1550   char *_tag_name;
1551 };
1552
1553 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":192
1554  *         return message
1555  * 
1556  * cdef class _ListErrorLog(_BaseErrorLog):             # <<<<<<<<<<<<<<
1557  *     u"Immutable base version of a list based error log."
1558  *     cdef list _entries
1559  */
1560
1561 struct __pyx_obj_4lxml_5etree__ListErrorLog {
1562   struct __pyx_obj_4lxml_5etree__BaseErrorLog __pyx_base;
1563   PyObject *_entries;
1564 };
1565
1566 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":312
1567  *         return self.filter_from_level(ErrorLevels.WARNING)
1568  * 
1569  * cdef class _ErrorLog(_ListErrorLog):             # <<<<<<<<<<<<<<
1570  *     def __init__(self):
1571  *         _ListErrorLog.__init__(self, [], None, None)
1572  */
1573
1574 struct __pyx_obj_4lxml_5etree__ErrorLog {
1575   struct __pyx_obj_4lxml_5etree__ListErrorLog __pyx_base;
1576 };
1577
1578 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":50
1579  * 
1580  * 
1581  * cdef class _XPathContext(_BaseContext):             # <<<<<<<<<<<<<<
1582  *     cdef object _variables
1583  *     def __init__(self, namespaces, extensions, enable_regexp, variables,
1584  */
1585
1586 struct __pyx_obj_4lxml_5etree__XPathContext {
1587   struct __pyx_obj_4lxml_5etree__BaseContext __pyx_base;
1588   PyObject *_variables;
1589 };
1590
1591 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2281
1592  *         return NULL
1593  * 
1594  * cdef class ElementTextIterator:             # <<<<<<<<<<<<<<
1595  *     u"""ElementTextIterator(self, element, tag=None, with_tail=True)
1596  *     Iterates over the text content of a subtree.
1597  */
1598
1599 struct __pyx_obj_4lxml_5etree_ElementTextIterator {
1600   PyObject_HEAD
1601   PyObject *_nextEvent;
1602   struct LxmlElement *_start_element;
1603 };
1604
1605 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2125
1606  *                 self._name = NULL
1607  * 
1608  * cdef public class _ElementIterator(_ElementTagMatcher) [             # <<<<<<<<<<<<<<
1609  *     object LxmlElementIterator, type LxmlElementIteratorType ]:
1610  *     # we keep Python references here to control GC
1611  */
1612
1613 struct LxmlElementIterator {
1614   struct LxmlElementTagMatcher __pyx_base;
1615   struct LxmlElement *_node;
1616   _node_to_node_function _next_element;
1617 };
1618
1619 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":6
1620  * # Custom Element classes
1621  * 
1622  * cdef public class ElementBase(_Element) [ type LxmlElementBaseType,             # <<<<<<<<<<<<<<
1623  *                                           object LxmlElementBase ]:
1624  *     u"""ElementBase(*children, attrib=None, nsmap=None, **_extra)
1625  */
1626
1627 struct LxmlElementBase {
1628   struct LxmlElement __pyx_base;
1629 };
1630
1631 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":362
1632  *         self._entries.append(entry)
1633  * 
1634  * cdef class PyErrorLog(_BaseErrorLog):             # <<<<<<<<<<<<<<
1635  *     u"""PyErrorLog(self, logger_name=None)
1636  *     A global error log that connects to the Python stdlib logging package.
1637  */
1638
1639 struct __pyx_obj_4lxml_5etree_PyErrorLog {
1640   struct __pyx_obj_4lxml_5etree__BaseErrorLog __pyx_base;
1641   PyObject *level_map;
1642   PyObject *_map_level;
1643   PyObject *_log;
1644 };
1645
1646 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":22
1647  * # DTD
1648  * 
1649  * cdef class DTD(_Validator):             # <<<<<<<<<<<<<<
1650  *     u"""DTD(self, file=None, external_id=None)
1651  *     A DTD validator.
1652  */
1653
1654 struct __pyx_obj_4lxml_5etree_DTD {
1655   struct __pyx_obj_4lxml_5etree__Validator __pyx_base;
1656   xmlDtd *_c_dtd;
1657 };
1658
1659 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":311
1660  *         return c_ctxt.node.next
1661  * 
1662  * cdef class iterparse(_BaseParser):             # <<<<<<<<<<<<<<
1663  *     u"""iterparse(self, source, events=("end",), tag=None, attribute_defaults=False, dtd_validation=False, load_dtd=False, no_network=True, remove_blank_text=False, remove_comments=False, remove_pis=False, encoding=None, html=False, huge_tree=False, schema=None)
1664  * 
1665  */
1666
1667 struct __pyx_obj_4lxml_5etree_iterparse {
1668   struct __pyx_obj_4lxml_5etree__BaseParser __pyx_base;
1669   PyObject *_tag;
1670   PyObject *_events;
1671   PyObject *root;
1672   PyObject *_source;
1673   PyObject *_buffer;
1674   int (*_parse_chunk)(xmlParserCtxt *, char *, int, int);
1675 };
1676
1677 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":50
1678  * # XSLT document loaders
1679  * 
1680  * cdef class _XSLTResolverContext(_ResolverContext):             # <<<<<<<<<<<<<<
1681  *     cdef xmlDoc* _c_style_doc
1682  *     cdef _BaseParser _parser
1683  */
1684
1685 struct __pyx_obj_4lxml_5etree__XSLTResolverContext {
1686   struct __pyx_obj_4lxml_5etree__ResolverContext __pyx_base;
1687   xmlDoc *_c_style_doc;
1688   struct __pyx_obj_4lxml_5etree__BaseParser *_parser;
1689 };
1690
1691 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":40
1692  *     pass
1693  * 
1694  * cdef class _ParserDictionaryContext:             # <<<<<<<<<<<<<<
1695  *     # Global parser context to share the string dictionary.
1696  *     #
1697  */
1698
1699 struct __pyx_obj_4lxml_5etree__ParserDictionaryContext {
1700   PyObject_HEAD
1701   struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *__pyx_vtab;
1702   xmlDict *_c_dict;
1703   struct __pyx_obj_4lxml_5etree__BaseParser *_default_parser;
1704   PyObject *_implied_parser_contexts;
1705 };
1706
1707 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":527
1708  * 
1709  * 
1710  * cdef class iterwalk:             # <<<<<<<<<<<<<<
1711  *     u"""iterwalk(self, element_or_tree, events=("end",), tag=None)
1712  * 
1713  */
1714
1715 struct __pyx_obj_4lxml_5etree_iterwalk {
1716   PyObject_HEAD
1717   struct __pyx_vtabstruct_4lxml_5etree_iterwalk *__pyx_vtab;
1718   PyObject *_node_stack;
1719   PyObject *_pop_node;
1720   int _index;
1721   PyObject *_events;
1722   PyObject *_pop_event;
1723   int _event_filter;
1724   PyObject *_tag_tuple;
1725   char *_tag_href;
1726   char *_tag_name;
1727 };
1728
1729 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":342
1730  *         self._entries.append(entry)
1731  * 
1732  * cdef class _DomainErrorLog(_ErrorLog):             # <<<<<<<<<<<<<<
1733  *     def __init__(self, domains):
1734  *         _ErrorLog.__init__(self)
1735  */
1736
1737 struct __pyx_obj_4lxml_5etree__DomainErrorLog {
1738   struct __pyx_obj_4lxml_5etree__ErrorLog __pyx_base;
1739 };
1740
1741 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":280
1742  * # attribute based lookup scheme
1743  * 
1744  * cdef class AttributeBasedElementClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<<
1745  *     u"""AttributeBasedElementClassLookup(self, attribute_name, class_mapping, fallback=None)
1746  *     Checks an attribute of an Element and looks up the value in a
1747  */
1748
1749 struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup {
1750   struct LxmlFallbackElementClassLookup __pyx_base;
1751   PyObject *_class_mapping;
1752   PyObject *_pytag;
1753   char *_c_ns;
1754   char *_c_name;
1755 };
1756
1757 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":410
1758  * 
1759  * 
1760  * cdef class DocInfo:             # <<<<<<<<<<<<<<
1761  *     u"Document information provided by parser and DTD."
1762  *     cdef _Document _doc
1763  */
1764
1765 struct __pyx_obj_4lxml_5etree_DocInfo {
1766   PyObject_HEAD
1767   struct LxmlDocument *_doc;
1768 };
1769
1770 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":11
1771  * cdef class _ParserSchemaValidationContext
1772  * cdef class _Validator
1773  * cdef class XMLSchema(_Validator)             # <<<<<<<<<<<<<<
1774  * 
1775  * class ParseError(LxmlSyntaxError):
1776  */
1777
1778 struct __pyx_obj_4lxml_5etree_XMLSchema {
1779   struct __pyx_obj_4lxml_5etree__Validator __pyx_base;
1780   struct __pyx_vtabstruct_4lxml_5etree_XMLSchema *__pyx_vtab;
1781   xmlSchema *_c_schema;
1782   int _has_default_attributes;
1783   int _add_attribute_defaults;
1784 };
1785
1786 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2194
1787  *         self._storeNext(node)
1788  * 
1789  * cdef class AncestorsIterator(_ElementIterator):             # <<<<<<<<<<<<<<
1790  *     u"""AncestorsIterator(self, node, tag=None)
1791  *     Iterates over the ancestors of an element (from parent to parent).
1792  */
1793
1794 struct __pyx_obj_4lxml_5etree_AncestorsIterator {
1795   struct LxmlElementIterator __pyx_base;
1796 };
1797
1798 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":58
1799  *     return (_elementTreeFactory(doc, None), _IDDict(doc))
1800  * 
1801  * cdef class _IDDict:             # <<<<<<<<<<<<<<
1802  *     u"""IDDict(self, etree)
1803  *     A dictionary-like proxy class that mapps ID attributes to elements.
1804  */
1805
1806 struct __pyx_obj_4lxml_5etree__IDDict {
1807   PyObject_HEAD
1808   struct __pyx_vtabstruct_4lxml_5etree__IDDict *__pyx_vtab;
1809   struct LxmlDocument *_doc;
1810   PyObject *_keys;
1811   PyObject *_items;
1812 };
1813
1814 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":95
1815  * 
1816  * 
1817  * cdef class ElementNamespaceClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<<
1818  *     u"""ElementNamespaceClassLookup(self, fallback=None)
1819  * 
1820  */
1821
1822 struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup {
1823   struct LxmlFallbackElementClassLookup __pyx_base;
1824   PyObject *_namespace_registries;
1825 };
1826
1827 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":279
1828  *     del sourceProxy._dependent_proxies[:]
1829  * 
1830  * cdef class _AppendOnlyElementProxy(_ReadOnlyElementProxy):             # <<<<<<<<<<<<<<
1831  *     u"""A read-only element that allows adding children and changing the
1832  *     text content (i.e. everything that adds to the subtree).
1833  */
1834
1835 struct __pyx_obj_4lxml_5etree__AppendOnlyElementProxy {
1836   struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy __pyx_base;
1837 };
1838
1839 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1936
1840  * 
1841  * 
1842  * cdef class _Attrib:             # <<<<<<<<<<<<<<
1843  *     u"""A dict-like proxy for the ``Element.attrib`` property.
1844  *     """
1845  */
1846
1847 struct __pyx_obj_4lxml_5etree__Attrib {
1848   PyObject_HEAD
1849   struct LxmlElement *_element;
1850 };
1851
1852 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":199
1853  * # default lookup scheme
1854  * 
1855  * cdef class ElementDefaultClassLookup(ElementClassLookup):             # <<<<<<<<<<<<<<
1856  *     u"""ElementDefaultClassLookup(self, element=None, comment=None, pi=None, entity=None)
1857  *     Element class lookup scheme that always returns the default Element
1858  */
1859
1860 struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup {
1861   struct LxmlElementClassLookup __pyx_base;
1862   PyObject *element_class;
1863   PyObject *comment_class;
1864   PyObject *pi_class;
1865   PyObject *entity_class;
1866 };
1867
1868 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":590
1869  * # special str/unicode subclasses
1870  * 
1871  * cdef class _ElementUnicodeResult(python.unicode):             # <<<<<<<<<<<<<<
1872  *     cdef _Element _parent
1873  *     cdef readonly object is_tail
1874  */
1875
1876 struct __pyx_obj_4lxml_5etree__ElementUnicodeResult {
1877   PyUnicodeObject __pyx_base;
1878   struct LxmlElement *_parent;
1879   PyObject *is_tail;
1880   PyObject *is_text;
1881   PyObject *is_attribute;
1882 };
1883
1884 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":26
1885  * 
1886  * ctypedef int (*_register_function)(void* ctxt, name_utf, ns_uri_utf)
1887  * cdef class _ExsltRegExp             # <<<<<<<<<<<<<<
1888  * 
1889  * ################################################################################
1890  */
1891
1892 struct __pyx_obj_4lxml_5etree__ExsltRegExp {
1893   PyObject_HEAD
1894   struct __pyx_vtabstruct_4lxml_5etree__ExsltRegExp *__pyx_vtab;
1895   PyObject *_compile_map;
1896 };
1897
1898 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":237
1899  * cdef public class _Element [ type LxmlElementType, object LxmlElement ]
1900  * cdef class _BaseParser
1901  * cdef class QName             # <<<<<<<<<<<<<<
1902  * ctypedef public xmlNode* (*_node_to_node_function)(xmlNode*)
1903  * 
1904  */
1905
1906 struct __pyx_obj_4lxml_5etree_QName {
1907   PyObject_HEAD
1908   PyObject *text;
1909   PyObject *localname;
1910   PyObject *namespace;
1911 };
1912
1913 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":194
1914  * 
1915  * # class for temporary storage of Python references
1916  * cdef class _TempStore:             # <<<<<<<<<<<<<<
1917  *     cdef list _storage
1918  *     def __init__(self):
1919  */
1920
1921 struct __pyx_obj_4lxml_5etree__TempStore {
1922   PyObject_HEAD
1923   struct __pyx_vtabstruct_4lxml_5etree__TempStore *__pyx_vtab;
1924   PyObject *_storage;
1925 };
1926
1927 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":304
1928  * # output to file-like objects
1929  * 
1930  * cdef class _FilelikeWriter:             # <<<<<<<<<<<<<<
1931  *     cdef object _filelike
1932  *     cdef object _close_filelike
1933  */
1934
1935 struct __pyx_obj_4lxml_5etree__FilelikeWriter {
1936   PyObject_HEAD
1937   struct __pyx_vtabstruct_4lxml_5etree__FilelikeWriter *__pyx_vtab;
1938   PyObject *_filelike;
1939   PyObject *_close_filelike;
1940   struct __pyx_obj_4lxml_5etree__ExceptionContext *_exc_context;
1941   struct __pyx_obj_4lxml_5etree__ErrorLog *error_log;
1942 };
1943
1944 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":22
1945  * # Schematron
1946  * 
1947  * cdef class Schematron(_Validator):             # <<<<<<<<<<<<<<
1948  *     u"""Schematron(self, etree=None, file=None)
1949  *     A Schematron validator.
1950  */
1951
1952 struct __pyx_obj_4lxml_5etree_Schematron {
1953   struct __pyx_obj_4lxml_5etree__Validator __pyx_base;
1954   xmlSchematron *_c_schema;
1955   xmlDoc *_c_schema_doc;
1956 };
1957
1958 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":167
1959  * # XSLT file/network access control
1960  * 
1961  * cdef class XSLTAccessControl:             # <<<<<<<<<<<<<<
1962  *     u"""XSLTAccessControl(self, read_file=True, write_file=True, create_dir=True, read_network=True, write_network=True)
1963  * 
1964  */
1965
1966 struct __pyx_obj_4lxml_5etree_XSLTAccessControl {
1967   PyObject_HEAD
1968   struct __pyx_vtabstruct_4lxml_5etree_XSLTAccessControl *__pyx_vtab;
1969   xsltSecurityPrefs *_prefs;
1970 };
1971
1972 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2180
1973  *             self._node = _elementFactory(node._doc, c_node)
1974  * 
1975  * cdef class SiblingsIterator(_ElementIterator):             # <<<<<<<<<<<<<<
1976  *     u"""SiblingsIterator(self, node, tag=None, preceding=False)
1977  *     Iterates over the siblings of an element.
1978  */
1979
1980 struct __pyx_obj_4lxml_5etree_SiblingsIterator {
1981   struct LxmlElementIterator __pyx_base;
1982 };
1983
1984 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1343
1985  *     )
1986  * 
1987  * cdef class HTMLParser(_FeedParser):             # <<<<<<<<<<<<<<
1988  *     u"""HTMLParser(self, encoding=None, remove_blank_text=False, \
1989  *                    remove_comments=False, remove_pis=False, strip_cdata=True, \
1990  */
1991
1992 struct __pyx_obj_4lxml_5etree_HTMLParser {
1993   struct __pyx_obj_4lxml_5etree__FeedParser __pyx_base;
1994 };
1995
1996 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":81
1997  *         python.PyDict_Clear(self._entries)
1998  * 
1999  * cdef class _ClassNamespaceRegistry(_NamespaceRegistry):             # <<<<<<<<<<<<<<
2000  *     u"Dictionary-like registry for namespace implementation classes"
2001  *     def __setitem__(self, name, item):
2002  */
2003
2004 struct __pyx_obj_4lxml_5etree__ClassNamespaceRegistry {
2005   struct __pyx_obj_4lxml_5etree__NamespaceRegistry __pyx_base;
2006 };
2007
2008 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":9
2009  * cdef class _SaxParserContext(_ParserContext)
2010  * cdef class _TargetParserContext(_SaxParserContext)
2011  * cdef class _ParserSchemaValidationContext             # <<<<<<<<<<<<<<
2012  * cdef class _Validator
2013  * cdef class XMLSchema(_Validator)
2014  */
2015
2016 struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext {
2017   PyObject_HEAD
2018   struct __pyx_vtabstruct_4lxml_5etree__ParserSchemaValidationContext *__pyx_vtab;
2019   struct __pyx_obj_4lxml_5etree_XMLSchema *_schema;
2020   xmlSchemaValidCtxt *_valid_ctxt;
2021   xmlSchemaSAXPlugStruct *_sax_plug;
2022   int _add_default_attributes;
2023 };
2024
2025 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2056
2026  *         return python.PyObject_RichCompare(one, other, op)
2027  * 
2028  * cdef class _AttribIterator:             # <<<<<<<<<<<<<<
2029  *     u"""Attribute iterator - for internal use only!
2030  *     """
2031  */
2032
2033 struct __pyx_obj_4lxml_5etree__AttribIterator {
2034   PyObject_HEAD
2035   struct LxmlElement *_node;
2036   xmlAttr *_c_attr;
2037   int _keysvalues;
2038 };
2039
2040 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":405
2041  * # read-only tree based class lookup
2042  * 
2043  * cdef class PythonElementClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<<
2044  *     u"""PythonElementClassLookup(self, fallback=None)
2045  *     Element class lookup based on a subclass method.
2046  */
2047
2048 struct __pyx_obj_4lxml_5etree_PythonElementClassLookup {
2049   struct LxmlFallbackElementClassLookup __pyx_base;
2050 };
2051
2052 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2157
2053  *         return current_node
2054  * 
2055  * cdef class ElementChildIterator(_ElementIterator):             # <<<<<<<<<<<<<<
2056  *     u"""ElementChildIterator(self, node, tag=None, reversed=False)
2057  *     Iterates over the children of an element.
2058  */
2059
2060 struct __pyx_obj_4lxml_5etree_ElementChildIterator {
2061   struct LxmlElementIterator __pyx_base;
2062 };
2063
2064 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":351
2065  *             _ErrorLog.receive(self, entry)
2066  * 
2067  * cdef class _RotatingErrorLog(_ErrorLog):             # <<<<<<<<<<<<<<
2068  *     cdef int _max_len
2069  *     def __init__(self, max_len):
2070  */
2071
2072 struct __pyx_obj_4lxml_5etree__RotatingErrorLog {
2073   struct __pyx_obj_4lxml_5etree__ErrorLog __pyx_base;
2074   int _max_len;
2075 };
2076
2077
2078 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":101
2079  *         return doc_ref
2080  * 
2081  * cdef class _ResolverRegistry:             # <<<<<<<<<<<<<<
2082  *     cdef object _resolvers
2083  *     cdef Resolver _default_resolver
2084  */
2085
2086 struct __pyx_vtabstruct_4lxml_5etree__ResolverRegistry {
2087   struct __pyx_obj_4lxml_5etree__ResolverRegistry *(*_copy)(struct __pyx_obj_4lxml_5etree__ResolverRegistry *);
2088 };
2089 static struct __pyx_vtabstruct_4lxml_5etree__ResolverRegistry *__pyx_vtabptr_4lxml_5etree__ResolverRegistry;
2090
2091
2092 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":208
2093  * 
2094  * # class for temporarily storing exceptions raised in extensions
2095  * cdef class _ExceptionContext:             # <<<<<<<<<<<<<<
2096  *     cdef object _exc_info
2097  *     cdef void clear(self):
2098  */
2099
2100 struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext {
2101   void (*clear)(struct __pyx_obj_4lxml_5etree__ExceptionContext *);
2102   void (*_store_raised)(struct __pyx_obj_4lxml_5etree__ExceptionContext *);
2103   void (*_store_exception)(struct __pyx_obj_4lxml_5etree__ExceptionContext *, PyObject *);
2104   int (*_has_raised)(struct __pyx_obj_4lxml_5etree__ExceptionContext *);
2105   int (*_raise_if_stored)(struct __pyx_obj_4lxml_5etree__ExceptionContext *);
2106 };
2107 static struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *__pyx_vtabptr_4lxml_5etree__ExceptionContext;
2108
2109
2110 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":148
2111  *         return repr(self._resolvers)
2112  * 
2113  * cdef class _ResolverContext(_ExceptionContext):             # <<<<<<<<<<<<<<
2114  *     cdef _ResolverRegistry _resolvers
2115  *     cdef _TempStore _storage
2116  */
2117
2118 struct __pyx_vtabstruct_4lxml_5etree__ResolverContext {
2119   struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext __pyx_base;
2120 };
2121 static struct __pyx_vtabstruct_4lxml_5etree__ResolverContext *__pyx_vtabptr_4lxml_5etree__ResolverContext;
2122
2123
2124 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":676
2125  *     return 0
2126  * 
2127  * cdef class _BaseParser:             # <<<<<<<<<<<<<<
2128  *     cdef ElementClassLookup _class_lookup
2129  *     cdef _ResolverRegistry _resolvers
2130  */
2131
2132 struct __pyx_vtabstruct_4lxml_5etree__BaseParser {
2133   struct __pyx_obj_4lxml_5etree__ParserContext *(*_getParserContext)(struct __pyx_obj_4lxml_5etree__BaseParser *);
2134   struct __pyx_obj_4lxml_5etree__ParserContext *(*_getPushParserContext)(struct __pyx_obj_4lxml_5etree__BaseParser *);
2135   struct __pyx_obj_4lxml_5etree__ParserContext *(*_createContext)(struct __pyx_obj_4lxml_5etree__BaseParser *, PyObject *);
2136   xmlParserCtxt *(*_newParserCtxt)(struct __pyx_obj_4lxml_5etree__BaseParser *);
2137   xmlParserCtxt *(*_newPushParserCtxt)(struct __pyx_obj_4lxml_5etree__BaseParser *);
2138   struct __pyx_obj_4lxml_5etree__BaseParser *(*_copy)(struct __pyx_obj_4lxml_5etree__BaseParser *);
2139   xmlDoc *(*_parseUnicodeDoc)(struct __pyx_obj_4lxml_5etree__BaseParser *, PyObject *, char *);
2140   xmlDoc *(*_parseDoc)(struct __pyx_obj_4lxml_5etree__BaseParser *, char *, Py_ssize_t, char *);
2141   xmlDoc *(*_parseDocFromFile)(struct __pyx_obj_4lxml_5etree__BaseParser *, char *);
2142   xmlDoc *(*_parseDocFromFilelike)(struct __pyx_obj_4lxml_5etree__BaseParser *, PyObject *, PyObject *);
2143 };
2144 static struct __pyx_vtabstruct_4lxml_5etree__BaseParser *__pyx_vtabptr_4lxml_5etree__BaseParser;
2145
2146
2147 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1006
2148  * ############################################################
2149  * 
2150  * cdef class _FeedParser(_BaseParser):             # <<<<<<<<<<<<<<
2151  *     cdef bint _feed_parser_running
2152  * 
2153  */
2154
2155 struct __pyx_vtabstruct_4lxml_5etree__FeedParser {
2156   struct __pyx_vtabstruct_4lxml_5etree__BaseParser __pyx_base;
2157 };
2158 static struct __pyx_vtabstruct_4lxml_5etree__FeedParser *__pyx_vtabptr_4lxml_5etree__FeedParser;
2159
2160
2161 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1185
2162  *     )
2163  * 
2164  * cdef class XMLParser(_FeedParser):             # <<<<<<<<<<<<<<
2165  *     u"""XMLParser(self, encoding=None, attribute_defaults=False, dtd_validation=False, load_dtd=False, no_network=True, ns_clean=False, recover=False, XMLSchema schema=None, remove_blank_text=False, resolve_entities=True, remove_comments=False, remove_pis=False, strip_cdata=True, target=None, compact=True)
2166  * 
2167  */
2168
2169 struct __pyx_vtabstruct_4lxml_5etree_XMLParser {
2170   struct __pyx_vtabstruct_4lxml_5etree__FeedParser __pyx_base;
2171 };
2172 static struct __pyx_vtabstruct_4lxml_5etree_XMLParser *__pyx_vtabptr_4lxml_5etree_XMLParser;
2173
2174 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlElementTagMatcherType;
2175
2176 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2097
2177  * 
2178  * 
2179  * cdef public class _ElementTagMatcher [ object LxmlElementTagMatcher,             # <<<<<<<<<<<<<<
2180  *                                        type LxmlElementTagMatcherType ]:
2181  *     cdef object _pystrings
2182  */
2183
2184 struct __pyx_vtabstruct_4lxml_5etree__ElementTagMatcher {
2185   PyObject *(*_initTagMatch)(struct LxmlElementTagMatcher *, PyObject *);
2186 };
2187 static struct __pyx_vtabstruct_4lxml_5etree__ElementTagMatcher *__pyx_vtabptr_4lxml_5etree__ElementTagMatcher;
2188
2189
2190 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1349
2191  * 
2192  * 
2193  * cdef class __ContentOnlyElement(_Element):             # <<<<<<<<<<<<<<
2194  *     cdef int _raiseImmutable(self) except -1:
2195  *         raise TypeError, u"this element does not have children or attributes"
2196  */
2197
2198 struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement {
2199   int (*_raiseImmutable)(struct __pyx_obj_4lxml_5etree___ContentOnlyElement *);
2200 };
2201 static struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement *__pyx_vtabptr_4lxml_5etree___ContentOnlyElement;
2202
2203
2204 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1448
2205  *             return u"<?%s?>" % self.target
2206  * 
2207  * cdef class _Entity(__ContentOnlyElement):             # <<<<<<<<<<<<<<
2208  *     property tag:
2209  *         def __get__(self):
2210  */
2211
2212 struct __pyx_vtabstruct_4lxml_5etree__Entity {
2213   struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement __pyx_base;
2214 };
2215 static struct __pyx_vtabstruct_4lxml_5etree__Entity *__pyx_vtabptr_4lxml_5etree__Entity;
2216
2217
2218 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":127
2219  *     """
2220  * 
2221  * cdef class EntityBase(_Entity):             # <<<<<<<<<<<<<<
2222  *     u"""All custom Entity classes must inherit from this one.
2223  * 
2224  */
2225
2226 struct __pyx_vtabstruct_4lxml_5etree_EntityBase {
2227   struct __pyx_vtabstruct_4lxml_5etree__Entity __pyx_base;
2228 };
2229 static struct __pyx_vtabstruct_4lxml_5etree_EntityBase *__pyx_vtabptr_4lxml_5etree_EntityBase;
2230
2231
2232 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":31
2233  * # Base class for XSLT and XPath evaluation contexts: functions, namespaces, ...
2234  * 
2235  * cdef class _BaseContext:             # <<<<<<<<<<<<<<
2236  *     cdef xpath.xmlXPathContext* _xpathCtxt
2237  *     cdef _Document _doc
2238  */
2239
2240 struct __pyx_vtabstruct_4lxml_5etree__BaseContext {
2241   struct __pyx_obj_4lxml_5etree__BaseContext *(*_copy)(struct __pyx_obj_4lxml_5etree__BaseContext *);
2242   PyObject *(*_to_utf)(struct __pyx_obj_4lxml_5etree__BaseContext *, PyObject *);
2243   void (*_set_xpath_context)(struct __pyx_obj_4lxml_5etree__BaseContext *, xmlXPathContext *);
2244   PyObject *(*_register_context)(struct __pyx_obj_4lxml_5etree__BaseContext *, struct LxmlDocument *);
2245   PyObject *(*_cleanup_context)(struct __pyx_obj_4lxml_5etree__BaseContext *);
2246   PyObject *(*_release_context)(struct __pyx_obj_4lxml_5etree__BaseContext *);
2247   PyObject *(*addNamespace)(struct __pyx_obj_4lxml_5etree__BaseContext *, PyObject *, PyObject *);
2248   PyObject *(*registerNamespace)(struct __pyx_obj_4lxml_5etree__BaseContext *, PyObject *, PyObject *);
2249   PyObject *(*registerLocalNamespaces)(struct __pyx_obj_4lxml_5etree__BaseContext *);
2250   PyObject *(*registerGlobalNamespaces)(struct __pyx_obj_4lxml_5etree__BaseContext *);
2251   PyObject *(*unregisterGlobalNamespaces)(struct __pyx_obj_4lxml_5etree__BaseContext *);
2252   void (*_unregisterNamespace)(struct __pyx_obj_4lxml_5etree__BaseContext *, PyObject *);
2253   void (*_addLocalExtensionFunction)(struct __pyx_obj_4lxml_5etree__BaseContext *, PyObject *, PyObject *, PyObject *);
2254   void (*registerGlobalFunctions)(struct __pyx_obj_4lxml_5etree__BaseContext *, void *, __pyx_t_4lxml_5etree__register_function);
2255   void (*registerLocalFunctions)(struct __pyx_obj_4lxml_5etree__BaseContext *, void *, __pyx_t_4lxml_5etree__register_function);
2256   PyObject *(*unregisterAllFunctions)(struct __pyx_obj_4lxml_5etree__BaseContext *, void *, __pyx_t_4lxml_5etree__register_function);
2257   PyObject *(*unregisterGlobalFunctions)(struct __pyx_obj_4lxml_5etree__BaseContext *, void *, __pyx_t_4lxml_5etree__register_function);
2258   PyObject *(*_find_cached_function)(struct __pyx_obj_4lxml_5etree__BaseContext *, char *, char *);
2259   PyObject *(*_release_temp_refs)(struct __pyx_obj_4lxml_5etree__BaseContext *);
2260   PyObject *(*_hold)(struct __pyx_obj_4lxml_5etree__BaseContext *, PyObject *);
2261 };
2262 static struct __pyx_vtabstruct_4lxml_5etree__BaseContext *__pyx_vtabptr_4lxml_5etree__BaseContext;
2263
2264
2265 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":50
2266  * 
2267  * 
2268  * cdef class _XPathContext(_BaseContext):             # <<<<<<<<<<<<<<
2269  *     cdef object _variables
2270  *     def __init__(self, namespaces, extensions, enable_regexp, variables,
2271  */
2272
2273 struct __pyx_vtabstruct_4lxml_5etree__XPathContext {
2274   struct __pyx_vtabstruct_4lxml_5etree__BaseContext __pyx_base;
2275   PyObject *(*set_context)(struct __pyx_obj_4lxml_5etree__XPathContext *, xmlXPathContext *);
2276   PyObject *(*register_context)(struct __pyx_obj_4lxml_5etree__XPathContext *, struct LxmlDocument *);
2277   PyObject *(*unregister_context)(struct __pyx_obj_4lxml_5etree__XPathContext *);
2278   PyObject *(*registerVariables)(struct __pyx_obj_4lxml_5etree__XPathContext *, PyObject *);
2279   PyObject *(*registerVariable)(struct __pyx_obj_4lxml_5etree__XPathContext *, PyObject *, PyObject *);
2280   void (*_registerVariable)(struct __pyx_obj_4lxml_5etree__XPathContext *, PyObject *, PyObject *);
2281   void (*_setupDict)(struct __pyx_obj_4lxml_5etree__XPathContext *, xmlXPathContext *);
2282 };
2283 static struct __pyx_vtabstruct_4lxml_5etree__XPathContext *__pyx_vtabptr_4lxml_5etree__XPathContext;
2284
2285
2286 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":26
2287  *     namespaces={u'xs': u'http://www.w3.org/2001/XMLSchema'})
2288  * 
2289  * cdef class XMLSchema(_Validator):             # <<<<<<<<<<<<<<
2290  *     u"""XMLSchema(self, etree=None, file=None)
2291  *     Turn a document into an XML Schema validator.
2292  */
2293
2294 struct __pyx_vtabstruct_4lxml_5etree_XMLSchema {
2295   struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *(*_newSaxValidator)(struct __pyx_obj_4lxml_5etree_XMLSchema *, int);
2296 };
2297 static struct __pyx_vtabstruct_4lxml_5etree_XMLSchema *__pyx_vtabptr_4lxml_5etree_XMLSchema;
2298
2299
2300 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":527
2301  * 
2302  * 
2303  * cdef class iterwalk:             # <<<<<<<<<<<<<<
2304  *     u"""iterwalk(self, element_or_tree, events=("end",), tag=None)
2305  * 
2306  */
2307
2308 struct __pyx_vtabstruct_4lxml_5etree_iterwalk {
2309   void (*_setTagFilter)(struct __pyx_obj_4lxml_5etree_iterwalk *, PyObject *);
2310   int (*_start_node)(struct __pyx_obj_4lxml_5etree_iterwalk *, struct LxmlElement *);
2311   struct LxmlElement *(*_end_node)(struct __pyx_obj_4lxml_5etree_iterwalk *);
2312 };
2313 static struct __pyx_vtabstruct_4lxml_5etree_iterwalk *__pyx_vtabptr_4lxml_5etree_iterwalk;
2314
2315 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlFallbackElementClassLookupType;
2316
2317 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":157
2318  *         self._lookup_function = NULL # use default lookup
2319  * 
2320  * cdef public class FallbackElementClassLookup(ElementClassLookup) \             # <<<<<<<<<<<<<<
2321  *          [ type LxmlFallbackElementClassLookupType,
2322  *            object LxmlFallbackElementClassLookup ]:
2323  */
2324
2325 struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup {
2326   void (*_setFallback)(struct LxmlFallbackElementClassLookup *, struct LxmlElementClassLookup *);
2327 };
2328 static struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup *__pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup;
2329
2330
2331 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":280
2332  * # attribute based lookup scheme
2333  * 
2334  * cdef class AttributeBasedElementClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<<
2335  *     u"""AttributeBasedElementClassLookup(self, attribute_name, class_mapping, fallback=None)
2336  *     Checks an attribute of an Element and looks up the value in a
2337  */
2338
2339 struct __pyx_vtabstruct_4lxml_5etree_AttributeBasedElementClassLookup {
2340   struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup __pyx_base;
2341 };
2342 static struct __pyx_vtabstruct_4lxml_5etree_AttributeBasedElementClassLookup *__pyx_vtabptr_4lxml_5etree_AttributeBasedElementClassLookup;
2343
2344
2345 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":105
2346  *             return ErrorLevels._getName(self.level, u"unknown")
2347  * 
2348  * cdef class _BaseErrorLog:             # <<<<<<<<<<<<<<
2349  *     cdef _LogEntry _first_error
2350  *     cdef readonly object last_error
2351  */
2352
2353 struct __pyx_vtabstruct_4lxml_5etree__BaseErrorLog {
2354   void (*_receive)(struct __pyx_obj_4lxml_5etree__BaseErrorLog *, xmlError *);
2355   void (*_receiveGeneric)(struct __pyx_obj_4lxml_5etree__BaseErrorLog *, int, int, int, int, PyObject *, PyObject *);
2356   PyObject *(*_buildParseException)(struct __pyx_obj_4lxml_5etree__BaseErrorLog *, PyObject *, PyObject *);
2357   PyObject *(*_buildExceptionMessage)(struct __pyx_obj_4lxml_5etree__BaseErrorLog *, PyObject *);
2358 };
2359 static struct __pyx_vtabstruct_4lxml_5etree__BaseErrorLog *__pyx_vtabptr_4lxml_5etree__BaseErrorLog;
2360
2361
2362 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":192
2363  *         return message
2364  * 
2365  * cdef class _ListErrorLog(_BaseErrorLog):             # <<<<<<<<<<<<<<
2366  *     u"Immutable base version of a list based error log."
2367  *     cdef list _entries
2368  */
2369
2370 struct __pyx_vtabstruct_4lxml_5etree__ListErrorLog {
2371   struct __pyx_vtabstruct_4lxml_5etree__BaseErrorLog __pyx_base;
2372 };
2373 static struct __pyx_vtabstruct_4lxml_5etree__ListErrorLog *__pyx_vtabptr_4lxml_5etree__ListErrorLog;
2374
2375
2376 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":312
2377  *         return self.filter_from_level(ErrorLevels.WARNING)
2378  * 
2379  * cdef class _ErrorLog(_ListErrorLog):             # <<<<<<<<<<<<<<
2380  *     def __init__(self):
2381  *         _ListErrorLog.__init__(self, [], None, None)
2382  */
2383
2384 struct __pyx_vtabstruct_4lxml_5etree__ErrorLog {
2385   struct __pyx_vtabstruct_4lxml_5etree__ListErrorLog __pyx_base;
2386   void (*connect)(struct __pyx_obj_4lxml_5etree__ErrorLog *);
2387   void (*disconnect)(struct __pyx_obj_4lxml_5etree__ErrorLog *);
2388 };
2389 static struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *__pyx_vtabptr_4lxml_5etree__ErrorLog;
2390
2391
2392 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":342
2393  *         self._entries.append(entry)
2394  * 
2395  * cdef class _DomainErrorLog(_ErrorLog):             # <<<<<<<<<<<<<<
2396  *     def __init__(self, domains):
2397  *         _ErrorLog.__init__(self)
2398  */
2399
2400 struct __pyx_vtabstruct_4lxml_5etree__DomainErrorLog {
2401   struct __pyx_vtabstruct_4lxml_5etree__ErrorLog __pyx_base;
2402 };
2403 static struct __pyx_vtabstruct_4lxml_5etree__DomainErrorLog *__pyx_vtabptr_4lxml_5etree__DomainErrorLog;
2404
2405
2406 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":311
2407  *         return c_ctxt.node.next
2408  * 
2409  * cdef class iterparse(_BaseParser):             # <<<<<<<<<<<<<<
2410  *     u"""iterparse(self, source, events=("end",), tag=None, attribute_defaults=False, dtd_validation=False, load_dtd=False, no_network=True, remove_blank_text=False, remove_comments=False, remove_pis=False, encoding=None, html=False, huge_tree=False, schema=None)
2411  * 
2412  */
2413
2414 struct __pyx_vtabstruct_4lxml_5etree_iterparse {
2415   struct __pyx_vtabstruct_4lxml_5etree__BaseParser __pyx_base;
2416 };
2417 static struct __pyx_vtabstruct_4lxml_5etree_iterparse *__pyx_vtabptr_4lxml_5etree_iterparse;
2418
2419
2420 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":259
2421  * ############################################################
2422  * 
2423  * cdef class _FileReaderContext:             # <<<<<<<<<<<<<<
2424  *     cdef object _filelike
2425  *     cdef object _encoding
2426  */
2427
2428 struct __pyx_vtabstruct_4lxml_5etree__FileReaderContext {
2429   xmlParserInputBuffer *(*_createParserInputBuffer)(struct __pyx_obj_4lxml_5etree__FileReaderContext *);
2430   xmlParserInput *(*_createParserInput)(struct __pyx_obj_4lxml_5etree__FileReaderContext *, xmlParserCtxt *);
2431   xmlDtd *(*_readDtd)(struct __pyx_obj_4lxml_5etree__FileReaderContext *);
2432   xmlDoc *(*_readDoc)(struct __pyx_obj_4lxml_5etree__FileReaderContext *, xmlParserCtxt *, int);
2433   int (*copyToBuffer)(struct __pyx_obj_4lxml_5etree__FileReaderContext *, char *, int);
2434 };
2435 static struct __pyx_vtabstruct_4lxml_5etree__FileReaderContext *__pyx_vtabptr_4lxml_5etree__FileReaderContext;
2436
2437
2438 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":11
2439  *     SAX_EVENT_COMMENT = 32
2440  * 
2441  * cdef class _SaxParserTarget:             # <<<<<<<<<<<<<<
2442  *     cdef int _sax_event_filter
2443  *     cdef int _sax_event_propagate
2444  */
2445
2446 struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget {
2447   PyObject *(*_handleSaxStart)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *, PyObject *, PyObject *, PyObject *);
2448   PyObject *(*_handleSaxEnd)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *, PyObject *);
2449   int (*_handleSaxData)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *, PyObject *);
2450   int (*_handleSaxDoctype)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *, PyObject *, PyObject *, PyObject *);
2451   PyObject *(*_handleSaxPi)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *, PyObject *, PyObject *);
2452   PyObject *(*_handleSaxComment)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *, PyObject *);
2453 };
2454 static struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *__pyx_vtabptr_4lxml_5etree__SaxParserTarget;
2455
2456
2457 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":332
2458  * ############################################################
2459  * 
2460  * cdef class TreeBuilder(_SaxParserTarget):             # <<<<<<<<<<<<<<
2461  *     u"""TreeBuilder(self, element_factory=None, parser=None)
2462  *     Parser target that builds a tree.
2463  */
2464
2465 struct __pyx_vtabstruct_4lxml_5etree_TreeBuilder {
2466   struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget __pyx_base;
2467   int (*_flush)(struct __pyx_obj_4lxml_5etree_TreeBuilder *);
2468 };
2469 static struct __pyx_vtabstruct_4lxml_5etree_TreeBuilder *__pyx_vtabptr_4lxml_5etree_TreeBuilder;
2470
2471
2472 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1418
2473  *         return []
2474  * 
2475  * cdef class _Comment(__ContentOnlyElement):             # <<<<<<<<<<<<<<
2476  *     property tag:
2477  *         def __get__(self):
2478  */
2479
2480 struct __pyx_vtabstruct_4lxml_5etree__Comment {
2481   struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement __pyx_base;
2482 };
2483 static struct __pyx_vtabstruct_4lxml_5etree__Comment *__pyx_vtabptr_4lxml_5etree__Comment;
2484
2485
2486 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":50
2487  * # XSLT document loaders
2488  * 
2489  * cdef class _XSLTResolverContext(_ResolverContext):             # <<<<<<<<<<<<<<
2490  *     cdef xmlDoc* _c_style_doc
2491  *     cdef _BaseParser _parser
2492  */
2493
2494 struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext {
2495   struct __pyx_vtabstruct_4lxml_5etree__ResolverContext __pyx_base;
2496   struct __pyx_obj_4lxml_5etree__XSLTResolverContext *(*_copy)(struct __pyx_obj_4lxml_5etree__XSLTResolverContext *);
2497 };
2498 static struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *__pyx_vtabptr_4lxml_5etree__XSLTResolverContext;
2499
2500
2501 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":194
2502  * 
2503  * # class for temporary storage of Python references
2504  * cdef class _TempStore:             # <<<<<<<<<<<<<<
2505  *     cdef list _storage
2506  *     def __init__(self):
2507  */
2508
2509 struct __pyx_vtabstruct_4lxml_5etree__TempStore {
2510   int (*add)(struct __pyx_obj_4lxml_5etree__TempStore *, PyObject *);
2511   int (*clear)(struct __pyx_obj_4lxml_5etree__TempStore *);
2512 };
2513 static struct __pyx_vtabstruct_4lxml_5etree__TempStore *__pyx_vtabptr_4lxml_5etree__TempStore;
2514
2515 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlElementIteratorType;
2516
2517 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2125
2518  *                 self._name = NULL
2519  * 
2520  * cdef public class _ElementIterator(_ElementTagMatcher) [             # <<<<<<<<<<<<<<
2521  *     object LxmlElementIterator, type LxmlElementIteratorType ]:
2522  *     # we keep Python references here to control GC
2523  */
2524
2525 struct __pyx_vtabstruct_4lxml_5etree__ElementIterator {
2526   struct __pyx_vtabstruct_4lxml_5etree__ElementTagMatcher __pyx_base;
2527   void (*_storeNext)(struct LxmlElementIterator *, struct LxmlElement *);
2528 };
2529 static struct __pyx_vtabstruct_4lxml_5etree__ElementIterator *__pyx_vtabptr_4lxml_5etree__ElementIterator;
2530
2531
2532 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2180
2533  *             self._node = _elementFactory(node._doc, c_node)
2534  * 
2535  * cdef class SiblingsIterator(_ElementIterator):             # <<<<<<<<<<<<<<
2536  *     u"""SiblingsIterator(self, node, tag=None, preceding=False)
2537  *     Iterates over the siblings of an element.
2538  */
2539
2540 struct __pyx_vtabstruct_4lxml_5etree_SiblingsIterator {
2541   struct __pyx_vtabstruct_4lxml_5etree__ElementIterator __pyx_base;
2542 };
2543 static struct __pyx_vtabstruct_4lxml_5etree_SiblingsIterator *__pyx_vtabptr_4lxml_5etree_SiblingsIterator;
2544
2545
2546 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":304
2547  * # output to file-like objects
2548  * 
2549  * cdef class _FilelikeWriter:             # <<<<<<<<<<<<<<
2550  *     cdef object _filelike
2551  *     cdef object _close_filelike
2552  */
2553
2554 struct __pyx_vtabstruct_4lxml_5etree__FilelikeWriter {
2555   xmlOutputBuffer *(*_createOutputBuffer)(struct __pyx_obj_4lxml_5etree__FilelikeWriter *, xmlCharEncodingHandler *);
2556   int (*write)(struct __pyx_obj_4lxml_5etree__FilelikeWriter *, char *, int);
2557   int (*close)(struct __pyx_obj_4lxml_5etree__FilelikeWriter *);
2558 };
2559 static struct __pyx_vtabstruct_4lxml_5etree__FilelikeWriter *__pyx_vtabptr_4lxml_5etree__FilelikeWriter;
2560
2561
2562 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1426
2563  *         return u"<!--%s-->" % self.text
2564  * 
2565  * cdef class _ProcessingInstruction(__ContentOnlyElement):             # <<<<<<<<<<<<<<
2566  *     property tag:
2567  *         def __get__(self):
2568  */
2569
2570 struct __pyx_vtabstruct_4lxml_5etree__ProcessingInstruction {
2571   struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement __pyx_base;
2572 };
2573 static struct __pyx_vtabstruct_4lxml_5etree__ProcessingInstruction *__pyx_vtabptr_4lxml_5etree__ProcessingInstruction;
2574
2575
2576 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":113
2577  *     """
2578  * 
2579  * cdef class PIBase(_ProcessingInstruction):             # <<<<<<<<<<<<<<
2580  *     u"""All custom Processing Instruction classes must inherit from this one.
2581  * 
2582  */
2583
2584 struct __pyx_vtabstruct_4lxml_5etree_PIBase {
2585   struct __pyx_vtabstruct_4lxml_5etree__ProcessingInstruction __pyx_base;
2586 };
2587 static struct __pyx_vtabstruct_4lxml_5etree_PIBase *__pyx_vtabptr_4lxml_5etree_PIBase;
2588
2589
2590 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":270
2591  * cdef dict EMPTY_DICT = {}
2592  * 
2593  * cdef class _XSLTContext(_BaseContext):             # <<<<<<<<<<<<<<
2594  *     cdef xslt.xsltTransformContext* _xsltCtxt
2595  *     cdef _ReadOnlyElementProxy _extension_element_proxy
2596  */
2597
2598 struct __pyx_vtabstruct_4lxml_5etree__XSLTContext {
2599   struct __pyx_vtabstruct_4lxml_5etree__BaseContext __pyx_base;
2600   PyObject *(*register_context)(struct __pyx_obj_4lxml_5etree__XSLTContext *, xsltTransformContext *, struct LxmlDocument *);
2601   PyObject *(*free_context)(struct __pyx_obj_4lxml_5etree__XSLTContext *);
2602 };
2603 static struct __pyx_vtabstruct_4lxml_5etree__XSLTContext *__pyx_vtabptr_4lxml_5etree__XSLTContext;
2604
2605
2606 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":327
2607  * 
2608  * 
2609  * cdef class XSLT:             # <<<<<<<<<<<<<<
2610  *     u"""XSLT(self, xslt_input, extensions=None, regexp=True, access_control=None)
2611  * 
2612  */
2613
2614 struct __pyx_vtabstruct_4lxml_5etree_XSLT {
2615   xmlDoc *(*_run_transform)(struct __pyx_obj_4lxml_5etree_XSLT *, xmlDoc *, PyObject *, struct __pyx_obj_4lxml_5etree__XSLTContext *, xsltTransformContext *);
2616 };
2617 static struct __pyx_vtabstruct_4lxml_5etree_XSLT *__pyx_vtabptr_4lxml_5etree_XSLT;
2618
2619
2620 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":351
2621  *             _ErrorLog.receive(self, entry)
2622  * 
2623  * cdef class _RotatingErrorLog(_ErrorLog):             # <<<<<<<<<<<<<<
2624  *     cdef int _max_len
2625  *     def __init__(self, max_len):
2626  */
2627
2628 struct __pyx_vtabstruct_4lxml_5etree__RotatingErrorLog {
2629   struct __pyx_vtabstruct_4lxml_5etree__ErrorLog __pyx_base;
2630 };
2631 static struct __pyx_vtabstruct_4lxml_5etree__RotatingErrorLog *__pyx_vtabptr_4lxml_5etree__RotatingErrorLog;
2632
2633
2634 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":13
2635  *         self.result = result
2636  * 
2637  * cdef class _PythonSaxParserTarget(_SaxParserTarget):             # <<<<<<<<<<<<<<
2638  *     cdef object _target_start
2639  *     cdef object _target_end
2640  */
2641
2642 struct __pyx_vtabstruct_4lxml_5etree__PythonSaxParserTarget {
2643   struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget __pyx_base;
2644 };
2645 static struct __pyx_vtabstruct_4lxml_5etree__PythonSaxParserTarget *__pyx_vtabptr_4lxml_5etree__PythonSaxParserTarget;
2646
2647
2648 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":14
2649  * 
2650  * 
2651  * cdef class _NamespaceRegistry:             # <<<<<<<<<<<<<<
2652  *     u"Dictionary-like namespace registry"
2653  *     cdef object _ns_uri
2654  */
2655
2656 struct __pyx_vtabstruct_4lxml_5etree__NamespaceRegistry {
2657   PyObject *(*_get)(struct __pyx_obj_4lxml_5etree__NamespaceRegistry *, PyObject *);
2658   PyObject *(*_getForString)(struct __pyx_obj_4lxml_5etree__NamespaceRegistry *, char *);
2659 };
2660 static struct __pyx_vtabstruct_4lxml_5etree__NamespaceRegistry *__pyx_vtabptr_4lxml_5etree__NamespaceRegistry;
2661
2662
2663 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":186
2664  *         return registry
2665  * 
2666  * cdef class _FunctionNamespaceRegistry(_NamespaceRegistry):             # <<<<<<<<<<<<<<
2667  *     def __setitem__(self, name, item):
2668  *         if not callable(item):
2669  */
2670
2671 struct __pyx_vtabstruct_4lxml_5etree__FunctionNamespaceRegistry {
2672   struct __pyx_vtabstruct_4lxml_5etree__NamespaceRegistry __pyx_base;
2673 };
2674 static struct __pyx_vtabstruct_4lxml_5etree__FunctionNamespaceRegistry *__pyx_vtabptr_4lxml_5etree__FunctionNamespaceRegistry;
2675
2676
2677 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":41
2678  * # Logging classes
2679  * 
2680  * cdef class _LogEntry:             # <<<<<<<<<<<<<<
2681  *     cdef readonly object domain
2682  *     cdef readonly object type
2683  */
2684
2685 struct __pyx_vtabstruct_4lxml_5etree__LogEntry {
2686   PyObject *(*_setError)(struct __pyx_obj_4lxml_5etree__LogEntry *, xmlError *);
2687   PyObject *(*_setGeneric)(struct __pyx_obj_4lxml_5etree__LogEntry *, int, int, int, int, PyObject *, PyObject *);
2688 };
2689 static struct __pyx_vtabstruct_4lxml_5etree__LogEntry *__pyx_vtabptr_4lxml_5etree__LogEntry;
2690
2691
2692 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":470
2693  * ############################################################
2694  * 
2695  * cdef class _ParserContext(_ResolverContext):             # <<<<<<<<<<<<<<
2696  *     cdef _ErrorLog _error_log
2697  *     cdef _ParserSchemaValidationContext _validator
2698  */
2699
2700 struct __pyx_vtabstruct_4lxml_5etree__ParserContext {
2701   struct __pyx_vtabstruct_4lxml_5etree__ResolverContext __pyx_base;
2702   struct __pyx_obj_4lxml_5etree__ParserContext *(*_copy)(struct __pyx_obj_4lxml_5etree__ParserContext *);
2703   void (*_initParserContext)(struct __pyx_obj_4lxml_5etree__ParserContext *, xmlParserCtxt *);
2704   void (*_resetParserContext)(struct __pyx_obj_4lxml_5etree__ParserContext *);
2705   int (*prepare)(struct __pyx_obj_4lxml_5etree__ParserContext *);
2706   int (*cleanup)(struct __pyx_obj_4lxml_5etree__ParserContext *);
2707   PyObject *(*_handleParseResult)(struct __pyx_obj_4lxml_5etree__ParserContext *, struct __pyx_obj_4lxml_5etree__BaseParser *, xmlDoc *, PyObject *);
2708   xmlDoc *(*_handleParseResultDoc)(struct __pyx_obj_4lxml_5etree__ParserContext *, struct __pyx_obj_4lxml_5etree__BaseParser *, xmlDoc *, PyObject *);
2709 };
2710 static struct __pyx_vtabstruct_4lxml_5etree__ParserContext *__pyx_vtabptr_4lxml_5etree__ParserContext;
2711
2712
2713 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":102
2714  *     _XPATH_VERSION_WARNING_REQUIRED = 0
2715  * 
2716  * cdef class _XPathEvaluatorBase:             # <<<<<<<<<<<<<<
2717  *     cdef xpath.xmlXPathContext* _xpathCtxt
2718  *     cdef _XPathContext _context
2719  */
2720
2721 struct __pyx_vtabstruct_4lxml_5etree__XPathEvaluatorBase {
2722   PyObject *(*set_context)(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *, xmlXPathContext *);
2723   int (*_checkAbsolutePath)(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *, char *);
2724   int (*_lock)(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *);
2725   void (*_unlock)(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *);
2726   PyObject *(*_raise_parse_error)(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *);
2727   PyObject *(*_raise_eval_error)(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *);
2728   PyObject *(*_handle_result)(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *, xmlXPathObject *, struct LxmlDocument *);
2729 };
2730 static struct __pyx_vtabstruct_4lxml_5etree__XPathEvaluatorBase *__pyx_vtabptr_4lxml_5etree__XPathEvaluatorBase;
2731
2732
2733 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":224
2734  * 
2735  * 
2736  * cdef class XPathElementEvaluator(_XPathEvaluatorBase):             # <<<<<<<<<<<<<<
2737  *     u"""XPathElementEvaluator(self, element, namespaces=None, extensions=None, regexp=True, smart_strings=True)
2738  *     Create an XPath evaluator for an element.
2739  */
2740
2741 struct __pyx_vtabstruct_4lxml_5etree_XPathElementEvaluator {
2742   struct __pyx_vtabstruct_4lxml_5etree__XPathEvaluatorBase __pyx_base;
2743 };
2744 static struct __pyx_vtabstruct_4lxml_5etree_XPathElementEvaluator *__pyx_vtabptr_4lxml_5etree_XPathElementEvaluator;
2745
2746
2747 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":99
2748  *                 raise TypeError, "Invalid child type: %r" % type(child)
2749  * 
2750  * cdef class CommentBase(_Comment):             # <<<<<<<<<<<<<<
2751  *     u"""All custom Comment classes must inherit from this one.
2752  * 
2753  */
2754
2755 struct __pyx_vtabstruct_4lxml_5etree_CommentBase {
2756   struct __pyx_vtabstruct_4lxml_5etree__Comment __pyx_base;
2757 };
2758 static struct __pyx_vtabstruct_4lxml_5etree_CommentBase *__pyx_vtabptr_4lxml_5etree_CommentBase;
2759
2760
2761 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":170
2762  *         return context
2763  * 
2764  * cdef class _ParserSchemaValidationContext:             # <<<<<<<<<<<<<<
2765  *     cdef XMLSchema _schema
2766  *     cdef xmlschema.xmlSchemaValidCtxt* _valid_ctxt
2767  */
2768
2769 struct __pyx_vtabstruct_4lxml_5etree__ParserSchemaValidationContext {
2770   struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *(*copy)(struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *);
2771   void (*inject_default_attributes)(struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *, xmlDoc *);
2772   int (*connect)(struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *, xmlParserCtxt *);
2773   void (*disconnect)(struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *);
2774   int (*isvalid)(struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *);
2775 };
2776 static struct __pyx_vtabstruct_4lxml_5etree__ParserSchemaValidationContext *__pyx_vtabptr_4lxml_5etree__ParserSchemaValidationContext;
2777
2778
2779 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2157
2780  *         return current_node
2781  * 
2782  * cdef class ElementChildIterator(_ElementIterator):             # <<<<<<<<<<<<<<
2783  *     u"""ElementChildIterator(self, node, tag=None, reversed=False)
2784  *     Iterates over the children of an element.
2785  */
2786
2787 struct __pyx_vtabstruct_4lxml_5etree_ElementChildIterator {
2788   struct __pyx_vtabstruct_4lxml_5etree__ElementIterator __pyx_base;
2789 };
2790 static struct __pyx_vtabstruct_4lxml_5etree_ElementChildIterator *__pyx_vtabptr_4lxml_5etree_ElementChildIterator;
2791
2792
2793 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":330
2794  * #  per-parser lookup scheme
2795  * 
2796  * cdef class ParserBasedElementClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<<
2797  *     u"""ParserBasedElementClassLookup(self, fallback=None)
2798  *     Element class lookup based on the XML parser.
2799  */
2800
2801 struct __pyx_vtabstruct_4lxml_5etree_ParserBasedElementClassLookup {
2802   struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup __pyx_base;
2803 };
2804 static struct __pyx_vtabstruct_4lxml_5etree_ParserBasedElementClassLookup *__pyx_vtabptr_4lxml_5etree_ParserBasedElementClassLookup;
2805
2806
2807 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":31
2808  *         return None
2809  * 
2810  * cdef class _SaxParserContext(_ParserContext):             # <<<<<<<<<<<<<<
2811  *     u"""This class maps SAX2 events to method calls.
2812  *     """
2813  */
2814
2815 struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext {
2816   struct __pyx_vtabstruct_4lxml_5etree__ParserContext __pyx_base;
2817   void (*_setSaxParserTarget)(struct __pyx_obj_4lxml_5etree__SaxParserContext *, struct __pyx_obj_4lxml_5etree__SaxParserTarget *);
2818   void (*_handleSaxException)(struct __pyx_obj_4lxml_5etree__SaxParserContext *, xmlParserCtxt *);
2819 };
2820 static struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *__pyx_vtabptr_4lxml_5etree__SaxParserContext;
2821
2822
2823 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":814
2824  *     return __findStylesheetByID(doc, id=id)
2825  * 
2826  * cdef class _XSLTProcessingInstruction(PIBase):             # <<<<<<<<<<<<<<
2827  *     def parseXSL(self, parser=None):
2828  *         u"""Try to parse the stylesheet referenced by this PI and return an
2829  */
2830
2831 struct __pyx_vtabstruct_4lxml_5etree__XSLTProcessingInstruction {
2832   struct __pyx_vtabstruct_4lxml_5etree_PIBase __pyx_base;
2833 };
2834 static struct __pyx_vtabstruct_4lxml_5etree__XSLTProcessingInstruction *__pyx_vtabptr_4lxml_5etree__XSLTProcessingInstruction;
2835
2836
2837 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":62
2838  *     return count
2839  * 
2840  * cdef class _IterparseContext(_ParserContext):             # <<<<<<<<<<<<<<
2841  *     cdef xmlparser.startElementNsSAX2Func _origSaxStart
2842  *     cdef xmlparser.endElementNsSAX2Func   _origSaxEnd
2843  */
2844
2845 struct __pyx_vtabstruct_4lxml_5etree__IterparseContext {
2846   struct __pyx_vtabstruct_4lxml_5etree__ParserContext __pyx_base;
2847   PyObject *(*_setEventFilter)(struct __pyx_obj_4lxml_5etree__IterparseContext *, PyObject *, PyObject *);
2848   int (*startNode)(struct __pyx_obj_4lxml_5etree__IterparseContext *, xmlNode *);
2849   int (*endNode)(struct __pyx_obj_4lxml_5etree__IterparseContext *, xmlNode *);
2850   int (*pushEvent)(struct __pyx_obj_4lxml_5etree__IterparseContext *, PyObject *, xmlNode *);
2851   void (*_assureDocGetsFreed)(struct __pyx_obj_4lxml_5etree__IterparseContext *);
2852 };
2853 static struct __pyx_vtabstruct_4lxml_5etree__IterparseContext *__pyx_vtabptr_4lxml_5etree__IterparseContext;
2854
2855
2856 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":379
2857  * 
2858  * 
2859  * cdef class XPath(_XPathEvaluatorBase):             # <<<<<<<<<<<<<<
2860  *     u"""XPath(self, path, namespaces=None, extensions=None, regexp=True, smart_strings=True)
2861  *     A compiled XPath expression that can be called on Elements and ElementTrees.
2862  */
2863
2864 struct __pyx_vtabstruct_4lxml_5etree_XPath {
2865   struct __pyx_vtabstruct_4lxml_5etree__XPathEvaluatorBase __pyx_base;
2866 };
2867 static struct __pyx_vtabstruct_4lxml_5etree_XPath *__pyx_vtabptr_4lxml_5etree_XPath;
2868
2869
2870 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":347
2871  * #  custom class lookup based on node type, namespace, name
2872  * 
2873  * cdef class CustomElementClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<<
2874  *     u"""CustomElementClassLookup(self, fallback=None)
2875  *     Element class lookup based on a subclass method.
2876  */
2877
2878 struct __pyx_vtabstruct_4lxml_5etree_CustomElementClassLookup {
2879   struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup __pyx_base;
2880 };
2881 static struct __pyx_vtabstruct_4lxml_5etree_CustomElementClassLookup *__pyx_vtabptr_4lxml_5etree_CustomElementClassLookup;
2882
2883
2884 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":3
2885  * # read-only tree implementation
2886  * 
2887  * cdef class _ReadOnlyElementProxy:             # <<<<<<<<<<<<<<
2888  *     u"The main read-only Element proxy class (for internal use only!)."
2889  *     cdef bint _free_after_use
2890  */
2891
2892 struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy {
2893   int (*_assertNode)(struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *);
2894   void (*free_after_use)(struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *);
2895   PyObject *(*getchildren)(struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *, int __pyx_skip_dispatch);
2896 };
2897 static struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *__pyx_vtabptr_4lxml_5etree__ReadOnlyElementProxy;
2898
2899
2900 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":279
2901  *     del sourceProxy._dependent_proxies[:]
2902  * 
2903  * cdef class _AppendOnlyElementProxy(_ReadOnlyElementProxy):             # <<<<<<<<<<<<<<
2904  *     u"""A read-only element that allows adding children and changing the
2905  *     text content (i.e. everything that adds to the subtree).
2906  */
2907
2908 struct __pyx_vtabstruct_4lxml_5etree__AppendOnlyElementProxy {
2909   struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy __pyx_base;
2910   PyObject *(*append)(struct __pyx_obj_4lxml_5etree__AppendOnlyElementProxy *, PyObject *, int __pyx_skip_dispatch);
2911 };
2912 static struct __pyx_vtabstruct_4lxml_5etree__AppendOnlyElementProxy *__pyx_vtabptr_4lxml_5etree__AppendOnlyElementProxy;
2913
2914
2915 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":451
2916  * _find_namespaces = re.compile('({[^}]+})').findall
2917  * 
2918  * cdef class ETXPath(XPath):             # <<<<<<<<<<<<<<
2919  *     u"""ETXPath(self, path, extensions=None, regexp=True)
2920  *     Special XPath class that supports the ElementTree {uri} notation for namespaces.
2921  */
2922
2923 struct __pyx_vtabstruct_4lxml_5etree_ETXPath {
2924   struct __pyx_vtabstruct_4lxml_5etree_XPath __pyx_base;
2925   PyObject *(*_nsextract_path)(struct __pyx_obj_4lxml_5etree_ETXPath *, PyObject *);
2926 };
2927 static struct __pyx_vtabstruct_4lxml_5etree_ETXPath *__pyx_vtabptr_4lxml_5etree_ETXPath;
2928
2929
2930 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":81
2931  *         python.PyDict_Clear(self._entries)
2932  * 
2933  * cdef class _ClassNamespaceRegistry(_NamespaceRegistry):             # <<<<<<<<<<<<<<
2934  *     u"Dictionary-like registry for namespace implementation classes"
2935  *     def __setitem__(self, name, item):
2936  */
2937
2938 struct __pyx_vtabstruct_4lxml_5etree__ClassNamespaceRegistry {
2939   struct __pyx_vtabstruct_4lxml_5etree__NamespaceRegistry __pyx_base;
2940 };
2941 static struct __pyx_vtabstruct_4lxml_5etree__ClassNamespaceRegistry *__pyx_vtabptr_4lxml_5etree__ClassNamespaceRegistry;
2942
2943
2944 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":95
2945  * 
2946  * 
2947  * cdef class ElementNamespaceClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<<
2948  *     u"""ElementNamespaceClassLookup(self, fallback=None)
2949  * 
2950  */
2951
2952 struct __pyx_vtabstruct_4lxml_5etree_ElementNamespaceClassLookup {
2953   struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup __pyx_base;
2954 };
2955 static struct __pyx_vtabstruct_4lxml_5etree_ElementNamespaceClassLookup *__pyx_vtabptr_4lxml_5etree_ElementNamespaceClassLookup;
2956
2957
2958 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":405
2959  * # read-only tree based class lookup
2960  * 
2961  * cdef class PythonElementClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<<
2962  *     u"""PythonElementClassLookup(self, fallback=None)
2963  *     Element class lookup based on a subclass method.
2964  */
2965
2966 struct __pyx_vtabstruct_4lxml_5etree_PythonElementClassLookup {
2967   struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup __pyx_base;
2968 };
2969 static struct __pyx_vtabstruct_4lxml_5etree_PythonElementClassLookup *__pyx_vtabptr_4lxml_5etree_PythonElementClassLookup;
2970
2971
2972 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":299
2973  * 
2974  * 
2975  * cdef class XPathDocumentEvaluator(XPathElementEvaluator):             # <<<<<<<<<<<<<<
2976  *     u"""XPathDocumentEvaluator(self, etree, namespaces=None, extensions=None, regexp=True, smart_strings=True)
2977  *     Create an XPath evaluator for an ElementTree.
2978  */
2979
2980 struct __pyx_vtabstruct_4lxml_5etree_XPathDocumentEvaluator {
2981   struct __pyx_vtabstruct_4lxml_5etree_XPathElementEvaluator __pyx_base;
2982 };
2983 static struct __pyx_vtabstruct_4lxml_5etree_XPathDocumentEvaluator *__pyx_vtabptr_4lxml_5etree_XPathDocumentEvaluator;
2984
2985
2986 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":167
2987  * # XSLT file/network access control
2988  * 
2989  * cdef class XSLTAccessControl:             # <<<<<<<<<<<<<<
2990  *     u"""XSLTAccessControl(self, read_file=True, write_file=True, create_dir=True, read_network=True, write_network=True)
2991  * 
2992  */
2993
2994 struct __pyx_vtabstruct_4lxml_5etree_XSLTAccessControl {
2995   PyObject *(*_setAccess)(struct __pyx_obj_4lxml_5etree_XSLTAccessControl *, xsltSecurityOption, PyObject *);
2996   void (*_register_in_context)(struct __pyx_obj_4lxml_5etree_XSLTAccessControl *, xsltTransformContext *);
2997   PyObject *(*_optval)(struct __pyx_obj_4lxml_5etree_XSLTAccessControl *, xsltSecurityOption);
2998 };
2999 static struct __pyx_vtabstruct_4lxml_5etree_XSLTAccessControl *__pyx_vtabptr_4lxml_5etree_XSLTAccessControl;
3000
3001 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlElementTreeType;
3002
3003 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1535
3004  * 
3005  * 
3006  * cdef public class _ElementTree [ type LxmlElementTreeType,             # <<<<<<<<<<<<<<
3007  *                                  object LxmlElementTree ]:
3008  *     cdef _Document _doc
3009  */
3010
3011 struct __pyx_vtabstruct_4lxml_5etree__ElementTree {
3012   PyObject *(*_assertHasRoot)(struct LxmlElementTree *);
3013 };
3014 static struct __pyx_vtabstruct_4lxml_5etree__ElementTree *__pyx_vtabptr_4lxml_5etree__ElementTree;
3015
3016
3017 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":660
3018  *     return new_xslt
3019  * 
3020  * cdef class _XSLTResultTree(_ElementTree):             # <<<<<<<<<<<<<<
3021  *     cdef XSLT _xslt
3022  *     cdef _Document _profile
3023  */
3024
3025 struct __pyx_vtabstruct_4lxml_5etree__XSLTResultTree {
3026   struct __pyx_vtabstruct_4lxml_5etree__ElementTree __pyx_base;
3027   PyObject *(*_saveToStringAndSize)(struct __pyx_obj_4lxml_5etree__XSLTResultTree *, char **, int *);
3028 };
3029 static struct __pyx_vtabstruct_4lxml_5etree__XSLTResultTree *__pyx_vtabptr_4lxml_5etree__XSLTResultTree;
3030
3031
3032 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":360
3033  * # EXSLT regexp implementation
3034  * 
3035  * cdef class _ExsltRegExp:             # <<<<<<<<<<<<<<
3036  *     cdef dict _compile_map
3037  *     def __init__(self):
3038  */
3039
3040 struct __pyx_vtabstruct_4lxml_5etree__ExsltRegExp {
3041   PyObject *(*_make_string)(struct __pyx_obj_4lxml_5etree__ExsltRegExp *, PyObject *);
3042   PyObject *(*_compile)(struct __pyx_obj_4lxml_5etree__ExsltRegExp *, PyObject *, PyObject *);
3043   PyObject *(*_register_in_context)(struct __pyx_obj_4lxml_5etree__ExsltRegExp *, struct __pyx_obj_4lxml_5etree__BaseContext *);
3044 };
3045 static struct __pyx_vtabstruct_4lxml_5etree__ExsltRegExp *__pyx_vtabptr_4lxml_5etree__ExsltRegExp;
3046
3047
3048 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2194
3049  *         self._storeNext(node)
3050  * 
3051  * cdef class AncestorsIterator(_ElementIterator):             # <<<<<<<<<<<<<<
3052  *     u"""AncestorsIterator(self, node, tag=None)
3053  *     Iterates over the ancestors of an element (from parent to parent).
3054  */
3055
3056 struct __pyx_vtabstruct_4lxml_5etree_AncestorsIterator {
3057   struct __pyx_vtabstruct_4lxml_5etree__ElementIterator __pyx_base;
3058 };
3059 static struct __pyx_vtabstruct_4lxml_5etree_AncestorsIterator *__pyx_vtabptr_4lxml_5etree_AncestorsIterator;
3060
3061
3062 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":362
3063  *         self._entries.append(entry)
3064  * 
3065  * cdef class PyErrorLog(_BaseErrorLog):             # <<<<<<<<<<<<<<
3066  *     u"""PyErrorLog(self, logger_name=None)
3067  *     A global error log that connects to the Python stdlib logging package.
3068  */
3069
3070 struct __pyx_vtabstruct_4lxml_5etree_PyErrorLog {
3071   struct __pyx_vtabstruct_4lxml_5etree__BaseErrorLog __pyx_base;
3072 };
3073 static struct __pyx_vtabstruct_4lxml_5etree_PyErrorLog *__pyx_vtabptr_4lxml_5etree_PyErrorLog;
3074
3075
3076 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2203
3077  *         self._storeNext(node)
3078  * 
3079  * cdef class ElementDepthFirstIterator(_ElementTagMatcher):             # <<<<<<<<<<<<<<
3080  *     u"""ElementDepthFirstIterator(self, node, tag=None, inclusive=True)
3081  *     Iterates over an element and its sub-elements in document order (depth
3082  */
3083
3084 struct __pyx_vtabstruct_4lxml_5etree_ElementDepthFirstIterator {
3085   struct __pyx_vtabstruct_4lxml_5etree__ElementTagMatcher __pyx_base;
3086   xmlNode *(*_nextNodeAnyTag)(struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *, xmlNode *);
3087   xmlNode *(*_nextNodeMatchTag)(struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *, xmlNode *);
3088 };
3089 static struct __pyx_vtabstruct_4lxml_5etree_ElementDepthFirstIterator *__pyx_vtabptr_4lxml_5etree_ElementDepthFirstIterator;
3090
3091
3092 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":199
3093  *         return u"FunctionNamespace(%r)" % self._ns_uri
3094  * 
3095  * cdef class _XPathFunctionNamespaceRegistry(_FunctionNamespaceRegistry):             # <<<<<<<<<<<<<<
3096  *     cdef object _prefix
3097  *     cdef object _prefix_utf
3098  */
3099
3100 struct __pyx_vtabstruct_4lxml_5etree__XPathFunctionNamespaceRegistry {
3101   struct __pyx_vtabstruct_4lxml_5etree__FunctionNamespaceRegistry __pyx_base;
3102 };
3103 static struct __pyx_vtabstruct_4lxml_5etree__XPathFunctionNamespaceRegistry *__pyx_vtabptr_4lxml_5etree__XPathFunctionNamespaceRegistry;
3104
3105
3106 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":58
3107  *     return (_elementTreeFactory(doc, None), _IDDict(doc))
3108  * 
3109  * cdef class _IDDict:             # <<<<<<<<<<<<<<
3110  *     u"""IDDict(self, etree)
3111  *     A dictionary-like proxy class that mapps ID attributes to elements.
3112  */
3113
3114 struct __pyx_vtabstruct_4lxml_5etree__IDDict {
3115   PyObject *(*_build_keys)(struct __pyx_obj_4lxml_5etree__IDDict *);
3116   PyObject *(*_build_items)(struct __pyx_obj_4lxml_5etree__IDDict *);
3117 };
3118 static struct __pyx_vtabstruct_4lxml_5etree__IDDict *__pyx_vtabptr_4lxml_5etree__IDDict;
3119
3120 __PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlDocumentType;
3121
3122 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":251
3123  * # Public Python API
3124  * 
3125  * cdef public class _Document [ type LxmlDocumentType, object LxmlDocument ]:             # <<<<<<<<<<<<<<
3126  *     u"""Internal base class to reference a libxml document.
3127  * 
3128  */
3129
3130 struct __pyx_vtabstruct_4lxml_5etree__Document {
3131   PyObject *(*getroot)(struct LxmlDocument *);
3132   int (*hasdoctype)(struct LxmlDocument *);
3133   PyObject *(*getdoctype)(struct LxmlDocument *);
3134   PyObject *(*getxmlinfo)(struct LxmlDocument *);
3135   PyObject *(*isstandalone)(struct LxmlDocument *);
3136   PyObject *(*buildNewPrefix)(struct LxmlDocument *);
3137   xmlNs *(*_findOrBuildNodeNs)(struct LxmlDocument *, xmlNode *, char *, char *);
3138   int (*_setNodeNs)(struct LxmlDocument *, xmlNode *, char *);
3139 };
3140 static struct __pyx_vtabstruct_4lxml_5etree__Document *__pyx_vtabptr_4lxml_5etree__Document;
3141
3142
3143 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":40
3144  *     pass
3145  * 
3146  * cdef class _ParserDictionaryContext:             # <<<<<<<<<<<<<<
3147  *     # Global parser context to share the string dictionary.
3148  *     #
3149  */
3150
3151 struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext {
3152   void (*initMainParserContext)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *);
3153   struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *(*_findThreadParserContext)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *);
3154   void (*setDefaultParser)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *, struct __pyx_obj_4lxml_5etree__BaseParser *);
3155   struct __pyx_obj_4lxml_5etree__BaseParser *(*getDefaultParser)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *);
3156   xmlDict *(*_getThreadDict)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *, xmlDict *);
3157   void (*initThreadDictRef)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *, xmlDict **);
3158   void (*initParserDict)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *, xmlParserCtxt *);
3159   void (*initXPathParserDict)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *, xmlXPathContext *);
3160   void (*initDocDict)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *, xmlDoc *);
3161   struct __pyx_obj_4lxml_5etree__ParserContext *(*findImpliedContext)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *);
3162   void (*pushImpliedContextFromParser)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *, struct __pyx_obj_4lxml_5etree__BaseParser *);
3163   void (*pushImpliedContext)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *, struct __pyx_obj_4lxml_5etree__ParserContext *);
3164   void (*popImpliedContext)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *);
3165 };
3166 static struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *__pyx_vtabptr_4lxml_5etree__ParserDictionaryContext;
3167
3168
3169 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1267
3170  *                              target, None, encoding)
3171  * 
3172  * cdef class ETCompatXMLParser(XMLParser):             # <<<<<<<<<<<<<<
3173  *     u"""ETCompatXMLParser(self, encoding=None, attribute_defaults=False, \
3174  *                  dtd_validation=False, load_dtd=False, no_network=True, \
3175  */
3176
3177 struct __pyx_vtabstruct_4lxml_5etree_ETCompatXMLParser {
3178   struct __pyx_vtabstruct_4lxml_5etree_XMLParser __pyx_base;
3179 };
3180 static struct __pyx_vtabstruct_4lxml_5etree_ETCompatXMLParser *__pyx_vtabptr_4lxml_5etree_ETCompatXMLParser;
3181
3182
3183 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":93
3184  * 
3185  * 
3186  * cdef class _TargetParserContext(_SaxParserContext):             # <<<<<<<<<<<<<<
3187  *     u"""This class maps SAX2 events to the ET parser target interface.
3188  *     """
3189  */
3190
3191 struct __pyx_vtabstruct_4lxml_5etree__TargetParserContext {
3192   struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext __pyx_base;
3193   int (*_setTarget)(struct __pyx_obj_4lxml_5etree__TargetParserContext *, PyObject *);
3194   void (*_cleanupTargetParserContext)(struct __pyx_obj_4lxml_5etree__TargetParserContext *, xmlDoc *);
3195 };
3196 static struct __pyx_vtabstruct_4lxml_5etree__TargetParserContext *__pyx_vtabptr_4lxml_5etree__TargetParserContext;
3197
3198
3199 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1343
3200  *     )
3201  * 
3202  * cdef class HTMLParser(_FeedParser):             # <<<<<<<<<<<<<<
3203  *     u"""HTMLParser(self, encoding=None, remove_blank_text=False, \
3204  *                    remove_comments=False, remove_pis=False, strip_cdata=True, \
3205  */
3206
3207 struct __pyx_vtabstruct_4lxml_5etree_HTMLParser {
3208   struct __pyx_vtabstruct_4lxml_5etree__FeedParser __pyx_base;
3209 };
3210 static struct __pyx_vtabstruct_4lxml_5etree_HTMLParser *__pyx_vtabptr_4lxml_5etree_HTMLParser;
3211 /* Module declarations from lxml.cstd */
3212
3213 /* Module declarations from lxml.tree */
3214
3215 /* Module declarations from __builtin__ */
3216
3217 /* Module declarations from lxml.python */
3218
3219 static PyTypeObject *__pyx_ptype_4lxml_6python_slice = 0;
3220 static PyTypeObject *__pyx_ptype_4lxml_6python_unicode = 0;
3221 /* Module declarations from lxml.config */
3222
3223 /* Module declarations from lxml.xmlerror */
3224
3225 /* Module declarations from lxml.xpath */
3226
3227 /* Module declarations from lxml.c14n */
3228
3229 /* Module declarations from lxml.xmlparser */
3230
3231 /* Module declarations from lxml.htmlparser */
3232
3233 /* Module declarations from lxml.xinclude */
3234
3235 /* Module declarations from lxml.xslt */
3236
3237 /* Module declarations from lxml.dtdvalid */
3238
3239 /* Module declarations from lxml.relaxng */
3240
3241 /* Module declarations from lxml.xmlschema */
3242
3243 /* Module declarations from lxml.schematron */
3244
3245 /* Module declarations from lxml.etree */
3246
3247 static PyTypeObject *__pyx_ptype_4lxml_5etree__TempStore = 0;
3248 static PyTypeObject *__pyx_ptype_4lxml_5etree__ExceptionContext = 0;
3249 static PyTypeObject *__pyx_ptype_4lxml_5etree__Document = 0;
3250 static PyTypeObject *__pyx_ptype_4lxml_5etree__Element = 0;
3251 static PyTypeObject *__pyx_ptype_4lxml_5etree__BaseParser = 0;
3252 static PyTypeObject *__pyx_ptype_4lxml_5etree_QName = 0;
3253 static PyTypeObject *__pyx_ptype_4lxml_5etree__LogEntry = 0;
3254 static PyTypeObject *__pyx_ptype_4lxml_5etree__BaseErrorLog = 0;
3255 static PyTypeObject *__pyx_ptype_4lxml_5etree__ListErrorLog = 0;
3256 static PyTypeObject *__pyx_ptype_4lxml_5etree__ErrorLog = 0;
3257 static PyTypeObject *__pyx_ptype_4lxml_5etree__DomainErrorLog = 0;
3258 static PyTypeObject *__pyx_ptype_4lxml_5etree__RotatingErrorLog = 0;
3259 static PyTypeObject *__pyx_ptype_4lxml_5etree_PyErrorLog = 0;
3260 static PyTypeObject *__pyx_ptype_4lxml_5etree_DocInfo = 0;
3261 static PyTypeObject *__pyx_ptype_4lxml_5etree___ContentOnlyElement = 0;
3262 static PyTypeObject *__pyx_ptype_4lxml_5etree__Comment = 0;
3263 static PyTypeObject *__pyx_ptype_4lxml_5etree__ProcessingInstruction = 0;
3264 static PyTypeObject *__pyx_ptype_4lxml_5etree__Entity = 0;
3265 static PyTypeObject *__pyx_ptype_4lxml_5etree__ElementTree = 0;
3266 static PyTypeObject *__pyx_ptype_4lxml_5etree__Attrib = 0;
3267 static PyTypeObject *__pyx_ptype_4lxml_5etree__AttribIterator = 0;
3268 static PyTypeObject *__pyx_ptype_4lxml_5etree__ElementTagMatcher = 0;
3269 static PyTypeObject *__pyx_ptype_4lxml_5etree__ElementIterator = 0;
3270 static PyTypeObject *__pyx_ptype_4lxml_5etree_ElementChildIterator = 0;
3271 static PyTypeObject *__pyx_ptype_4lxml_5etree_SiblingsIterator = 0;
3272 static PyTypeObject *__pyx_ptype_4lxml_5etree_AncestorsIterator = 0;
3273 static PyTypeObject *__pyx_ptype_4lxml_5etree_ElementDepthFirstIterator = 0;
3274 static PyTypeObject *__pyx_ptype_4lxml_5etree_ElementTextIterator = 0;
3275 static PyTypeObject *__pyx_ptype_4lxml_5etree_CDATA = 0;
3276 static PyTypeObject *__pyx_ptype_4lxml_5etree__ReadOnlyElementProxy = 0;
3277 static PyTypeObject *__pyx_ptype_4lxml_5etree__AppendOnlyElementProxy = 0;
3278 static PyTypeObject *__pyx_ptype_4lxml_5etree_ElementBase = 0;
3279 static PyTypeObject *__pyx_ptype_4lxml_5etree_CommentBase = 0;
3280 static PyTypeObject *__pyx_ptype_4lxml_5etree_PIBase = 0;
3281 static PyTypeObject *__pyx_ptype_4lxml_5etree_EntityBase = 0;
3282 static PyTypeObject *__pyx_ptype_4lxml_5etree_ElementClassLookup = 0;
3283 static PyTypeObject *__pyx_ptype_4lxml_5etree_FallbackElementClassLookup = 0;
3284 static PyTypeObject *__pyx_ptype_4lxml_5etree_ElementDefaultClassLookup = 0;
3285 static PyTypeObject *__pyx_ptype_4lxml_5etree_AttributeBasedElementClassLookup = 0;
3286 static PyTypeObject *__pyx_ptype_4lxml_5etree_ParserBasedElementClassLookup = 0;
3287 static PyTypeObject *__pyx_ptype_4lxml_5etree_CustomElementClassLookup = 0;
3288 static PyTypeObject *__pyx_ptype_4lxml_5etree_PythonElementClassLookup = 0;
3289 static PyTypeObject *__pyx_ptype_4lxml_5etree__NamespaceRegistry = 0;
3290 static PyTypeObject *__pyx_ptype_4lxml_5etree__ClassNamespaceRegistry = 0;
3291 static PyTypeObject *__pyx_ptype_4lxml_5etree_ElementNamespaceClassLookup = 0;
3292 static PyTypeObject *__pyx_ptype_4lxml_5etree__FunctionNamespaceRegistry = 0;
3293 static PyTypeObject *__pyx_ptype_4lxml_5etree__XPathFunctionNamespaceRegistry = 0;
3294 static PyTypeObject *__pyx_ptype_4lxml_5etree__InputDocument = 0;
3295 static PyTypeObject *__pyx_ptype_4lxml_5etree_Resolver = 0;
3296 static PyTypeObject *__pyx_ptype_4lxml_5etree__ResolverRegistry = 0;
3297 static PyTypeObject *__pyx_ptype_4lxml_5etree__ResolverContext = 0;
3298 static PyTypeObject *__pyx_ptype_4lxml_5etree__ParserContext = 0;
3299 static PyTypeObject *__pyx_ptype_4lxml_5etree__SaxParserContext = 0;
3300 static PyTypeObject *__pyx_ptype_4lxml_5etree__TargetParserContext = 0;
3301 static PyTypeObject *__pyx_ptype_4lxml_5etree__ParserSchemaValidationContext = 0;
3302 static PyTypeObject *__pyx_ptype_4lxml_5etree__Validator = 0;
3303 static PyTypeObject *__pyx_ptype_4lxml_5etree_XMLSchema = 0;
3304 static PyTypeObject *__pyx_ptype_4lxml_5etree__ParserDictionaryContext = 0;
3305 static PyTypeObject *__pyx_ptype_4lxml_5etree__FileReaderContext = 0;
3306 static PyTypeObject *__pyx_ptype_4lxml_5etree__FeedParser = 0;
3307 static PyTypeObject *__pyx_ptype_4lxml_5etree_XMLParser = 0;
3308 static PyTypeObject *__pyx_ptype_4lxml_5etree_ETCompatXMLParser = 0;
3309 static PyTypeObject *__pyx_ptype_4lxml_5etree_HTMLParser = 0;
3310 static PyTypeObject *__pyx_ptype_4lxml_5etree__SaxParserTarget = 0;
3311 static PyTypeObject *__pyx_ptype_4lxml_5etree_TreeBuilder = 0;
3312 static PyTypeObject *__pyx_ptype_4lxml_5etree__PythonSaxParserTarget = 0;
3313 static PyTypeObject *__pyx_ptype_4lxml_5etree__FilelikeWriter = 0;
3314 static PyTypeObject *__pyx_ptype_4lxml_5etree__IterparseContext = 0;
3315 static PyTypeObject *__pyx_ptype_4lxml_5etree_iterparse = 0;
3316 static PyTypeObject *__pyx_ptype_4lxml_5etree_iterwalk = 0;
3317 static PyTypeObject *__pyx_ptype_4lxml_5etree__IDDict = 0;
3318 static PyTypeObject *__pyx_ptype_4lxml_5etree_XInclude = 0;
3319 static PyTypeObject *__pyx_ptype_4lxml_5etree__ExsltRegExp = 0;
3320 static PyTypeObject *__pyx_ptype_4lxml_5etree__BaseContext = 0;
3321 static PyTypeObject *__pyx_ptype_4lxml_5etree__ElementUnicodeResult = 0;
3322 static PyTypeObject *__pyx_ptype_4lxml_5etree__XPathContext = 0;
3323 static PyTypeObject *__pyx_ptype_4lxml_5etree__XPathEvaluatorBase = 0;
3324 static PyTypeObject *__pyx_ptype_4lxml_5etree_XPathElementEvaluator = 0;
3325 static PyTypeObject *__pyx_ptype_4lxml_5etree_XPathDocumentEvaluator = 0;
3326 static PyTypeObject *__pyx_ptype_4lxml_5etree_XPath = 0;
3327 static PyTypeObject *__pyx_ptype_4lxml_5etree_ETXPath = 0;
3328 static PyTypeObject *__pyx_ptype_4lxml_5etree__XSLTResolverContext = 0;
3329 static PyTypeObject *__pyx_ptype_4lxml_5etree_XSLTAccessControl = 0;
3330 static PyTypeObject *__pyx_ptype_4lxml_5etree__XSLTContext = 0;
3331 static PyTypeObject *__pyx_ptype_4lxml_5etree__XSLTQuotedStringParam = 0;
3332 static PyTypeObject *__pyx_ptype_4lxml_5etree_XSLT = 0;
3333 static PyTypeObject *__pyx_ptype_4lxml_5etree__XSLTResultTree = 0;
3334 static PyTypeObject *__pyx_ptype_4lxml_5etree__XSLTProcessingInstruction = 0;
3335 static PyTypeObject *__pyx_ptype_4lxml_5etree_XSLTExtension = 0;
3336 static PyTypeObject *__pyx_ptype_4lxml_5etree_DTD = 0;
3337 static PyTypeObject *__pyx_ptype_4lxml_5etree_RelaxNG = 0;
3338 static PyTypeObject *__pyx_ptype_4lxml_5etree_Schematron = 0;
3339 static PyObject *__pyx_v_4lxml_5etree__unicode = 0;
3340 static PyObject *__pyx_v_4lxml_5etree_os_path_abspath = 0;
3341 static PyObject *__pyx_v_4lxml_5etree_BytesIO = 0;
3342 static PyObject *__pyx_v_4lxml_5etree_StringIO = 0;
3343 static PyObject *__pyx_v_4lxml_5etree__elementpath = 0;
3344 static PyObject *__pyx_v_4lxml_5etree_sys = 0;
3345 static PyObject *__pyx_v_4lxml_5etree_re = 0;
3346 static PyObject *__pyx_v_4lxml_5etree_gzip = 0;
3347 static PyObject *__pyx_v_4lxml_5etree_ITER_EMPTY = 0;
3348 static PyObject *__pyx_v_4lxml_5etree_EMPTY_READ_ONLY_DICT = 0;
3349 static PyObject *__pyx_v_4lxml_5etree__FILENAME_ENCODING = 0;
3350 static char *__pyx_v_4lxml_5etree__C_FILENAME_ENCODING;
3351 static PyObject *__pyx_v_4lxml_5etree__DEFAULT_NAMESPACE_PREFIXES = 0;
3352 static PyObject *__pyx_v_4lxml_5etree__LxmlError = 0;
3353 static PyObject *__pyx_v_4lxml_5etree_error_super_init = 0;
3354 static int __pyx_v_4lxml_5etree__LIBXML_VERSION_INT;
3355 static PyObject *__pyx_v_4lxml_5etree___RE_XML_ENCODING = 0;
3356 static PyObject *__pyx_v_4lxml_5etree___REPLACE_XML_ENCODING = 0;
3357 static PyObject *__pyx_v_4lxml_5etree___HAS_XML_ENCODING = 0;
3358 static struct __pyx_obj_4lxml_5etree__BaseErrorLog *__pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG = 0;
3359 static PyObject *__pyx_v_4lxml_5etree___ERROR_LEVELS = 0;
3360 static PyObject *__pyx_v_4lxml_5etree___ERROR_DOMAINS = 0;
3361 static PyObject *__pyx_v_4lxml_5etree___PARSER_ERROR_TYPES = 0;
3362 static PyObject *__pyx_v_4lxml_5etree___RELAXNG_ERROR_TYPES = 0;
3363 static PyObject *__pyx_v_4lxml_5etree__PREFIX_CACHE = 0;
3364 static _element_class_lookup_function __pyx_v_4lxml_5etree_LOOKUP_ELEMENT_CLASS;
3365 static PyObject *__pyx_v_4lxml_5etree_ELEMENT_CLASS_LOOKUP_STATE = 0;
3366 static struct __pyx_obj_4lxml_5etree_ParserBasedElementClassLookup *__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP = 0;
3367 static PyObject *__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES = 0;
3368 static PyObject *__pyx_v_4lxml_5etree__XMLSyntaxError = 0;
3369 static struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT = 0;
3370 static char *__pyx_v_4lxml_5etree__UNICODE_ENCODING;
3371 static xmlExternalEntityLoader __pyx_v_4lxml_5etree___DEFAULT_ENTITY_LOADER;
3372 static int __pyx_v_4lxml_5etree__XML_DEFAULT_PARSE_OPTIONS;
3373 static struct __pyx_obj_4lxml_5etree_XMLParser *__pyx_v_4lxml_5etree___DEFAULT_XML_PARSER = 0;
3374 static int __pyx_v_4lxml_5etree__HTML_DEFAULT_PARSE_OPTIONS;
3375 static struct __pyx_obj_4lxml_5etree_HTMLParser *__pyx_v_4lxml_5etree___DEFAULT_HTML_PARSER = 0;
3376 static PyObject *__pyx_v_4lxml_5etree_inspect_getargspec = 0;
3377 static PyObject *__pyx_v_4lxml_5etree__find_id_attributes = 0;
3378 static PyObject *__pyx_v_4lxml_5etree__XPATH_SYNTAX_ERRORS = 0;
3379 static PyObject *__pyx_v_4lxml_5etree__XPATH_EVAL_ERRORS = 0;
3380 static int __pyx_v_4lxml_5etree__XPATH_VERSION_WARNING_REQUIRED;
3381 static PyObject *__pyx_v_4lxml_5etree__replace_strings = 0;
3382 static PyObject *__pyx_v_4lxml_5etree__find_namespaces = 0;
3383 static xsltDocLoaderFunc __pyx_v_4lxml_5etree_XSLT_DOC_DEFAULT_LOADER;
3384 static PyObject *__pyx_v_4lxml_5etree_EMPTY_DICT = 0;
3385 static PyObject *__pyx_v_4lxml_5etree__FIND_PI_ATTRIBUTES = 0;
3386 static PyObject *__pyx_v_4lxml_5etree__RE_PI_HREF = 0;
3387 static PyObject *__pyx_v_4lxml_5etree__FIND_PI_HREF = 0;
3388 static PyObject *__pyx_v_4lxml_5etree__REPLACE_PI_HREF = 0;
3389 static struct __pyx_obj_4lxml_5etree_XPath *__pyx_v_4lxml_5etree___findStylesheetByID = 0;
3390 static struct __pyx_obj_4lxml_5etree_XPath *__pyx_v_4lxml_5etree__check_for_default_attributes = 0;
3391 static PyObject *__pyx_k_87 = 0;
3392 static PyObject *__pyx_k_88 = 0;
3393 static PyObject *__pyx_k_89 = 0;
3394 static PyObject *__pyx_k_90 = 0;
3395 static PyObject *__pyx_k_92 = 0;
3396 static PyObject *__pyx_k_93 = 0;
3397 static PyObject *__pyx_k_94 = 0;
3398 static PyObject *__pyx_k_95 = 0;
3399 static PyObject *__pyx_k_96 = 0;
3400 static PyObject *__pyx_k_97 = 0;
3401 static PyObject *__pyx_k_98 = 0;
3402 static PyObject *__pyx_k_99 = 0;
3403 static PyObject *__pyx_k_100 = 0;
3404 static PyObject *__pyx_k_102 = 0;
3405 static PyObject *__pyx_k_103 = 0;
3406 static PyObject *__pyx_k_105 = 0;
3407 static PyObject *__pyx_k_106 = 0;
3408 static PyObject *__pyx_k_108 = 0;
3409 static PyObject *__pyx_k_109 = 0;
3410 static PyObject *__pyx_k_110 = 0;
3411 static PyObject *__pyx_k_117 = 0;
3412 static PyObject *__pyx_k_118 = 0;
3413 static PyObject *__pyx_k_119 = 0;
3414 static PyObject *__pyx_k_120 = 0;
3415 static PyObject *__pyx_k_121 = 0;
3416 static PyObject *__pyx_k_122 = 0;
3417 static PyObject *__pyx_k_123 = 0;
3418 static PyObject *__pyx_k_124 = 0;
3419 static PyObject *__pyx_k_125 = 0;
3420 static PyObject *__pyx_k_126 = 0;
3421 static PyObject *__pyx_k_127 = 0;
3422 static PyObject *__pyx_k_128 = 0;
3423 static PyObject *__pyx_k_129 = 0;
3424 static PyObject *__pyx_k_130 = 0;
3425 static PyObject *__pyx_k_131 = 0;
3426 static PyObject *__pyx_k_132 = 0;
3427 static PyObject *__pyx_k_133 = 0;
3428 static PyObject *__pyx_k_134 = 0;
3429 static PyObject *__pyx_k_135 = 0;
3430 static PyObject *__pyx_k_136 = 0;
3431 static PyObject *__pyx_k_137 = 0;
3432 static PyObject *__pyx_k_138 = 0;
3433 static PyObject *__pyx_k_139 = 0;
3434 static PyObject *__pyx_k_140 = 0;
3435 static PyObject *__pyx_k_141 = 0;
3436 static PyObject *__pyx_k_142 = 0;
3437 static PyObject *__pyx_k_143 = 0;
3438 static PyObject *__pyx_k_144 = 0;
3439 static PyObject *__pyx_k_145 = 0;
3440 static PyObject *__pyx_k_146 = 0;
3441 static PyObject *__pyx_k_147 = 0;
3442 static PyObject *__pyx_k_148 = 0;
3443 static PyObject *__pyx_k_149 = 0;
3444 static PyObject *__pyx_k_152 = 0;
3445 static PyObject *__pyx_k_153 = 0;
3446 static PyObject *__pyx_k_154 = 0;
3447 static PyObject *__pyx_k_155 = 0;
3448 static PyObject *__pyx_k_156 = 0;
3449 static PyObject *__pyx_k_157 = 0;
3450 static PyObject *__pyx_k_158 = 0;
3451 static PyObject *__pyx_k_159 = 0;
3452 static PyObject *__pyx_k_160 = 0;
3453 static PyObject *__pyx_k_161 = 0;
3454 static PyObject *__pyx_k_162 = 0;
3455 static PyObject *__pyx_k_163 = 0;
3456 static PyObject *__pyx_k_164 = 0;
3457 static PyObject *__pyx_k_166 = 0;
3458 static PyObject *__pyx_k_175 = 0;
3459 static PyObject *__pyx_k_176 = 0;
3460 static PyObject *__pyx_k_177 = 0;
3461 static PyObject *__pyx_k_178 = 0;
3462 static PyObject *__pyx_k_179 = 0;
3463 static PyObject *__pyx_k_180 = 0;
3464 static PyObject *__pyx_k_181 = 0;
3465 static PyObject *__pyx_k_182 = 0;
3466 static PyObject *__pyx_k_185 = 0;
3467 static PyObject *__pyx_k_186 = 0;
3468 static PyObject *__pyx_k_193 = 0;
3469 static PyObject *__pyx_k_194 = 0;
3470 static PyObject *__pyx_k_195 = 0;
3471 static PyObject *__pyx_k_196 = 0;
3472 static PyObject *__pyx_k_197 = 0;
3473 static PyObject *__pyx_k_198 = 0;
3474 static PyObject *__pyx_k_199 = 0;
3475 static PyObject *__pyx_k_200 = 0;
3476 static PyObject *__pyx_k_218 = 0;
3477 static PyObject *__pyx_f_4lxml_5etree___unpackDottedVersion(PyObject *); /*proto*/
3478 static PyObject *__pyx_f_4lxml_5etree___unpackIntVersion(int); /*proto*/
3479 static INLINE struct LxmlElement *__pyx_f_4lxml_5etree_getProxy(xmlNode *); /*proto*/
3480 static INLINE int __pyx_f_4lxml_5etree_hasProxy(xmlNode *); /*proto*/
3481 static INLINE int __pyx_f_4lxml_5etree__registerProxy(struct LxmlElement *, struct LxmlDocument *, xmlNode *); /*proto*/
3482 static INLINE int __pyx_f_4lxml_5etree__unregisterProxy(struct LxmlElement *); /*proto*/
3483 static INLINE void __pyx_f_4lxml_5etree__releaseProxy(struct LxmlElement *); /*proto*/
3484 static INLINE void __pyx_f_4lxml_5etree__updateProxyDocument(xmlNode *, struct LxmlDocument *); /*proto*/
3485 static xmlDoc *__pyx_f_4lxml_5etree__fakeRootDoc(xmlDoc *, xmlNode *); /*proto*/
3486 static void __pyx_f_4lxml_5etree__destroyFakeDoc(xmlDoc *, xmlDoc *); /*proto*/
3487 static struct LxmlElement *__pyx_f_4lxml_5etree__fakeDocElementFactory(struct LxmlDocument *, xmlNode *); /*proto*/
3488 static int __pyx_f_4lxml_5etree_attemptDeallocation(xmlNode *); /*proto*/
3489 static xmlNode *__pyx_f_4lxml_5etree_getDeallocationTop(xmlNode *); /*proto*/
3490 static int __pyx_f_4lxml_5etree_canDeallocateChildNodes(xmlNode *); /*proto*/
3491 static void __pyx_f_4lxml_5etree__copyParentNamespaces(xmlNode *, xmlNode *); /*proto*/
3492 static int __pyx_f_4lxml_5etree__growNsCache(__pyx_t_4lxml_5etree__nscache *); /*proto*/
3493 static INLINE int __pyx_f_4lxml_5etree__appendToNsCache(__pyx_t_4lxml_5etree__nscache *, xmlNs *, xmlNs *); /*proto*/
3494 static int __pyx_f_4lxml_5etree__stripRedundantNamespaceDeclarations(xmlNode *, __pyx_t_4lxml_5etree__nscache *, xmlNs **); /*proto*/
3495 static int __pyx_f_4lxml_5etree_moveNodeToDocument(struct LxmlDocument *, xmlDoc *, xmlNode *); /*proto*/
3496 static void __pyx_f_4lxml_5etree_fixElementDocument(xmlNode *, struct LxmlDocument *, size_t); /*proto*/
3497 static void __pyx_f_4lxml_5etree_fixThreadDictNames(xmlNode *, xmlDict *, xmlDict *); /*proto*/
3498 static void __pyx_f_4lxml_5etree_fixThreadDictNamesForNode(xmlNode *, xmlDict *, xmlDict *); /*proto*/
3499 static INLINE void __pyx_f_4lxml_5etree_fixThreadDictNamesForAttributes(xmlAttr *, xmlDict *, xmlDict *); /*proto*/
3500 static INLINE void __pyx_f_4lxml_5etree_fixThreadDictNameForNode(xmlNode *, xmlDict *, xmlDict *); /*proto*/
3501 static INLINE void __pyx_f_4lxml_5etree_fixThreadDictContentForNode(xmlNode *, xmlDict *, xmlDict *); /*proto*/
3502 static INLINE void __pyx_f_4lxml_5etree_fixThreadDictNsForNode(xmlNode *, xmlDict *, xmlDict *); /*proto*/
3503 static void __pyx_f_4lxml_5etree_displayNode(xmlNode *, PyObject *); /*proto*/
3504 static struct LxmlDocument *__pyx_f_4lxml_5etree__documentOrRaise(PyObject *); /*proto*/
3505 static struct LxmlElement *__pyx_f_4lxml_5etree__rootNodeOrRaise(PyObject *); /*proto*/
3506 static struct LxmlDocument *__pyx_f_4lxml_5etree__documentOf(PyObject *); /*proto*/
3507 static struct LxmlElement *__pyx_f_4lxml_5etree__rootNodeOf(PyObject *); /*proto*/
3508 static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *, xmlDoc *, struct LxmlDocument *, struct __pyx_obj_4lxml_5etree__BaseParser *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
3509 static int __pyx_f_4lxml_5etree__initNewElement(struct LxmlElement *, int, PyObject *, PyObject *, struct __pyx_obj_4lxml_5etree__BaseParser *, PyObject *, PyObject *, PyObject *); /*proto*/
3510 static struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlElement *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
3511 static int __pyx_f_4lxml_5etree__initNodeNamespaces(xmlNode *, struct LxmlDocument *, PyObject *, PyObject *); /*proto*/
3512 static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *, struct LxmlDocument *, PyObject *, PyObject *); /*proto*/
3513 static int __pyx_f_4lxml_5etree__removeUnusedNamespaceDeclarations(xmlNode *); /*proto*/
3514 static int __pyx_f_4lxml_5etree__replaceNodeByChildren(struct LxmlDocument *, xmlNode *); /*proto*/
3515 static PyObject *__pyx_f_4lxml_5etree__attributeValue(xmlNode *, xmlAttr *); /*proto*/
3516 static PyObject *__pyx_f_4lxml_5etree__attributeValueFromNsName(xmlNode *, char *, char *); /*proto*/
3517 static PyObject *__pyx_f_4lxml_5etree__getNodeAttributeValue(xmlNode *, PyObject *, PyObject *); /*proto*/
3518 static INLINE PyObject *__pyx_f_4lxml_5etree__getAttributeValue(struct LxmlElement *, PyObject *, PyObject *); /*proto*/
3519 static int __pyx_f_4lxml_5etree__setAttributeValue(struct LxmlElement *, PyObject *, PyObject *); /*proto*/
3520 static int __pyx_f_4lxml_5etree__delAttribute(struct LxmlElement *, PyObject *); /*proto*/
3521 static int __pyx_f_4lxml_5etree__delAttributeFromNsName(xmlNode *, char *, char *); /*proto*/
3522 static PyObject *__pyx_f_4lxml_5etree__collectAttributes(xmlNode *, int); /*proto*/
3523 static PyObject *__pyx_f_4lxml_5etree__stripEncodingDeclaration(PyObject *); /*proto*/
3524 static int __pyx_f_4lxml_5etree__hasEncodingDeclaration(PyObject *); /*proto*/
3525 static PyObject *__pyx_f_4lxml_5etree__stripDeclaration(PyObject *); /*proto*/
3526 static INLINE int __pyx_f_4lxml_5etree__hasText(xmlNode *); /*proto*/
3527 static INLINE int __pyx_f_4lxml_5etree__hasTail(xmlNode *); /*proto*/
3528 static PyObject *__pyx_f_4lxml_5etree__collectText(xmlNode *); /*proto*/
3529 static void __pyx_f_4lxml_5etree__removeText(xmlNode *); /*proto*/
3530 static int __pyx_f_4lxml_5etree__setNodeText(xmlNode *, PyObject *); /*proto*/
3531 static int __pyx_f_4lxml_5etree__setTailText(xmlNode *, PyObject *); /*proto*/
3532 static PyObject *__pyx_f_4lxml_5etree__resolveQNameText(struct LxmlElement *, PyObject *); /*proto*/
3533 static INLINE int __pyx_f_4lxml_5etree__hasChild(xmlNode *); /*proto*/
3534 static INLINE Py_ssize_t __pyx_f_4lxml_5etree__countElements(xmlNode *); /*proto*/
3535 static int __pyx_f_4lxml_5etree__findChildSlice(PySliceObject *, xmlNode *, xmlNode **, Py_ssize_t *, Py_ssize_t *); /*proto*/
3536 static int __pyx_f_4lxml_5etree__isFullSlice(PySliceObject *); /*proto*/
3537 static PyObject *__pyx_f_4lxml_5etree__collectChildren(struct LxmlElement *); /*proto*/
3538 static INLINE xmlNode *__pyx_f_4lxml_5etree__findChild(xmlNode *, Py_ssize_t); /*proto*/
3539 static INLINE xmlNode *__pyx_f_4lxml_5etree__findChildForwards(xmlNode *, Py_ssize_t); /*proto*/
3540 static INLINE xmlNode *__pyx_f_4lxml_5etree__findChildBackwards(xmlNode *, Py_ssize_t); /*proto*/
3541 static INLINE xmlNode *__pyx_f_4lxml_5etree__textNodeOrSkip(xmlNode *); /*proto*/
3542 static INLINE xmlNode *__pyx_f_4lxml_5etree__nextElement(xmlNode *); /*proto*/
3543 static INLINE xmlNode *__pyx_f_4lxml_5etree__previousElement(xmlNode *); /*proto*/
3544 static INLINE xmlNode *__pyx_f_4lxml_5etree__parentElement(xmlNode *); /*proto*/
3545 static INLINE int __pyx_f_4lxml_5etree__tagMatches(xmlNode *, char *, char *); /*proto*/
3546 static int __pyx_f_4lxml_5etree__removeNode(struct LxmlDocument *, xmlNode *); /*proto*/
3547 static void __pyx_f_4lxml_5etree__moveTail(xmlNode *, xmlNode *); /*proto*/
3548 static int __pyx_f_4lxml_5etree__copyTail(xmlNode *, xmlNode *); /*proto*/
3549 static int __pyx_f_4lxml_5etree__copyNonElementSiblings(xmlNode *, xmlNode *); /*proto*/
3550 static int __pyx_f_4lxml_5etree__deleteSlice(struct LxmlDocument *, xmlNode *, Py_ssize_t, Py_ssize_t); /*proto*/
3551 static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *, xmlNode *, Py_ssize_t, Py_ssize_t, int, PyObject *); /*proto*/
3552 static int __pyx_f_4lxml_5etree__appendChild(struct LxmlElement *, struct LxmlElement *); /*proto*/
3553 static int __pyx_f_4lxml_5etree__prependChild(struct LxmlElement *, struct LxmlElement *); /*proto*/
3554 static int __pyx_f_4lxml_5etree__appendSibling(struct LxmlElement *, struct LxmlElement *); /*proto*/
3555 static int __pyx_f_4lxml_5etree__prependSibling(struct LxmlElement *, struct LxmlElement *); /*proto*/
3556 static INLINE int __pyx_f_4lxml_5etree_isutf8(char *); /*proto*/
3557 static int __pyx_f_4lxml_5etree_check_string_utf8(PyObject *); /*proto*/
3558 static PyObject *__pyx_f_4lxml_5etree_funicode(char *); /*proto*/
3559 static PyObject *__pyx_f_4lxml_5etree__utf8(PyObject *); /*proto*/
3560 static int __pyx_f_4lxml_5etree__isFilePath(char *); /*proto*/
3561 static PyObject *__pyx_f_4lxml_5etree__encodeFilename(PyObject *); /*proto*/
3562 static PyObject *__pyx_f_4lxml_5etree__decodeFilename(char *); /*proto*/
3563 static PyObject *__pyx_f_4lxml_5etree__encodeFilenameUTF8(PyObject *); /*proto*/
3564 static PyObject *__pyx_f_4lxml_5etree__getNsTag(PyObject *); /*proto*/
3565 static INLINE int __pyx_f_4lxml_5etree__pyXmlNameIsValid(PyObject *); /*proto*/
3566 static INLINE int __pyx_f_4lxml_5etree__pyHtmlNameIsValid(PyObject *); /*proto*/
3567 static INLINE int __pyx_f_4lxml_5etree__xmlNameIsValid(char *); /*proto*/
3568 static int __pyx_f_4lxml_5etree__htmlNameIsValid(char *); /*proto*/
3569 static int __pyx_f_4lxml_5etree__characterReferenceIsValid(char *); /*proto*/
3570 static int __pyx_f_4lxml_5etree__tagValidOrRaise(PyObject *); /*proto*/
3571 static int __pyx_f_4lxml_5etree__htmlTagValidOrRaise(PyObject *); /*proto*/
3572 static int __pyx_f_4lxml_5etree__attributeValidOrRaise(PyObject *); /*proto*/
3573 static int __pyx_f_4lxml_5etree__prefixValidOrRaise(PyObject *); /*proto*/
3574 static INLINE PyObject *__pyx_f_4lxml_5etree__namespacedName(xmlNode *); /*proto*/
3575 static PyObject *__pyx_f_4lxml_5etree__namespacedNameFromNsName(char *, char *); /*proto*/
3576 static PyObject *__pyx_f_4lxml_5etree__getFilenameForFile(PyObject *); /*proto*/
3577 static void __pyx_f_4lxml_5etree__nullGenericErrorFunc(void *, char *, ...); /*proto*/
3578 static void __pyx_f_4lxml_5etree__initThreadLogging(void); /*proto*/
3579 static void __pyx_f_4lxml_5etree_connectErrorLog(void *); /*proto*/
3580 static struct __pyx_obj_4lxml_5etree__BaseErrorLog *__pyx_f_4lxml_5etree__getGlobalErrorLog(void); /*proto*/
3581 static PyObject *__pyx_f_4lxml_5etree__setGlobalErrorLog(struct __pyx_obj_4lxml_5etree__BaseErrorLog *); /*proto*/
3582 static PyObject *__pyx_f_4lxml_5etree___copyGlobalErrorLog(void); /*proto*/
3583 static void __pyx_f_4lxml_5etree__forwardError(void *, xmlError *); /*proto*/
3584 static void __pyx_f_4lxml_5etree__receiveError(void *, xmlError *); /*proto*/
3585 static void __pyx_f_4lxml_5etree__receiveXSLTError(void *, char *, ...); /*proto*/
3586 static void __pyx_f_4lxml_5etree___initErrorConstants(void); /*proto*/
3587 static PyObject *__pyx_f_4lxml_5etree___initPrefixCache(void); /*proto*/
3588 static struct LxmlDocument *__pyx_f_4lxml_5etree__documentFactory(xmlDoc *, struct __pyx_obj_4lxml_5etree__BaseParser *); /*proto*/
3589 static struct LxmlElement *__pyx_f_4lxml_5etree__elementFactory(struct LxmlDocument *, xmlNode *); /*proto*/
3590 static struct LxmlElementTree *__pyx_f_4lxml_5etree__elementTreeFactory(struct LxmlDocument *, struct LxmlElement *); /*proto*/
3591 static struct LxmlElementTree *__pyx_f_4lxml_5etree__newElementTree(struct LxmlDocument *, struct LxmlElement *, PyObject *); /*proto*/
3592 static PyObject *__pyx_f_4lxml_5etree__attributeIteratorFactory(struct LxmlElement *, int); /*proto*/
3593 static xmlNode *__pyx_f_4lxml_5etree__createElement(xmlDoc *, PyObject *); /*proto*/
3594 static xmlNode *__pyx_f_4lxml_5etree__createComment(xmlDoc *, char *); /*proto*/
3595 static xmlNode *__pyx_f_4lxml_5etree__createPI(xmlDoc *, char *, char *); /*proto*/
3596 static xmlNode *__pyx_f_4lxml_5etree__createEntity(xmlDoc *, char *); /*proto*/
3597 static struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *__pyx_f_4lxml_5etree__newReadOnlyProxy(struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *, xmlNode *); /*proto*/
3598 static INLINE PyObject *__pyx_f_4lxml_5etree__initReadOnlyProxy(struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *, struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *); /*proto*/
3599 static PyObject *__pyx_f_4lxml_5etree__freeReadOnlyProxies(struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *); /*proto*/
3600 static struct __pyx_obj_4lxml_5etree__AppendOnlyElementProxy *__pyx_f_4lxml_5etree__newAppendOnlyProxy(struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *, xmlNode *); /*proto*/
3601 static xmlNode *__pyx_f_4lxml_5etree__roNodeOf(PyObject *); /*proto*/
3602 static INLINE PyObject *__pyx_f_4lxml_5etree__callLookupFallback(struct LxmlFallbackElementClassLookup *, struct LxmlDocument *, xmlNode *); /*proto*/
3603 static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *, struct LxmlDocument *, xmlNode *); /*proto*/
3604 static PyObject *__pyx_f_4lxml_5etree__attribute_class_lookup(PyObject *, struct LxmlDocument *, xmlNode *); /*proto*/
3605 static PyObject *__pyx_f_4lxml_5etree__parser_class_lookup(PyObject *, struct LxmlDocument *, xmlNode *); /*proto*/
3606 static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *, struct LxmlDocument *, xmlNode *); /*proto*/
3607 static PyObject *__pyx_f_4lxml_5etree__python_class_lookup(PyObject *, struct LxmlDocument *, xmlNode *); /*proto*/
3608 static void __pyx_f_4lxml_5etree__setElementClassLookupFunction(_element_class_lookup_function, PyObject *); /*proto*/
3609 static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *, struct LxmlDocument *, xmlNode *); /*proto*/
3610 static PyObject *__pyx_f_4lxml_5etree__find_all_extension_prefixes(void); /*proto*/
3611 static PyObject *__pyx_f_4lxml_5etree__find_extension(PyObject *, PyObject *); /*proto*/
3612 static PyObject *__pyx_f_4lxml_5etree__initResolverContext(struct __pyx_obj_4lxml_5etree__ResolverContext *, struct __pyx_obj_4lxml_5etree__ResolverRegistry *); /*proto*/
3613 static int __pyx_f_4lxml_5etree__checkThreadDict(xmlDict *); /*proto*/
3614 static void __pyx_f_4lxml_5etree__setupPythonUnicode(void); /*proto*/
3615 static char *__pyx_f_4lxml_5etree__findEncodingName(char *, int); /*proto*/
3616 static int __pyx_f_4lxml_5etree__readFilelikeParser(void *, char *, int); /*proto*/
3617 static int __pyx_f_4lxml_5etree__readFileParser(void *, char *, int); /*proto*/
3618 static xmlParserInput *__pyx_f_4lxml_5etree__local_resolver(char *, char *, xmlParserCtxt *); /*proto*/
3619 static PyObject *__pyx_f_4lxml_5etree__initParserContext(struct __pyx_obj_4lxml_5etree__ParserContext *, struct __pyx_obj_4lxml_5etree__ResolverRegistry *, xmlParserCtxt *); /*proto*/
3620 static int __pyx_f_4lxml_5etree__raiseParseError(xmlParserCtxt *, PyObject *, struct __pyx_obj_4lxml_5etree__ErrorLog *); /*proto*/
3621 static xmlDoc *__pyx_f_4lxml_5etree__handleParseResult(struct __pyx_obj_4lxml_5etree__ParserContext *, xmlParserCtxt *, xmlDoc *, PyObject *, int); /*proto*/
3622 static int __pyx_f_4lxml_5etree__fixHtmlDictNames(xmlDict *, xmlDoc *); /*proto*/
3623 static INLINE int __pyx_f_4lxml_5etree__fixHtmlDictNodeNames(xmlDict *, xmlNode *); /*proto*/
3624 static int __pyx_f_4lxml_5etree__htmlCtxtResetPush(xmlParserCtxt *, char *, int, char *, int); /*proto*/
3625 static xmlDoc *__pyx_f_4lxml_5etree__parseDoc(PyObject *, PyObject *, struct __pyx_obj_4lxml_5etree__BaseParser *); /*proto*/
3626 static xmlDoc *__pyx_f_4lxml_5etree__parseDocFromFile(PyObject *, struct __pyx_obj_4lxml_5etree__BaseParser *); /*proto*/
3627 static xmlDoc *__pyx_f_4lxml_5etree__parseDocFromFilelike(PyObject *, PyObject *, struct __pyx_obj_4lxml_5etree__BaseParser *); /*proto*/
3628 static xmlDoc *__pyx_f_4lxml_5etree__newXMLDoc(void); /*proto*/
3629 static xmlDoc *__pyx_f_4lxml_5etree__newHTMLDoc(void); /*proto*/
3630 static xmlDoc *__pyx_f_4lxml_5etree__copyDoc(xmlDoc *, int); /*proto*/
3631 static xmlDoc *__pyx_f_4lxml_5etree__copyDocRoot(xmlDoc *, xmlNode *); /*proto*/
3632 static xmlNode *__pyx_f_4lxml_5etree__copyNodeToDoc(xmlNode *, xmlDoc *); /*proto*/
3633 static struct LxmlDocument *__pyx_f_4lxml_5etree__parseDocument(PyObject *, struct __pyx_obj_4lxml_5etree__BaseParser *, PyObject *); /*proto*/
3634 static struct LxmlDocument *__pyx_f_4lxml_5etree__parseDocumentFromURL(PyObject *, struct __pyx_obj_4lxml_5etree__BaseParser *); /*proto*/
3635 static struct LxmlDocument *__pyx_f_4lxml_5etree__parseMemoryDocument(PyObject *, PyObject *, struct __pyx_obj_4lxml_5etree__BaseParser *); /*proto*/
3636 static struct LxmlDocument *__pyx_f_4lxml_5etree__parseFilelikeDocument(PyObject *, PyObject *, struct __pyx_obj_4lxml_5etree__BaseParser *); /*proto*/
3637 static void __pyx_f_4lxml_5etree__handleSaxStart(void *, char *, char *, char *, int, char **, int, int, char **); /*proto*/
3638 static void __pyx_f_4lxml_5etree__handleSaxStartNoNs(void *, char *, char **); /*proto*/
3639 static void __pyx_f_4lxml_5etree__handleSaxEnd(void *, char *, char *, char *); /*proto*/
3640 static void __pyx_f_4lxml_5etree__handleSaxEndNoNs(void *, char *); /*proto*/
3641 static void __pyx_f_4lxml_5etree__handleSaxData(void *, char *, int); /*proto*/
3642 static void __pyx_f_4lxml_5etree__handleSaxCData(void *, char *, int); /*proto*/
3643 static void __pyx_f_4lxml_5etree__handleSaxDoctype(void *, char *, char *, char *); /*proto*/
3644 static void __pyx_f_4lxml_5etree__handleSaxPI(void *, char *, char *); /*proto*/
3645 static void __pyx_f_4lxml_5etree__handleSaxComment(void *, char *); /*proto*/
3646 static int __pyx_f_4lxml_5etree__findOutputMethod(PyObject *); /*proto*/
3647 static PyObject *__pyx_f_4lxml_5etree__textToString(xmlNode *, PyObject *, int); /*proto*/
3648 static PyObject *__pyx_f_4lxml_5etree__tostring(struct LxmlElement *, PyObject *, PyObject *, int, int, int, int, int); /*proto*/
3649 static PyObject *__pyx_f_4lxml_5etree__raiseSerialisationError(int); /*proto*/
3650 static void __pyx_f_4lxml_5etree__writeNodeToBuffer(xmlOutputBuffer *, xmlNode *, char *, int, int, int, int, int, int); /*proto*/
3651 static void __pyx_f_4lxml_5etree__writeDeclarationToBuffer(xmlOutputBuffer *, char *, char *, int); /*proto*/
3652 static void __pyx_f_4lxml_5etree__writeDtdToBuffer(xmlOutputBuffer *, xmlDoc *, char *, char *); /*proto*/
3653 static void __pyx_f_4lxml_5etree__writeTail(xmlOutputBuffer *, xmlNode *, char *, int); /*proto*/
3654 static void __pyx_f_4lxml_5etree__writePrevSiblings(xmlOutputBuffer *, xmlNode *, char *, int); /*proto*/
3655 static void __pyx_f_4lxml_5etree__writeNextSiblings(xmlOutputBuffer *, xmlNode *, char *, int); /*proto*/
3656 static int __pyx_f_4lxml_5etree__writeFilelikeWriter(void *, char *, int); /*proto*/
3657 static int __pyx_f_4lxml_5etree__closeFilelikeWriter(void *); /*proto*/
3658 static PyObject *__pyx_f_4lxml_5etree__tofilelike(PyObject *, struct LxmlElement *, PyObject *, PyObject *, int, int, int, int, int, int); /*proto*/
3659 static PyObject *__pyx_f_4lxml_5etree__tofilelikeC14N(PyObject *, struct LxmlElement *, int, int, int); /*proto*/
3660 static PyObject *__pyx_f_4lxml_5etree__dumpToFile(PyObject *, xmlNode *, int, int); /*proto*/
3661 static int __pyx_f_4lxml_5etree__buildIterparseEventFilter(PyObject *); /*proto*/
3662 static int __pyx_f_4lxml_5etree__countNsDefs(xmlNode *); /*proto*/
3663 static int __pyx_f_4lxml_5etree__appendStartNsEvents(xmlNode *, PyObject *); /*proto*/
3664 static INLINE void __pyx_f_4lxml_5etree__pushSaxStartEvent(struct __pyx_obj_4lxml_5etree__IterparseContext *, xmlNode *); /*proto*/
3665 static INLINE void __pyx_f_4lxml_5etree__pushSaxEndEvent(struct __pyx_obj_4lxml_5etree__IterparseContext *, xmlNode *); /*proto*/
3666 static INLINE void __pyx_f_4lxml_5etree__pushSaxEvent(struct __pyx_obj_4lxml_5etree__IterparseContext *, PyObject *, xmlNode *); /*proto*/
3667 static void __pyx_f_4lxml_5etree__iterparseSaxStart(void *, char *, char *, char *, int, char **, int, int, char **); /*proto*/
3668 static void __pyx_f_4lxml_5etree__iterparseSaxEnd(void *, char *, char *, char *); /*proto*/
3669 static void __pyx_f_4lxml_5etree__iterparseSaxStartNoNs(void *, char *, char **); /*proto*/
3670 static void __pyx_f_4lxml_5etree__iterparseSaxEndNoNs(void *, char *); /*proto*/
3671 static void __pyx_f_4lxml_5etree__iterparseSaxComment(void *, char *); /*proto*/
3672 static void __pyx_f_4lxml_5etree__iterparseSaxPI(void *, char *, char *); /*proto*/
3673 static INLINE xmlNode *__pyx_f_4lxml_5etree__iterparseFindLastNode(xmlParserCtxt *); /*proto*/
3674 static void __pyx_f_4lxml_5etree__collectIdHashItemDict(void *, void *, char *); /*proto*/
3675 static void __pyx_f_4lxml_5etree__collectIdHashItemList(void *, void *, char *); /*proto*/
3676 static void __pyx_f_4lxml_5etree__collectIdHashKeys(void *, void *, char *); /*proto*/
3677 static PyObject *__pyx_f_4lxml_5etree__sortedTagList(PyObject *); /*proto*/
3678 static PyObject *__pyx_f_4lxml_5etree__filterSpecialTagNames(PyObject *, int *, int *, int *); /*proto*/
3679 static xmlXPathObject *__pyx_f_4lxml_5etree__wrapXPathObject(PyObject *); /*proto*/
3680 static PyObject *__pyx_f_4lxml_5etree__unwrapXPathObject(xmlXPathObject *, struct LxmlDocument *, int); /*proto*/
3681 static PyObject *__pyx_f_4lxml_5etree__createNodeSetResult(xmlXPathObject *, struct LxmlDocument *, int, int); /*proto*/
3682 static PyObject *__pyx_f_4lxml_5etree__unpackNodeSetEntry(PyObject *, xmlNode *, struct LxmlDocument *, int, int); /*proto*/
3683 static void __pyx_f_4lxml_5etree__freeXPathObject(xmlXPathObject *); /*proto*/
3684 static PyObject *__pyx_f_4lxml_5etree__elementStringResultFactory(PyObject *, struct LxmlElement *, int, int); /*proto*/
3685 static PyObject *__pyx_f_4lxml_5etree__buildElementStringResult(struct LxmlDocument *, xmlNode *, int); /*proto*/
3686 static void __pyx_f_4lxml_5etree__extension_function_call(struct __pyx_obj_4lxml_5etree__BaseContext *, PyObject *, xmlXPathParserContext *, int); /*proto*/
3687 static void __pyx_f_4lxml_5etree__xpath_function_call(xmlXPathParserContext *, int); /*proto*/
3688 static int __pyx_f_4lxml_5etree__register_xpath_function(void *, PyObject *, PyObject *); /*proto*/
3689 static int __pyx_f_4lxml_5etree__unregister_xpath_function(void *, PyObject *, PyObject *); /*proto*/
3690 static PyObject *__pyx_f_4lxml_5etree__initXSLTResolverContext(struct __pyx_obj_4lxml_5etree__XSLTResolverContext *, struct __pyx_obj_4lxml_5etree__BaseParser *); /*proto*/
3691 static xmlDoc *__pyx_f_4lxml_5etree__xslt_resolve_from_python(char *, void *, int, int *); /*proto*/
3692 static void __pyx_f_4lxml_5etree__xslt_store_resolver_exception(char *, void *, xsltLoadType); /*proto*/
3693 static xmlDoc *__pyx_f_4lxml_5etree__xslt_doc_loader(char *, xmlDict *, int, void *, xsltLoadType); /*proto*/
3694 static int __pyx_f_4lxml_5etree__register_xslt_function(void *, PyObject *, PyObject *); /*proto*/
3695 static int __pyx_f_4lxml_5etree__unregister_xslt_function(void *, PyObject *, PyObject *); /*proto*/
3696 static struct __pyx_obj_4lxml_5etree_XSLT *__pyx_f_4lxml_5etree__copyXSLT(struct __pyx_obj_4lxml_5etree_XSLT *); /*proto*/
3697 static PyObject *__pyx_f_4lxml_5etree__xsltResultTreeFactory(struct LxmlDocument *, struct __pyx_obj_4lxml_5etree_XSLT *, struct LxmlDocument *); /*proto*/
3698 static PyObject *__pyx_f_4lxml_5etree__findStylesheetByID(struct LxmlDocument *, PyObject *); /*proto*/
3699 static PyObject *__pyx_f_4lxml_5etree__registerXSLTExtensions(xsltTransformContext *, PyObject *); /*proto*/
3700 static void __pyx_f_4lxml_5etree__callExtensionElement(xsltTransformContext *, xmlNode *, xmlNode *, void *); /*proto*/
3701 static xmlDtd *__pyx_f_4lxml_5etree__parseDtdFromFilelike(PyObject *); /*proto*/
3702 static struct __pyx_obj_4lxml_5etree_DTD *__pyx_f_4lxml_5etree__dtdFactory(xmlDtd *); /*proto*/
3703 DL_EXPORT(struct LxmlElement) *deepcopyNodeToDocument(struct LxmlDocument *, xmlNode *); /*proto*/
3704 DL_EXPORT(struct LxmlElementTree) *elementTreeFactory(struct LxmlElement *); /*proto*/
3705 DL_EXPORT(struct LxmlElementTree) *newElementTree(struct LxmlElement *, PyObject *); /*proto*/
3706 DL_EXPORT(struct LxmlElement) *elementFactory(struct LxmlDocument *, xmlNode *); /*proto*/
3707 DL_EXPORT(struct LxmlElement) *makeElement(PyObject *, struct LxmlDocument *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
3708 DL_EXPORT(struct LxmlElement) *makeSubElement(struct LxmlElement *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
3709 DL_EXPORT(void) setElementClassLookupFunction(_element_class_lookup_function, PyObject *); /*proto*/
3710 DL_EXPORT(PyObject) *lookupDefaultElementClass(PyObject *, PyObject *, xmlNode *); /*proto*/
3711 DL_EXPORT(PyObject) *lookupNamespaceElementClass(PyObject *, PyObject *, xmlNode *); /*proto*/
3712 DL_EXPORT(PyObject) *callLookupFallback(struct LxmlFallbackElementClassLookup *, struct LxmlDocument *, xmlNode *); /*proto*/
3713 DL_EXPORT(int) tagMatches(xmlNode *, char *, char *); /*proto*/
3714 DL_EXPORT(struct LxmlDocument) *documentOrRaise(PyObject *); /*proto*/
3715 DL_EXPORT(struct LxmlElement) *rootNodeOrRaise(PyObject *); /*proto*/
3716 DL_EXPORT(int) hasText(xmlNode *); /*proto*/
3717 DL_EXPORT(int) hasTail(xmlNode *); /*proto*/
3718 DL_EXPORT(PyObject) *textOf(xmlNode *); /*proto*/
3719 DL_EXPORT(PyObject) *tailOf(xmlNode *); /*proto*/
3720 DL_EXPORT(int) setNodeText(xmlNode *, PyObject *); /*proto*/
3721 DL_EXPORT(int) setTailText(xmlNode *, PyObject *); /*proto*/
3722 DL_EXPORT(PyObject) *attributeValue(xmlNode *, xmlAttr *); /*proto*/
3723 DL_EXPORT(PyObject) *attributeValueFromNsName(xmlNode *, char *, char *); /*proto*/
3724 DL_EXPORT(PyObject) *getAttributeValue(struct LxmlElement *, PyObject *, PyObject *); /*proto*/
3725 DL_EXPORT(PyObject) *iterattributes(struct LxmlElement *, int); /*proto*/
3726 DL_EXPORT(PyObject) *collectAttributes(xmlNode *, int); /*proto*/
3727 DL_EXPORT(int) setAttributeValue(struct LxmlElement *, PyObject *, PyObject *); /*proto*/
3728 DL_EXPORT(int) delAttribute(struct LxmlElement *, PyObject *); /*proto*/
3729 DL_EXPORT(int) delAttributeFromNsName(xmlNode *, char *, char *); /*proto*/
3730 DL_EXPORT(int) hasChild(xmlNode *); /*proto*/
3731 DL_EXPORT(xmlNode) *findChild(xmlNode *, Py_ssize_t); /*proto*/
3732 DL_EXPORT(xmlNode) *findChildForwards(xmlNode *, Py_ssize_t); /*proto*/
3733 DL_EXPORT(xmlNode) *findChildBackwards(xmlNode *, Py_ssize_t); /*proto*/
3734 DL_EXPORT(xmlNode) *nextElement(xmlNode *); /*proto*/
3735 DL_EXPORT(xmlNode) *previousElement(xmlNode *); /*proto*/
3736 DL_EXPORT(void) appendChild(struct LxmlElement *, struct LxmlElement *); /*proto*/
3737 DL_EXPORT(PyObject) *pyunicode(char *); /*proto*/
3738 DL_EXPORT(PyObject) *utf8(PyObject *); /*proto*/
3739 DL_EXPORT(PyObject) *getNsTag(PyObject *); /*proto*/
3740 DL_EXPORT(PyObject) *namespacedName(xmlNode *); /*proto*/
3741 DL_EXPORT(PyObject) *namespacedNameFromNsName(char *, char *); /*proto*/
3742 DL_EXPORT(void) iteratorStoreNext(struct LxmlElementIterator *, struct LxmlElement *); /*proto*/
3743 DL_EXPORT(void) initTagMatch(struct LxmlElementTagMatcher *, PyObject *); /*proto*/
3744 DL_EXPORT(xmlNs) *findOrBuildNodeNsPrefix(struct LxmlDocument *, xmlNode *, char *, char *); /*proto*/
3745 #define __Pyx_MODULE_NAME "lxml.etree"
3746 int __pyx_module_is_main_lxml__etree = 0;
3747
3748 /* Implementation of lxml.etree */
3749 static char __pyx_k_2[] = "Returns the name of the root node as defined by the DOCTYPE.";
3750 static char __pyx_k_3[] = "Returns the public ID of the DOCTYPE.";
3751 static char __pyx_k_4[] = "Returns the system ID of the DOCTYPE.";
3752 static char __pyx_k_5[] = "Returns the XML version as declared by the document.";
3753 static char __pyx_k_6[] = "Returns the encoding name as declared by the document.";
3754 static char __pyx_k_7[] = "Returns the standalone flag as declared by the document.  The possible\n        values are True (``standalone='yes'``), False\n        (``standalone='no'`` or flag not provided in the declaration),\n        and None (unknown or no declaration found).  Note that a\n        normal truth test on this value will always tell if the\n        ``standalone`` flag was set to ``'yes'`` or not.\n        ";
3755 static char __pyx_k_8[] = "The source URL of the document (or None if unknown).";
3756 static char __pyx_k_9[] = "Returns a DOCTYPE declaration string for the document.";
3757 static char __pyx_k_10[] = "Returns a DTD validator based on the internal subset of the document.";
3758 static char __pyx_k_11[] = "Returns a DTD validator based on the external subset of the document.";
3759 static char __pyx_k_12[] = "Element tag\n        ";
3760 static char __pyx_k_13[] = "Element attribute dictionary. Where possible, use get(), set(),\n        keys(), values() and items() to access element attributes.\n        ";
3761 static char __pyx_k_14[] = "Text before the first subelement. This is either a string or \n        the value None, if there was no text.\n        ";
3762 static char __pyx_k_15[] = "Text after this element's end tag, but before the next sibling\n        element's start tag. This is either a string or the value None, if\n        there was no text.\n        ";
3763 static char __pyx_k_16[] = "Namespace prefix or None.\n        ";
3764 static char __pyx_k_17[] = "Original line number as found by the parser or None if unknown.\n        ";
3765 static char __pyx_k_18[] = "Namespace prefix->URI mapping known in the context of this Element.\n        ";
3766 static char __pyx_k_19[] = "The base URI of the Element (xml:base or HTML base URL).\n        None if the base URI is unknown.\n\n        Note that the value depends on the URL of the document that\n        holds the Element if there is no xml:base attribute on the\n        Element or its ancestors.\n\n        Setting this property will set an xml:base attribute on the\n        Element, regardless of the document type (XML or HTML).\n        ";
3767 static char __pyx_k_20[] = "Information about the document provided by parser and DTD.  This\n        value is only defined for ElementTree objects based on the root node\n        of a parsed document (e.g.  those returned by the parse functions),\n        not for trees that were built manually.\n        ";
3768 static char __pyx_k_21[] = "The parser that was used to parse the document in this ElementTree.\n        ";
3769 static char __pyx_k_23[] = "Text before the first subelement. This is either a string or the\n        value None, if there was no text.\n        ";
3770 static char __pyx_k_24[] = "Namespace prefix for extension functions.";
3771 static char __pyx_k_25[] = "The error log of the last parser run.\n        ";
3772 static char __pyx_k_26[] = "The custom resolver registry of this parser.";
3773 static char __pyx_k_27[] = "The version of the underlying XML parser.";
3774 static char __pyx_k_30[] = "The error log of the last (or current) run of the feed parser.\n\n        Note that this is local to the feed parser and thus is\n        different from what the ``error_log`` property returns.\n        ";
3775 static char __pyx_k_31[] = "The error log of the last (or current) parser run.\n        ";
3776 static char __pyx_k_32[] = "The access control configuration as a map of options.";
3777 static char __pyx_k_33[] = "The log of errors and warnings of an XSLT execution.";
3778 static char __pyx_k_34[] = "Return an ElementTree with profiling data for the stylesheet run.\n        ";
3779 static char __pyx_k_35[] = "The log of validation errors and warnings.";
3780 static char __pyx_k_37[] = "restructuredtext en";
3781 static char __pyx_k_41[] = "UTF-8";
3782 static char __pyx_k_42[] = "http://www.w3.org/1999/xhtml";
3783 static char __pyx_k_44[] = "http://www.w3.org/1999/XSL/Transform";
3784 static char __pyx_k_46[] = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
3785 static char __pyx_k_48[] = "http://schemas.xmlsoap.org/wsdl/";
3786 static char __pyx_k_50[] = "http://www.w3.org/2001/XMLSchema";
3787 static char __pyx_k_52[] = "http://www.w3.org/2001/XMLSchema-instance";
3788 static char __pyx_k_54[] = "http://purl.org/dc/elements/1.1/";
3789 static char __pyx_k_56[] = "http://codespeak.net/lxml/objectify/pytype";
3790 static char __pyx_k_58[] = "Main exception base class for lxml.  All other exceptions inherit from\n    this one.\n    ";
3791 static char __pyx_k_59[] = "Base class for all syntax errors.\n    ";
3792 static char __pyx_k_61[] = "Error during C14N serialisation.\n    ";
3793 static char __pyx_k_62[] = "[0-9]+";
3794 static char __pyx_k_64[] = "Unknown libxml2 version: %s";
3795 static char __pyx_k_68[] = "^(\\s*<\\?\\s*xml[^>]+)\\s+encoding\\s*=\\s*\"[^\"]*\"\\s*";
3796 static char __pyx_k_69[] = "Libxml2 error levels";
3797 static char __pyx_k_70[] = "Libxml2 error domains";
3798 static char __pyx_k_71[] = "Libxml2 error types";
3799 static char __pyx_k_72[] = "Libxml2 RelaxNG error types";
3800 static char __pyx_k_73[] = "NONE=0\nWARNING=1\nERROR=2\nFATAL=3\n";
3801 static char __pyx_k_74[] = "NONE=0\nPARSER=1\nTREE=2\nNAMESPACE=3\nDTD=4\nHTML=5\nMEMORY=6\nOUTPUT=7\nIO=8\nFTP=9\nHTTP=10\nXINCLUDE=11\nXPATH=12\nXPOINTER=13\nREGEXP=14\nDATATYPE=15\nSCHEMASP=16\nSCHEMASV=17\nRELAXNGP=18\nRELAXNGV=19\nCATALOG=20\nC14N=21\nXSLT=22\nVALID=23\nCHECK=24\nWRITER=25\nMODULE=26\nI18N=27\nSCHEMATRONV=28\n";
3802 static char __pyx_k_75[] = "ERR_OK=0\nERR_INTERNAL_ERROR=1\nERR_NO_MEMORY=2\nERR_DOCUMENT_START=3\nERR_DOCUMENT_EMPTY=4\nERR_DOCUMENT_END=5\nERR_INVALID_HEX_CHARREF=6\nERR_INVALID_DEC_CHARREF=7\nERR_INVALID_CHARREF=8\nERR_INVALID_CHAR=9\nERR_CHARREF_AT_EOF=10\nERR_CHARREF_IN_PROLOG=11\nERR_CHARREF_IN_EPILOG=12\nERR_CHARREF_IN_DTD=13\nERR_ENTITYREF_AT_EOF=14\nERR_ENTITYREF_IN_PROLOG=15\nERR_ENTITYREF_IN_EPILOG=16\nERR_ENTITYREF_IN_DTD=17\nERR_PEREF_AT_EOF=18\nERR_PEREF_IN_PROLOG=19\nERR_PEREF_IN_EPILOG=20\nERR_PEREF_IN_INT_SUBSET=21\nERR_ENTITYREF_NO_NAME=22\nERR_ENTITYREF_SEMICOL_MISSING=23\nERR_PEREF_NO_NAME=24\nERR_PEREF_SEMICOL_MISSING=25\nERR_UNDECLARED_ENTITY=26\nWAR_UNDECLARED_ENTITY=27\nERR_UNPARSED_ENTITY=28\nERR_ENTITY_IS_EXTERNAL=29\nERR_ENTITY_IS_PARAMETER=30\nERR_UNKNOWN_ENCODING=31\nERR_UNSUPPORTED_ENCODING=32\nERR_STRING_NOT_STARTED=33\nERR_STRING_NOT_CLOSED=34\nERR_NS_DECL_ERROR=35\nERR_ENTITY_NOT_STARTED=36\nERR_ENTITY_NOT_FINISHED=37\nERR_LT_IN_ATTRIBUTE=38\nERR_ATTRIBUTE_NOT_STARTED=39\nERR_ATTRIBUTE_NOT_FINISHED=40\nERR_ATTRIBUTE_WITHOUT_VALUE=41\nERR_ATTRIBUTE_REDEFINED=42\nERR_LITERAL_NOT_STARTED=43\nERR_LITERAL_NOT_FINISHED=44\nERR_COMMENT_NOT_FINISHED=45\nERR_PI_NOT_STARTED=46\nERR_PI_NOT_FINISHED=47\nERR_NOTATION_NOT_STARTED=48\nERR_NOTATION_NOT_FINISHED=49\nERR_ATTLIST_NOT_STARTED=50\nERR_ATTLIST_NOT_FINISHED=51\nERR_MIXED_NOT_STARTED=52\nERR_MIXED_NOT_FINISHED=53\nERR_ELEMCONTENT_NOT_STARTED=54\nERR_ELEMCONTENT_NOT_FINISHED=55\nERR_XMLDECL_NOT_STARTED=56\nERR_XMLDECL_NOT_FINISHED=57\nERR_CONDSEC_NOT_STARTED=58\nERR_CONDSEC_NOT_FINISHED=59\nERR_EXT_SUBSET_NOT_FINISHED=60\nERR_DOCTYPE_NOT_FINISHED=61\nERR_MISPLACED_CDATA_END=62\nERR_CDATA_NOT_FINISHED=63\nERR_RESERVED_XML_NAME=64\nERR_SPACE_REQUIRED=65\nERR_SEPARATOR_REQUIRED=66\nERR_NMTOKEN_REQUIRED=67\nERR_NAME_REQUIRED=68\nERR_PCDATA_REQUIRED=69\nERR_URI_REQUIRED=70\nERR_PUBID_REQUIRED=71\nERR_LT_REQUIRED=72\nERR_GT_REQUIRED=73\nERR_LTSLASH_REQUIRED=74\nERR_EQUAL_REQUIRED=75\nERR_TAG_NAME_MISMATCH=76\nERR_TAG_NOT_FINISHED=77\nERR_STANDALONE_VALUE=78\n";
3803 static char __pyx_k_76[] = "ERR_ENCODING_NAME=79\nERR_HYPHEN_IN_COMMENT=80\nERR_INVALID_ENCODING=81\nERR_EXT_ENTITY_STANDALONE=82\nERR_CONDSEC_INVALID=83\nERR_VALUE_REQUIRED=84\nERR_NOT_WELL_BALANCED=85\nERR_EXTRA_CONTENT=86\nERR_ENTITY_CHAR_ERROR=87\nERR_ENTITY_PE_INTERNAL=88\nERR_ENTITY_LOOP=89\nERR_ENTITY_BOUNDARY=90\nERR_INVALID_URI=91\nERR_URI_FRAGMENT=92\nWAR_CATALOG_PI=93\nERR_NO_DTD=94\nERR_CONDSEC_INVALID_KEYWORD=95\nERR_VERSION_MISSING=96\nWAR_UNKNOWN_VERSION=97\nWAR_LANG_VALUE=98\nWAR_NS_URI=99\nWAR_NS_URI_RELATIVE=100\nERR_MISSING_ENCODING=101\nWAR_SPACE_VALUE=102\nERR_NOT_STANDALONE=103\nERR_ENTITY_PROCESSING=104\nERR_NOTATION_PROCESSING=105\nWAR_NS_COLUMN=106\nWAR_ENTITY_REDEFINED=107\nERR_UNKNOWN_VERSION=108\nERR_VERSION_MISMATCH=109\nNS_ERR_XML_NAMESPACE=200\nNS_ERR_UNDEFINED_NAMESPACE=201\nNS_ERR_QNAME=202\nNS_ERR_ATTRIBUTE_REDEFINED=203\nNS_ERR_EMPTY=204\nNS_ERR_COLON=205\nDTD_ATTRIBUTE_DEFAULT=500\nDTD_ATTRIBUTE_REDEFINED=501\nDTD_ATTRIBUTE_VALUE=502\nDTD_CONTENT_ERROR=503\nDTD_CONTENT_MODEL=504\nDTD_CONTENT_NOT_DETERMINIST=505\nDTD_DIFFERENT_PREFIX=506\nDTD_ELEM_DEFAULT_NAMESPACE=507\nDTD_ELEM_NAMESPACE=508\nDTD_ELEM_REDEFINED=509\nDTD_EMPTY_NOTATION=510\nDTD_ENTITY_TYPE=511\nDTD_ID_FIXED=512\nDTD_ID_REDEFINED=513\nDTD_ID_SUBSET=514\nDTD_INVALID_CHILD=515\nDTD_INVALID_DEFAULT=516\nDTD_LOAD_ERROR=517\nDTD_MISSING_ATTRIBUTE=518\nDTD_MIXED_CORRUPT=519\nDTD_MULTIPLE_ID=520\nDTD_NO_DOC=521\nDTD_NO_DTD=522\nDTD_NO_ELEM_NAME=523\nDTD_NO_PREFIX=524\nDTD_NO_ROOT=525\nDTD_NOTATION_REDEFINED=526\nDTD_NOTATION_VALUE=527\nDTD_NOT_EMPTY=528\nDTD_NOT_PCDATA=529\nDTD_NOT_STANDALONE=530\nDTD_ROOT_NAME=531\nDTD_STANDALONE_WHITE_SPACE=532\nDTD_UNKNOWN_ATTRIBUTE=533\nDTD_UNKNOWN_ELEM=534\nDTD_UNKNOWN_ENTITY=535\nDTD_UNKNOWN_ID=536\nDTD_UNKNOWN_NOTATION=537\nDTD_STANDALONE_DEFAULTED=538\nDTD_XMLID_VALUE=539\nDTD_XMLID_TYPE=540\nDTD_DUP_TOKEN=541\nHTML_STRUCURE_ERROR=800\nHTML_UNKNOWN_TAG=801\nRNGP_ANYNAME_ATTR_ANCESTOR=1000\nRNGP_ATTR_CONFLICT=1001\nRNGP_ATTRIBUTE_CHILDREN=1002\nRNGP_ATTRIBUTE_CONTENT=1003\n";
3804 static char __pyx_k_77[] = "RNGP_ATTRIBUTE_EMPTY=1004\nRNGP_ATTRIBUTE_NOOP=1005\nRNGP_CHOICE_CONTENT=1006\nRNGP_CHOICE_EMPTY=1007\nRNGP_CREATE_FAILURE=1008\nRNGP_DATA_CONTENT=1009\nRNGP_DEF_CHOICE_AND_INTERLEAVE=1010\nRNGP_DEFINE_CREATE_FAILED=1011\nRNGP_DEFINE_EMPTY=1012\nRNGP_DEFINE_MISSING=1013\nRNGP_DEFINE_NAME_MISSING=1014\nRNGP_ELEM_CONTENT_EMPTY=1015\nRNGP_ELEM_CONTENT_ERROR=1016\nRNGP_ELEMENT_EMPTY=1017\nRNGP_ELEMENT_CONTENT=1018\nRNGP_ELEMENT_NAME=1019\nRNGP_ELEMENT_NO_CONTENT=1020\nRNGP_ELEM_TEXT_CONFLICT=1021\nRNGP_EMPTY=1022\nRNGP_EMPTY_CONSTRUCT=1023\nRNGP_EMPTY_CONTENT=1024\nRNGP_EMPTY_NOT_EMPTY=1025\nRNGP_ERROR_TYPE_LIB=1026\nRNGP_EXCEPT_EMPTY=1027\nRNGP_EXCEPT_MISSING=1028\nRNGP_EXCEPT_MULTIPLE=1029\nRNGP_EXCEPT_NO_CONTENT=1030\nRNGP_EXTERNALREF_EMTPY=1031\nRNGP_EXTERNAL_REF_FAILURE=1032\nRNGP_EXTERNALREF_RECURSE=1033\nRNGP_FORBIDDEN_ATTRIBUTE=1034\nRNGP_FOREIGN_ELEMENT=1035\nRNGP_GRAMMAR_CONTENT=1036\nRNGP_GRAMMAR_EMPTY=1037\nRNGP_GRAMMAR_MISSING=1038\nRNGP_GRAMMAR_NO_START=1039\nRNGP_GROUP_ATTR_CONFLICT=1040\nRNGP_HREF_ERROR=1041\nRNGP_INCLUDE_EMPTY=1042\nRNGP_INCLUDE_FAILURE=1043\nRNGP_INCLUDE_RECURSE=1044\nRNGP_INTERLEAVE_ADD=1045\nRNGP_INTERLEAVE_CREATE_FAILED=1046\nRNGP_INTERLEAVE_EMPTY=1047\nRNGP_INTERLEAVE_NO_CONTENT=1048\nRNGP_INVALID_DEFINE_NAME=1049\nRNGP_INVALID_URI=1050\nRNGP_INVALID_VALUE=1051\nRNGP_MISSING_HREF=1052\nRNGP_NAME_MISSING=1053\nRNGP_NEED_COMBINE=1054\nRNGP_NOTALLOWED_NOT_EMPTY=1055\nRNGP_NSNAME_ATTR_ANCESTOR=1056\nRNGP_NSNAME_NO_NS=1057\nRNGP_PARAM_FORBIDDEN=1058\nRNGP_PARAM_NAME_MISSING=1059\nRNGP_PARENTREF_CREATE_FAILED=1060\nRNGP_PARENTREF_NAME_INVALID=1061\nRNGP_PARENTREF_NO_NAME=1062\nRNGP_PARENTREF_NO_PARENT=1063\nRNGP_PARENTREF_NOT_EMPTY=1064\nRNGP_PARSE_ERROR=1065\nRNGP_PAT_ANYNAME_EXCEPT_ANYNAME=1066\nRNGP_PAT_ATTR_ATTR=1067\nRNGP_PAT_ATTR_ELEM=1068\nRNGP_PAT_DATA_EXCEPT_ATTR=1069\nRNGP_PAT_DATA_EXCEPT_ELEM=1070\nRNGP_PAT_DATA_EXCEPT_EMPTY=1071\nRNGP_PAT_DATA_EXCEPT_GROUP=1072\nRNGP_PAT_DATA_EXCEPT_INTERLEAVE=1073\nRNGP_PAT_DATA_EXCEPT_LIST=1074\n";
3805 static char __pyx_k_78[] = "RNGP_PAT_DATA_EXCEPT_ONEMORE=1075\nRNGP_PAT_DATA_EXCEPT_REF=1076\nRNGP_PAT_DATA_EXCEPT_TEXT=1077\nRNGP_PAT_LIST_ATTR=1078\nRNGP_PAT_LIST_ELEM=1079\nRNGP_PAT_LIST_INTERLEAVE=1080\nRNGP_PAT_LIST_LIST=1081\nRNGP_PAT_LIST_REF=1082\nRNGP_PAT_LIST_TEXT=1083\nRNGP_PAT_NSNAME_EXCEPT_ANYNAME=1084\nRNGP_PAT_NSNAME_EXCEPT_NSNAME=1085\nRNGP_PAT_ONEMORE_GROUP_ATTR=1086\nRNGP_PAT_ONEMORE_INTERLEAVE_ATTR=1087\nRNGP_PAT_START_ATTR=1088\nRNGP_PAT_START_DATA=1089\nRNGP_PAT_START_EMPTY=1090\nRNGP_PAT_START_GROUP=1091\nRNGP_PAT_START_INTERLEAVE=1092\nRNGP_PAT_START_LIST=1093\nRNGP_PAT_START_ONEMORE=1094\nRNGP_PAT_START_TEXT=1095\nRNGP_PAT_START_VALUE=1096\nRNGP_PREFIX_UNDEFINED=1097\nRNGP_REF_CREATE_FAILED=1098\nRNGP_REF_CYCLE=1099\nRNGP_REF_NAME_INVALID=1100\nRNGP_REF_NO_DEF=1101\nRNGP_REF_NO_NAME=1102\nRNGP_REF_NOT_EMPTY=1103\nRNGP_START_CHOICE_AND_INTERLEAVE=1104\nRNGP_START_CONTENT=1105\nRNGP_START_EMPTY=1106\nRNGP_START_MISSING=1107\nRNGP_TEXT_EXPECTED=1108\nRNGP_TEXT_HAS_CHILD=1109\nRNGP_TYPE_MISSING=1110\nRNGP_TYPE_NOT_FOUND=1111\nRNGP_TYPE_VALUE=1112\nRNGP_UNKNOWN_ATTRIBUTE=1113\nRNGP_UNKNOWN_COMBINE=1114\nRNGP_UNKNOWN_CONSTRUCT=1115\nRNGP_UNKNOWN_TYPE_LIB=1116\nRNGP_URI_FRAGMENT=1117\nRNGP_URI_NOT_ABSOLUTE=1118\nRNGP_VALUE_EMPTY=1119\nRNGP_VALUE_NO_CONTENT=1120\nRNGP_XMLNS_NAME=1121\nRNGP_XML_NS=1122\nXPATH_EXPRESSION_OK=1200\nXPATH_NUMBER_ERROR=1201\nXPATH_UNFINISHED_LITERAL_ERROR=1202\nXPATH_START_LITERAL_ERROR=1203\nXPATH_VARIABLE_REF_ERROR=1204\nXPATH_UNDEF_VARIABLE_ERROR=1205\nXPATH_INVALID_PREDICATE_ERROR=1206\nXPATH_EXPR_ERROR=1207\nXPATH_UNCLOSED_ERROR=1208\nXPATH_UNKNOWN_FUNC_ERROR=1209\nXPATH_INVALID_OPERAND=1210\nXPATH_INVALID_TYPE=1211\nXPATH_INVALID_ARITY=1212\nXPATH_INVALID_CTXT_SIZE=1213\nXPATH_INVALID_CTXT_POSITION=1214\nXPATH_MEMORY_ERROR=1215\nXPTR_SYNTAX_ERROR=1216\nXPTR_RESOURCE_ERROR=1217\nXPTR_SUB_RESOURCE_ERROR=1218\nXPATH_UNDEF_PREFIX_ERROR=1219\nXPATH_ENCODING_ERROR=1220\nXPATH_INVALID_CHAR_ERROR=1221\nTREE_INVALID_HEX=1300\nTREE_INVALID_DEC=1301\nTREE_UNTERMINATED_ENTITY=1302\n";
3806 static char __pyx_k_79[] = "TREE_NOT_UTF8=1303\nSAVE_NOT_UTF8=1400\nSAVE_CHAR_INVALID=1401\nSAVE_NO_DOCTYPE=1402\nSAVE_UNKNOWN_ENCODING=1403\nREGEXP_COMPILE_ERROR=1450\nIO_UNKNOWN=1500\nIO_EACCES=1501\nIO_EAGAIN=1502\nIO_EBADF=1503\nIO_EBADMSG=1504\nIO_EBUSY=1505\nIO_ECANCELED=1506\nIO_ECHILD=1507\nIO_EDEADLK=1508\nIO_EDOM=1509\nIO_EEXIST=1510\nIO_EFAULT=1511\nIO_EFBIG=1512\nIO_EINPROGRESS=1513\nIO_EINTR=1514\nIO_EINVAL=1515\nIO_EIO=1516\nIO_EISDIR=1517\nIO_EMFILE=1518\nIO_EMLINK=1519\nIO_EMSGSIZE=1520\nIO_ENAMETOOLONG=1521\nIO_ENFILE=1522\nIO_ENODEV=1523\nIO_ENOENT=1524\nIO_ENOEXEC=1525\nIO_ENOLCK=1526\nIO_ENOMEM=1527\nIO_ENOSPC=1528\nIO_ENOSYS=1529\nIO_ENOTDIR=1530\nIO_ENOTEMPTY=1531\nIO_ENOTSUP=1532\nIO_ENOTTY=1533\nIO_ENXIO=1534\nIO_EPERM=1535\nIO_EPIPE=1536\nIO_ERANGE=1537\nIO_EROFS=1538\nIO_ESPIPE=1539\nIO_ESRCH=1540\nIO_ETIMEDOUT=1541\nIO_EXDEV=1542\nIO_NETWORK_ATTEMPT=1543\nIO_ENCODER=1544\nIO_FLUSH=1545\nIO_WRITE=1546\nIO_NO_INPUT=1547\nIO_BUFFER_FULL=1548\nIO_LOAD_ERROR=1549\nIO_ENOTSOCK=1550\nIO_EISCONN=1551\nIO_ECONNREFUSED=1552\nIO_ENETUNREACH=1553\nIO_EADDRINUSE=1554\nIO_EALREADY=1555\nIO_EAFNOSUPPORT=1556\nXINCLUDE_RECURSION=1600\nXINCLUDE_PARSE_VALUE=1601\nXINCLUDE_ENTITY_DEF_MISMATCH=1602\nXINCLUDE_NO_HREF=1603\nXINCLUDE_NO_FALLBACK=1604\nXINCLUDE_HREF_URI=1605\nXINCLUDE_TEXT_FRAGMENT=1606\nXINCLUDE_TEXT_DOCUMENT=1607\nXINCLUDE_INVALID_CHAR=1608\nXINCLUDE_BUILD_FAILED=1609\nXINCLUDE_UNKNOWN_ENCODING=1610\nXINCLUDE_MULTIPLE_ROOT=1611\nXINCLUDE_XPTR_FAILED=1612\nXINCLUDE_XPTR_RESULT=1613\nXINCLUDE_INCLUDE_IN_INCLUDE=1614\nXINCLUDE_FALLBACKS_IN_INCLUDE=1615\nXINCLUDE_FALLBACK_NOT_IN_INCLUDE=1616\nXINCLUDE_DEPRECATED_NS=1617\nXINCLUDE_FRAGMENT_ID=1618\nCATALOG_MISSING_ATTR=1650\nCATALOG_ENTRY_BROKEN=1651\nCATALOG_PREFER_VALUE=1652\nCATALOG_NOT_CATALOG=1653\nCATALOG_RECURSION=1654\nSCHEMAP_PREFIX_UNDEFINED=1700\nSCHEMAP_ATTRFORMDEFAULT_VALUE=1701\nSCHEMAP_ATTRGRP_NONAME_NOREF=1702\nSCHEMAP_ATTR_NONAME_NOREF=1703\nSCHEMAP_COMPLEXTYPE_NONAME_NOREF=1704\nSCHEMAP_ELEMFORMDEFAULT_VALUE=1705\nSCHEMAP_ELEM_NONAME_NOREF=1706\n";
3807 static char __pyx_k_80[] = "SCHEMAP_EXTENSION_NO_BASE=1707\nSCHEMAP_FACET_NO_VALUE=1708\nSCHEMAP_FAILED_BUILD_IMPORT=1709\nSCHEMAP_GROUP_NONAME_NOREF=1710\nSCHEMAP_IMPORT_NAMESPACE_NOT_URI=1711\nSCHEMAP_IMPORT_REDEFINE_NSNAME=1712\nSCHEMAP_IMPORT_SCHEMA_NOT_URI=1713\nSCHEMAP_INVALID_BOOLEAN=1714\nSCHEMAP_INVALID_ENUM=1715\nSCHEMAP_INVALID_FACET=1716\nSCHEMAP_INVALID_FACET_VALUE=1717\nSCHEMAP_INVALID_MAXOCCURS=1718\nSCHEMAP_INVALID_MINOCCURS=1719\nSCHEMAP_INVALID_REF_AND_SUBTYPE=1720\nSCHEMAP_INVALID_WHITE_SPACE=1721\nSCHEMAP_NOATTR_NOREF=1722\nSCHEMAP_NOTATION_NO_NAME=1723\nSCHEMAP_NOTYPE_NOREF=1724\nSCHEMAP_REF_AND_SUBTYPE=1725\nSCHEMAP_RESTRICTION_NONAME_NOREF=1726\nSCHEMAP_SIMPLETYPE_NONAME=1727\nSCHEMAP_TYPE_AND_SUBTYPE=1728\nSCHEMAP_UNKNOWN_ALL_CHILD=1729\nSCHEMAP_UNKNOWN_ANYATTRIBUTE_CHILD=1730\nSCHEMAP_UNKNOWN_ATTR_CHILD=1731\nSCHEMAP_UNKNOWN_ATTRGRP_CHILD=1732\nSCHEMAP_UNKNOWN_ATTRIBUTE_GROUP=1733\nSCHEMAP_UNKNOWN_BASE_TYPE=1734\nSCHEMAP_UNKNOWN_CHOICE_CHILD=1735\nSCHEMAP_UNKNOWN_COMPLEXCONTENT_CHILD=1736\nSCHEMAP_UNKNOWN_COMPLEXTYPE_CHILD=1737\nSCHEMAP_UNKNOWN_ELEM_CHILD=1738\nSCHEMAP_UNKNOWN_EXTENSION_CHILD=1739\nSCHEMAP_UNKNOWN_FACET_CHILD=1740\nSCHEMAP_UNKNOWN_FACET_TYPE=1741\nSCHEMAP_UNKNOWN_GROUP_CHILD=1742\nSCHEMAP_UNKNOWN_IMPORT_CHILD=1743\nSCHEMAP_UNKNOWN_LIST_CHILD=1744\nSCHEMAP_UNKNOWN_NOTATION_CHILD=1745\nSCHEMAP_UNKNOWN_PROCESSCONTENT_CHILD=1746\nSCHEMAP_UNKNOWN_REF=1747\nSCHEMAP_UNKNOWN_RESTRICTION_CHILD=1748\nSCHEMAP_UNKNOWN_SCHEMAS_CHILD=1749\nSCHEMAP_UNKNOWN_SEQUENCE_CHILD=1750\nSCHEMAP_UNKNOWN_SIMPLECONTENT_CHILD=1751\nSCHEMAP_UNKNOWN_SIMPLETYPE_CHILD=1752\nSCHEMAP_UNKNOWN_TYPE=1753\nSCHEMAP_UNKNOWN_UNION_CHILD=1754\nSCHEMAP_ELEM_DEFAULT_FIXED=1755\nSCHEMAP_REGEXP_INVALID=1756\nSCHEMAP_FAILED_LOAD=1757\nSCHEMAP_NOTHING_TO_PARSE=1758\nSCHEMAP_NOROOT=1759\nSCHEMAP_REDEFINED_GROUP=1760\nSCHEMAP_REDEFINED_TYPE=1761\nSCHEMAP_REDEFINED_ELEMENT=1762\nSCHEMAP_REDEFINED_ATTRGROUP=1763\nSCHEMAP_REDEFINED_ATTR=1764\nSCHEMAP_REDEFINED_NOTATION=1765\nSCHEMAP_FAILED_PARSE=1766\nSCHEMAP_UNKNOWN_PREFIX=1767\n";
3808 static char __pyx_k_81[] = "SCHEMAP_DEF_AND_PREFIX=1768\nSCHEMAP_UNKNOWN_INCLUDE_CHILD=1769\nSCHEMAP_INCLUDE_SCHEMA_NOT_URI=1770\nSCHEMAP_INCLUDE_SCHEMA_NO_URI=1771\nSCHEMAP_NOT_SCHEMA=1772\nSCHEMAP_UNKNOWN_MEMBER_TYPE=1773\nSCHEMAP_INVALID_ATTR_USE=1774\nSCHEMAP_RECURSIVE=1775\nSCHEMAP_SUPERNUMEROUS_LIST_ITEM_TYPE=1776\nSCHEMAP_INVALID_ATTR_COMBINATION=1777\nSCHEMAP_INVALID_ATTR_INLINE_COMBINATION=1778\nSCHEMAP_MISSING_SIMPLETYPE_CHILD=1779\nSCHEMAP_INVALID_ATTR_NAME=1780\nSCHEMAP_REF_AND_CONTENT=1781\nSCHEMAP_CT_PROPS_CORRECT_1=1782\nSCHEMAP_CT_PROPS_CORRECT_2=1783\nSCHEMAP_CT_PROPS_CORRECT_3=1784\nSCHEMAP_CT_PROPS_CORRECT_4=1785\nSCHEMAP_CT_PROPS_CORRECT_5=1786\nSCHEMAP_DERIVATION_OK_RESTRICTION_1=1787\nSCHEMAP_DERIVATION_OK_RESTRICTION_2_1_1=1788\nSCHEMAP_DERIVATION_OK_RESTRICTION_2_1_2=1789\nSCHEMAP_DERIVATION_OK_RESTRICTION_2_2=1790\nSCHEMAP_DERIVATION_OK_RESTRICTION_3=1791\nSCHEMAP_WILDCARD_INVALID_NS_MEMBER=1792\nSCHEMAP_INTERSECTION_NOT_EXPRESSIBLE=1793\nSCHEMAP_UNION_NOT_EXPRESSIBLE=1794\nSCHEMAP_SRC_IMPORT_3_1=1795\nSCHEMAP_SRC_IMPORT_3_2=1796\nSCHEMAP_DERIVATION_OK_RESTRICTION_4_1=1797\nSCHEMAP_DERIVATION_OK_RESTRICTION_4_2=1798\nSCHEMAP_DERIVATION_OK_RESTRICTION_4_3=1799\nSCHEMAP_COS_CT_EXTENDS_1_3=1800\nSCHEMAV_NOROOT=1801\nSCHEMAV_UNDECLAREDELEM=1802\nSCHEMAV_NOTTOPLEVEL=1803\nSCHEMAV_MISSING=1804\nSCHEMAV_WRONGELEM=1805\nSCHEMAV_NOTYPE=1806\nSCHEMAV_NOROLLBACK=1807\nSCHEMAV_ISABSTRACT=1808\nSCHEMAV_NOTEMPTY=1809\nSCHEMAV_ELEMCONT=1810\nSCHEMAV_HAVEDEFAULT=1811\nSCHEMAV_NOTNILLABLE=1812\nSCHEMAV_EXTRACONTENT=1813\nSCHEMAV_INVALIDATTR=1814\nSCHEMAV_INVALIDELEM=1815\nSCHEMAV_NOTDETERMINIST=1816\nSCHEMAV_CONSTRUCT=1817\nSCHEMAV_INTERNAL=1818\nSCHEMAV_NOTSIMPLE=1819\nSCHEMAV_ATTRUNKNOWN=1820\nSCHEMAV_ATTRINVALID=1821\nSCHEMAV_VALUE=1822\nSCHEMAV_FACET=1823\nSCHEMAV_CVC_DATATYPE_VALID_1_2_1=1824\nSCHEMAV_CVC_DATATYPE_VALID_1_2_2=1825\nSCHEMAV_CVC_DATATYPE_VALID_1_2_3=1826\nSCHEMAV_CVC_TYPE_3_1_1=1827\nSCHEMAV_CVC_TYPE_3_1_2=1828\nSCHEMAV_CVC_FACET_VALID=1829\nSCHEMAV_CVC_LENGTH_VALID=1830\n";
3809 static char __pyx_k_82[] = "SCHEMAV_CVC_MINLENGTH_VALID=1831\nSCHEMAV_CVC_MAXLENGTH_VALID=1832\nSCHEMAV_CVC_MININCLUSIVE_VALID=1833\nSCHEMAV_CVC_MAXINCLUSIVE_VALID=1834\nSCHEMAV_CVC_MINEXCLUSIVE_VALID=1835\nSCHEMAV_CVC_MAXEXCLUSIVE_VALID=1836\nSCHEMAV_CVC_TOTALDIGITS_VALID=1837\nSCHEMAV_CVC_FRACTIONDIGITS_VALID=1838\nSCHEMAV_CVC_PATTERN_VALID=1839\nSCHEMAV_CVC_ENUMERATION_VALID=1840\nSCHEMAV_CVC_COMPLEX_TYPE_2_1=1841\nSCHEMAV_CVC_COMPLEX_TYPE_2_2=1842\nSCHEMAV_CVC_COMPLEX_TYPE_2_3=1843\nSCHEMAV_CVC_COMPLEX_TYPE_2_4=1844\nSCHEMAV_CVC_ELT_1=1845\nSCHEMAV_CVC_ELT_2=1846\nSCHEMAV_CVC_ELT_3_1=1847\nSCHEMAV_CVC_ELT_3_2_1=1848\nSCHEMAV_CVC_ELT_3_2_2=1849\nSCHEMAV_CVC_ELT_4_1=1850\nSCHEMAV_CVC_ELT_4_2=1851\nSCHEMAV_CVC_ELT_4_3=1852\nSCHEMAV_CVC_ELT_5_1_1=1853\nSCHEMAV_CVC_ELT_5_1_2=1854\nSCHEMAV_CVC_ELT_5_2_1=1855\nSCHEMAV_CVC_ELT_5_2_2_1=1856\nSCHEMAV_CVC_ELT_5_2_2_2_1=1857\nSCHEMAV_CVC_ELT_5_2_2_2_2=1858\nSCHEMAV_CVC_ELT_6=1859\nSCHEMAV_CVC_ELT_7=1860\nSCHEMAV_CVC_ATTRIBUTE_1=1861\nSCHEMAV_CVC_ATTRIBUTE_2=1862\nSCHEMAV_CVC_ATTRIBUTE_3=1863\nSCHEMAV_CVC_ATTRIBUTE_4=1864\nSCHEMAV_CVC_COMPLEX_TYPE_3_1=1865\nSCHEMAV_CVC_COMPLEX_TYPE_3_2_1=1866\nSCHEMAV_CVC_COMPLEX_TYPE_3_2_2=1867\nSCHEMAV_CVC_COMPLEX_TYPE_4=1868\nSCHEMAV_CVC_COMPLEX_TYPE_5_1=1869\nSCHEMAV_CVC_COMPLEX_TYPE_5_2=1870\nSCHEMAV_ELEMENT_CONTENT=1871\nSCHEMAV_DOCUMENT_ELEMENT_MISSING=1872\nSCHEMAV_CVC_COMPLEX_TYPE_1=1873\nSCHEMAV_CVC_AU=1874\nSCHEMAV_CVC_TYPE_1=1875\nSCHEMAV_CVC_TYPE_2=1876\nSCHEMAV_CVC_IDC=1877\nSCHEMAV_CVC_WILDCARD=1878\nSCHEMAV_MISC=1879\nXPTR_UNKNOWN_SCHEME=1900\nXPTR_CHILDSEQ_START=1901\nXPTR_EVAL_FAILED=1902\nXPTR_EXTRA_OBJECTS=1903\nC14N_CREATE_CTXT=1950\nC14N_REQUIRES_UTF8=1951\nC14N_CREATE_STACK=1952\nC14N_INVALID_NODE=1953\nC14N_UNKNOW_NODE=1954\nC14N_RELATIVE_NAMESPACE=1955\nFTP_PASV_ANSWER=2000\nFTP_EPSV_ANSWER=2001\nFTP_ACCNT=2002\nFTP_URL_SYNTAX=2003\nHTTP_URL_SYNTAX=2020\nHTTP_USE_IP=2021\nHTTP_UNKNOWN_HOST=2022\nSCHEMAP_SRC_SIMPLE_TYPE_1=3000\nSCHEMAP_SRC_SIMPLE_TYPE_2=3001\nSCHEMAP_SRC_SIMPLE_TYPE_3=3002\nSCHEMAP_SRC_SIMPLE_TYPE_4=3003\n";
3810 static char __pyx_k_83[] = "SCHEMAP_SRC_RESOLVE=3004\nSCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPE=3005\nSCHEMAP_SRC_LIST_ITEMTYPE_OR_SIMPLETYPE=3006\nSCHEMAP_SRC_UNION_MEMBERTYPES_OR_SIMPLETYPES=3007\nSCHEMAP_ST_PROPS_CORRECT_1=3008\nSCHEMAP_ST_PROPS_CORRECT_2=3009\nSCHEMAP_ST_PROPS_CORRECT_3=3010\nSCHEMAP_COS_ST_RESTRICTS_1_1=3011\nSCHEMAP_COS_ST_RESTRICTS_1_2=3012\nSCHEMAP_COS_ST_RESTRICTS_1_3_1=3013\nSCHEMAP_COS_ST_RESTRICTS_1_3_2=3014\nSCHEMAP_COS_ST_RESTRICTS_2_1=3015\nSCHEMAP_COS_ST_RESTRICTS_2_3_1_1=3016\nSCHEMAP_COS_ST_RESTRICTS_2_3_1_2=3017\nSCHEMAP_COS_ST_RESTRICTS_2_3_2_1=3018\nSCHEMAP_COS_ST_RESTRICTS_2_3_2_2=3019\nSCHEMAP_COS_ST_RESTRICTS_2_3_2_3=3020\nSCHEMAP_COS_ST_RESTRICTS_2_3_2_4=3021\nSCHEMAP_COS_ST_RESTRICTS_2_3_2_5=3022\nSCHEMAP_COS_ST_RESTRICTS_3_1=3023\nSCHEMAP_COS_ST_RESTRICTS_3_3_1=3024\nSCHEMAP_COS_ST_RESTRICTS_3_3_1_2=3025\nSCHEMAP_COS_ST_RESTRICTS_3_3_2_2=3026\nSCHEMAP_COS_ST_RESTRICTS_3_3_2_1=3027\nSCHEMAP_COS_ST_RESTRICTS_3_3_2_3=3028\nSCHEMAP_COS_ST_RESTRICTS_3_3_2_4=3029\nSCHEMAP_COS_ST_RESTRICTS_3_3_2_5=3030\nSCHEMAP_COS_ST_DERIVED_OK_2_1=3031\nSCHEMAP_COS_ST_DERIVED_OK_2_2=3032\nSCHEMAP_S4S_ELEM_NOT_ALLOWED=3033\nSCHEMAP_S4S_ELEM_MISSING=3034\nSCHEMAP_S4S_ATTR_NOT_ALLOWED=3035\nSCHEMAP_S4S_ATTR_MISSING=3036\nSCHEMAP_S4S_ATTR_INVALID_VALUE=3037\nSCHEMAP_SRC_ELEMENT_1=3038\nSCHEMAP_SRC_ELEMENT_2_1=3039\nSCHEMAP_SRC_ELEMENT_2_2=3040\nSCHEMAP_SRC_ELEMENT_3=3041\nSCHEMAP_P_PROPS_CORRECT_1=3042\nSCHEMAP_P_PROPS_CORRECT_2_1=3043\nSCHEMAP_P_PROPS_CORRECT_2_2=3044\nSCHEMAP_E_PROPS_CORRECT_2=3045\nSCHEMAP_E_PROPS_CORRECT_3=3046\nSCHEMAP_E_PROPS_CORRECT_4=3047\nSCHEMAP_E_PROPS_CORRECT_5=3048\nSCHEMAP_E_PROPS_CORRECT_6=3049\nSCHEMAP_SRC_INCLUDE=3050\nSCHEMAP_SRC_ATTRIBUTE_1=3051\nSCHEMAP_SRC_ATTRIBUTE_2=3052\nSCHEMAP_SRC_ATTRIBUTE_3_1=3053\nSCHEMAP_SRC_ATTRIBUTE_3_2=3054\nSCHEMAP_SRC_ATTRIBUTE_4=3055\nSCHEMAP_NO_XMLNS=3056\nSCHEMAP_NO_XSI=3057\nSCHEMAP_COS_VALID_DEFAULT_1=3058\nSCHEMAP_COS_VALID_DEFAULT_2_1=3059\nSCHEMAP_COS_VALID_DEFAULT_2_2_1=3060\nSCHEMAP_COS_VALID_DEFAULT_2_2_2=3061\n";
3811 static char __pyx_k_84[] = "SCHEMAP_CVC_SIMPLE_TYPE=3062\nSCHEMAP_COS_CT_EXTENDS_1_1=3063\nSCHEMAP_SRC_IMPORT_1_1=3064\nSCHEMAP_SRC_IMPORT_1_2=3065\nSCHEMAP_SRC_IMPORT_2=3066\nSCHEMAP_SRC_IMPORT_2_1=3067\nSCHEMAP_SRC_IMPORT_2_2=3068\nSCHEMAP_INTERNAL=3069\nSCHEMAP_NOT_DETERMINISTIC=3070\nSCHEMAP_SRC_ATTRIBUTE_GROUP_1=3071\nSCHEMAP_SRC_ATTRIBUTE_GROUP_2=3072\nSCHEMAP_SRC_ATTRIBUTE_GROUP_3=3073\nSCHEMAP_MG_PROPS_CORRECT_1=3074\nSCHEMAP_MG_PROPS_CORRECT_2=3075\nSCHEMAP_SRC_CT_1=3076\nSCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3=3077\nSCHEMAP_AU_PROPS_CORRECT_2=3078\nSCHEMAP_A_PROPS_CORRECT_2=3079\nSCHEMAP_C_PROPS_CORRECT=3080\nSCHEMAP_SRC_REDEFINE=3081\nSCHEMAP_SRC_IMPORT=3082\nSCHEMAP_WARN_SKIP_SCHEMA=3083\nSCHEMAP_WARN_UNLOCATED_SCHEMA=3084\nSCHEMAP_WARN_ATTR_REDECL_PROH=3085\nSCHEMAP_WARN_ATTR_POINTLESS_PROH=3086\nSCHEMAP_AG_PROPS_CORRECT=3087\nSCHEMAP_COS_CT_EXTENDS_1_2=3088\nSCHEMAP_AU_PROPS_CORRECT=3089\nSCHEMAP_A_PROPS_CORRECT_3=3090\nSCHEMAP_COS_ALL_LIMITED=3091\nSCHEMATRONV_ASSERT=4000\nSCHEMATRONV_REPORT=4001\nMODULE_OPEN=4900\nMODULE_CLOSE=4901\nCHECK_FOUND_ELEMENT=5000\nCHECK_FOUND_ATTRIBUTE=5001\nCHECK_FOUND_TEXT=5002\nCHECK_FOUND_CDATA=5003\nCHECK_FOUND_ENTITYREF=5004\nCHECK_FOUND_ENTITY=5005\nCHECK_FOUND_PI=5006\nCHECK_FOUND_COMMENT=5007\nCHECK_FOUND_DOCTYPE=5008\nCHECK_FOUND_FRAGMENT=5009\nCHECK_FOUND_NOTATION=5010\nCHECK_UNKNOWN_NODE=5011\nCHECK_ENTITY_TYPE=5012\nCHECK_NO_PARENT=5013\nCHECK_NO_DOC=5014\nCHECK_NO_NAME=5015\nCHECK_NO_ELEM=5016\nCHECK_WRONG_DOC=5017\nCHECK_NO_PREV=5018\nCHECK_WRONG_PREV=5019\nCHECK_NO_NEXT=5020\nCHECK_WRONG_NEXT=5021\nCHECK_NOT_DTD=5022\nCHECK_NOT_ATTR=5023\nCHECK_NOT_ATTR_DECL=5024\nCHECK_NOT_ELEM_DECL=5025\nCHECK_NOT_ENTITY_DECL=5026\nCHECK_NOT_NS_DECL=5027\nCHECK_NO_HREF=5028\nCHECK_WRONG_PARENT=5029\nCHECK_NS_SCOPE=5030\nCHECK_NS_ANCESTOR=5031\nCHECK_NOT_UTF8=5032\nCHECK_NO_DICT=5033\nCHECK_NOT_NCNAME=5034\nCHECK_OUTSIDE_DICT=5035\nCHECK_WRONG_NAME=5036\nCHECK_NAME_NOT_NULL=5037\nI18N_NO_NAME=6000\nI18N_NO_HANDLER=6001\nI18N_EXCESS_HANDLER=6002\nI18N_CONV_FAILED=6003\n";
3812 static char __pyx_k_85[] = "I18N_NO_OUTPUT=6004\nCHECK_=6005\nCHECK_X=6006\n";
3813 static char __pyx_k_86[] = "RELAXNG_OK=0\nRELAXNG_ERR_MEMORY=1\nRELAXNG_ERR_TYPE=2\nRELAXNG_ERR_TYPEVAL=3\nRELAXNG_ERR_DUPID=4\nRELAXNG_ERR_TYPECMP=5\nRELAXNG_ERR_NOSTATE=6\nRELAXNG_ERR_NODEFINE=7\nRELAXNG_ERR_LISTEXTRA=8\nRELAXNG_ERR_LISTEMPTY=9\nRELAXNG_ERR_INTERNODATA=10\nRELAXNG_ERR_INTERSEQ=11\nRELAXNG_ERR_INTEREXTRA=12\nRELAXNG_ERR_ELEMNAME=13\nRELAXNG_ERR_ATTRNAME=14\nRELAXNG_ERR_ELEMNONS=15\nRELAXNG_ERR_ATTRNONS=16\nRELAXNG_ERR_ELEMWRONGNS=17\nRELAXNG_ERR_ATTRWRONGNS=18\nRELAXNG_ERR_ELEMEXTRANS=19\nRELAXNG_ERR_ATTREXTRANS=20\nRELAXNG_ERR_ELEMNOTEMPTY=21\nRELAXNG_ERR_NOELEM=22\nRELAXNG_ERR_NOTELEM=23\nRELAXNG_ERR_ATTRVALID=24\nRELAXNG_ERR_CONTENTVALID=25\nRELAXNG_ERR_EXTRACONTENT=26\nRELAXNG_ERR_INVALIDATTR=27\nRELAXNG_ERR_DATAELEM=28\nRELAXNG_ERR_VALELEM=29\nRELAXNG_ERR_LISTELEM=30\nRELAXNG_ERR_DATATYPE=31\nRELAXNG_ERR_VALUE=32\nRELAXNG_ERR_LIST=33\nRELAXNG_ERR_NOGRAMMAR=34\nRELAXNG_ERR_EXTRADATA=35\nRELAXNG_ERR_LACKDATA=36\nRELAXNG_ERR_INTERNAL=37\nRELAXNG_ERR_ELEMWRONG=38\nRELAXNG_ERR_TEXTWRONG=39\n";
3814 static char __pyx_k_111[] = "Base class of lxml registry errors.\n    ";
3815 static char __pyx_k_113[] = "Error registering a namespace extension.\n    ";
3816 static char __pyx_k_114[] = "Syntax error while parsing an XML document.\n\n    For compatibility with ElementTree 1.3 and later.\n    ";
3817 static char __pyx_k_115[] = "Syntax error while parsing an XML document.\n    ";
3818 static char __pyx_k_116[] = "Internal lxml parser error.\n    ";
3819 static char __pyx_k_150[] = "A libxml2 error that occurred during serialisation.\n    ";
3820 static char __pyx_k_167[] = "Error during XInclude processing.\n    ";
3821 static char __pyx_k_168[] = "Base class of all XPath errors.\n    ";
3822 static char __pyx_k_169[] = "Error during XPath evaluation.\n    ";
3823 static char __pyx_k_170[] = "Internal error looking up an XPath extension function.\n    ";
3824 static char __pyx_k_171[] = "Error handling an XPath result.\n    ";
3825 static char __pyx_k_172[] = "";
3826 static char __pyx_k_173[] = "";
3827 static char __pyx_k_183[] = "(\"[^\"]*\")|('[^']*')";
3828 static char __pyx_k_184[] = "({[^}]+})";
3829 static char __pyx_k_187[] = "Base class of all XSLT errors.\n    ";
3830 static char __pyx_k_188[] = "Error parsing a stylesheet document.\n    ";
3831 static char __pyx_k_189[] = "Error running an XSL transformation.\n    ";
3832 static char __pyx_k_190[] = "Error serialising an XSLT result.\n    ";
3833 static char __pyx_k_191[] = "Error registering an XSLT extension.\n    ";
3834 static char __pyx_k_201[] = "\\s+(\\w+)\\s*=\\s*[\"']([^\"']+)[\"']";
3835 static char __pyx_k_202[] = "\\s+href\\s*=\\s*[\"']([^\"']+)[\"']";
3836 static char __pyx_k_203[] = "Validation error.\n\n    Raised by all document validators when their ``assertValid(tree)``\n    method fails.\n    ";
3837 static char __pyx_k_204[] = "Base class for DTD errors.\n    ";
3838 static char __pyx_k_205[] = "Error while parsing a DTD.\n    ";
3839 static char __pyx_k_206[] = "Error while validating an XML document with a DTD.\n    ";
3840 static char __pyx_k_207[] = "Base class for RelaxNG errors.\n    ";
3841 static char __pyx_k_208[] = "Error while parsing an XML document as RelaxNG.\n    ";
3842 static char __pyx_k_210[] = "Error while validating an XML document with a RelaxNG schema.\n    ";
3843 static char __pyx_k_211[] = "Base class of all XML Schema errors\n    ";
3844 static char __pyx_k_212[] = "Error while parsing an XML document as XML Schema.\n    ";
3845 static char __pyx_k_214[] = "Error while validating an XML document with an XML Schema.\n    ";
3846 static char __pyx_k_215[] = "boolean(//xs:attribute[@default or @fixed][1])";
3847 static char __pyx_k_217[] = "http://www.w3.org/2001/XMLSchema";
3848 static char __pyx_k_219[] = "Base class of all Schematron errors.\n    ";
3849 static char __pyx_k_221[] = "Error while parsing an XML document as Schematron schema.\n    ";
3850 static char __pyx_k_223[] = "Error while validating an XML document with a Schematron schema.\n    ";
3851 static PyObject *__pyx_int_1;
3852 static PyObject *__pyx_int_0;
3853 static PyObject *__pyx_int_100;
3854 static PyObject *__pyx_int_4;
3855 static PyObject *__pyx_int_neg_300;
3856 static PyObject *__pyx_int_neg_200;
3857 static PyObject *__pyx_int_neg_100;
3858 static PyObject *__pyx_int_neg_1;
3859 static PyObject *__pyx_int_2;
3860 static PyObject *__pyx_int_32768;
3861 static char __pyx_k___main__[] = "__main__";
3862 static PyObject *__pyx_kp___main__;
3863 static char __pyx_k___init__[] = "__init__";
3864 static PyObject *__pyx_kp___init__;
3865 static char __pyx_k___repr__[] = "__repr__";
3866 static PyObject *__pyx_kp___repr__;
3867 static char __pyx_k_copy[] = "copy";
3868 static PyObject *__pyx_kp_copy;
3869 static char __pyx_k___iter__[] = "__iter__";
3870 static PyObject *__pyx_kp___iter__;
3871 static char __pyx_k___getitem__[] = "__getitem__";
3872 static PyObject *__pyx_kp___getitem__;
3873 static char __pyx_k___len__[] = "__len__";
3874 static PyObject *__pyx_kp___len__;
3875 static char __pyx_k___contains__[] = "__contains__";
3876 static PyObject *__pyx_kp___contains__;
3877 static char __pyx_k___nonzero__[] = "__nonzero__";
3878 static PyObject *__pyx_kp___nonzero__;
3879 static char __pyx_k_filter_domains[] = "filter_domains";
3880 static PyObject *__pyx_kp_filter_domains;
3881 static char __pyx_k_filter_types[] = "filter_types";
3882 static PyObject *__pyx_kp_filter_types;
3883 static char __pyx_k_filter_levels[] = "filter_levels";
3884 static PyObject *__pyx_kp_filter_levels;
3885 static char __pyx_k_filter_from_level[] = "filter_from_level";
3886 static PyObject *__pyx_kp_filter_from_level;
3887 static char __pyx_k_filter_from_fatals[] = "filter_from_fatals";
3888 static PyObject *__pyx_kp_filter_from_fatals;
3889 static char __pyx_k_filter_from_errors[] = "filter_from_errors";
3890 static PyObject *__pyx_kp_filter_from_errors;
3891 static char __pyx_k_1[] = "filter_from_warnings";
3892 static PyObject *__pyx_kp_1;
3893 static char __pyx_k_clear[] = "clear";
3894 static PyObject *__pyx_kp_clear;
3895 static char __pyx_k_receive[] = "receive";
3896 static PyObject *__pyx_kp_receive;
3897 static char __pyx_k_log[] = "log";
3898 static PyObject *__pyx_kp_log;
3899 static char __pyx_k___dealloc__[] = "__dealloc__";
3900 static PyObject *__pyx_kp___dealloc__;
3901 static char __pyx_k__init[] = "_init";
3902 static PyObject *__pyx_kp__init;
3903 static char __pyx_k___setitem__[] = "__setitem__";
3904 static PyObject *__pyx_kp___setitem__;
3905 static char __pyx_k___delitem__[] = "__delitem__";
3906 static PyObject *__pyx_kp___delitem__;
3907 static char __pyx_k___deepcopy__[] = "__deepcopy__";
3908 static PyObject *__pyx_kp___deepcopy__;
3909 static char __pyx_k___copy__[] = "__copy__";
3910 static PyObject *__pyx_kp___copy__;
3911 static char __pyx_k_set[] = "set";
3912 static PyObject *__pyx_kp_set;
3913 static char __pyx_k_append[] = "append";
3914 static PyObject *__pyx_kp_append;
3915 static char __pyx_k_addnext[] = "addnext";
3916 static PyObject *__pyx_kp_addnext;
3917 static char __pyx_k_addprevious[] = "addprevious";
3918 static PyObject *__pyx_kp_addprevious;
3919 static char __pyx_k_extend[] = "extend";
3920 static PyObject *__pyx_kp_extend;
3921 static char __pyx_k_insert[] = "insert";
3922 static PyObject *__pyx_kp_insert;
3923 static char __pyx_k_remove[] = "remove";
3924 static PyObject *__pyx_kp_remove;
3925 static char __pyx_k_replace[] = "replace";
3926 static PyObject *__pyx_kp_replace;
3927 static char __pyx_k___reversed__[] = "__reversed__";
3928 static PyObject *__pyx_kp___reversed__;
3929 static char __pyx_k_index[] = "index";
3930 static PyObject *__pyx_kp_index;
3931 static char __pyx_k_get[] = "get";
3932 static PyObject *__pyx_kp_get;
3933 static char __pyx_k_keys[] = "keys";
3934 static PyObject *__pyx_kp_keys;
3935 static char __pyx_k_values[] = "values";
3936 static PyObject *__pyx_kp_values;
3937 static char __pyx_k_items[] = "items";
3938 static PyObject *__pyx_kp_items;
3939 static char __pyx_k_getchildren[] = "getchildren";
3940 static PyObject *__pyx_kp_getchildren;
3941 static char __pyx_k_getparent[] = "getparent";
3942 static PyObject *__pyx_kp_getparent;
3943 static char __pyx_k_getnext[] = "getnext";
3944 static PyObject *__pyx_kp_getnext;
3945 static char __pyx_k_getprevious[] = "getprevious";
3946 static PyObject *__pyx_kp_getprevious;
3947 static char __pyx_k_itersiblings[] = "itersiblings";
3948 static PyObject *__pyx_kp_itersiblings;
3949 static char __pyx_k_iterancestors[] = "iterancestors";
3950 static PyObject *__pyx_kp_iterancestors;
3951 static char __pyx_k_iterdescendants[] = "iterdescendants";
3952 static PyObject *__pyx_kp_iterdescendants;
3953 static char __pyx_k_iterchildren[] = "iterchildren";
3954 static PyObject *__pyx_kp_iterchildren;
3955 static char __pyx_k_getroottree[] = "getroottree";
3956 static PyObject *__pyx_kp_getroottree;
3957 static char __pyx_k_getiterator[] = "getiterator";
3958 static PyObject *__pyx_kp_getiterator;
3959 static char __pyx_k_iter[] = "iter";
3960 static PyObject *__pyx_kp_iter;
3961 static char __pyx_k_itertext[] = "itertext";
3962 static PyObject *__pyx_kp_itertext;
3963 static char __pyx_k_makeelement[] = "makeelement";
3964 static PyObject *__pyx_kp_makeelement;
3965 static char __pyx_k_find[] = "find";
3966 static PyObject *__pyx_kp_find;
3967 static char __pyx_k_findtext[] = "findtext";
3968 static PyObject *__pyx_kp_findtext;
3969 static char __pyx_k_findall[] = "findall";
3970 static PyObject *__pyx_kp_findall;
3971 static char __pyx_k_iterfind[] = "iterfind";
3972 static PyObject *__pyx_kp_iterfind;
3973 static char __pyx_k_xpath[] = "xpath";
3974 static PyObject *__pyx_kp_xpath;
3975 static char __pyx_k___str__[] = "__str__";
3976 static PyObject *__pyx_kp___str__;
3977 static char __pyx_k___hash__[] = "__hash__";
3978 static PyObject *__pyx_kp___hash__;
3979 static char __pyx_k___richcmp__[] = "__richcmp__";
3980 static PyObject *__pyx_kp___richcmp__;
3981 static char __pyx_k_parse[] = "parse";
3982 static PyObject *__pyx_kp_parse;
3983 static char __pyx_k__setroot[] = "_setroot";
3984 static PyObject *__pyx_kp__setroot;
3985 static char __pyx_k_getroot[] = "getroot";
3986 static PyObject *__pyx_kp_getroot;
3987 static char __pyx_k_write[] = "write";
3988 static PyObject *__pyx_kp_write;
3989 static char __pyx_k_getpath[] = "getpath";
3990 static PyObject *__pyx_kp_getpath;
3991 static char __pyx_k_xslt[] = "xslt";
3992 static PyObject *__pyx_kp_xslt;
3993 static char __pyx_k_relaxng[] = "relaxng";
3994 static PyObject *__pyx_kp_relaxng;
3995 static char __pyx_k_xmlschema[] = "xmlschema";
3996 static PyObject *__pyx_kp_xmlschema;
3997 static char __pyx_k_xinclude[] = "xinclude";
3998 static PyObject *__pyx_kp_xinclude;
3999 static char __pyx_k_22[] = "write_c14n";
4000 static PyObject *__pyx_kp_22;
4001 static char __pyx_k_update[] = "update";
4002 static PyObject *__pyx_kp_update;
4003 static char __pyx_k_pop[] = "pop";
4004 static PyObject *__pyx_kp_pop;
4005 static char __pyx_k_iterkeys[] = "iterkeys";
4006 static PyObject *__pyx_kp_iterkeys;
4007 static char __pyx_k_itervalues[] = "itervalues";
4008 static PyObject *__pyx_kp_itervalues;
4009 static char __pyx_k_iteritems[] = "iteritems";
4010 static PyObject *__pyx_kp_iteritems;
4011 static char __pyx_k_has_key[] = "has_key";
4012 static PyObject *__pyx_kp_has_key;
4013 static char __pyx_k___next__[] = "__next__";
4014 static PyObject *__pyx_kp___next__;
4015 static char __pyx_k___cinit__[] = "__cinit__";
4016 static PyObject *__pyx_kp___cinit__;
4017 static char __pyx_k_set_fallback[] = "set_fallback";
4018 static PyObject *__pyx_kp_set_fallback;
4019 static char __pyx_k_lookup[] = "lookup";
4020 static PyObject *__pyx_kp_lookup;
4021 static char __pyx_k_get_namespace[] = "get_namespace";
4022 static PyObject *__pyx_kp_get_namespace;
4023 static char __pyx_k_resolve[] = "resolve";
4024 static PyObject *__pyx_kp_resolve;
4025 static char __pyx_k_resolve_empty[] = "resolve_empty";
4026 static PyObject *__pyx_kp_resolve_empty;
4027 static char __pyx_k_resolve_string[] = "resolve_string";
4028 static PyObject *__pyx_kp_resolve_string;
4029 static char __pyx_k_resolve_filename[] = "resolve_filename";
4030 static PyObject *__pyx_kp_resolve_filename;
4031 static char __pyx_k_resolve_file[] = "resolve_file";
4032 static PyObject *__pyx_kp_resolve_file;
4033 static char __pyx_k_add[] = "add";
4034 static PyObject *__pyx_kp_add;
4035 static char __pyx_k_28[] = "setElementClassLookup";
4036 static PyObject *__pyx_kp_28;
4037 static char __pyx_k_29[] = "set_element_class_lookup";
4038 static PyObject *__pyx_kp_29;
4039 static char __pyx_k_feed[] = "feed";
4040 static PyObject *__pyx_kp_feed;
4041 static char __pyx_k_close[] = "close";
4042 static PyObject *__pyx_kp_close;
4043 static char __pyx_k_data[] = "data";
4044 static PyObject *__pyx_kp_data;
4045 static char __pyx_k_start[] = "start";
4046 static PyObject *__pyx_kp_start;
4047 static char __pyx_k_end[] = "end";
4048 static PyObject *__pyx_kp_end;
4049 static char __pyx_k_pi[] = "pi";
4050 static PyObject *__pyx_kp_pi;
4051 static char __pyx_k_comment[] = "comment";
4052 static PyObject *__pyx_kp_comment;
4053 static char __pyx_k___call__[] = "__call__";
4054 static PyObject *__pyx_kp___call__;
4055 static char __pyx_k_test[] = "test";
4056 static PyObject *__pyx_kp_test;
4057 static char __pyx_k_match[] = "match";
4058 static PyObject *__pyx_kp_match;
4059 static char __pyx_k_evaluate[] = "evaluate";
4060 static PyObject *__pyx_kp_evaluate;
4061 static char __pyx_k_register_namespace[] = "register_namespace";
4062 static PyObject *__pyx_kp_register_namespace;
4063 static char __pyx_k_register_namespaces[] = "register_namespaces";
4064 static PyObject *__pyx_kp_register_namespaces;
4065 static char __pyx_k_DENY_ALL[] = "DENY_ALL";
4066 static PyObject *__pyx_kp_DENY_ALL;
4067 static char __pyx_k_DENY_WRITE[] = "DENY_WRITE";
4068 static PyObject *__pyx_kp_DENY_WRITE;
4069 static char __pyx_k_strparam[] = "strparam";
4070 static PyObject *__pyx_kp_strparam;
4071 static char __pyx_k_apply[] = "apply";
4072 static PyObject *__pyx_kp_apply;
4073 static char __pyx_k_tostring[] = "tostring";
4074 static PyObject *__pyx_kp_tostring;
4075 static char __pyx_k___unicode__[] = "__unicode__";
4076 static PyObject *__pyx_kp___unicode__;
4077 static char __pyx_k___getbuffer__[] = "__getbuffer__";
4078 static PyObject *__pyx_kp___getbuffer__;
4079 static char __pyx_k___releasebuffer__[] = "__releasebuffer__";
4080 static PyObject *__pyx_kp___releasebuffer__;
4081 static char __pyx_k_parseXSL[] = "parseXSL";
4082 static PyObject *__pyx_kp_parseXSL;
4083 static char __pyx_k_execute[] = "execute";
4084 static PyObject *__pyx_kp_execute;
4085 static char __pyx_k_apply_templates[] = "apply_templates";
4086 static PyObject *__pyx_kp_apply_templates;
4087 static char __pyx_k_validate[] = "validate";
4088 static PyObject *__pyx_kp_validate;
4089 static char __pyx_k_assertValid[] = "assertValid";
4090 static PyObject *__pyx_kp_assertValid;
4091 static char __pyx_k_assert_[] = "assert_";
4092 static PyObject *__pyx_kp_assert_;
4093 static char __pyx_k_self[] = "self";
4094 static PyObject *__pyx_kp_self;
4095 static char __pyx_k_message[] = "message";
4096 static PyObject *__pyx_kp_message;
4097 static char __pyx_k_error_log[] = "error_log";
4098 static PyObject *__pyx_kp_error_log;
4099 static char __pyx_k_first_error[] = "first_error";
4100 static PyObject *__pyx_kp_first_error;
4101 static char __pyx_k_last_error[] = "last_error";
4102 static PyObject *__pyx_kp_last_error;
4103 static char __pyx_k_entries[] = "entries";
4104 static PyObject *__pyx_kp_entries;
4105 static char __pyx_k_error_type[] = "error_type";
4106 static PyObject *__pyx_kp_error_type;
4107 static char __pyx_k_domains[] = "domains";
4108 static PyObject *__pyx_kp_domains;
4109 static char __pyx_k_types[] = "types";
4110 static PyObject *__pyx_kp_types;
4111 static char __pyx_k_levels[] = "levels";
4112 static PyObject *__pyx_kp_levels;
4113 static char __pyx_k_level[] = "level";
4114 static PyObject *__pyx_kp_level;
4115 static char __pyx_k_entry[] = "entry";
4116 static PyObject *__pyx_kp_entry;
4117 static char __pyx_k_max_len[] = "max_len";
4118 static PyObject *__pyx_kp_max_len;
4119 static char __pyx_k_logger_name[] = "logger_name";
4120 static PyObject *__pyx_kp_logger_name;
4121 static char __pyx_k_log_entry[] = "log_entry";
4122 static PyObject *__pyx_kp_log_entry;
4123 static char __pyx_k_tree[] = "tree";
4124 static PyObject *__pyx_kp_tree;
4125 static char __pyx_k_url[] = "url";
4126 static PyObject *__pyx_kp_url;
4127 static char __pyx_k_x[] = "x";
4128 static PyObject *__pyx_kp_x;
4129 static char __pyx_k_value[] = "value";
4130 static PyObject *__pyx_kp_value;
4131 static char __pyx_k_memo[] = "memo";
4132 static PyObject *__pyx_kp_memo;
4133 static char __pyx_k_key[] = "key";
4134 static PyObject *__pyx_kp_key;
4135 static char __pyx_k_element[] = "element";
4136 static PyObject *__pyx_kp_element;
4137 static char __pyx_k_elements[] = "elements";
4138 static PyObject *__pyx_kp_elements;
4139 static char __pyx_k_old_element[] = "old_element";
4140 static PyObject *__pyx_kp_old_element;
4141 static char __pyx_k_new_element[] = "new_element";
4142 static PyObject *__pyx_kp_new_element;
4143 static char __pyx_k_line[] = "line";
4144 static PyObject *__pyx_kp_line;
4145 static char __pyx_k_child[] = "child";
4146 static PyObject *__pyx_kp_child;
4147 static char __pyx_k_stop[] = "stop";
4148 static PyObject *__pyx_kp_stop;
4149 static char __pyx_k_default[] = "default";
4150 static PyObject *__pyx_kp_default;
4151 static char __pyx_k_tag[] = "tag";
4152 static PyObject *__pyx_kp_tag;
4153 static char __pyx_k_preceding[] = "preceding";
4154 static PyObject *__pyx_kp_preceding;
4155 static char __pyx_k_reversed[] = "reversed";
4156 static PyObject *__pyx_kp_reversed;
4157 static char __pyx_k_with_tail[] = "with_tail";
4158 static PyObject *__pyx_kp_with_tail;
4159 static char __pyx_k__tag[] = "_tag";
4160 static PyObject *__pyx_kp__tag;
4161 static char __pyx_k_attrib[] = "attrib";
4162 static PyObject *__pyx_kp_attrib;
4163 static char __pyx_k_nsmap[] = "nsmap";
4164 static PyObject *__pyx_kp_nsmap;
4165 static char __pyx_k_path[] = "path";
4166 static PyObject *__pyx_kp_path;
4167 static char __pyx_k__path[] = "_path";
4168 static PyObject *__pyx_kp__path;
4169 static char __pyx_k_namespaces[] = "namespaces";
4170 static PyObject *__pyx_kp_namespaces;
4171 static char __pyx_k_extensions[] = "extensions";
4172 static PyObject *__pyx_kp_extensions;
4173 static char __pyx_k_smart_strings[] = "smart_strings";
4174 static PyObject *__pyx_kp_smart_strings;
4175 static char __pyx_k_36[] = "text_or_uri_or_element";
4176 static PyObject *__pyx_kp_36;
4177 static char __pyx_k_one[] = "one";
4178 static PyObject *__pyx_kp_one;
4179 static char __pyx_k_other[] = "other";
4180 static PyObject *__pyx_kp_other;
4181 static char __pyx_k_op[] = "op";
4182 static PyObject *__pyx_kp_op;
4183 static char __pyx_k_source[] = "source";
4184 static PyObject *__pyx_kp_source;
4185 static char __pyx_k_parser[] = "parser";
4186 static PyObject *__pyx_kp_parser;
4187 static char __pyx_k_base_url[] = "base_url";
4188 static PyObject *__pyx_kp_base_url;
4189 static char __pyx_k_root[] = "root";
4190 static PyObject *__pyx_kp_root;
4191 static char __pyx_k_file[] = "file";
4192 static PyObject *__pyx_kp_file;
4193 static char __pyx_k_encoding[] = "encoding";
4194 static PyObject *__pyx_kp_encoding;
4195 static char __pyx_k_method[] = "method";
4196 static PyObject *__pyx_kp_method;
4197 static char __pyx_k_pretty_print[] = "pretty_print";
4198 static PyObject *__pyx_kp_pretty_print;
4199 static char __pyx_k_xml_declaration[] = "xml_declaration";
4200 static PyObject *__pyx_kp_xml_declaration;
4201 static char __pyx_k_standalone[] = "standalone";
4202 static PyObject *__pyx_kp_standalone;
4203 static char __pyx_k_compression[] = "compression";
4204 static PyObject *__pyx_kp_compression;
4205 static char __pyx_k__xslt[] = "_xslt";
4206 static PyObject *__pyx_kp__xslt;
4207 static char __pyx_k_access_control[] = "access_control";
4208 static PyObject *__pyx_kp_access_control;
4209 static char __pyx_k_exclusive[] = "exclusive";
4210 static PyObject *__pyx_kp_exclusive;
4211 static char __pyx_k_with_comments[] = "with_comments";
4212 static PyObject *__pyx_kp_with_comments;
4213 static char __pyx_k_sequence_or_dict[] = "sequence_or_dict";
4214 static PyObject *__pyx_kp_sequence_or_dict;
4215 static char __pyx_k_node[] = "node";
4216 static PyObject *__pyx_kp_node;
4217 static char __pyx_k_inclusive[] = "inclusive";
4218 static PyObject *__pyx_kp_inclusive;
4219 static char __pyx_k_text[] = "text";
4220 static PyObject *__pyx_kp_text;
4221 static char __pyx_k_target[] = "target";
4222 static PyObject *__pyx_kp_target;
4223 static char __pyx_k_name[] = "name";
4224 static PyObject *__pyx_kp_name;
4225 static char __pyx_k__parent[] = "_parent";
4226 static PyObject *__pyx_kp__parent;
4227 static char __pyx_k_strings[] = "strings";
4228 static PyObject *__pyx_kp_strings;
4229 static char __pyx_k_elem[] = "elem";
4230 static PyObject *__pyx_kp_elem;
4231 static char __pyx_k_element_or_tree[] = "element_or_tree";
4232 static PyObject *__pyx_kp_element_or_tree;
4233 static char __pyx_k_other_element[] = "other_element";
4234 static PyObject *__pyx_kp_other_element;
4235 static char __pyx_k_fallback[] = "fallback";
4236 static PyObject *__pyx_kp_fallback;
4237 static char __pyx_k_entity[] = "entity";
4238 static PyObject *__pyx_kp_entity;
4239 static char __pyx_k_attribute_name[] = "attribute_name";
4240 static PyObject *__pyx_kp_attribute_name;
4241 static char __pyx_k_class_mapping[] = "class_mapping";
4242 static PyObject *__pyx_kp_class_mapping;
4243 static char __pyx_k_type[] = "type";
4244 static PyObject *__pyx_kp_type;
4245 static char __pyx_k_doc[] = "doc";
4246 static PyObject *__pyx_kp_doc;
4247 static char __pyx_k_namespace[] = "namespace";
4248 static PyObject *__pyx_kp_namespace;
4249 static char __pyx_k_ns_uri[] = "ns_uri";
4250 static PyObject *__pyx_kp_ns_uri;
4251 static char __pyx_k_class_dict_iterable[] = "class_dict_iterable";
4252 static PyObject *__pyx_kp_class_dict_iterable;
4253 static char __pyx_k_item[] = "item";
4254 static PyObject *__pyx_kp_item;
4255 static char __pyx_k_prefix[] = "prefix";
4256 static PyObject *__pyx_kp_prefix;
4257 static char __pyx_k_system_url[] = "system_url";
4258 static PyObject *__pyx_kp_system_url;
4259 static char __pyx_k_public_id[] = "public_id";
4260 static PyObject *__pyx_kp_public_id;
4261 static char __pyx_k_context[] = "context";
4262 static PyObject *__pyx_kp_context;
4263 static char __pyx_k_string[] = "string";
4264 static PyObject *__pyx_kp_string;
4265 static char __pyx_k_filename[] = "filename";
4266 static PyObject *__pyx_kp_filename;
4267 static char __pyx_k_f[] = "f";
4268 static PyObject *__pyx_kp_f;
4269 static char __pyx_k_default_resolver[] = "default_resolver";
4270 static PyObject *__pyx_kp_default_resolver;
4271 static char __pyx_k_resolver[] = "resolver";
4272 static PyObject *__pyx_kp_resolver;
4273 static char __pyx_k_code[] = "code";
4274 static PyObject *__pyx_kp_code;
4275 static char __pyx_k_column[] = "column";
4276 static PyObject *__pyx_kp_column;
4277 static char __pyx_k_filelike[] = "filelike";
4278 static PyObject *__pyx_kp_filelike;
4279 static char __pyx_k_exc_context[] = "exc_context";
4280 static PyObject *__pyx_kp_exc_context;
4281 static char __pyx_k_parse_options[] = "parse_options";
4282 static PyObject *__pyx_kp_parse_options;
4283 static char __pyx_k_for_html[] = "for_html";
4284 static PyObject *__pyx_kp_for_html;
4285 static char __pyx_k_schema[] = "schema";
4286 static PyObject *__pyx_kp_schema;
4287 static char __pyx_k_remove_comments[] = "remove_comments";
4288 static PyObject *__pyx_kp_remove_comments;
4289 static char __pyx_k_remove_pis[] = "remove_pis";
4290 static PyObject *__pyx_kp_remove_pis;
4291 static char __pyx_k_strip_cdata[] = "strip_cdata";
4292 static PyObject *__pyx_kp_strip_cdata;
4293 static char __pyx_k_attribute_defaults[] = "attribute_defaults";
4294 static PyObject *__pyx_kp_attribute_defaults;
4295 static char __pyx_k_dtd_validation[] = "dtd_validation";
4296 static PyObject *__pyx_kp_dtd_validation;
4297 static char __pyx_k_load_dtd[] = "load_dtd";
4298 static PyObject *__pyx_kp_load_dtd;
4299 static char __pyx_k_no_network[] = "no_network";
4300 static PyObject *__pyx_kp_no_network;
4301 static char __pyx_k_ns_clean[] = "ns_clean";
4302 static PyObject *__pyx_kp_ns_clean;
4303 static char __pyx_k_recover[] = "recover";
4304 static PyObject *__pyx_kp_recover;
4305 static char __pyx_k_huge_tree[] = "huge_tree";
4306 static PyObject *__pyx_kp_huge_tree;
4307 static char __pyx_k_remove_blank_text[] = "remove_blank_text";
4308 static PyObject *__pyx_kp_remove_blank_text;
4309 static char __pyx_k_resolve_entities[] = "resolve_entities";
4310 static PyObject *__pyx_kp_resolve_entities;
4311 static char __pyx_k_compact[] = "compact";
4312 static PyObject *__pyx_kp_compact;
4313 static char __pyx_k_element_factory[] = "element_factory";
4314 static PyObject *__pyx_kp_element_factory;
4315 static char __pyx_k_attrs[] = "attrs";
4316 static PyObject *__pyx_kp_attrs;
4317 static char __pyx_k_result[] = "result";
4318 static PyObject *__pyx_kp_result;
4319 static char __pyx_k_events[] = "events";
4320 static PyObject *__pyx_kp_events;
4321 static char __pyx_k_html[] = "html";
4322 static PyObject *__pyx_kp_html;
4323 static char __pyx_k_etree[] = "etree";
4324 static PyObject *__pyx_kp_etree;
4325 static char __pyx_k_id_name[] = "id_name";
4326 static PyObject *__pyx_kp_id_name;
4327 static char __pyx_k_tree_or_element[] = "tree_or_element";
4328 static PyObject *__pyx_kp_tree_or_element;
4329 static char __pyx_k_enable_regexp[] = "enable_regexp";
4330 static PyObject *__pyx_kp_enable_regexp;
4331 static char __pyx_k_build_smart_strings[] = "build_smart_strings";
4332 static PyObject *__pyx_kp_build_smart_strings;
4333 static char __pyx_k_module[] = "module";
4334 static PyObject *__pyx_kp_module;
4335 static char __pyx_k_function_mapping[] = "function_mapping";
4336 static PyObject *__pyx_kp_function_mapping;
4337 static char __pyx_k_ns[] = "ns";
4338 static PyObject *__pyx_kp_ns;
4339 static char __pyx_k_ctxt[] = "ctxt";
4340 static PyObject *__pyx_kp_ctxt;
4341 static char __pyx_k_s[] = "s";
4342 static PyObject *__pyx_kp_s;
4343 static char __pyx_k_rexp[] = "rexp";
4344 static PyObject *__pyx_kp_rexp;
4345 static char __pyx_k_flags[] = "flags";
4346 static PyObject *__pyx_kp_flags;
4347 static char __pyx_k_replacement[] = "replacement";
4348 static PyObject *__pyx_kp_replacement;
4349 static char __pyx_k_variables[] = "variables";
4350 static PyObject *__pyx_kp_variables;
4351 static char __pyx_k__eval_arg[] = "_eval_arg";
4352 static PyObject *__pyx_kp__eval_arg;
4353 static char __pyx_k_regexp[] = "regexp";
4354 static PyObject *__pyx_kp_regexp;
4355 static char __pyx_k_uri[] = "uri";
4356 static PyObject *__pyx_kp_uri;
4357 static char __pyx_k_etree_or_element[] = "etree_or_element";
4358 static PyObject *__pyx_kp_etree_or_element;
4359 static char __pyx_k__etree_or_element[] = "_etree_or_element";
4360 static PyObject *__pyx_kp__etree_or_element;
4361 static char __pyx_k_read_file[] = "read_file";
4362 static PyObject *__pyx_kp_read_file;
4363 static char __pyx_k_write_file[] = "write_file";
4364 static PyObject *__pyx_kp_write_file;
4365 static char __pyx_k_create_dir[] = "create_dir";
4366 static PyObject *__pyx_kp_create_dir;
4367 static char __pyx_k_read_network[] = "read_network";
4368 static PyObject *__pyx_kp_read_network;
4369 static char __pyx_k_write_network[] = "write_network";
4370 static PyObject *__pyx_kp_write_network;
4371 static char __pyx_k_strval[] = "strval";
4372 static PyObject *__pyx_kp_strval;
4373 static char __pyx_k_xslt_input[] = "xslt_input";
4374 static PyObject *__pyx_kp_xslt_input;
4375 static char __pyx_k__input[] = "_input";
4376 static PyObject *__pyx_kp__input;
4377 static char __pyx_k_profile_run[] = "profile_run";
4378 static PyObject *__pyx_kp_profile_run;
4379 static char __pyx_k_result_tree[] = "result_tree";
4380 static PyObject *__pyx_kp_result_tree;
4381 static char __pyx_k_buffer[] = "buffer";
4382 static PyObject *__pyx_kp_buffer;
4383 static char __pyx_k_self_node[] = "self_node";
4384 static PyObject *__pyx_kp_self_node;
4385 static char __pyx_k_input_node[] = "input_node";
4386 static PyObject *__pyx_kp_input_node;
4387 static char __pyx_k_output_parent[] = "output_parent";
4388 static PyObject *__pyx_kp_output_parent;
4389 static char __pyx_k_external_id[] = "external_id";
4390 static PyObject *__pyx_kp_external_id;
4391 static char __pyx_k___docformat__[] = "__docformat__";
4392 static PyObject *__pyx_kp___docformat__;
4393 static char __pyx_k___builtin__[] = "__builtin__";
4394 static PyObject *__pyx_kp___builtin__;
4395 static char __pyx_k_ImportError[] = "ImportError";
4396 static PyObject *__pyx_kp_ImportError;
4397 static char __pyx_k_builtins[] = "builtins";
4398 static PyObject *__pyx_kp_builtins;
4399 static char __pyx_k_unicode[] = "unicode";
4400 static PyObject *__pyx_kp_unicode;
4401 static char __pyx_k_AttributeError[] = "AttributeError";
4402 static PyObject *__pyx_kp_AttributeError;
4403 static char __pyx_k_str[] = "str";
4404 static PyObject *__pyx_kp_str;
4405 static char __pyx_k_38[] = "os.path";
4406 static PyObject *__pyx_kp_38;
4407 static char __pyx_k_abspath[] = "abspath";
4408 static PyObject *__pyx_kp_abspath;
4409 static char __pyx_k_io[] = "io";
4410 static PyObject *__pyx_kp_io;
4411 static char __pyx_k_BytesIO[] = "BytesIO";
4412 static PyObject *__pyx_kp_BytesIO;
4413 static char __pyx_k_StringIO[] = "StringIO";
4414 static PyObject *__pyx_kp_StringIO;
4415 static char __pyx_k__elementpath[] = "_elementpath";
4416 static PyObject *__pyx_kp__elementpath;
4417 static char __pyx_k_sys[] = "sys";
4418 static PyObject *__pyx_kp_sys;
4419 static char __pyx_k_re[] = "re";
4420 static PyObject *__pyx_kp_re;
4421 static char __pyx_k_gzip[] = "gzip";
4422 static PyObject *__pyx_kp_gzip;
4423 static char __pyx_k_DEBUG[] = "DEBUG";
4424 static PyObject *__pyx_kp_DEBUG;
4425 static char __pyx_k_39[] = "getfilesystemencoding";
4426 static PyObject *__pyx_kp_39;
4427 static char __pyx_k_getdefaultencoding[] = "getdefaultencoding";
4428 static PyObject *__pyx_kp_getdefaultencoding;
4429 static char __pyx_k_40[] = "ascii";
4430 static PyObject *__pyx_kp_40;
4431 static char __pyx_k_encode[] = "encode";
4432 static PyObject *__pyx_kp_encode;
4433 static char __pyx_k_43[] = "html";
4434 static PyObject *__pyx_kp_43;
4435 static char __pyx_k_45[] = "xsl";
4436 static PyObject *__pyx_kp_45;
4437 static char __pyx_k_47[] = "rdf";
4438 static PyObject *__pyx_kp_47;
4439 static char __pyx_k_49[] = "wsdl";
4440 static PyObject *__pyx_kp_49;
4441 static char __pyx_k_51[] = "xs";
4442 static PyObject *__pyx_kp_51;
4443 static char __pyx_k_53[] = "xsi";
4444 static PyObject *__pyx_kp_53;
4445 static char __pyx_k_55[] = "dc";
4446 static PyObject *__pyx_kp_55;
4447 static char __pyx_k_57[] = "py";
4448 static PyObject *__pyx_kp_57;
4449 static char __pyx_k_Error[] = "Error";
4450 static PyObject *__pyx_kp_Error;
4451 static char __pyx_k_Exception[] = "Exception";
4452 static PyObject *__pyx_kp_Exception;
4453 static char __pyx_k_LxmlError[] = "LxmlError";
4454 static PyObject *__pyx_kp_LxmlError;
4455 static char __pyx_k_LxmlSyntaxError[] = "LxmlSyntaxError";
4456 static PyObject *__pyx_kp_LxmlSyntaxError;
4457 static char __pyx_k_SyntaxError[] = "SyntaxError";
4458 static PyObject *__pyx_kp_SyntaxError;
4459 static char __pyx_k_60[] = "C14NError";
4460 static PyObject *__pyx_kp_60;
4461 static char __pyx_k_decode[] = "decode";
4462 static PyObject *__pyx_kp_decode;
4463 static char __pyx_k_63[] = "ASCII";
4464 static PyObject *__pyx_kp_63;
4465 static char __pyx_k_group[] = "group";
4466 static PyObject *__pyx_kp_group;
4467 static char __pyx_k_65[] = "ASCII";
4468 static PyObject *__pyx_kp_65;
4469 static char __pyx_k_LIBXML_VERSION[] = "LIBXML_VERSION";
4470 static PyObject *__pyx_kp_LIBXML_VERSION;
4471 static char __pyx_k_66[] = "LIBXML_COMPILED_VERSION";
4472 static PyObject *__pyx_kp_66;
4473 static char __pyx_k_LXML_VERSION[] = "LXML_VERSION";
4474 static PyObject *__pyx_kp_LXML_VERSION;
4475 static char __pyx_k_67[] = "ASCII";
4476 static PyObject *__pyx_kp_67;
4477 static char __pyx_k___version__[] = "__version__";
4478 static PyObject *__pyx_kp___version__;
4479 static char __pyx_k_compile[] = "compile";
4480 static PyObject *__pyx_kp_compile;
4481 static char __pyx_k_U[] = "U";
4482 static PyObject *__pyx_kp_U;
4483 static char __pyx_k_sub[] = "sub";
4484 static PyObject *__pyx_kp_sub;
4485 static char __pyx_k_ErrorLevels[] = "ErrorLevels";
4486 static PyObject *__pyx_kp_ErrorLevels;
4487 static char __pyx_k_ErrorDomains[] = "ErrorDomains";
4488 static PyObject *__pyx_kp_ErrorDomains;
4489 static char __pyx_k_ErrorTypes[] = "ErrorTypes";
4490 static PyObject *__pyx_kp_ErrorTypes;
4491 static char __pyx_k_RelaxNGErrorTypes[] = "RelaxNGErrorTypes";
4492 static PyObject *__pyx_kp_RelaxNGErrorTypes;
4493 static char __pyx_k_91[] = "xml";
4494 static PyObject *__pyx_kp_91;
4495 static char __pyx_k_101[] = "ProcessingInstruction";
4496 static PyObject *__pyx_kp_101;
4497 static char __pyx_k_PI[] = "PI";
4498 static PyObject *__pyx_kp_PI;
4499 static char __pyx_k_104[] = "xml";
4500 static PyObject *__pyx_kp_104;
4501 static char __pyx_k_107[] = "xml";
4502 static PyObject *__pyx_kp_107;
4503 static char __pyx_k_LxmlRegistryError[] = "LxmlRegistryError";
4504 static PyObject *__pyx_kp_LxmlRegistryError;
4505 static char __pyx_k_112[] = "NamespaceRegistryError";
4506 static PyObject *__pyx_kp_112;
4507 static char __pyx_k_ParseError[] = "ParseError";
4508 static PyObject *__pyx_kp_ParseError;
4509 static char __pyx_k_XMLSyntaxError[] = "XMLSyntaxError";
4510 static PyObject *__pyx_kp_XMLSyntaxError;
4511 static char __pyx_k_ParserError[] = "ParserError";
4512 static PyObject *__pyx_kp_ParserError;
4513 static char __pyx_k_inspect[] = "inspect";
4514 static PyObject *__pyx_kp_inspect;
4515 static char __pyx_k_getargspec[] = "getargspec";
4516 static PyObject *__pyx_kp_getargspec;
4517 static char __pyx_k__TargetParserResult[] = "_TargetParserResult";
4518 static PyObject *__pyx_kp__TargetParserResult;
4519 static char __pyx_k_SerialisationError[] = "SerialisationError";
4520 static PyObject *__pyx_kp_SerialisationError;
4521 static char __pyx_k_151[] = "end";
4522 static PyObject *__pyx_kp_151;
4523 static char __pyx_k_165[] = "end";
4524 static PyObject *__pyx_kp_165;
4525 static char __pyx_k_XIncludeError[] = "XIncludeError";
4526 static PyObject *__pyx_kp_XIncludeError;
4527 static char __pyx_k_XPathError[] = "XPathError";
4528 static PyObject *__pyx_kp_XPathError;
4529 static char __pyx_k_XPathEvalError[] = "XPathEvalError";
4530 static PyObject *__pyx_kp_XPathEvalError;
4531 static char __pyx_k_XPathFunctionError[] = "XPathFunctionError";
4532 static PyObject *__pyx_kp_XPathFunctionError;
4533 static char __pyx_k_XPathResultError[] = "XPathResultError";
4534 static PyObject *__pyx_kp_XPathResultError;
4535 static char __pyx_k_174[] = "_ElementStringResult";
4536 static PyObject *__pyx_kp_174;
4537 static char __pyx_k_XPathSyntaxError[] = "XPathSyntaxError";
4538 static PyObject *__pyx_kp_XPathSyntaxError;
4539 static char __pyx_k_XSLTError[] = "XSLTError";
4540 static PyObject *__pyx_kp_XSLTError;
4541 static char __pyx_k_XSLTParseError[] = "XSLTParseError";
4542 static PyObject *__pyx_kp_XSLTParseError;
4543 static char __pyx_k_XSLTApplyError[] = "XSLTApplyError";
4544 static PyObject *__pyx_kp_XSLTApplyError;
4545 static char __pyx_k_XSLTSaveError[] = "XSLTSaveError";
4546 static PyObject *__pyx_kp_XSLTSaveError;
4547 static char __pyx_k_XSLTExtensionError[] = "XSLTExtensionError";
4548 static PyObject *__pyx_kp_XSLTExtensionError;
4549 static char __pyx_k_192[] = "LIBXSLT_COMPILED_VERSION";
4550 static PyObject *__pyx_kp_192;
4551 static char __pyx_k_LIBXSLT_VERSION[] = "LIBXSLT_VERSION";
4552 static PyObject *__pyx_kp_LIBXSLT_VERSION;
4553 static char __pyx_k_DocumentInvalid[] = "DocumentInvalid";
4554 static PyObject *__pyx_kp_DocumentInvalid;
4555 static char __pyx_k_DTDError[] = "DTDError";
4556 static PyObject *__pyx_kp_DTDError;
4557 static char __pyx_k_DTDParseError[] = "DTDParseError";
4558 static PyObject *__pyx_kp_DTDParseError;
4559 static char __pyx_k_DTDValidateError[] = "DTDValidateError";
4560 static PyObject *__pyx_kp_DTDValidateError;
4561 static char __pyx_k_RelaxNGError[] = "RelaxNGError";
4562 static PyObject *__pyx_kp_RelaxNGError;
4563 static char __pyx_k_RelaxNGParseError[] = "RelaxNGParseError";
4564 static PyObject *__pyx_kp_RelaxNGParseError;
4565 static char __pyx_k_209[] = "RelaxNGValidateError";
4566 static PyObject *__pyx_kp_209;
4567 static char __pyx_k_XMLSchemaError[] = "XMLSchemaError";
4568 static PyObject *__pyx_kp_XMLSchemaError;
4569 static char __pyx_k_XMLSchemaParseError[] = "XMLSchemaParseError";
4570 static PyObject *__pyx_kp_XMLSchemaParseError;
4571 static char __pyx_k_213[] = "XMLSchemaValidateError";
4572 static PyObject *__pyx_kp_213;
4573 static char __pyx_k_216[] = "xs";
4574 static PyObject *__pyx_kp_216;
4575 static char __pyx_k_SchematronError[] = "SchematronError";
4576 static PyObject *__pyx_kp_SchematronError;
4577 static char __pyx_k_220[] = "SchematronParseError";
4578 static PyObject *__pyx_kp_220;
4579 static char __pyx_k_222[] = "SchematronValidateError";
4580 static PyObject *__pyx_kp_222;
4581 static char __pyx_k_super[] = "super";
4582 static PyObject *__pyx_kp_super;
4583 static char __pyx_k_224[] = "ASCII";
4584 static PyObject *__pyx_kp_224;
4585 static char __pyx_k_split[] = "split";
4586 static PyObject *__pyx_kp_split;
4587 static char __pyx_k_ValueError[] = "ValueError";
4588 static PyObject *__pyx_kp_ValueError;
4589 static char __pyx_k_startswith[] = "startswith";
4590 static PyObject *__pyx_kp_startswith;
4591 static char __pyx_k_228[] = "dev";
4592 static PyObject *__pyx_kp_228;
4593 static char __pyx_k_229[] = "alpha";
4594 static PyObject *__pyx_kp_229;
4595 static char __pyx_k_230[] = "beta";
4596 static PyObject *__pyx_kp_230;
4597 static char __pyx_k_exc_info[] = "exc_info";
4598 static PyObject *__pyx_kp_exc_info;
4599 static char __pyx_k_TypeError[] = "TypeError";
4600 static PyObject *__pyx_kp_TypeError;
4601 static char __pyx_k_238[] = "items";
4602 static PyObject *__pyx_kp_238;
4603 static char __pyx_k_KeyError[] = "KeyError";
4604 static PyObject *__pyx_kp_KeyError;
4605 static char __pyx_k_strip[] = "strip";
4606 static PyObject *__pyx_kp_strip;
4607 static char __pyx_k_UnicodeEncodeError[] = "UnicodeEncodeError";
4608 static PyObject *__pyx_kp_UnicodeEncodeError;
4609 static char __pyx_k_UnicodeDecodeError[] = "UnicodeDecodeError";
4610 static PyObject *__pyx_kp_UnicodeDecodeError;
4611 static char __pyx_k_275[] = "name";
4612 static PyObject *__pyx_kp_275;
4613 static char __pyx_k_276[] = "geturl";
4614 static PyObject *__pyx_kp_276;
4615 static char __pyx_k_277[] = "filename";
4616 static PyObject *__pyx_kp_277;
4617 static char __pyx_k_python[] = "python";
4618 static PyObject *__pyx_kp_python;
4619 static char __pyx_k_278[] = "PyUnicode_DecodeASCII";
4620 static PyObject *__pyx_kp_278;
4621 static char __pyx_k_279[] = "backslashreplace";
4622 static PyObject *__pyx_kp_279;
4623 static char __pyx_k_level_name[] = "level_name";
4624 static PyObject *__pyx_kp_level_name;
4625 static char __pyx_k_domain_name[] = "domain_name";
4626 static PyObject *__pyx_kp_domain_name;
4627 static char __pyx_k_type_name[] = "type_name";
4628 static PyObject *__pyx_kp_type_name;
4629 static char __pyx_k__getName[] = "_getName";
4630 static PyObject *__pyx_kp__getName;
4631 static char __pyx_k_283[] = "unknown";
4632 static PyObject *__pyx_kp_283;
4633 static char __pyx_k_RELAXNGV[] = "RELAXNGV";
4634 static PyObject *__pyx_kp_RELAXNGV;
4635 static char __pyx_k_284[] = "unknown";
4636 static PyObject *__pyx_kp_284;
4637 static char __pyx_k_285[] = "unknown";
4638 static PyObject *__pyx_kp_285;
4639 static char __pyx_k_join[] = "join";
4640 static PyObject *__pyx_kp_join;
4641 static char __pyx_k_FATAL[] = "FATAL";
4642 static PyObject *__pyx_kp_FATAL;
4643 static char __pyx_k_ERROR[] = "ERROR";
4644 static PyObject *__pyx_kp_ERROR;
4645 static char __pyx_k_WARNING[] = "WARNING";
4646 static PyObject *__pyx_kp_WARNING;
4647 static char __pyx_k__accepted_domains[] = "_accepted_domains";
4648 static PyObject *__pyx_kp__accepted_domains;
4649 static char __pyx_k_domain[] = "domain";
4650 static PyObject *__pyx_kp_domain;
4651 static char __pyx_k_logging[] = "logging";
4652 static PyObject *__pyx_kp_logging;
4653 static char __pyx_k_CRITICAL[] = "CRITICAL";
4654 static PyObject *__pyx_kp_CRITICAL;
4655 static char __pyx_k_getLogger[] = "getLogger";
4656 static PyObject *__pyx_kp_getLogger;
4657 static char __pyx_k_292[] = "_GlobalErrorLog";
4658 static PyObject *__pyx_kp_292;
4659 static char __pyx_k_293[] = "_GlobalErrorLog";
4660 static PyObject *__pyx_kp_293;
4661 static char __pyx_k_294[] = "_GlobalErrorLog";
4662 static PyObject *__pyx_kp_294;
4663 static char __pyx_k__names[] = "_names";
4664 static PyObject *__pyx_kp__names;
4665 static char __pyx_k_304[] = "A";
4666 static PyObject *__pyx_kp_304;
4667 static char __pyx_k_305[] = "A";
4668 static PyObject *__pyx_kp_305;
4669 static char __pyx_k_IndexError[] = "IndexError";
4670 static PyObject *__pyx_kp_IndexError;
4671 static char __pyx_k_tail[] = "tail";
4672 static PyObject *__pyx_kp_tail;
4673 static char __pyx_k_id[] = "id";
4674 static PyObject *__pyx_kp_id;
4675 static char __pyx_k_warnings[] = "warnings";
4676 static PyObject *__pyx_kp_warnings;
4677 static char __pyx_k_warn[] = "warn";
4678 static PyObject *__pyx_kp_warn;
4679 static char __pyx_k_FutureWarning[] = "FutureWarning";
4680 static PyObject *__pyx_kp_FutureWarning;
4681 static char __pyx_k_Comment[] = "Comment";
4682 static PyObject *__pyx_kp_Comment;
4683 static char __pyx_k_Entity[] = "Entity";
4684 static PyObject *__pyx_kp_Entity;
4685 static char __pyx_k_349[] = "ASCII";
4686 static PyObject *__pyx_kp_349;
4687 static char __pyx_k_350[] = "ASCII";
4688 static PyObject *__pyx_kp_350;
4689 static char __pyx_k_upper[] = "upper";
4690 static PyObject *__pyx_kp_upper;
4691 static char __pyx_k_352[] = "ASCII";
4692 static PyObject *__pyx_kp_352;
4693 static char __pyx_k_353[] = "UTF8";
4694 static PyObject *__pyx_kp_353;
4695 static char __pyx_k_StopIteration[] = "StopIteration";
4696 static PyObject *__pyx_kp_StopIteration;
4697 static char __pyx_k_Element[] = "Element";
4698 static PyObject *__pyx_kp_Element;
4699 static char __pyx_k_373[] = "start";
4700 static PyObject *__pyx_kp_373;
4701 static char __pyx_k_374[] = "end";
4702 static PyObject *__pyx_kp_374;
4703 static char __pyx_k_375[] = "start";
4704 static PyObject *__pyx_kp_375;
4705 static char __pyx_k_376[] = "start";
4706 static PyObject *__pyx_kp_376;
4707 static char __pyx_k_stdout[] = "stdout";
4708 static PyObject *__pyx_kp_stdout;
4709 static char __pyx_k_382[] = "ASCII";
4710 static PyObject *__pyx_kp_382;
4711 static char __pyx_k_384[] = "UTF8";
4712 static PyObject *__pyx_kp_384;
4713 static char __pyx_k_386[] = "ASCII";
4714 static PyObject *__pyx_kp_386;
4715 static char __pyx_k__doc[] = "_doc";
4716 static PyObject *__pyx_kp__doc;
4717 static char __pyx_k_NAMESPACE[] = "NAMESPACE";
4718 static PyObject *__pyx_kp_NAMESPACE;
4719 static char __pyx_k_TAG[] = "TAG";
4720 static PyObject *__pyx_kp_TAG;
4721 static char __pyx_k___class__[] = "__class__";
4722 static PyObject *__pyx_kp___class__;
4723 static char __pyx_k___name__[] = "__name__";
4724 static PyObject *__pyx_kp___name__;
4725 static char __pyx_k_PARSER[] = "PARSER";
4726 static PyObject *__pyx_kp_PARSER;
4727 static char __pyx_k_HTML[] = "HTML";
4728 static PyObject *__pyx_kp_HTML;
4729 static char __pyx_k_408[] = "element";
4730 static PyObject *__pyx_kp_408;
4731 static char __pyx_k_409[] = "comment";
4732 static PyObject *__pyx_kp_409;
4733 static char __pyx_k_410[] = "PI";
4734 static PyObject *__pyx_kp_410;
4735 static char __pyx_k_411[] = "entity";
4736 static PyObject *__pyx_kp_411;
4737 static char __pyx_k_412[] = "element";
4738 static PyObject *__pyx_kp_412;
4739 static char __pyx_k_413[] = "items";
4740 static PyObject *__pyx_kp_413;
4741 static char __pyx_k_414[] = "_";
4742 static PyObject *__pyx_kp_414;
4743 static char __pyx_k_read[] = "read";
4744 static PyObject *__pyx_kp_read;
4745 static char __pyx_k_discard[] = "discard";
4746 static PyObject *__pyx_kp_discard;
4747 static char __pyx_k_position[] = "position";
4748 static PyObject *__pyx_kp_position;
4749 static char __pyx_k_426[] = "_ParserDictionaryContext";
4750 static PyObject *__pyx_kp_426;
4751 static char __pyx_k_427[] = "_ParserDictionaryContext";
4752 static PyObject *__pyx_kp_427;
4753 static char __pyx_k_428[] = "_ParserDictionaryContext";
4754 static PyObject *__pyx_kp_428;
4755 static char __pyx_k_IOError[] = "IOError";
4756 static PyObject *__pyx_kp_IOError;
4757 static char __pyx_k_443[] = "WAR_UNDECLARED_ENTITY";
4758 static PyObject *__pyx_kp_443;
4759 static char __pyx_k_444[] = "ERR_UNDECLARED_ENTITY";
4760 static PyObject *__pyx_kp_444;
4761 static char __pyx_k_LookupError[] = "LookupError";
4762 static PyObject *__pyx_kp_LookupError;
4763 static char __pyx_k_455[] = "getvalue";
4764 static PyObject *__pyx_kp_455;
4765 static char __pyx_k_456[] = "tell";
4766 static PyObject *__pyx_kp_456;
4767 static char __pyx_k_tell[] = "tell";
4768 static PyObject *__pyx_kp_tell;
4769 static char __pyx_k_getvalue[] = "getvalue";
4770 static PyObject *__pyx_kp_getvalue;
4771 static char __pyx_k_457[] = "read";
4772 static PyObject *__pyx_kp_457;
4773 static char __pyx_k_doctype[] = "doctype";
4774 static PyObject *__pyx_kp_doctype;
4775 static char __pyx_k_472[] = "__dict__";
4776 static PyObject *__pyx_kp_472;
4777 static char __pyx_k_lower[] = "lower";
4778 static PyObject *__pyx_kp_lower;
4779 static char __pyx_k_473[] = "xml";
4780 static PyObject *__pyx_kp_473;
4781 static char __pyx_k_474[] = "html";
4782 static PyObject *__pyx_kp_474;
4783 static char __pyx_k_475[] = "text";
4784 static PyObject *__pyx_kp_475;
4785 static char __pyx_k_479[] = "ASCII";
4786 static PyObject *__pyx_kp_479;
4787 static char __pyx_k_GzipFile[] = "GzipFile";
4788 static PyObject *__pyx_kp_GzipFile;
4789 static char __pyx_k_fileobj[] = "fileobj";
4790 static PyObject *__pyx_kp_fileobj;
4791 static char __pyx_k_mode[] = "mode";
4792 static PyObject *__pyx_kp_mode;
4793 static char __pyx_k_503[] = "wb";
4794 static PyObject *__pyx_kp_503;
4795 static char __pyx_k_compresslevel[] = "compresslevel";
4796 static PyObject *__pyx_kp_compresslevel;
4797 static char __pyx_k_506[] = "wb";
4798 static PyObject *__pyx_kp_506;
4799 static char __pyx_k_open[] = "open";
4800 static PyObject *__pyx_kp_open;
4801 static char __pyx_k_507[] = "wb";
4802 static PyObject *__pyx_kp_507;
4803 static char __pyx_k_510[] = "write";
4804 static PyObject *__pyx_kp_510;
4805 static char __pyx_k_512[] = "write";
4806 static PyObject *__pyx_kp_512;
4807 static char __pyx_k_517[] = "start";
4808 static PyObject *__pyx_kp_517;
4809 static char __pyx_k_518[] = "end";
4810 static PyObject *__pyx_kp_518;
4811 static char __pyx_k_521[] = "comment";
4812 static PyObject *__pyx_kp_521;
4813 static char __pyx_k_522[] = "pi";
4814 static PyObject *__pyx_kp_522;
4815 static char __pyx_k_530[] = "start";
4816 static PyObject *__pyx_kp_530;
4817 static char __pyx_k_531[] = "end";
4818 static PyObject *__pyx_kp_531;
4819 static char __pyx_k_533[] = "comment";
4820 static PyObject *__pyx_kp_533;
4821 static char __pyx_k_534[] = "pi";
4822 static PyObject *__pyx_kp_534;
4823 static char __pyx_k_535[] = "read";
4824 static PyObject *__pyx_kp_535;
4825 static char __pyx_k_536[] = "rb";
4826 static PyObject *__pyx_kp_536;
4827 static char __pyx_k_544[] = "start";
4828 static PyObject *__pyx_kp_544;
4829 static char __pyx_k_545[] = "end";
4830 static PyObject *__pyx_kp_545;
4831 static char __pyx_k_XML[] = "XML";
4832 static PyObject *__pyx_kp_XML;
4833 static char __pyx_k_548[] = "id";
4834 static PyObject *__pyx_kp_548;
4835 static char __pyx_k_enumerate[] = "enumerate";
4836 static PyObject *__pyx_kp_enumerate;
4837 static char __pyx_k_sort[] = "sort";
4838 static PyObject *__pyx_kp_sort;
4839 static char __pyx_k_565[] = "_";
4840 static PyObject *__pyx_kp_565;
4841 static char __pyx_k_UNICODE[] = "UNICODE";
4842 static PyObject *__pyx_kp_UNICODE;
4843 static char __pyx_k_IGNORECASE[] = "IGNORECASE";
4844 static PyObject *__pyx_kp_IGNORECASE;
4845 static char __pyx_k_567[] = "i";
4846 static PyObject *__pyx_kp_567;
4847 static char __pyx_k_search[] = "search";
4848 static PyObject *__pyx_kp_search;
4849 static char __pyx_k_568[] = "i";
4850 static PyObject *__pyx_kp_568;
4851 static char __pyx_k_569[] = "g";
4852 static PyObject *__pyx_kp_569;
4853 static char __pyx_k_groups[] = "groups";
4854 static PyObject *__pyx_kp_groups;
4855 static char __pyx_k_571[] = "matches";
4856 static PyObject *__pyx_kp_571;
4857 static char __pyx_k_SubElement[] = "SubElement";
4858 static PyObject *__pyx_kp_SubElement;
4859 static char __pyx_k_573[] = "match";
4860 static PyObject *__pyx_kp_573;
4861 static char __pyx_k_574[] = "i";
4862 static PyObject *__pyx_kp_574;
4863 static char __pyx_k_575[] = "g";
4864 static PyObject *__pyx_kp_575;
4865 static char __pyx_k_577[] = "test";
4866 static PyObject *__pyx_kp_577;
4867 static char __pyx_k_578[] = "match";
4868 static PyObject *__pyx_kp_578;
4869 static char __pyx_k_579[] = "replace";
4870 static PyObject *__pyx_kp_579;
4871 static char __pyx_k_NotImplementedError[] = "NotImplementedError";
4872 static PyObject *__pyx_kp_NotImplementedError;
4873 static char __pyx_k_583[] = "XPATH_POINT";
4874 static PyObject *__pyx_kp_583;
4875 static char __pyx_k_584[] = "XPATH_RANGE";
4876 static PyObject *__pyx_kp_584;
4877 static char __pyx_k_585[] = "XPATH_LOCATIONSET";
4878 static PyObject *__pyx_kp_585;
4879 static char __pyx_k_586[] = "XPATH_USERS";
4880 static PyObject *__pyx_kp_586;
4881 static char __pyx_k_is_attribute[] = "is_attribute";
4882 static PyObject *__pyx_kp_is_attribute;
4883 static char __pyx_k_is_tail[] = "is_tail";
4884 static PyObject *__pyx_kp_is_tail;
4885 static char __pyx_k_is_text[] = "is_text";
4886 static PyObject *__pyx_kp_is_text;
4887 static char __pyx_k_resolvers[] = "resolvers";
4888 static PyObject *__pyx_kp_resolvers;
4889 static char __pyx_k_607[] = "read_file";
4890 static PyObject *__pyx_kp_607;
4891 static char __pyx_k_608[] = "write_file";
4892 static PyObject *__pyx_kp_608;
4893 static char __pyx_k_609[] = "create_dir";
4894 static PyObject *__pyx_kp_609;
4895 static char __pyx_k_610[] = "read_network";
4896 static PyObject *__pyx_kp_610;
4897 static char __pyx_k_611[] = "write_network";
4898 static PyObject *__pyx_kp_611;
4899 static char __pyx_k_options[] = "options";
4900 static PyObject *__pyx_kp_options;
4901 static char __pyx_k_ElementTree[] = "ElementTree";
4902 static PyObject *__pyx_kp_ElementTree;
4903 static char __pyx_k_628[] = "xsl";
4904 static PyObject *__pyx_kp_628;
4905 static char __pyx_k_635[] = "href";
4906 static PyObject *__pyx_kp_635;
4907 static char __pyx_k_AssertionError[] = "AssertionError";
4908 static PyObject *__pyx_kp_AssertionError;
4909 static char __pyx_k_652[] = "read";
4910 static PyObject *__pyx_kp_652;
4911 static PyObject *__pyx_kp_37;
4912 static PyObject *__pyx_kp_41;
4913 static PyObject *__pyx_kp_42;
4914 static PyObject *__pyx_kp_44;
4915 static PyObject *__pyx_kp_46;
4916 static PyObject *__pyx_kp_48;
4917 static PyObject *__pyx_kp_50;
4918 static PyObject *__pyx_kp_52;
4919 static PyObject *__pyx_kp_54;
4920 static PyObject *__pyx_kp_56;
4921 static PyObject *__pyx_kp_58;
4922 static PyObject *__pyx_kp_59;
4923 static PyObject *__pyx_kp_61;
4924 static PyObject *__pyx_kp_62;
4925 static PyObject *__pyx_kp_64;
4926 static PyObject *__pyx_kp_68;
4927 static PyObject *__pyx_kp_69;
4928 static PyObject *__pyx_kp_70;
4929 static PyObject *__pyx_kp_71;
4930 static PyObject *__pyx_kp_72;
4931 static PyObject *__pyx_kp_73;
4932 static PyObject *__pyx_kp_74;
4933 static PyObject *__pyx_kp_75;
4934 static PyObject *__pyx_kp_76;
4935 static PyObject *__pyx_kp_77;
4936 static PyObject *__pyx_kp_78;
4937 static PyObject *__pyx_kp_79;
4938 static PyObject *__pyx_kp_80;
4939 static PyObject *__pyx_kp_81;
4940 static PyObject *__pyx_kp_82;
4941 static PyObject *__pyx_kp_83;
4942 static PyObject *__pyx_kp_84;
4943 static PyObject *__pyx_kp_85;
4944 static PyObject *__pyx_kp_86;
4945 static PyObject *__pyx_kp_111;
4946 static PyObject *__pyx_kp_113;
4947 static PyObject *__pyx_kp_114;
4948 static PyObject *__pyx_kp_115;
4949 static PyObject *__pyx_kp_116;
4950 static PyObject *__pyx_kp_150;
4951 static PyObject *__pyx_kp_167;
4952 static PyObject *__pyx_kp_168;
4953 static PyObject *__pyx_kp_169;
4954 static PyObject *__pyx_kp_170;
4955 static PyObject *__pyx_kp_171;
4956 static PyObject *__pyx_kp_183;
4957 static PyObject *__pyx_kp_184;
4958 static PyObject *__pyx_kp_187;
4959 static PyObject *__pyx_kp_188;
4960 static PyObject *__pyx_kp_189;
4961 static PyObject *__pyx_kp_190;
4962 static PyObject *__pyx_kp_191;
4963 static PyObject *__pyx_kp_201;
4964 static PyObject *__pyx_kp_202;
4965 static PyObject *__pyx_kp_203;
4966 static PyObject *__pyx_kp_204;
4967 static PyObject *__pyx_kp_205;
4968 static PyObject *__pyx_kp_206;
4969 static PyObject *__pyx_kp_207;
4970 static PyObject *__pyx_kp_208;
4971 static PyObject *__pyx_kp_210;
4972 static PyObject *__pyx_kp_211;
4973 static PyObject *__pyx_kp_212;
4974 static PyObject *__pyx_kp_214;
4975 static PyObject *__pyx_kp_215;
4976 static PyObject *__pyx_kp_217;
4977 static PyObject *__pyx_kp_219;
4978 static PyObject *__pyx_kp_221;
4979 static PyObject *__pyx_kp_223;
4980 static PyObject *__pyx_builtin_ImportError;
4981 static PyObject *__pyx_builtin_AttributeError;
4982 static PyObject *__pyx_builtin_Exception;
4983 static PyObject *__pyx_builtin_SyntaxError;
4984 static PyObject *__pyx_builtin_super;
4985 static PyObject *__pyx_builtin_ValueError;
4986 static PyObject *__pyx_builtin_TypeError;
4987 static PyObject *__pyx_builtin_KeyError;
4988 static PyObject *__pyx_builtin_UnicodeEncodeError;
4989 static PyObject *__pyx_builtin_UnicodeDecodeError;
4990 static PyObject *__pyx_builtin_IndexError;
4991 static PyObject *__pyx_builtin_id;
4992 static PyObject *__pyx_builtin_FutureWarning;
4993 static PyObject *__pyx_builtin_StopIteration;
4994 static PyObject *__pyx_builtin_IOError;
4995 static PyObject *__pyx_builtin_LookupError;
4996 static PyObject *__pyx_builtin_open;
4997 static PyObject *__pyx_builtin_enumerate;
4998 static PyObject *__pyx_builtin_NotImplementedError;
4999 static PyObject *__pyx_builtin_AssertionError;
5000 static PyObject *__pyx_kp_225;
5001 static PyObject *__pyx_kp_226;
5002 static PyObject *__pyx_kp_227;
5003 static char __pyx_k_225[] = "-";
5004 static char __pyx_k_226[] = ".";
5005 static char __pyx_k_227[] = ".";
5006 static PyObject *__pyx_kp_231;
5007 static char __pyx_k_231[] = "double registering proxy!";
5008 static PyObject *__pyx_kp_232;
5009 static char __pyx_k_232[] = "Tried to unregister unknown proxy";
5010 static PyObject *__pyx_kp_233;
5011 static char __pyx_k_233[] = " ";
5012 static PyObject *__pyx_kp_234;
5013 static PyObject *__pyx_kp_235;
5014 static char __pyx_k_234[] = "Invalid input object: %s";
5015 static char __pyx_k_235[] = "Input object has no document: %s";
5016 static PyObject *__pyx_kp_236;
5017 static PyObject *__pyx_kp_237;
5018 static char __pyx_k_236[] = "Invalid input object: %s";
5019 static char __pyx_k_237[] = "Input object has no element: %s";
5020 static PyObject *__pyx_kp_239;
5021 static char __pyx_k_239[] = "Invalid attribute dictionary: %s";
5022 static PyObject *__pyx_kp_240;
5023 static char __pyx_k_240[] = "\\g<1>";
5024 static PyObject *__pyx_kp_241;
5025 static PyObject *__pyx_kp_242;
5026 static PyObject *__pyx_kp_243;
5027 static char __pyx_k_241[] = "<?xml";
5028 static char __pyx_k_242[] = "?>";
5029 static char __pyx_k_243[] = "\n\r ";
5030 static PyObject *__pyx_kp_244;
5031 static PyObject *__pyx_kp_245;
5032 static PyObject *__pyx_kp_246;
5033 static char __pyx_k_244[] = "";
5034 static char __pyx_k_245[] = "";
5035 static char __pyx_k_246[] = "";
5036 static char __pyx_k_247[] = "%s:%s";
5037 static PyObject *__pyx_kp_248;
5038 static PyObject *__pyx_kp_249;
5039 static PyObject *__pyx_kp_250;
5040 static PyObject *__pyx_kp_251;
5041 static PyObject *__pyx_kp_252;
5042 static PyObject *__pyx_kp_253;
5043 static PyObject *__pyx_kp_254;
5044 static char __pyx_k_248[] = "attempt to assign sequence of size %d to extended slice of size %d";
5045 static char __pyx_k_249[] = "Node must not be None";
5046 static char __pyx_k_250[] = "Node must not be None";
5047 static char __pyx_k_251[] = "Node must not be None";
5048 static char __pyx_k_252[] = "Node must not be None";
5049 static char __pyx_k_253[] = "Node must not be None";
5050 static char __pyx_k_254[] = "Node must not be None";
5051 static PyObject *__pyx_kp_255;
5052 static PyObject *__pyx_kp_256;
5053 static char __pyx_k_255[] = "Argument must be string or unicode.";
5054 static char __pyx_k_256[] = "All strings must be XML compatible: Unicode or ASCII, no NULL bytes";
5055 static PyObject *__pyx_kp_258;
5056 static char __pyx_k_257[] = "UTF-8";
5057 static char __pyx_k_258[] = "Argument must be string or unicode.";
5058 static char __pyx_k_259[] = "replace";
5059 static PyObject *__pyx_kp_260;
5060 static char __pyx_k_260[] = "Argument must be string or unicode.";
5061 static PyObject *__pyx_kp_261;
5062 static PyObject *__pyx_kp_262;
5063 static PyObject *__pyx_kp_263;
5064 static char __pyx_k_261[] = "Invalid tag name";
5065 static char __pyx_k_262[] = "Empty tag name";
5066 static char __pyx_k_263[] = "Empty tag name";
5067 static PyObject *__pyx_kp_264;
5068 static char __pyx_k_264[] = "Invalid tag name %r";
5069 static char __pyx_k_265[] = "UTF-8";
5070 static PyObject *__pyx_kp_266;
5071 static char __pyx_k_266[] = "Invalid HTML tag name %r";
5072 static char __pyx_k_267[] = "UTF-8";
5073 static PyObject *__pyx_kp_268;
5074 static char __pyx_k_268[] = "Invalid attribute name %r";
5075 static char __pyx_k_269[] = "UTF-8";
5076 static PyObject *__pyx_kp_270;
5077 static char __pyx_k_270[] = "Invalid namespace prefix %r";
5078 static char __pyx_k_271[] = "UTF-8";
5079 static char __pyx_k_272[] = "{%s}%s";
5080 static char __pyx_k_273[] = "{%s}%s";
5081 static char __pyx_k_274[] = "UTF-8";
5082 static PyObject *__pyx_kp_280;
5083 static PyObject *__pyx_kp_281;
5084 static char __pyx_k_280[] = "<undecodable error message>";
5085 static char __pyx_k_281[] = "<string>";
5086 static PyObject *__pyx_kp_282;
5087 static char __pyx_k_282[] = "%s:%d:%d:%s:%s:%s: %s";
5088 static PyObject *__pyx_kp_286;
5089 static char __pyx_k_286[] = "";
5090 static PyObject *__pyx_kp_287;
5091 static PyObject *__pyx_kp_288;
5092 static char __pyx_k_287[] = "%s, line %d, column %d";
5093 static char __pyx_k_288[] = "%s, line %d";
5094 static PyObject *__pyx_kp_289;
5095 static PyObject *__pyx_kp_290;
5096 static char __pyx_k_289[] = "%s, line %d, column %d";
5097 static char __pyx_k_290[] = "%s, line %d";
5098 static PyObject *__pyx_kp_291;
5099 static char __pyx_k_291[] = "\n";
5100 static char __pyx_k_295[] = "file %s";
5101 static char __pyx_k_296[] = "string://__STRING__XSLT";
5102 static char __pyx_k_297[] = "<xslt>";
5103 static char __pyx_k_298[] = "line %d";
5104 static char __pyx_k_299[] = "element %s";
5105 static char __pyx_k_300[] = "";
5106 static char __pyx_k_301[] = "%s, element '%s'";
5107 static PyObject *__pyx_kp_302;
5108 static char __pyx_k_302[] = "\\s*([a-zA-Z0-9_]+)\\s*=\\s*([0-9]+)";
5109 static char __pyx_k_303[] = "ns%d";
5110 static PyObject *__pyx_kp_306;
5111 static char __pyx_k_306[] = "invalid node type %d, expected %d";
5112 static char __pyx_k_307[] = "ns%d";
5113 static PyObject *__pyx_kp_308;
5114 static char __pyx_k_308[] = "Could not find root node";
5115 static PyObject *__pyx_kp_309;
5116 static PyObject *__pyx_kp_310;
5117 static PyObject *__pyx_kp_311;
5118 static PyObject *__pyx_kp_312;
5119 static PyObject *__pyx_kp_313;
5120 static char __pyx_k_309[] = "<!DOCTYPE %s PUBLIC \"%s\" \"%s\">";
5121 static char __pyx_k_310[] = "<!DOCTYPE %s PUBLIC \"%s\">";
5122 static char __pyx_k_311[] = "<!DOCTYPE %s SYSTEM \"%s\">";
5123 static char __pyx_k_312[] = "<!DOCTYPE %s>";
5124 static char __pyx_k_313[] = "";
5125 static PyObject *__pyx_kp_314;
5126 static PyObject *__pyx_kp_315;
5127 static char __pyx_k_314[] = "cannot assign None";
5128 static char __pyx_k_315[] = "list index out of range";
5129 static PyObject *__pyx_kp_316;
5130 static char __pyx_k_316[] = "index out of range: %d";
5131 static PyObject *__pyx_kp_317;
5132 static char __pyx_k_317[] = "Only processing instructions and comments can be siblings of the root element";
5133 static PyObject *__pyx_kp_318;
5134 static char __pyx_k_318[] = "Only processing instructions and comments can be siblings of the root element";
5135 static PyObject *__pyx_kp_319;
5136 static char __pyx_k_319[] = "Element is not a child of this node.";
5137 static PyObject *__pyx_kp_320;
5138 static char __pyx_k_320[] = "Element is not a child of this node.";
5139 static char __pyx_k_321[] = "UTF-8";
5140 static char __pyx_k_322[] = "strict";
5141 static PyObject *__pyx_kp_323;
5142 static char __pyx_k_323[] = "<Element %s at %x>";
5143 static PyObject *__pyx_kp_324;
5144 static char __pyx_k_324[] = "list index out of range";
5145 static PyObject *__pyx_kp_325;
5146 static char __pyx_k_325[] = "The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.";
5147 static PyObject *__pyx_kp_326;
5148 static PyObject *__pyx_kp_327;
5149 static PyObject *__pyx_kp_328;
5150 static PyObject *__pyx_kp_329;
5151 static PyObject *__pyx_kp_330;
5152 static PyObject *__pyx_kp_331;
5153 static char __pyx_k_326[] = "Element is not a child of this node.";
5154 static char __pyx_k_327[] = "list.index(x): x not in slice";
5155 static char __pyx_k_328[] = "list.index(x): x not in slice";
5156 static char __pyx_k_329[] = "list.index(x): x not in slice";
5157 static char __pyx_k_330[] = "list.index(x): x not in slice";
5158 static char __pyx_k_331[] = "list.index(x): x not in list";
5159 static PyObject *__pyx_kp_332;
5160 static char __pyx_k_332[] = "this element does not have children or attributes";
5161 static PyObject *__pyx_kp_333;
5162 static char __pyx_k_333[] = "";
5163 static PyObject *__pyx_kp_334;
5164 static char __pyx_k_334[] = "list index out of range";
5165 static PyObject *__pyx_kp_335;
5166 static char __pyx_k_335[] = "<!--%s-->";
5167 static PyObject *__pyx_kp_336;
5168 static PyObject *__pyx_kp_337;
5169 static char __pyx_k_336[] = "<?%s %s?>";
5170 static char __pyx_k_337[] = "<?%s?>";
5171 static PyObject *__pyx_kp_338;
5172 static PyObject *__pyx_kp_339;
5173 static PyObject *__pyx_kp_340;
5174 static char __pyx_k_338[] = "&";
5175 static char __pyx_k_339[] = ";";
5176 static char __pyx_k_340[] = "Invalid entity name '%s'";
5177 static PyObject *__pyx_kp_341;
5178 static char __pyx_k_341[] = "&%s;";
5179 static PyObject *__pyx_kp_342;
5180 static char __pyx_k_342[] = "&%s;";
5181 static PyObject *__pyx_kp_343;
5182 static PyObject *__pyx_kp_346;
5183 static char __pyx_k_343[] = "Invalid input tag of type %r";
5184 static char __pyx_k_344[] = "UTF-8";
5185 static char __pyx_k_345[] = "UTF-8";
5186 static char __pyx_k_346[] = "{%s}%s";
5187 static PyObject *__pyx_kp_347;
5188 static char __pyx_k_347[] = "ElementTree not initialized, missing root";
5189 static PyObject *__pyx_kp_348;
5190 static char __pyx_k_348[] = "Only elements can be the root of an ElementTree";
5191 static PyObject *__pyx_kp_351;
5192 static PyObject *__pyx_kp_354;
5193 static char __pyx_k_351[] = "US-ASCII";
5194 static char __pyx_k_354[] = "UTF-8";
5195 static PyObject *__pyx_kp_355;
5196 static char __pyx_k_355[] = "Element is not in this tree.";
5197 static PyObject *__pyx_kp_356;
5198 static PyObject *__pyx_kp_357;
5199 static PyObject *__pyx_kp_358;
5200 static PyObject *__pyx_kp_359;
5201 static char __pyx_k_356[] = "/";
5202 static char __pyx_k_357[] = ".";
5203 static char __pyx_k_358[] = "/";
5204 static char __pyx_k_359[] = ".";
5205 static PyObject *__pyx_kp_360;
5206 static PyObject *__pyx_kp_361;
5207 static PyObject *__pyx_kp_362;
5208 static PyObject *__pyx_kp_363;
5209 static char __pyx_k_360[] = "/";
5210 static char __pyx_k_361[] = ".";
5211 static char __pyx_k_362[] = "/";
5212 static char __pyx_k_363[] = ".";
5213 static PyObject *__pyx_kp_364;
5214 static PyObject *__pyx_kp_365;
5215 static PyObject *__pyx_kp_366;
5216 static PyObject *__pyx_kp_367;
5217 static char __pyx_k_364[] = "/";
5218 static char __pyx_k_365[] = ".";
5219 static char __pyx_k_366[] = "/";
5220 static char __pyx_k_367[] = ".";
5221 static PyObject *__pyx_kp_368;
5222 static PyObject *__pyx_kp_369;
5223 static PyObject *__pyx_kp_370;
5224 static PyObject *__pyx_kp_371;
5225 static char __pyx_k_368[] = "/";
5226 static char __pyx_k_369[] = ".";
5227 static char __pyx_k_370[] = "/";
5228 static char __pyx_k_371[] = ".";
5229 static PyObject *__pyx_kp_372;
5230 static char __pyx_k_372[] = "pop expected at most 2 arguments, got %d";
5231 static PyObject *__pyx_kp_377;
5232 static char __pyx_k_377[] = "";
5233 static PyObject *__pyx_kp_378;
5234 static char __pyx_k_378[] = "";
5235 static PyObject *__pyx_kp_379;
5236 static PyObject *__pyx_kp_380;
5237 static char __pyx_k_379[] = "Invalid character reference: '%s'";
5238 static char __pyx_k_380[] = "Invalid entity reference: '%s'";
5239 static PyObject *__pyx_kp_381;
5240 static PyObject *__pyx_kp_383;
5241 static PyObject *__pyx_kp_385;
5242 static PyObject *__pyx_kp_387;
5243 static char __pyx_k_381[] = "Serialisation to unicode must not request an XML declaration";
5244 static char __pyx_k_383[] = "UTF-8";
5245 static char __pyx_k_385[] = "US-ASCII";
5246 static char __pyx_k_387[] = "Type '%s' cannot be serialized.";
5247 static PyObject *__pyx_kp_388;
5248 static char __pyx_k_388[] = "Type '%s' cannot be serialized.";
5249 static PyObject *__pyx_kp_389;
5250 static char __pyx_k_389[] = "Proxy invalidated!";
5251 static PyObject *__pyx_kp_390;
5252 static char __pyx_k_390[] = "<Element %s at %x>";
5253 static PyObject *__pyx_kp_391;
5254 static char __pyx_k_391[] = "list index out of range";
5255 static PyObject *__pyx_kp_392;
5256 static char __pyx_k_392[] = "*";
5257 static char __pyx_k_393[] = "UTF-8";
5258 static char __pyx_k_394[] = "strict";
5259 static PyObject *__pyx_kp_395;
5260 static PyObject *__pyx_kp_396;
5261 static char __pyx_k_395[] = "invalid value to append()";
5262 static char __pyx_k_396[] = "invalid element";
5263 static PyObject *__pyx_kp_397;
5264 static PyObject *__pyx_kp_398;
5265 static PyObject *__pyx_kp_399;
5266 static char __pyx_k_397[] = ".";
5267 static char __pyx_k_398[] = ".";
5268 static char __pyx_k_399[] = "Invalid child type: %r";
5269 static PyObject *__pyx_kp_400;
5270 static PyObject *__pyx_kp_401;
5271 static PyObject *__pyx_kp_402;
5272 static PyObject *__pyx_kp_403;
5273 static char __pyx_k_400[] = "element class must be subclass of ElementBase";
5274 static char __pyx_k_401[] = "comment class must be subclass of CommentBase";
5275 static char __pyx_k_402[] = "Entity class must be subclass of EntityBase";
5276 static char __pyx_k_403[] = "PI class must be subclass of PIBase";
5277 static PyObject *__pyx_kp_407;
5278 static char __pyx_k_404[] = "xml-stylesheet";
5279 static char __pyx_k_405[] = "text/xsl";
5280 static char __pyx_k_406[] = "text/xml";
5281 static char __pyx_k_407[] = "Unknown node type: %s";
5282 static PyObject *__pyx_kp_415;
5283 static char __pyx_k_415[] = "Name not registered.";
5284 static PyObject *__pyx_kp_416;
5285 static char __pyx_k_416[] = "Name not registered.";
5286 static PyObject *__pyx_kp_417;
5287 static char __pyx_k_417[] = "Registered element classes must be subtypes of ElementBase";
5288 static PyObject *__pyx_kp_418;
5289 static char __pyx_k_418[] = "Namespace(%r)";
5290 static PyObject *__pyx_kp_419;
5291 static PyObject *__pyx_kp_420;
5292 static char __pyx_k_419[] = "Registered functions must be callable.";
5293 static char __pyx_k_420[] = "extensions must have non empty names";
5294 static PyObject *__pyx_kp_421;
5295 static char __pyx_k_421[] = "FunctionNamespace(%r)";
5296 static PyObject *__pyx_kp_422;
5297 static char __pyx_k_422[] = "";
5298 static PyObject *__pyx_kp_423;
5299 static char __pyx_k_423[] = "";
5300 static PyObject *__pyx_kp_424;
5301 static char __pyx_k_424[] = "argument must be a byte string or unicode string";
5302 static PyObject *__pyx_kp_425;
5303 static char __pyx_k_425[] = "Argument is not a file-like object";
5304 static char __pyx_k_429[] = "<test/>";
5305 static char __pyx_k_430[] = "UTF-16LE";
5306 static char __pyx_k_431[] = "UTF-16BE";
5307 static char __pyx_k_432[] = "UTF-16LE";
5308 static char __pyx_k_433[] = "UTF-16BE";
5309 static char __pyx_k_434[] = "UCS-4LE";
5310 static char __pyx_k_435[] = "UCS-4BE";
5311 static PyObject *__pyx_kp_436;
5312 static char __pyx_k_436[] = "";
5313 static PyObject *__pyx_kp_437;
5314 static char __pyx_k_437[] = "reading from file-like objects must return byte strings or unicode strings";
5315 static PyObject *__pyx_kp_438;
5316 static char __pyx_k_438[] = "parser locking failed";
5317 static PyObject *__pyx_kp_439;
5318 static PyObject *__pyx_kp_440;
5319 static PyObject *__pyx_kp_441;
5320 static PyObject *__pyx_kp_442;
5321 static char __pyx_k_439[] = "Error reading file '%s': %s";
5322 static char __pyx_k_440[] = "Error reading '%s'";
5323 static char __pyx_k_441[] = "Document is not well formed";
5324 static char __pyx_k_442[] = "line %d: %s";
5325 static char __pyx_k_445[] = "UTF-8";
5326 static PyObject *__pyx_kp_446;
5327 static PyObject *__pyx_kp_447;
5328 static char __pyx_k_446[] = "This class cannot be instantiated";
5329 static char __pyx_k_447[] = "unknown encoding: '%s'";
5330 static char __pyx_k_448[] = "dummy";
5331 static PyObject *__pyx_kp_449;
5332 static char __pyx_k_449[] = "libxml2 %d.%d.%d";
5333 static PyObject *__pyx_kp_450;
5334 static char __pyx_k_450[] = "string is too long to parse it with libxml2";
5335 static PyObject *__pyx_kp_451;
5336 static PyObject *__pyx_kp_452;
5337 static char __pyx_k_451[] = "Unicode parsing is not supported on this platform";
5338 static char __pyx_k_452[] = "Parsing requires string data";
5339 static PyObject *__pyx_kp_453;
5340 static char __pyx_k_453[] = "no element found";
5341 static char __pyx_k_454[] = "UTF-8";
5342 static PyObject *__pyx_kp_458;
5343 static char __pyx_k_458[] = "cannot parse from '%s'";
5344 static PyObject *__pyx_kp_459;
5345 static PyObject *__pyx_kp_460;
5346 static char __pyx_k_459[] = "Unicode strings with encoding declaration are not supported.";
5347 static char __pyx_k_460[] = "can only parse strings";
5348 static PyObject *__pyx_kp_461;
5349 static PyObject *__pyx_kp_462;
5350 static char __pyx_k_461[] = "";
5351 static char __pyx_k_462[] = "";
5352 static char __pyx_k_463[] = "strict";
5353 static PyObject *__pyx_kp_464;
5354 static PyObject *__pyx_kp_465;
5355 static char __pyx_k_464[] = "";
5356 static char __pyx_k_465[] = "";
5357 static PyObject *__pyx_kp_466;
5358 static PyObject *__pyx_kp_467;
5359 static PyObject *__pyx_kp_468;
5360 static char __pyx_k_466[] = "";
5361 static char __pyx_k_467[] = "internal error (tail)";
5362 static char __pyx_k_468[] = "internal error (text)";
5363 static PyObject *__pyx_kp_469;
5364 static PyObject *__pyx_kp_470;
5365 static char __pyx_k_469[] = "missing end tags";
5366 static char __pyx_k_470[] = "missing toplevel element";
5367 static PyObject *__pyx_kp_471;
5368 static char __pyx_k_471[] = "end tag mismatch (expected %s, got %s)";
5369 static PyObject *__pyx_kp_476;
5370 static char __pyx_k_476[] = "unknown output method %r";
5371 static PyObject *__pyx_kp_477;
5372 static PyObject *__pyx_kp_478;
5373 static char __pyx_k_477[] = "Error during serialisation (out of memory?)";
5374 static char __pyx_k_478[] = "UTF-8";
5375 static char __pyx_k_480[] = "strict";
5376 static char __pyx_k_481[] = "strict";
5377 static PyObject *__pyx_kp_482;
5378 static PyObject *__pyx_kp_483;
5379 static char __pyx_k_482[] = "UTF-8";
5380 static char __pyx_k_483[] = "unknown encoding: '%s'";
5381 static char __pyx_k_484[] = "strict";
5382 static PyObject *__pyx_kp_485;
5383 static char __pyx_k_485[] = "unknown error %d";
5384 static char __pyx_k_486[] = "\n";
5385 static char __pyx_k_487[] = "1.0";
5386 static char __pyx_k_488[] = "<?xml version='";
5387 static char __pyx_k_489[] = "' encoding='";
5388 static char __pyx_k_490[] = "' standalone='no'?>\n";
5389 static char __pyx_k_491[] = "' standalone='yes'?>\n";
5390 static char __pyx_k_492[] = "'?>\n";
5391 static char __pyx_k_493[] = "<!DOCTYPE ";
5392 static char __pyx_k_494[] = " PUBLIC \"";
5393 static char __pyx_k_495[] = "\" \"";
5394 static char __pyx_k_496[] = " SYSTEM \"";
5395 static char __pyx_k_497[] = "\"";
5396 static char __pyx_k_498[] = ">\n";
5397 static char __pyx_k_499[] = " [\n";
5398 static char __pyx_k_500[] = "]>\n";
5399 static char __pyx_k_501[] = "\n";
5400 static char __pyx_k_502[] = "\n";
5401 static PyObject *__pyx_kp_504;
5402 static char __pyx_k_504[] = "Could not create I/O writer context.";
5403 static PyObject *__pyx_kp_505;
5404 static char __pyx_k_505[] = "File is already closed";
5405 static PyObject *__pyx_kp_508;
5406 static PyObject *__pyx_kp_509;
5407 static PyObject *__pyx_kp_511;
5408 static char __pyx_k_508[] = "UTF-8";
5409 static char __pyx_k_509[] = "unknown encoding: '%s'";
5410 static char __pyx_k_511[] = "File or filename expected, got '%s'";
5411 static PyObject *__pyx_kp_513;
5412 static PyObject *__pyx_kp_514;
5413 static char __pyx_k_513[] = "File or filename expected, got '%s'";
5414 static char __pyx_k_514[] = "C14N failed";
5415 static PyObject *__pyx_kp_515;
5416 static char __pyx_k_515[] = "not a file";
5417 static char __pyx_k_516[] = "\n";
5418 static PyObject *__pyx_kp_519;
5419 static PyObject *__pyx_kp_520;
5420 static PyObject *__pyx_kp_523;
5421 static char __pyx_k_519[] = "start-ns";
5422 static char __pyx_k_520[] = "end-ns";
5423 static char __pyx_k_523[] = "invalid event name '%s'";
5424 static PyObject *__pyx_kp_524;
5425 static PyObject *__pyx_kp_525;
5426 static PyObject *__pyx_kp_526;
5427 static char __pyx_k_524[] = "";
5428 static char __pyx_k_525[] = "";
5429 static char __pyx_k_526[] = "start-ns";
5430 static PyObject *__pyx_kp_527;
5431 static PyObject *__pyx_kp_528;
5432 static PyObject *__pyx_kp_529;
5433 static char __pyx_k_527[] = "*";
5434 static char __pyx_k_528[] = "*";
5435 static char __pyx_k_529[] = "*";
5436 static PyObject *__pyx_kp_532;
5437 static char __pyx_k_532[] = "end-ns";
5438 static PyObject *__pyx_kp_537;
5439 static PyObject *__pyx_kp_538;
5440 static char __pyx_k_537[] = "start-ns";
5441 static char __pyx_k_538[] = "end-ns";
5442 static PyObject *__pyx_kp_539;
5443 static char __pyx_k_539[] = "iterparse parsers cannot be copied";
5444 static PyObject *__pyx_kp_540;
5445 static char __pyx_k_540[] = "reading file objects must return plain strings";
5446 static PyObject *__pyx_kp_541;
5447 static PyObject *__pyx_kp_542;
5448 static PyObject *__pyx_kp_543;
5449 static char __pyx_k_541[] = "*";
5450 static char __pyx_k_542[] = "*";
5451 static char __pyx_k_543[] = "*";
5452 static PyObject *__pyx_kp_546;
5453 static char __pyx_k_546[] = "end-ns";
5454 static PyObject *__pyx_kp_547;
5455 static char __pyx_k_547[] = "//*[string(@id)]";
5456 static PyObject *__pyx_kp_549;
5457 static char __pyx_k_549[] = "No ID dictionary available.";
5458 static PyObject *__pyx_kp_550;
5459 static PyObject *__pyx_kp_551;
5460 static char __pyx_k_550[] = "key not found.";
5461 static char __pyx_k_551[] = "ID attribute not found.";
5462 static PyObject *__pyx_kp_552;
5463 static char __pyx_k_552[] = "XInclude processing failed";
5464 static PyObject *__pyx_kp_553;
5465 static char __pyx_k_553[] = "*";
5466 static PyObject *__pyx_kp_554;
5467 static char __pyx_k_554[] = "";
5468 static PyObject *__pyx_kp_555;
5469 static char __pyx_k_555[] = "*";
5470 static PyObject *__pyx_kp_172;
5471 static PyObject *__pyx_kp_173;
5472 static PyObject *__pyx_kp_556;
5473 static PyObject *__pyx_kp_557;
5474 static PyObject *__pyx_kp_558;
5475 static char __pyx_k_556[] = "extensions must have non empty names";
5476 static char __pyx_k_557[] = "empty namespace prefix is not supported in XPath";
5477 static char __pyx_k_558[] = "setting default namespace is not supported in XPath";
5478 static PyObject *__pyx_kp_559;
5479 static char __pyx_k_559[] = "empty prefix is not supported in XPath";
5480 static PyObject *__pyx_kp_560;
5481 static char __pyx_k_560[] = "empty prefix is not supported in XPath";
5482 static PyObject *__pyx_kp_561;
5483 static PyObject *__pyx_kp_562;
5484 static PyObject *__pyx_kp_563;
5485 static PyObject *__pyx_kp_564;
5486 static char __pyx_k_561[] = "XPath context is only usable during the evaluation";
5487 static char __pyx_k_562[] = "no context node";
5488 static char __pyx_k_563[] = "document-external context nodes are not supported";
5489 static char __pyx_k_564[] = "document context is missing";
5490 static PyObject *__pyx_kp_566;
5491 static char __pyx_k_566[] = "";
5492 static PyObject *__pyx_kp_570;
5493 static PyObject *__pyx_kp_572;
5494 static char __pyx_k_570[] = "";
5495 static char __pyx_k_572[] = "";
5496 static PyObject *__pyx_kp_576;
5497 static char __pyx_k_576[] = "http://exslt.org/regular-expressions";
5498 static PyObject *__pyx_kp_580;
5499 static PyObject *__pyx_kp_581;
5500 static char __pyx_k_580[] = "This is not a node: %r";
5501 static char __pyx_k_581[] = "Unknown return type: %s";
5502 static PyObject *__pyx_kp_582;
5503 static PyObject *__pyx_kp_587;
5504 static char __pyx_k_582[] = "Undefined xpath result";
5505 static char __pyx_k_587[] = "Unknown xpath result %s";
5506 static PyObject *__pyx_kp_588;
5507 static char __pyx_k_588[] = "Not yet implemented result node type: %d";
5508 static PyObject *__pyx_kp_589;
5509 static PyObject *__pyx_kp_590;
5510 static char __pyx_k_589[] = "{%s}%s";
5511 static char __pyx_k_590[] = "XPath function '%s' not found";
5512 static PyObject *__pyx_kp_591;
5513 static PyObject *__pyx_kp_592;
5514 static char __pyx_k_591[] = "This version of libxml2 has a known XPath bug. ";
5515 static char __pyx_k_592[] = "Use it at your own risk.";
5516 static PyObject *__pyx_kp_593;
5517 static char __pyx_k_593[] = "parser locking failed";
5518 static PyObject *__pyx_kp_594;
5519 static char __pyx_k_594[] = "Error in xpath expression";
5520 static PyObject *__pyx_kp_595;
5521 static char __pyx_k_595[] = "Error in xpath expression";
5522 static PyObject *__pyx_kp_596;
5523 static PyObject *__pyx_kp_602;
5524 static char __pyx_k_596[] = "";
5525 static char __pyx_k_597[] = "__xpp%02d";
5526 static char __pyx_k_598[] = "UTF-8";
5527 static char __pyx_k_599[] = "strict";
5528 static char __pyx_k_600[] = "UTF-8";
5529 static char __pyx_k_601[] = "strict";
5530 static char __pyx_k_602[] = ":";
5531 static char __pyx_k_603[] = "UTF-8";
5532 static char __pyx_k_604[] = "strict";
5533 static char __pyx_k_605[] = "string://__STRING__XSLT__/";
5534 static PyObject *__pyx_kp_606;
5535 static char __pyx_k_606[] = "Cannot resolve URI %s";
5536 static PyObject *__pyx_kp_612;
5537 static PyObject *__pyx_kp_613;
5538 static PyObject *__pyx_kp_614;
5539 static PyObject *__pyx_kp_615;
5540 static char __pyx_k_612[] = "%s(%s)";
5541 static char __pyx_k_613[] = ".";
5542 static char __pyx_k_614[] = ", ";
5543 static char __pyx_k_615[] = "%s=%r";
5544 static PyObject *__pyx_kp_616;
5545 static char __pyx_k_616[] = "extensions must not have empty namespaces";
5546 static PyObject *__pyx_kp_617;
5547 static PyObject *__pyx_kp_618;
5548 static char __pyx_k_617[] = "string://__STRING__XSLT__/%d.xslt";
5549 static char __pyx_k_618[] = "Cannot parse stylesheet";
5550 static PyObject *__pyx_kp_619;
5551 static PyObject *__pyx_kp_620;
5552 static PyObject *__pyx_kp_621;
5553 static char __pyx_k_619[] = "%s, line %d";
5554 static char __pyx_k_620[] = "Error applying stylesheet, line %d";
5555 static char __pyx_k_621[] = "Error applying stylesheet";
5556 static PyObject *__pyx_kp_622;
5557 static char __pyx_k_622[] = "";
5558 static PyObject *__pyx_kp_623;
5559 static char __pyx_k_623[] = "";
5560 static char __pyx_k_624[] = "ascii";
5561 static char __pyx_k_625[] = "strict";
5562 static char __pyx_k_626[] = "B";
5563 static PyObject *__pyx_kp_627;
5564 static PyObject *__pyx_kp_629;
5565 static char __pyx_k_627[] = "//xsl:stylesheet[@xml:id = $id]";
5566 static char __pyx_k_629[] = "http://www.w3.org/1999/XSL/Transform";
5567 static PyObject *__pyx_kp_630;
5568 static PyObject *__pyx_kp_631;
5569 static PyObject *__pyx_kp_632;
5570 static PyObject *__pyx_kp_633;
5571 static PyObject *__pyx_kp_634;
5572 static char __pyx_k_630[] = "PI lacks content";
5573 static char __pyx_k_631[] = " ";
5574 static char __pyx_k_632[] = "malformed PI attributes";
5575 static char __pyx_k_633[] = "reference to non-existing embedded stylesheet";
5576 static char __pyx_k_634[] = "ambiguous reference to embedded stylesheet";
5577 static PyObject *__pyx_kp_636;
5578 static PyObject *__pyx_kp_637;
5579 static PyObject *__pyx_kp_638;
5580 static PyObject *__pyx_kp_639;
5581 static PyObject *__pyx_kp_640;
5582 static PyObject *__pyx_kp_641;
5583 static PyObject *__pyx_kp_642;
5584 static char __pyx_k_636[] = "only setting the 'href' attribute is supported on XSLT-PIs";
5585 static char __pyx_k_637[] = "";
5586 static char __pyx_k_638[] = "\"";
5587 static char __pyx_k_639[] = ">";
5588 static char __pyx_k_640[] = "Invalid URL, must not contain '\"' or '>'";
5589 static char __pyx_k_641[] = " href=\"%s\"";
5590 static char __pyx_k_642[] = " ";
5591 static PyObject *__pyx_kp_643;
5592 static char __pyx_k_643[] = " ";
5593 static PyObject *__pyx_kp_645;
5594 static char __pyx_k_644[] = "fake-parent";
5595 static char __pyx_k_645[] = "unsupported XSLT result type: %d";
5596 static PyObject *__pyx_kp_646;
5597 static PyObject *__pyx_kp_647;
5598 static char __pyx_k_646[] = "extension element %s not found";
5599 static char __pyx_k_647[] = "UTF-8";
5600 static char __pyx_k_648[] = "Error executing extension element '%s': %s";
5601 static char __pyx_k_649[] = "Error executing extension element '%s'";
5602 static PyObject *__pyx_kp_650;
5603 static char __pyx_k_650[] = "Document does not comply with schema";
5604 static PyObject *__pyx_kp_651;
5605 static char __pyx_k_651[] = "Document does not comply with schema";
5606 static PyObject *__pyx_kp_653;
5607 static PyObject *__pyx_kp_654;
5608 static PyObject *__pyx_kp_655;
5609 static char __pyx_k_653[] = "file must be a filename or file-like object";
5610 static char __pyx_k_654[] = "either filename or external ID required";
5611 static char __pyx_k_655[] = "error parsing DTD";
5612 static PyObject *__pyx_kp_656;
5613 static PyObject *__pyx_kp_657;
5614 static char __pyx_k_656[] = "Failed to create validation context";
5615 static char __pyx_k_657[] = "Internal error in DTD validation";
5616 static PyObject *__pyx_kp_658;
5617 static char __pyx_k_658[] = "error parsing DTD";
5618 static PyObject *__pyx_kp_660;
5619 static PyObject *__pyx_kp_661;
5620 static PyObject *__pyx_kp_662;
5621 static PyObject *__pyx_kp_663;
5622 static char __pyx_k_659[] = "http://relaxng.org/ns/structure/1.0";
5623 static char __pyx_k_660[] = "Document is not Relax NG";
5624 static char __pyx_k_661[] = "No tree or file given";
5625 static char __pyx_k_662[] = "Document is not parsable as Relax NG";
5626 static char __pyx_k_663[] = "Document is not valid Relax NG";
5627 static PyObject *__pyx_kp_664;
5628 static char __pyx_k_664[] = "Internal error in Relax NG validation";
5629 static PyObject *__pyx_kp_666;
5630 static PyObject *__pyx_kp_667;
5631 static PyObject *__pyx_kp_668;
5632 static char __pyx_k_665[] = "http://www.w3.org/2001/XMLSchema";
5633 static char __pyx_k_666[] = "Document is not XML Schema";
5634 static char __pyx_k_667[] = "No tree or file given";
5635 static char __pyx_k_668[] = "Document is not valid XML Schema";
5636 static PyObject *__pyx_kp_669;
5637 static char __pyx_k_669[] = "Internal error in XML Schema validation.";
5638 static PyObject *__pyx_kp_670;
5639 static PyObject *__pyx_kp_671;
5640 static PyObject *__pyx_kp_672;
5641 static char __pyx_k_670[] = "lxml.etree was compiled without Schematron support.";
5642 static char __pyx_k_671[] = "No tree or file given";
5643 static char __pyx_k_672[] = "Document is not a valid Schematron schema";
5644 static PyObject *__pyx_kp_673;
5645 static char __pyx_k_673[] = "Internal error in Schematron validation";
5646
5647 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":118
5648  *     this one.
5649  *     """
5650  *     def __init__(self, message, error_log=None):             # <<<<<<<<<<<<<<
5651  *         if python.PY_VERSION_HEX >= 0x02050000:
5652  *             # Python >= 2.5 uses new style class exceptions
5653  */
5654
5655 static PyObject *__pyx_pf_4lxml_5etree_9LxmlError___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5656 static PyMethodDef __pyx_mdef_4lxml_5etree_9LxmlError___init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pf_4lxml_5etree_9LxmlError___init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
5657 static PyObject *__pyx_pf_4lxml_5etree_9LxmlError___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5658   PyObject *__pyx_v_self = 0;
5659   PyObject *__pyx_v_message = 0;
5660   PyObject *__pyx_v_error_log = 0;
5661   PyObject *__pyx_r = NULL;
5662   int __pyx_t_1;
5663   PyObject *__pyx_t_2 = NULL;
5664   PyObject *__pyx_t_3 = NULL;
5665   PyObject *__pyx_t_4 = NULL;
5666   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_self,&__pyx_kp_message,&__pyx_kp_error_log,0};
5667   __Pyx_SetupRefcountContext("__init__");
5668   __pyx_self = __pyx_self;
5669   if (unlikely(__pyx_kwds)) {
5670     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
5671     PyObject* values[3] = {0,0,0};
5672     values[2] = Py_None;
5673     switch (PyTuple_GET_SIZE(__pyx_args)) {
5674       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5675       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5676       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5677       case  0: break;
5678       default: goto __pyx_L5_argtuple_error;
5679     }
5680     switch (PyTuple_GET_SIZE(__pyx_args)) {
5681       case  0:
5682       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_self);
5683       if (likely(values[0])) kw_args--;
5684       else goto __pyx_L5_argtuple_error;
5685       case  1:
5686       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_message);
5687       if (likely(values[1])) kw_args--;
5688       else {
5689         __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5690       }
5691       case  2:
5692       if (kw_args > 0) {
5693         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_error_log);
5694         if (unlikely(value)) { values[2] = value; kw_args--; }
5695       }
5696     }
5697     if (unlikely(kw_args > 0)) {
5698       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5699     }
5700     __pyx_v_self = values[0];
5701     __pyx_v_message = values[1];
5702     __pyx_v_error_log = values[2];
5703   } else {
5704     __pyx_v_error_log = Py_None;
5705     switch (PyTuple_GET_SIZE(__pyx_args)) {
5706       case  3:
5707       __pyx_v_error_log = PyTuple_GET_ITEM(__pyx_args, 2);
5708       case  2:
5709       __pyx_v_message = PyTuple_GET_ITEM(__pyx_args, 1);
5710       __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
5711       break;
5712       default: goto __pyx_L5_argtuple_error;
5713     }
5714   }
5715   goto __pyx_L4_argument_unpacking_done;
5716   __pyx_L5_argtuple_error:;
5717   __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5718   __pyx_L3_error:;
5719   __Pyx_AddTraceback("lxml.etree.LxmlError.__init__");
5720   return NULL;
5721   __pyx_L4_argument_unpacking_done:;
5722
5723   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":119
5724  *     """
5725  *     def __init__(self, message, error_log=None):
5726  *         if python.PY_VERSION_HEX >= 0x02050000:             # <<<<<<<<<<<<<<
5727  *             # Python >= 2.5 uses new style class exceptions
5728  *             super(_LxmlError, self).__init__(message)
5729  */
5730   __pyx_t_1 = (PY_VERSION_HEX >= 0x02050000);
5731   if (__pyx_t_1) {
5732
5733     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":121
5734  *         if python.PY_VERSION_HEX >= 0x02050000:
5735  *             # Python >= 2.5 uses new style class exceptions
5736  *             super(_LxmlError, self).__init__(message)             # <<<<<<<<<<<<<<
5737  *         else:
5738  *             error_super_init(self, message)
5739  */
5740     __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5741     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
5742     __Pyx_INCREF(__pyx_v_4lxml_5etree__LxmlError);
5743     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_4lxml_5etree__LxmlError);
5744     __Pyx_GIVEREF(__pyx_v_4lxml_5etree__LxmlError);
5745     __Pyx_INCREF(__pyx_v_self);
5746     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self);
5747     __Pyx_GIVEREF(__pyx_v_self);
5748     __pyx_t_3 = PyObject_Call(__pyx_builtin_super, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5749     __Pyx_GOTREF(__pyx_t_3);
5750     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
5751     __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_kp___init__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5752     __Pyx_GOTREF(__pyx_t_2);
5753     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5754     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5755     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
5756     __Pyx_INCREF(__pyx_v_message);
5757     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_message);
5758     __Pyx_GIVEREF(__pyx_v_message);
5759     __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5760     __Pyx_GOTREF(__pyx_t_4);
5761     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5762     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
5763     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5764     goto __pyx_L6;
5765   }
5766   /*else*/ {
5767
5768     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":123
5769  *             super(_LxmlError, self).__init__(message)
5770  *         else:
5771  *             error_super_init(self, message)             # <<<<<<<<<<<<<<
5772  *         if error_log is None:
5773  *             self.error_log = __copyGlobalErrorLog()
5774  */
5775     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5776     __Pyx_GOTREF(((PyObject *)__pyx_t_4));
5777     __Pyx_INCREF(__pyx_v_self);
5778     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self);
5779     __Pyx_GIVEREF(__pyx_v_self);
5780     __Pyx_INCREF(__pyx_v_message);
5781     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_message);
5782     __Pyx_GIVEREF(__pyx_v_message);
5783     __pyx_t_3 = PyObject_Call(__pyx_v_4lxml_5etree_error_super_init, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5784     __Pyx_GOTREF(__pyx_t_3);
5785     __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
5786     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5787   }
5788   __pyx_L6:;
5789
5790   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":124
5791  *         else:
5792  *             error_super_init(self, message)
5793  *         if error_log is None:             # <<<<<<<<<<<<<<
5794  *             self.error_log = __copyGlobalErrorLog()
5795  *         else:
5796  */
5797   __pyx_t_1 = (__pyx_v_error_log == Py_None);
5798   if (__pyx_t_1) {
5799
5800     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":125
5801  *             error_super_init(self, message)
5802  *         if error_log is None:
5803  *             self.error_log = __copyGlobalErrorLog()             # <<<<<<<<<<<<<<
5804  *         else:
5805  *             self.error_log = error_log.copy()
5806  */
5807     __pyx_t_3 = __pyx_f_4lxml_5etree___copyGlobalErrorLog(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5808     __Pyx_GOTREF(__pyx_t_3);
5809     if (PyObject_SetAttr(__pyx_v_self, __pyx_kp_error_log, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5810     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5811     goto __pyx_L7;
5812   }
5813   /*else*/ {
5814
5815     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":127
5816  *             self.error_log = __copyGlobalErrorLog()
5817  *         else:
5818  *             self.error_log = error_log.copy()             # <<<<<<<<<<<<<<
5819  * 
5820  * cdef object _LxmlError
5821  */
5822     __pyx_t_3 = PyObject_GetAttr(__pyx_v_error_log, __pyx_kp_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5823     __Pyx_GOTREF(__pyx_t_3);
5824     __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5825     __Pyx_GOTREF(__pyx_t_4);
5826     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5827     if (PyObject_SetAttr(__pyx_v_self, __pyx_kp_error_log, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5828     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5829   }
5830   __pyx_L7:;
5831
5832   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5833   goto __pyx_L0;
5834   __pyx_L1_error:;
5835   __Pyx_XDECREF(__pyx_t_2);
5836   __Pyx_XDECREF(__pyx_t_3);
5837   __Pyx_XDECREF(__pyx_t_4);
5838   __Pyx_AddTraceback("lxml.etree.LxmlError.__init__");
5839   __pyx_r = NULL;
5840   __pyx_L0:;
5841   __Pyx_XGIVEREF(__pyx_r);
5842   __Pyx_FinishRefcountContext();
5843   return __pyx_r;
5844 }
5845
5846 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":148
5847  * 
5848  * # version information
5849  * cdef __unpackDottedVersion(version):             # <<<<<<<<<<<<<<
5850  *     cdef list version_list = []
5851  *     l = (version.decode(u"ASCII").replace(u'-', u'.').split(u'.') + [0]*4)[:4]
5852  */
5853
5854 static  PyObject *__pyx_f_4lxml_5etree___unpackDottedVersion(PyObject *__pyx_v_version) {
5855   PyObject *__pyx_v_version_list = 0;
5856   PyObject *__pyx_v_l;
5857   PyObject *__pyx_v_item;
5858   PyObject *__pyx_v_count;
5859   PyObject *__pyx_r = NULL;
5860   PyObject *__pyx_1 = 0;
5861   int __pyx_2;
5862   PyObject *__pyx_t_1 = NULL;
5863   PyObject *__pyx_t_2 = NULL;
5864   PyObject *__pyx_t_3 = NULL;
5865   Py_ssize_t __pyx_t_4;
5866   PyObject *__pyx_t_5 = NULL;
5867   PyObject *__pyx_t_6 = NULL;
5868   PyObject *__pyx_t_7 = NULL;
5869   PyObject *__pyx_t_8 = NULL;
5870   int __pyx_t_9;
5871   int __pyx_t_10;
5872   __Pyx_SetupRefcountContext("__unpackDottedVersion");
5873   __pyx_v_l = Py_None; __Pyx_INCREF(Py_None);
5874   __pyx_v_item = Py_None; __Pyx_INCREF(Py_None);
5875   __pyx_v_count = Py_None; __Pyx_INCREF(Py_None);
5876
5877   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":149
5878  * # version information
5879  * cdef __unpackDottedVersion(version):
5880  *     cdef list version_list = []             # <<<<<<<<<<<<<<
5881  *     l = (version.decode(u"ASCII").replace(u'-', u'.').split(u'.') + [0]*4)[:4]
5882  *     for item in l:
5883  */
5884   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5885   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
5886   __pyx_v_version_list = __pyx_t_1;
5887   __pyx_t_1 = 0;
5888
5889   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":150
5890  * cdef __unpackDottedVersion(version):
5891  *     cdef list version_list = []
5892  *     l = (version.decode(u"ASCII").replace(u'-', u'.').split(u'.') + [0]*4)[:4]             # <<<<<<<<<<<<<<
5893  *     for item in l:
5894  *         try:
5895  */
5896   __pyx_t_1 = PyObject_GetAttr(__pyx_v_version, __pyx_kp_decode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5897   __Pyx_GOTREF(__pyx_t_1);
5898   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5899   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
5900   __Pyx_INCREF(((PyObject *)__pyx_kp_224));
5901   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_224));
5902   __Pyx_GIVEREF(((PyObject *)__pyx_kp_224));
5903   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5904   __Pyx_GOTREF(__pyx_t_3);
5905   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5906   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
5907   __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_kp_replace); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5908   __Pyx_GOTREF(__pyx_t_2);
5909   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5910   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5911   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
5912   __Pyx_INCREF(((PyObject *)__pyx_kp_225));
5913   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_225));
5914   __Pyx_GIVEREF(((PyObject *)__pyx_kp_225));
5915   __Pyx_INCREF(((PyObject *)__pyx_kp_226));
5916   PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_kp_226));
5917   __Pyx_GIVEREF(((PyObject *)__pyx_kp_226));
5918   __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5919   __Pyx_GOTREF(__pyx_t_1);
5920   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5921   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
5922   __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_kp_split); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5923   __Pyx_GOTREF(__pyx_t_3);
5924   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5925   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5926   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
5927   __Pyx_INCREF(((PyObject *)__pyx_kp_227));
5928   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_227));
5929   __Pyx_GIVEREF(((PyObject *)__pyx_kp_227));
5930   __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5931   __Pyx_GOTREF(__pyx_t_2);
5932   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5933   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
5934   __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5935   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
5936   __Pyx_INCREF(__pyx_int_0);
5937   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
5938   __Pyx_GIVEREF(__pyx_int_0);
5939   __pyx_t_3 = PyNumber_Multiply(((PyObject *)__pyx_t_1), __pyx_int_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5940   __Pyx_GOTREF(__pyx_t_3);
5941   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
5942   __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5943   __Pyx_GOTREF(__pyx_t_1);
5944   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5945   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5946   __pyx_1 = PySequence_GetSlice(__pyx_t_1, 0, 4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5947   __Pyx_GOTREF(__pyx_1);
5948   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5949   __Pyx_DECREF(__pyx_v_l);
5950   __pyx_v_l = __pyx_1;
5951   __pyx_1 = 0;
5952
5953   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":151
5954  *     cdef list version_list = []
5955  *     l = (version.decode(u"ASCII").replace(u'-', u'.').split(u'.') + [0]*4)[:4]
5956  *     for item in l:             # <<<<<<<<<<<<<<
5957  *         try:
5958  *             item = int(item)
5959  */
5960   if (PyList_CheckExact(__pyx_v_l) || PyTuple_CheckExact(__pyx_v_l)) {
5961     __pyx_t_4 = 0; __pyx_t_1 = __pyx_v_l; __Pyx_INCREF(__pyx_t_1);
5962   } else {
5963     __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_l); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5964     __Pyx_GOTREF(__pyx_t_1);
5965   }
5966   for (;;) {
5967     if (likely(PyList_CheckExact(__pyx_t_1))) {
5968       if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
5969       __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++;
5970     } else if (likely(PyTuple_CheckExact(__pyx_t_1))) {
5971       if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
5972       __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++;
5973     } else {
5974       __pyx_t_3 = PyIter_Next(__pyx_t_1);
5975       if (!__pyx_t_3) {
5976         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5977         break;
5978       }
5979       __Pyx_GOTREF(__pyx_t_3);
5980     }
5981     __Pyx_DECREF(__pyx_v_item);
5982     __pyx_v_item = __pyx_t_3;
5983     __pyx_t_3 = 0;
5984
5985     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":152
5986  *     l = (version.decode(u"ASCII").replace(u'-', u'.').split(u'.') + [0]*4)[:4]
5987  *     for item in l:
5988  *         try:             # <<<<<<<<<<<<<<
5989  *             item = int(item)
5990  *         except ValueError:
5991  */
5992     {
5993       PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
5994       __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
5995       __Pyx_XGOTREF(__pyx_save_exc_type);
5996       __Pyx_XGOTREF(__pyx_save_exc_value);
5997       __Pyx_XGOTREF(__pyx_save_exc_tb);
5998       /*try:*/ {
5999
6000         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":153
6001  *     for item in l:
6002  *         try:
6003  *             item = int(item)             # <<<<<<<<<<<<<<
6004  *         except ValueError:
6005  *             if item.startswith(u'dev'):
6006  */
6007         __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
6008         __Pyx_GOTREF(((PyObject *)__pyx_t_3));
6009         __Pyx_INCREF(__pyx_v_item);
6010         PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_item);
6011         __Pyx_GIVEREF(__pyx_v_item);
6012         __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
6013         __Pyx_GOTREF(__pyx_t_2);
6014         __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
6015         __Pyx_DECREF(__pyx_v_item);
6016         __pyx_v_item = __pyx_t_2;
6017         __pyx_t_2 = 0;
6018       }
6019       __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
6020       __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
6021       __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
6022       goto __pyx_L12_try_end;
6023       __pyx_L5_error:;
6024       __Pyx_XDECREF(__pyx_1); __pyx_1 = 0;
6025       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6026       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6027
6028       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":154
6029  *         try:
6030  *             item = int(item)
6031  *         except ValueError:             # <<<<<<<<<<<<<<
6032  *             if item.startswith(u'dev'):
6033  *                 count = item[3:]
6034  */
6035       __pyx_2 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
6036       if (__pyx_2) {
6037         __Pyx_AddTraceback("lxml.etree.__unpackDottedVersion");
6038         if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
6039         __Pyx_GOTREF(__pyx_t_2);
6040         __Pyx_GOTREF(__pyx_t_3);
6041         __Pyx_GOTREF(__pyx_t_5);
6042
6043         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":155
6044  *             item = int(item)
6045  *         except ValueError:
6046  *             if item.startswith(u'dev'):             # <<<<<<<<<<<<<<
6047  *                 count = item[3:]
6048  *                 item = -300
6049  */
6050         __pyx_t_6 = PyObject_GetAttr(__pyx_v_item, __pyx_kp_startswith); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
6051         __Pyx_GOTREF(__pyx_t_6);
6052         __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
6053         __Pyx_GOTREF(((PyObject *)__pyx_t_7));
6054         __Pyx_INCREF(((PyObject *)__pyx_kp_228));
6055         PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_228));
6056         __Pyx_GIVEREF(((PyObject *)__pyx_kp_228));
6057         __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
6058         __Pyx_GOTREF(__pyx_t_8);
6059         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6060         __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
6061         __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
6062         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6063         if (__pyx_t_9) {
6064
6065           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":156
6066  *         except ValueError:
6067  *             if item.startswith(u'dev'):
6068  *                 count = item[3:]             # <<<<<<<<<<<<<<
6069  *                 item = -300
6070  *             elif item.startswith(u'alpha'):
6071  */
6072           __pyx_1 = PySequence_GetSlice(__pyx_v_item, 3, PY_SSIZE_T_MAX); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
6073           __Pyx_GOTREF(__pyx_1);
6074           __Pyx_DECREF(__pyx_v_count);
6075           __pyx_v_count = __pyx_1;
6076           __pyx_1 = 0;
6077
6078           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":157
6079  *             if item.startswith(u'dev'):
6080  *                 count = item[3:]
6081  *                 item = -300             # <<<<<<<<<<<<<<
6082  *             elif item.startswith(u'alpha'):
6083  *                 count = item[5:]
6084  */
6085           __Pyx_INCREF(__pyx_int_neg_300);
6086           __Pyx_DECREF(__pyx_v_item);
6087           __pyx_v_item = __pyx_int_neg_300;
6088           goto __pyx_L15;
6089         }
6090
6091         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":158
6092  *                 count = item[3:]
6093  *                 item = -300
6094  *             elif item.startswith(u'alpha'):             # <<<<<<<<<<<<<<
6095  *                 count = item[5:]
6096  *                 item = -200
6097  */
6098         __pyx_t_8 = PyObject_GetAttr(__pyx_v_item, __pyx_kp_startswith); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
6099         __Pyx_GOTREF(__pyx_t_8);
6100         __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
6101         __Pyx_GOTREF(((PyObject *)__pyx_t_7));
6102         __Pyx_INCREF(((PyObject *)__pyx_kp_229));
6103         PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_229));
6104         __Pyx_GIVEREF(((PyObject *)__pyx_kp_229));
6105         __pyx_t_6 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
6106         __Pyx_GOTREF(__pyx_t_6);
6107         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6108         __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
6109         __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
6110         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6111         if (__pyx_t_9) {
6112
6113           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":159
6114  *                 item = -300
6115  *             elif item.startswith(u'alpha'):
6116  *                 count = item[5:]             # <<<<<<<<<<<<<<
6117  *                 item = -200
6118  *             elif item.startswith(u'beta'):
6119  */
6120           __pyx_1 = PySequence_GetSlice(__pyx_v_item, 5, PY_SSIZE_T_MAX); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
6121           __Pyx_GOTREF(__pyx_1);
6122           __Pyx_DECREF(__pyx_v_count);
6123           __pyx_v_count = __pyx_1;
6124           __pyx_1 = 0;
6125
6126           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":160
6127  *             elif item.startswith(u'alpha'):
6128  *                 count = item[5:]
6129  *                 item = -200             # <<<<<<<<<<<<<<
6130  *             elif item.startswith(u'beta'):
6131  *                 count = item[4:]
6132  */
6133           __Pyx_INCREF(__pyx_int_neg_200);
6134           __Pyx_DECREF(__pyx_v_item);
6135           __pyx_v_item = __pyx_int_neg_200;
6136           goto __pyx_L15;
6137         }
6138
6139         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":161
6140  *                 count = item[5:]
6141  *                 item = -200
6142  *             elif item.startswith(u'beta'):             # <<<<<<<<<<<<<<
6143  *                 count = item[4:]
6144  *                 item = -100
6145  */
6146         __pyx_t_6 = PyObject_GetAttr(__pyx_v_item, __pyx_kp_startswith); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
6147         __Pyx_GOTREF(__pyx_t_6);
6148         __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
6149         __Pyx_GOTREF(((PyObject *)__pyx_t_7));
6150         __Pyx_INCREF(((PyObject *)__pyx_kp_230));
6151         PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_230));
6152         __Pyx_GIVEREF(((PyObject *)__pyx_kp_230));
6153         __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
6154         __Pyx_GOTREF(__pyx_t_8);
6155         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6156         __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
6157         __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
6158         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6159         if (__pyx_t_9) {
6160
6161           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":162
6162  *                 item = -200
6163  *             elif item.startswith(u'beta'):
6164  *                 count = item[4:]             # <<<<<<<<<<<<<<
6165  *                 item = -100
6166  *             else:
6167  */
6168           __pyx_1 = PySequence_GetSlice(__pyx_v_item, 4, PY_SSIZE_T_MAX); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
6169           __Pyx_GOTREF(__pyx_1);
6170           __Pyx_DECREF(__pyx_v_count);
6171           __pyx_v_count = __pyx_1;
6172           __pyx_1 = 0;
6173
6174           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":163
6175  *             elif item.startswith(u'beta'):
6176  *                 count = item[4:]
6177  *                 item = -100             # <<<<<<<<<<<<<<
6178  *             else:
6179  *                 count = 0
6180  */
6181           __Pyx_INCREF(__pyx_int_neg_100);
6182           __Pyx_DECREF(__pyx_v_item);
6183           __pyx_v_item = __pyx_int_neg_100;
6184           goto __pyx_L15;
6185         }
6186         /*else*/ {
6187
6188           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":165
6189  *                 item = -100
6190  *             else:
6191  *                 count = 0             # <<<<<<<<<<<<<<
6192  *             if count:
6193  *                 item = item + int(count)
6194  */
6195           __Pyx_INCREF(__pyx_int_0);
6196           __Pyx_DECREF(__pyx_v_count);
6197           __pyx_v_count = __pyx_int_0;
6198         }
6199         __pyx_L15:;
6200
6201         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":166
6202  *             else:
6203  *                 count = 0
6204  *             if count:             # <<<<<<<<<<<<<<
6205  *                 item = item + int(count)
6206  *         version_list.append(item)
6207  */
6208         __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_count); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
6209         if (__pyx_t_9) {
6210
6211           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":167
6212  *                 count = 0
6213  *             if count:
6214  *                 item = item + int(count)             # <<<<<<<<<<<<<<
6215  *         version_list.append(item)
6216  *     return tuple(version_list)
6217  */
6218           __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
6219           __Pyx_GOTREF(((PyObject *)__pyx_t_8));
6220           __Pyx_INCREF(__pyx_v_count);
6221           PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_count);
6222           __Pyx_GIVEREF(__pyx_v_count);
6223           __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
6224           __Pyx_GOTREF(__pyx_t_7);
6225           __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
6226           __pyx_t_8 = PyNumber_Add(__pyx_v_item, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
6227           __Pyx_GOTREF(__pyx_t_8);
6228           __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6229           __Pyx_DECREF(__pyx_v_item);
6230           __pyx_v_item = __pyx_t_8;
6231           __pyx_t_8 = 0;
6232           goto __pyx_L16;
6233         }
6234         __pyx_L16:;
6235         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6236         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6237         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6238         goto __pyx_L6_exception_handled;
6239       }
6240       __pyx_L7_except_error:;
6241       __Pyx_XDECREF(__pyx_save_exc_type);
6242       __Pyx_XDECREF(__pyx_save_exc_value);
6243       __Pyx_XDECREF(__pyx_save_exc_tb);
6244       goto __pyx_L1_error;
6245       __pyx_L6_exception_handled:;
6246       __Pyx_XGIVEREF(__pyx_save_exc_type);
6247       __Pyx_XGIVEREF(__pyx_save_exc_value);
6248       __Pyx_XGIVEREF(__pyx_save_exc_tb);
6249       __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
6250       __pyx_L12_try_end:;
6251     }
6252
6253     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":168
6254  *             if count:
6255  *                 item = item + int(count)
6256  *         version_list.append(item)             # <<<<<<<<<<<<<<
6257  *     return tuple(version_list)
6258  * 
6259  */
6260     __pyx_t_10 = PyList_Append(((PyObject *)__pyx_v_version_list), __pyx_v_item); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6261   }
6262   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6263
6264   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":169
6265  *                 item = item + int(count)
6266  *         version_list.append(item)
6267  *     return tuple(version_list)             # <<<<<<<<<<<<<<
6268  * 
6269  * cdef __unpackIntVersion(int c_version):
6270  */
6271   __Pyx_XDECREF(__pyx_r);
6272   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6273   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
6274   __Pyx_INCREF(((PyObject *)__pyx_v_version_list));
6275   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_version_list));
6276   __Pyx_GIVEREF(((PyObject *)__pyx_v_version_list));
6277   __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)&PyTuple_Type)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6278   __Pyx_GOTREF(__pyx_t_5);
6279   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
6280   __pyx_r = __pyx_t_5;
6281   __pyx_t_5 = 0;
6282   goto __pyx_L0;
6283
6284   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6285   goto __pyx_L0;
6286   __pyx_L1_error:;
6287   __Pyx_XDECREF(__pyx_1);
6288   __Pyx_XDECREF(__pyx_t_1);
6289   __Pyx_XDECREF(__pyx_t_2);
6290   __Pyx_XDECREF(__pyx_t_3);
6291   __Pyx_XDECREF(__pyx_t_5);
6292   __Pyx_XDECREF(__pyx_t_6);
6293   __Pyx_XDECREF(__pyx_t_7);
6294   __Pyx_XDECREF(__pyx_t_8);
6295   __Pyx_AddTraceback("lxml.etree.__unpackDottedVersion");
6296   __pyx_r = 0;
6297   __pyx_L0:;
6298   __Pyx_XDECREF(__pyx_v_version_list);
6299   __Pyx_DECREF(__pyx_v_l);
6300   __Pyx_DECREF(__pyx_v_item);
6301   __Pyx_DECREF(__pyx_v_count);
6302   __Pyx_XGIVEREF(__pyx_r);
6303   __Pyx_FinishRefcountContext();
6304   return __pyx_r;
6305 }
6306
6307 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":171
6308  *     return tuple(version_list)
6309  * 
6310  * cdef __unpackIntVersion(int c_version):             # <<<<<<<<<<<<<<
6311  *     return (
6312  *         ((c_version / (100*100)) % 100),
6313  */
6314
6315 static  PyObject *__pyx_f_4lxml_5etree___unpackIntVersion(int __pyx_v_c_version) {
6316   PyObject *__pyx_r = NULL;
6317   PyObject *__pyx_t_1 = NULL;
6318   PyObject *__pyx_t_2 = NULL;
6319   PyObject *__pyx_t_3 = NULL;
6320   PyObject *__pyx_t_4 = NULL;
6321   __Pyx_SetupRefcountContext("__unpackIntVersion");
6322
6323   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":172
6324  * 
6325  * cdef __unpackIntVersion(int c_version):
6326  *     return (             # <<<<<<<<<<<<<<
6327  *         ((c_version / (100*100)) % 100),
6328  *         ((c_version / 100)       % 100),
6329  */
6330   __Pyx_XDECREF(__pyx_r);
6331
6332   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":173
6333  * cdef __unpackIntVersion(int c_version):
6334  *     return (
6335  *         ((c_version / (100*100)) % 100),             # <<<<<<<<<<<<<<
6336  *         ((c_version / 100)       % 100),
6337  *         (c_version               % 100)
6338  */
6339   __pyx_t_1 = PyInt_FromLong(((__pyx_v_c_version / 10000) % 100)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6340   __Pyx_GOTREF(__pyx_t_1);
6341
6342   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":174
6343  *     return (
6344  *         ((c_version / (100*100)) % 100),
6345  *         ((c_version / 100)       % 100),             # <<<<<<<<<<<<<<
6346  *         (c_version               % 100)
6347  *         )
6348  */
6349   __pyx_t_2 = PyInt_FromLong(((__pyx_v_c_version / 100) % 100)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6350   __Pyx_GOTREF(__pyx_t_2);
6351
6352   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":175
6353  *         ((c_version / (100*100)) % 100),
6354  *         ((c_version / 100)       % 100),
6355  *         (c_version               % 100)             # <<<<<<<<<<<<<<
6356  *         )
6357  * 
6358  */
6359   __pyx_t_3 = PyInt_FromLong((__pyx_v_c_version % 100)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6360   __Pyx_GOTREF(__pyx_t_3);
6361   __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6362   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
6363   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
6364   __Pyx_GIVEREF(__pyx_t_1);
6365   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
6366   __Pyx_GIVEREF(__pyx_t_2);
6367   PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
6368   __Pyx_GIVEREF(__pyx_t_3);
6369   __pyx_t_1 = 0;
6370   __pyx_t_2 = 0;
6371   __pyx_t_3 = 0;
6372   __pyx_r = ((PyObject *)__pyx_t_4);
6373   __pyx_t_4 = 0;
6374   goto __pyx_L0;
6375
6376   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6377   goto __pyx_L0;
6378   __pyx_L1_error:;
6379   __Pyx_XDECREF(__pyx_t_1);
6380   __Pyx_XDECREF(__pyx_t_2);
6381   __Pyx_XDECREF(__pyx_t_3);
6382   __Pyx_XDECREF(__pyx_t_4);
6383   __Pyx_AddTraceback("lxml.etree.__unpackIntVersion");
6384   __pyx_r = 0;
6385   __pyx_L0:;
6386   __Pyx_XGIVEREF(__pyx_r);
6387   __Pyx_FinishRefcountContext();
6388   return __pyx_r;
6389 }
6390
6391 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":196
6392  * cdef class _TempStore:
6393  *     cdef list _storage
6394  *     def __init__(self):             # <<<<<<<<<<<<<<
6395  *         self._storage = []
6396  * 
6397  */
6398
6399 static int __pyx_pf_4lxml_5etree_10_TempStore___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6400 static int __pyx_pf_4lxml_5etree_10_TempStore___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6401   int __pyx_r;
6402   PyObject *__pyx_t_1 = NULL;
6403   __Pyx_SetupRefcountContext("__init__");
6404   if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
6405     __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
6406   if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
6407
6408   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":197
6409  *     cdef list _storage
6410  *     def __init__(self):
6411  *         self._storage = []             # <<<<<<<<<<<<<<
6412  * 
6413  *     cdef int add(self, obj) except -1:
6414  */
6415   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6416   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
6417   __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
6418   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__TempStore *)__pyx_v_self)->_storage);
6419   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__TempStore *)__pyx_v_self)->_storage));
6420   ((struct __pyx_obj_4lxml_5etree__TempStore *)__pyx_v_self)->_storage = __pyx_t_1;
6421   __pyx_t_1 = 0;
6422
6423   __pyx_r = 0;
6424   goto __pyx_L0;
6425   __pyx_L1_error:;
6426   __Pyx_XDECREF(__pyx_t_1);
6427   __Pyx_AddTraceback("lxml.etree._TempStore.__init__");
6428   __pyx_r = -1;
6429   __pyx_L0:;
6430   __Pyx_FinishRefcountContext();
6431   return __pyx_r;
6432 }
6433
6434 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":199
6435  *         self._storage = []
6436  * 
6437  *     cdef int add(self, obj) except -1:             # <<<<<<<<<<<<<<
6438  *         self._storage.append(obj)
6439  *         return 0
6440  */
6441
6442 static  int __pyx_f_4lxml_5etree_10_TempStore_add(struct __pyx_obj_4lxml_5etree__TempStore *__pyx_v_self, PyObject *__pyx_v_obj) {
6443   int __pyx_r;
6444   int __pyx_t_1;
6445   __Pyx_SetupRefcountContext("add");
6446
6447   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":200
6448  * 
6449  *     cdef int add(self, obj) except -1:
6450  *         self._storage.append(obj)             # <<<<<<<<<<<<<<
6451  *         return 0
6452  * 
6453  */
6454   __pyx_t_1 = PyList_Append(((PyObject *)__pyx_v_self->_storage), __pyx_v_obj); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6455
6456   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":201
6457  *     cdef int add(self, obj) except -1:
6458  *         self._storage.append(obj)
6459  *         return 0             # <<<<<<<<<<<<<<
6460  * 
6461  *     cdef int clear(self) except -1:
6462  */
6463   __pyx_r = 0;
6464   goto __pyx_L0;
6465
6466   __pyx_r = 0;
6467   goto __pyx_L0;
6468   __pyx_L1_error:;
6469   __Pyx_AddTraceback("lxml.etree._TempStore.add");
6470   __pyx_r = -1;
6471   __pyx_L0:;
6472   __Pyx_FinishRefcountContext();
6473   return __pyx_r;
6474 }
6475
6476 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":203
6477  *         return 0
6478  * 
6479  *     cdef int clear(self) except -1:             # <<<<<<<<<<<<<<
6480  *         del self._storage[:]
6481  *         return 0
6482  */
6483
6484 static  int __pyx_f_4lxml_5etree_10_TempStore_clear(struct __pyx_obj_4lxml_5etree__TempStore *__pyx_v_self) {
6485   int __pyx_r;
6486   __Pyx_SetupRefcountContext("clear");
6487
6488   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":204
6489  * 
6490  *     cdef int clear(self) except -1:
6491  *         del self._storage[:]             # <<<<<<<<<<<<<<
6492  *         return 0
6493  * 
6494  */
6495   if (PySequence_DelSlice(((PyObject *)__pyx_v_self->_storage), 0, PY_SSIZE_T_MAX) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6496
6497   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":205
6498  *     cdef int clear(self) except -1:
6499  *         del self._storage[:]
6500  *         return 0             # <<<<<<<<<<<<<<
6501  * 
6502  * # class for temporarily storing exceptions raised in extensions
6503  */
6504   __pyx_r = 0;
6505   goto __pyx_L0;
6506
6507   __pyx_r = 0;
6508   goto __pyx_L0;
6509   __pyx_L1_error:;
6510   __Pyx_AddTraceback("lxml.etree._TempStore.clear");
6511   __pyx_r = -1;
6512   __pyx_L0:;
6513   __Pyx_FinishRefcountContext();
6514   return __pyx_r;
6515 }
6516
6517 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":210
6518  * cdef class _ExceptionContext:
6519  *     cdef object _exc_info
6520  *     cdef void clear(self):             # <<<<<<<<<<<<<<
6521  *         self._exc_info = None
6522  * 
6523  */
6524
6525 static  void __pyx_f_4lxml_5etree_17_ExceptionContext_clear(struct __pyx_obj_4lxml_5etree__ExceptionContext *__pyx_v_self) {
6526   __Pyx_SetupRefcountContext("clear");
6527
6528   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":211
6529  *     cdef object _exc_info
6530  *     cdef void clear(self):
6531  *         self._exc_info = None             # <<<<<<<<<<<<<<
6532  * 
6533  *     cdef void _store_raised(self):
6534  */
6535   __Pyx_INCREF(Py_None);
6536   __Pyx_GIVEREF(Py_None);
6537   __Pyx_GOTREF(__pyx_v_self->_exc_info);
6538   __Pyx_DECREF(__pyx_v_self->_exc_info);
6539   __pyx_v_self->_exc_info = Py_None;
6540
6541   __Pyx_FinishRefcountContext();
6542 }
6543
6544 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":213
6545  *         self._exc_info = None
6546  * 
6547  *     cdef void _store_raised(self):             # <<<<<<<<<<<<<<
6548  *         self._exc_info = sys.exc_info()
6549  * 
6550  */
6551
6552 static  void __pyx_f_4lxml_5etree_17_ExceptionContext__store_raised(struct __pyx_obj_4lxml_5etree__ExceptionContext *__pyx_v_self) {
6553   PyObject *__pyx_t_1 = NULL;
6554   PyObject *__pyx_t_2 = NULL;
6555   __Pyx_SetupRefcountContext("_store_raised");
6556
6557   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":214
6558  * 
6559  *     cdef void _store_raised(self):
6560  *         self._exc_info = sys.exc_info()             # <<<<<<<<<<<<<<
6561  * 
6562  *     cdef void _store_exception(self, exception):
6563  */
6564   __pyx_t_1 = PyObject_GetAttr(__pyx_v_4lxml_5etree_sys, __pyx_kp_exc_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6565   __Pyx_GOTREF(__pyx_t_1);
6566   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6567   __Pyx_GOTREF(__pyx_t_2);
6568   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6569   __Pyx_GIVEREF(__pyx_t_2);
6570   __Pyx_GOTREF(__pyx_v_self->_exc_info);
6571   __Pyx_DECREF(__pyx_v_self->_exc_info);
6572   __pyx_v_self->_exc_info = __pyx_t_2;
6573   __pyx_t_2 = 0;
6574
6575   goto __pyx_L0;
6576   __pyx_L1_error:;
6577   __Pyx_XDECREF(__pyx_t_1);
6578   __Pyx_XDECREF(__pyx_t_2);
6579   __Pyx_WriteUnraisable("lxml.etree._ExceptionContext._store_raised");
6580   __pyx_L0:;
6581   __Pyx_FinishRefcountContext();
6582 }
6583
6584 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":216
6585  *         self._exc_info = sys.exc_info()
6586  * 
6587  *     cdef void _store_exception(self, exception):             # <<<<<<<<<<<<<<
6588  *         self._exc_info = (exception, None, None)
6589  * 
6590  */
6591
6592 static  void __pyx_f_4lxml_5etree_17_ExceptionContext__store_exception(struct __pyx_obj_4lxml_5etree__ExceptionContext *__pyx_v_self, PyObject *__pyx_v_exception) {
6593   PyObject *__pyx_t_1 = NULL;
6594   __Pyx_SetupRefcountContext("_store_exception");
6595
6596   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":217
6597  * 
6598  *     cdef void _store_exception(self, exception):
6599  *         self._exc_info = (exception, None, None)             # <<<<<<<<<<<<<<
6600  * 
6601  *     cdef bint _has_raised(self):
6602  */
6603   __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6604   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
6605   __Pyx_INCREF(__pyx_v_exception);
6606   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_exception);
6607   __Pyx_GIVEREF(__pyx_v_exception);
6608   __Pyx_INCREF(Py_None);
6609   PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
6610   __Pyx_GIVEREF(Py_None);
6611   __Pyx_INCREF(Py_None);
6612   PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
6613   __Pyx_GIVEREF(Py_None);
6614   __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
6615   __Pyx_GOTREF(__pyx_v_self->_exc_info);
6616   __Pyx_DECREF(__pyx_v_self->_exc_info);
6617   __pyx_v_self->_exc_info = ((PyObject *)__pyx_t_1);
6618   __pyx_t_1 = 0;
6619
6620   goto __pyx_L0;
6621   __pyx_L1_error:;
6622   __Pyx_XDECREF(__pyx_t_1);
6623   __Pyx_WriteUnraisable("lxml.etree._ExceptionContext._store_exception");
6624   __pyx_L0:;
6625   __Pyx_FinishRefcountContext();
6626 }
6627
6628 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":219
6629  *         self._exc_info = (exception, None, None)
6630  * 
6631  *     cdef bint _has_raised(self):             # <<<<<<<<<<<<<<
6632  *         return self._exc_info is not None
6633  * 
6634  */
6635
6636 static  int __pyx_f_4lxml_5etree_17_ExceptionContext__has_raised(struct __pyx_obj_4lxml_5etree__ExceptionContext *__pyx_v_self) {
6637   int __pyx_r;
6638   int __pyx_t_1;
6639   __Pyx_SetupRefcountContext("_has_raised");
6640
6641   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":220
6642  * 
6643  *     cdef bint _has_raised(self):
6644  *         return self._exc_info is not None             # <<<<<<<<<<<<<<
6645  * 
6646  *     cdef int _raise_if_stored(self) except -1:
6647  */
6648   __pyx_t_1 = (__pyx_v_self->_exc_info != Py_None);
6649   __pyx_r = __pyx_t_1;
6650   goto __pyx_L0;
6651
6652   __pyx_r = 0;
6653   __pyx_L0:;
6654   __Pyx_FinishRefcountContext();
6655   return __pyx_r;
6656 }
6657
6658 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":222
6659  *         return self._exc_info is not None
6660  * 
6661  *     cdef int _raise_if_stored(self) except -1:             # <<<<<<<<<<<<<<
6662  *         if self._exc_info is None:
6663  *             return 0
6664  */
6665
6666 static  int __pyx_f_4lxml_5etree_17_ExceptionContext__raise_if_stored(struct __pyx_obj_4lxml_5etree__ExceptionContext *__pyx_v_self) {
6667   PyObject *__pyx_v_type;
6668   PyObject *__pyx_v_value;
6669   PyObject *__pyx_v_traceback;
6670   int __pyx_r;
6671   PyObject *__pyx_1 = 0;
6672   PyObject *__pyx_2 = 0;
6673   PyObject *__pyx_3 = 0;
6674   PyObject *__pyx_4 = 0;
6675   int __pyx_t_1;
6676   int __pyx_t_2;
6677   int __pyx_t_3;
6678   __Pyx_SetupRefcountContext("_raise_if_stored");
6679   __pyx_v_type = Py_None; __Pyx_INCREF(Py_None);
6680   __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);
6681   __pyx_v_traceback = Py_None; __Pyx_INCREF(Py_None);
6682
6683   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":223
6684  * 
6685  *     cdef int _raise_if_stored(self) except -1:
6686  *         if self._exc_info is None:             # <<<<<<<<<<<<<<
6687  *             return 0
6688  *         type, value, traceback = self._exc_info
6689  */
6690   __pyx_t_1 = (__pyx_v_self->_exc_info == Py_None);
6691   if (__pyx_t_1) {
6692
6693     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":224
6694  *     cdef int _raise_if_stored(self) except -1:
6695  *         if self._exc_info is None:
6696  *             return 0             # <<<<<<<<<<<<<<
6697  *         type, value, traceback = self._exc_info
6698  *         self._exc_info = None
6699  */
6700     __pyx_r = 0;
6701     goto __pyx_L0;
6702     goto __pyx_L3;
6703   }
6704   __pyx_L3:;
6705
6706   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":225
6707  *         if self._exc_info is None:
6708  *             return 0
6709  *         type, value, traceback = self._exc_info             # <<<<<<<<<<<<<<
6710  *         self._exc_info = None
6711  *         if value is None and traceback is None:
6712  */
6713   if (PyTuple_CheckExact(__pyx_v_self->_exc_info) && likely(PyTuple_GET_SIZE(__pyx_v_self->_exc_info) == 3)) {
6714     PyObject* tuple = __pyx_v_self->_exc_info;
6715     __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
6716     __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
6717     __pyx_4 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_4);
6718     __Pyx_DECREF(__pyx_v_type);
6719     __pyx_v_type = __pyx_2;
6720     __pyx_2 = 0;
6721     __Pyx_DECREF(__pyx_v_value);
6722     __pyx_v_value = __pyx_3;
6723     __pyx_3 = 0;
6724     __Pyx_DECREF(__pyx_v_traceback);
6725     __pyx_v_traceback = __pyx_4;
6726     __pyx_4 = 0;
6727   } else {
6728     __pyx_1 = PyObject_GetIter(__pyx_v_self->_exc_info); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6729     __Pyx_GOTREF(__pyx_1);
6730     __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6731     __Pyx_GOTREF(__pyx_2);
6732     __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6733     __Pyx_GOTREF(__pyx_3);
6734     __pyx_4 = __Pyx_UnpackItem(__pyx_1, 2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6735     __Pyx_GOTREF(__pyx_4);
6736     if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6737     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
6738     __Pyx_DECREF(__pyx_v_type);
6739     __pyx_v_type = __pyx_2;
6740     __pyx_2 = 0;
6741     __Pyx_DECREF(__pyx_v_value);
6742     __pyx_v_value = __pyx_3;
6743     __pyx_3 = 0;
6744     __Pyx_DECREF(__pyx_v_traceback);
6745     __pyx_v_traceback = __pyx_4;
6746     __pyx_4 = 0;
6747   }
6748
6749   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":226
6750  *             return 0
6751  *         type, value, traceback = self._exc_info
6752  *         self._exc_info = None             # <<<<<<<<<<<<<<
6753  *         if value is None and traceback is None:
6754  *             raise type
6755  */
6756   __Pyx_INCREF(Py_None);
6757   __Pyx_GIVEREF(Py_None);
6758   __Pyx_GOTREF(__pyx_v_self->_exc_info);
6759   __Pyx_DECREF(__pyx_v_self->_exc_info);
6760   __pyx_v_self->_exc_info = Py_None;
6761
6762   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":227
6763  *         type, value, traceback = self._exc_info
6764  *         self._exc_info = None
6765  *         if value is None and traceback is None:             # <<<<<<<<<<<<<<
6766  *             raise type
6767  *         else:
6768  */
6769   __pyx_t_1 = (__pyx_v_value == Py_None);
6770   if (__pyx_t_1) {
6771     __pyx_t_2 = (__pyx_v_traceback == Py_None);
6772     __pyx_t_3 = __pyx_t_2;
6773   } else {
6774     __pyx_t_3 = __pyx_t_1;
6775   }
6776   if (__pyx_t_3) {
6777
6778     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":228
6779  *         self._exc_info = None
6780  *         if value is None and traceback is None:
6781  *             raise type             # <<<<<<<<<<<<<<
6782  *         else:
6783  *             raise type, value, traceback
6784  */
6785     __Pyx_Raise(__pyx_v_type, 0, 0);
6786     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6787     goto __pyx_L4;
6788   }
6789   /*else*/ {
6790
6791     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":230
6792  *             raise type
6793  *         else:
6794  *             raise type, value, traceback             # <<<<<<<<<<<<<<
6795  * 
6796  * 
6797  */
6798     __Pyx_Raise(__pyx_v_type, __pyx_v_value, __pyx_v_traceback);
6799     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6800   }
6801   __pyx_L4:;
6802
6803   __pyx_r = 0;
6804   goto __pyx_L0;
6805   __pyx_L1_error:;
6806   __Pyx_XDECREF(__pyx_1);
6807   __Pyx_XDECREF(__pyx_2);
6808   __Pyx_XDECREF(__pyx_3);
6809   __Pyx_XDECREF(__pyx_4);
6810   __Pyx_AddTraceback("lxml.etree._ExceptionContext._raise_if_stored");
6811   __pyx_r = -1;
6812   __pyx_L0:;
6813   __Pyx_DECREF(__pyx_v_type);
6814   __Pyx_DECREF(__pyx_v_value);
6815   __Pyx_DECREF(__pyx_v_traceback);
6816   __Pyx_FinishRefcountContext();
6817   return __pyx_r;
6818 }
6819
6820 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":7
6821  * # the Python class
6822  * 
6823  * cdef inline _Element getProxy(xmlNode* c_node):             # <<<<<<<<<<<<<<
6824  *     u"""Get a proxy for a given node.
6825  *     """
6826  */
6827
6828 static INLINE struct LxmlElement *__pyx_f_4lxml_5etree_getProxy(xmlNode *__pyx_v_c_node) {
6829   struct LxmlElement *__pyx_r = NULL;
6830   int __pyx_t_1;
6831   __Pyx_SetupRefcountContext("getProxy");
6832
6833   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":11
6834  *     """
6835  *     #print "getProxy for:", <int>c_node
6836  *     if c_node is not NULL and c_node._private is not NULL:             # <<<<<<<<<<<<<<
6837  *         return <_Element>c_node._private
6838  *     else:
6839  */
6840   if ((__pyx_v_c_node != NULL)) {
6841     __pyx_t_1 = (__pyx_v_c_node->_private != NULL);
6842   } else {
6843     __pyx_t_1 = (__pyx_v_c_node != NULL);
6844   }
6845   if (__pyx_t_1) {
6846
6847     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":12
6848  *     #print "getProxy for:", <int>c_node
6849  *     if c_node is not NULL and c_node._private is not NULL:
6850  *         return <_Element>c_node._private             # <<<<<<<<<<<<<<
6851  *     else:
6852  *         return None
6853  */
6854     __Pyx_XDECREF(((PyObject *)__pyx_r));
6855     __Pyx_INCREF(((PyObject *)((struct LxmlElement *)__pyx_v_c_node->_private)));
6856     __pyx_r = ((struct LxmlElement *)__pyx_v_c_node->_private);
6857     goto __pyx_L0;
6858     goto __pyx_L3;
6859   }
6860   /*else*/ {
6861
6862     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":14
6863  *         return <_Element>c_node._private
6864  *     else:
6865  *         return None             # <<<<<<<<<<<<<<
6866  * 
6867  * cdef inline int hasProxy(xmlNode* c_node):
6868  */
6869     __Pyx_XDECREF(((PyObject *)__pyx_r));
6870     __Pyx_INCREF(Py_None);
6871     __pyx_r = ((struct LxmlElement *)Py_None);
6872     goto __pyx_L0;
6873   }
6874   __pyx_L3:;
6875
6876   __pyx_r = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
6877   __pyx_L0:;
6878   __Pyx_XGIVEREF((PyObject *)__pyx_r);
6879   __Pyx_FinishRefcountContext();
6880   return __pyx_r;
6881 }
6882
6883 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":16
6884  *         return None
6885  * 
6886  * cdef inline int hasProxy(xmlNode* c_node):             # <<<<<<<<<<<<<<
6887  *     return c_node._private is not NULL
6888  * 
6889  */
6890
6891 static INLINE int __pyx_f_4lxml_5etree_hasProxy(xmlNode *__pyx_v_c_node) {
6892   int __pyx_r;
6893   __Pyx_SetupRefcountContext("hasProxy");
6894
6895   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":17
6896  * 
6897  * cdef inline int hasProxy(xmlNode* c_node):
6898  *     return c_node._private is not NULL             # <<<<<<<<<<<<<<
6899  * 
6900  * cdef inline int _registerProxy(_Element proxy, _Document doc,
6901  */
6902   __pyx_r = (__pyx_v_c_node->_private != NULL);
6903   goto __pyx_L0;
6904
6905   __pyx_r = 0;
6906   __pyx_L0:;
6907   __Pyx_FinishRefcountContext();
6908   return __pyx_r;
6909 }
6910
6911 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":19
6912  *     return c_node._private is not NULL
6913  * 
6914  * cdef inline int _registerProxy(_Element proxy, _Document doc,             # <<<<<<<<<<<<<<
6915  *                                xmlNode* c_node) except -1:
6916  *     u"""Register a proxy and type for the node it's proxying for.
6917  */
6918
6919 static INLINE int __pyx_f_4lxml_5etree__registerProxy(struct LxmlElement *__pyx_v_proxy, struct LxmlDocument *__pyx_v_doc, xmlNode *__pyx_v_c_node) {
6920   int __pyx_r;
6921   __Pyx_SetupRefcountContext("_registerProxy");
6922
6923   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":24
6924  *     """
6925  *     #print "registering for:", <int>proxy._c_node
6926  *     assert c_node._private is NULL, u"double registering proxy!"             # <<<<<<<<<<<<<<
6927  *     proxy._doc = doc
6928  *     proxy._c_node = c_node
6929  */
6930   #ifndef PYREX_WITHOUT_ASSERTIONS
6931   if (unlikely(!(__pyx_v_c_node->_private == NULL))) {
6932     PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_231));
6933     {__pyx_filename = __pyx_f[6]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6934   }
6935   #endif
6936
6937   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":25
6938  *     #print "registering for:", <int>proxy._c_node
6939  *     assert c_node._private is NULL, u"double registering proxy!"
6940  *     proxy._doc = doc             # <<<<<<<<<<<<<<
6941  *     proxy._c_node = c_node
6942  *     c_node._private = <void*>proxy
6943  */
6944   __Pyx_INCREF(((PyObject *)__pyx_v_doc));
6945   __Pyx_GIVEREF(((PyObject *)__pyx_v_doc));
6946   __Pyx_GOTREF(__pyx_v_proxy->_doc);
6947   __Pyx_DECREF(((PyObject *)__pyx_v_proxy->_doc));
6948   __pyx_v_proxy->_doc = __pyx_v_doc;
6949
6950   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":26
6951  *     assert c_node._private is NULL, u"double registering proxy!"
6952  *     proxy._doc = doc
6953  *     proxy._c_node = c_node             # <<<<<<<<<<<<<<
6954  *     c_node._private = <void*>proxy
6955  *     # additional INCREF to make sure _Document is GC-ed LAST!
6956  */
6957   __pyx_v_proxy->_c_node = __pyx_v_c_node;
6958
6959   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":27
6960  *     proxy._doc = doc
6961  *     proxy._c_node = c_node
6962  *     c_node._private = <void*>proxy             # <<<<<<<<<<<<<<
6963  *     # additional INCREF to make sure _Document is GC-ed LAST!
6964  *     proxy._gc_doc = <python.PyObject*>doc
6965  */
6966   __pyx_v_c_node->_private = ((void *)__pyx_v_proxy);
6967
6968   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":29
6969  *     c_node._private = <void*>proxy
6970  *     # additional INCREF to make sure _Document is GC-ed LAST!
6971  *     proxy._gc_doc = <python.PyObject*>doc             # <<<<<<<<<<<<<<
6972  *     python.Py_INCREF(doc)
6973  * 
6974  */
6975   __pyx_v_proxy->_gc_doc = ((PyObject *)__pyx_v_doc);
6976
6977   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":30
6978  *     # additional INCREF to make sure _Document is GC-ed LAST!
6979  *     proxy._gc_doc = <python.PyObject*>doc
6980  *     python.Py_INCREF(doc)             # <<<<<<<<<<<<<<
6981  * 
6982  * cdef inline int _unregisterProxy(_Element proxy) except -1:
6983  */
6984   Py_INCREF(((PyObject *)__pyx_v_doc));
6985
6986   __pyx_r = 0;
6987   goto __pyx_L0;
6988   __pyx_L1_error:;
6989   __Pyx_AddTraceback("lxml.etree._registerProxy");
6990   __pyx_r = -1;
6991   __pyx_L0:;
6992   __Pyx_FinishRefcountContext();
6993   return __pyx_r;
6994 }
6995
6996 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":32
6997  *     python.Py_INCREF(doc)
6998  * 
6999  * cdef inline int _unregisterProxy(_Element proxy) except -1:             # <<<<<<<<<<<<<<
7000  *     u"""Unregister a proxy for the node it's proxying for.
7001  *     """
7002  */
7003
7004 static INLINE int __pyx_f_4lxml_5etree__unregisterProxy(struct LxmlElement *__pyx_v_proxy) {
7005   xmlNode *__pyx_v_c_node;
7006   int __pyx_r;
7007   __Pyx_SetupRefcountContext("_unregisterProxy");
7008
7009   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":36
7010  *     """
7011  *     cdef xmlNode* c_node
7012  *     c_node = proxy._c_node             # <<<<<<<<<<<<<<
7013  *     assert c_node._private is <void*>proxy, u"Tried to unregister unknown proxy"
7014  *     c_node._private = NULL
7015  */
7016   __pyx_v_c_node = __pyx_v_proxy->_c_node;
7017
7018   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":37
7019  *     cdef xmlNode* c_node
7020  *     c_node = proxy._c_node
7021  *     assert c_node._private is <void*>proxy, u"Tried to unregister unknown proxy"             # <<<<<<<<<<<<<<
7022  *     c_node._private = NULL
7023  *     return 0
7024  */
7025   #ifndef PYREX_WITHOUT_ASSERTIONS
7026   if (unlikely(!(__pyx_v_c_node->_private == ((void *)__pyx_v_proxy)))) {
7027     PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_232));
7028     {__pyx_filename = __pyx_f[6]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7029   }
7030   #endif
7031
7032   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":38
7033  *     c_node = proxy._c_node
7034  *     assert c_node._private is <void*>proxy, u"Tried to unregister unknown proxy"
7035  *     c_node._private = NULL             # <<<<<<<<<<<<<<
7036  *     return 0
7037  * 
7038  */
7039   __pyx_v_c_node->_private = NULL;
7040
7041   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":39
7042  *     assert c_node._private is <void*>proxy, u"Tried to unregister unknown proxy"
7043  *     c_node._private = NULL
7044  *     return 0             # <<<<<<<<<<<<<<
7045  * 
7046  * cdef inline void _releaseProxy(_Element proxy):
7047  */
7048   __pyx_r = 0;
7049   goto __pyx_L0;
7050
7051   __pyx_r = 0;
7052   goto __pyx_L0;
7053   __pyx_L1_error:;
7054   __Pyx_AddTraceback("lxml.etree._unregisterProxy");
7055   __pyx_r = -1;
7056   __pyx_L0:;
7057   __Pyx_FinishRefcountContext();
7058   return __pyx_r;
7059 }
7060
7061 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":41
7062  *     return 0
7063  * 
7064  * cdef inline void _releaseProxy(_Element proxy):             # <<<<<<<<<<<<<<
7065  *     u"""An additional DECREF for the document.
7066  *     """
7067  */
7068
7069 static INLINE void __pyx_f_4lxml_5etree__releaseProxy(struct LxmlElement *__pyx_v_proxy) {
7070   __Pyx_SetupRefcountContext("_releaseProxy");
7071
7072   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":44
7073  *     u"""An additional DECREF for the document.
7074  *     """
7075  *     python.Py_XDECREF(proxy._gc_doc)             # <<<<<<<<<<<<<<
7076  *     proxy._gc_doc = NULL
7077  * 
7078  */
7079   Py_XDECREF(__pyx_v_proxy->_gc_doc);
7080
7081   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":45
7082  *     """
7083  *     python.Py_XDECREF(proxy._gc_doc)
7084  *     proxy._gc_doc = NULL             # <<<<<<<<<<<<<<
7085  * 
7086  * cdef inline void _updateProxyDocument(xmlNode* c_node, _Document doc):
7087  */
7088   __pyx_v_proxy->_gc_doc = NULL;
7089
7090   __Pyx_FinishRefcountContext();
7091 }
7092
7093 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":47
7094  *     proxy._gc_doc = NULL
7095  * 
7096  * cdef inline void _updateProxyDocument(xmlNode* c_node, _Document doc):             # <<<<<<<<<<<<<<
7097  *     u"""Replace the document reference of a proxy and return the old one
7098  *     iff it was replaced (None otherwise).
7099  */
7100
7101 static INLINE void __pyx_f_4lxml_5etree__updateProxyDocument(xmlNode *__pyx_v_c_node, struct LxmlDocument *__pyx_v_doc) {
7102   struct LxmlDocument *__pyx_v_old_doc;
7103   struct LxmlElement *__pyx_v_element = 0;
7104   int __pyx_t_1;
7105   __Pyx_SetupRefcountContext("_updateProxyDocument");
7106   __pyx_v_old_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
7107
7108   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":52
7109  *     """
7110  *     cdef _Document old_doc
7111  *     cdef _Element element = <_Element>c_node._private             # <<<<<<<<<<<<<<
7112  *     if element._doc is not doc:
7113  *         old_doc = element._doc
7114  */
7115   __Pyx_INCREF(((PyObject *)((struct LxmlElement *)__pyx_v_c_node->_private)));
7116   __pyx_v_element = ((struct LxmlElement *)__pyx_v_c_node->_private);
7117
7118   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":53
7119  *     cdef _Document old_doc
7120  *     cdef _Element element = <_Element>c_node._private
7121  *     if element._doc is not doc:             # <<<<<<<<<<<<<<
7122  *         old_doc = element._doc
7123  *         element._doc = doc
7124  */
7125   __pyx_t_1 = (__pyx_v_element->_doc != __pyx_v_doc);
7126   if (__pyx_t_1) {
7127
7128     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":54
7129  *     cdef _Element element = <_Element>c_node._private
7130  *     if element._doc is not doc:
7131  *         old_doc = element._doc             # <<<<<<<<<<<<<<
7132  *         element._doc = doc
7133  *         python.Py_INCREF(doc)
7134  */
7135     __Pyx_INCREF(((PyObject *)__pyx_v_element->_doc));
7136     __Pyx_DECREF(((PyObject *)__pyx_v_old_doc));
7137     __pyx_v_old_doc = __pyx_v_element->_doc;
7138
7139     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":55
7140  *     if element._doc is not doc:
7141  *         old_doc = element._doc
7142  *         element._doc = doc             # <<<<<<<<<<<<<<
7143  *         python.Py_INCREF(doc)
7144  *         element._gc_doc = <python.PyObject*>doc
7145  */
7146     __Pyx_INCREF(((PyObject *)__pyx_v_doc));
7147     __Pyx_GIVEREF(((PyObject *)__pyx_v_doc));
7148     __Pyx_GOTREF(__pyx_v_element->_doc);
7149     __Pyx_DECREF(((PyObject *)__pyx_v_element->_doc));
7150     __pyx_v_element->_doc = __pyx_v_doc;
7151
7152     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":56
7153  *         old_doc = element._doc
7154  *         element._doc = doc
7155  *         python.Py_INCREF(doc)             # <<<<<<<<<<<<<<
7156  *         element._gc_doc = <python.PyObject*>doc
7157  *         python.Py_DECREF(old_doc)
7158  */
7159     Py_INCREF(((PyObject *)__pyx_v_doc));
7160
7161     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":57
7162  *         element._doc = doc
7163  *         python.Py_INCREF(doc)
7164  *         element._gc_doc = <python.PyObject*>doc             # <<<<<<<<<<<<<<
7165  *         python.Py_DECREF(old_doc)
7166  * 
7167  */
7168     __pyx_v_element->_gc_doc = ((PyObject *)__pyx_v_doc);
7169
7170     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":58
7171  *         python.Py_INCREF(doc)
7172  *         element._gc_doc = <python.PyObject*>doc
7173  *         python.Py_DECREF(old_doc)             # <<<<<<<<<<<<<<
7174  * 
7175  * ################################################################################
7176  */
7177     Py_DECREF(((PyObject *)__pyx_v_old_doc));
7178     goto __pyx_L3;
7179   }
7180   __pyx_L3:;
7181
7182   __Pyx_DECREF((PyObject *)__pyx_v_old_doc);
7183   __Pyx_XDECREF((PyObject *)__pyx_v_element);
7184   __Pyx_FinishRefcountContext();
7185 }
7186
7187 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":63
7188  * # temporarily make a node the root node of its document
7189  * 
7190  * cdef xmlDoc* _fakeRootDoc(xmlDoc* c_base_doc, xmlNode* c_node) except NULL:             # <<<<<<<<<<<<<<
7191  *     # build a temporary document that has the given node as root node
7192  *     # note that copy and original must not be modified during its lifetime!!
7193  */
7194
7195 static  xmlDoc *__pyx_f_4lxml_5etree__fakeRootDoc(xmlDoc *__pyx_v_c_base_doc, xmlNode *__pyx_v_c_node) {
7196   xmlNode *__pyx_v_c_child;
7197   xmlNode *__pyx_v_c_root;
7198   xmlNode *__pyx_v_c_new_root;
7199   xmlDoc *__pyx_v_c_doc;
7200   xmlDoc *__pyx_r;
7201   int __pyx_t_1;
7202   xmlDoc *__pyx_t_2;
7203   __Pyx_SetupRefcountContext("_fakeRootDoc");
7204
7205   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":71
7206  *     cdef xmlNode* c_new_root
7207  *     cdef xmlDoc*  c_doc
7208  *     c_root = tree.xmlDocGetRootElement(c_base_doc)             # <<<<<<<<<<<<<<
7209  *     if c_root is c_node:
7210  *         # already the root node
7211  */
7212   __pyx_v_c_root = xmlDocGetRootElement(__pyx_v_c_base_doc);
7213
7214   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":72
7215  *     cdef xmlDoc*  c_doc
7216  *     c_root = tree.xmlDocGetRootElement(c_base_doc)
7217  *     if c_root is c_node:             # <<<<<<<<<<<<<<
7218  *         # already the root node
7219  *         return c_base_doc
7220  */
7221   __pyx_t_1 = (__pyx_v_c_root == __pyx_v_c_node);
7222   if (__pyx_t_1) {
7223
7224     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":74
7225  *     if c_root is c_node:
7226  *         # already the root node
7227  *         return c_base_doc             # <<<<<<<<<<<<<<
7228  * 
7229  *     c_doc  = _copyDoc(c_base_doc, 0)                   # non recursive!
7230  */
7231     __pyx_r = __pyx_v_c_base_doc;
7232     goto __pyx_L0;
7233     goto __pyx_L3;
7234   }
7235   __pyx_L3:;
7236
7237   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":76
7238  *         return c_base_doc
7239  * 
7240  *     c_doc  = _copyDoc(c_base_doc, 0)                   # non recursive!             # <<<<<<<<<<<<<<
7241  *     c_new_root = tree.xmlDocCopyNode(c_node, c_doc, 2) # non recursive!
7242  *     tree.xmlDocSetRootElement(c_doc, c_new_root)
7243  */
7244   __pyx_t_2 = __pyx_f_4lxml_5etree__copyDoc(__pyx_v_c_base_doc, 0); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7245   __pyx_v_c_doc = __pyx_t_2;
7246
7247   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":77
7248  * 
7249  *     c_doc  = _copyDoc(c_base_doc, 0)                   # non recursive!
7250  *     c_new_root = tree.xmlDocCopyNode(c_node, c_doc, 2) # non recursive!             # <<<<<<<<<<<<<<
7251  *     tree.xmlDocSetRootElement(c_doc, c_new_root)
7252  *     _copyParentNamespaces(c_node, c_new_root)
7253  */
7254   __pyx_v_c_new_root = xmlDocCopyNode(__pyx_v_c_node, __pyx_v_c_doc, 2);
7255
7256   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":78
7257  *     c_doc  = _copyDoc(c_base_doc, 0)                   # non recursive!
7258  *     c_new_root = tree.xmlDocCopyNode(c_node, c_doc, 2) # non recursive!
7259  *     tree.xmlDocSetRootElement(c_doc, c_new_root)             # <<<<<<<<<<<<<<
7260  *     _copyParentNamespaces(c_node, c_new_root)
7261  * 
7262  */
7263   xmlDocSetRootElement(__pyx_v_c_doc, __pyx_v_c_new_root);
7264
7265   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":79
7266  *     c_new_root = tree.xmlDocCopyNode(c_node, c_doc, 2) # non recursive!
7267  *     tree.xmlDocSetRootElement(c_doc, c_new_root)
7268  *     _copyParentNamespaces(c_node, c_new_root)             # <<<<<<<<<<<<<<
7269  * 
7270  *     c_new_root.children = c_node.children
7271  */
7272   __pyx_f_4lxml_5etree__copyParentNamespaces(__pyx_v_c_node, __pyx_v_c_new_root);
7273
7274   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":81
7275  *     _copyParentNamespaces(c_node, c_new_root)
7276  * 
7277  *     c_new_root.children = c_node.children             # <<<<<<<<<<<<<<
7278  *     c_new_root.last = c_node.last
7279  *     c_new_root.next = c_new_root.prev = NULL
7280  */
7281   __pyx_v_c_new_root->children = __pyx_v_c_node->children;
7282
7283   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":82
7284  * 
7285  *     c_new_root.children = c_node.children
7286  *     c_new_root.last = c_node.last             # <<<<<<<<<<<<<<
7287  *     c_new_root.next = c_new_root.prev = NULL
7288  * 
7289  */
7290   __pyx_v_c_new_root->last = __pyx_v_c_node->last;
7291
7292   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":83
7293  *     c_new_root.children = c_node.children
7294  *     c_new_root.last = c_node.last
7295  *     c_new_root.next = c_new_root.prev = NULL             # <<<<<<<<<<<<<<
7296  * 
7297  *     # store original node
7298  */
7299   __pyx_v_c_new_root->next = NULL;
7300   __pyx_v_c_new_root->prev = NULL;
7301
7302   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":86
7303  * 
7304  *     # store original node
7305  *     c_doc._private = c_node             # <<<<<<<<<<<<<<
7306  * 
7307  *     # divert parent pointers of children
7308  */
7309   __pyx_v_c_doc->_private = __pyx_v_c_node;
7310
7311   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":89
7312  * 
7313  *     # divert parent pointers of children
7314  *     c_child = c_new_root.children             # <<<<<<<<<<<<<<
7315  *     while c_child is not NULL:
7316  *         c_child.parent = c_new_root
7317  */
7318   __pyx_v_c_child = __pyx_v_c_new_root->children;
7319
7320   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":90
7321  *     # divert parent pointers of children
7322  *     c_child = c_new_root.children
7323  *     while c_child is not NULL:             # <<<<<<<<<<<<<<
7324  *         c_child.parent = c_new_root
7325  *         c_child = c_child.next
7326  */
7327   while (1) {
7328     __pyx_t_1 = (__pyx_v_c_child != NULL);
7329     if (!__pyx_t_1) break;
7330
7331     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":91
7332  *     c_child = c_new_root.children
7333  *     while c_child is not NULL:
7334  *         c_child.parent = c_new_root             # <<<<<<<<<<<<<<
7335  *         c_child = c_child.next
7336  * 
7337  */
7338     __pyx_v_c_child->parent = __pyx_v_c_new_root;
7339
7340     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":92
7341  *     while c_child is not NULL:
7342  *         c_child.parent = c_new_root
7343  *         c_child = c_child.next             # <<<<<<<<<<<<<<
7344  * 
7345  *     c_doc.children = c_new_root
7346  */
7347     __pyx_v_c_child = __pyx_v_c_child->next;
7348   }
7349
7350   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":94
7351  *         c_child = c_child.next
7352  * 
7353  *     c_doc.children = c_new_root             # <<<<<<<<<<<<<<
7354  *     return c_doc
7355  * 
7356  */
7357   __pyx_v_c_doc->children = __pyx_v_c_new_root;
7358
7359   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":95
7360  * 
7361  *     c_doc.children = c_new_root
7362  *     return c_doc             # <<<<<<<<<<<<<<
7363  * 
7364  * cdef void _destroyFakeDoc(xmlDoc* c_base_doc, xmlDoc* c_doc):
7365  */
7366   __pyx_r = __pyx_v_c_doc;
7367   goto __pyx_L0;
7368
7369   __pyx_r = 0;
7370   goto __pyx_L0;
7371   __pyx_L1_error:;
7372   __Pyx_AddTraceback("lxml.etree._fakeRootDoc");
7373   __pyx_r = NULL;
7374   __pyx_L0:;
7375   __Pyx_FinishRefcountContext();
7376   return __pyx_r;
7377 }
7378
7379 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":97
7380  *     return c_doc
7381  * 
7382  * cdef void _destroyFakeDoc(xmlDoc* c_base_doc, xmlDoc* c_doc):             # <<<<<<<<<<<<<<
7383  *     # delete a temporary document
7384  *     cdef xmlNode* c_child
7385  */
7386
7387 static  void __pyx_f_4lxml_5etree__destroyFakeDoc(xmlDoc *__pyx_v_c_base_doc, xmlDoc *__pyx_v_c_doc) {
7388   xmlNode *__pyx_v_c_child;
7389   xmlNode *__pyx_v_c_parent;
7390   xmlNode *__pyx_v_c_root;
7391   int __pyx_t_1;
7392   __Pyx_SetupRefcountContext("_destroyFakeDoc");
7393
7394   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":102
7395  *     cdef xmlNode* c_parent
7396  *     cdef xmlNode* c_root
7397  *     if c_doc is c_base_doc:             # <<<<<<<<<<<<<<
7398  *         return
7399  *     c_root = tree.xmlDocGetRootElement(c_doc)
7400  */
7401   __pyx_t_1 = (__pyx_v_c_doc == __pyx_v_c_base_doc);
7402   if (__pyx_t_1) {
7403
7404     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":103
7405  *     cdef xmlNode* c_root
7406  *     if c_doc is c_base_doc:
7407  *         return             # <<<<<<<<<<<<<<
7408  *     c_root = tree.xmlDocGetRootElement(c_doc)
7409  * 
7410  */
7411     goto __pyx_L0;
7412     goto __pyx_L3;
7413   }
7414   __pyx_L3:;
7415
7416   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":104
7417  *     if c_doc is c_base_doc:
7418  *         return
7419  *     c_root = tree.xmlDocGetRootElement(c_doc)             # <<<<<<<<<<<<<<
7420  * 
7421  *     # restore parent pointers of children
7422  */
7423   __pyx_v_c_root = xmlDocGetRootElement(__pyx_v_c_doc);
7424
7425   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":107
7426  * 
7427  *     # restore parent pointers of children
7428  *     c_parent = <xmlNode*>c_doc._private             # <<<<<<<<<<<<<<
7429  *     c_child = c_root.children
7430  *     while c_child is not NULL:
7431  */
7432   __pyx_v_c_parent = ((xmlNode *)__pyx_v_c_doc->_private);
7433
7434   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":108
7435  *     # restore parent pointers of children
7436  *     c_parent = <xmlNode*>c_doc._private
7437  *     c_child = c_root.children             # <<<<<<<<<<<<<<
7438  *     while c_child is not NULL:
7439  *         c_child.parent = c_parent
7440  */
7441   __pyx_v_c_child = __pyx_v_c_root->children;
7442
7443   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":109
7444  *     c_parent = <xmlNode*>c_doc._private
7445  *     c_child = c_root.children
7446  *     while c_child is not NULL:             # <<<<<<<<<<<<<<
7447  *         c_child.parent = c_parent
7448  *         c_child = c_child.next
7449  */
7450   while (1) {
7451     __pyx_t_1 = (__pyx_v_c_child != NULL);
7452     if (!__pyx_t_1) break;
7453
7454     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":110
7455  *     c_child = c_root.children
7456  *     while c_child is not NULL:
7457  *         c_child.parent = c_parent             # <<<<<<<<<<<<<<
7458  *         c_child = c_child.next
7459  * 
7460  */
7461     __pyx_v_c_child->parent = __pyx_v_c_parent;
7462
7463     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":111
7464  *     while c_child is not NULL:
7465  *         c_child.parent = c_parent
7466  *         c_child = c_child.next             # <<<<<<<<<<<<<<
7467  * 
7468  *     # prevent recursive removal of children
7469  */
7470     __pyx_v_c_child = __pyx_v_c_child->next;
7471   }
7472
7473   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":114
7474  * 
7475  *     # prevent recursive removal of children
7476  *     c_root.children = c_root.last = NULL             # <<<<<<<<<<<<<<
7477  *     tree.xmlFreeDoc(c_doc)
7478  * 
7479  */
7480   __pyx_v_c_root->children = NULL;
7481   __pyx_v_c_root->last = NULL;
7482
7483   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":115
7484  *     # prevent recursive removal of children
7485  *     c_root.children = c_root.last = NULL
7486  *     tree.xmlFreeDoc(c_doc)             # <<<<<<<<<<<<<<
7487  * 
7488  * cdef _Element _fakeDocElementFactory(_Document doc, xmlNode* c_element):
7489  */
7490   xmlFreeDoc(__pyx_v_c_doc);
7491
7492   __pyx_L0:;
7493   __Pyx_FinishRefcountContext();
7494 }
7495
7496 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":117
7497  *     tree.xmlFreeDoc(c_doc)
7498  * 
7499  * cdef _Element _fakeDocElementFactory(_Document doc, xmlNode* c_element):             # <<<<<<<<<<<<<<
7500  *     u"""Special element factory for cases where we need to create a fake
7501  *     root document, but still need to instantiate arbitrary nodes from
7502  */
7503
7504 static  struct LxmlElement *__pyx_f_4lxml_5etree__fakeDocElementFactory(struct LxmlDocument *__pyx_v_doc, xmlNode *__pyx_v_c_element) {
7505   struct LxmlElement *__pyx_r = NULL;
7506   int __pyx_t_1;
7507   PyObject *__pyx_t_2 = NULL;
7508   __Pyx_SetupRefcountContext("_fakeDocElementFactory");
7509
7510   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":126
7511  *     instantiate the original node instead.
7512  *     """
7513  *     if c_element.doc is not doc._c_doc:             # <<<<<<<<<<<<<<
7514  *         if c_element.doc._private is not NULL:
7515  *             if c_element is c_element.doc.children:
7516  */
7517   __pyx_t_1 = (__pyx_v_c_element->doc != __pyx_v_doc->_c_doc);
7518   if (__pyx_t_1) {
7519
7520     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":127
7521  *     """
7522  *     if c_element.doc is not doc._c_doc:
7523  *         if c_element.doc._private is not NULL:             # <<<<<<<<<<<<<<
7524  *             if c_element is c_element.doc.children:
7525  *                 c_element = <xmlNode*>c_element.doc._private
7526  */
7527     __pyx_t_1 = (__pyx_v_c_element->doc->_private != NULL);
7528     if (__pyx_t_1) {
7529
7530       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":128
7531  *     if c_element.doc is not doc._c_doc:
7532  *         if c_element.doc._private is not NULL:
7533  *             if c_element is c_element.doc.children:             # <<<<<<<<<<<<<<
7534  *                 c_element = <xmlNode*>c_element.doc._private
7535  *                 #assert c_element.type == tree.XML_ELEMENT_NODE
7536  */
7537       __pyx_t_1 = (__pyx_v_c_element == __pyx_v_c_element->doc->children);
7538       if (__pyx_t_1) {
7539
7540         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":129
7541  *         if c_element.doc._private is not NULL:
7542  *             if c_element is c_element.doc.children:
7543  *                 c_element = <xmlNode*>c_element.doc._private             # <<<<<<<<<<<<<<
7544  *                 #assert c_element.type == tree.XML_ELEMENT_NODE
7545  *     return _elementFactory(doc, c_element)
7546  */
7547         __pyx_v_c_element = ((xmlNode *)__pyx_v_c_element->doc->_private);
7548         goto __pyx_L5;
7549       }
7550       __pyx_L5:;
7551       goto __pyx_L4;
7552     }
7553     __pyx_L4:;
7554     goto __pyx_L3;
7555   }
7556   __pyx_L3:;
7557
7558   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":131
7559  *                 c_element = <xmlNode*>c_element.doc._private
7560  *                 #assert c_element.type == tree.XML_ELEMENT_NODE
7561  *     return _elementFactory(doc, c_element)             # <<<<<<<<<<<<<<
7562  * 
7563  * ################################################################################
7564  */
7565   __Pyx_XDECREF(((PyObject *)__pyx_r));
7566   __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_doc, __pyx_v_c_element)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7567   __Pyx_GOTREF(__pyx_t_2);
7568   __pyx_r = ((struct LxmlElement *)__pyx_t_2);
7569   __pyx_t_2 = 0;
7570   goto __pyx_L0;
7571
7572   __pyx_r = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
7573   goto __pyx_L0;
7574   __pyx_L1_error:;
7575   __Pyx_XDECREF(__pyx_t_2);
7576   __Pyx_AddTraceback("lxml.etree._fakeDocElementFactory");
7577   __pyx_r = 0;
7578   __pyx_L0:;
7579   __Pyx_XGIVEREF((PyObject *)__pyx_r);
7580   __Pyx_FinishRefcountContext();
7581   return __pyx_r;
7582 }
7583
7584 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":136
7585  * # support for freeing tree elements when proxy objects are destroyed
7586  * 
7587  * cdef int attemptDeallocation(xmlNode* c_node):             # <<<<<<<<<<<<<<
7588  *     u"""Attempt deallocation of c_node (or higher up in tree).
7589  *     """
7590  */
7591
7592 static  int __pyx_f_4lxml_5etree_attemptDeallocation(xmlNode *__pyx_v_c_node) {
7593   xmlNode *__pyx_v_c_top;
7594   int __pyx_r;
7595   int __pyx_t_1;
7596   __Pyx_SetupRefcountContext("attemptDeallocation");
7597
7598   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":141
7599  *     cdef xmlNode* c_top
7600  *     # could be we actually aren't referring to the tree at all
7601  *     if c_node is NULL:             # <<<<<<<<<<<<<<
7602  *         #print "not freeing, node is NULL"
7603  *         return 0
7604  */
7605   __pyx_t_1 = (__pyx_v_c_node == NULL);
7606   if (__pyx_t_1) {
7607
7608     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":143
7609  *     if c_node is NULL:
7610  *         #print "not freeing, node is NULL"
7611  *         return 0             # <<<<<<<<<<<<<<
7612  *     c_top = getDeallocationTop(c_node)
7613  *     if c_top is not NULL:
7614  */
7615     __pyx_r = 0;
7616     goto __pyx_L0;
7617     goto __pyx_L3;
7618   }
7619   __pyx_L3:;
7620
7621   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":144
7622  *         #print "not freeing, node is NULL"
7623  *         return 0
7624  *     c_top = getDeallocationTop(c_node)             # <<<<<<<<<<<<<<
7625  *     if c_top is not NULL:
7626  *         #print "freeing:", c_top.name
7627  */
7628   __pyx_v_c_top = __pyx_f_4lxml_5etree_getDeallocationTop(__pyx_v_c_node);
7629
7630   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":145
7631  *         return 0
7632  *     c_top = getDeallocationTop(c_node)
7633  *     if c_top is not NULL:             # <<<<<<<<<<<<<<
7634  *         #print "freeing:", c_top.name
7635  *         _removeText(c_top.next) # tail
7636  */
7637   __pyx_t_1 = (__pyx_v_c_top != NULL);
7638   if (__pyx_t_1) {
7639
7640     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":147
7641  *     if c_top is not NULL:
7642  *         #print "freeing:", c_top.name
7643  *         _removeText(c_top.next) # tail             # <<<<<<<<<<<<<<
7644  *         tree.xmlFreeNode(c_top)
7645  *         return 1
7646  */
7647     __pyx_f_4lxml_5etree__removeText(__pyx_v_c_top->next);
7648
7649     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":148
7650  *         #print "freeing:", c_top.name
7651  *         _removeText(c_top.next) # tail
7652  *         tree.xmlFreeNode(c_top)             # <<<<<<<<<<<<<<
7653  *         return 1
7654  *     return 0
7655  */
7656     xmlFreeNode(__pyx_v_c_top);
7657
7658     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":149
7659  *         _removeText(c_top.next) # tail
7660  *         tree.xmlFreeNode(c_top)
7661  *         return 1             # <<<<<<<<<<<<<<
7662  *     return 0
7663  * 
7664  */
7665     __pyx_r = 1;
7666     goto __pyx_L0;
7667     goto __pyx_L4;
7668   }
7669   __pyx_L4:;
7670
7671   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":150
7672  *         tree.xmlFreeNode(c_top)
7673  *         return 1
7674  *     return 0             # <<<<<<<<<<<<<<
7675  * 
7676  * cdef xmlNode* getDeallocationTop(xmlNode* c_node):
7677  */
7678   __pyx_r = 0;
7679   goto __pyx_L0;
7680
7681   __pyx_r = 0;
7682   __pyx_L0:;
7683   __Pyx_FinishRefcountContext();
7684   return __pyx_r;
7685 }
7686
7687 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":152
7688  *     return 0
7689  * 
7690  * cdef xmlNode* getDeallocationTop(xmlNode* c_node):             # <<<<<<<<<<<<<<
7691  *     u"""Return the top of the tree that can be deallocated, or NULL.
7692  *     """
7693  */
7694
7695 static  xmlNode *__pyx_f_4lxml_5etree_getDeallocationTop(xmlNode *__pyx_v_c_node) {
7696   xmlNode *__pyx_v_c_current;
7697   xmlNode *__pyx_v_c_top;
7698   xmlNode *__pyx_r;
7699   int __pyx_t_1;
7700   int __pyx_t_2;
7701   __Pyx_SetupRefcountContext("getDeallocationTop");
7702
7703   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":158
7704  *     cdef xmlNode* c_top
7705  *     #print "trying to do deallocating:", c_node.type
7706  *     if c_node._private is not NULL:             # <<<<<<<<<<<<<<
7707  *         #print "Not freeing: proxies still exist"
7708  *         return NULL
7709  */
7710   __pyx_t_1 = (__pyx_v_c_node->_private != NULL);
7711   if (__pyx_t_1) {
7712
7713     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":160
7714  *     if c_node._private is not NULL:
7715  *         #print "Not freeing: proxies still exist"
7716  *         return NULL             # <<<<<<<<<<<<<<
7717  *     c_current = c_node.parent
7718  *     c_top = c_node
7719  */
7720     __pyx_r = NULL;
7721     goto __pyx_L0;
7722     goto __pyx_L3;
7723   }
7724   __pyx_L3:;
7725
7726   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":161
7727  *         #print "Not freeing: proxies still exist"
7728  *         return NULL
7729  *     c_current = c_node.parent             # <<<<<<<<<<<<<<
7730  *     c_top = c_node
7731  *     while c_current is not NULL:
7732  */
7733   __pyx_v_c_current = __pyx_v_c_node->parent;
7734
7735   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":162
7736  *         return NULL
7737  *     c_current = c_node.parent
7738  *     c_top = c_node             # <<<<<<<<<<<<<<
7739  *     while c_current is not NULL:
7740  *         #print "checking:", c_current.type
7741  */
7742   __pyx_v_c_top = __pyx_v_c_node;
7743
7744   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":163
7745  *     c_current = c_node.parent
7746  *     c_top = c_node
7747  *     while c_current is not NULL:             # <<<<<<<<<<<<<<
7748  *         #print "checking:", c_current.type
7749  *         if c_current.type == tree.XML_DOCUMENT_NODE or \
7750  */
7751   while (1) {
7752     __pyx_t_1 = (__pyx_v_c_current != NULL);
7753     if (!__pyx_t_1) break;
7754
7755     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":165
7756  *     while c_current is not NULL:
7757  *         #print "checking:", c_current.type
7758  *         if c_current.type == tree.XML_DOCUMENT_NODE or \             # <<<<<<<<<<<<<<
7759  *                c_current.type == tree.XML_HTML_DOCUMENT_NODE:
7760  *             #print "not freeing: still in doc"
7761  */
7762     if (!(__pyx_v_c_current->type == XML_DOCUMENT_NODE)) {
7763
7764       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":166
7765  *         #print "checking:", c_current.type
7766  *         if c_current.type == tree.XML_DOCUMENT_NODE or \
7767  *                c_current.type == tree.XML_HTML_DOCUMENT_NODE:             # <<<<<<<<<<<<<<
7768  *             #print "not freeing: still in doc"
7769  *             return NULL
7770  */
7771       __pyx_t_1 = (__pyx_v_c_current->type == XML_HTML_DOCUMENT_NODE);
7772     } else {
7773       __pyx_t_1 = (__pyx_v_c_current->type == XML_DOCUMENT_NODE);
7774     }
7775     if (__pyx_t_1) {
7776
7777       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":168
7778  *                c_current.type == tree.XML_HTML_DOCUMENT_NODE:
7779  *             #print "not freeing: still in doc"
7780  *             return NULL             # <<<<<<<<<<<<<<
7781  *         # if we're still attached to the document, don't deallocate
7782  *         if c_current._private is not NULL:
7783  */
7784       __pyx_r = NULL;
7785       goto __pyx_L0;
7786       goto __pyx_L6;
7787     }
7788     __pyx_L6:;
7789
7790     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":170
7791  *             return NULL
7792  *         # if we're still attached to the document, don't deallocate
7793  *         if c_current._private is not NULL:             # <<<<<<<<<<<<<<
7794  *             #print "Not freeing: proxies still exist"
7795  *             return NULL
7796  */
7797     __pyx_t_1 = (__pyx_v_c_current->_private != NULL);
7798     if (__pyx_t_1) {
7799
7800       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":172
7801  *         if c_current._private is not NULL:
7802  *             #print "Not freeing: proxies still exist"
7803  *             return NULL             # <<<<<<<<<<<<<<
7804  *         c_top = c_current
7805  *         c_current = c_current.parent
7806  */
7807       __pyx_r = NULL;
7808       goto __pyx_L0;
7809       goto __pyx_L7;
7810     }
7811     __pyx_L7:;
7812
7813     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":173
7814  *             #print "Not freeing: proxies still exist"
7815  *             return NULL
7816  *         c_top = c_current             # <<<<<<<<<<<<<<
7817  *         c_current = c_current.parent
7818  *     # see whether we have children to deallocate
7819  */
7820     __pyx_v_c_top = __pyx_v_c_current;
7821
7822     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":174
7823  *             return NULL
7824  *         c_top = c_current
7825  *         c_current = c_current.parent             # <<<<<<<<<<<<<<
7826  *     # see whether we have children to deallocate
7827  *     if canDeallocateChildNodes(c_top):
7828  */
7829     __pyx_v_c_current = __pyx_v_c_current->parent;
7830   }
7831
7832   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":176
7833  *         c_current = c_current.parent
7834  *     # see whether we have children to deallocate
7835  *     if canDeallocateChildNodes(c_top):             # <<<<<<<<<<<<<<
7836  *         return c_top
7837  *     else:
7838  */
7839   __pyx_t_2 = __pyx_f_4lxml_5etree_canDeallocateChildNodes(__pyx_v_c_top);
7840   if (__pyx_t_2) {
7841
7842     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":177
7843  *     # see whether we have children to deallocate
7844  *     if canDeallocateChildNodes(c_top):
7845  *         return c_top             # <<<<<<<<<<<<<<
7846  *     else:
7847  *         return NULL
7848  */
7849     __pyx_r = __pyx_v_c_top;
7850     goto __pyx_L0;
7851     goto __pyx_L8;
7852   }
7853   /*else*/ {
7854
7855     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":179
7856  *         return c_top
7857  *     else:
7858  *         return NULL             # <<<<<<<<<<<<<<
7859  * 
7860  * cdef int canDeallocateChildNodes(xmlNode* c_parent):
7861  */
7862     __pyx_r = NULL;
7863     goto __pyx_L0;
7864   }
7865   __pyx_L8:;
7866
7867   __pyx_r = 0;
7868   __pyx_L0:;
7869   __Pyx_FinishRefcountContext();
7870   return __pyx_r;
7871 }
7872
7873 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":181
7874  *         return NULL
7875  * 
7876  * cdef int canDeallocateChildNodes(xmlNode* c_parent):             # <<<<<<<<<<<<<<
7877  *     cdef xmlNode* c_node
7878  *     c_node = c_parent.children
7879  */
7880
7881 static  int __pyx_f_4lxml_5etree_canDeallocateChildNodes(xmlNode *__pyx_v_c_parent) {
7882   xmlNode *__pyx_v_c_node;
7883   int __pyx_r;
7884   int __pyx_t_1;
7885   __Pyx_SetupRefcountContext("canDeallocateChildNodes");
7886
7887   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":183
7888  * cdef int canDeallocateChildNodes(xmlNode* c_parent):
7889  *     cdef xmlNode* c_node
7890  *     c_node = c_parent.children             # <<<<<<<<<<<<<<
7891  *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_parent, c_node, 1)
7892  *     if c_node._private is not NULL:
7893  */
7894   __pyx_v_c_node = __pyx_v_c_parent->children;
7895
7896   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":184
7897  *     cdef xmlNode* c_node
7898  *     c_node = c_parent.children
7899  *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_parent, c_node, 1)             # <<<<<<<<<<<<<<
7900  *     if c_node._private is not NULL:
7901  *         return 0
7902  */
7903   BEGIN_FOR_EACH_ELEMENT_FROM(__pyx_v_c_parent, __pyx_v_c_node, 1);
7904
7905   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":185
7906  *     c_node = c_parent.children
7907  *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_parent, c_node, 1)
7908  *     if c_node._private is not NULL:             # <<<<<<<<<<<<<<
7909  *         return 0
7910  *     tree.END_FOR_EACH_ELEMENT_FROM(c_node)
7911  */
7912   __pyx_t_1 = (__pyx_v_c_node->_private != NULL);
7913   if (__pyx_t_1) {
7914
7915     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":186
7916  *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_parent, c_node, 1)
7917  *     if c_node._private is not NULL:
7918  *         return 0             # <<<<<<<<<<<<<<
7919  *     tree.END_FOR_EACH_ELEMENT_FROM(c_node)
7920  *     return 1
7921  */
7922     __pyx_r = 0;
7923     goto __pyx_L0;
7924     goto __pyx_L3;
7925   }
7926   __pyx_L3:;
7927
7928   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":187
7929  *     if c_node._private is not NULL:
7930  *         return 0
7931  *     tree.END_FOR_EACH_ELEMENT_FROM(c_node)             # <<<<<<<<<<<<<<
7932  *     return 1
7933  * 
7934  */
7935   END_FOR_EACH_ELEMENT_FROM(__pyx_v_c_node);
7936
7937   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":188
7938  *         return 0
7939  *     tree.END_FOR_EACH_ELEMENT_FROM(c_node)
7940  *     return 1             # <<<<<<<<<<<<<<
7941  * 
7942  * ################################################################################
7943  */
7944   __pyx_r = 1;
7945   goto __pyx_L0;
7946
7947   __pyx_r = 0;
7948   __pyx_L0:;
7949   __Pyx_FinishRefcountContext();
7950   return __pyx_r;
7951 }
7952
7953 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":193
7954  * # fix _Document references and namespaces when a node changes documents
7955  * 
7956  * cdef void _copyParentNamespaces(xmlNode* c_from_node, xmlNode* c_to_node) nogil:             # <<<<<<<<<<<<<<
7957  *     u"""Copy the namespaces of all ancestors of c_from_node to c_to_node.
7958  *     """
7959  */
7960
7961 static  void __pyx_f_4lxml_5etree__copyParentNamespaces(xmlNode *__pyx_v_c_from_node, xmlNode *__pyx_v_c_to_node) {
7962   xmlNode *__pyx_v_c_parent;
7963   xmlNs *__pyx_v_c_new_ns;
7964   int __pyx_t_1;
7965   int __pyx_t_2;
7966
7967   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":200
7968  *     cdef xmlNs* c_new_ns
7969  *     cdef int prefix_known
7970  *     c_parent = c_from_node.parent             # <<<<<<<<<<<<<<
7971  *     while c_parent is not NULL and (tree._isElementOrXInclude(c_parent) or
7972  *                                     c_parent.type == tree.XML_DOCUMENT_NODE):
7973  */
7974   __pyx_v_c_parent = __pyx_v_c_from_node->parent;
7975
7976   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":201
7977  *     cdef int prefix_known
7978  *     c_parent = c_from_node.parent
7979  *     while c_parent is not NULL and (tree._isElementOrXInclude(c_parent) or             # <<<<<<<<<<<<<<
7980  *                                     c_parent.type == tree.XML_DOCUMENT_NODE):
7981  *         c_new_ns = c_parent.nsDef
7982  */
7983   while (1) {
7984     if ((__pyx_v_c_parent != NULL)) {
7985       if (!_isElementOrXInclude(__pyx_v_c_parent)) {
7986
7987         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":202
7988  *     c_parent = c_from_node.parent
7989  *     while c_parent is not NULL and (tree._isElementOrXInclude(c_parent) or
7990  *                                     c_parent.type == tree.XML_DOCUMENT_NODE):             # <<<<<<<<<<<<<<
7991  *         c_new_ns = c_parent.nsDef
7992  *         while c_new_ns is not NULL:
7993  */
7994         __pyx_t_1 = (__pyx_v_c_parent->type == XML_DOCUMENT_NODE);
7995       } else {
7996         __pyx_t_1 = _isElementOrXInclude(__pyx_v_c_parent);
7997       }
7998       __pyx_t_2 = __pyx_t_1;
7999     } else {
8000       __pyx_t_2 = (__pyx_v_c_parent != NULL);
8001     }
8002     if (!__pyx_t_2) break;
8003
8004     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":203
8005  *     while c_parent is not NULL and (tree._isElementOrXInclude(c_parent) or
8006  *                                     c_parent.type == tree.XML_DOCUMENT_NODE):
8007  *         c_new_ns = c_parent.nsDef             # <<<<<<<<<<<<<<
8008  *         while c_new_ns is not NULL:
8009  *             # libxml2 will check if the prefix is already defined
8010  */
8011     __pyx_v_c_new_ns = __pyx_v_c_parent->nsDef;
8012
8013     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":204
8014  *                                     c_parent.type == tree.XML_DOCUMENT_NODE):
8015  *         c_new_ns = c_parent.nsDef
8016  *         while c_new_ns is not NULL:             # <<<<<<<<<<<<<<
8017  *             # libxml2 will check if the prefix is already defined
8018  *             tree.xmlNewNs(c_to_node, c_new_ns.href, c_new_ns.prefix)
8019  */
8020     while (1) {
8021       __pyx_t_2 = (__pyx_v_c_new_ns != NULL);
8022       if (!__pyx_t_2) break;
8023
8024       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":206
8025  *         while c_new_ns is not NULL:
8026  *             # libxml2 will check if the prefix is already defined
8027  *             tree.xmlNewNs(c_to_node, c_new_ns.href, c_new_ns.prefix)             # <<<<<<<<<<<<<<
8028  *             c_new_ns = c_new_ns.next
8029  *         c_parent = c_parent.parent
8030  */
8031       xmlNewNs(__pyx_v_c_to_node, __pyx_v_c_new_ns->href, __pyx_v_c_new_ns->prefix);
8032
8033       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":207
8034  *             # libxml2 will check if the prefix is already defined
8035  *             tree.xmlNewNs(c_to_node, c_new_ns.href, c_new_ns.prefix)
8036  *             c_new_ns = c_new_ns.next             # <<<<<<<<<<<<<<
8037  *         c_parent = c_parent.parent
8038  * 
8039  */
8040       __pyx_v_c_new_ns = __pyx_v_c_new_ns->next;
8041     }
8042
8043     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":208
8044  *             tree.xmlNewNs(c_to_node, c_new_ns.href, c_new_ns.prefix)
8045  *             c_new_ns = c_new_ns.next
8046  *         c_parent = c_parent.parent             # <<<<<<<<<<<<<<
8047  * 
8048  * ctypedef struct _nscache:
8049  */
8050     __pyx_v_c_parent = __pyx_v_c_parent->parent;
8051   }
8052
8053 }
8054
8055 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":216
8056  *     size_t last
8057  * 
8058  * cdef int _growNsCache(_nscache* c_ns_cache) except -1:             # <<<<<<<<<<<<<<
8059  *     cdef xmlNs** c_ns_ptr
8060  *     if c_ns_cache.size == 0:
8061  */
8062
8063 static  int __pyx_f_4lxml_5etree__growNsCache(__pyx_t_4lxml_5etree__nscache *__pyx_v_c_ns_cache) {
8064   xmlNs **__pyx_v_c_ns_ptr;
8065   int __pyx_r;
8066   int __pyx_t_1;
8067   PyObject *__pyx_t_2 = NULL;
8068   __Pyx_SetupRefcountContext("_growNsCache");
8069
8070   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":218
8071  * cdef int _growNsCache(_nscache* c_ns_cache) except -1:
8072  *     cdef xmlNs** c_ns_ptr
8073  *     if c_ns_cache.size == 0:             # <<<<<<<<<<<<<<
8074  *         c_ns_cache.size = 20
8075  *     else:
8076  */
8077   __pyx_t_1 = (__pyx_v_c_ns_cache->size == 0);
8078   if (__pyx_t_1) {
8079
8080     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":219
8081  *     cdef xmlNs** c_ns_ptr
8082  *     if c_ns_cache.size == 0:
8083  *         c_ns_cache.size = 20             # <<<<<<<<<<<<<<
8084  *     else:
8085  *         c_ns_cache.size *= 2
8086  */
8087     __pyx_v_c_ns_cache->size = 20;
8088     goto __pyx_L3;
8089   }
8090   /*else*/ {
8091
8092     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":221
8093  *         c_ns_cache.size = 20
8094  *     else:
8095  *         c_ns_cache.size *= 2             # <<<<<<<<<<<<<<
8096  *     c_ns_ptr = <xmlNs**> cstd.realloc(
8097  *         c_ns_cache.new, c_ns_cache.size * sizeof(xmlNs*))
8098  */
8099     __pyx_v_c_ns_cache->size *= 2;
8100   }
8101   __pyx_L3:;
8102
8103   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":223
8104  *         c_ns_cache.size *= 2
8105  *     c_ns_ptr = <xmlNs**> cstd.realloc(
8106  *         c_ns_cache.new, c_ns_cache.size * sizeof(xmlNs*))             # <<<<<<<<<<<<<<
8107  *     if c_ns_ptr is not NULL:
8108  *         c_ns_cache.new = c_ns_ptr
8109  */
8110   __pyx_v_c_ns_ptr = ((xmlNs **)realloc(__pyx_v_c_ns_cache->new, (__pyx_v_c_ns_cache->size * (sizeof(xmlNs *)))));
8111
8112   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":224
8113  *     c_ns_ptr = <xmlNs**> cstd.realloc(
8114  *         c_ns_cache.new, c_ns_cache.size * sizeof(xmlNs*))
8115  *     if c_ns_ptr is not NULL:             # <<<<<<<<<<<<<<
8116  *         c_ns_cache.new = c_ns_ptr
8117  *         c_ns_ptr = <xmlNs**> cstd.realloc(
8118  */
8119   __pyx_t_1 = (__pyx_v_c_ns_ptr != NULL);
8120   if (__pyx_t_1) {
8121
8122     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":225
8123  *         c_ns_cache.new, c_ns_cache.size * sizeof(xmlNs*))
8124  *     if c_ns_ptr is not NULL:
8125  *         c_ns_cache.new = c_ns_ptr             # <<<<<<<<<<<<<<
8126  *         c_ns_ptr = <xmlNs**> cstd.realloc(
8127  *             c_ns_cache.old, c_ns_cache.size * sizeof(xmlNs*))
8128  */
8129     __pyx_v_c_ns_cache->new = __pyx_v_c_ns_ptr;
8130
8131     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":227
8132  *         c_ns_cache.new = c_ns_ptr
8133  *         c_ns_ptr = <xmlNs**> cstd.realloc(
8134  *             c_ns_cache.old, c_ns_cache.size * sizeof(xmlNs*))             # <<<<<<<<<<<<<<
8135  *     if c_ns_ptr is not NULL:
8136  *         c_ns_cache.old = c_ns_ptr
8137  */
8138     __pyx_v_c_ns_ptr = ((xmlNs **)realloc(__pyx_v_c_ns_cache->old, (__pyx_v_c_ns_cache->size * (sizeof(xmlNs *)))));
8139     goto __pyx_L4;
8140   }
8141   __pyx_L4:;
8142
8143   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":228
8144  *         c_ns_ptr = <xmlNs**> cstd.realloc(
8145  *             c_ns_cache.old, c_ns_cache.size * sizeof(xmlNs*))
8146  *     if c_ns_ptr is not NULL:             # <<<<<<<<<<<<<<
8147  *         c_ns_cache.old = c_ns_ptr
8148  *     else:
8149  */
8150   __pyx_t_1 = (__pyx_v_c_ns_ptr != NULL);
8151   if (__pyx_t_1) {
8152
8153     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":229
8154  *             c_ns_cache.old, c_ns_cache.size * sizeof(xmlNs*))
8155  *     if c_ns_ptr is not NULL:
8156  *         c_ns_cache.old = c_ns_ptr             # <<<<<<<<<<<<<<
8157  *     else:
8158  *         cstd.free(c_ns_cache.new)
8159  */
8160     __pyx_v_c_ns_cache->old = __pyx_v_c_ns_ptr;
8161     goto __pyx_L5;
8162   }
8163   /*else*/ {
8164
8165     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":231
8166  *         c_ns_cache.old = c_ns_ptr
8167  *     else:
8168  *         cstd.free(c_ns_cache.new)             # <<<<<<<<<<<<<<
8169  *         cstd.free(c_ns_cache.old)
8170  *         python.PyErr_NoMemory()
8171  */
8172     free(__pyx_v_c_ns_cache->new);
8173
8174     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":232
8175  *     else:
8176  *         cstd.free(c_ns_cache.new)
8177  *         cstd.free(c_ns_cache.old)             # <<<<<<<<<<<<<<
8178  *         python.PyErr_NoMemory()
8179  *         return -1
8180  */
8181     free(__pyx_v_c_ns_cache->old);
8182
8183     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":233
8184  *         cstd.free(c_ns_cache.new)
8185  *         cstd.free(c_ns_cache.old)
8186  *         python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
8187  *         return -1
8188  *     return 0
8189  */
8190     __pyx_t_2 = PyErr_NoMemory(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8191     __Pyx_GOTREF(__pyx_t_2);
8192     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8193
8194     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":234
8195  *         cstd.free(c_ns_cache.old)
8196  *         python.PyErr_NoMemory()
8197  *         return -1             # <<<<<<<<<<<<<<
8198  *     return 0
8199  * 
8200  */
8201     __pyx_r = -1;
8202     goto __pyx_L0;
8203   }
8204   __pyx_L5:;
8205
8206   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":235
8207  *         python.PyErr_NoMemory()
8208  *         return -1
8209  *     return 0             # <<<<<<<<<<<<<<
8210  * 
8211  * cdef inline int _appendToNsCache(_nscache* c_ns_cache,
8212  */
8213   __pyx_r = 0;
8214   goto __pyx_L0;
8215
8216   __pyx_r = 0;
8217   goto __pyx_L0;
8218   __pyx_L1_error:;
8219   __Pyx_XDECREF(__pyx_t_2);
8220   __Pyx_AddTraceback("lxml.etree._growNsCache");
8221   __pyx_r = -1;
8222   __pyx_L0:;
8223   __Pyx_FinishRefcountContext();
8224   return __pyx_r;
8225 }
8226
8227 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":237
8228  *     return 0
8229  * 
8230  * cdef inline int _appendToNsCache(_nscache* c_ns_cache,             # <<<<<<<<<<<<<<
8231  *                                  xmlNs* c_old_ns, xmlNs* c_new_ns) except -1:
8232  *     if c_ns_cache.last >= c_ns_cache.size:
8233  */
8234
8235 static INLINE int __pyx_f_4lxml_5etree__appendToNsCache(__pyx_t_4lxml_5etree__nscache *__pyx_v_c_ns_cache, xmlNs *__pyx_v_c_old_ns, xmlNs *__pyx_v_c_new_ns) {
8236   int __pyx_r;
8237   int __pyx_t_1;
8238   int __pyx_t_2;
8239   __Pyx_SetupRefcountContext("_appendToNsCache");
8240
8241   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":239
8242  * cdef inline int _appendToNsCache(_nscache* c_ns_cache,
8243  *                                  xmlNs* c_old_ns, xmlNs* c_new_ns) except -1:
8244  *     if c_ns_cache.last >= c_ns_cache.size:             # <<<<<<<<<<<<<<
8245  *         _growNsCache(c_ns_cache)
8246  *     c_ns_cache.old[c_ns_cache.last] = c_old_ns
8247  */
8248   __pyx_t_1 = (__pyx_v_c_ns_cache->last >= __pyx_v_c_ns_cache->size);
8249   if (__pyx_t_1) {
8250
8251     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":240
8252  *                                  xmlNs* c_old_ns, xmlNs* c_new_ns) except -1:
8253  *     if c_ns_cache.last >= c_ns_cache.size:
8254  *         _growNsCache(c_ns_cache)             # <<<<<<<<<<<<<<
8255  *     c_ns_cache.old[c_ns_cache.last] = c_old_ns
8256  *     c_ns_cache.new[c_ns_cache.last] = c_new_ns
8257  */
8258     __pyx_t_2 = __pyx_f_4lxml_5etree__growNsCache(__pyx_v_c_ns_cache); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8259     goto __pyx_L3;
8260   }
8261   __pyx_L3:;
8262
8263   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":241
8264  *     if c_ns_cache.last >= c_ns_cache.size:
8265  *         _growNsCache(c_ns_cache)
8266  *     c_ns_cache.old[c_ns_cache.last] = c_old_ns             # <<<<<<<<<<<<<<
8267  *     c_ns_cache.new[c_ns_cache.last] = c_new_ns
8268  *     c_ns_cache.last += 1
8269  */
8270   (__pyx_v_c_ns_cache->old[__pyx_v_c_ns_cache->last]) = __pyx_v_c_old_ns;
8271
8272   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":242
8273  *         _growNsCache(c_ns_cache)
8274  *     c_ns_cache.old[c_ns_cache.last] = c_old_ns
8275  *     c_ns_cache.new[c_ns_cache.last] = c_new_ns             # <<<<<<<<<<<<<<
8276  *     c_ns_cache.last += 1
8277  * 
8278  */
8279   (__pyx_v_c_ns_cache->new[__pyx_v_c_ns_cache->last]) = __pyx_v_c_new_ns;
8280
8281   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":243
8282  *     c_ns_cache.old[c_ns_cache.last] = c_old_ns
8283  *     c_ns_cache.new[c_ns_cache.last] = c_new_ns
8284  *     c_ns_cache.last += 1             # <<<<<<<<<<<<<<
8285  * 
8286  * cdef int _stripRedundantNamespaceDeclarations(
8287  */
8288   __pyx_v_c_ns_cache->last += 1;
8289
8290   __pyx_r = 0;
8291   goto __pyx_L0;
8292   __pyx_L1_error:;
8293   __Pyx_AddTraceback("lxml.etree._appendToNsCache");
8294   __pyx_r = -1;
8295   __pyx_L0:;
8296   __Pyx_FinishRefcountContext();
8297   return __pyx_r;
8298 }
8299
8300 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":245
8301  *     c_ns_cache.last += 1
8302  * 
8303  * cdef int _stripRedundantNamespaceDeclarations(             # <<<<<<<<<<<<<<
8304  *     xmlNode* c_element, _nscache* c_ns_cache, xmlNs** c_del_ns_list) except -1:
8305  *     u"""Removes namespace declarations from an element that are already
8306  */
8307
8308 static  int __pyx_f_4lxml_5etree__stripRedundantNamespaceDeclarations(xmlNode *__pyx_v_c_element, __pyx_t_4lxml_5etree__nscache *__pyx_v_c_ns_cache, xmlNs **__pyx_v_c_del_ns_list) {
8309   xmlNs *__pyx_v_c_ns;
8310   xmlNs *__pyx_v_c_ns_next;
8311   xmlNs **__pyx_v_c_nsdef;
8312   int __pyx_r;
8313   int __pyx_t_1;
8314   int __pyx_t_2;
8315   __Pyx_SetupRefcountContext("_stripRedundantNamespaceDeclarations");
8316
8317   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":255
8318  *     cdef xmlNs** c_nsdef
8319  *     # use a xmlNs** to handle assignments to "c_element.nsDef" correctly
8320  *     c_nsdef = &c_element.nsDef             # <<<<<<<<<<<<<<
8321  *     while c_nsdef[0] is not NULL:
8322  *         c_ns = tree.xmlSearchNsByHref(
8323  */
8324   __pyx_v_c_nsdef = (&__pyx_v_c_element->nsDef);
8325
8326   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":256
8327  *     # use a xmlNs** to handle assignments to "c_element.nsDef" correctly
8328  *     c_nsdef = &c_element.nsDef
8329  *     while c_nsdef[0] is not NULL:             # <<<<<<<<<<<<<<
8330  *         c_ns = tree.xmlSearchNsByHref(
8331  *             c_element.doc, c_element.parent, c_nsdef[0].href)
8332  */
8333   while (1) {
8334     __pyx_t_1 = ((__pyx_v_c_nsdef[0]) != NULL);
8335     if (!__pyx_t_1) break;
8336
8337     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":258
8338  *     while c_nsdef[0] is not NULL:
8339  *         c_ns = tree.xmlSearchNsByHref(
8340  *             c_element.doc, c_element.parent, c_nsdef[0].href)             # <<<<<<<<<<<<<<
8341  *         if c_ns is NULL:
8342  *             # new namespace href => keep and cache the ns declaration
8343  */
8344     __pyx_v_c_ns = xmlSearchNsByHref(__pyx_v_c_element->doc, __pyx_v_c_element->parent, (__pyx_v_c_nsdef[0])->href);
8345
8346     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":259
8347  *         c_ns = tree.xmlSearchNsByHref(
8348  *             c_element.doc, c_element.parent, c_nsdef[0].href)
8349  *         if c_ns is NULL:             # <<<<<<<<<<<<<<
8350  *             # new namespace href => keep and cache the ns declaration
8351  *             _appendToNsCache(c_ns_cache, c_nsdef[0], c_nsdef[0])
8352  */
8353     __pyx_t_1 = (__pyx_v_c_ns == NULL);
8354     if (__pyx_t_1) {
8355
8356       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":261
8357  *         if c_ns is NULL:
8358  *             # new namespace href => keep and cache the ns declaration
8359  *             _appendToNsCache(c_ns_cache, c_nsdef[0], c_nsdef[0])             # <<<<<<<<<<<<<<
8360  *             c_nsdef = &c_nsdef[0].next
8361  *         else:
8362  */
8363       __pyx_t_2 = __pyx_f_4lxml_5etree__appendToNsCache(__pyx_v_c_ns_cache, (__pyx_v_c_nsdef[0]), (__pyx_v_c_nsdef[0])); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8364
8365       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":262
8366  *             # new namespace href => keep and cache the ns declaration
8367  *             _appendToNsCache(c_ns_cache, c_nsdef[0], c_nsdef[0])
8368  *             c_nsdef = &c_nsdef[0].next             # <<<<<<<<<<<<<<
8369  *         else:
8370  *             # known namespace href => strip the ns
8371  */
8372       __pyx_v_c_nsdef = (&(__pyx_v_c_nsdef[0])->next);
8373       goto __pyx_L5;
8374     }
8375     /*else*/ {
8376
8377       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":266
8378  *             # known namespace href => strip the ns
8379  *             if c_ns is tree.xmlSearchNs(c_element.doc, c_element.parent,
8380  *                                         c_ns.prefix):             # <<<<<<<<<<<<<<
8381  *                 # prefix is not shadowed by parents => ns is reusable
8382  *                 _appendToNsCache(c_ns_cache, c_nsdef[0], c_ns)
8383  */
8384       __pyx_t_1 = (__pyx_v_c_ns == xmlSearchNs(__pyx_v_c_element->doc, __pyx_v_c_element->parent, __pyx_v_c_ns->prefix));
8385       if (__pyx_t_1) {
8386
8387         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":268
8388  *                                         c_ns.prefix):
8389  *                 # prefix is not shadowed by parents => ns is reusable
8390  *                 _appendToNsCache(c_ns_cache, c_nsdef[0], c_ns)             # <<<<<<<<<<<<<<
8391  *             # cut out c_nsdef.next and prepend it to garbage chain
8392  *             c_ns_next = c_nsdef[0].next
8393  */
8394         __pyx_t_2 = __pyx_f_4lxml_5etree__appendToNsCache(__pyx_v_c_ns_cache, (__pyx_v_c_nsdef[0]), __pyx_v_c_ns); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8395         goto __pyx_L6;
8396       }
8397       __pyx_L6:;
8398
8399       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":270
8400  *                 _appendToNsCache(c_ns_cache, c_nsdef[0], c_ns)
8401  *             # cut out c_nsdef.next and prepend it to garbage chain
8402  *             c_ns_next = c_nsdef[0].next             # <<<<<<<<<<<<<<
8403  *             c_nsdef[0].next = c_del_ns_list[0]
8404  *             c_del_ns_list[0] = c_nsdef[0]
8405  */
8406       __pyx_v_c_ns_next = (__pyx_v_c_nsdef[0])->next;
8407
8408       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":271
8409  *             # cut out c_nsdef.next and prepend it to garbage chain
8410  *             c_ns_next = c_nsdef[0].next
8411  *             c_nsdef[0].next = c_del_ns_list[0]             # <<<<<<<<<<<<<<
8412  *             c_del_ns_list[0] = c_nsdef[0]
8413  *             c_nsdef[0] = c_ns_next
8414  */
8415       (__pyx_v_c_nsdef[0])->next = (__pyx_v_c_del_ns_list[0]);
8416
8417       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":272
8418  *             c_ns_next = c_nsdef[0].next
8419  *             c_nsdef[0].next = c_del_ns_list[0]
8420  *             c_del_ns_list[0] = c_nsdef[0]             # <<<<<<<<<<<<<<
8421  *             c_nsdef[0] = c_ns_next
8422  *     return 0
8423  */
8424       (__pyx_v_c_del_ns_list[0]) = (__pyx_v_c_nsdef[0]);
8425
8426       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":273
8427  *             c_nsdef[0].next = c_del_ns_list[0]
8428  *             c_del_ns_list[0] = c_nsdef[0]
8429  *             c_nsdef[0] = c_ns_next             # <<<<<<<<<<<<<<
8430  *     return 0
8431  * 
8432  */
8433       (__pyx_v_c_nsdef[0]) = __pyx_v_c_ns_next;
8434     }
8435     __pyx_L5:;
8436   }
8437
8438   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":274
8439  *             c_del_ns_list[0] = c_nsdef[0]
8440  *             c_nsdef[0] = c_ns_next
8441  *     return 0             # <<<<<<<<<<<<<<
8442  * 
8443  * cdef int moveNodeToDocument(_Document doc, xmlDoc* c_source_doc,
8444  */
8445   __pyx_r = 0;
8446   goto __pyx_L0;
8447
8448   __pyx_r = 0;
8449   goto __pyx_L0;
8450   __pyx_L1_error:;
8451   __Pyx_AddTraceback("lxml.etree._stripRedundantNamespaceDeclarations");
8452   __pyx_r = -1;
8453   __pyx_L0:;
8454   __Pyx_FinishRefcountContext();
8455   return __pyx_r;
8456 }
8457
8458 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":276
8459  *     return 0
8460  * 
8461  * cdef int moveNodeToDocument(_Document doc, xmlDoc* c_source_doc,             # <<<<<<<<<<<<<<
8462  *                             xmlNode* c_element) except -1:
8463  *     u"""Fix the xmlNs pointers of a node and its subtree that were moved.
8464  */
8465
8466 static  int __pyx_f_4lxml_5etree_moveNodeToDocument(struct LxmlDocument *__pyx_v_doc, xmlDoc *__pyx_v_c_source_doc, xmlNode *__pyx_v_c_element) {
8467   xmlNode *__pyx_v_c_start_node;
8468   xmlNode *__pyx_v_c_node;
8469   __pyx_t_4lxml_5etree__nscache __pyx_v_c_ns_cache;
8470   xmlNs *__pyx_v_c_ns;
8471   xmlNs *__pyx_v_c_del_ns_list;
8472   size_t __pyx_v_i;
8473   size_t __pyx_v_proxy_count;
8474   int __pyx_r;
8475   int __pyx_t_1;
8476   int __pyx_t_2;
8477   size_t __pyx_t_3;
8478   xmlNs *__pyx_t_4;
8479   __Pyx_SetupRefcountContext("moveNodeToDocument");
8480
8481   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":315
8482  *     cdef xmlNs* c_nsdef
8483  *     cdef xmlNs* c_del_ns_list
8484  *     cdef size_t i, proxy_count = 0             # <<<<<<<<<<<<<<
8485  * 
8486  *     if not tree._isElementOrXInclude(c_element):
8487  */
8488   __pyx_v_proxy_count = 0;
8489
8490   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":317
8491  *     cdef size_t i, proxy_count = 0
8492  * 
8493  *     if not tree._isElementOrXInclude(c_element):             # <<<<<<<<<<<<<<
8494  *         return 0
8495  * 
8496  */
8497   __pyx_t_1 = (!_isElementOrXInclude(__pyx_v_c_element));
8498   if (__pyx_t_1) {
8499
8500     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":318
8501  * 
8502  *     if not tree._isElementOrXInclude(c_element):
8503  *         return 0             # <<<<<<<<<<<<<<
8504  * 
8505  *     c_start_node = c_element
8506  */
8507     __pyx_r = 0;
8508     goto __pyx_L0;
8509     goto __pyx_L3;
8510   }
8511   __pyx_L3:;
8512
8513   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":320
8514  *         return 0
8515  * 
8516  *     c_start_node = c_element             # <<<<<<<<<<<<<<
8517  *     c_del_ns_list = NULL
8518  * 
8519  */
8520   __pyx_v_c_start_node = __pyx_v_c_element;
8521
8522   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":321
8523  * 
8524  *     c_start_node = c_element
8525  *     c_del_ns_list = NULL             # <<<<<<<<<<<<<<
8526  * 
8527  *     c_ns_cache.new = NULL
8528  */
8529   __pyx_v_c_del_ns_list = NULL;
8530
8531   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":323
8532  *     c_del_ns_list = NULL
8533  * 
8534  *     c_ns_cache.new = NULL             # <<<<<<<<<<<<<<
8535  *     c_ns_cache.old = NULL
8536  *     c_ns_cache.size = 0
8537  */
8538   __pyx_v_c_ns_cache.new = NULL;
8539
8540   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":324
8541  * 
8542  *     c_ns_cache.new = NULL
8543  *     c_ns_cache.old = NULL             # <<<<<<<<<<<<<<
8544  *     c_ns_cache.size = 0
8545  *     c_ns_cache.last = 0
8546  */
8547   __pyx_v_c_ns_cache.old = NULL;
8548
8549   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":325
8550  *     c_ns_cache.new = NULL
8551  *     c_ns_cache.old = NULL
8552  *     c_ns_cache.size = 0             # <<<<<<<<<<<<<<
8553  *     c_ns_cache.last = 0
8554  * 
8555  */
8556   __pyx_v_c_ns_cache.size = 0;
8557
8558   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":326
8559  *     c_ns_cache.old = NULL
8560  *     c_ns_cache.size = 0
8561  *     c_ns_cache.last = 0             # <<<<<<<<<<<<<<
8562  * 
8563  *     tree.BEGIN_FOR_EACH_FROM(c_element, c_element, 1)
8564  */
8565   __pyx_v_c_ns_cache.last = 0;
8566
8567   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":328
8568  *     c_ns_cache.last = 0
8569  * 
8570  *     tree.BEGIN_FOR_EACH_FROM(c_element, c_element, 1)             # <<<<<<<<<<<<<<
8571  *     if tree._isElementOrXInclude(c_element):
8572  *         if c_element._private is not NULL:
8573  */
8574   BEGIN_FOR_EACH_FROM(__pyx_v_c_element, __pyx_v_c_element, 1);
8575
8576   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":329
8577  * 
8578  *     tree.BEGIN_FOR_EACH_FROM(c_element, c_element, 1)
8579  *     if tree._isElementOrXInclude(c_element):             # <<<<<<<<<<<<<<
8580  *         if c_element._private is not NULL:
8581  *             proxy_count += 1
8582  */
8583   __pyx_t_1 = _isElementOrXInclude(__pyx_v_c_element);
8584   if (__pyx_t_1) {
8585
8586     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":330
8587  *     tree.BEGIN_FOR_EACH_FROM(c_element, c_element, 1)
8588  *     if tree._isElementOrXInclude(c_element):
8589  *         if c_element._private is not NULL:             # <<<<<<<<<<<<<<
8590  *             proxy_count += 1
8591  * 
8592  */
8593     __pyx_t_1 = (__pyx_v_c_element->_private != NULL);
8594     if (__pyx_t_1) {
8595
8596       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":331
8597  *     if tree._isElementOrXInclude(c_element):
8598  *         if c_element._private is not NULL:
8599  *             proxy_count += 1             # <<<<<<<<<<<<<<
8600  * 
8601  *         # 1) cut out namespaces defined here that are already known by
8602  */
8603       __pyx_v_proxy_count += 1;
8604       goto __pyx_L5;
8605     }
8606     __pyx_L5:;
8607
8608     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":335
8609  *         # 1) cut out namespaces defined here that are already known by
8610  *         #    the ancestors
8611  *         if c_element.nsDef is not NULL:             # <<<<<<<<<<<<<<
8612  *             _stripRedundantNamespaceDeclarations(
8613  *                 c_element, &c_ns_cache, &c_del_ns_list)
8614  */
8615     __pyx_t_1 = (__pyx_v_c_element->nsDef != NULL);
8616     if (__pyx_t_1) {
8617
8618       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":337
8619  *         if c_element.nsDef is not NULL:
8620  *             _stripRedundantNamespaceDeclarations(
8621  *                 c_element, &c_ns_cache, &c_del_ns_list)             # <<<<<<<<<<<<<<
8622  * 
8623  *         # 2) make sure the namespaces of an element and its attributes
8624  */
8625       __pyx_t_2 = __pyx_f_4lxml_5etree__stripRedundantNamespaceDeclarations(__pyx_v_c_element, (&__pyx_v_c_ns_cache), (&__pyx_v_c_del_ns_list)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8626       goto __pyx_L6;
8627     }
8628     __pyx_L6:;
8629
8630     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":341
8631  *         # 2) make sure the namespaces of an element and its attributes
8632  *         #    are declared in this document (i.e. on the node or its parents)
8633  *         c_node = c_element             # <<<<<<<<<<<<<<
8634  *         while c_node is not NULL:
8635  *             if c_node.ns is not NULL:
8636  */
8637     __pyx_v_c_node = __pyx_v_c_element;
8638
8639     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":342
8640  *         #    are declared in this document (i.e. on the node or its parents)
8641  *         c_node = c_element
8642  *         while c_node is not NULL:             # <<<<<<<<<<<<<<
8643  *             if c_node.ns is not NULL:
8644  *                 for i from 0 <= i < c_ns_cache.last:
8645  */
8646     while (1) {
8647       __pyx_t_1 = (__pyx_v_c_node != NULL);
8648       if (!__pyx_t_1) break;
8649
8650       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":343
8651  *         c_node = c_element
8652  *         while c_node is not NULL:
8653  *             if c_node.ns is not NULL:             # <<<<<<<<<<<<<<
8654  *                 for i from 0 <= i < c_ns_cache.last:
8655  *                     if c_node.ns is c_ns_cache.old[i]:
8656  */
8657       __pyx_t_1 = (__pyx_v_c_node->ns != NULL);
8658       if (__pyx_t_1) {
8659
8660         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":344
8661  *         while c_node is not NULL:
8662  *             if c_node.ns is not NULL:
8663  *                 for i from 0 <= i < c_ns_cache.last:             # <<<<<<<<<<<<<<
8664  *                     if c_node.ns is c_ns_cache.old[i]:
8665  *                         c_node.ns = c_ns_cache.new[i]
8666  */
8667         __pyx_t_3 = __pyx_v_c_ns_cache.last;
8668         for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
8669
8670           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":345
8671  *             if c_node.ns is not NULL:
8672  *                 for i from 0 <= i < c_ns_cache.last:
8673  *                     if c_node.ns is c_ns_cache.old[i]:             # <<<<<<<<<<<<<<
8674  *                         c_node.ns = c_ns_cache.new[i]
8675  *                         break
8676  */
8677           __pyx_t_1 = (__pyx_v_c_node->ns == (__pyx_v_c_ns_cache.old[__pyx_v_i]));
8678           if (__pyx_t_1) {
8679
8680             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":346
8681  *                 for i from 0 <= i < c_ns_cache.last:
8682  *                     if c_node.ns is c_ns_cache.old[i]:
8683  *                         c_node.ns = c_ns_cache.new[i]             # <<<<<<<<<<<<<<
8684  *                         break
8685  *                 else:
8686  */
8687             __pyx_v_c_node->ns = (__pyx_v_c_ns_cache.new[__pyx_v_i]);
8688
8689             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":347
8690  *                     if c_node.ns is c_ns_cache.old[i]:
8691  *                         c_node.ns = c_ns_cache.new[i]
8692  *                         break             # <<<<<<<<<<<<<<
8693  *                 else:
8694  *                     # not in cache => find a replacement from this document
8695  */
8696             goto __pyx_L11_break;
8697             goto __pyx_L12;
8698           }
8699           __pyx_L12:;
8700         }
8701         /*else*/ {
8702
8703           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":351
8704  *                     # not in cache => find a replacement from this document
8705  *                     c_ns = doc._findOrBuildNodeNs(
8706  *                         c_start_node, c_node.ns.href, c_node.ns.prefix)             # <<<<<<<<<<<<<<
8707  *                     _appendToNsCache(&c_ns_cache, c_node.ns, c_ns)
8708  *                     c_node.ns = c_ns
8709  */
8710           __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_doc->__pyx_vtab)->_findOrBuildNodeNs(__pyx_v_doc, __pyx_v_c_start_node, __pyx_v_c_node->ns->href, __pyx_v_c_node->ns->prefix); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8711           __pyx_v_c_ns = __pyx_t_4;
8712
8713           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":352
8714  *                     c_ns = doc._findOrBuildNodeNs(
8715  *                         c_start_node, c_node.ns.href, c_node.ns.prefix)
8716  *                     _appendToNsCache(&c_ns_cache, c_node.ns, c_ns)             # <<<<<<<<<<<<<<
8717  *                     c_node.ns = c_ns
8718  * 
8719  */
8720           __pyx_t_2 = __pyx_f_4lxml_5etree__appendToNsCache((&__pyx_v_c_ns_cache), __pyx_v_c_node->ns, __pyx_v_c_ns); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8721
8722           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":353
8723  *                         c_start_node, c_node.ns.href, c_node.ns.prefix)
8724  *                     _appendToNsCache(&c_ns_cache, c_node.ns, c_ns)
8725  *                     c_node.ns = c_ns             # <<<<<<<<<<<<<<
8726  * 
8727  *             if c_node is c_element:
8728  */
8729           __pyx_v_c_node->ns = __pyx_v_c_ns;
8730         }
8731         __pyx_L11_break:;
8732         goto __pyx_L9;
8733       }
8734       __pyx_L9:;
8735
8736       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":355
8737  *                     c_node.ns = c_ns
8738  * 
8739  *             if c_node is c_element:             # <<<<<<<<<<<<<<
8740  *                 # after the element, continue with its attributes
8741  *                 c_node = <xmlNode*>c_element.properties
8742  */
8743       __pyx_t_1 = (__pyx_v_c_node == __pyx_v_c_element);
8744       if (__pyx_t_1) {
8745
8746         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":357
8747  *             if c_node is c_element:
8748  *                 # after the element, continue with its attributes
8749  *                 c_node = <xmlNode*>c_element.properties             # <<<<<<<<<<<<<<
8750  *             else:
8751  *                 c_node = c_node.next
8752  */
8753         __pyx_v_c_node = ((xmlNode *)__pyx_v_c_element->properties);
8754         goto __pyx_L13;
8755       }
8756       /*else*/ {
8757
8758         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":359
8759  *                 c_node = <xmlNode*>c_element.properties
8760  *             else:
8761  *                 c_node = c_node.next             # <<<<<<<<<<<<<<
8762  *     tree.END_FOR_EACH_FROM(c_element)
8763  * 
8764  */
8765         __pyx_v_c_node = __pyx_v_c_node->next;
8766       }
8767       __pyx_L13:;
8768     }
8769     goto __pyx_L4;
8770   }
8771   __pyx_L4:;
8772
8773   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":360
8774  *             else:
8775  *                 c_node = c_node.next
8776  *     tree.END_FOR_EACH_FROM(c_element)             # <<<<<<<<<<<<<<
8777  * 
8778  *     # free now unused namespace declarations
8779  */
8780   END_FOR_EACH_FROM(__pyx_v_c_element);
8781
8782   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":363
8783  * 
8784  *     # free now unused namespace declarations
8785  *     if c_del_ns_list is not NULL:             # <<<<<<<<<<<<<<
8786  *         tree.xmlFreeNsList(c_del_ns_list)
8787  * 
8788  */
8789   __pyx_t_1 = (__pyx_v_c_del_ns_list != NULL);
8790   if (__pyx_t_1) {
8791
8792     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":364
8793  *     # free now unused namespace declarations
8794  *     if c_del_ns_list is not NULL:
8795  *         tree.xmlFreeNsList(c_del_ns_list)             # <<<<<<<<<<<<<<
8796  * 
8797  *     # cleanup
8798  */
8799     xmlFreeNsList(__pyx_v_c_del_ns_list);
8800     goto __pyx_L14;
8801   }
8802   __pyx_L14:;
8803
8804   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":367
8805  * 
8806  *     # cleanup
8807  *     if c_ns_cache.new is not NULL:             # <<<<<<<<<<<<<<
8808  *         cstd.free(c_ns_cache.new)
8809  *     if c_ns_cache.old is not NULL:
8810  */
8811   __pyx_t_1 = (__pyx_v_c_ns_cache.new != NULL);
8812   if (__pyx_t_1) {
8813
8814     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":368
8815  *     # cleanup
8816  *     if c_ns_cache.new is not NULL:
8817  *         cstd.free(c_ns_cache.new)             # <<<<<<<<<<<<<<
8818  *     if c_ns_cache.old is not NULL:
8819  *         cstd.free(c_ns_cache.old)
8820  */
8821     free(__pyx_v_c_ns_cache.new);
8822     goto __pyx_L15;
8823   }
8824   __pyx_L15:;
8825
8826   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":369
8827  *     if c_ns_cache.new is not NULL:
8828  *         cstd.free(c_ns_cache.new)
8829  *     if c_ns_cache.old is not NULL:             # <<<<<<<<<<<<<<
8830  *         cstd.free(c_ns_cache.old)
8831  * 
8832  */
8833   __pyx_t_1 = (__pyx_v_c_ns_cache.old != NULL);
8834   if (__pyx_t_1) {
8835
8836     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":370
8837  *         cstd.free(c_ns_cache.new)
8838  *     if c_ns_cache.old is not NULL:
8839  *         cstd.free(c_ns_cache.old)             # <<<<<<<<<<<<<<
8840  * 
8841  *     # 3) fix the names in the tree if we moved it from a different thread
8842  */
8843     free(__pyx_v_c_ns_cache.old);
8844     goto __pyx_L16;
8845   }
8846   __pyx_L16:;
8847
8848   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":373
8849  * 
8850  *     # 3) fix the names in the tree if we moved it from a different thread
8851  *     if doc._c_doc.dict is not c_source_doc.dict:             # <<<<<<<<<<<<<<
8852  *         fixThreadDictNames(c_start_node, c_source_doc.dict, doc._c_doc.dict)
8853  * 
8854  */
8855   __pyx_t_1 = (__pyx_v_doc->_c_doc->dict != __pyx_v_c_source_doc->dict);
8856   if (__pyx_t_1) {
8857
8858     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":374
8859  *     # 3) fix the names in the tree if we moved it from a different thread
8860  *     if doc._c_doc.dict is not c_source_doc.dict:
8861  *         fixThreadDictNames(c_start_node, c_source_doc.dict, doc._c_doc.dict)             # <<<<<<<<<<<<<<
8862  * 
8863  *     # 4) fix _Document references
8864  */
8865     __pyx_f_4lxml_5etree_fixThreadDictNames(__pyx_v_c_start_node, __pyx_v_c_source_doc->dict, __pyx_v_doc->_c_doc->dict);
8866     goto __pyx_L17;
8867   }
8868   __pyx_L17:;
8869
8870   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":378
8871  *     # 4) fix _Document references
8872  *     #    (and potentially deallocate the source document)
8873  *     if proxy_count > 0:             # <<<<<<<<<<<<<<
8874  *         if proxy_count == 1 and c_start_node._private is not NULL:
8875  *             _updateProxyDocument(c_start_node, doc)
8876  */
8877   __pyx_t_1 = (__pyx_v_proxy_count > 0);
8878   if (__pyx_t_1) {
8879
8880     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":379
8881  *     #    (and potentially deallocate the source document)
8882  *     if proxy_count > 0:
8883  *         if proxy_count == 1 and c_start_node._private is not NULL:             # <<<<<<<<<<<<<<
8884  *             _updateProxyDocument(c_start_node, doc)
8885  *         else:
8886  */
8887     if ((__pyx_v_proxy_count == 1)) {
8888       __pyx_t_1 = (__pyx_v_c_start_node->_private != NULL);
8889     } else {
8890       __pyx_t_1 = (__pyx_v_proxy_count == 1);
8891     }
8892     if (__pyx_t_1) {
8893
8894       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":380
8895  *     if proxy_count > 0:
8896  *         if proxy_count == 1 and c_start_node._private is not NULL:
8897  *             _updateProxyDocument(c_start_node, doc)             # <<<<<<<<<<<<<<
8898  *         else:
8899  *             fixElementDocument(c_start_node, doc, proxy_count)
8900  */
8901       __pyx_f_4lxml_5etree__updateProxyDocument(__pyx_v_c_start_node, __pyx_v_doc);
8902       goto __pyx_L19;
8903     }
8904     /*else*/ {
8905
8906       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":382
8907  *             _updateProxyDocument(c_start_node, doc)
8908  *         else:
8909  *             fixElementDocument(c_start_node, doc, proxy_count)             # <<<<<<<<<<<<<<
8910  * 
8911  *     return 0
8912  */
8913       __pyx_f_4lxml_5etree_fixElementDocument(__pyx_v_c_start_node, __pyx_v_doc, __pyx_v_proxy_count);
8914     }
8915     __pyx_L19:;
8916     goto __pyx_L18;
8917   }
8918   __pyx_L18:;
8919
8920   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":384
8921  *             fixElementDocument(c_start_node, doc, proxy_count)
8922  * 
8923  *     return 0             # <<<<<<<<<<<<<<
8924  * 
8925  * 
8926  */
8927   __pyx_r = 0;
8928   goto __pyx_L0;
8929
8930   __pyx_r = 0;
8931   goto __pyx_L0;
8932   __pyx_L1_error:;
8933   __Pyx_AddTraceback("lxml.etree.moveNodeToDocument");
8934   __pyx_r = -1;
8935   __pyx_L0:;
8936   __Pyx_FinishRefcountContext();
8937   return __pyx_r;
8938 }
8939
8940 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":387
8941  * 
8942  * 
8943  * cdef void fixElementDocument(xmlNode* c_element, _Document doc,             # <<<<<<<<<<<<<<
8944  *                              size_t proxy_count):
8945  *     cdef xmlNode* c_node = c_element
8946  */
8947
8948 static  void __pyx_f_4lxml_5etree_fixElementDocument(xmlNode *__pyx_v_c_element, struct LxmlDocument *__pyx_v_doc, size_t __pyx_v_proxy_count) {
8949   xmlNode *__pyx_v_c_node;
8950   int __pyx_t_1;
8951   __Pyx_SetupRefcountContext("fixElementDocument");
8952
8953   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":389
8954  * cdef void fixElementDocument(xmlNode* c_element, _Document doc,
8955  *                              size_t proxy_count):
8956  *     cdef xmlNode* c_node = c_element             # <<<<<<<<<<<<<<
8957  *     tree.BEGIN_FOR_EACH_FROM(c_element, c_node, 1)
8958  *     if c_node._private is not NULL:
8959  */
8960   __pyx_v_c_node = __pyx_v_c_element;
8961
8962   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":390
8963  *                              size_t proxy_count):
8964  *     cdef xmlNode* c_node = c_element
8965  *     tree.BEGIN_FOR_EACH_FROM(c_element, c_node, 1)             # <<<<<<<<<<<<<<
8966  *     if c_node._private is not NULL:
8967  *         _updateProxyDocument(c_node, doc)
8968  */
8969   BEGIN_FOR_EACH_FROM(__pyx_v_c_element, __pyx_v_c_node, 1);
8970
8971   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":391
8972  *     cdef xmlNode* c_node = c_element
8973  *     tree.BEGIN_FOR_EACH_FROM(c_element, c_node, 1)
8974  *     if c_node._private is not NULL:             # <<<<<<<<<<<<<<
8975  *         _updateProxyDocument(c_node, doc)
8976  *         proxy_count -= 1
8977  */
8978   __pyx_t_1 = (__pyx_v_c_node->_private != NULL);
8979   if (__pyx_t_1) {
8980
8981     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":392
8982  *     tree.BEGIN_FOR_EACH_FROM(c_element, c_node, 1)
8983  *     if c_node._private is not NULL:
8984  *         _updateProxyDocument(c_node, doc)             # <<<<<<<<<<<<<<
8985  *         proxy_count -= 1
8986  *         if proxy_count == 0:
8987  */
8988     __pyx_f_4lxml_5etree__updateProxyDocument(__pyx_v_c_node, __pyx_v_doc);
8989
8990     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":393
8991  *     if c_node._private is not NULL:
8992  *         _updateProxyDocument(c_node, doc)
8993  *         proxy_count -= 1             # <<<<<<<<<<<<<<
8994  *         if proxy_count == 0:
8995  *             return
8996  */
8997     __pyx_v_proxy_count -= 1;
8998
8999     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":394
9000  *         _updateProxyDocument(c_node, doc)
9001  *         proxy_count -= 1
9002  *         if proxy_count == 0:             # <<<<<<<<<<<<<<
9003  *             return
9004  *     tree.END_FOR_EACH_FROM(c_node)
9005  */
9006     __pyx_t_1 = (__pyx_v_proxy_count == 0);
9007     if (__pyx_t_1) {
9008
9009       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":395
9010  *         proxy_count -= 1
9011  *         if proxy_count == 0:
9012  *             return             # <<<<<<<<<<<<<<
9013  *     tree.END_FOR_EACH_FROM(c_node)
9014  * 
9015  */
9016       goto __pyx_L0;
9017       goto __pyx_L4;
9018     }
9019     __pyx_L4:;
9020     goto __pyx_L3;
9021   }
9022   __pyx_L3:;
9023
9024   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":396
9025  *         if proxy_count == 0:
9026  *             return
9027  *     tree.END_FOR_EACH_FROM(c_node)             # <<<<<<<<<<<<<<
9028  * 
9029  * cdef void fixThreadDictNames(xmlNode* c_element,
9030  */
9031   END_FOR_EACH_FROM(__pyx_v_c_node);
9032
9033   __pyx_L0:;
9034   __Pyx_FinishRefcountContext();
9035 }
9036
9037 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":398
9038  *     tree.END_FOR_EACH_FROM(c_node)
9039  * 
9040  * cdef void fixThreadDictNames(xmlNode* c_element,             # <<<<<<<<<<<<<<
9041  *                              tree.xmlDict* c_src_dict,
9042  *                              tree.xmlDict* c_dict) nogil:
9043  */
9044
9045 static  void __pyx_f_4lxml_5etree_fixThreadDictNames(xmlNode *__pyx_v_c_element, xmlDict *__pyx_v_c_src_dict, xmlDict *__pyx_v_c_dict) {
9046   int __pyx_t_1;
9047
9048   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":405
9049  *     # this should only be called when the element is based on a
9050  *     # different libxml2 tag name dictionary
9051  *     if c_element.type == tree.XML_DOCUMENT_NODE or \             # <<<<<<<<<<<<<<
9052  *             c_element.type == tree.XML_HTML_DOCUMENT_NODE:
9053  *         # may define "xml" namespace
9054  */
9055   if (!(__pyx_v_c_element->type == XML_DOCUMENT_NODE)) {
9056
9057     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":406
9058  *     # different libxml2 tag name dictionary
9059  *     if c_element.type == tree.XML_DOCUMENT_NODE or \
9060  *             c_element.type == tree.XML_HTML_DOCUMENT_NODE:             # <<<<<<<<<<<<<<
9061  *         # may define "xml" namespace
9062  *         fixThreadDictNsForNode(c_element, c_src_dict, c_dict)
9063  */
9064     __pyx_t_1 = (__pyx_v_c_element->type == XML_HTML_DOCUMENT_NODE);
9065   } else {
9066     __pyx_t_1 = (__pyx_v_c_element->type == XML_DOCUMENT_NODE);
9067   }
9068   if (__pyx_t_1) {
9069
9070     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":408
9071  *             c_element.type == tree.XML_HTML_DOCUMENT_NODE:
9072  *         # may define "xml" namespace
9073  *         fixThreadDictNsForNode(c_element, c_src_dict, c_dict)             # <<<<<<<<<<<<<<
9074  *         c_element = c_element.children
9075  *         while c_element is not NULL:
9076  */
9077     __pyx_f_4lxml_5etree_fixThreadDictNsForNode(__pyx_v_c_element, __pyx_v_c_src_dict, __pyx_v_c_dict);
9078
9079     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":409
9080  *         # may define "xml" namespace
9081  *         fixThreadDictNsForNode(c_element, c_src_dict, c_dict)
9082  *         c_element = c_element.children             # <<<<<<<<<<<<<<
9083  *         while c_element is not NULL:
9084  *             if tree._isElementOrXInclude(c_element):
9085  */
9086     __pyx_v_c_element = __pyx_v_c_element->children;
9087
9088     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":410
9089  *         fixThreadDictNsForNode(c_element, c_src_dict, c_dict)
9090  *         c_element = c_element.children
9091  *         while c_element is not NULL:             # <<<<<<<<<<<<<<
9092  *             if tree._isElementOrXInclude(c_element):
9093  *                 fixThreadDictNamesForNode(c_element, c_src_dict, c_dict)
9094  */
9095     while (1) {
9096       __pyx_t_1 = (__pyx_v_c_element != NULL);
9097       if (!__pyx_t_1) break;
9098
9099       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":411
9100  *         c_element = c_element.children
9101  *         while c_element is not NULL:
9102  *             if tree._isElementOrXInclude(c_element):             # <<<<<<<<<<<<<<
9103  *                 fixThreadDictNamesForNode(c_element, c_src_dict, c_dict)
9104  *             c_element = c_element.next
9105  */
9106       __pyx_t_1 = _isElementOrXInclude(__pyx_v_c_element);
9107       if (__pyx_t_1) {
9108
9109         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":412
9110  *         while c_element is not NULL:
9111  *             if tree._isElementOrXInclude(c_element):
9112  *                 fixThreadDictNamesForNode(c_element, c_src_dict, c_dict)             # <<<<<<<<<<<<<<
9113  *             c_element = c_element.next
9114  *     elif tree._isElementOrXInclude(c_element):
9115  */
9116         __pyx_f_4lxml_5etree_fixThreadDictNamesForNode(__pyx_v_c_element, __pyx_v_c_src_dict, __pyx_v_c_dict);
9117         goto __pyx_L6;
9118       }
9119       __pyx_L6:;
9120
9121       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":413
9122  *             if tree._isElementOrXInclude(c_element):
9123  *                 fixThreadDictNamesForNode(c_element, c_src_dict, c_dict)
9124  *             c_element = c_element.next             # <<<<<<<<<<<<<<
9125  *     elif tree._isElementOrXInclude(c_element):
9126  *         fixThreadDictNamesForNode(c_element, c_src_dict, c_dict)
9127  */
9128       __pyx_v_c_element = __pyx_v_c_element->next;
9129     }
9130     goto __pyx_L3;
9131   }
9132
9133   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":414
9134  *                 fixThreadDictNamesForNode(c_element, c_src_dict, c_dict)
9135  *             c_element = c_element.next
9136  *     elif tree._isElementOrXInclude(c_element):             # <<<<<<<<<<<<<<
9137  *         fixThreadDictNamesForNode(c_element, c_src_dict, c_dict)
9138  * 
9139  */
9140   __pyx_t_1 = _isElementOrXInclude(__pyx_v_c_element);
9141   if (__pyx_t_1) {
9142
9143     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":415
9144  *             c_element = c_element.next
9145  *     elif tree._isElementOrXInclude(c_element):
9146  *         fixThreadDictNamesForNode(c_element, c_src_dict, c_dict)             # <<<<<<<<<<<<<<
9147  * 
9148  * cdef void fixThreadDictNamesForNode(xmlNode* c_element,
9149  */
9150     __pyx_f_4lxml_5etree_fixThreadDictNamesForNode(__pyx_v_c_element, __pyx_v_c_src_dict, __pyx_v_c_dict);
9151     goto __pyx_L3;
9152   }
9153   __pyx_L3:;
9154
9155 }
9156
9157 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":417
9158  *         fixThreadDictNamesForNode(c_element, c_src_dict, c_dict)
9159  * 
9160  * cdef void fixThreadDictNamesForNode(xmlNode* c_element,             # <<<<<<<<<<<<<<
9161  *                                     tree.xmlDict* c_src_dict,
9162  *                                     tree.xmlDict* c_dict) nogil:
9163  */
9164
9165 static  void __pyx_f_4lxml_5etree_fixThreadDictNamesForNode(xmlNode *__pyx_v_c_element, xmlDict *__pyx_v_c_src_dict, xmlDict *__pyx_v_c_dict) {
9166   xmlNode *__pyx_v_c_node;
9167   int __pyx_t_1;
9168
9169   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":420
9170  *                                     tree.xmlDict* c_src_dict,
9171  *                                     tree.xmlDict* c_dict) nogil:
9172  *     cdef xmlNode* c_node = c_element             # <<<<<<<<<<<<<<
9173  *     tree.BEGIN_FOR_EACH_FROM(c_element, c_node, 1)
9174  *     if c_node.name is not NULL:
9175  */
9176   __pyx_v_c_node = __pyx_v_c_element;
9177
9178   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":421
9179  *                                     tree.xmlDict* c_dict) nogil:
9180  *     cdef xmlNode* c_node = c_element
9181  *     tree.BEGIN_FOR_EACH_FROM(c_element, c_node, 1)             # <<<<<<<<<<<<<<
9182  *     if c_node.name is not NULL:
9183  *         fixThreadDictNameForNode(c_node, c_src_dict, c_dict)
9184  */
9185   BEGIN_FOR_EACH_FROM(__pyx_v_c_element, __pyx_v_c_node, 1);
9186
9187   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":422
9188  *     cdef xmlNode* c_node = c_element
9189  *     tree.BEGIN_FOR_EACH_FROM(c_element, c_node, 1)
9190  *     if c_node.name is not NULL:             # <<<<<<<<<<<<<<
9191  *         fixThreadDictNameForNode(c_node, c_src_dict, c_dict)
9192  *     if c_node.type == tree.XML_ELEMENT_NODE:
9193  */
9194   __pyx_t_1 = (__pyx_v_c_node->name != NULL);
9195   if (__pyx_t_1) {
9196
9197     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":423
9198  *     tree.BEGIN_FOR_EACH_FROM(c_element, c_node, 1)
9199  *     if c_node.name is not NULL:
9200  *         fixThreadDictNameForNode(c_node, c_src_dict, c_dict)             # <<<<<<<<<<<<<<
9201  *     if c_node.type == tree.XML_ELEMENT_NODE:
9202  *         fixThreadDictNamesForAttributes(
9203  */
9204     __pyx_f_4lxml_5etree_fixThreadDictNameForNode(__pyx_v_c_node, __pyx_v_c_src_dict, __pyx_v_c_dict);
9205     goto __pyx_L3;
9206   }
9207   __pyx_L3:;
9208
9209   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":424
9210  *     if c_node.name is not NULL:
9211  *         fixThreadDictNameForNode(c_node, c_src_dict, c_dict)
9212  *     if c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
9213  *         fixThreadDictNamesForAttributes(
9214  *             c_node.properties, c_src_dict, c_dict)
9215  */
9216   __pyx_t_1 = (__pyx_v_c_node->type == XML_ELEMENT_NODE);
9217   if (__pyx_t_1) {
9218
9219     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":426
9220  *     if c_node.type == tree.XML_ELEMENT_NODE:
9221  *         fixThreadDictNamesForAttributes(
9222  *             c_node.properties, c_src_dict, c_dict)             # <<<<<<<<<<<<<<
9223  *     elif c_node.type == tree.XML_TEXT_NODE:
9224  *         # libxml2's SAX2 parser interns some indentation space
9225  */
9226     __pyx_f_4lxml_5etree_fixThreadDictNamesForAttributes(__pyx_v_c_node->properties, __pyx_v_c_src_dict, __pyx_v_c_dict);
9227     goto __pyx_L4;
9228   }
9229
9230   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":427
9231  *         fixThreadDictNamesForAttributes(
9232  *             c_node.properties, c_src_dict, c_dict)
9233  *     elif c_node.type == tree.XML_TEXT_NODE:             # <<<<<<<<<<<<<<
9234  *         # libxml2's SAX2 parser interns some indentation space
9235  *         fixThreadDictContentForNode(c_node, c_src_dict, c_dict)
9236  */
9237   __pyx_t_1 = (__pyx_v_c_node->type == XML_TEXT_NODE);
9238   if (__pyx_t_1) {
9239
9240     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":429
9241  *     elif c_node.type == tree.XML_TEXT_NODE:
9242  *         # libxml2's SAX2 parser interns some indentation space
9243  *         fixThreadDictContentForNode(c_node, c_src_dict, c_dict)             # <<<<<<<<<<<<<<
9244  *     tree.END_FOR_EACH_FROM(c_node)
9245  * 
9246  */
9247     __pyx_f_4lxml_5etree_fixThreadDictContentForNode(__pyx_v_c_node, __pyx_v_c_src_dict, __pyx_v_c_dict);
9248     goto __pyx_L4;
9249   }
9250   __pyx_L4:;
9251
9252   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":430
9253  *         # libxml2's SAX2 parser interns some indentation space
9254  *         fixThreadDictContentForNode(c_node, c_src_dict, c_dict)
9255  *     tree.END_FOR_EACH_FROM(c_node)             # <<<<<<<<<<<<<<
9256  * 
9257  * cdef inline void fixThreadDictNamesForAttributes(tree.xmlAttr* c_attr,
9258  */
9259   END_FOR_EACH_FROM(__pyx_v_c_node);
9260
9261 }
9262
9263 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":432
9264  *     tree.END_FOR_EACH_FROM(c_node)
9265  * 
9266  * cdef inline void fixThreadDictNamesForAttributes(tree.xmlAttr* c_attr,             # <<<<<<<<<<<<<<
9267  *                                                  tree.xmlDict* c_src_dict,
9268  *                                                  tree.xmlDict* c_dict) nogil:
9269  */
9270
9271 static INLINE void __pyx_f_4lxml_5etree_fixThreadDictNamesForAttributes(xmlAttr *__pyx_v_c_attr, xmlDict *__pyx_v_c_src_dict, xmlDict *__pyx_v_c_dict) {
9272   xmlNode *__pyx_v_c_child;
9273   xmlNode *__pyx_v_c_node;
9274   int __pyx_t_1;
9275
9276   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":436
9277  *                                                  tree.xmlDict* c_dict) nogil:
9278  *     cdef xmlNode* c_child
9279  *     cdef xmlNode* c_node = <xmlNode*>c_attr             # <<<<<<<<<<<<<<
9280  *     while c_node is not NULL:
9281  *         fixThreadDictNameForNode(c_node, c_src_dict, c_dict)
9282  */
9283   __pyx_v_c_node = ((xmlNode *)__pyx_v_c_attr);
9284
9285   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":437
9286  *     cdef xmlNode* c_child
9287  *     cdef xmlNode* c_node = <xmlNode*>c_attr
9288  *     while c_node is not NULL:             # <<<<<<<<<<<<<<
9289  *         fixThreadDictNameForNode(c_node, c_src_dict, c_dict)
9290  *         # libxml2 keeps some (!) attribute values in the dict
9291  */
9292   while (1) {
9293     __pyx_t_1 = (__pyx_v_c_node != NULL);
9294     if (!__pyx_t_1) break;
9295
9296     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":438
9297  *     cdef xmlNode* c_node = <xmlNode*>c_attr
9298  *     while c_node is not NULL:
9299  *         fixThreadDictNameForNode(c_node, c_src_dict, c_dict)             # <<<<<<<<<<<<<<
9300  *         # libxml2 keeps some (!) attribute values in the dict
9301  *         c_child = c_node.children
9302  */
9303     __pyx_f_4lxml_5etree_fixThreadDictNameForNode(__pyx_v_c_node, __pyx_v_c_src_dict, __pyx_v_c_dict);
9304
9305     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":440
9306  *         fixThreadDictNameForNode(c_node, c_src_dict, c_dict)
9307  *         # libxml2 keeps some (!) attribute values in the dict
9308  *         c_child = c_node.children             # <<<<<<<<<<<<<<
9309  *         while c_child is not NULL:
9310  *             fixThreadDictContentForNode(c_child, c_src_dict, c_dict)
9311  */
9312     __pyx_v_c_child = __pyx_v_c_node->children;
9313
9314     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":441
9315  *         # libxml2 keeps some (!) attribute values in the dict
9316  *         c_child = c_node.children
9317  *         while c_child is not NULL:             # <<<<<<<<<<<<<<
9318  *             fixThreadDictContentForNode(c_child, c_src_dict, c_dict)
9319  *             c_child = c_child.next
9320  */
9321     while (1) {
9322       __pyx_t_1 = (__pyx_v_c_child != NULL);
9323       if (!__pyx_t_1) break;
9324
9325       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":442
9326  *         c_child = c_node.children
9327  *         while c_child is not NULL:
9328  *             fixThreadDictContentForNode(c_child, c_src_dict, c_dict)             # <<<<<<<<<<<<<<
9329  *             c_child = c_child.next
9330  *         c_node = c_node.next
9331  */
9332       __pyx_f_4lxml_5etree_fixThreadDictContentForNode(__pyx_v_c_child, __pyx_v_c_src_dict, __pyx_v_c_dict);
9333
9334       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":443
9335  *         while c_child is not NULL:
9336  *             fixThreadDictContentForNode(c_child, c_src_dict, c_dict)
9337  *             c_child = c_child.next             # <<<<<<<<<<<<<<
9338  *         c_node = c_node.next
9339  * 
9340  */
9341       __pyx_v_c_child = __pyx_v_c_child->next;
9342     }
9343
9344     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":444
9345  *             fixThreadDictContentForNode(c_child, c_src_dict, c_dict)
9346  *             c_child = c_child.next
9347  *         c_node = c_node.next             # <<<<<<<<<<<<<<
9348  * 
9349  * cdef inline void fixThreadDictNameForNode(xmlNode* c_node,
9350  */
9351     __pyx_v_c_node = __pyx_v_c_node->next;
9352   }
9353
9354 }
9355
9356 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":446
9357  *         c_node = c_node.next
9358  * 
9359  * cdef inline void fixThreadDictNameForNode(xmlNode* c_node,             # <<<<<<<<<<<<<<
9360  *                                           tree.xmlDict* c_src_dict,
9361  *                                           tree.xmlDict* c_dict) nogil:
9362  */
9363
9364 static INLINE void __pyx_f_4lxml_5etree_fixThreadDictNameForNode(xmlNode *__pyx_v_c_node, xmlDict *__pyx_v_c_src_dict, xmlDict *__pyx_v_c_dict) {
9365   char *__pyx_v_c_name;
9366   int __pyx_t_1;
9367   int __pyx_t_2;
9368   int __pyx_t_3;
9369
9370   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":449
9371  *                                           tree.xmlDict* c_src_dict,
9372  *                                           tree.xmlDict* c_dict) nogil:
9373  *     cdef char* c_name = c_node.name             # <<<<<<<<<<<<<<
9374  *     if c_name is not NULL and \
9375  *            c_node.type != tree.XML_TEXT_NODE and \
9376  */
9377   __pyx_v_c_name = __pyx_v_c_node->name;
9378
9379   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":450
9380  *                                           tree.xmlDict* c_dict) nogil:
9381  *     cdef char* c_name = c_node.name
9382  *     if c_name is not NULL and \             # <<<<<<<<<<<<<<
9383  *            c_node.type != tree.XML_TEXT_NODE and \
9384  *            c_node.type != tree.XML_COMMENT_NODE:
9385  */
9386   if ((__pyx_v_c_name != NULL)) {
9387
9388     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":451
9389  *     cdef char* c_name = c_node.name
9390  *     if c_name is not NULL and \
9391  *            c_node.type != tree.XML_TEXT_NODE and \             # <<<<<<<<<<<<<<
9392  *            c_node.type != tree.XML_COMMENT_NODE:
9393  *         if tree.xmlDictOwns(c_src_dict, c_node.name):
9394  */
9395     if ((__pyx_v_c_node->type != XML_TEXT_NODE)) {
9396
9397       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":452
9398  *     if c_name is not NULL and \
9399  *            c_node.type != tree.XML_TEXT_NODE and \
9400  *            c_node.type != tree.XML_COMMENT_NODE:             # <<<<<<<<<<<<<<
9401  *         if tree.xmlDictOwns(c_src_dict, c_node.name):
9402  *             # c_name can be NULL on memory error, but we don't handle that here
9403  */
9404       __pyx_t_1 = (__pyx_v_c_node->type != XML_COMMENT_NODE);
9405     } else {
9406       __pyx_t_1 = (__pyx_v_c_node->type != XML_TEXT_NODE);
9407     }
9408     __pyx_t_2 = __pyx_t_1;
9409   } else {
9410     __pyx_t_2 = (__pyx_v_c_name != NULL);
9411   }
9412   if (__pyx_t_2) {
9413
9414     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":453
9415  *            c_node.type != tree.XML_TEXT_NODE and \
9416  *            c_node.type != tree.XML_COMMENT_NODE:
9417  *         if tree.xmlDictOwns(c_src_dict, c_node.name):             # <<<<<<<<<<<<<<
9418  *             # c_name can be NULL on memory error, but we don't handle that here
9419  *             c_name = tree.xmlDictLookup(c_dict, c_name, -1)
9420  */
9421     __pyx_t_3 = xmlDictOwns(__pyx_v_c_src_dict, __pyx_v_c_node->name);
9422     if (__pyx_t_3) {
9423
9424       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":455
9425  *         if tree.xmlDictOwns(c_src_dict, c_node.name):
9426  *             # c_name can be NULL on memory error, but we don't handle that here
9427  *             c_name = tree.xmlDictLookup(c_dict, c_name, -1)             # <<<<<<<<<<<<<<
9428  *             if c_name is not NULL:
9429  *                 c_node.name = c_name
9430  */
9431       __pyx_v_c_name = xmlDictLookup(__pyx_v_c_dict, __pyx_v_c_name, -1);
9432
9433       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":456
9434  *             # c_name can be NULL on memory error, but we don't handle that here
9435  *             c_name = tree.xmlDictLookup(c_dict, c_name, -1)
9436  *             if c_name is not NULL:             # <<<<<<<<<<<<<<
9437  *                 c_node.name = c_name
9438  * 
9439  */
9440       __pyx_t_2 = (__pyx_v_c_name != NULL);
9441       if (__pyx_t_2) {
9442
9443         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":457
9444  *             c_name = tree.xmlDictLookup(c_dict, c_name, -1)
9445  *             if c_name is not NULL:
9446  *                 c_node.name = c_name             # <<<<<<<<<<<<<<
9447  * 
9448  * cdef inline void fixThreadDictContentForNode(xmlNode* c_node,
9449  */
9450         __pyx_v_c_node->name = __pyx_v_c_name;
9451         goto __pyx_L5;
9452       }
9453       __pyx_L5:;
9454       goto __pyx_L4;
9455     }
9456     __pyx_L4:;
9457     goto __pyx_L3;
9458   }
9459   __pyx_L3:;
9460
9461 }
9462
9463 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":459
9464  *                 c_node.name = c_name
9465  * 
9466  * cdef inline void fixThreadDictContentForNode(xmlNode* c_node,             # <<<<<<<<<<<<<<
9467  *                                              tree.xmlDict* c_src_dict,
9468  *                                              tree.xmlDict* c_dict) nogil:
9469  */
9470
9471 static INLINE void __pyx_f_4lxml_5etree_fixThreadDictContentForNode(xmlNode *__pyx_v_c_node, xmlDict *__pyx_v_c_src_dict, xmlDict *__pyx_v_c_dict) {
9472   int __pyx_t_1;
9473   int __pyx_t_2;
9474
9475   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":462
9476  *                                              tree.xmlDict* c_src_dict,
9477  *                                              tree.xmlDict* c_dict) nogil:
9478  *     if c_node.content is not NULL and \             # <<<<<<<<<<<<<<
9479  *            c_node.content is not <char*>&c_node.properties:
9480  *         if tree.xmlDictOwns(c_src_dict, c_node.content):
9481  */
9482   if ((__pyx_v_c_node->content != NULL)) {
9483
9484     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":463
9485  *                                              tree.xmlDict* c_dict) nogil:
9486  *     if c_node.content is not NULL and \
9487  *            c_node.content is not <char*>&c_node.properties:             # <<<<<<<<<<<<<<
9488  *         if tree.xmlDictOwns(c_src_dict, c_node.content):
9489  *             # result can be NULL on memory error, but we don't handle that here
9490  */
9491     __pyx_t_1 = (__pyx_v_c_node->content != ((char *)(&__pyx_v_c_node->properties)));
9492   } else {
9493     __pyx_t_1 = (__pyx_v_c_node->content != NULL);
9494   }
9495   if (__pyx_t_1) {
9496
9497     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":464
9498  *     if c_node.content is not NULL and \
9499  *            c_node.content is not <char*>&c_node.properties:
9500  *         if tree.xmlDictOwns(c_src_dict, c_node.content):             # <<<<<<<<<<<<<<
9501  *             # result can be NULL on memory error, but we don't handle that here
9502  *             c_node.content = tree.xmlDictLookup(c_dict, c_node.content, -1)
9503  */
9504     __pyx_t_2 = xmlDictOwns(__pyx_v_c_src_dict, __pyx_v_c_node->content);
9505     if (__pyx_t_2) {
9506
9507       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":466
9508  *         if tree.xmlDictOwns(c_src_dict, c_node.content):
9509  *             # result can be NULL on memory error, but we don't handle that here
9510  *             c_node.content = tree.xmlDictLookup(c_dict, c_node.content, -1)             # <<<<<<<<<<<<<<
9511  * 
9512  * cdef inline void fixThreadDictNsForNode(xmlNode* c_node,
9513  */
9514       __pyx_v_c_node->content = xmlDictLookup(__pyx_v_c_dict, __pyx_v_c_node->content, -1);
9515       goto __pyx_L4;
9516     }
9517     __pyx_L4:;
9518     goto __pyx_L3;
9519   }
9520   __pyx_L3:;
9521
9522 }
9523
9524 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":468
9525  *             c_node.content = tree.xmlDictLookup(c_dict, c_node.content, -1)
9526  * 
9527  * cdef inline void fixThreadDictNsForNode(xmlNode* c_node,             # <<<<<<<<<<<<<<
9528  *                                         tree.xmlDict* c_src_dict,
9529  *                                         tree.xmlDict* c_dict) nogil:
9530  */
9531
9532 static INLINE void __pyx_f_4lxml_5etree_fixThreadDictNsForNode(xmlNode *__pyx_v_c_node, xmlDict *__pyx_v_c_src_dict, xmlDict *__pyx_v_c_dict) {
9533   xmlNs *__pyx_v_c_ns;
9534   int __pyx_t_1;
9535   int __pyx_t_2;
9536
9537   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":471
9538  *                                         tree.xmlDict* c_src_dict,
9539  *                                         tree.xmlDict* c_dict) nogil:
9540  *     cdef xmlNs* c_ns = c_node.nsDef             # <<<<<<<<<<<<<<
9541  *     while c_ns is not NULL:
9542  *         if c_ns.href is not NULL:
9543  */
9544   __pyx_v_c_ns = __pyx_v_c_node->nsDef;
9545
9546   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":472
9547  *                                         tree.xmlDict* c_dict) nogil:
9548  *     cdef xmlNs* c_ns = c_node.nsDef
9549  *     while c_ns is not NULL:             # <<<<<<<<<<<<<<
9550  *         if c_ns.href is not NULL:
9551  *             if tree.xmlDictOwns(c_src_dict, c_ns.href):
9552  */
9553   while (1) {
9554     __pyx_t_1 = (__pyx_v_c_ns != NULL);
9555     if (!__pyx_t_1) break;
9556
9557     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":473
9558  *     cdef xmlNs* c_ns = c_node.nsDef
9559  *     while c_ns is not NULL:
9560  *         if c_ns.href is not NULL:             # <<<<<<<<<<<<<<
9561  *             if tree.xmlDictOwns(c_src_dict, c_ns.href):
9562  *                 c_ns.href = tree.xmlDictLookup(c_dict, c_ns.href, -1)
9563  */
9564     __pyx_t_1 = (__pyx_v_c_ns->href != NULL);
9565     if (__pyx_t_1) {
9566
9567       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":474
9568  *     while c_ns is not NULL:
9569  *         if c_ns.href is not NULL:
9570  *             if tree.xmlDictOwns(c_src_dict, c_ns.href):             # <<<<<<<<<<<<<<
9571  *                 c_ns.href = tree.xmlDictLookup(c_dict, c_ns.href, -1)
9572  *         if c_ns.prefix is not NULL:
9573  */
9574       __pyx_t_2 = xmlDictOwns(__pyx_v_c_src_dict, __pyx_v_c_ns->href);
9575       if (__pyx_t_2) {
9576
9577         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":475
9578  *         if c_ns.href is not NULL:
9579  *             if tree.xmlDictOwns(c_src_dict, c_ns.href):
9580  *                 c_ns.href = tree.xmlDictLookup(c_dict, c_ns.href, -1)             # <<<<<<<<<<<<<<
9581  *         if c_ns.prefix is not NULL:
9582  *             if tree.xmlDictOwns(c_src_dict, c_ns.prefix):
9583  */
9584         __pyx_v_c_ns->href = xmlDictLookup(__pyx_v_c_dict, __pyx_v_c_ns->href, -1);
9585         goto __pyx_L6;
9586       }
9587       __pyx_L6:;
9588       goto __pyx_L5;
9589     }
9590     __pyx_L5:;
9591
9592     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":476
9593  *             if tree.xmlDictOwns(c_src_dict, c_ns.href):
9594  *                 c_ns.href = tree.xmlDictLookup(c_dict, c_ns.href, -1)
9595  *         if c_ns.prefix is not NULL:             # <<<<<<<<<<<<<<
9596  *             if tree.xmlDictOwns(c_src_dict, c_ns.prefix):
9597  *                 c_ns.prefix = tree.xmlDictLookup(c_dict, c_ns.prefix, -1)
9598  */
9599     __pyx_t_1 = (__pyx_v_c_ns->prefix != NULL);
9600     if (__pyx_t_1) {
9601
9602       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":477
9603  *                 c_ns.href = tree.xmlDictLookup(c_dict, c_ns.href, -1)
9604  *         if c_ns.prefix is not NULL:
9605  *             if tree.xmlDictOwns(c_src_dict, c_ns.prefix):             # <<<<<<<<<<<<<<
9606  *                 c_ns.prefix = tree.xmlDictLookup(c_dict, c_ns.prefix, -1)
9607  *         c_ns = c_ns.next
9608  */
9609       __pyx_t_2 = xmlDictOwns(__pyx_v_c_src_dict, __pyx_v_c_ns->prefix);
9610       if (__pyx_t_2) {
9611
9612         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":478
9613  *         if c_ns.prefix is not NULL:
9614  *             if tree.xmlDictOwns(c_src_dict, c_ns.prefix):
9615  *                 c_ns.prefix = tree.xmlDictLookup(c_dict, c_ns.prefix, -1)             # <<<<<<<<<<<<<<
9616  *         c_ns = c_ns.next
9617  */
9618         __pyx_v_c_ns->prefix = xmlDictLookup(__pyx_v_c_dict, __pyx_v_c_ns->prefix, -1);
9619         goto __pyx_L8;
9620       }
9621       __pyx_L8:;
9622       goto __pyx_L7;
9623     }
9624     __pyx_L7:;
9625
9626     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/proxy.pxi":479
9627  *             if tree.xmlDictOwns(c_src_dict, c_ns.prefix):
9628  *                 c_ns.prefix = tree.xmlDictLookup(c_dict, c_ns.prefix, -1)
9629  *         c_ns = c_ns.next             # <<<<<<<<<<<<<<
9630  */
9631     __pyx_v_c_ns = __pyx_v_c_ns->next;
9632   }
9633
9634 }
9635
9636 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":3
9637  * # Private/public helper functions for API functions
9638  * 
9639  * cdef void displayNode(xmlNode* c_node, indent):             # <<<<<<<<<<<<<<
9640  *     # to help with debugging
9641  *     cdef xmlNode* c_child
9642  */
9643
9644 static  void __pyx_f_4lxml_5etree_displayNode(xmlNode *__pyx_v_c_node, PyObject *__pyx_v_indent) {
9645   xmlNode *__pyx_v_c_child;
9646   PyObject *__pyx_t_1 = NULL;
9647   PyObject *__pyx_t_2 = NULL;
9648   PyObject *__pyx_t_3 = NULL;
9649   int __pyx_t_4;
9650   __Pyx_SetupRefcountContext("displayNode");
9651
9652   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":6
9653  *     # to help with debugging
9654  *     cdef xmlNode* c_child
9655  *     print indent * u' ', <long>c_node             # <<<<<<<<<<<<<<
9656  *     c_child = c_node.children
9657  *     while c_child is not NULL:
9658  */
9659   __pyx_t_1 = PyNumber_Multiply(__pyx_v_indent, ((PyObject *)__pyx_kp_233)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9660   __Pyx_GOTREF(__pyx_t_1);
9661   __pyx_t_2 = PyInt_FromLong(((long)__pyx_v_c_node)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9662   __Pyx_GOTREF(__pyx_t_2);
9663   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9664   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
9665   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
9666   __Pyx_GIVEREF(__pyx_t_1);
9667   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
9668   __Pyx_GIVEREF(__pyx_t_2);
9669   __pyx_t_1 = 0;
9670   __pyx_t_2 = 0;
9671   if (__Pyx_Print(((PyObject *)__pyx_t_3), 1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9672   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
9673
9674   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":7
9675  *     cdef xmlNode* c_child
9676  *     print indent * u' ', <long>c_node
9677  *     c_child = c_node.children             # <<<<<<<<<<<<<<
9678  *     while c_child is not NULL:
9679  *         displayNode(c_child, indent + 1)
9680  */
9681   __pyx_v_c_child = __pyx_v_c_node->children;
9682
9683   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":8
9684  *     print indent * u' ', <long>c_node
9685  *     c_child = c_node.children
9686  *     while c_child is not NULL:             # <<<<<<<<<<<<<<
9687  *         displayNode(c_child, indent + 1)
9688  *         c_child = c_child.next
9689  */
9690   while (1) {
9691     __pyx_t_4 = (__pyx_v_c_child != NULL);
9692     if (!__pyx_t_4) break;
9693
9694     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":9
9695  *     c_child = c_node.children
9696  *     while c_child is not NULL:
9697  *         displayNode(c_child, indent + 1)             # <<<<<<<<<<<<<<
9698  *         c_child = c_child.next
9699  * 
9700  */
9701     __pyx_t_3 = PyNumber_Add(__pyx_v_indent, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9702     __Pyx_GOTREF(__pyx_t_3);
9703     __pyx_f_4lxml_5etree_displayNode(__pyx_v_c_child, __pyx_t_3);
9704     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9705
9706     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":10
9707  *     while c_child is not NULL:
9708  *         displayNode(c_child, indent + 1)
9709  *         c_child = c_child.next             # <<<<<<<<<<<<<<
9710  * 
9711  * cdef _Document _documentOrRaise(object input):
9712  */
9713     __pyx_v_c_child = __pyx_v_c_child->next;
9714   }
9715
9716   goto __pyx_L0;
9717   __pyx_L1_error:;
9718   __Pyx_XDECREF(__pyx_t_1);
9719   __Pyx_XDECREF(__pyx_t_2);
9720   __Pyx_XDECREF(__pyx_t_3);
9721   __Pyx_WriteUnraisable("lxml.etree.displayNode");
9722   __pyx_L0:;
9723   __Pyx_FinishRefcountContext();
9724 }
9725
9726 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":12
9727  *         c_child = c_child.next
9728  * 
9729  * cdef _Document _documentOrRaise(object input):             # <<<<<<<<<<<<<<
9730  *     u"""Call this to get the document of a _Document, _ElementTree or _Element
9731  *     object, or to raise an exception if it can't be determined.
9732  */
9733
9734 static  struct LxmlDocument *__pyx_f_4lxml_5etree__documentOrRaise(PyObject *__pyx_v_input) {
9735   struct LxmlDocument *__pyx_v_doc;
9736   struct LxmlElement *__pyx_v_element;
9737   struct LxmlDocument *__pyx_r = NULL;
9738   int __pyx_t_1;
9739   PyObject *__pyx_t_2 = NULL;
9740   PyObject *__pyx_t_3 = NULL;
9741   __Pyx_SetupRefcountContext("_documentOrRaise");
9742   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
9743   __pyx_v_element = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
9744
9745   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":20
9746  *     cdef _Document doc
9747  *     cdef _Element element
9748  *     if isinstance(input, _ElementTree):             # <<<<<<<<<<<<<<
9749  *         element = (<_ElementTree>input)._context_node
9750  *         if element is not None:
9751  */
9752   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_input, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ElementTree))); 
9753   if (__pyx_t_1) {
9754
9755     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":21
9756  *     cdef _Element element
9757  *     if isinstance(input, _ElementTree):
9758  *         element = (<_ElementTree>input)._context_node             # <<<<<<<<<<<<<<
9759  *         if element is not None:
9760  *             doc = element._doc
9761  */
9762     __Pyx_INCREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_input)->_context_node));
9763     __Pyx_DECREF(((PyObject *)__pyx_v_element));
9764     __pyx_v_element = ((struct LxmlElementTree *)__pyx_v_input)->_context_node;
9765
9766     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":22
9767  *     if isinstance(input, _ElementTree):
9768  *         element = (<_ElementTree>input)._context_node
9769  *         if element is not None:             # <<<<<<<<<<<<<<
9770  *             doc = element._doc
9771  *     elif isinstance(input, _Element):
9772  */
9773     __pyx_t_1 = (((PyObject *)__pyx_v_element) != Py_None);
9774     if (__pyx_t_1) {
9775
9776       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":23
9777  *         element = (<_ElementTree>input)._context_node
9778  *         if element is not None:
9779  *             doc = element._doc             # <<<<<<<<<<<<<<
9780  *     elif isinstance(input, _Element):
9781  *         doc = (<_Element>input)._doc
9782  */
9783       __Pyx_INCREF(((PyObject *)__pyx_v_element->_doc));
9784       __Pyx_DECREF(((PyObject *)__pyx_v_doc));
9785       __pyx_v_doc = __pyx_v_element->_doc;
9786       goto __pyx_L4;
9787     }
9788     __pyx_L4:;
9789     goto __pyx_L3;
9790   }
9791
9792   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":24
9793  *         if element is not None:
9794  *             doc = element._doc
9795  *     elif isinstance(input, _Element):             # <<<<<<<<<<<<<<
9796  *         doc = (<_Element>input)._doc
9797  *     elif isinstance(input, _Document):
9798  */
9799   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_input, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Element))); 
9800   if (__pyx_t_1) {
9801
9802     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":25
9803  *             doc = element._doc
9804  *     elif isinstance(input, _Element):
9805  *         doc = (<_Element>input)._doc             # <<<<<<<<<<<<<<
9806  *     elif isinstance(input, _Document):
9807  *         doc = <_Document>input
9808  */
9809     __Pyx_INCREF(((PyObject *)((struct LxmlElement *)__pyx_v_input)->_doc));
9810     __Pyx_DECREF(((PyObject *)__pyx_v_doc));
9811     __pyx_v_doc = ((struct LxmlElement *)__pyx_v_input)->_doc;
9812     goto __pyx_L3;
9813   }
9814
9815   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":26
9816  *     elif isinstance(input, _Element):
9817  *         doc = (<_Element>input)._doc
9818  *     elif isinstance(input, _Document):             # <<<<<<<<<<<<<<
9819  *         doc = <_Document>input
9820  *     else:
9821  */
9822   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_input, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Document))); 
9823   if (__pyx_t_1) {
9824
9825     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":27
9826  *         doc = (<_Element>input)._doc
9827  *     elif isinstance(input, _Document):
9828  *         doc = <_Document>input             # <<<<<<<<<<<<<<
9829  *     else:
9830  *         raise TypeError, u"Invalid input object: %s" % \
9831  */
9832     __Pyx_INCREF(((PyObject *)((struct LxmlDocument *)__pyx_v_input)));
9833     __Pyx_DECREF(((PyObject *)__pyx_v_doc));
9834     __pyx_v_doc = ((struct LxmlDocument *)__pyx_v_input);
9835     goto __pyx_L3;
9836   }
9837   /*else*/ {
9838
9839     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":30
9840  *     else:
9841  *         raise TypeError, u"Invalid input object: %s" % \
9842  *             python._fqtypename(input)             # <<<<<<<<<<<<<<
9843  *     if doc is None:
9844  *         raise ValueError, u"Input object has no document: %s" % \
9845  */
9846     __pyx_t_2 = __Pyx_PyBytes_FromString(_fqtypename(__pyx_v_input)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9847     __Pyx_GOTREF(__pyx_t_2);
9848     __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_234), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9849     __Pyx_GOTREF(__pyx_t_3);
9850     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9851     __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_3, 0);
9852     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9853     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9854   }
9855   __pyx_L3:;
9856
9857   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":31
9858  *         raise TypeError, u"Invalid input object: %s" % \
9859  *             python._fqtypename(input)
9860  *     if doc is None:             # <<<<<<<<<<<<<<
9861  *         raise ValueError, u"Input object has no document: %s" % \
9862  *             python._fqtypename(input)
9863  */
9864   __pyx_t_1 = (((PyObject *)__pyx_v_doc) == Py_None);
9865   if (__pyx_t_1) {
9866
9867     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":33
9868  *     if doc is None:
9869  *         raise ValueError, u"Input object has no document: %s" % \
9870  *             python._fqtypename(input)             # <<<<<<<<<<<<<<
9871  *     else:
9872  *         return doc
9873  */
9874     __pyx_t_3 = __Pyx_PyBytes_FromString(_fqtypename(__pyx_v_input)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9875     __Pyx_GOTREF(__pyx_t_3);
9876     __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_235), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9877     __Pyx_GOTREF(__pyx_t_2);
9878     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9879     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_2, 0);
9880     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9881     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9882     goto __pyx_L5;
9883   }
9884   /*else*/ {
9885
9886     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":35
9887  *             python._fqtypename(input)
9888  *     else:
9889  *         return doc             # <<<<<<<<<<<<<<
9890  * 
9891  * cdef _Element _rootNodeOrRaise(object input):
9892  */
9893     __Pyx_XDECREF(((PyObject *)__pyx_r));
9894     __Pyx_INCREF(((PyObject *)__pyx_v_doc));
9895     __pyx_r = __pyx_v_doc;
9896     goto __pyx_L0;
9897   }
9898   __pyx_L5:;
9899
9900   __pyx_r = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
9901   goto __pyx_L0;
9902   __pyx_L1_error:;
9903   __Pyx_XDECREF(__pyx_t_2);
9904   __Pyx_XDECREF(__pyx_t_3);
9905   __Pyx_AddTraceback("lxml.etree._documentOrRaise");
9906   __pyx_r = 0;
9907   __pyx_L0:;
9908   __Pyx_DECREF((PyObject *)__pyx_v_doc);
9909   __Pyx_DECREF((PyObject *)__pyx_v_element);
9910   __Pyx_XGIVEREF((PyObject *)__pyx_r);
9911   __Pyx_FinishRefcountContext();
9912   return __pyx_r;
9913 }
9914
9915 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":37
9916  *         return doc
9917  * 
9918  * cdef _Element _rootNodeOrRaise(object input):             # <<<<<<<<<<<<<<
9919  *     u"""Call this to get the root node of a _Document, _ElementTree or
9920  *      _Element object, or to raise an exception if it can't be determined.
9921  */
9922
9923 static  struct LxmlElement *__pyx_f_4lxml_5etree__rootNodeOrRaise(PyObject *__pyx_v_input) {
9924   struct LxmlElement *__pyx_v_node;
9925   struct LxmlElement *__pyx_r = NULL;
9926   int __pyx_t_1;
9927   PyObject *__pyx_t_2 = NULL;
9928   PyObject *__pyx_t_3 = NULL;
9929   __Pyx_SetupRefcountContext("_rootNodeOrRaise");
9930   __pyx_v_node = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
9931
9932   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":44
9933  *      """
9934  *     cdef _Element node
9935  *     if isinstance(input, _ElementTree):             # <<<<<<<<<<<<<<
9936  *         node = (<_ElementTree>input)._context_node
9937  *     elif isinstance(input, _Element):
9938  */
9939   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_input, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ElementTree))); 
9940   if (__pyx_t_1) {
9941
9942     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":45
9943  *     cdef _Element node
9944  *     if isinstance(input, _ElementTree):
9945  *         node = (<_ElementTree>input)._context_node             # <<<<<<<<<<<<<<
9946  *     elif isinstance(input, _Element):
9947  *         node = <_Element>input
9948  */
9949     __Pyx_INCREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_input)->_context_node));
9950     __Pyx_DECREF(((PyObject *)__pyx_v_node));
9951     __pyx_v_node = ((struct LxmlElementTree *)__pyx_v_input)->_context_node;
9952     goto __pyx_L3;
9953   }
9954
9955   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":46
9956  *     if isinstance(input, _ElementTree):
9957  *         node = (<_ElementTree>input)._context_node
9958  *     elif isinstance(input, _Element):             # <<<<<<<<<<<<<<
9959  *         node = <_Element>input
9960  *     elif isinstance(input, _Document):
9961  */
9962   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_input, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Element))); 
9963   if (__pyx_t_1) {
9964
9965     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":47
9966  *         node = (<_ElementTree>input)._context_node
9967  *     elif isinstance(input, _Element):
9968  *         node = <_Element>input             # <<<<<<<<<<<<<<
9969  *     elif isinstance(input, _Document):
9970  *         node = (<_Document>input).getroot()
9971  */
9972     __Pyx_INCREF(((PyObject *)((struct LxmlElement *)__pyx_v_input)));
9973     __Pyx_DECREF(((PyObject *)__pyx_v_node));
9974     __pyx_v_node = ((struct LxmlElement *)__pyx_v_input);
9975     goto __pyx_L3;
9976   }
9977
9978   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":48
9979  *     elif isinstance(input, _Element):
9980  *         node = <_Element>input
9981  *     elif isinstance(input, _Document):             # <<<<<<<<<<<<<<
9982  *         node = (<_Document>input).getroot()
9983  *     else:
9984  */
9985   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_input, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Document))); 
9986   if (__pyx_t_1) {
9987
9988     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":49
9989  *         node = <_Element>input
9990  *     elif isinstance(input, _Document):
9991  *         node = (<_Document>input).getroot()             # <<<<<<<<<<<<<<
9992  *     else:
9993  *         raise TypeError, u"Invalid input object: %s" % \
9994  */
9995     __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)((struct LxmlDocument *)__pyx_v_input)->__pyx_vtab)->getroot(((struct LxmlDocument *)__pyx_v_input)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9996     __Pyx_GOTREF(__pyx_t_2);
9997     if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9998     __Pyx_DECREF(((PyObject *)__pyx_v_node));
9999     __pyx_v_node = ((struct LxmlElement *)__pyx_t_2);
10000     __pyx_t_2 = 0;
10001     goto __pyx_L3;
10002   }
10003   /*else*/ {
10004
10005     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":52
10006  *     else:
10007  *         raise TypeError, u"Invalid input object: %s" % \
10008  *             python._fqtypename(input)             # <<<<<<<<<<<<<<
10009  *     if node is None:
10010  *         raise ValueError, u"Input object has no element: %s" % \
10011  */
10012     __pyx_t_2 = __Pyx_PyBytes_FromString(_fqtypename(__pyx_v_input)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10013     __Pyx_GOTREF(__pyx_t_2);
10014     __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_236), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10015     __Pyx_GOTREF(__pyx_t_3);
10016     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10017     __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_3, 0);
10018     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10019     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10020   }
10021   __pyx_L3:;
10022
10023   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":53
10024  *         raise TypeError, u"Invalid input object: %s" % \
10025  *             python._fqtypename(input)
10026  *     if node is None:             # <<<<<<<<<<<<<<
10027  *         raise ValueError, u"Input object has no element: %s" % \
10028  *             python._fqtypename(input)
10029  */
10030   __pyx_t_1 = (((PyObject *)__pyx_v_node) == Py_None);
10031   if (__pyx_t_1) {
10032
10033     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":55
10034  *     if node is None:
10035  *         raise ValueError, u"Input object has no element: %s" % \
10036  *             python._fqtypename(input)             # <<<<<<<<<<<<<<
10037  *     else:
10038  *         return node
10039  */
10040     __pyx_t_3 = __Pyx_PyBytes_FromString(_fqtypename(__pyx_v_input)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10041     __Pyx_GOTREF(__pyx_t_3);
10042     __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_237), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10043     __Pyx_GOTREF(__pyx_t_2);
10044     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10045     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_2, 0);
10046     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10047     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10048     goto __pyx_L4;
10049   }
10050   /*else*/ {
10051
10052     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":57
10053  *             python._fqtypename(input)
10054  *     else:
10055  *         return node             # <<<<<<<<<<<<<<
10056  * 
10057  * cdef _Document _documentOf(object input):
10058  */
10059     __Pyx_XDECREF(((PyObject *)__pyx_r));
10060     __Pyx_INCREF(((PyObject *)__pyx_v_node));
10061     __pyx_r = __pyx_v_node;
10062     goto __pyx_L0;
10063   }
10064   __pyx_L4:;
10065
10066   __pyx_r = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
10067   goto __pyx_L0;
10068   __pyx_L1_error:;
10069   __Pyx_XDECREF(__pyx_t_2);
10070   __Pyx_XDECREF(__pyx_t_3);
10071   __Pyx_AddTraceback("lxml.etree._rootNodeOrRaise");
10072   __pyx_r = 0;
10073   __pyx_L0:;
10074   __Pyx_DECREF((PyObject *)__pyx_v_node);
10075   __Pyx_XGIVEREF((PyObject *)__pyx_r);
10076   __Pyx_FinishRefcountContext();
10077   return __pyx_r;
10078 }
10079
10080 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":59
10081  *         return node
10082  * 
10083  * cdef _Document _documentOf(object input):             # <<<<<<<<<<<<<<
10084  *     # call this to get the document of a
10085  *     # _Document, _ElementTree or _Element object
10086  */
10087
10088 static  struct LxmlDocument *__pyx_f_4lxml_5etree__documentOf(PyObject *__pyx_v_input) {
10089   struct LxmlElement *__pyx_v_element;
10090   struct LxmlDocument *__pyx_r = NULL;
10091   int __pyx_t_1;
10092   __Pyx_SetupRefcountContext("_documentOf");
10093   __pyx_v_element = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
10094
10095   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":64
10096  *     # may return None!
10097  *     cdef _Element element
10098  *     if isinstance(input, _ElementTree):             # <<<<<<<<<<<<<<
10099  *         element = (<_ElementTree>input)._context_node
10100  *         if element is not None:
10101  */
10102   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_input, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ElementTree))); 
10103   if (__pyx_t_1) {
10104
10105     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":65
10106  *     cdef _Element element
10107  *     if isinstance(input, _ElementTree):
10108  *         element = (<_ElementTree>input)._context_node             # <<<<<<<<<<<<<<
10109  *         if element is not None:
10110  *             return element._doc
10111  */
10112     __Pyx_INCREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_input)->_context_node));
10113     __Pyx_DECREF(((PyObject *)__pyx_v_element));
10114     __pyx_v_element = ((struct LxmlElementTree *)__pyx_v_input)->_context_node;
10115
10116     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":66
10117  *     if isinstance(input, _ElementTree):
10118  *         element = (<_ElementTree>input)._context_node
10119  *         if element is not None:             # <<<<<<<<<<<<<<
10120  *             return element._doc
10121  *     elif isinstance(input, _Element):
10122  */
10123     __pyx_t_1 = (((PyObject *)__pyx_v_element) != Py_None);
10124     if (__pyx_t_1) {
10125
10126       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":67
10127  *         element = (<_ElementTree>input)._context_node
10128  *         if element is not None:
10129  *             return element._doc             # <<<<<<<<<<<<<<
10130  *     elif isinstance(input, _Element):
10131  *         return (<_Element>input)._doc
10132  */
10133       __Pyx_XDECREF(((PyObject *)__pyx_r));
10134       __Pyx_INCREF(((PyObject *)__pyx_v_element->_doc));
10135       __pyx_r = __pyx_v_element->_doc;
10136       goto __pyx_L0;
10137       goto __pyx_L4;
10138     }
10139     __pyx_L4:;
10140     goto __pyx_L3;
10141   }
10142
10143   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":68
10144  *         if element is not None:
10145  *             return element._doc
10146  *     elif isinstance(input, _Element):             # <<<<<<<<<<<<<<
10147  *         return (<_Element>input)._doc
10148  *     elif isinstance(input, _Document):
10149  */
10150   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_input, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Element))); 
10151   if (__pyx_t_1) {
10152
10153     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":69
10154  *             return element._doc
10155  *     elif isinstance(input, _Element):
10156  *         return (<_Element>input)._doc             # <<<<<<<<<<<<<<
10157  *     elif isinstance(input, _Document):
10158  *         return <_Document>input
10159  */
10160     __Pyx_XDECREF(((PyObject *)__pyx_r));
10161     __Pyx_INCREF(((PyObject *)((struct LxmlElement *)__pyx_v_input)->_doc));
10162     __pyx_r = ((struct LxmlElement *)__pyx_v_input)->_doc;
10163     goto __pyx_L0;
10164     goto __pyx_L3;
10165   }
10166
10167   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":70
10168  *     elif isinstance(input, _Element):
10169  *         return (<_Element>input)._doc
10170  *     elif isinstance(input, _Document):             # <<<<<<<<<<<<<<
10171  *         return <_Document>input
10172  *     return None
10173  */
10174   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_input, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Document))); 
10175   if (__pyx_t_1) {
10176
10177     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":71
10178  *         return (<_Element>input)._doc
10179  *     elif isinstance(input, _Document):
10180  *         return <_Document>input             # <<<<<<<<<<<<<<
10181  *     return None
10182  * 
10183  */
10184     __Pyx_XDECREF(((PyObject *)__pyx_r));
10185     __Pyx_INCREF(((PyObject *)((struct LxmlDocument *)__pyx_v_input)));
10186     __pyx_r = ((struct LxmlDocument *)__pyx_v_input);
10187     goto __pyx_L0;
10188     goto __pyx_L3;
10189   }
10190   __pyx_L3:;
10191
10192   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":72
10193  *     elif isinstance(input, _Document):
10194  *         return <_Document>input
10195  *     return None             # <<<<<<<<<<<<<<
10196  * 
10197  * cdef _Element _rootNodeOf(object input):
10198  */
10199   __Pyx_XDECREF(((PyObject *)__pyx_r));
10200   __Pyx_INCREF(Py_None);
10201   __pyx_r = ((struct LxmlDocument *)Py_None);
10202   goto __pyx_L0;
10203
10204   __pyx_r = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
10205   __pyx_L0:;
10206   __Pyx_DECREF((PyObject *)__pyx_v_element);
10207   __Pyx_XGIVEREF((PyObject *)__pyx_r);
10208   __Pyx_FinishRefcountContext();
10209   return __pyx_r;
10210 }
10211
10212 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":74
10213  *     return None
10214  * 
10215  * cdef _Element _rootNodeOf(object input):             # <<<<<<<<<<<<<<
10216  *     # call this to get the root node of a
10217  *     # _Document, _ElementTree or _Element object
10218  */
10219
10220 static  struct LxmlElement *__pyx_f_4lxml_5etree__rootNodeOf(PyObject *__pyx_v_input) {
10221   struct LxmlElement *__pyx_r = NULL;
10222   int __pyx_t_1;
10223   PyObject *__pyx_t_2 = NULL;
10224   __Pyx_SetupRefcountContext("_rootNodeOf");
10225
10226   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":78
10227  *     # _Document, _ElementTree or _Element object
10228  *     # may return None!
10229  *     if isinstance(input, _ElementTree):             # <<<<<<<<<<<<<<
10230  *         return (<_ElementTree>input)._context_node
10231  *     elif isinstance(input, _Element):
10232  */
10233   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_input, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ElementTree))); 
10234   if (__pyx_t_1) {
10235
10236     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":79
10237  *     # may return None!
10238  *     if isinstance(input, _ElementTree):
10239  *         return (<_ElementTree>input)._context_node             # <<<<<<<<<<<<<<
10240  *     elif isinstance(input, _Element):
10241  *         return <_Element>input
10242  */
10243     __Pyx_XDECREF(((PyObject *)__pyx_r));
10244     __Pyx_INCREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_input)->_context_node));
10245     __pyx_r = ((struct LxmlElementTree *)__pyx_v_input)->_context_node;
10246     goto __pyx_L0;
10247     goto __pyx_L3;
10248   }
10249
10250   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":80
10251  *     if isinstance(input, _ElementTree):
10252  *         return (<_ElementTree>input)._context_node
10253  *     elif isinstance(input, _Element):             # <<<<<<<<<<<<<<
10254  *         return <_Element>input
10255  *     elif isinstance(input, _Document):
10256  */
10257   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_input, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Element))); 
10258   if (__pyx_t_1) {
10259
10260     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":81
10261  *         return (<_ElementTree>input)._context_node
10262  *     elif isinstance(input, _Element):
10263  *         return <_Element>input             # <<<<<<<<<<<<<<
10264  *     elif isinstance(input, _Document):
10265  *         return (<_Document>input).getroot()
10266  */
10267     __Pyx_XDECREF(((PyObject *)__pyx_r));
10268     __Pyx_INCREF(((PyObject *)((struct LxmlElement *)__pyx_v_input)));
10269     __pyx_r = ((struct LxmlElement *)__pyx_v_input);
10270     goto __pyx_L0;
10271     goto __pyx_L3;
10272   }
10273
10274   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":82
10275  *     elif isinstance(input, _Element):
10276  *         return <_Element>input
10277  *     elif isinstance(input, _Document):             # <<<<<<<<<<<<<<
10278  *         return (<_Document>input).getroot()
10279  *     else:
10280  */
10281   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_input, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Document))); 
10282   if (__pyx_t_1) {
10283
10284     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":83
10285  *         return <_Element>input
10286  *     elif isinstance(input, _Document):
10287  *         return (<_Document>input).getroot()             # <<<<<<<<<<<<<<
10288  *     else:
10289  *         return None
10290  */
10291     __Pyx_XDECREF(((PyObject *)__pyx_r));
10292     __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)((struct LxmlDocument *)__pyx_v_input)->__pyx_vtab)->getroot(((struct LxmlDocument *)__pyx_v_input)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10293     __Pyx_GOTREF(__pyx_t_2);
10294     if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10295     __pyx_r = ((struct LxmlElement *)__pyx_t_2);
10296     __pyx_t_2 = 0;
10297     goto __pyx_L0;
10298     goto __pyx_L3;
10299   }
10300   /*else*/ {
10301
10302     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":85
10303  *         return (<_Document>input).getroot()
10304  *     else:
10305  *         return None             # <<<<<<<<<<<<<<
10306  * 
10307  * cdef _Element _makeElement(tag, xmlDoc* c_doc, _Document doc,
10308  */
10309     __Pyx_XDECREF(((PyObject *)__pyx_r));
10310     __Pyx_INCREF(Py_None);
10311     __pyx_r = ((struct LxmlElement *)Py_None);
10312     goto __pyx_L0;
10313   }
10314   __pyx_L3:;
10315
10316   __pyx_r = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
10317   goto __pyx_L0;
10318   __pyx_L1_error:;
10319   __Pyx_XDECREF(__pyx_t_2);
10320   __Pyx_AddTraceback("lxml.etree._rootNodeOf");
10321   __pyx_r = 0;
10322   __pyx_L0:;
10323   __Pyx_XGIVEREF((PyObject *)__pyx_r);
10324   __Pyx_FinishRefcountContext();
10325   return __pyx_r;
10326 }
10327
10328 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":87
10329  *         return None
10330  * 
10331  * cdef _Element _makeElement(tag, xmlDoc* c_doc, _Document doc,             # <<<<<<<<<<<<<<
10332  *                            _BaseParser parser, text, tail, attrib, nsmap,
10333  *                            extra_attrs):
10334  */
10335
10336 static  struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *__pyx_v_tag, xmlDoc *__pyx_v_c_doc, struct LxmlDocument *__pyx_v_doc, struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser, PyObject *__pyx_v_text, PyObject *__pyx_v_tail, PyObject *__pyx_v_attrib, PyObject *__pyx_v_nsmap, PyObject *__pyx_v_extra_attrs) {
10337   xmlNode *__pyx_v_c_node;
10338   PyObject *__pyx_v_ns_utf;
10339   PyObject *__pyx_v_name_utf;
10340   struct LxmlElement *__pyx_r = NULL;
10341   PyObject *__pyx_1 = 0;
10342   PyObject *__pyx_2 = 0;
10343   PyObject *__pyx_3 = 0;
10344   int __pyx_t_1;
10345   PyObject *__pyx_t_2 = NULL;
10346   int __pyx_t_3;
10347   int __pyx_t_4;
10348   xmlDoc *__pyx_t_5;
10349   xmlDoc *__pyx_t_6;
10350   xmlNode *__pyx_t_7;
10351   PyObject *__pyx_t_8 = NULL;
10352   PyObject *__pyx_t_9 = NULL;
10353   __Pyx_SetupRefcountContext("_makeElement");
10354   __Pyx_INCREF((PyObject *)__pyx_v_doc);
10355   __pyx_v_ns_utf = Py_None; __Pyx_INCREF(Py_None);
10356   __pyx_v_name_utf = Py_None; __Pyx_INCREF(Py_None);
10357
10358   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":105
10359  *     """
10360  *     cdef xmlNode* c_node
10361  *     if doc is not None:             # <<<<<<<<<<<<<<
10362  *         c_doc = doc._c_doc
10363  *     ns_utf, name_utf = _getNsTag(tag)
10364  */
10365   __pyx_t_1 = (((PyObject *)__pyx_v_doc) != Py_None);
10366   if (__pyx_t_1) {
10367
10368     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":106
10369  *     cdef xmlNode* c_node
10370  *     if doc is not None:
10371  *         c_doc = doc._c_doc             # <<<<<<<<<<<<<<
10372  *     ns_utf, name_utf = _getNsTag(tag)
10373  *     if parser is not None and parser._for_html:
10374  */
10375     __pyx_v_c_doc = __pyx_v_doc->_c_doc;
10376     goto __pyx_L3;
10377   }
10378   __pyx_L3:;
10379
10380   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":107
10381  *     if doc is not None:
10382  *         c_doc = doc._c_doc
10383  *     ns_utf, name_utf = _getNsTag(tag)             # <<<<<<<<<<<<<<
10384  *     if parser is not None and parser._for_html:
10385  *         _htmlTagValidOrRaise(name_utf)
10386  */
10387   __pyx_t_2 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_tag); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10388   __Pyx_GOTREF(__pyx_t_2);
10389   if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 2)) {
10390     PyObject* tuple = __pyx_t_2;
10391     __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
10392     __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
10393     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10394     __Pyx_DECREF(__pyx_v_ns_utf);
10395     __pyx_v_ns_utf = __pyx_2;
10396     __pyx_2 = 0;
10397     __Pyx_DECREF(__pyx_v_name_utf);
10398     __pyx_v_name_utf = __pyx_3;
10399     __pyx_3 = 0;
10400   } else {
10401     __pyx_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10402     __Pyx_GOTREF(__pyx_1);
10403     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10404     __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10405     __Pyx_GOTREF(__pyx_2);
10406     __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10407     __Pyx_GOTREF(__pyx_3);
10408     if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10409     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
10410     __Pyx_DECREF(__pyx_v_ns_utf);
10411     __pyx_v_ns_utf = __pyx_2;
10412     __pyx_2 = 0;
10413     __Pyx_DECREF(__pyx_v_name_utf);
10414     __pyx_v_name_utf = __pyx_3;
10415     __pyx_3 = 0;
10416   }
10417
10418   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":108
10419  *         c_doc = doc._c_doc
10420  *     ns_utf, name_utf = _getNsTag(tag)
10421  *     if parser is not None and parser._for_html:             # <<<<<<<<<<<<<<
10422  *         _htmlTagValidOrRaise(name_utf)
10423  *         if c_doc is NULL:
10424  */
10425   __pyx_t_1 = (((PyObject *)__pyx_v_parser) != Py_None);
10426   if (__pyx_t_1) {
10427     __pyx_t_3 = __pyx_v_parser->_for_html;
10428   } else {
10429     __pyx_t_3 = __pyx_t_1;
10430   }
10431   if (__pyx_t_3) {
10432
10433     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":109
10434  *     ns_utf, name_utf = _getNsTag(tag)
10435  *     if parser is not None and parser._for_html:
10436  *         _htmlTagValidOrRaise(name_utf)             # <<<<<<<<<<<<<<
10437  *         if c_doc is NULL:
10438  *             c_doc = _newHTMLDoc()
10439  */
10440     __pyx_t_4 = __pyx_f_4lxml_5etree__htmlTagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10441
10442     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":110
10443  *     if parser is not None and parser._for_html:
10444  *         _htmlTagValidOrRaise(name_utf)
10445  *         if c_doc is NULL:             # <<<<<<<<<<<<<<
10446  *             c_doc = _newHTMLDoc()
10447  *     else:
10448  */
10449     __pyx_t_3 = (__pyx_v_c_doc == NULL);
10450     if (__pyx_t_3) {
10451
10452       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":111
10453  *         _htmlTagValidOrRaise(name_utf)
10454  *         if c_doc is NULL:
10455  *             c_doc = _newHTMLDoc()             # <<<<<<<<<<<<<<
10456  *     else:
10457  *         _tagValidOrRaise(name_utf)
10458  */
10459       __pyx_t_5 = __pyx_f_4lxml_5etree__newHTMLDoc(); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10460       __pyx_v_c_doc = __pyx_t_5;
10461       goto __pyx_L5;
10462     }
10463     __pyx_L5:;
10464     goto __pyx_L4;
10465   }
10466   /*else*/ {
10467
10468     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":113
10469  *             c_doc = _newHTMLDoc()
10470  *     else:
10471  *         _tagValidOrRaise(name_utf)             # <<<<<<<<<<<<<<
10472  *         if c_doc is NULL:
10473  *             c_doc = _newXMLDoc()
10474  */
10475     __pyx_t_4 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10476
10477     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":114
10478  *     else:
10479  *         _tagValidOrRaise(name_utf)
10480  *         if c_doc is NULL:             # <<<<<<<<<<<<<<
10481  *             c_doc = _newXMLDoc()
10482  *     c_node = _createElement(c_doc, name_utf)
10483  */
10484     __pyx_t_3 = (__pyx_v_c_doc == NULL);
10485     if (__pyx_t_3) {
10486
10487       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":115
10488  *         _tagValidOrRaise(name_utf)
10489  *         if c_doc is NULL:
10490  *             c_doc = _newXMLDoc()             # <<<<<<<<<<<<<<
10491  *     c_node = _createElement(c_doc, name_utf)
10492  *     if c_node is NULL:
10493  */
10494       __pyx_t_6 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10495       __pyx_v_c_doc = __pyx_t_6;
10496       goto __pyx_L6;
10497     }
10498     __pyx_L6:;
10499   }
10500   __pyx_L4:;
10501
10502   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":116
10503  *         if c_doc is NULL:
10504  *             c_doc = _newXMLDoc()
10505  *     c_node = _createElement(c_doc, name_utf)             # <<<<<<<<<<<<<<
10506  *     if c_node is NULL:
10507  *         if doc is None and c_doc is not NULL:
10508  */
10509   __pyx_t_7 = __pyx_f_4lxml_5etree__createElement(__pyx_v_c_doc, __pyx_v_name_utf); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10510   __pyx_v_c_node = __pyx_t_7;
10511
10512   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":117
10513  *             c_doc = _newXMLDoc()
10514  *     c_node = _createElement(c_doc, name_utf)
10515  *     if c_node is NULL:             # <<<<<<<<<<<<<<
10516  *         if doc is None and c_doc is not NULL:
10517  *             tree.xmlFreeDoc(c_doc)
10518  */
10519   __pyx_t_3 = (__pyx_v_c_node == NULL);
10520   if (__pyx_t_3) {
10521
10522     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":118
10523  *     c_node = _createElement(c_doc, name_utf)
10524  *     if c_node is NULL:
10525  *         if doc is None and c_doc is not NULL:             # <<<<<<<<<<<<<<
10526  *             tree.xmlFreeDoc(c_doc)
10527  *         return python.PyErr_NoMemory()
10528  */
10529     __pyx_t_3 = (((PyObject *)__pyx_v_doc) == Py_None);
10530     if (__pyx_t_3) {
10531       __pyx_t_1 = (__pyx_v_c_doc != NULL);
10532     } else {
10533       __pyx_t_1 = __pyx_t_3;
10534     }
10535     if (__pyx_t_1) {
10536
10537       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":119
10538  *     if c_node is NULL:
10539  *         if doc is None and c_doc is not NULL:
10540  *             tree.xmlFreeDoc(c_doc)             # <<<<<<<<<<<<<<
10541  *         return python.PyErr_NoMemory()
10542  *     try:
10543  */
10544       xmlFreeDoc(__pyx_v_c_doc);
10545       goto __pyx_L8;
10546     }
10547     __pyx_L8:;
10548
10549     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":120
10550  *         if doc is None and c_doc is not NULL:
10551  *             tree.xmlFreeDoc(c_doc)
10552  *         return python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
10553  *     try:
10554  *         if doc is None:
10555  */
10556     __Pyx_XDECREF(((PyObject *)__pyx_r));
10557     __pyx_t_2 = PyErr_NoMemory(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10558     __Pyx_GOTREF(__pyx_t_2);
10559     if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10560     __pyx_r = ((struct LxmlElement *)__pyx_t_2);
10561     __pyx_t_2 = 0;
10562     goto __pyx_L0;
10563     goto __pyx_L7;
10564   }
10565   __pyx_L7:;
10566
10567   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":121
10568  *             tree.xmlFreeDoc(c_doc)
10569  *         return python.PyErr_NoMemory()
10570  *     try:             # <<<<<<<<<<<<<<
10571  *         if doc is None:
10572  *             tree.xmlDocSetRootElement(c_doc, c_node)
10573  */
10574   {
10575     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
10576     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
10577     __Pyx_XGOTREF(__pyx_save_exc_type);
10578     __Pyx_XGOTREF(__pyx_save_exc_value);
10579     __Pyx_XGOTREF(__pyx_save_exc_tb);
10580     /*try:*/ {
10581
10582       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":122
10583  *         return python.PyErr_NoMemory()
10584  *     try:
10585  *         if doc is None:             # <<<<<<<<<<<<<<
10586  *             tree.xmlDocSetRootElement(c_doc, c_node)
10587  *             doc = _documentFactory(c_doc, parser)
10588  */
10589       __pyx_t_1 = (((PyObject *)__pyx_v_doc) == Py_None);
10590       if (__pyx_t_1) {
10591
10592         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":123
10593  *     try:
10594  *         if doc is None:
10595  *             tree.xmlDocSetRootElement(c_doc, c_node)             # <<<<<<<<<<<<<<
10596  *             doc = _documentFactory(c_doc, parser)
10597  *         if text is not None:
10598  */
10599         xmlDocSetRootElement(__pyx_v_c_doc, __pyx_v_c_node);
10600
10601         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":124
10602  *         if doc is None:
10603  *             tree.xmlDocSetRootElement(c_doc, c_node)
10604  *             doc = _documentFactory(c_doc, parser)             # <<<<<<<<<<<<<<
10605  *         if text is not None:
10606  *             _setNodeText(c_node, text)
10607  */
10608         __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, __pyx_v_parser)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
10609         __Pyx_GOTREF(__pyx_t_2);
10610         __Pyx_DECREF(((PyObject *)__pyx_v_doc));
10611         __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_2);
10612         __pyx_t_2 = 0;
10613         goto __pyx_L17;
10614       }
10615       __pyx_L17:;
10616
10617       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":125
10618  *             tree.xmlDocSetRootElement(c_doc, c_node)
10619  *             doc = _documentFactory(c_doc, parser)
10620  *         if text is not None:             # <<<<<<<<<<<<<<
10621  *             _setNodeText(c_node, text)
10622  *         if tail is not None:
10623  */
10624       __pyx_t_1 = (__pyx_v_text != Py_None);
10625       if (__pyx_t_1) {
10626
10627         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":126
10628  *             doc = _documentFactory(c_doc, parser)
10629  *         if text is not None:
10630  *             _setNodeText(c_node, text)             # <<<<<<<<<<<<<<
10631  *         if tail is not None:
10632  *             _setTailText(c_node, tail)
10633  */
10634         __pyx_t_4 = __pyx_f_4lxml_5etree__setNodeText(__pyx_v_c_node, __pyx_v_text); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
10635         goto __pyx_L18;
10636       }
10637       __pyx_L18:;
10638
10639       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":127
10640  *         if text is not None:
10641  *             _setNodeText(c_node, text)
10642  *         if tail is not None:             # <<<<<<<<<<<<<<
10643  *             _setTailText(c_node, tail)
10644  *         # add namespaces to node if necessary
10645  */
10646       __pyx_t_1 = (__pyx_v_tail != Py_None);
10647       if (__pyx_t_1) {
10648
10649         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":128
10650  *             _setNodeText(c_node, text)
10651  *         if tail is not None:
10652  *             _setTailText(c_node, tail)             # <<<<<<<<<<<<<<
10653  *         # add namespaces to node if necessary
10654  *         _initNodeNamespaces(c_node, doc, ns_utf, nsmap)
10655  */
10656         __pyx_t_4 = __pyx_f_4lxml_5etree__setTailText(__pyx_v_c_node, __pyx_v_tail); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
10657         goto __pyx_L19;
10658       }
10659       __pyx_L19:;
10660
10661       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":130
10662  *             _setTailText(c_node, tail)
10663  *         # add namespaces to node if necessary
10664  *         _initNodeNamespaces(c_node, doc, ns_utf, nsmap)             # <<<<<<<<<<<<<<
10665  *         _initNodeAttributes(c_node, doc, attrib, extra_attrs)
10666  *         return _elementFactory(doc, c_node)
10667  */
10668       __pyx_t_4 = __pyx_f_4lxml_5etree__initNodeNamespaces(__pyx_v_c_node, __pyx_v_doc, __pyx_v_ns_utf, __pyx_v_nsmap); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
10669
10670       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":131
10671  *         # add namespaces to node if necessary
10672  *         _initNodeNamespaces(c_node, doc, ns_utf, nsmap)
10673  *         _initNodeAttributes(c_node, doc, attrib, extra_attrs)             # <<<<<<<<<<<<<<
10674  *         return _elementFactory(doc, c_node)
10675  *     except:
10676  */
10677       __pyx_t_2 = __pyx_f_4lxml_5etree__initNodeAttributes(__pyx_v_c_node, __pyx_v_doc, __pyx_v_attrib, __pyx_v_extra_attrs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
10678       __Pyx_GOTREF(__pyx_t_2);
10679       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10680
10681       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":132
10682  *         _initNodeNamespaces(c_node, doc, ns_utf, nsmap)
10683  *         _initNodeAttributes(c_node, doc, attrib, extra_attrs)
10684  *         return _elementFactory(doc, c_node)             # <<<<<<<<<<<<<<
10685  *     except:
10686  *         # free allocated c_node/c_doc unless Python does it for us
10687  */
10688       __Pyx_XDECREF(((PyObject *)__pyx_r));
10689       __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
10690       __Pyx_GOTREF(__pyx_t_2);
10691       __pyx_r = ((struct LxmlElement *)__pyx_t_2);
10692       __pyx_t_2 = 0;
10693       goto __pyx_L13_try_return;
10694     }
10695     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
10696     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
10697     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
10698     goto __pyx_L16_try_end;
10699     __pyx_L13_try_return:;
10700     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
10701     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
10702     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
10703     goto __pyx_L0;
10704     __pyx_L9_error:;
10705     __Pyx_XDECREF(__pyx_1); __pyx_1 = 0;
10706     __Pyx_XDECREF(__pyx_2); __pyx_2 = 0;
10707     __Pyx_XDECREF(__pyx_3); __pyx_3 = 0;
10708     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
10709
10710     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":133
10711  *         _initNodeAttributes(c_node, doc, attrib, extra_attrs)
10712  *         return _elementFactory(doc, c_node)
10713  *     except:             # <<<<<<<<<<<<<<
10714  *         # free allocated c_node/c_doc unless Python does it for us
10715  *         if c_node.doc is not c_doc:
10716  */
10717     /*except:*/ {
10718       __Pyx_AddTraceback("lxml.etree._makeElement");
10719       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_8, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
10720       __Pyx_GOTREF(__pyx_t_2);
10721       __Pyx_GOTREF(__pyx_t_8);
10722       __Pyx_GOTREF(__pyx_t_9);
10723
10724       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":135
10725  *     except:
10726  *         # free allocated c_node/c_doc unless Python does it for us
10727  *         if c_node.doc is not c_doc:             # <<<<<<<<<<<<<<
10728  *             # node not yet in document => will not be freed by document
10729  *             if tail is not None:
10730  */
10731       __pyx_t_1 = (__pyx_v_c_node->doc != __pyx_v_c_doc);
10732       if (__pyx_t_1) {
10733
10734         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":137
10735  *         if c_node.doc is not c_doc:
10736  *             # node not yet in document => will not be freed by document
10737  *             if tail is not None:             # <<<<<<<<<<<<<<
10738  *                 _removeText(c_node.next) # tail
10739  *             tree.xmlFreeNode(c_node)
10740  */
10741         __pyx_t_1 = (__pyx_v_tail != Py_None);
10742         if (__pyx_t_1) {
10743
10744           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":138
10745  *             # node not yet in document => will not be freed by document
10746  *             if tail is not None:
10747  *                 _removeText(c_node.next) # tail             # <<<<<<<<<<<<<<
10748  *             tree.xmlFreeNode(c_node)
10749  *         if doc is None:
10750  */
10751           __pyx_f_4lxml_5etree__removeText(__pyx_v_c_node->next);
10752           goto __pyx_L23;
10753         }
10754         __pyx_L23:;
10755
10756         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":139
10757  *             if tail is not None:
10758  *                 _removeText(c_node.next) # tail
10759  *             tree.xmlFreeNode(c_node)             # <<<<<<<<<<<<<<
10760  *         if doc is None:
10761  *             # c_doc will not be freed by doc
10762  */
10763         xmlFreeNode(__pyx_v_c_node);
10764         goto __pyx_L22;
10765       }
10766       __pyx_L22:;
10767
10768       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":140
10769  *                 _removeText(c_node.next) # tail
10770  *             tree.xmlFreeNode(c_node)
10771  *         if doc is None:             # <<<<<<<<<<<<<<
10772  *             # c_doc will not be freed by doc
10773  *             tree.xmlFreeDoc(c_doc)
10774  */
10775       __pyx_t_1 = (((PyObject *)__pyx_v_doc) == Py_None);
10776       if (__pyx_t_1) {
10777
10778         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":142
10779  *         if doc is None:
10780  *             # c_doc will not be freed by doc
10781  *             tree.xmlFreeDoc(c_doc)             # <<<<<<<<<<<<<<
10782  *         raise
10783  * 
10784  */
10785         xmlFreeDoc(__pyx_v_c_doc);
10786         goto __pyx_L24;
10787       }
10788       __pyx_L24:;
10789
10790       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":143
10791  *             # c_doc will not be freed by doc
10792  *             tree.xmlFreeDoc(c_doc)
10793  *         raise             # <<<<<<<<<<<<<<
10794  * 
10795  * cdef int _initNewElement(_Element element, bint is_html, name_utf, ns_utf,
10796  */
10797       __Pyx_Raise(__pyx_t_2, __pyx_t_8, __pyx_t_9);
10798       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
10799       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10800       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10801       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10802       goto __pyx_L10_exception_handled;
10803     }
10804     __pyx_L11_except_error:;
10805     __Pyx_XDECREF(__pyx_save_exc_type);
10806     __Pyx_XDECREF(__pyx_save_exc_value);
10807     __Pyx_XDECREF(__pyx_save_exc_tb);
10808     goto __pyx_L1_error;
10809     __pyx_L10_exception_handled:;
10810     __Pyx_XGIVEREF(__pyx_save_exc_type);
10811     __Pyx_XGIVEREF(__pyx_save_exc_value);
10812     __Pyx_XGIVEREF(__pyx_save_exc_tb);
10813     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
10814     __pyx_L16_try_end:;
10815   }
10816
10817   __pyx_r = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
10818   goto __pyx_L0;
10819   __pyx_L1_error:;
10820   __Pyx_XDECREF(__pyx_1);
10821   __Pyx_XDECREF(__pyx_2);
10822   __Pyx_XDECREF(__pyx_3);
10823   __Pyx_XDECREF(__pyx_t_2);
10824   __Pyx_XDECREF(__pyx_t_8);
10825   __Pyx_XDECREF(__pyx_t_9);
10826   __Pyx_AddTraceback("lxml.etree._makeElement");
10827   __pyx_r = 0;
10828   __pyx_L0:;
10829   __Pyx_DECREF(__pyx_v_ns_utf);
10830   __Pyx_DECREF(__pyx_v_name_utf);
10831   __Pyx_DECREF((PyObject *)__pyx_v_doc);
10832   __Pyx_XGIVEREF((PyObject *)__pyx_r);
10833   __Pyx_FinishRefcountContext();
10834   return __pyx_r;
10835 }
10836
10837 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":145
10838  *         raise
10839  * 
10840  * cdef int _initNewElement(_Element element, bint is_html, name_utf, ns_utf,             # <<<<<<<<<<<<<<
10841  *                          _BaseParser parser, attrib, nsmap, extra_attrs) except -1:
10842  *     u"""Initialise a new Element object.
10843  */
10844
10845 static  int __pyx_f_4lxml_5etree__initNewElement(struct LxmlElement *__pyx_v_element, int __pyx_v_is_html, PyObject *__pyx_v_name_utf, PyObject *__pyx_v_ns_utf, struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser, PyObject *__pyx_v_attrib, PyObject *__pyx_v_nsmap, PyObject *__pyx_v_extra_attrs) {
10846   xmlDoc *__pyx_v_c_doc;
10847   xmlNode *__pyx_v_c_node;
10848   struct LxmlDocument *__pyx_v_doc;
10849   int __pyx_r;
10850   int __pyx_t_1;
10851   int __pyx_t_2;
10852   xmlDoc *__pyx_t_3;
10853   xmlDoc *__pyx_t_4;
10854   xmlNode *__pyx_t_5;
10855   PyObject *__pyx_t_6 = NULL;
10856   PyObject *__pyx_t_7 = NULL;
10857   __Pyx_SetupRefcountContext("_initNewElement");
10858   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
10859
10860   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":155
10861  *     cdef xmlNode* c_node
10862  *     cdef _Document doc
10863  *     if is_html:             # <<<<<<<<<<<<<<
10864  *         _htmlTagValidOrRaise(name_utf)
10865  *         c_doc = _newHTMLDoc()
10866  */
10867   __pyx_t_1 = __pyx_v_is_html;
10868   if (__pyx_t_1) {
10869
10870     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":156
10871  *     cdef _Document doc
10872  *     if is_html:
10873  *         _htmlTagValidOrRaise(name_utf)             # <<<<<<<<<<<<<<
10874  *         c_doc = _newHTMLDoc()
10875  *     else:
10876  */
10877     __pyx_t_2 = __pyx_f_4lxml_5etree__htmlTagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10878
10879     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":157
10880  *     if is_html:
10881  *         _htmlTagValidOrRaise(name_utf)
10882  *         c_doc = _newHTMLDoc()             # <<<<<<<<<<<<<<
10883  *     else:
10884  *         _tagValidOrRaise(name_utf)
10885  */
10886     __pyx_t_3 = __pyx_f_4lxml_5etree__newHTMLDoc(); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10887     __pyx_v_c_doc = __pyx_t_3;
10888     goto __pyx_L3;
10889   }
10890   /*else*/ {
10891
10892     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":159
10893  *         c_doc = _newHTMLDoc()
10894  *     else:
10895  *         _tagValidOrRaise(name_utf)             # <<<<<<<<<<<<<<
10896  *         c_doc = _newXMLDoc()
10897  *     c_node = _createElement(c_doc, name_utf)
10898  */
10899     __pyx_t_2 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10900
10901     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":160
10902  *     else:
10903  *         _tagValidOrRaise(name_utf)
10904  *         c_doc = _newXMLDoc()             # <<<<<<<<<<<<<<
10905  *     c_node = _createElement(c_doc, name_utf)
10906  *     if c_node is NULL:
10907  */
10908     __pyx_t_4 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10909     __pyx_v_c_doc = __pyx_t_4;
10910   }
10911   __pyx_L3:;
10912
10913   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":161
10914  *         _tagValidOrRaise(name_utf)
10915  *         c_doc = _newXMLDoc()
10916  *     c_node = _createElement(c_doc, name_utf)             # <<<<<<<<<<<<<<
10917  *     if c_node is NULL:
10918  *         if c_doc is not NULL:
10919  */
10920   __pyx_t_5 = __pyx_f_4lxml_5etree__createElement(__pyx_v_c_doc, __pyx_v_name_utf); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10921   __pyx_v_c_node = __pyx_t_5;
10922
10923   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":162
10924  *         c_doc = _newXMLDoc()
10925  *     c_node = _createElement(c_doc, name_utf)
10926  *     if c_node is NULL:             # <<<<<<<<<<<<<<
10927  *         if c_doc is not NULL:
10928  *             tree.xmlFreeDoc(c_doc)
10929  */
10930   __pyx_t_1 = (__pyx_v_c_node == NULL);
10931   if (__pyx_t_1) {
10932
10933     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":163
10934  *     c_node = _createElement(c_doc, name_utf)
10935  *     if c_node is NULL:
10936  *         if c_doc is not NULL:             # <<<<<<<<<<<<<<
10937  *             tree.xmlFreeDoc(c_doc)
10938  *         return python.PyErr_NoMemory()
10939  */
10940     __pyx_t_1 = (__pyx_v_c_doc != NULL);
10941     if (__pyx_t_1) {
10942
10943       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":164
10944  *     if c_node is NULL:
10945  *         if c_doc is not NULL:
10946  *             tree.xmlFreeDoc(c_doc)             # <<<<<<<<<<<<<<
10947  *         return python.PyErr_NoMemory()
10948  *     tree.xmlDocSetRootElement(c_doc, c_node)
10949  */
10950       xmlFreeDoc(__pyx_v_c_doc);
10951       goto __pyx_L5;
10952     }
10953     __pyx_L5:;
10954
10955     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":165
10956  *         if c_doc is not NULL:
10957  *             tree.xmlFreeDoc(c_doc)
10958  *         return python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
10959  *     tree.xmlDocSetRootElement(c_doc, c_node)
10960  *     doc = _documentFactory(c_doc, parser)
10961  */
10962     __pyx_t_6 = PyErr_NoMemory(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10963     __Pyx_GOTREF(__pyx_t_6);
10964     __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10965     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10966     __pyx_r = __pyx_t_2;
10967     goto __pyx_L0;
10968     goto __pyx_L4;
10969   }
10970   __pyx_L4:;
10971
10972   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":166
10973  *             tree.xmlFreeDoc(c_doc)
10974  *         return python.PyErr_NoMemory()
10975  *     tree.xmlDocSetRootElement(c_doc, c_node)             # <<<<<<<<<<<<<<
10976  *     doc = _documentFactory(c_doc, parser)
10977  *     # add namespaces to node if necessary
10978  */
10979   xmlDocSetRootElement(__pyx_v_c_doc, __pyx_v_c_node);
10980
10981   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":167
10982  *         return python.PyErr_NoMemory()
10983  *     tree.xmlDocSetRootElement(c_doc, c_node)
10984  *     doc = _documentFactory(c_doc, parser)             # <<<<<<<<<<<<<<
10985  *     # add namespaces to node if necessary
10986  *     _initNodeNamespaces(c_node, doc, ns_utf, nsmap)
10987  */
10988   __pyx_t_6 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, __pyx_v_parser)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10989   __Pyx_GOTREF(__pyx_t_6);
10990   __Pyx_DECREF(((PyObject *)__pyx_v_doc));
10991   __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_6);
10992   __pyx_t_6 = 0;
10993
10994   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":169
10995  *     doc = _documentFactory(c_doc, parser)
10996  *     # add namespaces to node if necessary
10997  *     _initNodeNamespaces(c_node, doc, ns_utf, nsmap)             # <<<<<<<<<<<<<<
10998  *     _initNodeAttributes(c_node, doc, attrib, extra_attrs)
10999  *     _registerProxy(element, doc, c_node)
11000  */
11001   __pyx_t_2 = __pyx_f_4lxml_5etree__initNodeNamespaces(__pyx_v_c_node, __pyx_v_doc, __pyx_v_ns_utf, __pyx_v_nsmap); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11002
11003   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":170
11004  *     # add namespaces to node if necessary
11005  *     _initNodeNamespaces(c_node, doc, ns_utf, nsmap)
11006  *     _initNodeAttributes(c_node, doc, attrib, extra_attrs)             # <<<<<<<<<<<<<<
11007  *     _registerProxy(element, doc, c_node)
11008  *     element._init()
11009  */
11010   __pyx_t_6 = __pyx_f_4lxml_5etree__initNodeAttributes(__pyx_v_c_node, __pyx_v_doc, __pyx_v_attrib, __pyx_v_extra_attrs); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11011   __Pyx_GOTREF(__pyx_t_6);
11012   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11013
11014   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":171
11015  *     _initNodeNamespaces(c_node, doc, ns_utf, nsmap)
11016  *     _initNodeAttributes(c_node, doc, attrib, extra_attrs)
11017  *     _registerProxy(element, doc, c_node)             # <<<<<<<<<<<<<<
11018  *     element._init()
11019  *     return 0
11020  */
11021   __pyx_t_2 = __pyx_f_4lxml_5etree__registerProxy(__pyx_v_element, __pyx_v_doc, __pyx_v_c_node); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11022
11023   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":172
11024  *     _initNodeAttributes(c_node, doc, attrib, extra_attrs)
11025  *     _registerProxy(element, doc, c_node)
11026  *     element._init()             # <<<<<<<<<<<<<<
11027  *     return 0
11028  * 
11029  */
11030   __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_element), __pyx_kp__init); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11031   __Pyx_GOTREF(__pyx_t_6);
11032   __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11033   __Pyx_GOTREF(__pyx_t_7);
11034   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11035   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11036
11037   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":173
11038  *     _registerProxy(element, doc, c_node)
11039  *     element._init()
11040  *     return 0             # <<<<<<<<<<<<<<
11041  * 
11042  * cdef _Element _makeSubElement(_Element parent, tag, text, tail,
11043  */
11044   __pyx_r = 0;
11045   goto __pyx_L0;
11046
11047   __pyx_r = 0;
11048   goto __pyx_L0;
11049   __pyx_L1_error:;
11050   __Pyx_XDECREF(__pyx_t_6);
11051   __Pyx_XDECREF(__pyx_t_7);
11052   __Pyx_AddTraceback("lxml.etree._initNewElement");
11053   __pyx_r = -1;
11054   __pyx_L0:;
11055   __Pyx_DECREF((PyObject *)__pyx_v_doc);
11056   __Pyx_FinishRefcountContext();
11057   return __pyx_r;
11058 }
11059
11060 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":175
11061  *     return 0
11062  * 
11063  * cdef _Element _makeSubElement(_Element parent, tag, text, tail,             # <<<<<<<<<<<<<<
11064  *                               attrib, nsmap, extra_attrs):
11065  *     u"""Create a new child element and initialize text content, namespaces and
11066  */
11067
11068 static  struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlElement *__pyx_v_parent, PyObject *__pyx_v_tag, PyObject *__pyx_v_text, PyObject *__pyx_v_tail, PyObject *__pyx_v_attrib, PyObject *__pyx_v_nsmap, PyObject *__pyx_v_extra_attrs) {
11069   xmlNode *__pyx_v_c_node;
11070   xmlDoc *__pyx_v_c_doc;
11071   PyObject *__pyx_v_ns_utf;
11072   PyObject *__pyx_v_name_utf;
11073   struct LxmlElement *__pyx_r = NULL;
11074   PyObject *__pyx_1 = 0;
11075   PyObject *__pyx_2 = 0;
11076   PyObject *__pyx_3 = 0;
11077   int __pyx_t_1;
11078   int __pyx_t_2;
11079   int __pyx_t_3;
11080   PyObject *__pyx_t_4 = NULL;
11081   int __pyx_t_5;
11082   xmlNode *__pyx_t_6;
11083   PyObject *__pyx_t_7 = NULL;
11084   PyObject *__pyx_t_8 = NULL;
11085   __Pyx_SetupRefcountContext("_makeSubElement");
11086   __pyx_v_ns_utf = Py_None; __Pyx_INCREF(Py_None);
11087   __pyx_v_name_utf = Py_None; __Pyx_INCREF(Py_None);
11088
11089   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":182
11090  *     cdef xmlNode* c_node
11091  *     cdef xmlDoc* c_doc
11092  *     if parent is None or parent._doc is None:             # <<<<<<<<<<<<<<
11093  *         return None
11094  *     ns_utf, name_utf = _getNsTag(tag)
11095  */
11096   __pyx_t_1 = (((PyObject *)__pyx_v_parent) == Py_None);
11097   if (!__pyx_t_1) {
11098     __pyx_t_2 = (((PyObject *)__pyx_v_parent->_doc) == Py_None);
11099     __pyx_t_3 = __pyx_t_2;
11100   } else {
11101     __pyx_t_3 = __pyx_t_1;
11102   }
11103   if (__pyx_t_3) {
11104
11105     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":183
11106  *     cdef xmlDoc* c_doc
11107  *     if parent is None or parent._doc is None:
11108  *         return None             # <<<<<<<<<<<<<<
11109  *     ns_utf, name_utf = _getNsTag(tag)
11110  *     c_doc = parent._doc._c_doc
11111  */
11112     __Pyx_XDECREF(((PyObject *)__pyx_r));
11113     __Pyx_INCREF(Py_None);
11114     __pyx_r = ((struct LxmlElement *)Py_None);
11115     goto __pyx_L0;
11116     goto __pyx_L3;
11117   }
11118   __pyx_L3:;
11119
11120   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":184
11121  *     if parent is None or parent._doc is None:
11122  *         return None
11123  *     ns_utf, name_utf = _getNsTag(tag)             # <<<<<<<<<<<<<<
11124  *     c_doc = parent._doc._c_doc
11125  * 
11126  */
11127   __pyx_t_4 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_tag); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11128   __Pyx_GOTREF(__pyx_t_4);
11129   if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 2)) {
11130     PyObject* tuple = __pyx_t_4;
11131     __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
11132     __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
11133     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11134     __Pyx_DECREF(__pyx_v_ns_utf);
11135     __pyx_v_ns_utf = __pyx_2;
11136     __pyx_2 = 0;
11137     __Pyx_DECREF(__pyx_v_name_utf);
11138     __pyx_v_name_utf = __pyx_3;
11139     __pyx_3 = 0;
11140   } else {
11141     __pyx_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11142     __Pyx_GOTREF(__pyx_1);
11143     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11144     __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11145     __Pyx_GOTREF(__pyx_2);
11146     __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11147     __Pyx_GOTREF(__pyx_3);
11148     if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11149     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
11150     __Pyx_DECREF(__pyx_v_ns_utf);
11151     __pyx_v_ns_utf = __pyx_2;
11152     __pyx_2 = 0;
11153     __Pyx_DECREF(__pyx_v_name_utf);
11154     __pyx_v_name_utf = __pyx_3;
11155     __pyx_3 = 0;
11156   }
11157
11158   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":185
11159  *         return None
11160  *     ns_utf, name_utf = _getNsTag(tag)
11161  *     c_doc = parent._doc._c_doc             # <<<<<<<<<<<<<<
11162  * 
11163  *     if parent._doc._parser is not None and parent._doc._parser._for_html:
11164  */
11165   __pyx_v_c_doc = __pyx_v_parent->_doc->_c_doc;
11166
11167   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":187
11168  *     c_doc = parent._doc._c_doc
11169  * 
11170  *     if parent._doc._parser is not None and parent._doc._parser._for_html:             # <<<<<<<<<<<<<<
11171  *         _htmlTagValidOrRaise(name_utf)
11172  *     else:
11173  */
11174   __pyx_t_3 = (((PyObject *)__pyx_v_parent->_doc->_parser) != Py_None);
11175   if (__pyx_t_3) {
11176     __pyx_t_1 = __pyx_v_parent->_doc->_parser->_for_html;
11177   } else {
11178     __pyx_t_1 = __pyx_t_3;
11179   }
11180   if (__pyx_t_1) {
11181
11182     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":188
11183  * 
11184  *     if parent._doc._parser is not None and parent._doc._parser._for_html:
11185  *         _htmlTagValidOrRaise(name_utf)             # <<<<<<<<<<<<<<
11186  *     else:
11187  *         _tagValidOrRaise(name_utf)
11188  */
11189     __pyx_t_5 = __pyx_f_4lxml_5etree__htmlTagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11190     goto __pyx_L4;
11191   }
11192   /*else*/ {
11193
11194     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":190
11195  *         _htmlTagValidOrRaise(name_utf)
11196  *     else:
11197  *         _tagValidOrRaise(name_utf)             # <<<<<<<<<<<<<<
11198  * 
11199  *     c_node = _createElement(c_doc, name_utf)
11200  */
11201     __pyx_t_5 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11202   }
11203   __pyx_L4:;
11204
11205   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":192
11206  *         _tagValidOrRaise(name_utf)
11207  * 
11208  *     c_node = _createElement(c_doc, name_utf)             # <<<<<<<<<<<<<<
11209  *     if c_node is NULL:
11210  *         return python.PyErr_NoMemory()
11211  */
11212   __pyx_t_6 = __pyx_f_4lxml_5etree__createElement(__pyx_v_c_doc, __pyx_v_name_utf); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11213   __pyx_v_c_node = __pyx_t_6;
11214
11215   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":193
11216  * 
11217  *     c_node = _createElement(c_doc, name_utf)
11218  *     if c_node is NULL:             # <<<<<<<<<<<<<<
11219  *         return python.PyErr_NoMemory()
11220  *     tree.xmlAddChild(parent._c_node, c_node)
11221  */
11222   __pyx_t_1 = (__pyx_v_c_node == NULL);
11223   if (__pyx_t_1) {
11224
11225     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":194
11226  *     c_node = _createElement(c_doc, name_utf)
11227  *     if c_node is NULL:
11228  *         return python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
11229  *     tree.xmlAddChild(parent._c_node, c_node)
11230  * 
11231  */
11232     __Pyx_XDECREF(((PyObject *)__pyx_r));
11233     __pyx_t_4 = PyErr_NoMemory(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11234     __Pyx_GOTREF(__pyx_t_4);
11235     if (!(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11236     __pyx_r = ((struct LxmlElement *)__pyx_t_4);
11237     __pyx_t_4 = 0;
11238     goto __pyx_L0;
11239     goto __pyx_L5;
11240   }
11241   __pyx_L5:;
11242
11243   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":195
11244  *     if c_node is NULL:
11245  *         return python.PyErr_NoMemory()
11246  *     tree.xmlAddChild(parent._c_node, c_node)             # <<<<<<<<<<<<<<
11247  * 
11248  *     try:
11249  */
11250   xmlAddChild(__pyx_v_parent->_c_node, __pyx_v_c_node);
11251
11252   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":197
11253  *     tree.xmlAddChild(parent._c_node, c_node)
11254  * 
11255  *     try:             # <<<<<<<<<<<<<<
11256  *         if text is not None:
11257  *             _setNodeText(c_node, text)
11258  */
11259   {
11260     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
11261     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
11262     __Pyx_XGOTREF(__pyx_save_exc_type);
11263     __Pyx_XGOTREF(__pyx_save_exc_value);
11264     __Pyx_XGOTREF(__pyx_save_exc_tb);
11265     /*try:*/ {
11266
11267       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":198
11268  * 
11269  *     try:
11270  *         if text is not None:             # <<<<<<<<<<<<<<
11271  *             _setNodeText(c_node, text)
11272  *         if tail is not None:
11273  */
11274       __pyx_t_1 = (__pyx_v_text != Py_None);
11275       if (__pyx_t_1) {
11276
11277         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":199
11278  *     try:
11279  *         if text is not None:
11280  *             _setNodeText(c_node, text)             # <<<<<<<<<<<<<<
11281  *         if tail is not None:
11282  *             _setTailText(c_node, tail)
11283  */
11284         __pyx_t_5 = __pyx_f_4lxml_5etree__setNodeText(__pyx_v_c_node, __pyx_v_text); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
11285         goto __pyx_L14;
11286       }
11287       __pyx_L14:;
11288
11289       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":200
11290  *         if text is not None:
11291  *             _setNodeText(c_node, text)
11292  *         if tail is not None:             # <<<<<<<<<<<<<<
11293  *             _setTailText(c_node, tail)
11294  * 
11295  */
11296       __pyx_t_1 = (__pyx_v_tail != Py_None);
11297       if (__pyx_t_1) {
11298
11299         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":201
11300  *             _setNodeText(c_node, text)
11301  *         if tail is not None:
11302  *             _setTailText(c_node, tail)             # <<<<<<<<<<<<<<
11303  * 
11304  *         # add namespaces to node if necessary
11305  */
11306         __pyx_t_5 = __pyx_f_4lxml_5etree__setTailText(__pyx_v_c_node, __pyx_v_tail); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
11307         goto __pyx_L15;
11308       }
11309       __pyx_L15:;
11310
11311       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":204
11312  * 
11313  *         # add namespaces to node if necessary
11314  *         _initNodeNamespaces(c_node, parent._doc, ns_utf, nsmap)             # <<<<<<<<<<<<<<
11315  *         _initNodeAttributes(c_node, parent._doc, attrib, extra_attrs)
11316  *         return _elementFactory(parent._doc, c_node)
11317  */
11318       __pyx_t_5 = __pyx_f_4lxml_5etree__initNodeNamespaces(__pyx_v_c_node, __pyx_v_parent->_doc, __pyx_v_ns_utf, __pyx_v_nsmap); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
11319
11320       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":205
11321  *         # add namespaces to node if necessary
11322  *         _initNodeNamespaces(c_node, parent._doc, ns_utf, nsmap)
11323  *         _initNodeAttributes(c_node, parent._doc, attrib, extra_attrs)             # <<<<<<<<<<<<<<
11324  *         return _elementFactory(parent._doc, c_node)
11325  *     except:
11326  */
11327       __pyx_t_4 = __pyx_f_4lxml_5etree__initNodeAttributes(__pyx_v_c_node, __pyx_v_parent->_doc, __pyx_v_attrib, __pyx_v_extra_attrs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
11328       __Pyx_GOTREF(__pyx_t_4);
11329       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11330
11331       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":206
11332  *         _initNodeNamespaces(c_node, parent._doc, ns_utf, nsmap)
11333  *         _initNodeAttributes(c_node, parent._doc, attrib, extra_attrs)
11334  *         return _elementFactory(parent._doc, c_node)             # <<<<<<<<<<<<<<
11335  *     except:
11336  *         # make sure we clean up in case of an error
11337  */
11338       __Pyx_XDECREF(((PyObject *)__pyx_r));
11339       __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_parent->_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
11340       __Pyx_GOTREF(__pyx_t_4);
11341       __pyx_r = ((struct LxmlElement *)__pyx_t_4);
11342       __pyx_t_4 = 0;
11343       goto __pyx_L10_try_return;
11344     }
11345     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
11346     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
11347     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
11348     goto __pyx_L13_try_end;
11349     __pyx_L10_try_return:;
11350     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
11351     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
11352     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
11353     goto __pyx_L0;
11354     __pyx_L6_error:;
11355     __Pyx_XDECREF(__pyx_1); __pyx_1 = 0;
11356     __Pyx_XDECREF(__pyx_2); __pyx_2 = 0;
11357     __Pyx_XDECREF(__pyx_3); __pyx_3 = 0;
11358     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11359
11360     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":207
11361  *         _initNodeAttributes(c_node, parent._doc, attrib, extra_attrs)
11362  *         return _elementFactory(parent._doc, c_node)
11363  *     except:             # <<<<<<<<<<<<<<
11364  *         # make sure we clean up in case of an error
11365  *         _removeNode(parent._doc, c_node)
11366  */
11367     /*except:*/ {
11368       __Pyx_AddTraceback("lxml.etree._makeSubElement");
11369       if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
11370       __Pyx_GOTREF(__pyx_t_4);
11371       __Pyx_GOTREF(__pyx_t_7);
11372       __Pyx_GOTREF(__pyx_t_8);
11373
11374       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":209
11375  *     except:
11376  *         # make sure we clean up in case of an error
11377  *         _removeNode(parent._doc, c_node)             # <<<<<<<<<<<<<<
11378  *         raise
11379  * 
11380  */
11381       __pyx_t_5 = __pyx_f_4lxml_5etree__removeNode(__pyx_v_parent->_doc, __pyx_v_c_node); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
11382
11383       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":210
11384  *         # make sure we clean up in case of an error
11385  *         _removeNode(parent._doc, c_node)
11386  *         raise             # <<<<<<<<<<<<<<
11387  * 
11388  * cdef int _initNodeNamespaces(xmlNode* c_node, _Document doc,
11389  */
11390       __Pyx_Raise(__pyx_t_4, __pyx_t_7, __pyx_t_8);
11391       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
11392       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11393       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11394       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11395       goto __pyx_L7_exception_handled;
11396     }
11397     __pyx_L8_except_error:;
11398     __Pyx_XDECREF(__pyx_save_exc_type);
11399     __Pyx_XDECREF(__pyx_save_exc_value);
11400     __Pyx_XDECREF(__pyx_save_exc_tb);
11401     goto __pyx_L1_error;
11402     __pyx_L7_exception_handled:;
11403     __Pyx_XGIVEREF(__pyx_save_exc_type);
11404     __Pyx_XGIVEREF(__pyx_save_exc_value);
11405     __Pyx_XGIVEREF(__pyx_save_exc_tb);
11406     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
11407     __pyx_L13_try_end:;
11408   }
11409
11410   __pyx_r = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
11411   goto __pyx_L0;
11412   __pyx_L1_error:;
11413   __Pyx_XDECREF(__pyx_1);
11414   __Pyx_XDECREF(__pyx_2);
11415   __Pyx_XDECREF(__pyx_3);
11416   __Pyx_XDECREF(__pyx_t_4);
11417   __Pyx_XDECREF(__pyx_t_7);
11418   __Pyx_XDECREF(__pyx_t_8);
11419   __Pyx_AddTraceback("lxml.etree._makeSubElement");
11420   __pyx_r = 0;
11421   __pyx_L0:;
11422   __Pyx_DECREF(__pyx_v_ns_utf);
11423   __Pyx_DECREF(__pyx_v_name_utf);
11424   __Pyx_XGIVEREF((PyObject *)__pyx_r);
11425   __Pyx_FinishRefcountContext();
11426   return __pyx_r;
11427 }
11428
11429 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":212
11430  *         raise
11431  * 
11432  * cdef int _initNodeNamespaces(xmlNode* c_node, _Document doc,             # <<<<<<<<<<<<<<
11433  *                              object node_ns_utf, object nsmap) except -1:
11434  *     u"""Lookup current namespace prefixes, then set namespace structure for
11435  */
11436
11437 static  int __pyx_f_4lxml_5etree__initNodeNamespaces(xmlNode *__pyx_v_c_node, struct LxmlDocument *__pyx_v_doc, PyObject *__pyx_v_node_ns_utf, PyObject *__pyx_v_nsmap) {
11438   xmlNs *__pyx_v_c_ns;
11439   char *__pyx_v_c_prefix;
11440   char *__pyx_v_c_href;
11441   PyObject *__pyx_v_nsdefs;
11442   PyObject *__pyx_v_item;
11443   PyObject *__pyx_v_prefix;
11444   PyObject *__pyx_v_href;
11445   PyObject *__pyx_v_href_utf;
11446   PyObject *__pyx_v_prefix_utf;
11447   int __pyx_r;
11448   PyObject *__pyx_1 = 0;
11449   PyObject *__pyx_2 = 0;
11450   PyObject *__pyx_3 = 0;
11451   int __pyx_t_1;
11452   int __pyx_t_2;
11453   int __pyx_t_3;
11454   PyObject *__pyx_t_4 = NULL;
11455   PyObject *__pyx_t_5 = NULL;
11456   PyObject *__pyx_t_6 = NULL;
11457   Py_ssize_t __pyx_t_7;
11458   __Pyx_SetupRefcountContext("_initNodeNamespaces");
11459   __Pyx_INCREF(__pyx_v_node_ns_utf);
11460   __pyx_v_nsdefs = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
11461   __pyx_v_item = Py_None; __Pyx_INCREF(Py_None);
11462   __pyx_v_prefix = Py_None; __Pyx_INCREF(Py_None);
11463   __pyx_v_href = Py_None; __Pyx_INCREF(Py_None);
11464   __pyx_v_href_utf = Py_None; __Pyx_INCREF(Py_None);
11465   __pyx_v_prefix_utf = Py_None; __Pyx_INCREF(Py_None);
11466
11467   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":223
11468  *     cdef char*  c_href
11469  *     cdef list nsdefs
11470  *     if not nsmap:             # <<<<<<<<<<<<<<
11471  *         if node_ns_utf is not None:
11472  *             doc._setNodeNs(c_node, _cstr(node_ns_utf))
11473  */
11474   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_nsmap); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11475   __pyx_t_2 = (!__pyx_t_1);
11476   if (__pyx_t_2) {
11477
11478     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":224
11479  *     cdef list nsdefs
11480  *     if not nsmap:
11481  *         if node_ns_utf is not None:             # <<<<<<<<<<<<<<
11482  *             doc._setNodeNs(c_node, _cstr(node_ns_utf))
11483  *         return 0
11484  */
11485     __pyx_t_2 = (__pyx_v_node_ns_utf != Py_None);
11486     if (__pyx_t_2) {
11487
11488       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":225
11489  *     if not nsmap:
11490  *         if node_ns_utf is not None:
11491  *             doc._setNodeNs(c_node, _cstr(node_ns_utf))             # <<<<<<<<<<<<<<
11492  *         return 0
11493  * 
11494  */
11495       __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_doc->__pyx_vtab)->_setNodeNs(__pyx_v_doc, __pyx_v_c_node, PyString_AS_STRING(__pyx_v_node_ns_utf)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11496       goto __pyx_L4;
11497     }
11498     __pyx_L4:;
11499
11500     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":226
11501  *         if node_ns_utf is not None:
11502  *             doc._setNodeNs(c_node, _cstr(node_ns_utf))
11503  *         return 0             # <<<<<<<<<<<<<<
11504  * 
11505  *     nsdefs = list(nsmap.items())
11506  */
11507     __pyx_r = 0;
11508     goto __pyx_L0;
11509     goto __pyx_L3;
11510   }
11511   __pyx_L3:;
11512
11513   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":228
11514  *         return 0
11515  * 
11516  *     nsdefs = list(nsmap.items())             # <<<<<<<<<<<<<<
11517  *     if None in nsmap and python.PyList_GET_SIZE(nsdefs) > 1:
11518  *         # Move the default namespace to the end.  This makes sure libxml2
11519  */
11520   __pyx_t_4 = PyObject_GetAttr(__pyx_v_nsmap, __pyx_kp_items); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11521   __Pyx_GOTREF(__pyx_t_4);
11522   __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11523   __Pyx_GOTREF(__pyx_t_5);
11524   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11525   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11526   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
11527   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
11528   __Pyx_GIVEREF(__pyx_t_5);
11529   __pyx_t_5 = 0;
11530   __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)&PyList_Type)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11531   __Pyx_GOTREF(__pyx_t_5);
11532   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
11533   if (!(likely(PyList_CheckExact(__pyx_t_5)) || (__pyx_t_5) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected list, got %s", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11534   __Pyx_DECREF(((PyObject *)__pyx_v_nsdefs));
11535   __pyx_v_nsdefs = ((PyObject *)__pyx_t_5);
11536   __pyx_t_5 = 0;
11537
11538   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":229
11539  * 
11540  *     nsdefs = list(nsmap.items())
11541  *     if None in nsmap and python.PyList_GET_SIZE(nsdefs) > 1:             # <<<<<<<<<<<<<<
11542  *         # Move the default namespace to the end.  This makes sure libxml2
11543  *         # prefers a prefix if the ns is defined redundantly on the same
11544  */
11545   __pyx_t_2 = (PySequence_Contains(__pyx_v_nsmap, Py_None)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11546   if (__pyx_t_2) {
11547     __pyx_t_1 = (PyList_GET_SIZE(((PyObject *)__pyx_v_nsdefs)) > 1);
11548   } else {
11549     __pyx_t_1 = __pyx_t_2;
11550   }
11551   if (__pyx_t_1) {
11552
11553     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":236
11554  *         # elements serialise without prefix (i.e. into the non-default
11555  *         # namespace).
11556  *         item = (None, nsmap[None])             # <<<<<<<<<<<<<<
11557  *         nsdefs.remove(item)
11558  *         nsdefs.append(item)
11559  */
11560     __pyx_1 = PyObject_GetItem(__pyx_v_nsmap, Py_None); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11561     __Pyx_GOTREF(__pyx_1);
11562     __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11563     __Pyx_GOTREF(((PyObject *)__pyx_t_5));
11564     __Pyx_INCREF(Py_None);
11565     PyTuple_SET_ITEM(__pyx_t_5, 0, Py_None);
11566     __Pyx_GIVEREF(Py_None);
11567     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_1);
11568     __Pyx_GIVEREF(__pyx_1);
11569     __pyx_1 = 0;
11570     __Pyx_DECREF(__pyx_v_item);
11571     __pyx_v_item = ((PyObject *)__pyx_t_5);
11572     __pyx_t_5 = 0;
11573
11574     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":237
11575  *         # namespace).
11576  *         item = (None, nsmap[None])
11577  *         nsdefs.remove(item)             # <<<<<<<<<<<<<<
11578  *         nsdefs.append(item)
11579  * 
11580  */
11581     __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_nsdefs), __pyx_kp_remove); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11582     __Pyx_GOTREF(__pyx_t_5);
11583     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11584     __Pyx_GOTREF(((PyObject *)__pyx_t_4));
11585     __Pyx_INCREF(__pyx_v_item);
11586     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_item);
11587     __Pyx_GIVEREF(__pyx_v_item);
11588     __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11589     __Pyx_GOTREF(__pyx_t_6);
11590     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11591     __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
11592     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11593
11594     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":238
11595  *         item = (None, nsmap[None])
11596  *         nsdefs.remove(item)
11597  *         nsdefs.append(item)             # <<<<<<<<<<<<<<
11598  * 
11599  *     for prefix, href in nsdefs:
11600  */
11601     __pyx_t_3 = PyList_Append(((PyObject *)__pyx_v_nsdefs), __pyx_v_item); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11602     goto __pyx_L5;
11603   }
11604   __pyx_L5:;
11605
11606   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":240
11607  *         nsdefs.append(item)
11608  * 
11609  *     for prefix, href in nsdefs:             # <<<<<<<<<<<<<<
11610  *         href_utf = _utf8(href)
11611  *         c_href = _cstr(href_utf)
11612  */
11613   if (likely(((PyObject *)__pyx_v_nsdefs) != Py_None)) {
11614     __pyx_t_7 = 0; __pyx_t_6 = ((PyObject *)__pyx_v_nsdefs); __Pyx_INCREF(__pyx_t_6);
11615   } else {
11616     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11617   }
11618   for (;;) {
11619     if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
11620     __pyx_t_4 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++;
11621     if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 2)) {
11622       PyObject* tuple = __pyx_t_4;
11623       __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
11624       __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
11625       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11626       __Pyx_DECREF(__pyx_v_prefix);
11627       __pyx_v_prefix = __pyx_2;
11628       __pyx_2 = 0;
11629       __Pyx_DECREF(__pyx_v_href);
11630       __pyx_v_href = __pyx_3;
11631       __pyx_3 = 0;
11632     } else {
11633       __pyx_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11634       __Pyx_GOTREF(__pyx_1);
11635       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11636       __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11637       __Pyx_GOTREF(__pyx_2);
11638       __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11639       __Pyx_GOTREF(__pyx_3);
11640       if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11641       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
11642       __Pyx_DECREF(__pyx_v_prefix);
11643       __pyx_v_prefix = __pyx_2;
11644       __pyx_2 = 0;
11645       __Pyx_DECREF(__pyx_v_href);
11646       __pyx_v_href = __pyx_3;
11647       __pyx_3 = 0;
11648     }
11649
11650     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":241
11651  * 
11652  *     for prefix, href in nsdefs:
11653  *         href_utf = _utf8(href)             # <<<<<<<<<<<<<<
11654  *         c_href = _cstr(href_utf)
11655  *         if prefix is not None:
11656  */
11657     __pyx_t_4 = __pyx_f_4lxml_5etree__utf8(__pyx_v_href); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11658     __Pyx_GOTREF(__pyx_t_4);
11659     __Pyx_DECREF(__pyx_v_href_utf);
11660     __pyx_v_href_utf = __pyx_t_4;
11661     __pyx_t_4 = 0;
11662
11663     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":242
11664  *     for prefix, href in nsdefs:
11665  *         href_utf = _utf8(href)
11666  *         c_href = _cstr(href_utf)             # <<<<<<<<<<<<<<
11667  *         if prefix is not None:
11668  *             prefix_utf = _utf8(prefix)
11669  */
11670     __pyx_v_c_href = PyString_AS_STRING(__pyx_v_href_utf);
11671
11672     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":243
11673  *         href_utf = _utf8(href)
11674  *         c_href = _cstr(href_utf)
11675  *         if prefix is not None:             # <<<<<<<<<<<<<<
11676  *             prefix_utf = _utf8(prefix)
11677  *             _prefixValidOrRaise(prefix_utf)
11678  */
11679     __pyx_t_1 = (__pyx_v_prefix != Py_None);
11680     if (__pyx_t_1) {
11681
11682       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":244
11683  *         c_href = _cstr(href_utf)
11684  *         if prefix is not None:
11685  *             prefix_utf = _utf8(prefix)             # <<<<<<<<<<<<<<
11686  *             _prefixValidOrRaise(prefix_utf)
11687  *             c_prefix = _cstr(prefix_utf)
11688  */
11689       __pyx_t_4 = __pyx_f_4lxml_5etree__utf8(__pyx_v_prefix); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11690       __Pyx_GOTREF(__pyx_t_4);
11691       __Pyx_DECREF(__pyx_v_prefix_utf);
11692       __pyx_v_prefix_utf = __pyx_t_4;
11693       __pyx_t_4 = 0;
11694
11695       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":245
11696  *         if prefix is not None:
11697  *             prefix_utf = _utf8(prefix)
11698  *             _prefixValidOrRaise(prefix_utf)             # <<<<<<<<<<<<<<
11699  *             c_prefix = _cstr(prefix_utf)
11700  *         else:
11701  */
11702       __pyx_t_3 = __pyx_f_4lxml_5etree__prefixValidOrRaise(__pyx_v_prefix_utf); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11703
11704       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":246
11705  *             prefix_utf = _utf8(prefix)
11706  *             _prefixValidOrRaise(prefix_utf)
11707  *             c_prefix = _cstr(prefix_utf)             # <<<<<<<<<<<<<<
11708  *         else:
11709  *             c_prefix = NULL
11710  */
11711       __pyx_v_c_prefix = PyString_AS_STRING(__pyx_v_prefix_utf);
11712       goto __pyx_L8;
11713     }
11714     /*else*/ {
11715
11716       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":248
11717  *             c_prefix = _cstr(prefix_utf)
11718  *         else:
11719  *             c_prefix = NULL             # <<<<<<<<<<<<<<
11720  *         # add namespace with prefix if it is not already known
11721  *         c_ns = tree.xmlSearchNs(doc._c_doc, c_node, c_prefix)
11722  */
11723       __pyx_v_c_prefix = NULL;
11724     }
11725     __pyx_L8:;
11726
11727     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":250
11728  *             c_prefix = NULL
11729  *         # add namespace with prefix if it is not already known
11730  *         c_ns = tree.xmlSearchNs(doc._c_doc, c_node, c_prefix)             # <<<<<<<<<<<<<<
11731  *         if c_ns is NULL or \
11732  *                 c_ns.href is NULL or \
11733  */
11734     __pyx_v_c_ns = xmlSearchNs(__pyx_v_doc->_c_doc, __pyx_v_c_node, __pyx_v_c_prefix);
11735
11736     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":251
11737  *         # add namespace with prefix if it is not already known
11738  *         c_ns = tree.xmlSearchNs(doc._c_doc, c_node, c_prefix)
11739  *         if c_ns is NULL or \             # <<<<<<<<<<<<<<
11740  *                 c_ns.href is NULL or \
11741  *                 cstd.strcmp(c_ns.href, c_href) != 0:
11742  */
11743     if (!(__pyx_v_c_ns == NULL)) {
11744
11745       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":252
11746  *         c_ns = tree.xmlSearchNs(doc._c_doc, c_node, c_prefix)
11747  *         if c_ns is NULL or \
11748  *                 c_ns.href is NULL or \             # <<<<<<<<<<<<<<
11749  *                 cstd.strcmp(c_ns.href, c_href) != 0:
11750  *             c_ns = tree.xmlNewNs(c_node, c_href, c_prefix)
11751  */
11752       if (!(__pyx_v_c_ns->href == NULL)) {
11753
11754         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":253
11755  *         if c_ns is NULL or \
11756  *                 c_ns.href is NULL or \
11757  *                 cstd.strcmp(c_ns.href, c_href) != 0:             # <<<<<<<<<<<<<<
11758  *             c_ns = tree.xmlNewNs(c_node, c_href, c_prefix)
11759  *         if href_utf == node_ns_utf:
11760  */
11761         __pyx_t_1 = (strcmp(__pyx_v_c_ns->href, __pyx_v_c_href) != 0);
11762       } else {
11763         __pyx_t_1 = (__pyx_v_c_ns->href == NULL);
11764       }
11765       __pyx_t_2 = __pyx_t_1;
11766     } else {
11767       __pyx_t_2 = (__pyx_v_c_ns == NULL);
11768     }
11769     if (__pyx_t_2) {
11770
11771       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":254
11772  *                 c_ns.href is NULL or \
11773  *                 cstd.strcmp(c_ns.href, c_href) != 0:
11774  *             c_ns = tree.xmlNewNs(c_node, c_href, c_prefix)             # <<<<<<<<<<<<<<
11775  *         if href_utf == node_ns_utf:
11776  *             tree.xmlSetNs(c_node, c_ns)
11777  */
11778       __pyx_v_c_ns = xmlNewNs(__pyx_v_c_node, __pyx_v_c_href, __pyx_v_c_prefix);
11779       goto __pyx_L9;
11780     }
11781     __pyx_L9:;
11782
11783     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":255
11784  *                 cstd.strcmp(c_ns.href, c_href) != 0:
11785  *             c_ns = tree.xmlNewNs(c_node, c_href, c_prefix)
11786  *         if href_utf == node_ns_utf:             # <<<<<<<<<<<<<<
11787  *             tree.xmlSetNs(c_node, c_ns)
11788  *             node_ns_utf = None
11789  */
11790     __pyx_t_4 = PyObject_RichCompare(__pyx_v_href_utf, __pyx_v_node_ns_utf, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11791     __Pyx_GOTREF(__pyx_t_4);
11792     __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11793     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11794     if (__pyx_t_2) {
11795
11796       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":256
11797  *             c_ns = tree.xmlNewNs(c_node, c_href, c_prefix)
11798  *         if href_utf == node_ns_utf:
11799  *             tree.xmlSetNs(c_node, c_ns)             # <<<<<<<<<<<<<<
11800  *             node_ns_utf = None
11801  * 
11802  */
11803       xmlSetNs(__pyx_v_c_node, __pyx_v_c_ns);
11804
11805       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":257
11806  *         if href_utf == node_ns_utf:
11807  *             tree.xmlSetNs(c_node, c_ns)
11808  *             node_ns_utf = None             # <<<<<<<<<<<<<<
11809  * 
11810  *     if node_ns_utf is not None:
11811  */
11812       __Pyx_INCREF(Py_None);
11813       __Pyx_DECREF(__pyx_v_node_ns_utf);
11814       __pyx_v_node_ns_utf = Py_None;
11815       goto __pyx_L10;
11816     }
11817     __pyx_L10:;
11818   }
11819   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11820
11821   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":259
11822  *             node_ns_utf = None
11823  * 
11824  *     if node_ns_utf is not None:             # <<<<<<<<<<<<<<
11825  *         doc._setNodeNs(c_node, _cstr(node_ns_utf))
11826  *     return 0
11827  */
11828   __pyx_t_2 = (__pyx_v_node_ns_utf != Py_None);
11829   if (__pyx_t_2) {
11830
11831     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":260
11832  * 
11833  *     if node_ns_utf is not None:
11834  *         doc._setNodeNs(c_node, _cstr(node_ns_utf))             # <<<<<<<<<<<<<<
11835  *     return 0
11836  * 
11837  */
11838     __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_doc->__pyx_vtab)->_setNodeNs(__pyx_v_doc, __pyx_v_c_node, PyString_AS_STRING(__pyx_v_node_ns_utf)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11839     goto __pyx_L11;
11840   }
11841   __pyx_L11:;
11842
11843   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":261
11844  *     if node_ns_utf is not None:
11845  *         doc._setNodeNs(c_node, _cstr(node_ns_utf))
11846  *     return 0             # <<<<<<<<<<<<<<
11847  * 
11848  * cdef _initNodeAttributes(xmlNode* c_node, _Document doc, attrib, extra):
11849  */
11850   __pyx_r = 0;
11851   goto __pyx_L0;
11852
11853   __pyx_r = 0;
11854   goto __pyx_L0;
11855   __pyx_L1_error:;
11856   __Pyx_XDECREF(__pyx_1);
11857   __Pyx_XDECREF(__pyx_2);
11858   __Pyx_XDECREF(__pyx_3);
11859   __Pyx_XDECREF(__pyx_t_4);
11860   __Pyx_XDECREF(__pyx_t_5);
11861   __Pyx_XDECREF(__pyx_t_6);
11862   __Pyx_AddTraceback("lxml.etree._initNodeNamespaces");
11863   __pyx_r = -1;
11864   __pyx_L0:;
11865   __Pyx_DECREF(__pyx_v_nsdefs);
11866   __Pyx_DECREF(__pyx_v_item);
11867   __Pyx_DECREF(__pyx_v_prefix);
11868   __Pyx_DECREF(__pyx_v_href);
11869   __Pyx_DECREF(__pyx_v_href_utf);
11870   __Pyx_DECREF(__pyx_v_prefix_utf);
11871   __Pyx_DECREF(__pyx_v_node_ns_utf);
11872   __Pyx_FinishRefcountContext();
11873   return __pyx_r;
11874 }
11875
11876 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":263
11877  *     return 0
11878  * 
11879  * cdef _initNodeAttributes(xmlNode* c_node, _Document doc, attrib, extra):             # <<<<<<<<<<<<<<
11880  *     u"""Initialise the attributes of an element node.
11881  *     """
11882  */
11883
11884 static  PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_node, struct LxmlDocument *__pyx_v_doc, PyObject *__pyx_v_attrib, PyObject *__pyx_v_extra) {
11885   int __pyx_v_is_html;
11886   xmlNs *__pyx_v_c_ns;
11887   PyObject *__pyx_v_name;
11888   PyObject *__pyx_v_value;
11889   PyObject *__pyx_v_attr_ns_utf;
11890   PyObject *__pyx_v_attr_name_utf;
11891   PyObject *__pyx_v_value_utf;
11892   PyObject *__pyx_r = NULL;
11893   PyObject *__pyx_1 = 0;
11894   PyObject *__pyx_2 = 0;
11895   PyObject *__pyx_3 = 0;
11896   int __pyx_t_1;
11897   int __pyx_t_2;
11898   int __pyx_t_3;
11899   PyObject *__pyx_t_4 = NULL;
11900   PyObject *__pyx_t_5 = NULL;
11901   PyObject *__pyx_t_6 = NULL;
11902   Py_ssize_t __pyx_t_7;
11903   int __pyx_t_8;
11904   xmlNs *__pyx_t_9;
11905   __Pyx_SetupRefcountContext("_initNodeAttributes");
11906   __Pyx_INCREF(__pyx_v_attrib);
11907   __pyx_v_name = Py_None; __Pyx_INCREF(Py_None);
11908   __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);
11909   __pyx_v_attr_ns_utf = Py_None; __Pyx_INCREF(Py_None);
11910   __pyx_v_attr_name_utf = Py_None; __Pyx_INCREF(Py_None);
11911   __pyx_v_value_utf = Py_None; __Pyx_INCREF(Py_None);
11912
11913   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":269
11914  *     cdef xmlNs* c_ns
11915  *     # 'extra' is not checked here (expected to be a keyword dict)
11916  *     if attrib is not None and not hasattr(attrib, u'items'):             # <<<<<<<<<<<<<<
11917  *         raise TypeError, u"Invalid attribute dictionary: %s" % \
11918  *             python._fqtypename(attrib)
11919  */
11920   __pyx_t_1 = (__pyx_v_attrib != Py_None);
11921   if (__pyx_t_1) {
11922     __pyx_t_2 = PyObject_HasAttr(__pyx_v_attrib, ((PyObject *)__pyx_kp_238)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11923     __pyx_t_3 = (!__pyx_t_2);
11924   } else {
11925     __pyx_t_3 = __pyx_t_1;
11926   }
11927   if (__pyx_t_3) {
11928
11929     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":271
11930  *     if attrib is not None and not hasattr(attrib, u'items'):
11931  *         raise TypeError, u"Invalid attribute dictionary: %s" % \
11932  *             python._fqtypename(attrib)             # <<<<<<<<<<<<<<
11933  *     if extra is not None and extra:
11934  *         if attrib is None:
11935  */
11936     __pyx_t_4 = __Pyx_PyBytes_FromString(_fqtypename(__pyx_v_attrib)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11937     __Pyx_GOTREF(__pyx_t_4);
11938     __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_239), __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11939     __Pyx_GOTREF(__pyx_t_5);
11940     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11941     __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_5, 0);
11942     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11943     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11944     goto __pyx_L3;
11945   }
11946   __pyx_L3:;
11947
11948   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":272
11949  *         raise TypeError, u"Invalid attribute dictionary: %s" % \
11950  *             python._fqtypename(attrib)
11951  *     if extra is not None and extra:             # <<<<<<<<<<<<<<
11952  *         if attrib is None:
11953  *             attrib = extra
11954  */
11955   __pyx_t_3 = (__pyx_v_extra != Py_None);
11956   if (__pyx_t_3) {
11957     __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_extra); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11958     __pyx_t_2 = __pyx_t_1;
11959   } else {
11960     __pyx_t_2 = __pyx_t_3;
11961   }
11962   if (__pyx_t_2) {
11963
11964     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":273
11965  *             python._fqtypename(attrib)
11966  *     if extra is not None and extra:
11967  *         if attrib is None:             # <<<<<<<<<<<<<<
11968  *             attrib = extra
11969  *         else:
11970  */
11971     __pyx_t_2 = (__pyx_v_attrib == Py_None);
11972     if (__pyx_t_2) {
11973
11974       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":274
11975  *     if extra is not None and extra:
11976  *         if attrib is None:
11977  *             attrib = extra             # <<<<<<<<<<<<<<
11978  *         else:
11979  *             attrib.update(extra)
11980  */
11981       __Pyx_INCREF(__pyx_v_extra);
11982       __Pyx_DECREF(__pyx_v_attrib);
11983       __pyx_v_attrib = __pyx_v_extra;
11984       goto __pyx_L5;
11985     }
11986     /*else*/ {
11987
11988       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":276
11989  *             attrib = extra
11990  *         else:
11991  *             attrib.update(extra)             # <<<<<<<<<<<<<<
11992  *     if attrib:
11993  *         is_html = doc._parser._for_html
11994  */
11995       __pyx_t_5 = PyObject_GetAttr(__pyx_v_attrib, __pyx_kp_update); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11996       __Pyx_GOTREF(__pyx_t_5);
11997       __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11998       __Pyx_GOTREF(((PyObject *)__pyx_t_4));
11999       __Pyx_INCREF(__pyx_v_extra);
12000       PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_extra);
12001       __Pyx_GIVEREF(__pyx_v_extra);
12002       __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12003       __Pyx_GOTREF(__pyx_t_6);
12004       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12005       __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
12006       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12007     }
12008     __pyx_L5:;
12009     goto __pyx_L4;
12010   }
12011   __pyx_L4:;
12012
12013   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":277
12014  *         else:
12015  *             attrib.update(extra)
12016  *     if attrib:             # <<<<<<<<<<<<<<
12017  *         is_html = doc._parser._for_html
12018  *         for name, value in attrib.items():
12019  */
12020   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_attrib); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12021   if (__pyx_t_2) {
12022
12023     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":278
12024  *             attrib.update(extra)
12025  *     if attrib:
12026  *         is_html = doc._parser._for_html             # <<<<<<<<<<<<<<
12027  *         for name, value in attrib.items():
12028  *             attr_ns_utf, attr_name_utf = _getNsTag(name)
12029  */
12030     __pyx_v_is_html = __pyx_v_doc->_parser->_for_html;
12031
12032     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":279
12033  *     if attrib:
12034  *         is_html = doc._parser._for_html
12035  *         for name, value in attrib.items():             # <<<<<<<<<<<<<<
12036  *             attr_ns_utf, attr_name_utf = _getNsTag(name)
12037  *             if not is_html:
12038  */
12039     __pyx_t_6 = PyObject_GetAttr(__pyx_v_attrib, __pyx_kp_items); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12040     __Pyx_GOTREF(__pyx_t_6);
12041     __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12042     __Pyx_GOTREF(__pyx_t_4);
12043     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12044     if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
12045       __pyx_t_7 = 0; __pyx_t_6 = __pyx_t_4; __Pyx_INCREF(__pyx_t_6);
12046     } else {
12047       __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12048       __Pyx_GOTREF(__pyx_t_6);
12049     }
12050     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12051     for (;;) {
12052       if (likely(PyList_CheckExact(__pyx_t_6))) {
12053         if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
12054         __pyx_t_4 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++;
12055       } else if (likely(PyTuple_CheckExact(__pyx_t_6))) {
12056         if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
12057         __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++;
12058       } else {
12059         __pyx_t_4 = PyIter_Next(__pyx_t_6);
12060         if (!__pyx_t_4) {
12061           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12062           break;
12063         }
12064         __Pyx_GOTREF(__pyx_t_4);
12065       }
12066       if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 2)) {
12067         PyObject* tuple = __pyx_t_4;
12068         __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
12069         __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
12070         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12071         __Pyx_DECREF(__pyx_v_name);
12072         __pyx_v_name = __pyx_2;
12073         __pyx_2 = 0;
12074         __Pyx_DECREF(__pyx_v_value);
12075         __pyx_v_value = __pyx_3;
12076         __pyx_3 = 0;
12077       } else {
12078         __pyx_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12079         __Pyx_GOTREF(__pyx_1);
12080         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12081         __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12082         __Pyx_GOTREF(__pyx_2);
12083         __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12084         __Pyx_GOTREF(__pyx_3);
12085         if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12086         __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
12087         __Pyx_DECREF(__pyx_v_name);
12088         __pyx_v_name = __pyx_2;
12089         __pyx_2 = 0;
12090         __Pyx_DECREF(__pyx_v_value);
12091         __pyx_v_value = __pyx_3;
12092         __pyx_3 = 0;
12093       }
12094
12095       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":280
12096  *         is_html = doc._parser._for_html
12097  *         for name, value in attrib.items():
12098  *             attr_ns_utf, attr_name_utf = _getNsTag(name)             # <<<<<<<<<<<<<<
12099  *             if not is_html:
12100  *                 _attributeValidOrRaise(attr_name_utf)
12101  */
12102       __pyx_t_4 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_name); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12103       __Pyx_GOTREF(__pyx_t_4);
12104       if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 2)) {
12105         PyObject* tuple = __pyx_t_4;
12106         __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
12107         __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
12108         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12109         __Pyx_DECREF(__pyx_v_attr_ns_utf);
12110         __pyx_v_attr_ns_utf = __pyx_2;
12111         __pyx_2 = 0;
12112         __Pyx_DECREF(__pyx_v_attr_name_utf);
12113         __pyx_v_attr_name_utf = __pyx_3;
12114         __pyx_3 = 0;
12115       } else {
12116         __pyx_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12117         __Pyx_GOTREF(__pyx_1);
12118         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12119         __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12120         __Pyx_GOTREF(__pyx_2);
12121         __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12122         __Pyx_GOTREF(__pyx_3);
12123         if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12124         __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
12125         __Pyx_DECREF(__pyx_v_attr_ns_utf);
12126         __pyx_v_attr_ns_utf = __pyx_2;
12127         __pyx_2 = 0;
12128         __Pyx_DECREF(__pyx_v_attr_name_utf);
12129         __pyx_v_attr_name_utf = __pyx_3;
12130         __pyx_3 = 0;
12131       }
12132
12133       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":281
12134  *         for name, value in attrib.items():
12135  *             attr_ns_utf, attr_name_utf = _getNsTag(name)
12136  *             if not is_html:             # <<<<<<<<<<<<<<
12137  *                 _attributeValidOrRaise(attr_name_utf)
12138  *             value_utf = _utf8(value)
12139  */
12140       __pyx_t_2 = (!__pyx_v_is_html);
12141       if (__pyx_t_2) {
12142
12143         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":282
12144  *             attr_ns_utf, attr_name_utf = _getNsTag(name)
12145  *             if not is_html:
12146  *                 _attributeValidOrRaise(attr_name_utf)             # <<<<<<<<<<<<<<
12147  *             value_utf = _utf8(value)
12148  *             if attr_ns_utf is None:
12149  */
12150         __pyx_t_8 = __pyx_f_4lxml_5etree__attributeValidOrRaise(__pyx_v_attr_name_utf); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12151         goto __pyx_L9;
12152       }
12153       __pyx_L9:;
12154
12155       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":283
12156  *             if not is_html:
12157  *                 _attributeValidOrRaise(attr_name_utf)
12158  *             value_utf = _utf8(value)             # <<<<<<<<<<<<<<
12159  *             if attr_ns_utf is None:
12160  *                 tree.xmlNewProp(c_node, _cstr(attr_name_utf), _cstr(value_utf))
12161  */
12162       __pyx_t_4 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12163       __Pyx_GOTREF(__pyx_t_4);
12164       __Pyx_DECREF(__pyx_v_value_utf);
12165       __pyx_v_value_utf = __pyx_t_4;
12166       __pyx_t_4 = 0;
12167
12168       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":284
12169  *                 _attributeValidOrRaise(attr_name_utf)
12170  *             value_utf = _utf8(value)
12171  *             if attr_ns_utf is None:             # <<<<<<<<<<<<<<
12172  *                 tree.xmlNewProp(c_node, _cstr(attr_name_utf), _cstr(value_utf))
12173  *             else:
12174  */
12175       __pyx_t_2 = (__pyx_v_attr_ns_utf == Py_None);
12176       if (__pyx_t_2) {
12177
12178         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":285
12179  *             value_utf = _utf8(value)
12180  *             if attr_ns_utf is None:
12181  *                 tree.xmlNewProp(c_node, _cstr(attr_name_utf), _cstr(value_utf))             # <<<<<<<<<<<<<<
12182  *             else:
12183  *                 c_ns = doc._findOrBuildNodeNs(c_node, _cstr(attr_ns_utf), NULL)
12184  */
12185         xmlNewProp(__pyx_v_c_node, PyString_AS_STRING(__pyx_v_attr_name_utf), PyString_AS_STRING(__pyx_v_value_utf));
12186         goto __pyx_L10;
12187       }
12188       /*else*/ {
12189
12190         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":287
12191  *                 tree.xmlNewProp(c_node, _cstr(attr_name_utf), _cstr(value_utf))
12192  *             else:
12193  *                 c_ns = doc._findOrBuildNodeNs(c_node, _cstr(attr_ns_utf), NULL)             # <<<<<<<<<<<<<<
12194  *                 tree.xmlNewNsProp(c_node, c_ns,
12195  *                                   _cstr(attr_name_utf), _cstr(value_utf))
12196  */
12197         __pyx_t_9 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_doc->__pyx_vtab)->_findOrBuildNodeNs(__pyx_v_doc, __pyx_v_c_node, PyString_AS_STRING(__pyx_v_attr_ns_utf), NULL); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12198         __pyx_v_c_ns = __pyx_t_9;
12199
12200         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":289
12201  *                 c_ns = doc._findOrBuildNodeNs(c_node, _cstr(attr_ns_utf), NULL)
12202  *                 tree.xmlNewNsProp(c_node, c_ns,
12203  *                                   _cstr(attr_name_utf), _cstr(value_utf))             # <<<<<<<<<<<<<<
12204  * 
12205  * ctypedef struct _ns_node_ref:
12206  */
12207         xmlNewNsProp(__pyx_v_c_node, __pyx_v_c_ns, PyString_AS_STRING(__pyx_v_attr_name_utf), PyString_AS_STRING(__pyx_v_value_utf));
12208       }
12209       __pyx_L10:;
12210     }
12211     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12212     goto __pyx_L6;
12213   }
12214   __pyx_L6:;
12215
12216   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12217   goto __pyx_L0;
12218   __pyx_L1_error:;
12219   __Pyx_XDECREF(__pyx_1);
12220   __Pyx_XDECREF(__pyx_2);
12221   __Pyx_XDECREF(__pyx_3);
12222   __Pyx_XDECREF(__pyx_t_4);
12223   __Pyx_XDECREF(__pyx_t_5);
12224   __Pyx_XDECREF(__pyx_t_6);
12225   __Pyx_AddTraceback("lxml.etree._initNodeAttributes");
12226   __pyx_r = 0;
12227   __pyx_L0:;
12228   __Pyx_DECREF(__pyx_v_name);
12229   __Pyx_DECREF(__pyx_v_value);
12230   __Pyx_DECREF(__pyx_v_attr_ns_utf);
12231   __Pyx_DECREF(__pyx_v_attr_name_utf);
12232   __Pyx_DECREF(__pyx_v_value_utf);
12233   __Pyx_DECREF(__pyx_v_attrib);
12234   __Pyx_XGIVEREF(__pyx_r);
12235   __Pyx_FinishRefcountContext();
12236   return __pyx_r;
12237 }
12238
12239 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":295
12240  *     xmlNode* node
12241  * 
12242  * cdef int _removeUnusedNamespaceDeclarations(xmlNode* c_element) except -1:             # <<<<<<<<<<<<<<
12243  *     u"""Remove any namespace declarations from a subtree that do not used
12244  *     by any of its elements (or attributes).
12245  */
12246
12247 static  int __pyx_f_4lxml_5etree__removeUnusedNamespaceDeclarations(xmlNode *__pyx_v_c_element) {
12248   __pyx_t_4lxml_5etree__ns_node_ref *__pyx_v_c_ns_list;
12249   __pyx_t_4lxml_5etree__ns_node_ref *__pyx_v_c_nsref_ptr;
12250   xmlNs *__pyx_v_c_nsdef;
12251   xmlNode *__pyx_v_c_node;
12252   size_t __pyx_v_c_ns_list_size;
12253   size_t __pyx_v_c_ns_list_len;
12254   size_t __pyx_v_i;
12255   int __pyx_r;
12256   int __pyx_t_1;
12257   PyObject *__pyx_t_2 = NULL;
12258   size_t __pyx_t_3;
12259   __Pyx_SetupRefcountContext("_removeUnusedNamespaceDeclarations");
12260
12261   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":307
12262  *     cdef size_t i
12263  * 
12264  *     c_ns_list = NULL             # <<<<<<<<<<<<<<
12265  *     c_ns_list_size = 0
12266  *     c_ns_list_len  = 0
12267  */
12268   __pyx_v_c_ns_list = NULL;
12269
12270   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":308
12271  * 
12272  *     c_ns_list = NULL
12273  *     c_ns_list_size = 0             # <<<<<<<<<<<<<<
12274  *     c_ns_list_len  = 0
12275  * 
12276  */
12277   __pyx_v_c_ns_list_size = 0;
12278
12279   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":309
12280  *     c_ns_list = NULL
12281  *     c_ns_list_size = 0
12282  *     c_ns_list_len  = 0             # <<<<<<<<<<<<<<
12283  * 
12284  *     if c_element.parent is not NULL and \
12285  */
12286   __pyx_v_c_ns_list_len = 0;
12287
12288   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":311
12289  *     c_ns_list_len  = 0
12290  * 
12291  *     if c_element.parent is not NULL and \             # <<<<<<<<<<<<<<
12292  *             c_element.parent.type == tree.XML_DOCUMENT_NODE:
12293  *         # include the document node
12294  */
12295   if ((__pyx_v_c_element->parent != NULL)) {
12296
12297     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":312
12298  * 
12299  *     if c_element.parent is not NULL and \
12300  *             c_element.parent.type == tree.XML_DOCUMENT_NODE:             # <<<<<<<<<<<<<<
12301  *         # include the document node
12302  *         c_nsdef = c_element.parent.nsDef
12303  */
12304     __pyx_t_1 = (__pyx_v_c_element->parent->type == XML_DOCUMENT_NODE);
12305   } else {
12306     __pyx_t_1 = (__pyx_v_c_element->parent != NULL);
12307   }
12308   if (__pyx_t_1) {
12309
12310     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":314
12311  *             c_element.parent.type == tree.XML_DOCUMENT_NODE:
12312  *         # include the document node
12313  *         c_nsdef = c_element.parent.nsDef             # <<<<<<<<<<<<<<
12314  *         while c_nsdef is not NULL:
12315  *             if c_ns_list_len >= c_ns_list_size:
12316  */
12317     __pyx_v_c_nsdef = __pyx_v_c_element->parent->nsDef;
12318
12319     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":315
12320  *         # include the document node
12321  *         c_nsdef = c_element.parent.nsDef
12322  *         while c_nsdef is not NULL:             # <<<<<<<<<<<<<<
12323  *             if c_ns_list_len >= c_ns_list_size:
12324  *                 if c_ns_list is NULL:
12325  */
12326     while (1) {
12327       __pyx_t_1 = (__pyx_v_c_nsdef != NULL);
12328       if (!__pyx_t_1) break;
12329
12330       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":316
12331  *         c_nsdef = c_element.parent.nsDef
12332  *         while c_nsdef is not NULL:
12333  *             if c_ns_list_len >= c_ns_list_size:             # <<<<<<<<<<<<<<
12334  *                 if c_ns_list is NULL:
12335  *                     c_ns_list_size = 20
12336  */
12337       __pyx_t_1 = (__pyx_v_c_ns_list_len >= __pyx_v_c_ns_list_size);
12338       if (__pyx_t_1) {
12339
12340         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":317
12341  *         while c_nsdef is not NULL:
12342  *             if c_ns_list_len >= c_ns_list_size:
12343  *                 if c_ns_list is NULL:             # <<<<<<<<<<<<<<
12344  *                     c_ns_list_size = 20
12345  *                 else:
12346  */
12347         __pyx_t_1 = (__pyx_v_c_ns_list == NULL);
12348         if (__pyx_t_1) {
12349
12350           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":318
12351  *             if c_ns_list_len >= c_ns_list_size:
12352  *                 if c_ns_list is NULL:
12353  *                     c_ns_list_size = 20             # <<<<<<<<<<<<<<
12354  *                 else:
12355  *                     c_ns_list_size *= 2
12356  */
12357           __pyx_v_c_ns_list_size = 20;
12358           goto __pyx_L7;
12359         }
12360         /*else*/ {
12361
12362           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":320
12363  *                     c_ns_list_size = 20
12364  *                 else:
12365  *                     c_ns_list_size *= 2             # <<<<<<<<<<<<<<
12366  *                 c_nsref_ptr = <_ns_node_ref*> cstd.realloc(
12367  *                     c_ns_list, c_ns_list_size * sizeof(_ns_node_ref))
12368  */
12369           __pyx_v_c_ns_list_size *= 2;
12370         }
12371         __pyx_L7:;
12372
12373         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":322
12374  *                     c_ns_list_size *= 2
12375  *                 c_nsref_ptr = <_ns_node_ref*> cstd.realloc(
12376  *                     c_ns_list, c_ns_list_size * sizeof(_ns_node_ref))             # <<<<<<<<<<<<<<
12377  *                 if c_nsref_ptr is NULL:
12378  *                     if c_ns_list is not NULL:
12379  */
12380         __pyx_v_c_nsref_ptr = ((__pyx_t_4lxml_5etree__ns_node_ref *)realloc(__pyx_v_c_ns_list, (__pyx_v_c_ns_list_size * (sizeof(__pyx_t_4lxml_5etree__ns_node_ref)))));
12381
12382         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":323
12383  *                 c_nsref_ptr = <_ns_node_ref*> cstd.realloc(
12384  *                     c_ns_list, c_ns_list_size * sizeof(_ns_node_ref))
12385  *                 if c_nsref_ptr is NULL:             # <<<<<<<<<<<<<<
12386  *                     if c_ns_list is not NULL:
12387  *                         cstd.free(c_ns_list)
12388  */
12389         __pyx_t_1 = (__pyx_v_c_nsref_ptr == NULL);
12390         if (__pyx_t_1) {
12391
12392           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":324
12393  *                     c_ns_list, c_ns_list_size * sizeof(_ns_node_ref))
12394  *                 if c_nsref_ptr is NULL:
12395  *                     if c_ns_list is not NULL:             # <<<<<<<<<<<<<<
12396  *                         cstd.free(c_ns_list)
12397  *                     python.PyErr_NoMemory()
12398  */
12399           __pyx_t_1 = (__pyx_v_c_ns_list != NULL);
12400           if (__pyx_t_1) {
12401
12402             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":325
12403  *                 if c_nsref_ptr is NULL:
12404  *                     if c_ns_list is not NULL:
12405  *                         cstd.free(c_ns_list)             # <<<<<<<<<<<<<<
12406  *                     python.PyErr_NoMemory()
12407  *                     return -1
12408  */
12409             free(__pyx_v_c_ns_list);
12410             goto __pyx_L9;
12411           }
12412           __pyx_L9:;
12413
12414           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":326
12415  *                     if c_ns_list is not NULL:
12416  *                         cstd.free(c_ns_list)
12417  *                     python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
12418  *                     return -1
12419  *                 c_ns_list = c_nsref_ptr
12420  */
12421           __pyx_t_2 = PyErr_NoMemory(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12422           __Pyx_GOTREF(__pyx_t_2);
12423           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12424
12425           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":327
12426  *                         cstd.free(c_ns_list)
12427  *                     python.PyErr_NoMemory()
12428  *                     return -1             # <<<<<<<<<<<<<<
12429  *                 c_ns_list = c_nsref_ptr
12430  * 
12431  */
12432           __pyx_r = -1;
12433           goto __pyx_L0;
12434           goto __pyx_L8;
12435         }
12436         __pyx_L8:;
12437
12438         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":328
12439  *                     python.PyErr_NoMemory()
12440  *                     return -1
12441  *                 c_ns_list = c_nsref_ptr             # <<<<<<<<<<<<<<
12442  * 
12443  *             c_ns_list[c_ns_list_len].ns   = c_nsdef
12444  */
12445         __pyx_v_c_ns_list = __pyx_v_c_nsref_ptr;
12446         goto __pyx_L6;
12447       }
12448       __pyx_L6:;
12449
12450       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":330
12451  *                 c_ns_list = c_nsref_ptr
12452  * 
12453  *             c_ns_list[c_ns_list_len].ns   = c_nsdef             # <<<<<<<<<<<<<<
12454  *             c_ns_list[c_ns_list_len].node = c_element.parent
12455  *             c_ns_list_len += 1
12456  */
12457       (__pyx_v_c_ns_list[__pyx_v_c_ns_list_len]).ns = __pyx_v_c_nsdef;
12458
12459       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":331
12460  * 
12461  *             c_ns_list[c_ns_list_len].ns   = c_nsdef
12462  *             c_ns_list[c_ns_list_len].node = c_element.parent             # <<<<<<<<<<<<<<
12463  *             c_ns_list_len += 1
12464  *             c_nsdef = c_nsdef.next
12465  */
12466       (__pyx_v_c_ns_list[__pyx_v_c_ns_list_len]).node = __pyx_v_c_element->parent;
12467
12468       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":332
12469  *             c_ns_list[c_ns_list_len].ns   = c_nsdef
12470  *             c_ns_list[c_ns_list_len].node = c_element.parent
12471  *             c_ns_list_len += 1             # <<<<<<<<<<<<<<
12472  *             c_nsdef = c_nsdef.next
12473  * 
12474  */
12475       __pyx_v_c_ns_list_len += 1;
12476
12477       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":333
12478  *             c_ns_list[c_ns_list_len].node = c_element.parent
12479  *             c_ns_list_len += 1
12480  *             c_nsdef = c_nsdef.next             # <<<<<<<<<<<<<<
12481  * 
12482  *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_element, c_element, 1)
12483  */
12484       __pyx_v_c_nsdef = __pyx_v_c_nsdef->next;
12485     }
12486     goto __pyx_L3;
12487   }
12488   __pyx_L3:;
12489
12490   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":335
12491  *             c_nsdef = c_nsdef.next
12492  * 
12493  *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_element, c_element, 1)             # <<<<<<<<<<<<<<
12494  *     # collect all new namespace declarations into the ns list
12495  *     c_nsdef = c_element.nsDef
12496  */
12497   BEGIN_FOR_EACH_ELEMENT_FROM(__pyx_v_c_element, __pyx_v_c_element, 1);
12498
12499   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":337
12500  *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_element, c_element, 1)
12501  *     # collect all new namespace declarations into the ns list
12502  *     c_nsdef = c_element.nsDef             # <<<<<<<<<<<<<<
12503  *     while c_nsdef is not NULL:
12504  *         if c_ns_list_len >= c_ns_list_size:
12505  */
12506   __pyx_v_c_nsdef = __pyx_v_c_element->nsDef;
12507
12508   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":338
12509  *     # collect all new namespace declarations into the ns list
12510  *     c_nsdef = c_element.nsDef
12511  *     while c_nsdef is not NULL:             # <<<<<<<<<<<<<<
12512  *         if c_ns_list_len >= c_ns_list_size:
12513  *             if c_ns_list is NULL:
12514  */
12515   while (1) {
12516     __pyx_t_1 = (__pyx_v_c_nsdef != NULL);
12517     if (!__pyx_t_1) break;
12518
12519     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":339
12520  *     c_nsdef = c_element.nsDef
12521  *     while c_nsdef is not NULL:
12522  *         if c_ns_list_len >= c_ns_list_size:             # <<<<<<<<<<<<<<
12523  *             if c_ns_list is NULL:
12524  *                 c_ns_list_size = 20
12525  */
12526     __pyx_t_1 = (__pyx_v_c_ns_list_len >= __pyx_v_c_ns_list_size);
12527     if (__pyx_t_1) {
12528
12529       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":340
12530  *     while c_nsdef is not NULL:
12531  *         if c_ns_list_len >= c_ns_list_size:
12532  *             if c_ns_list is NULL:             # <<<<<<<<<<<<<<
12533  *                 c_ns_list_size = 20
12534  *             else:
12535  */
12536       __pyx_t_1 = (__pyx_v_c_ns_list == NULL);
12537       if (__pyx_t_1) {
12538
12539         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":341
12540  *         if c_ns_list_len >= c_ns_list_size:
12541  *             if c_ns_list is NULL:
12542  *                 c_ns_list_size = 20             # <<<<<<<<<<<<<<
12543  *             else:
12544  *                 c_ns_list_size *= 2
12545  */
12546         __pyx_v_c_ns_list_size = 20;
12547         goto __pyx_L13;
12548       }
12549       /*else*/ {
12550
12551         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":343
12552  *                 c_ns_list_size = 20
12553  *             else:
12554  *                 c_ns_list_size *= 2             # <<<<<<<<<<<<<<
12555  *             c_nsref_ptr = <_ns_node_ref*> cstd.realloc(
12556  *                 c_ns_list, c_ns_list_size * sizeof(_ns_node_ref))
12557  */
12558         __pyx_v_c_ns_list_size *= 2;
12559       }
12560       __pyx_L13:;
12561
12562       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":345
12563  *                 c_ns_list_size *= 2
12564  *             c_nsref_ptr = <_ns_node_ref*> cstd.realloc(
12565  *                 c_ns_list, c_ns_list_size * sizeof(_ns_node_ref))             # <<<<<<<<<<<<<<
12566  *             if c_nsref_ptr is NULL:
12567  *                 if c_ns_list is not NULL:
12568  */
12569       __pyx_v_c_nsref_ptr = ((__pyx_t_4lxml_5etree__ns_node_ref *)realloc(__pyx_v_c_ns_list, (__pyx_v_c_ns_list_size * (sizeof(__pyx_t_4lxml_5etree__ns_node_ref)))));
12570
12571       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":346
12572  *             c_nsref_ptr = <_ns_node_ref*> cstd.realloc(
12573  *                 c_ns_list, c_ns_list_size * sizeof(_ns_node_ref))
12574  *             if c_nsref_ptr is NULL:             # <<<<<<<<<<<<<<
12575  *                 if c_ns_list is not NULL:
12576  *                     cstd.free(c_ns_list)
12577  */
12578       __pyx_t_1 = (__pyx_v_c_nsref_ptr == NULL);
12579       if (__pyx_t_1) {
12580
12581         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":347
12582  *                 c_ns_list, c_ns_list_size * sizeof(_ns_node_ref))
12583  *             if c_nsref_ptr is NULL:
12584  *                 if c_ns_list is not NULL:             # <<<<<<<<<<<<<<
12585  *                     cstd.free(c_ns_list)
12586  *                 python.PyErr_NoMemory()
12587  */
12588         __pyx_t_1 = (__pyx_v_c_ns_list != NULL);
12589         if (__pyx_t_1) {
12590
12591           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":348
12592  *             if c_nsref_ptr is NULL:
12593  *                 if c_ns_list is not NULL:
12594  *                     cstd.free(c_ns_list)             # <<<<<<<<<<<<<<
12595  *                 python.PyErr_NoMemory()
12596  *                 return -1
12597  */
12598           free(__pyx_v_c_ns_list);
12599           goto __pyx_L15;
12600         }
12601         __pyx_L15:;
12602
12603         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":349
12604  *                 if c_ns_list is not NULL:
12605  *                     cstd.free(c_ns_list)
12606  *                 python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
12607  *                 return -1
12608  *             c_ns_list = c_nsref_ptr
12609  */
12610         __pyx_t_2 = PyErr_NoMemory(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12611         __Pyx_GOTREF(__pyx_t_2);
12612         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12613
12614         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":350
12615  *                     cstd.free(c_ns_list)
12616  *                 python.PyErr_NoMemory()
12617  *                 return -1             # <<<<<<<<<<<<<<
12618  *             c_ns_list = c_nsref_ptr
12619  * 
12620  */
12621         __pyx_r = -1;
12622         goto __pyx_L0;
12623         goto __pyx_L14;
12624       }
12625       __pyx_L14:;
12626
12627       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":351
12628  *                 python.PyErr_NoMemory()
12629  *                 return -1
12630  *             c_ns_list = c_nsref_ptr             # <<<<<<<<<<<<<<
12631  * 
12632  *         c_ns_list[c_ns_list_len].ns   = c_nsdef
12633  */
12634       __pyx_v_c_ns_list = __pyx_v_c_nsref_ptr;
12635       goto __pyx_L12;
12636     }
12637     __pyx_L12:;
12638
12639     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":353
12640  *             c_ns_list = c_nsref_ptr
12641  * 
12642  *         c_ns_list[c_ns_list_len].ns   = c_nsdef             # <<<<<<<<<<<<<<
12643  *         c_ns_list[c_ns_list_len].node = c_element
12644  *         c_ns_list_len += 1
12645  */
12646     (__pyx_v_c_ns_list[__pyx_v_c_ns_list_len]).ns = __pyx_v_c_nsdef;
12647
12648     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":354
12649  * 
12650  *         c_ns_list[c_ns_list_len].ns   = c_nsdef
12651  *         c_ns_list[c_ns_list_len].node = c_element             # <<<<<<<<<<<<<<
12652  *         c_ns_list_len += 1
12653  *         c_nsdef = c_nsdef.next
12654  */
12655     (__pyx_v_c_ns_list[__pyx_v_c_ns_list_len]).node = __pyx_v_c_element;
12656
12657     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":355
12658  *         c_ns_list[c_ns_list_len].ns   = c_nsdef
12659  *         c_ns_list[c_ns_list_len].node = c_element
12660  *         c_ns_list_len += 1             # <<<<<<<<<<<<<<
12661  *         c_nsdef = c_nsdef.next
12662  * 
12663  */
12664     __pyx_v_c_ns_list_len += 1;
12665
12666     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":356
12667  *         c_ns_list[c_ns_list_len].node = c_element
12668  *         c_ns_list_len += 1
12669  *         c_nsdef = c_nsdef.next             # <<<<<<<<<<<<<<
12670  * 
12671  *     # remove all namespace declarations from the list that are referenced
12672  */
12673     __pyx_v_c_nsdef = __pyx_v_c_nsdef->next;
12674   }
12675
12676   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":359
12677  * 
12678  *     # remove all namespace declarations from the list that are referenced
12679  *     if c_element.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
12680  *         c_node = c_element
12681  *         while c_node is not NULL:
12682  */
12683   __pyx_t_1 = (__pyx_v_c_element->type == XML_ELEMENT_NODE);
12684   if (__pyx_t_1) {
12685
12686     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":360
12687  *     # remove all namespace declarations from the list that are referenced
12688  *     if c_element.type == tree.XML_ELEMENT_NODE:
12689  *         c_node = c_element             # <<<<<<<<<<<<<<
12690  *         while c_node is not NULL:
12691  *             if c_node.ns is not NULL:
12692  */
12693     __pyx_v_c_node = __pyx_v_c_element;
12694
12695     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":361
12696  *     if c_element.type == tree.XML_ELEMENT_NODE:
12697  *         c_node = c_element
12698  *         while c_node is not NULL:             # <<<<<<<<<<<<<<
12699  *             if c_node.ns is not NULL:
12700  *                 for i from 0 <= i < c_ns_list_len:
12701  */
12702     while (1) {
12703       __pyx_t_1 = (__pyx_v_c_node != NULL);
12704       if (!__pyx_t_1) break;
12705
12706       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":362
12707  *         c_node = c_element
12708  *         while c_node is not NULL:
12709  *             if c_node.ns is not NULL:             # <<<<<<<<<<<<<<
12710  *                 for i from 0 <= i < c_ns_list_len:
12711  *                     if c_node.ns is c_ns_list[i].ns:
12712  */
12713       __pyx_t_1 = (__pyx_v_c_node->ns != NULL);
12714       if (__pyx_t_1) {
12715
12716         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":363
12717  *         while c_node is not NULL:
12718  *             if c_node.ns is not NULL:
12719  *                 for i from 0 <= i < c_ns_list_len:             # <<<<<<<<<<<<<<
12720  *                     if c_node.ns is c_ns_list[i].ns:
12721  *                         c_ns_list_len -= 1
12722  */
12723         __pyx_t_3 = __pyx_v_c_ns_list_len;
12724         for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
12725
12726           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":364
12727  *             if c_node.ns is not NULL:
12728  *                 for i from 0 <= i < c_ns_list_len:
12729  *                     if c_node.ns is c_ns_list[i].ns:             # <<<<<<<<<<<<<<
12730  *                         c_ns_list_len -= 1
12731  *                         c_ns_list[i].ns   = c_ns_list[c_ns_list_len].ns
12732  */
12733           __pyx_t_1 = (__pyx_v_c_node->ns == (__pyx_v_c_ns_list[__pyx_v_i]).ns);
12734           if (__pyx_t_1) {
12735
12736             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":365
12737  *                 for i from 0 <= i < c_ns_list_len:
12738  *                     if c_node.ns is c_ns_list[i].ns:
12739  *                         c_ns_list_len -= 1             # <<<<<<<<<<<<<<
12740  *                         c_ns_list[i].ns   = c_ns_list[c_ns_list_len].ns
12741  *                         c_ns_list[i].node = c_ns_list[c_ns_list_len].node
12742  */
12743             __pyx_v_c_ns_list_len -= 1;
12744
12745             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":366
12746  *                     if c_node.ns is c_ns_list[i].ns:
12747  *                         c_ns_list_len -= 1
12748  *                         c_ns_list[i].ns   = c_ns_list[c_ns_list_len].ns             # <<<<<<<<<<<<<<
12749  *                         c_ns_list[i].node = c_ns_list[c_ns_list_len].node
12750  *                         c_ns_list[c_ns_list_len].ns   = NULL
12751  */
12752             (__pyx_v_c_ns_list[__pyx_v_i]).ns = (__pyx_v_c_ns_list[__pyx_v_c_ns_list_len]).ns;
12753
12754             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":367
12755  *                         c_ns_list_len -= 1
12756  *                         c_ns_list[i].ns   = c_ns_list[c_ns_list_len].ns
12757  *                         c_ns_list[i].node = c_ns_list[c_ns_list_len].node             # <<<<<<<<<<<<<<
12758  *                         c_ns_list[c_ns_list_len].ns   = NULL
12759  *                         c_ns_list[c_ns_list_len].node = NULL
12760  */
12761             (__pyx_v_c_ns_list[__pyx_v_i]).node = (__pyx_v_c_ns_list[__pyx_v_c_ns_list_len]).node;
12762
12763             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":368
12764  *                         c_ns_list[i].ns   = c_ns_list[c_ns_list_len].ns
12765  *                         c_ns_list[i].node = c_ns_list[c_ns_list_len].node
12766  *                         c_ns_list[c_ns_list_len].ns   = NULL             # <<<<<<<<<<<<<<
12767  *                         c_ns_list[c_ns_list_len].node = NULL
12768  *                         break
12769  */
12770             (__pyx_v_c_ns_list[__pyx_v_c_ns_list_len]).ns = NULL;
12771
12772             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":369
12773  *                         c_ns_list[i].node = c_ns_list[c_ns_list_len].node
12774  *                         c_ns_list[c_ns_list_len].ns   = NULL
12775  *                         c_ns_list[c_ns_list_len].node = NULL             # <<<<<<<<<<<<<<
12776  *                         break
12777  *             if c_node is c_element:
12778  */
12779             (__pyx_v_c_ns_list[__pyx_v_c_ns_list_len]).node = NULL;
12780
12781             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":370
12782  *                         c_ns_list[c_ns_list_len].ns   = NULL
12783  *                         c_ns_list[c_ns_list_len].node = NULL
12784  *                         break             # <<<<<<<<<<<<<<
12785  *             if c_node is c_element:
12786  *                 # continue with attributes
12787  */
12788             goto __pyx_L21_break;
12789             goto __pyx_L22;
12790           }
12791           __pyx_L22:;
12792         }
12793         __pyx_L21_break:;
12794         goto __pyx_L19;
12795       }
12796       __pyx_L19:;
12797
12798       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":371
12799  *                         c_ns_list[c_ns_list_len].node = NULL
12800  *                         break
12801  *             if c_node is c_element:             # <<<<<<<<<<<<<<
12802  *                 # continue with attributes
12803  *                 c_node = <xmlNode*>c_element.properties
12804  */
12805       __pyx_t_1 = (__pyx_v_c_node == __pyx_v_c_element);
12806       if (__pyx_t_1) {
12807
12808         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":373
12809  *             if c_node is c_element:
12810  *                 # continue with attributes
12811  *                 c_node = <xmlNode*>c_element.properties             # <<<<<<<<<<<<<<
12812  *             else:
12813  *                 c_node = c_node.next
12814  */
12815         __pyx_v_c_node = ((xmlNode *)__pyx_v_c_element->properties);
12816         goto __pyx_L23;
12817       }
12818       /*else*/ {
12819
12820         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":375
12821  *                 c_node = <xmlNode*>c_element.properties
12822  *             else:
12823  *                 c_node = c_node.next             # <<<<<<<<<<<<<<
12824  *     tree.END_FOR_EACH_ELEMENT_FROM(c_element)
12825  * 
12826  */
12827         __pyx_v_c_node = __pyx_v_c_node->next;
12828       }
12829       __pyx_L23:;
12830     }
12831     goto __pyx_L16;
12832   }
12833   __pyx_L16:;
12834
12835   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":376
12836  *             else:
12837  *                 c_node = c_node.next
12838  *     tree.END_FOR_EACH_ELEMENT_FROM(c_element)             # <<<<<<<<<<<<<<
12839  * 
12840  *     if c_ns_list is NULL:
12841  */
12842   END_FOR_EACH_ELEMENT_FROM(__pyx_v_c_element);
12843
12844   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":378
12845  *     tree.END_FOR_EACH_ELEMENT_FROM(c_element)
12846  * 
12847  *     if c_ns_list is NULL:             # <<<<<<<<<<<<<<
12848  *         return 0
12849  * 
12850  */
12851   __pyx_t_1 = (__pyx_v_c_ns_list == NULL);
12852   if (__pyx_t_1) {
12853
12854     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":379
12855  * 
12856  *     if c_ns_list is NULL:
12857  *         return 0             # <<<<<<<<<<<<<<
12858  * 
12859  *     # free all namespace declarations that remained in the list
12860  */
12861     __pyx_r = 0;
12862     goto __pyx_L0;
12863     goto __pyx_L24;
12864   }
12865   __pyx_L24:;
12866
12867   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":382
12868  * 
12869  *     # free all namespace declarations that remained in the list
12870  *     for i from 0 <= i < c_ns_list_len:             # <<<<<<<<<<<<<<
12871  *         c_node = c_ns_list[i].node
12872  *         c_nsdef = c_node.nsDef
12873  */
12874   __pyx_t_3 = __pyx_v_c_ns_list_len;
12875   for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
12876
12877     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":383
12878  *     # free all namespace declarations that remained in the list
12879  *     for i from 0 <= i < c_ns_list_len:
12880  *         c_node = c_ns_list[i].node             # <<<<<<<<<<<<<<
12881  *         c_nsdef = c_node.nsDef
12882  *         if c_nsdef is c_ns_list[i].ns:
12883  */
12884     __pyx_v_c_node = (__pyx_v_c_ns_list[__pyx_v_i]).node;
12885
12886     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":384
12887  *     for i from 0 <= i < c_ns_list_len:
12888  *         c_node = c_ns_list[i].node
12889  *         c_nsdef = c_node.nsDef             # <<<<<<<<<<<<<<
12890  *         if c_nsdef is c_ns_list[i].ns:
12891  *             c_node.nsDef = c_node.nsDef.next
12892  */
12893     __pyx_v_c_nsdef = __pyx_v_c_node->nsDef;
12894
12895     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":385
12896  *         c_node = c_ns_list[i].node
12897  *         c_nsdef = c_node.nsDef
12898  *         if c_nsdef is c_ns_list[i].ns:             # <<<<<<<<<<<<<<
12899  *             c_node.nsDef = c_node.nsDef.next
12900  *         else:
12901  */
12902     __pyx_t_1 = (__pyx_v_c_nsdef == (__pyx_v_c_ns_list[__pyx_v_i]).ns);
12903     if (__pyx_t_1) {
12904
12905       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":386
12906  *         c_nsdef = c_node.nsDef
12907  *         if c_nsdef is c_ns_list[i].ns:
12908  *             c_node.nsDef = c_node.nsDef.next             # <<<<<<<<<<<<<<
12909  *         else:
12910  *             while c_nsdef.next is not c_ns_list[i].ns:
12911  */
12912       __pyx_v_c_node->nsDef = __pyx_v_c_node->nsDef->next;
12913       goto __pyx_L27;
12914     }
12915     /*else*/ {
12916
12917       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":388
12918  *             c_node.nsDef = c_node.nsDef.next
12919  *         else:
12920  *             while c_nsdef.next is not c_ns_list[i].ns:             # <<<<<<<<<<<<<<
12921  *                 c_nsdef = c_nsdef.next
12922  *             c_nsdef.next = c_nsdef.next.next
12923  */
12924       while (1) {
12925         __pyx_t_1 = (__pyx_v_c_nsdef->next != (__pyx_v_c_ns_list[__pyx_v_i]).ns);
12926         if (!__pyx_t_1) break;
12927
12928         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":389
12929  *         else:
12930  *             while c_nsdef.next is not c_ns_list[i].ns:
12931  *                 c_nsdef = c_nsdef.next             # <<<<<<<<<<<<<<
12932  *             c_nsdef.next = c_nsdef.next.next
12933  *         tree.xmlFreeNs(c_ns_list[i].ns)
12934  */
12935         __pyx_v_c_nsdef = __pyx_v_c_nsdef->next;
12936       }
12937
12938       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":390
12939  *             while c_nsdef.next is not c_ns_list[i].ns:
12940  *                 c_nsdef = c_nsdef.next
12941  *             c_nsdef.next = c_nsdef.next.next             # <<<<<<<<<<<<<<
12942  *         tree.xmlFreeNs(c_ns_list[i].ns)
12943  * 
12944  */
12945       __pyx_v_c_nsdef->next = __pyx_v_c_nsdef->next->next;
12946     }
12947     __pyx_L27:;
12948
12949     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":391
12950  *                 c_nsdef = c_nsdef.next
12951  *             c_nsdef.next = c_nsdef.next.next
12952  *         tree.xmlFreeNs(c_ns_list[i].ns)             # <<<<<<<<<<<<<<
12953  * 
12954  *     if c_ns_list is not NULL:
12955  */
12956     xmlFreeNs((__pyx_v_c_ns_list[__pyx_v_i]).ns);
12957   }
12958
12959   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":393
12960  *         tree.xmlFreeNs(c_ns_list[i].ns)
12961  * 
12962  *     if c_ns_list is not NULL:             # <<<<<<<<<<<<<<
12963  *         cstd.free(c_ns_list)
12964  *     return 0
12965  */
12966   __pyx_t_1 = (__pyx_v_c_ns_list != NULL);
12967   if (__pyx_t_1) {
12968
12969     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":394
12970  * 
12971  *     if c_ns_list is not NULL:
12972  *         cstd.free(c_ns_list)             # <<<<<<<<<<<<<<
12973  *     return 0
12974  * 
12975  */
12976     free(__pyx_v_c_ns_list);
12977     goto __pyx_L30;
12978   }
12979   __pyx_L30:;
12980
12981   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":395
12982  *     if c_ns_list is not NULL:
12983  *         cstd.free(c_ns_list)
12984  *     return 0             # <<<<<<<<<<<<<<
12985  * 
12986  * cdef int _replaceNodeByChildren(_Document doc, xmlNode* c_node) except -1:
12987  */
12988   __pyx_r = 0;
12989   goto __pyx_L0;
12990
12991   __pyx_r = 0;
12992   goto __pyx_L0;
12993   __pyx_L1_error:;
12994   __Pyx_XDECREF(__pyx_t_2);
12995   __Pyx_AddTraceback("lxml.etree._removeUnusedNamespaceDeclarations");
12996   __pyx_r = -1;
12997   __pyx_L0:;
12998   __Pyx_FinishRefcountContext();
12999   return __pyx_r;
13000 }
13001
13002 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":397
13003  *     return 0
13004  * 
13005  * cdef int _replaceNodeByChildren(_Document doc, xmlNode* c_node) except -1:             # <<<<<<<<<<<<<<
13006  *     cdef xmlNode* c_parent
13007  *     cdef xmlNode* c_child
13008  */
13009
13010 static  int __pyx_f_4lxml_5etree__replaceNodeByChildren(struct LxmlDocument *__pyx_v_doc, xmlNode *__pyx_v_c_node) {
13011   xmlNode *__pyx_v_c_parent;
13012   xmlNode *__pyx_v_c_child;
13013   int __pyx_r;
13014   int __pyx_t_1;
13015   int __pyx_t_2;
13016   __Pyx_SetupRefcountContext("_replaceNodeByChildren");
13017
13018   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":400
13019  *     cdef xmlNode* c_parent
13020  *     cdef xmlNode* c_child
13021  *     if c_node.children is NULL:             # <<<<<<<<<<<<<<
13022  *         tree.xmlUnlinkNode(c_node)
13023  *         return 0
13024  */
13025   __pyx_t_1 = (__pyx_v_c_node->children == NULL);
13026   if (__pyx_t_1) {
13027
13028     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":401
13029  *     cdef xmlNode* c_child
13030  *     if c_node.children is NULL:
13031  *         tree.xmlUnlinkNode(c_node)             # <<<<<<<<<<<<<<
13032  *         return 0
13033  * 
13034  */
13035     xmlUnlinkNode(__pyx_v_c_node);
13036
13037     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":402
13038  *     if c_node.children is NULL:
13039  *         tree.xmlUnlinkNode(c_node)
13040  *         return 0             # <<<<<<<<<<<<<<
13041  * 
13042  *     c_parent = c_node.parent
13043  */
13044     __pyx_r = 0;
13045     goto __pyx_L0;
13046     goto __pyx_L3;
13047   }
13048   __pyx_L3:;
13049
13050   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":404
13051  *         return 0
13052  * 
13053  *     c_parent = c_node.parent             # <<<<<<<<<<<<<<
13054  *     # fix parent links of children
13055  *     c_child = c_node.children
13056  */
13057   __pyx_v_c_parent = __pyx_v_c_node->parent;
13058
13059   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":406
13060  *     c_parent = c_node.parent
13061  *     # fix parent links of children
13062  *     c_child = c_node.children             # <<<<<<<<<<<<<<
13063  *     while c_child is not NULL:
13064  *         c_child.parent = c_parent
13065  */
13066   __pyx_v_c_child = __pyx_v_c_node->children;
13067
13068   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":407
13069  *     # fix parent links of children
13070  *     c_child = c_node.children
13071  *     while c_child is not NULL:             # <<<<<<<<<<<<<<
13072  *         c_child.parent = c_parent
13073  *         c_child = c_child.next
13074  */
13075   while (1) {
13076     __pyx_t_1 = (__pyx_v_c_child != NULL);
13077     if (!__pyx_t_1) break;
13078
13079     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":408
13080  *     c_child = c_node.children
13081  *     while c_child is not NULL:
13082  *         c_child.parent = c_parent             # <<<<<<<<<<<<<<
13083  *         c_child = c_child.next
13084  * 
13085  */
13086     __pyx_v_c_child->parent = __pyx_v_c_parent;
13087
13088     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":409
13089  *     while c_child is not NULL:
13090  *         c_child.parent = c_parent
13091  *         c_child = c_child.next             # <<<<<<<<<<<<<<
13092  * 
13093  *     # fix namespace references of children if their parent's namespace
13094  */
13095     __pyx_v_c_child = __pyx_v_c_child->next;
13096   }
13097
13098   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":413
13099  *     # fix namespace references of children if their parent's namespace
13100  *     # declarations get lost
13101  *     if c_node.nsDef is not NULL:             # <<<<<<<<<<<<<<
13102  *         c_child = c_node.children
13103  *         while c_child is not NULL:
13104  */
13105   __pyx_t_1 = (__pyx_v_c_node->nsDef != NULL);
13106   if (__pyx_t_1) {
13107
13108     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":414
13109  *     # declarations get lost
13110  *     if c_node.nsDef is not NULL:
13111  *         c_child = c_node.children             # <<<<<<<<<<<<<<
13112  *         while c_child is not NULL:
13113  *             moveNodeToDocument(doc, doc._c_doc, c_child)
13114  */
13115     __pyx_v_c_child = __pyx_v_c_node->children;
13116
13117     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":415
13118  *     if c_node.nsDef is not NULL:
13119  *         c_child = c_node.children
13120  *         while c_child is not NULL:             # <<<<<<<<<<<<<<
13121  *             moveNodeToDocument(doc, doc._c_doc, c_child)
13122  *             c_child = c_child.next
13123  */
13124     while (1) {
13125       __pyx_t_1 = (__pyx_v_c_child != NULL);
13126       if (!__pyx_t_1) break;
13127
13128       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":416
13129  *         c_child = c_node.children
13130  *         while c_child is not NULL:
13131  *             moveNodeToDocument(doc, doc._c_doc, c_child)             # <<<<<<<<<<<<<<
13132  *             c_child = c_child.next
13133  * 
13134  */
13135       __pyx_t_2 = __pyx_f_4lxml_5etree_moveNodeToDocument(__pyx_v_doc, __pyx_v_doc->_c_doc, __pyx_v_c_child); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13136
13137       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":417
13138  *         while c_child is not NULL:
13139  *             moveNodeToDocument(doc, doc._c_doc, c_child)
13140  *             c_child = c_child.next             # <<<<<<<<<<<<<<
13141  * 
13142  *     # fix sibling links to/from child slice
13143  */
13144       __pyx_v_c_child = __pyx_v_c_child->next;
13145     }
13146     goto __pyx_L6;
13147   }
13148   __pyx_L6:;
13149
13150   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":420
13151  * 
13152  *     # fix sibling links to/from child slice
13153  *     if c_node.prev is NULL:             # <<<<<<<<<<<<<<
13154  *         c_parent.children = c_node.children
13155  *     else:
13156  */
13157   __pyx_t_1 = (__pyx_v_c_node->prev == NULL);
13158   if (__pyx_t_1) {
13159
13160     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":421
13161  *     # fix sibling links to/from child slice
13162  *     if c_node.prev is NULL:
13163  *         c_parent.children = c_node.children             # <<<<<<<<<<<<<<
13164  *     else:
13165  *         c_node.prev.next = c_node.children
13166  */
13167     __pyx_v_c_parent->children = __pyx_v_c_node->children;
13168     goto __pyx_L9;
13169   }
13170   /*else*/ {
13171
13172     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":423
13173  *         c_parent.children = c_node.children
13174  *     else:
13175  *         c_node.prev.next = c_node.children             # <<<<<<<<<<<<<<
13176  *         c_node.children.prev = c_node.prev
13177  *     if c_node.next is NULL:
13178  */
13179     __pyx_v_c_node->prev->next = __pyx_v_c_node->children;
13180
13181     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":424
13182  *     else:
13183  *         c_node.prev.next = c_node.children
13184  *         c_node.children.prev = c_node.prev             # <<<<<<<<<<<<<<
13185  *     if c_node.next is NULL:
13186  *         c_parent.last = c_node.last
13187  */
13188     __pyx_v_c_node->children->prev = __pyx_v_c_node->prev;
13189   }
13190   __pyx_L9:;
13191
13192   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":425
13193  *         c_node.prev.next = c_node.children
13194  *         c_node.children.prev = c_node.prev
13195  *     if c_node.next is NULL:             # <<<<<<<<<<<<<<
13196  *         c_parent.last = c_node.last
13197  *     else:
13198  */
13199   __pyx_t_1 = (__pyx_v_c_node->next == NULL);
13200   if (__pyx_t_1) {
13201
13202     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":426
13203  *         c_node.children.prev = c_node.prev
13204  *     if c_node.next is NULL:
13205  *         c_parent.last = c_node.last             # <<<<<<<<<<<<<<
13206  *     else:
13207  *         c_node.next.prev = c_node.last
13208  */
13209     __pyx_v_c_parent->last = __pyx_v_c_node->last;
13210     goto __pyx_L10;
13211   }
13212   /*else*/ {
13213
13214     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":428
13215  *         c_parent.last = c_node.last
13216  *     else:
13217  *         c_node.next.prev = c_node.last             # <<<<<<<<<<<<<<
13218  *         c_node.last.next = c_node.next
13219  * 
13220  */
13221     __pyx_v_c_node->next->prev = __pyx_v_c_node->last;
13222
13223     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":429
13224  *     else:
13225  *         c_node.next.prev = c_node.last
13226  *         c_node.last.next = c_node.next             # <<<<<<<<<<<<<<
13227  * 
13228  *     # unlink c_node
13229  */
13230     __pyx_v_c_node->last->next = __pyx_v_c_node->next;
13231   }
13232   __pyx_L10:;
13233
13234   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":432
13235  * 
13236  *     # unlink c_node
13237  *     c_node.children = c_node.last = NULL             # <<<<<<<<<<<<<<
13238  *     c_node.parent = c_node.next = c_node.prev = NULL
13239  *     return 0
13240  */
13241   __pyx_v_c_node->children = NULL;
13242   __pyx_v_c_node->last = NULL;
13243
13244   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":433
13245  *     # unlink c_node
13246  *     c_node.children = c_node.last = NULL
13247  *     c_node.parent = c_node.next = c_node.prev = NULL             # <<<<<<<<<<<<<<
13248  *     return 0
13249  * 
13250  */
13251   __pyx_v_c_node->parent = NULL;
13252   __pyx_v_c_node->next = NULL;
13253   __pyx_v_c_node->prev = NULL;
13254
13255   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":434
13256  *     c_node.children = c_node.last = NULL
13257  *     c_node.parent = c_node.next = c_node.prev = NULL
13258  *     return 0             # <<<<<<<<<<<<<<
13259  * 
13260  * cdef object _attributeValue(xmlNode* c_element, xmlAttr* c_attrib_node):
13261  */
13262   __pyx_r = 0;
13263   goto __pyx_L0;
13264
13265   __pyx_r = 0;
13266   goto __pyx_L0;
13267   __pyx_L1_error:;
13268   __Pyx_AddTraceback("lxml.etree._replaceNodeByChildren");
13269   __pyx_r = -1;
13270   __pyx_L0:;
13271   __Pyx_FinishRefcountContext();
13272   return __pyx_r;
13273 }
13274
13275 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":436
13276  *     return 0
13277  * 
13278  * cdef object _attributeValue(xmlNode* c_element, xmlAttr* c_attrib_node):             # <<<<<<<<<<<<<<
13279  *     cdef char* value
13280  *     cdef char* c_href
13281  */
13282
13283 static  PyObject *__pyx_f_4lxml_5etree__attributeValue(xmlNode *__pyx_v_c_element, xmlAttr *__pyx_v_c_attrib_node) {
13284   char *__pyx_v_value;
13285   char *__pyx_v_c_href;
13286   PyObject *__pyx_v_result;
13287   PyObject *__pyx_r = NULL;
13288   PyObject *__pyx_t_1 = NULL;
13289   __Pyx_SetupRefcountContext("_attributeValue");
13290   __pyx_v_result = Py_None; __Pyx_INCREF(Py_None);
13291
13292   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":439
13293  *     cdef char* value
13294  *     cdef char* c_href
13295  *     c_href = _getNs(<xmlNode*>c_attrib_node)             # <<<<<<<<<<<<<<
13296  *     value = tree.xmlGetNsProp(c_element, c_attrib_node.name, c_href)
13297  *     try:
13298  */
13299   __pyx_v_c_href = _getNs(((xmlNode *)__pyx_v_c_attrib_node));
13300
13301   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":440
13302  *     cdef char* c_href
13303  *     c_href = _getNs(<xmlNode*>c_attrib_node)
13304  *     value = tree.xmlGetNsProp(c_element, c_attrib_node.name, c_href)             # <<<<<<<<<<<<<<
13305  *     try:
13306  *         result = funicode(value)
13307  */
13308   __pyx_v_value = xmlGetNsProp(__pyx_v_c_element, __pyx_v_c_attrib_node->name, __pyx_v_c_href);
13309
13310   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":441
13311  *     c_href = _getNs(<xmlNode*>c_attrib_node)
13312  *     value = tree.xmlGetNsProp(c_element, c_attrib_node.name, c_href)
13313  *     try:             # <<<<<<<<<<<<<<
13314  *         result = funicode(value)
13315  *     finally:
13316  */
13317   /*try:*/ {
13318
13319     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":442
13320  *     value = tree.xmlGetNsProp(c_element, c_attrib_node.name, c_href)
13321  *     try:
13322  *         result = funicode(value)             # <<<<<<<<<<<<<<
13323  *     finally:
13324  *         tree.xmlFree(value)
13325  */
13326     __pyx_t_1 = __pyx_f_4lxml_5etree_funicode(__pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L4;}
13327     __Pyx_GOTREF(__pyx_t_1);
13328     __Pyx_DECREF(__pyx_v_result);
13329     __pyx_v_result = __pyx_t_1;
13330     __pyx_t_1 = 0;
13331   }
13332   /*finally:*/ {
13333     int __pyx_why;
13334     PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
13335     int __pyx_exc_lineno;
13336     __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
13337     __pyx_why = 0; goto __pyx_L5;
13338     __pyx_L4: {
13339       __pyx_why = 4;
13340       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
13341       __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
13342       __pyx_exc_lineno = __pyx_lineno;
13343       goto __pyx_L5;
13344     }
13345     __pyx_L5:;
13346
13347     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":444
13348  *         result = funicode(value)
13349  *     finally:
13350  *         tree.xmlFree(value)             # <<<<<<<<<<<<<<
13351  *     return result
13352  * 
13353  */
13354     xmlFree(__pyx_v_value);
13355     switch (__pyx_why) {
13356       case 4: {
13357         __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
13358         __pyx_lineno = __pyx_exc_lineno;
13359         __pyx_exc_type = 0;
13360         __pyx_exc_value = 0;
13361         __pyx_exc_tb = 0;
13362         goto __pyx_L1_error;
13363       }
13364     }
13365   }
13366
13367   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":445
13368  *     finally:
13369  *         tree.xmlFree(value)
13370  *     return result             # <<<<<<<<<<<<<<
13371  * 
13372  * cdef object _attributeValueFromNsName(xmlNode* c_element,
13373  */
13374   __Pyx_XDECREF(__pyx_r);
13375   __Pyx_INCREF(__pyx_v_result);
13376   __pyx_r = __pyx_v_result;
13377   goto __pyx_L0;
13378
13379   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13380   goto __pyx_L0;
13381   __pyx_L1_error:;
13382   __Pyx_XDECREF(__pyx_t_1);
13383   __Pyx_AddTraceback("lxml.etree._attributeValue");
13384   __pyx_r = 0;
13385   __pyx_L0:;
13386   __Pyx_DECREF(__pyx_v_result);
13387   __Pyx_XGIVEREF(__pyx_r);
13388   __Pyx_FinishRefcountContext();
13389   return __pyx_r;
13390 }
13391
13392 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":447
13393  *     return result
13394  * 
13395  * cdef object _attributeValueFromNsName(xmlNode* c_element,             # <<<<<<<<<<<<<<
13396  *                                       char* c_href, char* c_name):
13397  *     cdef char* c_result = tree.xmlGetNsProp(c_element, c_name, c_href)
13398  */
13399
13400 static  PyObject *__pyx_f_4lxml_5etree__attributeValueFromNsName(xmlNode *__pyx_v_c_element, char *__pyx_v_c_href, char *__pyx_v_c_name) {
13401   char *__pyx_v_c_result;
13402   PyObject *__pyx_v_result;
13403   PyObject *__pyx_r = NULL;
13404   int __pyx_t_1;
13405   PyObject *__pyx_t_2 = NULL;
13406   __Pyx_SetupRefcountContext("_attributeValueFromNsName");
13407   __pyx_v_result = Py_None; __Pyx_INCREF(Py_None);
13408
13409   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":449
13410  * cdef object _attributeValueFromNsName(xmlNode* c_element,
13411  *                                       char* c_href, char* c_name):
13412  *     cdef char* c_result = tree.xmlGetNsProp(c_element, c_name, c_href)             # <<<<<<<<<<<<<<
13413  *     if c_result is NULL:
13414  *         return None
13415  */
13416   __pyx_v_c_result = xmlGetNsProp(__pyx_v_c_element, __pyx_v_c_name, __pyx_v_c_href);
13417
13418   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":450
13419  *                                       char* c_href, char* c_name):
13420  *     cdef char* c_result = tree.xmlGetNsProp(c_element, c_name, c_href)
13421  *     if c_result is NULL:             # <<<<<<<<<<<<<<
13422  *         return None
13423  *     try:
13424  */
13425   __pyx_t_1 = (__pyx_v_c_result == NULL);
13426   if (__pyx_t_1) {
13427
13428     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":451
13429  *     cdef char* c_result = tree.xmlGetNsProp(c_element, c_name, c_href)
13430  *     if c_result is NULL:
13431  *         return None             # <<<<<<<<<<<<<<
13432  *     try:
13433  *         result = funicode(c_result)
13434  */
13435     __Pyx_XDECREF(__pyx_r);
13436     __Pyx_INCREF(Py_None);
13437     __pyx_r = Py_None;
13438     goto __pyx_L0;
13439     goto __pyx_L3;
13440   }
13441   __pyx_L3:;
13442
13443   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":452
13444  *     if c_result is NULL:
13445  *         return None
13446  *     try:             # <<<<<<<<<<<<<<
13447  *         result = funicode(c_result)
13448  *     finally:
13449  */
13450   /*try:*/ {
13451
13452     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":453
13453  *         return None
13454  *     try:
13455  *         result = funicode(c_result)             # <<<<<<<<<<<<<<
13456  *     finally:
13457  *         tree.xmlFree(c_result)
13458  */
13459     __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_result); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L5;}
13460     __Pyx_GOTREF(__pyx_t_2);
13461     __Pyx_DECREF(__pyx_v_result);
13462     __pyx_v_result = __pyx_t_2;
13463     __pyx_t_2 = 0;
13464   }
13465   /*finally:*/ {
13466     int __pyx_why;
13467     PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
13468     int __pyx_exc_lineno;
13469     __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
13470     __pyx_why = 0; goto __pyx_L6;
13471     __pyx_L5: {
13472       __pyx_why = 4;
13473       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
13474       __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
13475       __pyx_exc_lineno = __pyx_lineno;
13476       goto __pyx_L6;
13477     }
13478     __pyx_L6:;
13479
13480     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":455
13481  *         result = funicode(c_result)
13482  *     finally:
13483  *         tree.xmlFree(c_result)             # <<<<<<<<<<<<<<
13484  *     return result
13485  * 
13486  */
13487     xmlFree(__pyx_v_c_result);
13488     switch (__pyx_why) {
13489       case 4: {
13490         __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
13491         __pyx_lineno = __pyx_exc_lineno;
13492         __pyx_exc_type = 0;
13493         __pyx_exc_value = 0;
13494         __pyx_exc_tb = 0;
13495         goto __pyx_L1_error;
13496       }
13497     }
13498   }
13499
13500   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":456
13501  *     finally:
13502  *         tree.xmlFree(c_result)
13503  *     return result             # <<<<<<<<<<<<<<
13504  * 
13505  * cdef object _getNodeAttributeValue(xmlNode* c_node, key, default):
13506  */
13507   __Pyx_XDECREF(__pyx_r);
13508   __Pyx_INCREF(__pyx_v_result);
13509   __pyx_r = __pyx_v_result;
13510   goto __pyx_L0;
13511
13512   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13513   goto __pyx_L0;
13514   __pyx_L1_error:;
13515   __Pyx_XDECREF(__pyx_t_2);
13516   __Pyx_AddTraceback("lxml.etree._attributeValueFromNsName");
13517   __pyx_r = 0;
13518   __pyx_L0:;
13519   __Pyx_DECREF(__pyx_v_result);
13520   __Pyx_XGIVEREF(__pyx_r);
13521   __Pyx_FinishRefcountContext();
13522   return __pyx_r;
13523 }
13524
13525 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":458
13526  *     return result
13527  * 
13528  * cdef object _getNodeAttributeValue(xmlNode* c_node, key, default):             # <<<<<<<<<<<<<<
13529  *     cdef char* c_result
13530  *     cdef char* c_href
13531  */
13532
13533 static  PyObject *__pyx_f_4lxml_5etree__getNodeAttributeValue(xmlNode *__pyx_v_c_node, PyObject *__pyx_v_key, PyObject *__pyx_v_default) {
13534   char *__pyx_v_c_result;
13535   char *__pyx_v_c_href;
13536   PyObject *__pyx_v_ns;
13537   PyObject *__pyx_v_tag;
13538   PyObject *__pyx_v_result;
13539   PyObject *__pyx_r = NULL;
13540   PyObject *__pyx_1 = 0;
13541   PyObject *__pyx_2 = 0;
13542   PyObject *__pyx_3 = 0;
13543   void *__pyx_4;
13544   PyObject *__pyx_t_1 = NULL;
13545   int __pyx_t_2;
13546   __Pyx_SetupRefcountContext("_getNodeAttributeValue");
13547   __pyx_v_ns = Py_None; __Pyx_INCREF(Py_None);
13548   __pyx_v_tag = Py_None; __Pyx_INCREF(Py_None);
13549   __pyx_v_result = Py_None; __Pyx_INCREF(Py_None);
13550
13551   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":461
13552  *     cdef char* c_result
13553  *     cdef char* c_href
13554  *     ns, tag = _getNsTag(key)             # <<<<<<<<<<<<<<
13555  *     c_href = NULL if ns is None else _cstr(ns)
13556  *     c_result = tree.xmlGetNsProp(c_node, _cstr(tag), c_href)
13557  */
13558   __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13559   __Pyx_GOTREF(__pyx_t_1);
13560   if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 2)) {
13561     PyObject* tuple = __pyx_t_1;
13562     __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
13563     __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
13564     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13565     __Pyx_DECREF(__pyx_v_ns);
13566     __pyx_v_ns = __pyx_2;
13567     __pyx_2 = 0;
13568     __Pyx_DECREF(__pyx_v_tag);
13569     __pyx_v_tag = __pyx_3;
13570     __pyx_3 = 0;
13571   } else {
13572     __pyx_1 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13573     __Pyx_GOTREF(__pyx_1);
13574     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13575     __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13576     __Pyx_GOTREF(__pyx_2);
13577     __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13578     __Pyx_GOTREF(__pyx_3);
13579     if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13580     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
13581     __Pyx_DECREF(__pyx_v_ns);
13582     __pyx_v_ns = __pyx_2;
13583     __pyx_2 = 0;
13584     __Pyx_DECREF(__pyx_v_tag);
13585     __pyx_v_tag = __pyx_3;
13586     __pyx_3 = 0;
13587   }
13588
13589   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":462
13590  *     cdef char* c_href
13591  *     ns, tag = _getNsTag(key)
13592  *     c_href = NULL if ns is None else _cstr(ns)             # <<<<<<<<<<<<<<
13593  *     c_result = tree.xmlGetNsProp(c_node, _cstr(tag), c_href)
13594  *     if c_result is NULL:
13595  */
13596   __pyx_t_2 = (__pyx_v_ns == Py_None);
13597   if (__pyx_t_2) {
13598     __pyx_4 = NULL;
13599   } else {
13600     __pyx_4 = PyString_AS_STRING(__pyx_v_ns);
13601   }
13602   __pyx_v_c_href = __pyx_4;
13603
13604   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":463
13605  *     ns, tag = _getNsTag(key)
13606  *     c_href = NULL if ns is None else _cstr(ns)
13607  *     c_result = tree.xmlGetNsProp(c_node, _cstr(tag), c_href)             # <<<<<<<<<<<<<<
13608  *     if c_result is NULL:
13609  *         # XXX free namespace that is not in use..?
13610  */
13611   __pyx_v_c_result = xmlGetNsProp(__pyx_v_c_node, PyString_AS_STRING(__pyx_v_tag), __pyx_v_c_href);
13612
13613   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":464
13614  *     c_href = NULL if ns is None else _cstr(ns)
13615  *     c_result = tree.xmlGetNsProp(c_node, _cstr(tag), c_href)
13616  *     if c_result is NULL:             # <<<<<<<<<<<<<<
13617  *         # XXX free namespace that is not in use..?
13618  *         return default
13619  */
13620   __pyx_t_2 = (__pyx_v_c_result == NULL);
13621   if (__pyx_t_2) {
13622
13623     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":466
13624  *     if c_result is NULL:
13625  *         # XXX free namespace that is not in use..?
13626  *         return default             # <<<<<<<<<<<<<<
13627  *     try:
13628  *         result = funicode(c_result)
13629  */
13630     __Pyx_XDECREF(__pyx_r);
13631     __Pyx_INCREF(__pyx_v_default);
13632     __pyx_r = __pyx_v_default;
13633     goto __pyx_L0;
13634     goto __pyx_L3;
13635   }
13636   __pyx_L3:;
13637
13638   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":467
13639  *         # XXX free namespace that is not in use..?
13640  *         return default
13641  *     try:             # <<<<<<<<<<<<<<
13642  *         result = funicode(c_result)
13643  *     finally:
13644  */
13645   /*try:*/ {
13646
13647     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":468
13648  *         return default
13649  *     try:
13650  *         result = funicode(c_result)             # <<<<<<<<<<<<<<
13651  *     finally:
13652  *         tree.xmlFree(c_result)
13653  */
13654     __pyx_t_1 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_result); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L5;}
13655     __Pyx_GOTREF(__pyx_t_1);
13656     __Pyx_DECREF(__pyx_v_result);
13657     __pyx_v_result = __pyx_t_1;
13658     __pyx_t_1 = 0;
13659   }
13660   /*finally:*/ {
13661     int __pyx_why;
13662     PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
13663     int __pyx_exc_lineno;
13664     __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
13665     __pyx_why = 0; goto __pyx_L6;
13666     __pyx_L5: {
13667       __pyx_why = 4;
13668       __Pyx_XDECREF(__pyx_1); __pyx_1 = 0;
13669       __Pyx_XDECREF(__pyx_2); __pyx_2 = 0;
13670       __Pyx_XDECREF(__pyx_3); __pyx_3 = 0;
13671       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
13672       __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
13673       __pyx_exc_lineno = __pyx_lineno;
13674       goto __pyx_L6;
13675     }
13676     __pyx_L6:;
13677
13678     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":470
13679  *         result = funicode(c_result)
13680  *     finally:
13681  *         tree.xmlFree(c_result)             # <<<<<<<<<<<<<<
13682  *     return result
13683  * 
13684  */
13685     xmlFree(__pyx_v_c_result);
13686     switch (__pyx_why) {
13687       case 4: {
13688         __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
13689         __pyx_lineno = __pyx_exc_lineno;
13690         __pyx_exc_type = 0;
13691         __pyx_exc_value = 0;
13692         __pyx_exc_tb = 0;
13693         goto __pyx_L1_error;
13694       }
13695     }
13696   }
13697
13698   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":471
13699  *     finally:
13700  *         tree.xmlFree(c_result)
13701  *     return result             # <<<<<<<<<<<<<<
13702  * 
13703  * cdef inline object _getAttributeValue(_Element element, key, default):
13704  */
13705   __Pyx_XDECREF(__pyx_r);
13706   __Pyx_INCREF(__pyx_v_result);
13707   __pyx_r = __pyx_v_result;
13708   goto __pyx_L0;
13709
13710   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13711   goto __pyx_L0;
13712   __pyx_L1_error:;
13713   __Pyx_XDECREF(__pyx_1);
13714   __Pyx_XDECREF(__pyx_2);
13715   __Pyx_XDECREF(__pyx_3);
13716   __Pyx_XDECREF(__pyx_t_1);
13717   __Pyx_AddTraceback("lxml.etree._getNodeAttributeValue");
13718   __pyx_r = 0;
13719   __pyx_L0:;
13720   __Pyx_DECREF(__pyx_v_ns);
13721   __Pyx_DECREF(__pyx_v_tag);
13722   __Pyx_DECREF(__pyx_v_result);
13723   __Pyx_XGIVEREF(__pyx_r);
13724   __Pyx_FinishRefcountContext();
13725   return __pyx_r;
13726 }
13727
13728 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":473
13729  *     return result
13730  * 
13731  * cdef inline object _getAttributeValue(_Element element, key, default):             # <<<<<<<<<<<<<<
13732  *     return _getNodeAttributeValue(element._c_node, key, default)
13733  * 
13734  */
13735
13736 static INLINE PyObject *__pyx_f_4lxml_5etree__getAttributeValue(struct LxmlElement *__pyx_v_element, PyObject *__pyx_v_key, PyObject *__pyx_v_default) {
13737   PyObject *__pyx_r = NULL;
13738   PyObject *__pyx_t_1 = NULL;
13739   __Pyx_SetupRefcountContext("_getAttributeValue");
13740
13741   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":474
13742  * 
13743  * cdef inline object _getAttributeValue(_Element element, key, default):
13744  *     return _getNodeAttributeValue(element._c_node, key, default)             # <<<<<<<<<<<<<<
13745  * 
13746  * cdef int _setAttributeValue(_Element element, key, value) except -1:
13747  */
13748   __Pyx_XDECREF(__pyx_r);
13749   __pyx_t_1 = __pyx_f_4lxml_5etree__getNodeAttributeValue(__pyx_v_element->_c_node, __pyx_v_key, __pyx_v_default); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13750   __Pyx_GOTREF(__pyx_t_1);
13751   __pyx_r = __pyx_t_1;
13752   __pyx_t_1 = 0;
13753   goto __pyx_L0;
13754
13755   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13756   goto __pyx_L0;
13757   __pyx_L1_error:;
13758   __Pyx_XDECREF(__pyx_t_1);
13759   __Pyx_AddTraceback("lxml.etree._getAttributeValue");
13760   __pyx_r = 0;
13761   __pyx_L0:;
13762   __Pyx_XGIVEREF(__pyx_r);
13763   __Pyx_FinishRefcountContext();
13764   return __pyx_r;
13765 }
13766
13767 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":476
13768  *     return _getNodeAttributeValue(element._c_node, key, default)
13769  * 
13770  * cdef int _setAttributeValue(_Element element, key, value) except -1:             # <<<<<<<<<<<<<<
13771  *     cdef xmlNs* c_ns
13772  *     cdef char* c_value
13773  */
13774
13775 static  int __pyx_f_4lxml_5etree__setAttributeValue(struct LxmlElement *__pyx_v_element, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
13776   xmlNs *__pyx_v_c_ns;
13777   char *__pyx_v_c_value;
13778   char *__pyx_v_c_tag;
13779   PyObject *__pyx_v_ns;
13780   PyObject *__pyx_v_tag;
13781   int __pyx_r;
13782   PyObject *__pyx_1 = 0;
13783   PyObject *__pyx_2 = 0;
13784   PyObject *__pyx_3 = 0;
13785   PyObject *__pyx_t_1 = NULL;
13786   int __pyx_t_2;
13787   int __pyx_t_3;
13788   xmlNs *__pyx_t_4;
13789   __Pyx_SetupRefcountContext("_setAttributeValue");
13790   __Pyx_INCREF(__pyx_v_value);
13791   __pyx_v_ns = Py_None; __Pyx_INCREF(Py_None);
13792   __pyx_v_tag = Py_None; __Pyx_INCREF(Py_None);
13793
13794   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":480
13795  *     cdef char* c_value
13796  *     cdef char* c_tag
13797  *     ns, tag = _getNsTag(key)             # <<<<<<<<<<<<<<
13798  *     if not element._doc._parser._for_html:
13799  *         _attributeValidOrRaise(tag)
13800  */
13801   __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13802   __Pyx_GOTREF(__pyx_t_1);
13803   if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 2)) {
13804     PyObject* tuple = __pyx_t_1;
13805     __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
13806     __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
13807     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13808     __Pyx_DECREF(__pyx_v_ns);
13809     __pyx_v_ns = __pyx_2;
13810     __pyx_2 = 0;
13811     __Pyx_DECREF(__pyx_v_tag);
13812     __pyx_v_tag = __pyx_3;
13813     __pyx_3 = 0;
13814   } else {
13815     __pyx_1 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13816     __Pyx_GOTREF(__pyx_1);
13817     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13818     __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13819     __Pyx_GOTREF(__pyx_2);
13820     __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13821     __Pyx_GOTREF(__pyx_3);
13822     if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13823     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
13824     __Pyx_DECREF(__pyx_v_ns);
13825     __pyx_v_ns = __pyx_2;
13826     __pyx_2 = 0;
13827     __Pyx_DECREF(__pyx_v_tag);
13828     __pyx_v_tag = __pyx_3;
13829     __pyx_3 = 0;
13830   }
13831
13832   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":481
13833  *     cdef char* c_tag
13834  *     ns, tag = _getNsTag(key)
13835  *     if not element._doc._parser._for_html:             # <<<<<<<<<<<<<<
13836  *         _attributeValidOrRaise(tag)
13837  *     c_tag = _cstr(tag)
13838  */
13839   __pyx_t_2 = (!__pyx_v_element->_doc->_parser->_for_html);
13840   if (__pyx_t_2) {
13841
13842     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":482
13843  *     ns, tag = _getNsTag(key)
13844  *     if not element._doc._parser._for_html:
13845  *         _attributeValidOrRaise(tag)             # <<<<<<<<<<<<<<
13846  *     c_tag = _cstr(tag)
13847  *     if isinstance(value, QName):
13848  */
13849     __pyx_t_3 = __pyx_f_4lxml_5etree__attributeValidOrRaise(__pyx_v_tag); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13850     goto __pyx_L3;
13851   }
13852   __pyx_L3:;
13853
13854   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":483
13855  *     if not element._doc._parser._for_html:
13856  *         _attributeValidOrRaise(tag)
13857  *     c_tag = _cstr(tag)             # <<<<<<<<<<<<<<
13858  *     if isinstance(value, QName):
13859  *         value = _resolveQNameText(element, value)
13860  */
13861   __pyx_v_c_tag = PyString_AS_STRING(__pyx_v_tag);
13862
13863   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":484
13864  *         _attributeValidOrRaise(tag)
13865  *     c_tag = _cstr(tag)
13866  *     if isinstance(value, QName):             # <<<<<<<<<<<<<<
13867  *         value = _resolveQNameText(element, value)
13868  *     else:
13869  */
13870   __pyx_t_2 = PyObject_TypeCheck(__pyx_v_value, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree_QName))); 
13871   if (__pyx_t_2) {
13872
13873     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":485
13874  *     c_tag = _cstr(tag)
13875  *     if isinstance(value, QName):
13876  *         value = _resolveQNameText(element, value)             # <<<<<<<<<<<<<<
13877  *     else:
13878  *         value = _utf8(value)
13879  */
13880     __pyx_t_1 = __pyx_f_4lxml_5etree__resolveQNameText(__pyx_v_element, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13881     __Pyx_GOTREF(__pyx_t_1);
13882     __Pyx_DECREF(__pyx_v_value);
13883     __pyx_v_value = __pyx_t_1;
13884     __pyx_t_1 = 0;
13885     goto __pyx_L4;
13886   }
13887   /*else*/ {
13888
13889     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":487
13890  *         value = _resolveQNameText(element, value)
13891  *     else:
13892  *         value = _utf8(value)             # <<<<<<<<<<<<<<
13893  *     c_value = _cstr(value)
13894  *     if ns is None:
13895  */
13896     __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13897     __Pyx_GOTREF(__pyx_t_1);
13898     __Pyx_DECREF(__pyx_v_value);
13899     __pyx_v_value = __pyx_t_1;
13900     __pyx_t_1 = 0;
13901   }
13902   __pyx_L4:;
13903
13904   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":488
13905  *     else:
13906  *         value = _utf8(value)
13907  *     c_value = _cstr(value)             # <<<<<<<<<<<<<<
13908  *     if ns is None:
13909  *         c_ns = NULL
13910  */
13911   __pyx_v_c_value = PyString_AS_STRING(__pyx_v_value);
13912
13913   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":489
13914  *         value = _utf8(value)
13915  *     c_value = _cstr(value)
13916  *     if ns is None:             # <<<<<<<<<<<<<<
13917  *         c_ns = NULL
13918  *     else:
13919  */
13920   __pyx_t_2 = (__pyx_v_ns == Py_None);
13921   if (__pyx_t_2) {
13922
13923     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":490
13924  *     c_value = _cstr(value)
13925  *     if ns is None:
13926  *         c_ns = NULL             # <<<<<<<<<<<<<<
13927  *     else:
13928  *         c_ns = element._doc._findOrBuildNodeNs(element._c_node,
13929  */
13930     __pyx_v_c_ns = NULL;
13931     goto __pyx_L5;
13932   }
13933   /*else*/ {
13934
13935     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":493
13936  *     else:
13937  *         c_ns = element._doc._findOrBuildNodeNs(element._c_node,
13938  *                                                _cstr(ns), NULL)             # <<<<<<<<<<<<<<
13939  *     tree.xmlSetNsProp(element._c_node, c_ns, c_tag, c_value)
13940  *     return 0
13941  */
13942     __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_element->_doc->__pyx_vtab)->_findOrBuildNodeNs(__pyx_v_element->_doc, __pyx_v_element->_c_node, PyString_AS_STRING(__pyx_v_ns), NULL); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13943     __pyx_v_c_ns = __pyx_t_4;
13944   }
13945   __pyx_L5:;
13946
13947   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":494
13948  *         c_ns = element._doc._findOrBuildNodeNs(element._c_node,
13949  *                                                _cstr(ns), NULL)
13950  *     tree.xmlSetNsProp(element._c_node, c_ns, c_tag, c_value)             # <<<<<<<<<<<<<<
13951  *     return 0
13952  * 
13953  */
13954   xmlSetNsProp(__pyx_v_element->_c_node, __pyx_v_c_ns, __pyx_v_c_tag, __pyx_v_c_value);
13955
13956   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":495
13957  *                                                _cstr(ns), NULL)
13958  *     tree.xmlSetNsProp(element._c_node, c_ns, c_tag, c_value)
13959  *     return 0             # <<<<<<<<<<<<<<
13960  * 
13961  * cdef int _delAttribute(_Element element, key) except -1:
13962  */
13963   __pyx_r = 0;
13964   goto __pyx_L0;
13965
13966   __pyx_r = 0;
13967   goto __pyx_L0;
13968   __pyx_L1_error:;
13969   __Pyx_XDECREF(__pyx_1);
13970   __Pyx_XDECREF(__pyx_2);
13971   __Pyx_XDECREF(__pyx_3);
13972   __Pyx_XDECREF(__pyx_t_1);
13973   __Pyx_AddTraceback("lxml.etree._setAttributeValue");
13974   __pyx_r = -1;
13975   __pyx_L0:;
13976   __Pyx_DECREF(__pyx_v_ns);
13977   __Pyx_DECREF(__pyx_v_tag);
13978   __Pyx_DECREF(__pyx_v_value);
13979   __Pyx_FinishRefcountContext();
13980   return __pyx_r;
13981 }
13982
13983 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":497
13984  *     return 0
13985  * 
13986  * cdef int _delAttribute(_Element element, key) except -1:             # <<<<<<<<<<<<<<
13987  *     cdef char* c_href
13988  *     ns, tag = _getNsTag(key)
13989  */
13990
13991 static  int __pyx_f_4lxml_5etree__delAttribute(struct LxmlElement *__pyx_v_element, PyObject *__pyx_v_key) {
13992   char *__pyx_v_c_href;
13993   PyObject *__pyx_v_ns;
13994   PyObject *__pyx_v_tag;
13995   int __pyx_r;
13996   PyObject *__pyx_1 = 0;
13997   PyObject *__pyx_2 = 0;
13998   PyObject *__pyx_3 = 0;
13999   void *__pyx_4;
14000   PyObject *__pyx_t_1 = NULL;
14001   int __pyx_t_2;
14002   int __pyx_t_3;
14003   __Pyx_SetupRefcountContext("_delAttribute");
14004   __pyx_v_ns = Py_None; __Pyx_INCREF(Py_None);
14005   __pyx_v_tag = Py_None; __Pyx_INCREF(Py_None);
14006
14007   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":499
14008  * cdef int _delAttribute(_Element element, key) except -1:
14009  *     cdef char* c_href
14010  *     ns, tag = _getNsTag(key)             # <<<<<<<<<<<<<<
14011  *     c_href = NULL if ns is None else _cstr(ns)
14012  *     if _delAttributeFromNsName(element._c_node, c_href, _cstr(tag)):
14013  */
14014   __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14015   __Pyx_GOTREF(__pyx_t_1);
14016   if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 2)) {
14017     PyObject* tuple = __pyx_t_1;
14018     __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
14019     __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
14020     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14021     __Pyx_DECREF(__pyx_v_ns);
14022     __pyx_v_ns = __pyx_2;
14023     __pyx_2 = 0;
14024     __Pyx_DECREF(__pyx_v_tag);
14025     __pyx_v_tag = __pyx_3;
14026     __pyx_3 = 0;
14027   } else {
14028     __pyx_1 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14029     __Pyx_GOTREF(__pyx_1);
14030     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14031     __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14032     __Pyx_GOTREF(__pyx_2);
14033     __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14034     __Pyx_GOTREF(__pyx_3);
14035     if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14036     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
14037     __Pyx_DECREF(__pyx_v_ns);
14038     __pyx_v_ns = __pyx_2;
14039     __pyx_2 = 0;
14040     __Pyx_DECREF(__pyx_v_tag);
14041     __pyx_v_tag = __pyx_3;
14042     __pyx_3 = 0;
14043   }
14044
14045   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":500
14046  *     cdef char* c_href
14047  *     ns, tag = _getNsTag(key)
14048  *     c_href = NULL if ns is None else _cstr(ns)             # <<<<<<<<<<<<<<
14049  *     if _delAttributeFromNsName(element._c_node, c_href, _cstr(tag)):
14050  *         raise KeyError, key
14051  */
14052   __pyx_t_2 = (__pyx_v_ns == Py_None);
14053   if (__pyx_t_2) {
14054     __pyx_4 = NULL;
14055   } else {
14056     __pyx_4 = PyString_AS_STRING(__pyx_v_ns);
14057   }
14058   __pyx_v_c_href = __pyx_4;
14059
14060   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":501
14061  *     ns, tag = _getNsTag(key)
14062  *     c_href = NULL if ns is None else _cstr(ns)
14063  *     if _delAttributeFromNsName(element._c_node, c_href, _cstr(tag)):             # <<<<<<<<<<<<<<
14064  *         raise KeyError, key
14065  *     return 0
14066  */
14067   __pyx_t_3 = __pyx_f_4lxml_5etree__delAttributeFromNsName(__pyx_v_element->_c_node, __pyx_v_c_href, PyString_AS_STRING(__pyx_v_tag));
14068   if (__pyx_t_3) {
14069
14070     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":502
14071  *     c_href = NULL if ns is None else _cstr(ns)
14072  *     if _delAttributeFromNsName(element._c_node, c_href, _cstr(tag)):
14073  *         raise KeyError, key             # <<<<<<<<<<<<<<
14074  *     return 0
14075  * 
14076  */
14077     __Pyx_Raise(__pyx_builtin_KeyError, __pyx_v_key, 0);
14078     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14079     goto __pyx_L3;
14080   }
14081   __pyx_L3:;
14082
14083   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":503
14084  *     if _delAttributeFromNsName(element._c_node, c_href, _cstr(tag)):
14085  *         raise KeyError, key
14086  *     return 0             # <<<<<<<<<<<<<<
14087  * 
14088  * cdef int _delAttributeFromNsName(xmlNode* c_node, char* c_href, char* c_name):
14089  */
14090   __pyx_r = 0;
14091   goto __pyx_L0;
14092
14093   __pyx_r = 0;
14094   goto __pyx_L0;
14095   __pyx_L1_error:;
14096   __Pyx_XDECREF(__pyx_1);
14097   __Pyx_XDECREF(__pyx_2);
14098   __Pyx_XDECREF(__pyx_3);
14099   __Pyx_XDECREF(__pyx_t_1);
14100   __Pyx_AddTraceback("lxml.etree._delAttribute");
14101   __pyx_r = -1;
14102   __pyx_L0:;
14103   __Pyx_DECREF(__pyx_v_ns);
14104   __Pyx_DECREF(__pyx_v_tag);
14105   __Pyx_FinishRefcountContext();
14106   return __pyx_r;
14107 }
14108
14109 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":505
14110  *     return 0
14111  * 
14112  * cdef int _delAttributeFromNsName(xmlNode* c_node, char* c_href, char* c_name):             # <<<<<<<<<<<<<<
14113  *     cdef xmlAttr* c_attr
14114  *     c_attr = tree.xmlHasNsProp(c_node, c_name, c_href)
14115  */
14116
14117 static  int __pyx_f_4lxml_5etree__delAttributeFromNsName(xmlNode *__pyx_v_c_node, char *__pyx_v_c_href, char *__pyx_v_c_name) {
14118   xmlAttr *__pyx_v_c_attr;
14119   int __pyx_r;
14120   int __pyx_t_1;
14121   __Pyx_SetupRefcountContext("_delAttributeFromNsName");
14122
14123   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":507
14124  * cdef int _delAttributeFromNsName(xmlNode* c_node, char* c_href, char* c_name):
14125  *     cdef xmlAttr* c_attr
14126  *     c_attr = tree.xmlHasNsProp(c_node, c_name, c_href)             # <<<<<<<<<<<<<<
14127  *     if c_attr is NULL:
14128  *         # XXX free namespace that is not in use..?
14129  */
14130   __pyx_v_c_attr = xmlHasNsProp(__pyx_v_c_node, __pyx_v_c_name, __pyx_v_c_href);
14131
14132   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":508
14133  *     cdef xmlAttr* c_attr
14134  *     c_attr = tree.xmlHasNsProp(c_node, c_name, c_href)
14135  *     if c_attr is NULL:             # <<<<<<<<<<<<<<
14136  *         # XXX free namespace that is not in use..?
14137  *         return -1
14138  */
14139   __pyx_t_1 = (__pyx_v_c_attr == NULL);
14140   if (__pyx_t_1) {
14141
14142     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":510
14143  *     if c_attr is NULL:
14144  *         # XXX free namespace that is not in use..?
14145  *         return -1             # <<<<<<<<<<<<<<
14146  *     tree.xmlRemoveProp(c_attr)
14147  *     return 0
14148  */
14149     __pyx_r = -1;
14150     goto __pyx_L0;
14151     goto __pyx_L3;
14152   }
14153   __pyx_L3:;
14154
14155   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":511
14156  *         # XXX free namespace that is not in use..?
14157  *         return -1
14158  *     tree.xmlRemoveProp(c_attr)             # <<<<<<<<<<<<<<
14159  *     return 0
14160  * 
14161  */
14162   xmlRemoveProp(__pyx_v_c_attr);
14163
14164   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":512
14165  *         return -1
14166  *     tree.xmlRemoveProp(c_attr)
14167  *     return 0             # <<<<<<<<<<<<<<
14168  * 
14169  * cdef object _collectAttributes(xmlNode* c_node, int collecttype):
14170  */
14171   __pyx_r = 0;
14172   goto __pyx_L0;
14173
14174   __pyx_r = 0;
14175   __pyx_L0:;
14176   __Pyx_FinishRefcountContext();
14177   return __pyx_r;
14178 }
14179
14180 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":514
14181  *     return 0
14182  * 
14183  * cdef object _collectAttributes(xmlNode* c_node, int collecttype):             # <<<<<<<<<<<<<<
14184  *     u"""Collect all attributes of a node in a list.  Depending on collecttype,
14185  *     it collects either the name (1), the value (2) or the name-value tuples.
14186  */
14187
14188 static  PyObject *__pyx_f_4lxml_5etree__collectAttributes(xmlNode *__pyx_v_c_node, int __pyx_v_collecttype) {
14189   Py_ssize_t __pyx_v_count;
14190   xmlAttr *__pyx_v_c_attr;
14191   PyObject *__pyx_v_attributes;
14192   PyObject *__pyx_v_item;
14193   PyObject *__pyx_r = NULL;
14194   int __pyx_t_1;
14195   PyObject *__pyx_t_2 = NULL;
14196   PyObject *__pyx_t_3 = NULL;
14197   PyObject *__pyx_t_4 = NULL;
14198   __Pyx_SetupRefcountContext("_collectAttributes");
14199   __pyx_v_attributes = Py_None; __Pyx_INCREF(Py_None);
14200   __pyx_v_item = Py_None; __Pyx_INCREF(Py_None);
14201
14202   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":520
14203  *     cdef Py_ssize_t count
14204  *     cdef xmlAttr* c_attr
14205  *     c_attr = c_node.properties             # <<<<<<<<<<<<<<
14206  *     count = 0
14207  *     while c_attr is not NULL:
14208  */
14209   __pyx_v_c_attr = __pyx_v_c_node->properties;
14210
14211   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":521
14212  *     cdef xmlAttr* c_attr
14213  *     c_attr = c_node.properties
14214  *     count = 0             # <<<<<<<<<<<<<<
14215  *     while c_attr is not NULL:
14216  *         if c_attr.type == tree.XML_ATTRIBUTE_NODE:
14217  */
14218   __pyx_v_count = 0;
14219
14220   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":522
14221  *     c_attr = c_node.properties
14222  *     count = 0
14223  *     while c_attr is not NULL:             # <<<<<<<<<<<<<<
14224  *         if c_attr.type == tree.XML_ATTRIBUTE_NODE:
14225  *             count = count + 1
14226  */
14227   while (1) {
14228     __pyx_t_1 = (__pyx_v_c_attr != NULL);
14229     if (!__pyx_t_1) break;
14230
14231     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":523
14232  *     count = 0
14233  *     while c_attr is not NULL:
14234  *         if c_attr.type == tree.XML_ATTRIBUTE_NODE:             # <<<<<<<<<<<<<<
14235  *             count = count + 1
14236  *         c_attr = c_attr.next
14237  */
14238     __pyx_t_1 = (__pyx_v_c_attr->type == XML_ATTRIBUTE_NODE);
14239     if (__pyx_t_1) {
14240
14241       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":524
14242  *     while c_attr is not NULL:
14243  *         if c_attr.type == tree.XML_ATTRIBUTE_NODE:
14244  *             count = count + 1             # <<<<<<<<<<<<<<
14245  *         c_attr = c_attr.next
14246  * 
14247  */
14248       __pyx_v_count = (__pyx_v_count + 1);
14249       goto __pyx_L5;
14250     }
14251     __pyx_L5:;
14252
14253     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":525
14254  *         if c_attr.type == tree.XML_ATTRIBUTE_NODE:
14255  *             count = count + 1
14256  *         c_attr = c_attr.next             # <<<<<<<<<<<<<<
14257  * 
14258  *     if count == 0:
14259  */
14260     __pyx_v_c_attr = __pyx_v_c_attr->next;
14261   }
14262
14263   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":527
14264  *         c_attr = c_attr.next
14265  * 
14266  *     if count == 0:             # <<<<<<<<<<<<<<
14267  *         return []
14268  * 
14269  */
14270   __pyx_t_1 = (__pyx_v_count == 0);
14271   if (__pyx_t_1) {
14272
14273     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":528
14274  * 
14275  *     if count == 0:
14276  *         return []             # <<<<<<<<<<<<<<
14277  * 
14278  *     attributes = python.PyList_New(count)
14279  */
14280     __Pyx_XDECREF(__pyx_r);
14281     __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14282     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
14283     __pyx_r = ((PyObject *)__pyx_t_2);
14284     __pyx_t_2 = 0;
14285     goto __pyx_L0;
14286     goto __pyx_L6;
14287   }
14288   __pyx_L6:;
14289
14290   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":530
14291  *         return []
14292  * 
14293  *     attributes = python.PyList_New(count)             # <<<<<<<<<<<<<<
14294  *     c_attr = c_node.properties
14295  *     count = 0
14296  */
14297   __pyx_t_2 = PyList_New(__pyx_v_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14298   __Pyx_GOTREF(__pyx_t_2);
14299   __Pyx_DECREF(__pyx_v_attributes);
14300   __pyx_v_attributes = __pyx_t_2;
14301   __pyx_t_2 = 0;
14302
14303   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":531
14304  * 
14305  *     attributes = python.PyList_New(count)
14306  *     c_attr = c_node.properties             # <<<<<<<<<<<<<<
14307  *     count = 0
14308  *     while c_attr is not NULL:
14309  */
14310   __pyx_v_c_attr = __pyx_v_c_node->properties;
14311
14312   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":532
14313  *     attributes = python.PyList_New(count)
14314  *     c_attr = c_node.properties
14315  *     count = 0             # <<<<<<<<<<<<<<
14316  *     while c_attr is not NULL:
14317  *         if c_attr.type == tree.XML_ATTRIBUTE_NODE:
14318  */
14319   __pyx_v_count = 0;
14320
14321   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":533
14322  *     c_attr = c_node.properties
14323  *     count = 0
14324  *     while c_attr is not NULL:             # <<<<<<<<<<<<<<
14325  *         if c_attr.type == tree.XML_ATTRIBUTE_NODE:
14326  *             if collecttype == 1:
14327  */
14328   while (1) {
14329     __pyx_t_1 = (__pyx_v_c_attr != NULL);
14330     if (!__pyx_t_1) break;
14331
14332     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":534
14333  *     count = 0
14334  *     while c_attr is not NULL:
14335  *         if c_attr.type == tree.XML_ATTRIBUTE_NODE:             # <<<<<<<<<<<<<<
14336  *             if collecttype == 1:
14337  *                 item = _namespacedName(<xmlNode*>c_attr)
14338  */
14339     __pyx_t_1 = (__pyx_v_c_attr->type == XML_ATTRIBUTE_NODE);
14340     if (__pyx_t_1) {
14341
14342       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":535
14343  *     while c_attr is not NULL:
14344  *         if c_attr.type == tree.XML_ATTRIBUTE_NODE:
14345  *             if collecttype == 1:             # <<<<<<<<<<<<<<
14346  *                 item = _namespacedName(<xmlNode*>c_attr)
14347  *             elif collecttype == 2:
14348  */
14349       switch (__pyx_v_collecttype) {
14350         case 1:
14351
14352         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":536
14353  *         if c_attr.type == tree.XML_ATTRIBUTE_NODE:
14354  *             if collecttype == 1:
14355  *                 item = _namespacedName(<xmlNode*>c_attr)             # <<<<<<<<<<<<<<
14356  *             elif collecttype == 2:
14357  *                 item = _attributeValue(c_node, c_attr)
14358  */
14359         __pyx_t_2 = __pyx_f_4lxml_5etree__namespacedName(((xmlNode *)__pyx_v_c_attr)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14360         __Pyx_GOTREF(__pyx_t_2);
14361         __Pyx_DECREF(__pyx_v_item);
14362         __pyx_v_item = __pyx_t_2;
14363         __pyx_t_2 = 0;
14364         break;
14365
14366         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":537
14367  *             if collecttype == 1:
14368  *                 item = _namespacedName(<xmlNode*>c_attr)
14369  *             elif collecttype == 2:             # <<<<<<<<<<<<<<
14370  *                 item = _attributeValue(c_node, c_attr)
14371  *             else:
14372  */
14373         case 2:
14374
14375         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":538
14376  *                 item = _namespacedName(<xmlNode*>c_attr)
14377  *             elif collecttype == 2:
14378  *                 item = _attributeValue(c_node, c_attr)             # <<<<<<<<<<<<<<
14379  *             else:
14380  *                 item = (_namespacedName(<xmlNode*>c_attr),
14381  */
14382         __pyx_t_2 = __pyx_f_4lxml_5etree__attributeValue(__pyx_v_c_node, __pyx_v_c_attr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14383         __Pyx_GOTREF(__pyx_t_2);
14384         __Pyx_DECREF(__pyx_v_item);
14385         __pyx_v_item = __pyx_t_2;
14386         __pyx_t_2 = 0;
14387         break;
14388         default:
14389
14390         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":540
14391  *                 item = _attributeValue(c_node, c_attr)
14392  *             else:
14393  *                 item = (_namespacedName(<xmlNode*>c_attr),             # <<<<<<<<<<<<<<
14394  *                         _attributeValue(c_node, c_attr))
14395  * 
14396  */
14397         __pyx_t_2 = __pyx_f_4lxml_5etree__namespacedName(((xmlNode *)__pyx_v_c_attr)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14398         __Pyx_GOTREF(__pyx_t_2);
14399
14400         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":541
14401  *             else:
14402  *                 item = (_namespacedName(<xmlNode*>c_attr),
14403  *                         _attributeValue(c_node, c_attr))             # <<<<<<<<<<<<<<
14404  * 
14405  *             python.Py_INCREF(item)
14406  */
14407         __pyx_t_3 = __pyx_f_4lxml_5etree__attributeValue(__pyx_v_c_node, __pyx_v_c_attr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14408         __Pyx_GOTREF(__pyx_t_3);
14409         __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14410         __Pyx_GOTREF(((PyObject *)__pyx_t_4));
14411         PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
14412         __Pyx_GIVEREF(__pyx_t_2);
14413         PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
14414         __Pyx_GIVEREF(__pyx_t_3);
14415         __pyx_t_2 = 0;
14416         __pyx_t_3 = 0;
14417         __Pyx_DECREF(__pyx_v_item);
14418         __pyx_v_item = ((PyObject *)__pyx_t_4);
14419         __pyx_t_4 = 0;
14420         break;
14421       }
14422
14423       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":543
14424  *                         _attributeValue(c_node, c_attr))
14425  * 
14426  *             python.Py_INCREF(item)             # <<<<<<<<<<<<<<
14427  *             python.PyList_SET_ITEM(attributes, count, item)
14428  *             count = count + 1
14429  */
14430       Py_INCREF(__pyx_v_item);
14431
14432       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":544
14433  * 
14434  *             python.Py_INCREF(item)
14435  *             python.PyList_SET_ITEM(attributes, count, item)             # <<<<<<<<<<<<<<
14436  *             count = count + 1
14437  *         c_attr = c_attr.next
14438  */
14439       PyList_SET_ITEM(__pyx_v_attributes, __pyx_v_count, __pyx_v_item);
14440
14441       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":545
14442  *             python.Py_INCREF(item)
14443  *             python.PyList_SET_ITEM(attributes, count, item)
14444  *             count = count + 1             # <<<<<<<<<<<<<<
14445  *         c_attr = c_attr.next
14446  *     return attributes
14447  */
14448       __pyx_v_count = (__pyx_v_count + 1);
14449       goto __pyx_L9;
14450     }
14451     __pyx_L9:;
14452
14453     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":546
14454  *             python.PyList_SET_ITEM(attributes, count, item)
14455  *             count = count + 1
14456  *         c_attr = c_attr.next             # <<<<<<<<<<<<<<
14457  *     return attributes
14458  * 
14459  */
14460     __pyx_v_c_attr = __pyx_v_c_attr->next;
14461   }
14462
14463   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":547
14464  *             count = count + 1
14465  *         c_attr = c_attr.next
14466  *     return attributes             # <<<<<<<<<<<<<<
14467  * 
14468  * cdef object __RE_XML_ENCODING
14469  */
14470   __Pyx_XDECREF(__pyx_r);
14471   __Pyx_INCREF(__pyx_v_attributes);
14472   __pyx_r = __pyx_v_attributes;
14473   goto __pyx_L0;
14474
14475   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14476   goto __pyx_L0;
14477   __pyx_L1_error:;
14478   __Pyx_XDECREF(__pyx_t_2);
14479   __Pyx_XDECREF(__pyx_t_3);
14480   __Pyx_XDECREF(__pyx_t_4);
14481   __Pyx_AddTraceback("lxml.etree._collectAttributes");
14482   __pyx_r = 0;
14483   __pyx_L0:;
14484   __Pyx_DECREF(__pyx_v_attributes);
14485   __Pyx_DECREF(__pyx_v_item);
14486   __Pyx_XGIVEREF(__pyx_r);
14487   __Pyx_FinishRefcountContext();
14488   return __pyx_r;
14489 }
14490
14491 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":559
14492  * __HAS_XML_ENCODING = __RE_XML_ENCODING.match
14493  * 
14494  * cdef object _stripEncodingDeclaration(object xml_string):             # <<<<<<<<<<<<<<
14495  *     # this is a hack to remove the XML encoding declaration from unicode
14496  *     return __REPLACE_XML_ENCODING(ur'\g<1>', xml_string)
14497  */
14498
14499 static  PyObject *__pyx_f_4lxml_5etree__stripEncodingDeclaration(PyObject *__pyx_v_xml_string) {
14500   PyObject *__pyx_r = NULL;
14501   PyObject *__pyx_t_1 = NULL;
14502   PyObject *__pyx_t_2 = NULL;
14503   __Pyx_SetupRefcountContext("_stripEncodingDeclaration");
14504
14505   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":561
14506  * cdef object _stripEncodingDeclaration(object xml_string):
14507  *     # this is a hack to remove the XML encoding declaration from unicode
14508  *     return __REPLACE_XML_ENCODING(ur'\g<1>', xml_string)             # <<<<<<<<<<<<<<
14509  * 
14510  * cdef int _hasEncodingDeclaration(object xml_string):
14511  */
14512   __Pyx_XDECREF(__pyx_r);
14513   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14514   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
14515   __Pyx_INCREF(((PyObject *)__pyx_kp_240));
14516   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_240));
14517   __Pyx_GIVEREF(((PyObject *)__pyx_kp_240));
14518   __Pyx_INCREF(__pyx_v_xml_string);
14519   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_xml_string);
14520   __Pyx_GIVEREF(__pyx_v_xml_string);
14521   __pyx_t_2 = PyObject_Call(__pyx_v_4lxml_5etree___REPLACE_XML_ENCODING, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14522   __Pyx_GOTREF(__pyx_t_2);
14523   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
14524   __pyx_r = __pyx_t_2;
14525   __pyx_t_2 = 0;
14526   goto __pyx_L0;
14527
14528   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14529   goto __pyx_L0;
14530   __pyx_L1_error:;
14531   __Pyx_XDECREF(__pyx_t_1);
14532   __Pyx_XDECREF(__pyx_t_2);
14533   __Pyx_AddTraceback("lxml.etree._stripEncodingDeclaration");
14534   __pyx_r = 0;
14535   __pyx_L0:;
14536   __Pyx_XGIVEREF(__pyx_r);
14537   __Pyx_FinishRefcountContext();
14538   return __pyx_r;
14539 }
14540
14541 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":563
14542  *     return __REPLACE_XML_ENCODING(ur'\g<1>', xml_string)
14543  * 
14544  * cdef int _hasEncodingDeclaration(object xml_string):             # <<<<<<<<<<<<<<
14545  *     # check if a (unicode) string has an XML encoding declaration
14546  *     return __HAS_XML_ENCODING(xml_string) is not None
14547  */
14548
14549 static  int __pyx_f_4lxml_5etree__hasEncodingDeclaration(PyObject *__pyx_v_xml_string) {
14550   int __pyx_r;
14551   PyObject *__pyx_t_1 = NULL;
14552   PyObject *__pyx_t_2 = NULL;
14553   int __pyx_t_3;
14554   __Pyx_SetupRefcountContext("_hasEncodingDeclaration");
14555
14556   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":565
14557  * cdef int _hasEncodingDeclaration(object xml_string):
14558  *     # check if a (unicode) string has an XML encoding declaration
14559  *     return __HAS_XML_ENCODING(xml_string) is not None             # <<<<<<<<<<<<<<
14560  * 
14561  * cdef object _stripDeclaration(object xml_string):
14562  */
14563   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14564   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
14565   __Pyx_INCREF(__pyx_v_xml_string);
14566   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_xml_string);
14567   __Pyx_GIVEREF(__pyx_v_xml_string);
14568   __pyx_t_2 = PyObject_Call(__pyx_v_4lxml_5etree___HAS_XML_ENCODING, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14569   __Pyx_GOTREF(__pyx_t_2);
14570   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
14571   __pyx_t_3 = (__pyx_t_2 != Py_None);
14572   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14573   __pyx_r = __pyx_t_3;
14574   goto __pyx_L0;
14575
14576   __pyx_r = 0;
14577   goto __pyx_L0;
14578   __pyx_L1_error:;
14579   __Pyx_XDECREF(__pyx_t_1);
14580   __Pyx_XDECREF(__pyx_t_2);
14581   __Pyx_WriteUnraisable("lxml.etree._hasEncodingDeclaration");
14582   __pyx_r = 0;
14583   __pyx_L0:;
14584   __Pyx_FinishRefcountContext();
14585   return __pyx_r;
14586 }
14587
14588 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":567
14589  *     return __HAS_XML_ENCODING(xml_string) is not None
14590  * 
14591  * cdef object _stripDeclaration(object xml_string):             # <<<<<<<<<<<<<<
14592  *     # this is a hack to remove the XML declaration when we encode to UTF-8
14593  *     xml_string = xml_string.strip()
14594  */
14595
14596 static  PyObject *__pyx_f_4lxml_5etree__stripDeclaration(PyObject *__pyx_v_xml_string) {
14597   PyObject *__pyx_v_i;
14598   PyObject *__pyx_r = NULL;
14599   PyObject *__pyx_1 = 0;
14600   PyObject *__pyx_t_1 = NULL;
14601   PyObject *__pyx_t_2 = NULL;
14602   int __pyx_t_3;
14603   PyObject *__pyx_t_4 = NULL;
14604   Py_ssize_t __pyx_t_5;
14605   Py_ssize_t __pyx_t_6;
14606   __Pyx_SetupRefcountContext("_stripDeclaration");
14607   __Pyx_INCREF(__pyx_v_xml_string);
14608   __pyx_v_i = Py_None; __Pyx_INCREF(Py_None);
14609
14610   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":569
14611  * cdef object _stripDeclaration(object xml_string):
14612  *     # this is a hack to remove the XML declaration when we encode to UTF-8
14613  *     xml_string = xml_string.strip()             # <<<<<<<<<<<<<<
14614  *     if xml_string[:5] == '<?xml':
14615  *         i = xml_string.find('?>')
14616  */
14617   __pyx_t_1 = PyObject_GetAttr(__pyx_v_xml_string, __pyx_kp_strip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14618   __Pyx_GOTREF(__pyx_t_1);
14619   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14620   __Pyx_GOTREF(__pyx_t_2);
14621   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14622   __Pyx_DECREF(__pyx_v_xml_string);
14623   __pyx_v_xml_string = __pyx_t_2;
14624   __pyx_t_2 = 0;
14625
14626   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":570
14627  *     # this is a hack to remove the XML declaration when we encode to UTF-8
14628  *     xml_string = xml_string.strip()
14629  *     if xml_string[:5] == '<?xml':             # <<<<<<<<<<<<<<
14630  *         i = xml_string.find('?>')
14631  *         if i != -1:
14632  */
14633   __pyx_1 = PySequence_GetSlice(__pyx_v_xml_string, 0, 5); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14634   __Pyx_GOTREF(__pyx_1);
14635   __pyx_t_2 = PyObject_RichCompare(__pyx_1, __pyx_kp_241, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14636   __Pyx_GOTREF(__pyx_t_2);
14637   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
14638   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14639   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14640   if (__pyx_t_3) {
14641
14642     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":571
14643  *     xml_string = xml_string.strip()
14644  *     if xml_string[:5] == '<?xml':
14645  *         i = xml_string.find('?>')             # <<<<<<<<<<<<<<
14646  *         if i != -1:
14647  *             i = i + 2
14648  */
14649     __pyx_t_2 = PyObject_GetAttr(__pyx_v_xml_string, __pyx_kp_find); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14650     __Pyx_GOTREF(__pyx_t_2);
14651     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14652     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
14653     __Pyx_INCREF(__pyx_kp_242);
14654     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_242);
14655     __Pyx_GIVEREF(__pyx_kp_242);
14656     __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14657     __Pyx_GOTREF(__pyx_t_4);
14658     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14659     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
14660     __Pyx_DECREF(__pyx_v_i);
14661     __pyx_v_i = __pyx_t_4;
14662     __pyx_t_4 = 0;
14663
14664     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":572
14665  *     if xml_string[:5] == '<?xml':
14666  *         i = xml_string.find('?>')
14667  *         if i != -1:             # <<<<<<<<<<<<<<
14668  *             i = i + 2
14669  *             while xml_string[i:i+1] in '\n\r ':
14670  */
14671     __pyx_t_4 = PyObject_RichCompare(__pyx_v_i, __pyx_int_neg_1, Py_NE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14672     __Pyx_GOTREF(__pyx_t_4);
14673     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14674     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14675     if (__pyx_t_3) {
14676
14677       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":573
14678  *         i = xml_string.find('?>')
14679  *         if i != -1:
14680  *             i = i + 2             # <<<<<<<<<<<<<<
14681  *             while xml_string[i:i+1] in '\n\r ':
14682  *                 i = i+1
14683  */
14684       __pyx_t_4 = PyNumber_Add(__pyx_v_i, __pyx_int_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14685       __Pyx_GOTREF(__pyx_t_4);
14686       __Pyx_DECREF(__pyx_v_i);
14687       __pyx_v_i = __pyx_t_4;
14688       __pyx_t_4 = 0;
14689
14690       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":574
14691  *         if i != -1:
14692  *             i = i + 2
14693  *             while xml_string[i:i+1] in '\n\r ':             # <<<<<<<<<<<<<<
14694  *                 i = i+1
14695  *             xml_string = xml_string[i:]
14696  */
14697       while (1) {
14698         __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14699         __pyx_t_4 = PyNumber_Add(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14700         __Pyx_GOTREF(__pyx_t_4);
14701         __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14702         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14703         __pyx_1 = PySequence_GetSlice(__pyx_v_xml_string, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14704         __Pyx_GOTREF(__pyx_1);
14705         __pyx_t_3 = (PySequence_Contains(__pyx_kp_243, __pyx_1)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14706         __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
14707         if (!__pyx_t_3) break;
14708
14709         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":575
14710  *             i = i + 2
14711  *             while xml_string[i:i+1] in '\n\r ':
14712  *                 i = i+1             # <<<<<<<<<<<<<<
14713  *             xml_string = xml_string[i:]
14714  *     return xml_string
14715  */
14716         __pyx_t_4 = PyNumber_Add(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14717         __Pyx_GOTREF(__pyx_t_4);
14718         __Pyx_DECREF(__pyx_v_i);
14719         __pyx_v_i = __pyx_t_4;
14720         __pyx_t_4 = 0;
14721       }
14722
14723       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":576
14724  *             while xml_string[i:i+1] in '\n\r ':
14725  *                 i = i+1
14726  *             xml_string = xml_string[i:]             # <<<<<<<<<<<<<<
14727  *     return xml_string
14728  * 
14729  */
14730       __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14731       __pyx_1 = PySequence_GetSlice(__pyx_v_xml_string, __pyx_t_6, PY_SSIZE_T_MAX); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14732       __Pyx_GOTREF(__pyx_1);
14733       __Pyx_DECREF(__pyx_v_xml_string);
14734       __pyx_v_xml_string = __pyx_1;
14735       __pyx_1 = 0;
14736       goto __pyx_L4;
14737     }
14738     __pyx_L4:;
14739     goto __pyx_L3;
14740   }
14741   __pyx_L3:;
14742
14743   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":577
14744  *                 i = i+1
14745  *             xml_string = xml_string[i:]
14746  *     return xml_string             # <<<<<<<<<<<<<<
14747  * 
14748  * cdef inline int _hasText(xmlNode* c_node):
14749  */
14750   __Pyx_XDECREF(__pyx_r);
14751   __Pyx_INCREF(__pyx_v_xml_string);
14752   __pyx_r = __pyx_v_xml_string;
14753   goto __pyx_L0;
14754
14755   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14756   goto __pyx_L0;
14757   __pyx_L1_error:;
14758   __Pyx_XDECREF(__pyx_1);
14759   __Pyx_XDECREF(__pyx_t_1);
14760   __Pyx_XDECREF(__pyx_t_2);
14761   __Pyx_XDECREF(__pyx_t_4);
14762   __Pyx_AddTraceback("lxml.etree._stripDeclaration");
14763   __pyx_r = 0;
14764   __pyx_L0:;
14765   __Pyx_DECREF(__pyx_v_i);
14766   __Pyx_DECREF(__pyx_v_xml_string);
14767   __Pyx_XGIVEREF(__pyx_r);
14768   __Pyx_FinishRefcountContext();
14769   return __pyx_r;
14770 }
14771
14772 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":579
14773  *     return xml_string
14774  * 
14775  * cdef inline int _hasText(xmlNode* c_node):             # <<<<<<<<<<<<<<
14776  *     return c_node is not NULL and _textNodeOrSkip(c_node.children) is not NULL
14777  * 
14778  */
14779
14780 static INLINE int __pyx_f_4lxml_5etree__hasText(xmlNode *__pyx_v_c_node) {
14781   int __pyx_r;
14782   int __pyx_t_1;
14783   __Pyx_SetupRefcountContext("_hasText");
14784
14785   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":580
14786  * 
14787  * cdef inline int _hasText(xmlNode* c_node):
14788  *     return c_node is not NULL and _textNodeOrSkip(c_node.children) is not NULL             # <<<<<<<<<<<<<<
14789  * 
14790  * cdef inline int _hasTail(xmlNode* c_node):
14791  */
14792   if ((__pyx_v_c_node != NULL)) {
14793     __pyx_t_1 = (__pyx_f_4lxml_5etree__textNodeOrSkip(__pyx_v_c_node->children) != NULL);
14794   } else {
14795     __pyx_t_1 = (__pyx_v_c_node != NULL);
14796   }
14797   __pyx_r = __pyx_t_1;
14798   goto __pyx_L0;
14799
14800   __pyx_r = 0;
14801   __pyx_L0:;
14802   __Pyx_FinishRefcountContext();
14803   return __pyx_r;
14804 }
14805
14806 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":582
14807  *     return c_node is not NULL and _textNodeOrSkip(c_node.children) is not NULL
14808  * 
14809  * cdef inline int _hasTail(xmlNode* c_node):             # <<<<<<<<<<<<<<
14810  *     return c_node is not NULL and _textNodeOrSkip(c_node.next) is not NULL
14811  * 
14812  */
14813
14814 static INLINE int __pyx_f_4lxml_5etree__hasTail(xmlNode *__pyx_v_c_node) {
14815   int __pyx_r;
14816   int __pyx_t_1;
14817   __Pyx_SetupRefcountContext("_hasTail");
14818
14819   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":583
14820  * 
14821  * cdef inline int _hasTail(xmlNode* c_node):
14822  *     return c_node is not NULL and _textNodeOrSkip(c_node.next) is not NULL             # <<<<<<<<<<<<<<
14823  * 
14824  * cdef _collectText(xmlNode* c_node):
14825  */
14826   if ((__pyx_v_c_node != NULL)) {
14827     __pyx_t_1 = (__pyx_f_4lxml_5etree__textNodeOrSkip(__pyx_v_c_node->next) != NULL);
14828   } else {
14829     __pyx_t_1 = (__pyx_v_c_node != NULL);
14830   }
14831   __pyx_r = __pyx_t_1;
14832   goto __pyx_L0;
14833
14834   __pyx_r = 0;
14835   __pyx_L0:;
14836   __Pyx_FinishRefcountContext();
14837   return __pyx_r;
14838 }
14839
14840 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":585
14841  *     return c_node is not NULL and _textNodeOrSkip(c_node.next) is not NULL
14842  * 
14843  * cdef _collectText(xmlNode* c_node):             # <<<<<<<<<<<<<<
14844  *     u"""Collect all text nodes and return them as a unicode string.
14845  * 
14846  */
14847
14848 static  PyObject *__pyx_f_4lxml_5etree__collectText(xmlNode *__pyx_v_c_node) {
14849   Py_ssize_t __pyx_v_scount;
14850   char *__pyx_v_c_text;
14851   xmlNode *__pyx_v_c_node_cur;
14852   PyObject *__pyx_v_result;
14853   PyObject *__pyx_r = NULL;
14854   xmlNode *__pyx_t_1;
14855   int __pyx_t_2;
14856   PyObject *__pyx_t_3 = NULL;
14857   PyObject *__pyx_t_4 = NULL;
14858   char *__pyx_t_5;
14859   __Pyx_SetupRefcountContext("_collectText");
14860   __pyx_v_result = Py_None; __Pyx_INCREF(Py_None);
14861
14862   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":596
14863  *     cdef xmlNode* c_node_cur
14864  *     # check for multiple text nodes
14865  *     scount = 0             # <<<<<<<<<<<<<<
14866  *     c_text = NULL
14867  *     c_node_cur = c_node = _textNodeOrSkip(c_node)
14868  */
14869   __pyx_v_scount = 0;
14870
14871   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":597
14872  *     # check for multiple text nodes
14873  *     scount = 0
14874  *     c_text = NULL             # <<<<<<<<<<<<<<
14875  *     c_node_cur = c_node = _textNodeOrSkip(c_node)
14876  *     while c_node_cur is not NULL:
14877  */
14878   __pyx_v_c_text = NULL;
14879
14880   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":598
14881  *     scount = 0
14882  *     c_text = NULL
14883  *     c_node_cur = c_node = _textNodeOrSkip(c_node)             # <<<<<<<<<<<<<<
14884  *     while c_node_cur is not NULL:
14885  *         if c_node_cur.content[0] != c'\0':
14886  */
14887   __pyx_t_1 = __pyx_f_4lxml_5etree__textNodeOrSkip(__pyx_v_c_node);
14888   __pyx_v_c_node_cur = __pyx_t_1;
14889   __pyx_v_c_node = __pyx_t_1;
14890
14891   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":599
14892  *     c_text = NULL
14893  *     c_node_cur = c_node = _textNodeOrSkip(c_node)
14894  *     while c_node_cur is not NULL:             # <<<<<<<<<<<<<<
14895  *         if c_node_cur.content[0] != c'\0':
14896  *             c_text = c_node_cur.content
14897  */
14898   while (1) {
14899     __pyx_t_2 = (__pyx_v_c_node_cur != NULL);
14900     if (!__pyx_t_2) break;
14901
14902     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":600
14903  *     c_node_cur = c_node = _textNodeOrSkip(c_node)
14904  *     while c_node_cur is not NULL:
14905  *         if c_node_cur.content[0] != c'\0':             # <<<<<<<<<<<<<<
14906  *             c_text = c_node_cur.content
14907  *         scount = scount + 1
14908  */
14909     __pyx_t_2 = ((__pyx_v_c_node_cur->content[0]) != '\x00');
14910     if (__pyx_t_2) {
14911
14912       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":601
14913  *     while c_node_cur is not NULL:
14914  *         if c_node_cur.content[0] != c'\0':
14915  *             c_text = c_node_cur.content             # <<<<<<<<<<<<<<
14916  *         scount = scount + 1
14917  *         c_node_cur = _textNodeOrSkip(c_node_cur.next)
14918  */
14919       __pyx_v_c_text = __pyx_v_c_node_cur->content;
14920       goto __pyx_L5;
14921     }
14922     __pyx_L5:;
14923
14924     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":602
14925  *         if c_node_cur.content[0] != c'\0':
14926  *             c_text = c_node_cur.content
14927  *         scount = scount + 1             # <<<<<<<<<<<<<<
14928  *         c_node_cur = _textNodeOrSkip(c_node_cur.next)
14929  * 
14930  */
14931     __pyx_v_scount = (__pyx_v_scount + 1);
14932
14933     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":603
14934  *             c_text = c_node_cur.content
14935  *         scount = scount + 1
14936  *         c_node_cur = _textNodeOrSkip(c_node_cur.next)             # <<<<<<<<<<<<<<
14937  * 
14938  *     # handle two most common cases first
14939  */
14940     __pyx_v_c_node_cur = __pyx_f_4lxml_5etree__textNodeOrSkip(__pyx_v_c_node_cur->next);
14941   }
14942
14943   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":606
14944  * 
14945  *     # handle two most common cases first
14946  *     if c_text is NULL:             # <<<<<<<<<<<<<<
14947  *         if scount > 0:
14948  *             if python.IS_PYTHON3:
14949  */
14950   __pyx_t_2 = (__pyx_v_c_text == NULL);
14951   if (__pyx_t_2) {
14952
14953     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":607
14954  *     # handle two most common cases first
14955  *     if c_text is NULL:
14956  *         if scount > 0:             # <<<<<<<<<<<<<<
14957  *             if python.IS_PYTHON3:
14958  *                 return u''
14959  */
14960     __pyx_t_2 = (__pyx_v_scount > 0);
14961     if (__pyx_t_2) {
14962
14963       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":608
14964  *     if c_text is NULL:
14965  *         if scount > 0:
14966  *             if python.IS_PYTHON3:             # <<<<<<<<<<<<<<
14967  *                 return u''
14968  *             else:
14969  */
14970       __pyx_t_2 = IS_PYTHON3;
14971       if (__pyx_t_2) {
14972
14973         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":609
14974  *         if scount > 0:
14975  *             if python.IS_PYTHON3:
14976  *                 return u''             # <<<<<<<<<<<<<<
14977  *             else:
14978  *                 return ''
14979  */
14980         __Pyx_XDECREF(__pyx_r);
14981         __Pyx_INCREF(((PyObject *)__pyx_kp_244));
14982         __pyx_r = ((PyObject *)__pyx_kp_244);
14983         goto __pyx_L0;
14984         goto __pyx_L8;
14985       }
14986       /*else*/ {
14987
14988         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":611
14989  *                 return u''
14990  *             else:
14991  *                 return ''             # <<<<<<<<<<<<<<
14992  *         else:
14993  *             return None
14994  */
14995         __Pyx_XDECREF(__pyx_r);
14996         __Pyx_INCREF(__pyx_kp_245);
14997         __pyx_r = __pyx_kp_245;
14998         goto __pyx_L0;
14999       }
15000       __pyx_L8:;
15001       goto __pyx_L7;
15002     }
15003     /*else*/ {
15004
15005       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":613
15006  *                 return ''
15007  *         else:
15008  *             return None             # <<<<<<<<<<<<<<
15009  *     if scount == 1:
15010  *         return funicode(c_text)
15011  */
15012       __Pyx_XDECREF(__pyx_r);
15013       __Pyx_INCREF(Py_None);
15014       __pyx_r = Py_None;
15015       goto __pyx_L0;
15016     }
15017     __pyx_L7:;
15018     goto __pyx_L6;
15019   }
15020   __pyx_L6:;
15021
15022   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":614
15023  *         else:
15024  *             return None
15025  *     if scount == 1:             # <<<<<<<<<<<<<<
15026  *         return funicode(c_text)
15027  * 
15028  */
15029   __pyx_t_2 = (__pyx_v_scount == 1);
15030   if (__pyx_t_2) {
15031
15032     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":615
15033  *             return None
15034  *     if scount == 1:
15035  *         return funicode(c_text)             # <<<<<<<<<<<<<<
15036  * 
15037  *     # the rest is not performance critical anymore
15038  */
15039     __Pyx_XDECREF(__pyx_r);
15040     __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_text); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15041     __Pyx_GOTREF(__pyx_t_3);
15042     __pyx_r = __pyx_t_3;
15043     __pyx_t_3 = 0;
15044     goto __pyx_L0;
15045     goto __pyx_L9;
15046   }
15047   __pyx_L9:;
15048
15049   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":618
15050  * 
15051  *     # the rest is not performance critical anymore
15052  *     result = ''             # <<<<<<<<<<<<<<
15053  *     while c_node is not NULL:
15054  *         result = result + c_node.content
15055  */
15056   __Pyx_INCREF(__pyx_kp_246);
15057   __Pyx_DECREF(__pyx_v_result);
15058   __pyx_v_result = __pyx_kp_246;
15059
15060   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":619
15061  *     # the rest is not performance critical anymore
15062  *     result = ''
15063  *     while c_node is not NULL:             # <<<<<<<<<<<<<<
15064  *         result = result + c_node.content
15065  *         c_node = _textNodeOrSkip(c_node.next)
15066  */
15067   while (1) {
15068     __pyx_t_2 = (__pyx_v_c_node != NULL);
15069     if (!__pyx_t_2) break;
15070
15071     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":620
15072  *     result = ''
15073  *     while c_node is not NULL:
15074  *         result = result + c_node.content             # <<<<<<<<<<<<<<
15075  *         c_node = _textNodeOrSkip(c_node.next)
15076  *     return funicode(result)
15077  */
15078     __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_c_node->content); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15079     __Pyx_GOTREF(__pyx_t_3);
15080     __pyx_t_4 = PyNumber_Add(__pyx_v_result, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15081     __Pyx_GOTREF(__pyx_t_4);
15082     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15083     __Pyx_DECREF(__pyx_v_result);
15084     __pyx_v_result = __pyx_t_4;
15085     __pyx_t_4 = 0;
15086
15087     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":621
15088  *     while c_node is not NULL:
15089  *         result = result + c_node.content
15090  *         c_node = _textNodeOrSkip(c_node.next)             # <<<<<<<<<<<<<<
15091  *     return funicode(result)
15092  * 
15093  */
15094     __pyx_v_c_node = __pyx_f_4lxml_5etree__textNodeOrSkip(__pyx_v_c_node->next);
15095   }
15096
15097   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":622
15098  *         result = result + c_node.content
15099  *         c_node = _textNodeOrSkip(c_node.next)
15100  *     return funicode(result)             # <<<<<<<<<<<<<<
15101  * 
15102  * cdef void _removeText(xmlNode* c_node):
15103  */
15104   __Pyx_XDECREF(__pyx_r);
15105   __pyx_t_5 = __Pyx_PyBytes_AsString(__pyx_v_result); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15106   __pyx_t_4 = __pyx_f_4lxml_5etree_funicode(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15107   __Pyx_GOTREF(__pyx_t_4);
15108   __pyx_r = __pyx_t_4;
15109   __pyx_t_4 = 0;
15110   goto __pyx_L0;
15111
15112   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15113   goto __pyx_L0;
15114   __pyx_L1_error:;
15115   __Pyx_XDECREF(__pyx_t_3);
15116   __Pyx_XDECREF(__pyx_t_4);
15117   __Pyx_AddTraceback("lxml.etree._collectText");
15118   __pyx_r = 0;
15119   __pyx_L0:;
15120   __Pyx_DECREF(__pyx_v_result);
15121   __Pyx_XGIVEREF(__pyx_r);
15122   __Pyx_FinishRefcountContext();
15123   return __pyx_r;
15124 }
15125
15126 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":624
15127  *     return funicode(result)
15128  * 
15129  * cdef void _removeText(xmlNode* c_node):             # <<<<<<<<<<<<<<
15130  *     u"""Remove all text nodes.
15131  * 
15132  */
15133
15134 static  void __pyx_f_4lxml_5etree__removeText(xmlNode *__pyx_v_c_node) {
15135   xmlNode *__pyx_v_c_next;
15136   int __pyx_t_1;
15137   __Pyx_SetupRefcountContext("_removeText");
15138
15139   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":630
15140  *     """
15141  *     cdef xmlNode* c_next
15142  *     c_node = _textNodeOrSkip(c_node)             # <<<<<<<<<<<<<<
15143  *     while c_node is not NULL:
15144  *         c_next = _textNodeOrSkip(c_node.next)
15145  */
15146   __pyx_v_c_node = __pyx_f_4lxml_5etree__textNodeOrSkip(__pyx_v_c_node);
15147
15148   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":631
15149  *     cdef xmlNode* c_next
15150  *     c_node = _textNodeOrSkip(c_node)
15151  *     while c_node is not NULL:             # <<<<<<<<<<<<<<
15152  *         c_next = _textNodeOrSkip(c_node.next)
15153  *         tree.xmlUnlinkNode(c_node)
15154  */
15155   while (1) {
15156     __pyx_t_1 = (__pyx_v_c_node != NULL);
15157     if (!__pyx_t_1) break;
15158
15159     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":632
15160  *     c_node = _textNodeOrSkip(c_node)
15161  *     while c_node is not NULL:
15162  *         c_next = _textNodeOrSkip(c_node.next)             # <<<<<<<<<<<<<<
15163  *         tree.xmlUnlinkNode(c_node)
15164  *         tree.xmlFreeNode(c_node)
15165  */
15166     __pyx_v_c_next = __pyx_f_4lxml_5etree__textNodeOrSkip(__pyx_v_c_node->next);
15167
15168     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":633
15169  *     while c_node is not NULL:
15170  *         c_next = _textNodeOrSkip(c_node.next)
15171  *         tree.xmlUnlinkNode(c_node)             # <<<<<<<<<<<<<<
15172  *         tree.xmlFreeNode(c_node)
15173  *         c_node = c_next
15174  */
15175     xmlUnlinkNode(__pyx_v_c_node);
15176
15177     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":634
15178  *         c_next = _textNodeOrSkip(c_node.next)
15179  *         tree.xmlUnlinkNode(c_node)
15180  *         tree.xmlFreeNode(c_node)             # <<<<<<<<<<<<<<
15181  *         c_node = c_next
15182  * 
15183  */
15184     xmlFreeNode(__pyx_v_c_node);
15185
15186     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":635
15187  *         tree.xmlUnlinkNode(c_node)
15188  *         tree.xmlFreeNode(c_node)
15189  *         c_node = c_next             # <<<<<<<<<<<<<<
15190  * 
15191  * cdef int _setNodeText(xmlNode* c_node, value) except -1:
15192  */
15193     __pyx_v_c_node = __pyx_v_c_next;
15194   }
15195
15196   __Pyx_FinishRefcountContext();
15197 }
15198
15199 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":637
15200  *         c_node = c_next
15201  * 
15202  * cdef int _setNodeText(xmlNode* c_node, value) except -1:             # <<<<<<<<<<<<<<
15203  *     cdef xmlNode* c_text_node
15204  *     # remove all text nodes at the start first
15205  */
15206
15207 static  int __pyx_f_4lxml_5etree__setNodeText(xmlNode *__pyx_v_c_node, PyObject *__pyx_v_value) {
15208   xmlNode *__pyx_v_c_text_node;
15209   PyObject *__pyx_v_text;
15210   int __pyx_r;
15211   int __pyx_t_1;
15212   PyObject *__pyx_t_2 = NULL;
15213   __Pyx_SetupRefcountContext("_setNodeText");
15214   __pyx_v_text = Py_None; __Pyx_INCREF(Py_None);
15215
15216   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":640
15217  *     cdef xmlNode* c_text_node
15218  *     # remove all text nodes at the start first
15219  *     _removeText(c_node.children)             # <<<<<<<<<<<<<<
15220  *     if value is None:
15221  *         return 0
15222  */
15223   __pyx_f_4lxml_5etree__removeText(__pyx_v_c_node->children);
15224
15225   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":641
15226  *     # remove all text nodes at the start first
15227  *     _removeText(c_node.children)
15228  *     if value is None:             # <<<<<<<<<<<<<<
15229  *         return 0
15230  *     # now add new text node with value at start
15231  */
15232   __pyx_t_1 = (__pyx_v_value == Py_None);
15233   if (__pyx_t_1) {
15234
15235     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":642
15236  *     _removeText(c_node.children)
15237  *     if value is None:
15238  *         return 0             # <<<<<<<<<<<<<<
15239  *     # now add new text node with value at start
15240  *     if python._isString(value):
15241  */
15242     __pyx_r = 0;
15243     goto __pyx_L0;
15244     goto __pyx_L3;
15245   }
15246   __pyx_L3:;
15247
15248   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":644
15249  *         return 0
15250  *     # now add new text node with value at start
15251  *     if python._isString(value):             # <<<<<<<<<<<<<<
15252  *         text = _utf8(value)
15253  *         c_text_node = tree.xmlNewDocText(c_node.doc, _cstr(text))
15254  */
15255   __pyx_t_1 = _isString(__pyx_v_value);
15256   if (__pyx_t_1) {
15257
15258     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":645
15259  *     # now add new text node with value at start
15260  *     if python._isString(value):
15261  *         text = _utf8(value)             # <<<<<<<<<<<<<<
15262  *         c_text_node = tree.xmlNewDocText(c_node.doc, _cstr(text))
15263  *     elif isinstance(value, CDATA):
15264  */
15265     __pyx_t_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15266     __Pyx_GOTREF(__pyx_t_2);
15267     __Pyx_DECREF(__pyx_v_text);
15268     __pyx_v_text = __pyx_t_2;
15269     __pyx_t_2 = 0;
15270
15271     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":646
15272  *     if python._isString(value):
15273  *         text = _utf8(value)
15274  *         c_text_node = tree.xmlNewDocText(c_node.doc, _cstr(text))             # <<<<<<<<<<<<<<
15275  *     elif isinstance(value, CDATA):
15276  *         c_text_node = tree.xmlNewCDataBlock(
15277  */
15278     __pyx_v_c_text_node = xmlNewDocText(__pyx_v_c_node->doc, PyString_AS_STRING(__pyx_v_text));
15279     goto __pyx_L4;
15280   }
15281
15282   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":647
15283  *         text = _utf8(value)
15284  *         c_text_node = tree.xmlNewDocText(c_node.doc, _cstr(text))
15285  *     elif isinstance(value, CDATA):             # <<<<<<<<<<<<<<
15286  *         c_text_node = tree.xmlNewCDataBlock(
15287  *             c_node.doc, _cstr((<CDATA>value)._utf8_data),
15288  */
15289   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_value, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree_CDATA))); 
15290   if (__pyx_t_1) {
15291
15292     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":650
15293  *         c_text_node = tree.xmlNewCDataBlock(
15294  *             c_node.doc, _cstr((<CDATA>value)._utf8_data),
15295  *             python.PyString_GET_SIZE((<CDATA>value)._utf8_data))             # <<<<<<<<<<<<<<
15296  *     else:
15297  *         # this will raise the right error
15298  */
15299     __pyx_v_c_text_node = xmlNewCDataBlock(__pyx_v_c_node->doc, PyString_AS_STRING(((struct __pyx_obj_4lxml_5etree_CDATA *)__pyx_v_value)->_utf8_data), PyString_GET_SIZE(((struct __pyx_obj_4lxml_5etree_CDATA *)__pyx_v_value)->_utf8_data));
15300     goto __pyx_L4;
15301   }
15302   /*else*/ {
15303
15304     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":653
15305  *     else:
15306  *         # this will raise the right error
15307  *        _utf8(value)             # <<<<<<<<<<<<<<
15308  *        return -1
15309  *     if c_node.children is NULL:
15310  */
15311     __pyx_t_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15312     __Pyx_GOTREF(__pyx_t_2);
15313     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15314
15315     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":654
15316  *         # this will raise the right error
15317  *        _utf8(value)
15318  *        return -1             # <<<<<<<<<<<<<<
15319  *     if c_node.children is NULL:
15320  *         tree.xmlAddChild(c_node, c_text_node)
15321  */
15322     __pyx_r = -1;
15323     goto __pyx_L0;
15324   }
15325   __pyx_L4:;
15326
15327   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":655
15328  *        _utf8(value)
15329  *        return -1
15330  *     if c_node.children is NULL:             # <<<<<<<<<<<<<<
15331  *         tree.xmlAddChild(c_node, c_text_node)
15332  *     else:
15333  */
15334   __pyx_t_1 = (__pyx_v_c_node->children == NULL);
15335   if (__pyx_t_1) {
15336
15337     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":656
15338  *        return -1
15339  *     if c_node.children is NULL:
15340  *         tree.xmlAddChild(c_node, c_text_node)             # <<<<<<<<<<<<<<
15341  *     else:
15342  *         tree.xmlAddPrevSibling(c_node.children, c_text_node)
15343  */
15344     xmlAddChild(__pyx_v_c_node, __pyx_v_c_text_node);
15345     goto __pyx_L5;
15346   }
15347   /*else*/ {
15348
15349     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":658
15350  *         tree.xmlAddChild(c_node, c_text_node)
15351  *     else:
15352  *         tree.xmlAddPrevSibling(c_node.children, c_text_node)             # <<<<<<<<<<<<<<
15353  *     return 0
15354  * 
15355  */
15356     xmlAddPrevSibling(__pyx_v_c_node->children, __pyx_v_c_text_node);
15357   }
15358   __pyx_L5:;
15359
15360   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":659
15361  *     else:
15362  *         tree.xmlAddPrevSibling(c_node.children, c_text_node)
15363  *     return 0             # <<<<<<<<<<<<<<
15364  * 
15365  * cdef int _setTailText(xmlNode* c_node, value) except -1:
15366  */
15367   __pyx_r = 0;
15368   goto __pyx_L0;
15369
15370   __pyx_r = 0;
15371   goto __pyx_L0;
15372   __pyx_L1_error:;
15373   __Pyx_XDECREF(__pyx_t_2);
15374   __Pyx_AddTraceback("lxml.etree._setNodeText");
15375   __pyx_r = -1;
15376   __pyx_L0:;
15377   __Pyx_DECREF(__pyx_v_text);
15378   __Pyx_FinishRefcountContext();
15379   return __pyx_r;
15380 }
15381
15382 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":661
15383  *     return 0
15384  * 
15385  * cdef int _setTailText(xmlNode* c_node, value) except -1:             # <<<<<<<<<<<<<<
15386  *     cdef xmlNode* c_text_node
15387  *     # remove all text nodes at the start first
15388  */
15389
15390 static  int __pyx_f_4lxml_5etree__setTailText(xmlNode *__pyx_v_c_node, PyObject *__pyx_v_value) {
15391   xmlNode *__pyx_v_c_text_node;
15392   PyObject *__pyx_v_text;
15393   int __pyx_r;
15394   int __pyx_t_1;
15395   PyObject *__pyx_t_2 = NULL;
15396   __Pyx_SetupRefcountContext("_setTailText");
15397   __pyx_v_text = Py_None; __Pyx_INCREF(Py_None);
15398
15399   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":664
15400  *     cdef xmlNode* c_text_node
15401  *     # remove all text nodes at the start first
15402  *     _removeText(c_node.next)             # <<<<<<<<<<<<<<
15403  *     if value is None:
15404  *         return 0
15405  */
15406   __pyx_f_4lxml_5etree__removeText(__pyx_v_c_node->next);
15407
15408   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":665
15409  *     # remove all text nodes at the start first
15410  *     _removeText(c_node.next)
15411  *     if value is None:             # <<<<<<<<<<<<<<
15412  *         return 0
15413  *     text = _utf8(value)
15414  */
15415   __pyx_t_1 = (__pyx_v_value == Py_None);
15416   if (__pyx_t_1) {
15417
15418     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":666
15419  *     _removeText(c_node.next)
15420  *     if value is None:
15421  *         return 0             # <<<<<<<<<<<<<<
15422  *     text = _utf8(value)
15423  *     c_text_node = tree.xmlNewDocText(c_node.doc, _cstr(text))
15424  */
15425     __pyx_r = 0;
15426     goto __pyx_L0;
15427     goto __pyx_L3;
15428   }
15429   __pyx_L3:;
15430
15431   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":667
15432  *     if value is None:
15433  *         return 0
15434  *     text = _utf8(value)             # <<<<<<<<<<<<<<
15435  *     c_text_node = tree.xmlNewDocText(c_node.doc, _cstr(text))
15436  *     # XXX what if we're the top element?
15437  */
15438   __pyx_t_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15439   __Pyx_GOTREF(__pyx_t_2);
15440   __Pyx_DECREF(__pyx_v_text);
15441   __pyx_v_text = __pyx_t_2;
15442   __pyx_t_2 = 0;
15443
15444   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":668
15445  *         return 0
15446  *     text = _utf8(value)
15447  *     c_text_node = tree.xmlNewDocText(c_node.doc, _cstr(text))             # <<<<<<<<<<<<<<
15448  *     # XXX what if we're the top element?
15449  *     tree.xmlAddNextSibling(c_node, c_text_node)
15450  */
15451   __pyx_v_c_text_node = xmlNewDocText(__pyx_v_c_node->doc, PyString_AS_STRING(__pyx_v_text));
15452
15453   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":670
15454  *     c_text_node = tree.xmlNewDocText(c_node.doc, _cstr(text))
15455  *     # XXX what if we're the top element?
15456  *     tree.xmlAddNextSibling(c_node, c_text_node)             # <<<<<<<<<<<<<<
15457  *     return 0
15458  * 
15459  */
15460   xmlAddNextSibling(__pyx_v_c_node, __pyx_v_c_text_node);
15461
15462   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":671
15463  *     # XXX what if we're the top element?
15464  *     tree.xmlAddNextSibling(c_node, c_text_node)
15465  *     return 0             # <<<<<<<<<<<<<<
15466  * 
15467  * cdef _resolveQNameText(_Element element, value):
15468  */
15469   __pyx_r = 0;
15470   goto __pyx_L0;
15471
15472   __pyx_r = 0;
15473   goto __pyx_L0;
15474   __pyx_L1_error:;
15475   __Pyx_XDECREF(__pyx_t_2);
15476   __Pyx_AddTraceback("lxml.etree._setTailText");
15477   __pyx_r = -1;
15478   __pyx_L0:;
15479   __Pyx_DECREF(__pyx_v_text);
15480   __Pyx_FinishRefcountContext();
15481   return __pyx_r;
15482 }
15483
15484 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":673
15485  *     return 0
15486  * 
15487  * cdef _resolveQNameText(_Element element, value):             # <<<<<<<<<<<<<<
15488  *     cdef xmlNs* c_ns
15489  *     ns, tag = _getNsTag(value)
15490  */
15491
15492 static  PyObject *__pyx_f_4lxml_5etree__resolveQNameText(struct LxmlElement *__pyx_v_element, PyObject *__pyx_v_value) {
15493   xmlNs *__pyx_v_c_ns;
15494   PyObject *__pyx_v_ns;
15495   PyObject *__pyx_v_tag;
15496   PyObject *__pyx_r = NULL;
15497   PyObject *__pyx_1 = 0;
15498   PyObject *__pyx_2 = 0;
15499   PyObject *__pyx_3 = 0;
15500   PyObject *__pyx_t_1 = NULL;
15501   int __pyx_t_2;
15502   xmlNs *__pyx_t_3;
15503   __Pyx_SetupRefcountContext("_resolveQNameText");
15504   __pyx_v_ns = Py_None; __Pyx_INCREF(Py_None);
15505   __pyx_v_tag = Py_None; __Pyx_INCREF(Py_None);
15506
15507   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":675
15508  * cdef _resolveQNameText(_Element element, value):
15509  *     cdef xmlNs* c_ns
15510  *     ns, tag = _getNsTag(value)             # <<<<<<<<<<<<<<
15511  *     if ns is None:
15512  *         return tag
15513  */
15514   __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15515   __Pyx_GOTREF(__pyx_t_1);
15516   if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 2)) {
15517     PyObject* tuple = __pyx_t_1;
15518     __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
15519     __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
15520     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15521     __Pyx_DECREF(__pyx_v_ns);
15522     __pyx_v_ns = __pyx_2;
15523     __pyx_2 = 0;
15524     __Pyx_DECREF(__pyx_v_tag);
15525     __pyx_v_tag = __pyx_3;
15526     __pyx_3 = 0;
15527   } else {
15528     __pyx_1 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15529     __Pyx_GOTREF(__pyx_1);
15530     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15531     __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15532     __Pyx_GOTREF(__pyx_2);
15533     __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15534     __Pyx_GOTREF(__pyx_3);
15535     if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15536     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
15537     __Pyx_DECREF(__pyx_v_ns);
15538     __pyx_v_ns = __pyx_2;
15539     __pyx_2 = 0;
15540     __Pyx_DECREF(__pyx_v_tag);
15541     __pyx_v_tag = __pyx_3;
15542     __pyx_3 = 0;
15543   }
15544
15545   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":676
15546  *     cdef xmlNs* c_ns
15547  *     ns, tag = _getNsTag(value)
15548  *     if ns is None:             # <<<<<<<<<<<<<<
15549  *         return tag
15550  *     else:
15551  */
15552   __pyx_t_2 = (__pyx_v_ns == Py_None);
15553   if (__pyx_t_2) {
15554
15555     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":677
15556  *     ns, tag = _getNsTag(value)
15557  *     if ns is None:
15558  *         return tag             # <<<<<<<<<<<<<<
15559  *     else:
15560  *         c_ns = element._doc._findOrBuildNodeNs(
15561  */
15562     __Pyx_XDECREF(__pyx_r);
15563     __Pyx_INCREF(__pyx_v_tag);
15564     __pyx_r = __pyx_v_tag;
15565     goto __pyx_L0;
15566     goto __pyx_L3;
15567   }
15568   /*else*/ {
15569
15570     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":680
15571  *     else:
15572  *         c_ns = element._doc._findOrBuildNodeNs(
15573  *             element._c_node, _cstr(ns), NULL)             # <<<<<<<<<<<<<<
15574  *         return python.PyString_FromFormat('%s:%s', c_ns.prefix, _cstr(tag))
15575  * 
15576  */
15577     __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_element->_doc->__pyx_vtab)->_findOrBuildNodeNs(__pyx_v_element->_doc, __pyx_v_element->_c_node, PyString_AS_STRING(__pyx_v_ns), NULL); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15578     __pyx_v_c_ns = __pyx_t_3;
15579
15580     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":681
15581  *         c_ns = element._doc._findOrBuildNodeNs(
15582  *             element._c_node, _cstr(ns), NULL)
15583  *         return python.PyString_FromFormat('%s:%s', c_ns.prefix, _cstr(tag))             # <<<<<<<<<<<<<<
15584  * 
15585  * cdef inline bint _hasChild(xmlNode* c_node):
15586  */
15587     __Pyx_XDECREF(__pyx_r);
15588     __pyx_t_1 = PyString_FromFormat(__pyx_k_247, __pyx_v_c_ns->prefix, PyString_AS_STRING(__pyx_v_tag)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15589     __Pyx_GOTREF(__pyx_t_1);
15590     __pyx_r = __pyx_t_1;
15591     __pyx_t_1 = 0;
15592     goto __pyx_L0;
15593   }
15594   __pyx_L3:;
15595
15596   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15597   goto __pyx_L0;
15598   __pyx_L1_error:;
15599   __Pyx_XDECREF(__pyx_1);
15600   __Pyx_XDECREF(__pyx_2);
15601   __Pyx_XDECREF(__pyx_3);
15602   __Pyx_XDECREF(__pyx_t_1);
15603   __Pyx_AddTraceback("lxml.etree._resolveQNameText");
15604   __pyx_r = 0;
15605   __pyx_L0:;
15606   __Pyx_DECREF(__pyx_v_ns);
15607   __Pyx_DECREF(__pyx_v_tag);
15608   __Pyx_XGIVEREF(__pyx_r);
15609   __Pyx_FinishRefcountContext();
15610   return __pyx_r;
15611 }
15612
15613 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":683
15614  *         return python.PyString_FromFormat('%s:%s', c_ns.prefix, _cstr(tag))
15615  * 
15616  * cdef inline bint _hasChild(xmlNode* c_node):             # <<<<<<<<<<<<<<
15617  *     return c_node is not NULL and _findChildForwards(c_node, 0) is not NULL
15618  * 
15619  */
15620
15621 static INLINE int __pyx_f_4lxml_5etree__hasChild(xmlNode *__pyx_v_c_node) {
15622   int __pyx_r;
15623   int __pyx_t_1;
15624   __Pyx_SetupRefcountContext("_hasChild");
15625
15626   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":684
15627  * 
15628  * cdef inline bint _hasChild(xmlNode* c_node):
15629  *     return c_node is not NULL and _findChildForwards(c_node, 0) is not NULL             # <<<<<<<<<<<<<<
15630  * 
15631  * cdef inline Py_ssize_t _countElements(xmlNode* c_node):
15632  */
15633   if ((__pyx_v_c_node != NULL)) {
15634     __pyx_t_1 = (__pyx_f_4lxml_5etree__findChildForwards(__pyx_v_c_node, 0) != NULL);
15635   } else {
15636     __pyx_t_1 = (__pyx_v_c_node != NULL);
15637   }
15638   __pyx_r = __pyx_t_1;
15639   goto __pyx_L0;
15640
15641   __pyx_r = 0;
15642   __pyx_L0:;
15643   __Pyx_FinishRefcountContext();
15644   return __pyx_r;
15645 }
15646
15647 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":686
15648  *     return c_node is not NULL and _findChildForwards(c_node, 0) is not NULL
15649  * 
15650  * cdef inline Py_ssize_t _countElements(xmlNode* c_node):             # <<<<<<<<<<<<<<
15651  *     u"Counts the elements within the following siblings and the node itself."
15652  *     cdef Py_ssize_t count
15653  */
15654
15655 static INLINE Py_ssize_t __pyx_f_4lxml_5etree__countElements(xmlNode *__pyx_v_c_node) {
15656   Py_ssize_t __pyx_v_count;
15657   Py_ssize_t __pyx_r;
15658   int __pyx_t_1;
15659   __Pyx_SetupRefcountContext("_countElements");
15660
15661   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":689
15662  *     u"Counts the elements within the following siblings and the node itself."
15663  *     cdef Py_ssize_t count
15664  *     count = 0             # <<<<<<<<<<<<<<
15665  *     while c_node is not NULL:
15666  *         if _isElement(c_node):
15667  */
15668   __pyx_v_count = 0;
15669
15670   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":690
15671  *     cdef Py_ssize_t count
15672  *     count = 0
15673  *     while c_node is not NULL:             # <<<<<<<<<<<<<<
15674  *         if _isElement(c_node):
15675  *             count = count + 1
15676  */
15677   while (1) {
15678     __pyx_t_1 = (__pyx_v_c_node != NULL);
15679     if (!__pyx_t_1) break;
15680
15681     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":691
15682  *     count = 0
15683  *     while c_node is not NULL:
15684  *         if _isElement(c_node):             # <<<<<<<<<<<<<<
15685  *             count = count + 1
15686  *         c_node = c_node.next
15687  */
15688     __pyx_t_1 = _isElement(__pyx_v_c_node);
15689     if (__pyx_t_1) {
15690
15691       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":692
15692  *     while c_node is not NULL:
15693  *         if _isElement(c_node):
15694  *             count = count + 1             # <<<<<<<<<<<<<<
15695  *         c_node = c_node.next
15696  *     return count
15697  */
15698       __pyx_v_count = (__pyx_v_count + 1);
15699       goto __pyx_L5;
15700     }
15701     __pyx_L5:;
15702
15703     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":693
15704  *         if _isElement(c_node):
15705  *             count = count + 1
15706  *         c_node = c_node.next             # <<<<<<<<<<<<<<
15707  *     return count
15708  * 
15709  */
15710     __pyx_v_c_node = __pyx_v_c_node->next;
15711   }
15712
15713   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":694
15714  *             count = count + 1
15715  *         c_node = c_node.next
15716  *     return count             # <<<<<<<<<<<<<<
15717  * 
15718  * cdef int _findChildSlice(
15719  */
15720   __pyx_r = __pyx_v_count;
15721   goto __pyx_L0;
15722
15723   __pyx_r = 0;
15724   __pyx_L0:;
15725   __Pyx_FinishRefcountContext();
15726   return __pyx_r;
15727 }
15728
15729 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":696
15730  *     return count
15731  * 
15732  * cdef int _findChildSlice(             # <<<<<<<<<<<<<<
15733  *     python.slice sliceobject, xmlNode* c_parent,
15734  *     xmlNode** c_start_node, Py_ssize_t* c_step, Py_ssize_t* c_length) except -1:
15735  */
15736
15737 static  int __pyx_f_4lxml_5etree__findChildSlice(PySliceObject *__pyx_v_sliceobject, xmlNode *__pyx_v_c_parent, xmlNode **__pyx_v_c_start_node, Py_ssize_t *__pyx_v_c_step, Py_ssize_t *__pyx_v_c_length) {
15738   Py_ssize_t __pyx_v_start;
15739   Py_ssize_t __pyx_v_stop;
15740   Py_ssize_t __pyx_v_childcount;
15741   int __pyx_r;
15742   int __pyx_t_1;
15743   int __pyx_t_2;
15744   __Pyx_SetupRefcountContext("_findChildSlice");
15745
15746   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":705
15747  *     """
15748  *     cdef Py_ssize_t start, stop, childcount
15749  *     childcount = _countElements(c_parent.children)             # <<<<<<<<<<<<<<
15750  *     if childcount == 0:
15751  *         c_start_node[0] = NULL
15752  */
15753   __pyx_v_childcount = __pyx_f_4lxml_5etree__countElements(__pyx_v_c_parent->children);
15754
15755   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":706
15756  *     cdef Py_ssize_t start, stop, childcount
15757  *     childcount = _countElements(c_parent.children)
15758  *     if childcount == 0:             # <<<<<<<<<<<<<<
15759  *         c_start_node[0] = NULL
15760  *         c_length[0] = 0
15761  */
15762   __pyx_t_1 = (__pyx_v_childcount == 0);
15763   if (__pyx_t_1) {
15764
15765     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":707
15766  *     childcount = _countElements(c_parent.children)
15767  *     if childcount == 0:
15768  *         c_start_node[0] = NULL             # <<<<<<<<<<<<<<
15769  *         c_length[0] = 0
15770  *         if sliceobject.step is None:
15771  */
15772     (__pyx_v_c_start_node[0]) = NULL;
15773
15774     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":708
15775  *     if childcount == 0:
15776  *         c_start_node[0] = NULL
15777  *         c_length[0] = 0             # <<<<<<<<<<<<<<
15778  *         if sliceobject.step is None:
15779  *             c_step[0] = 1
15780  */
15781     (__pyx_v_c_length[0]) = 0;
15782
15783     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":709
15784  *         c_start_node[0] = NULL
15785  *         c_length[0] = 0
15786  *         if sliceobject.step is None:             # <<<<<<<<<<<<<<
15787  *             c_step[0] = 1
15788  *         else:
15789  */
15790     __pyx_t_1 = (__pyx_v_sliceobject->step == Py_None);
15791     if (__pyx_t_1) {
15792
15793       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":710
15794  *         c_length[0] = 0
15795  *         if sliceobject.step is None:
15796  *             c_step[0] = 1             # <<<<<<<<<<<<<<
15797  *         else:
15798  *             python._PyEval_SliceIndex(sliceobject.step, c_step)
15799  */
15800       (__pyx_v_c_step[0]) = 1;
15801       goto __pyx_L4;
15802     }
15803     /*else*/ {
15804
15805       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":712
15806  *             c_step[0] = 1
15807  *         else:
15808  *             python._PyEval_SliceIndex(sliceobject.step, c_step)             # <<<<<<<<<<<<<<
15809  *         return 0
15810  *     python.PySlice_GetIndicesEx(
15811  */
15812       __pyx_t_2 = _PyEval_SliceIndex(__pyx_v_sliceobject->step, __pyx_v_c_step); if (unlikely(__pyx_t_2 == 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15813     }
15814     __pyx_L4:;
15815
15816     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":713
15817  *         else:
15818  *             python._PyEval_SliceIndex(sliceobject.step, c_step)
15819  *         return 0             # <<<<<<<<<<<<<<
15820  *     python.PySlice_GetIndicesEx(
15821  *         sliceobject, childcount, &start, &stop, c_step, c_length)
15822  */
15823     __pyx_r = 0;
15824     goto __pyx_L0;
15825     goto __pyx_L3;
15826   }
15827   __pyx_L3:;
15828
15829   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":715
15830  *         return 0
15831  *     python.PySlice_GetIndicesEx(
15832  *         sliceobject, childcount, &start, &stop, c_step, c_length)             # <<<<<<<<<<<<<<
15833  *     if start > childcount / 2:
15834  *         c_start_node[0] = _findChildBackwards(c_parent, childcount - start - 1)
15835  */
15836   __pyx_t_2 = PySlice_GetIndicesEx(__pyx_v_sliceobject, __pyx_v_childcount, (&__pyx_v_start), (&__pyx_v_stop), __pyx_v_c_step, __pyx_v_c_length); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15837
15838   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":716
15839  *     python.PySlice_GetIndicesEx(
15840  *         sliceobject, childcount, &start, &stop, c_step, c_length)
15841  *     if start > childcount / 2:             # <<<<<<<<<<<<<<
15842  *         c_start_node[0] = _findChildBackwards(c_parent, childcount - start - 1)
15843  *     else:
15844  */
15845   __pyx_t_1 = (__pyx_v_start > (__pyx_v_childcount / 2));
15846   if (__pyx_t_1) {
15847
15848     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":717
15849  *         sliceobject, childcount, &start, &stop, c_step, c_length)
15850  *     if start > childcount / 2:
15851  *         c_start_node[0] = _findChildBackwards(c_parent, childcount - start - 1)             # <<<<<<<<<<<<<<
15852  *     else:
15853  *         c_start_node[0] = _findChild(c_parent, start)
15854  */
15855     (__pyx_v_c_start_node[0]) = __pyx_f_4lxml_5etree__findChildBackwards(__pyx_v_c_parent, ((__pyx_v_childcount - __pyx_v_start) - 1));
15856     goto __pyx_L5;
15857   }
15858   /*else*/ {
15859
15860     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":719
15861  *         c_start_node[0] = _findChildBackwards(c_parent, childcount - start - 1)
15862  *     else:
15863  *         c_start_node[0] = _findChild(c_parent, start)             # <<<<<<<<<<<<<<
15864  *     return 0
15865  * 
15866  */
15867     (__pyx_v_c_start_node[0]) = __pyx_f_4lxml_5etree__findChild(__pyx_v_c_parent, __pyx_v_start);
15868   }
15869   __pyx_L5:;
15870
15871   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":720
15872  *     else:
15873  *         c_start_node[0] = _findChild(c_parent, start)
15874  *     return 0             # <<<<<<<<<<<<<<
15875  * 
15876  * cdef bint _isFullSlice(python.slice sliceobject):
15877  */
15878   __pyx_r = 0;
15879   goto __pyx_L0;
15880
15881   __pyx_r = 0;
15882   goto __pyx_L0;
15883   __pyx_L1_error:;
15884   __Pyx_AddTraceback("lxml.etree._findChildSlice");
15885   __pyx_r = -1;
15886   __pyx_L0:;
15887   __Pyx_FinishRefcountContext();
15888   return __pyx_r;
15889 }
15890
15891 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":722
15892  *     return 0
15893  * 
15894  * cdef bint _isFullSlice(python.slice sliceobject):             # <<<<<<<<<<<<<<
15895  *     u"""Conservative guess if this slice is a full slice as in ``s[:]``.
15896  *     """
15897  */
15898
15899 static  int __pyx_f_4lxml_5etree__isFullSlice(PySliceObject *__pyx_v_sliceobject) {
15900   Py_ssize_t __pyx_v_step;
15901   int __pyx_r;
15902   int __pyx_t_1;
15903   int __pyx_t_2;
15904   int __pyx_t_3;
15905   int __pyx_t_4;
15906   __Pyx_SetupRefcountContext("_isFullSlice");
15907
15908   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":726
15909  *     """
15910  *     cdef Py_ssize_t step
15911  *     if sliceobject is None:             # <<<<<<<<<<<<<<
15912  *         return 0
15913  *     if sliceobject.start is None and \
15914  */
15915   __pyx_t_1 = (((PyObject *)__pyx_v_sliceobject) == Py_None);
15916   if (__pyx_t_1) {
15917
15918     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":727
15919  *     cdef Py_ssize_t step
15920  *     if sliceobject is None:
15921  *         return 0             # <<<<<<<<<<<<<<
15922  *     if sliceobject.start is None and \
15923  *             sliceobject.stop is None:
15924  */
15925     __pyx_r = 0;
15926     goto __pyx_L0;
15927     goto __pyx_L3;
15928   }
15929   __pyx_L3:;
15930
15931   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":728
15932  *     if sliceobject is None:
15933  *         return 0
15934  *     if sliceobject.start is None and \             # <<<<<<<<<<<<<<
15935  *             sliceobject.stop is None:
15936  *         if sliceobject.step is None:
15937  */
15938   __pyx_t_1 = (__pyx_v_sliceobject->start == Py_None);
15939   if (__pyx_t_1) {
15940
15941     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":729
15942  *         return 0
15943  *     if sliceobject.start is None and \
15944  *             sliceobject.stop is None:             # <<<<<<<<<<<<<<
15945  *         if sliceobject.step is None:
15946  *             return 1
15947  */
15948     __pyx_t_2 = (__pyx_v_sliceobject->stop == Py_None);
15949     __pyx_t_3 = __pyx_t_2;
15950   } else {
15951     __pyx_t_3 = __pyx_t_1;
15952   }
15953   if (__pyx_t_3) {
15954
15955     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":730
15956  *     if sliceobject.start is None and \
15957  *             sliceobject.stop is None:
15958  *         if sliceobject.step is None:             # <<<<<<<<<<<<<<
15959  *             return 1
15960  *         python._PyEval_SliceIndex(sliceobject.step, &step)
15961  */
15962     __pyx_t_3 = (__pyx_v_sliceobject->step == Py_None);
15963     if (__pyx_t_3) {
15964
15965       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":731
15966  *             sliceobject.stop is None:
15967  *         if sliceobject.step is None:
15968  *             return 1             # <<<<<<<<<<<<<<
15969  *         python._PyEval_SliceIndex(sliceobject.step, &step)
15970  *         if step == 1:
15971  */
15972       __pyx_r = 1;
15973       goto __pyx_L0;
15974       goto __pyx_L5;
15975     }
15976     __pyx_L5:;
15977
15978     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":732
15979  *         if sliceobject.step is None:
15980  *             return 1
15981  *         python._PyEval_SliceIndex(sliceobject.step, &step)             # <<<<<<<<<<<<<<
15982  *         if step == 1:
15983  *             return 1
15984  */
15985     __pyx_t_4 = _PyEval_SliceIndex(__pyx_v_sliceobject->step, (&__pyx_v_step)); if (unlikely(__pyx_t_4 == 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15986
15987     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":733
15988  *             return 1
15989  *         python._PyEval_SliceIndex(sliceobject.step, &step)
15990  *         if step == 1:             # <<<<<<<<<<<<<<
15991  *             return 1
15992  *         return 0
15993  */
15994     __pyx_t_3 = (__pyx_v_step == 1);
15995     if (__pyx_t_3) {
15996
15997       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":734
15998  *         python._PyEval_SliceIndex(sliceobject.step, &step)
15999  *         if step == 1:
16000  *             return 1             # <<<<<<<<<<<<<<
16001  *         return 0
16002  *     return 0
16003  */
16004       __pyx_r = 1;
16005       goto __pyx_L0;
16006       goto __pyx_L6;
16007     }
16008     __pyx_L6:;
16009
16010     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":735
16011  *         if step == 1:
16012  *             return 1
16013  *         return 0             # <<<<<<<<<<<<<<
16014  *     return 0
16015  * 
16016  */
16017     __pyx_r = 0;
16018     goto __pyx_L0;
16019     goto __pyx_L4;
16020   }
16021   __pyx_L4:;
16022
16023   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":736
16024  *             return 1
16025  *         return 0
16026  *     return 0             # <<<<<<<<<<<<<<
16027  * 
16028  * cdef _collectChildren(_Element element):
16029  */
16030   __pyx_r = 0;
16031   goto __pyx_L0;
16032
16033   __pyx_r = 0;
16034   goto __pyx_L0;
16035   __pyx_L1_error:;
16036   __Pyx_WriteUnraisable("lxml.etree._isFullSlice");
16037   __pyx_r = 0;
16038   __pyx_L0:;
16039   __Pyx_FinishRefcountContext();
16040   return __pyx_r;
16041 }
16042
16043 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":738
16044  *     return 0
16045  * 
16046  * cdef _collectChildren(_Element element):             # <<<<<<<<<<<<<<
16047  *     cdef xmlNode* c_node
16048  *     cdef list result = []
16049  */
16050
16051 static  PyObject *__pyx_f_4lxml_5etree__collectChildren(struct LxmlElement *__pyx_v_element) {
16052   xmlNode *__pyx_v_c_node;
16053   PyObject *__pyx_v_result = 0;
16054   PyObject *__pyx_r = NULL;
16055   PyObject *__pyx_t_1 = NULL;
16056   int __pyx_t_2;
16057   int __pyx_t_3;
16058   __Pyx_SetupRefcountContext("_collectChildren");
16059
16060   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":740
16061  * cdef _collectChildren(_Element element):
16062  *     cdef xmlNode* c_node
16063  *     cdef list result = []             # <<<<<<<<<<<<<<
16064  *     c_node = element._c_node.children
16065  *     if c_node is not NULL:
16066  */
16067   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16068   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
16069   __pyx_v_result = __pyx_t_1;
16070   __pyx_t_1 = 0;
16071
16072   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":741
16073  *     cdef xmlNode* c_node
16074  *     cdef list result = []
16075  *     c_node = element._c_node.children             # <<<<<<<<<<<<<<
16076  *     if c_node is not NULL:
16077  *         if not _isElement(c_node):
16078  */
16079   __pyx_v_c_node = __pyx_v_element->_c_node->children;
16080
16081   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":742
16082  *     cdef list result = []
16083  *     c_node = element._c_node.children
16084  *     if c_node is not NULL:             # <<<<<<<<<<<<<<
16085  *         if not _isElement(c_node):
16086  *             c_node = _nextElement(c_node)
16087  */
16088   __pyx_t_2 = (__pyx_v_c_node != NULL);
16089   if (__pyx_t_2) {
16090
16091     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":743
16092  *     c_node = element._c_node.children
16093  *     if c_node is not NULL:
16094  *         if not _isElement(c_node):             # <<<<<<<<<<<<<<
16095  *             c_node = _nextElement(c_node)
16096  *         while c_node is not NULL:
16097  */
16098     __pyx_t_2 = (!_isElement(__pyx_v_c_node));
16099     if (__pyx_t_2) {
16100
16101       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":744
16102  *     if c_node is not NULL:
16103  *         if not _isElement(c_node):
16104  *             c_node = _nextElement(c_node)             # <<<<<<<<<<<<<<
16105  *         while c_node is not NULL:
16106  *             result.append(_elementFactory(element._doc, c_node))
16107  */
16108       __pyx_v_c_node = __pyx_f_4lxml_5etree__nextElement(__pyx_v_c_node);
16109       goto __pyx_L4;
16110     }
16111     __pyx_L4:;
16112
16113     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":745
16114  *         if not _isElement(c_node):
16115  *             c_node = _nextElement(c_node)
16116  *         while c_node is not NULL:             # <<<<<<<<<<<<<<
16117  *             result.append(_elementFactory(element._doc, c_node))
16118  *             c_node = _nextElement(c_node)
16119  */
16120     while (1) {
16121       __pyx_t_2 = (__pyx_v_c_node != NULL);
16122       if (!__pyx_t_2) break;
16123
16124       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":746
16125  *             c_node = _nextElement(c_node)
16126  *         while c_node is not NULL:
16127  *             result.append(_elementFactory(element._doc, c_node))             # <<<<<<<<<<<<<<
16128  *             c_node = _nextElement(c_node)
16129  *     return result
16130  */
16131       __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_element->_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16132       __Pyx_GOTREF(__pyx_t_1);
16133       __pyx_t_3 = PyList_Append(((PyObject *)__pyx_v_result), __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16134       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16135
16136       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":747
16137  *         while c_node is not NULL:
16138  *             result.append(_elementFactory(element._doc, c_node))
16139  *             c_node = _nextElement(c_node)             # <<<<<<<<<<<<<<
16140  *     return result
16141  * 
16142  */
16143       __pyx_v_c_node = __pyx_f_4lxml_5etree__nextElement(__pyx_v_c_node);
16144     }
16145     goto __pyx_L3;
16146   }
16147   __pyx_L3:;
16148
16149   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":748
16150  *             result.append(_elementFactory(element._doc, c_node))
16151  *             c_node = _nextElement(c_node)
16152  *     return result             # <<<<<<<<<<<<<<
16153  * 
16154  * cdef inline xmlNode* _findChild(xmlNode* c_node, Py_ssize_t index):
16155  */
16156   __Pyx_XDECREF(__pyx_r);
16157   __Pyx_INCREF(((PyObject *)__pyx_v_result));
16158   __pyx_r = ((PyObject *)__pyx_v_result);
16159   goto __pyx_L0;
16160
16161   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16162   goto __pyx_L0;
16163   __pyx_L1_error:;
16164   __Pyx_XDECREF(__pyx_t_1);
16165   __Pyx_AddTraceback("lxml.etree._collectChildren");
16166   __pyx_r = 0;
16167   __pyx_L0:;
16168   __Pyx_XDECREF(__pyx_v_result);
16169   __Pyx_XGIVEREF(__pyx_r);
16170   __Pyx_FinishRefcountContext();
16171   return __pyx_r;
16172 }
16173
16174 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":750
16175  *     return result
16176  * 
16177  * cdef inline xmlNode* _findChild(xmlNode* c_node, Py_ssize_t index):             # <<<<<<<<<<<<<<
16178  *     if index < 0:
16179  *         return _findChildBackwards(c_node, -index - 1)
16180  */
16181
16182 static INLINE xmlNode *__pyx_f_4lxml_5etree__findChild(xmlNode *__pyx_v_c_node, Py_ssize_t __pyx_v_index) {
16183   xmlNode *__pyx_r;
16184   int __pyx_t_1;
16185   __Pyx_SetupRefcountContext("_findChild");
16186
16187   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":751
16188  * 
16189  * cdef inline xmlNode* _findChild(xmlNode* c_node, Py_ssize_t index):
16190  *     if index < 0:             # <<<<<<<<<<<<<<
16191  *         return _findChildBackwards(c_node, -index - 1)
16192  *     else:
16193  */
16194   __pyx_t_1 = (__pyx_v_index < 0);
16195   if (__pyx_t_1) {
16196
16197     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":752
16198  * cdef inline xmlNode* _findChild(xmlNode* c_node, Py_ssize_t index):
16199  *     if index < 0:
16200  *         return _findChildBackwards(c_node, -index - 1)             # <<<<<<<<<<<<<<
16201  *     else:
16202  *         return _findChildForwards(c_node, index)
16203  */
16204     __pyx_r = __pyx_f_4lxml_5etree__findChildBackwards(__pyx_v_c_node, ((-__pyx_v_index) - 1));
16205     goto __pyx_L0;
16206     goto __pyx_L3;
16207   }
16208   /*else*/ {
16209
16210     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":754
16211  *         return _findChildBackwards(c_node, -index - 1)
16212  *     else:
16213  *         return _findChildForwards(c_node, index)             # <<<<<<<<<<<<<<
16214  * 
16215  * cdef inline xmlNode* _findChildForwards(xmlNode* c_node, Py_ssize_t index):
16216  */
16217     __pyx_r = __pyx_f_4lxml_5etree__findChildForwards(__pyx_v_c_node, __pyx_v_index);
16218     goto __pyx_L0;
16219   }
16220   __pyx_L3:;
16221
16222   __pyx_r = 0;
16223   __pyx_L0:;
16224   __Pyx_FinishRefcountContext();
16225   return __pyx_r;
16226 }
16227
16228 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":756
16229  *         return _findChildForwards(c_node, index)
16230  * 
16231  * cdef inline xmlNode* _findChildForwards(xmlNode* c_node, Py_ssize_t index):             # <<<<<<<<<<<<<<
16232  *     u"""Return child element of c_node with index, or return NULL if not found.
16233  *     """
16234  */
16235
16236 static INLINE xmlNode *__pyx_f_4lxml_5etree__findChildForwards(xmlNode *__pyx_v_c_node, Py_ssize_t __pyx_v_index) {
16237   xmlNode *__pyx_v_c_child;
16238   Py_ssize_t __pyx_v_c;
16239   xmlNode *__pyx_r;
16240   int __pyx_t_1;
16241   __Pyx_SetupRefcountContext("_findChildForwards");
16242
16243   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":761
16244  *     cdef xmlNode* c_child
16245  *     cdef Py_ssize_t c
16246  *     c_child = c_node.children             # <<<<<<<<<<<<<<
16247  *     c = 0
16248  *     while c_child is not NULL:
16249  */
16250   __pyx_v_c_child = __pyx_v_c_node->children;
16251
16252   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":762
16253  *     cdef Py_ssize_t c
16254  *     c_child = c_node.children
16255  *     c = 0             # <<<<<<<<<<<<<<
16256  *     while c_child is not NULL:
16257  *         if _isElement(c_child):
16258  */
16259   __pyx_v_c = 0;
16260
16261   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":763
16262  *     c_child = c_node.children
16263  *     c = 0
16264  *     while c_child is not NULL:             # <<<<<<<<<<<<<<
16265  *         if _isElement(c_child):
16266  *             if c == index:
16267  */
16268   while (1) {
16269     __pyx_t_1 = (__pyx_v_c_child != NULL);
16270     if (!__pyx_t_1) break;
16271
16272     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":764
16273  *     c = 0
16274  *     while c_child is not NULL:
16275  *         if _isElement(c_child):             # <<<<<<<<<<<<<<
16276  *             if c == index:
16277  *                 return c_child
16278  */
16279     __pyx_t_1 = _isElement(__pyx_v_c_child);
16280     if (__pyx_t_1) {
16281
16282       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":765
16283  *     while c_child is not NULL:
16284  *         if _isElement(c_child):
16285  *             if c == index:             # <<<<<<<<<<<<<<
16286  *                 return c_child
16287  *             c = c + 1
16288  */
16289       __pyx_t_1 = (__pyx_v_c == __pyx_v_index);
16290       if (__pyx_t_1) {
16291
16292         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":766
16293  *         if _isElement(c_child):
16294  *             if c == index:
16295  *                 return c_child             # <<<<<<<<<<<<<<
16296  *             c = c + 1
16297  *         c_child = c_child.next
16298  */
16299         __pyx_r = __pyx_v_c_child;
16300         goto __pyx_L0;
16301         goto __pyx_L6;
16302       }
16303       __pyx_L6:;
16304
16305       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":767
16306  *             if c == index:
16307  *                 return c_child
16308  *             c = c + 1             # <<<<<<<<<<<<<<
16309  *         c_child = c_child.next
16310  *     return NULL
16311  */
16312       __pyx_v_c = (__pyx_v_c + 1);
16313       goto __pyx_L5;
16314     }
16315     __pyx_L5:;
16316
16317     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":768
16318  *                 return c_child
16319  *             c = c + 1
16320  *         c_child = c_child.next             # <<<<<<<<<<<<<<
16321  *     return NULL
16322  * 
16323  */
16324     __pyx_v_c_child = __pyx_v_c_child->next;
16325   }
16326
16327   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":769
16328  *             c = c + 1
16329  *         c_child = c_child.next
16330  *     return NULL             # <<<<<<<<<<<<<<
16331  * 
16332  * cdef inline xmlNode* _findChildBackwards(xmlNode* c_node, Py_ssize_t index):
16333  */
16334   __pyx_r = NULL;
16335   goto __pyx_L0;
16336
16337   __pyx_r = 0;
16338   __pyx_L0:;
16339   __Pyx_FinishRefcountContext();
16340   return __pyx_r;
16341 }
16342
16343 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":771
16344  *     return NULL
16345  * 
16346  * cdef inline xmlNode* _findChildBackwards(xmlNode* c_node, Py_ssize_t index):             # <<<<<<<<<<<<<<
16347  *     u"""Return child element of c_node with index, or return NULL if not found.
16348  *     Search from the end.
16349  */
16350
16351 static INLINE xmlNode *__pyx_f_4lxml_5etree__findChildBackwards(xmlNode *__pyx_v_c_node, Py_ssize_t __pyx_v_index) {
16352   xmlNode *__pyx_v_c_child;
16353   Py_ssize_t __pyx_v_c;
16354   xmlNode *__pyx_r;
16355   int __pyx_t_1;
16356   __Pyx_SetupRefcountContext("_findChildBackwards");
16357
16358   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":777
16359  *     cdef xmlNode* c_child
16360  *     cdef Py_ssize_t c
16361  *     c_child = c_node.last             # <<<<<<<<<<<<<<
16362  *     c = 0
16363  *     while c_child is not NULL:
16364  */
16365   __pyx_v_c_child = __pyx_v_c_node->last;
16366
16367   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":778
16368  *     cdef Py_ssize_t c
16369  *     c_child = c_node.last
16370  *     c = 0             # <<<<<<<<<<<<<<
16371  *     while c_child is not NULL:
16372  *         if _isElement(c_child):
16373  */
16374   __pyx_v_c = 0;
16375
16376   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":779
16377  *     c_child = c_node.last
16378  *     c = 0
16379  *     while c_child is not NULL:             # <<<<<<<<<<<<<<
16380  *         if _isElement(c_child):
16381  *             if c == index:
16382  */
16383   while (1) {
16384     __pyx_t_1 = (__pyx_v_c_child != NULL);
16385     if (!__pyx_t_1) break;
16386
16387     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":780
16388  *     c = 0
16389  *     while c_child is not NULL:
16390  *         if _isElement(c_child):             # <<<<<<<<<<<<<<
16391  *             if c == index:
16392  *                 return c_child
16393  */
16394     __pyx_t_1 = _isElement(__pyx_v_c_child);
16395     if (__pyx_t_1) {
16396
16397       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":781
16398  *     while c_child is not NULL:
16399  *         if _isElement(c_child):
16400  *             if c == index:             # <<<<<<<<<<<<<<
16401  *                 return c_child
16402  *             c = c + 1
16403  */
16404       __pyx_t_1 = (__pyx_v_c == __pyx_v_index);
16405       if (__pyx_t_1) {
16406
16407         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":782
16408  *         if _isElement(c_child):
16409  *             if c == index:
16410  *                 return c_child             # <<<<<<<<<<<<<<
16411  *             c = c + 1
16412  *         c_child = c_child.prev
16413  */
16414         __pyx_r = __pyx_v_c_child;
16415         goto __pyx_L0;
16416         goto __pyx_L6;
16417       }
16418       __pyx_L6:;
16419
16420       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":783
16421  *             if c == index:
16422  *                 return c_child
16423  *             c = c + 1             # <<<<<<<<<<<<<<
16424  *         c_child = c_child.prev
16425  *     return NULL
16426  */
16427       __pyx_v_c = (__pyx_v_c + 1);
16428       goto __pyx_L5;
16429     }
16430     __pyx_L5:;
16431
16432     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":784
16433  *                 return c_child
16434  *             c = c + 1
16435  *         c_child = c_child.prev             # <<<<<<<<<<<<<<
16436  *     return NULL
16437  * 
16438  */
16439     __pyx_v_c_child = __pyx_v_c_child->prev;
16440   }
16441
16442   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":785
16443  *             c = c + 1
16444  *         c_child = c_child.prev
16445  *     return NULL             # <<<<<<<<<<<<<<
16446  * 
16447  * cdef inline xmlNode* _textNodeOrSkip(xmlNode* c_node) nogil:
16448  */
16449   __pyx_r = NULL;
16450   goto __pyx_L0;
16451
16452   __pyx_r = 0;
16453   __pyx_L0:;
16454   __Pyx_FinishRefcountContext();
16455   return __pyx_r;
16456 }
16457
16458 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":787
16459  *     return NULL
16460  * 
16461  * cdef inline xmlNode* _textNodeOrSkip(xmlNode* c_node) nogil:             # <<<<<<<<<<<<<<
16462  *     u"""Return the node if it's a text node.  Skip over ignorable nodes in a
16463  *     series of text nodes.  Return NULL if a non-ignorable node is found.
16464  */
16465
16466 static INLINE xmlNode *__pyx_f_4lxml_5etree__textNodeOrSkip(xmlNode *__pyx_v_c_node) {
16467   xmlNode *__pyx_r;
16468   int __pyx_t_1;
16469
16470   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":794
16471  *     nodes.
16472  *     """
16473  *     while c_node is not NULL:             # <<<<<<<<<<<<<<
16474  *         if c_node.type == tree.XML_TEXT_NODE:
16475  *             return c_node
16476  */
16477   while (1) {
16478     __pyx_t_1 = (__pyx_v_c_node != NULL);
16479     if (!__pyx_t_1) break;
16480
16481     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":795
16482  *     """
16483  *     while c_node is not NULL:
16484  *         if c_node.type == tree.XML_TEXT_NODE:             # <<<<<<<<<<<<<<
16485  *             return c_node
16486  *         if c_node.type == tree.XML_CDATA_SECTION_NODE:
16487  */
16488     __pyx_t_1 = (__pyx_v_c_node->type == XML_TEXT_NODE);
16489     if (__pyx_t_1) {
16490
16491       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":796
16492  *     while c_node is not NULL:
16493  *         if c_node.type == tree.XML_TEXT_NODE:
16494  *             return c_node             # <<<<<<<<<<<<<<
16495  *         if c_node.type == tree.XML_CDATA_SECTION_NODE:
16496  *             return c_node
16497  */
16498       __pyx_r = __pyx_v_c_node;
16499       goto __pyx_L0;
16500       goto __pyx_L5;
16501     }
16502     __pyx_L5:;
16503
16504     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":797
16505  *         if c_node.type == tree.XML_TEXT_NODE:
16506  *             return c_node
16507  *         if c_node.type == tree.XML_CDATA_SECTION_NODE:             # <<<<<<<<<<<<<<
16508  *             return c_node
16509  *         elif c_node.type == tree.XML_XINCLUDE_START or \
16510  */
16511     __pyx_t_1 = (__pyx_v_c_node->type == XML_CDATA_SECTION_NODE);
16512     if (__pyx_t_1) {
16513
16514       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":798
16515  *             return c_node
16516  *         if c_node.type == tree.XML_CDATA_SECTION_NODE:
16517  *             return c_node             # <<<<<<<<<<<<<<
16518  *         elif c_node.type == tree.XML_XINCLUDE_START or \
16519  *                  c_node.type == tree.XML_XINCLUDE_END:
16520  */
16521       __pyx_r = __pyx_v_c_node;
16522       goto __pyx_L0;
16523       goto __pyx_L6;
16524     }
16525
16526     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":799
16527  *         if c_node.type == tree.XML_CDATA_SECTION_NODE:
16528  *             return c_node
16529  *         elif c_node.type == tree.XML_XINCLUDE_START or \             # <<<<<<<<<<<<<<
16530  *                  c_node.type == tree.XML_XINCLUDE_END:
16531  *             c_node = c_node.next
16532  */
16533     if (!(__pyx_v_c_node->type == XML_XINCLUDE_START)) {
16534
16535       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":800
16536  *             return c_node
16537  *         elif c_node.type == tree.XML_XINCLUDE_START or \
16538  *                  c_node.type == tree.XML_XINCLUDE_END:             # <<<<<<<<<<<<<<
16539  *             c_node = c_node.next
16540  *         else:
16541  */
16542       __pyx_t_1 = (__pyx_v_c_node->type == XML_XINCLUDE_END);
16543     } else {
16544       __pyx_t_1 = (__pyx_v_c_node->type == XML_XINCLUDE_START);
16545     }
16546     if (__pyx_t_1) {
16547
16548       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":801
16549  *         elif c_node.type == tree.XML_XINCLUDE_START or \
16550  *                  c_node.type == tree.XML_XINCLUDE_END:
16551  *             c_node = c_node.next             # <<<<<<<<<<<<<<
16552  *         else:
16553  *             return NULL
16554  */
16555       __pyx_v_c_node = __pyx_v_c_node->next;
16556       goto __pyx_L6;
16557     }
16558     /*else*/ {
16559
16560       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":803
16561  *             c_node = c_node.next
16562  *         else:
16563  *             return NULL             # <<<<<<<<<<<<<<
16564  *     return NULL
16565  * 
16566  */
16567       __pyx_r = NULL;
16568       goto __pyx_L0;
16569     }
16570     __pyx_L6:;
16571   }
16572
16573   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":804
16574  *         else:
16575  *             return NULL
16576  *     return NULL             # <<<<<<<<<<<<<<
16577  * 
16578  * cdef inline xmlNode* _nextElement(xmlNode* c_node):
16579  */
16580   __pyx_r = NULL;
16581   goto __pyx_L0;
16582
16583   __pyx_r = 0;
16584   __pyx_L0:;
16585   return __pyx_r;
16586 }
16587
16588 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":806
16589  *     return NULL
16590  * 
16591  * cdef inline xmlNode* _nextElement(xmlNode* c_node):             # <<<<<<<<<<<<<<
16592  *     u"""Given a node, find the next sibling that is an element.
16593  *     """
16594  */
16595
16596 static INLINE xmlNode *__pyx_f_4lxml_5etree__nextElement(xmlNode *__pyx_v_c_node) {
16597   xmlNode *__pyx_r;
16598   int __pyx_t_1;
16599   __Pyx_SetupRefcountContext("_nextElement");
16600
16601   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":809
16602  *     u"""Given a node, find the next sibling that is an element.
16603  *     """
16604  *     if c_node is NULL:             # <<<<<<<<<<<<<<
16605  *         return NULL
16606  *     c_node = c_node.next
16607  */
16608   __pyx_t_1 = (__pyx_v_c_node == NULL);
16609   if (__pyx_t_1) {
16610
16611     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":810
16612  *     """
16613  *     if c_node is NULL:
16614  *         return NULL             # <<<<<<<<<<<<<<
16615  *     c_node = c_node.next
16616  *     while c_node is not NULL:
16617  */
16618     __pyx_r = NULL;
16619     goto __pyx_L0;
16620     goto __pyx_L3;
16621   }
16622   __pyx_L3:;
16623
16624   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":811
16625  *     if c_node is NULL:
16626  *         return NULL
16627  *     c_node = c_node.next             # <<<<<<<<<<<<<<
16628  *     while c_node is not NULL:
16629  *         if _isElement(c_node):
16630  */
16631   __pyx_v_c_node = __pyx_v_c_node->next;
16632
16633   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":812
16634  *         return NULL
16635  *     c_node = c_node.next
16636  *     while c_node is not NULL:             # <<<<<<<<<<<<<<
16637  *         if _isElement(c_node):
16638  *             return c_node
16639  */
16640   while (1) {
16641     __pyx_t_1 = (__pyx_v_c_node != NULL);
16642     if (!__pyx_t_1) break;
16643
16644     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":813
16645  *     c_node = c_node.next
16646  *     while c_node is not NULL:
16647  *         if _isElement(c_node):             # <<<<<<<<<<<<<<
16648  *             return c_node
16649  *         c_node = c_node.next
16650  */
16651     __pyx_t_1 = _isElement(__pyx_v_c_node);
16652     if (__pyx_t_1) {
16653
16654       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":814
16655  *     while c_node is not NULL:
16656  *         if _isElement(c_node):
16657  *             return c_node             # <<<<<<<<<<<<<<
16658  *         c_node = c_node.next
16659  *     return NULL
16660  */
16661       __pyx_r = __pyx_v_c_node;
16662       goto __pyx_L0;
16663       goto __pyx_L6;
16664     }
16665     __pyx_L6:;
16666
16667     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":815
16668  *         if _isElement(c_node):
16669  *             return c_node
16670  *         c_node = c_node.next             # <<<<<<<<<<<<<<
16671  *     return NULL
16672  * 
16673  */
16674     __pyx_v_c_node = __pyx_v_c_node->next;
16675   }
16676
16677   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":816
16678  *             return c_node
16679  *         c_node = c_node.next
16680  *     return NULL             # <<<<<<<<<<<<<<
16681  * 
16682  * cdef inline xmlNode* _previousElement(xmlNode* c_node):
16683  */
16684   __pyx_r = NULL;
16685   goto __pyx_L0;
16686
16687   __pyx_r = 0;
16688   __pyx_L0:;
16689   __Pyx_FinishRefcountContext();
16690   return __pyx_r;
16691 }
16692
16693 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":818
16694  *     return NULL
16695  * 
16696  * cdef inline xmlNode* _previousElement(xmlNode* c_node):             # <<<<<<<<<<<<<<
16697  *     u"""Given a node, find the next sibling that is an element.
16698  *     """
16699  */
16700
16701 static INLINE xmlNode *__pyx_f_4lxml_5etree__previousElement(xmlNode *__pyx_v_c_node) {
16702   xmlNode *__pyx_r;
16703   int __pyx_t_1;
16704   __Pyx_SetupRefcountContext("_previousElement");
16705
16706   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":821
16707  *     u"""Given a node, find the next sibling that is an element.
16708  *     """
16709  *     if c_node is NULL:             # <<<<<<<<<<<<<<
16710  *         return NULL
16711  *     c_node = c_node.prev
16712  */
16713   __pyx_t_1 = (__pyx_v_c_node == NULL);
16714   if (__pyx_t_1) {
16715
16716     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":822
16717  *     """
16718  *     if c_node is NULL:
16719  *         return NULL             # <<<<<<<<<<<<<<
16720  *     c_node = c_node.prev
16721  *     while c_node is not NULL:
16722  */
16723     __pyx_r = NULL;
16724     goto __pyx_L0;
16725     goto __pyx_L3;
16726   }
16727   __pyx_L3:;
16728
16729   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":823
16730  *     if c_node is NULL:
16731  *         return NULL
16732  *     c_node = c_node.prev             # <<<<<<<<<<<<<<
16733  *     while c_node is not NULL:
16734  *         if _isElement(c_node):
16735  */
16736   __pyx_v_c_node = __pyx_v_c_node->prev;
16737
16738   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":824
16739  *         return NULL
16740  *     c_node = c_node.prev
16741  *     while c_node is not NULL:             # <<<<<<<<<<<<<<
16742  *         if _isElement(c_node):
16743  *             return c_node
16744  */
16745   while (1) {
16746     __pyx_t_1 = (__pyx_v_c_node != NULL);
16747     if (!__pyx_t_1) break;
16748
16749     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":825
16750  *     c_node = c_node.prev
16751  *     while c_node is not NULL:
16752  *         if _isElement(c_node):             # <<<<<<<<<<<<<<
16753  *             return c_node
16754  *         c_node = c_node.prev
16755  */
16756     __pyx_t_1 = _isElement(__pyx_v_c_node);
16757     if (__pyx_t_1) {
16758
16759       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":826
16760  *     while c_node is not NULL:
16761  *         if _isElement(c_node):
16762  *             return c_node             # <<<<<<<<<<<<<<
16763  *         c_node = c_node.prev
16764  *     return NULL
16765  */
16766       __pyx_r = __pyx_v_c_node;
16767       goto __pyx_L0;
16768       goto __pyx_L6;
16769     }
16770     __pyx_L6:;
16771
16772     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":827
16773  *         if _isElement(c_node):
16774  *             return c_node
16775  *         c_node = c_node.prev             # <<<<<<<<<<<<<<
16776  *     return NULL
16777  * 
16778  */
16779     __pyx_v_c_node = __pyx_v_c_node->prev;
16780   }
16781
16782   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":828
16783  *             return c_node
16784  *         c_node = c_node.prev
16785  *     return NULL             # <<<<<<<<<<<<<<
16786  * 
16787  * cdef inline xmlNode* _parentElement(xmlNode* c_node):
16788  */
16789   __pyx_r = NULL;
16790   goto __pyx_L0;
16791
16792   __pyx_r = 0;
16793   __pyx_L0:;
16794   __Pyx_FinishRefcountContext();
16795   return __pyx_r;
16796 }
16797
16798 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":830
16799  *     return NULL
16800  * 
16801  * cdef inline xmlNode* _parentElement(xmlNode* c_node):             # <<<<<<<<<<<<<<
16802  *     u"Given a node, find the parent element."
16803  *     if c_node is NULL or not _isElement(c_node):
16804  */
16805
16806 static INLINE xmlNode *__pyx_f_4lxml_5etree__parentElement(xmlNode *__pyx_v_c_node) {
16807   xmlNode *__pyx_r;
16808   int __pyx_t_1;
16809   __Pyx_SetupRefcountContext("_parentElement");
16810
16811   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":832
16812  * cdef inline xmlNode* _parentElement(xmlNode* c_node):
16813  *     u"Given a node, find the parent element."
16814  *     if c_node is NULL or not _isElement(c_node):             # <<<<<<<<<<<<<<
16815  *         return NULL
16816  *     c_node = c_node.parent
16817  */
16818   if (!(__pyx_v_c_node == NULL)) {
16819     __pyx_t_1 = (!_isElement(__pyx_v_c_node));
16820   } else {
16821     __pyx_t_1 = (__pyx_v_c_node == NULL);
16822   }
16823   if (__pyx_t_1) {
16824
16825     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":833
16826  *     u"Given a node, find the parent element."
16827  *     if c_node is NULL or not _isElement(c_node):
16828  *         return NULL             # <<<<<<<<<<<<<<
16829  *     c_node = c_node.parent
16830  *     if c_node is NULL or not _isElement(c_node):
16831  */
16832     __pyx_r = NULL;
16833     goto __pyx_L0;
16834     goto __pyx_L3;
16835   }
16836   __pyx_L3:;
16837
16838   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":834
16839  *     if c_node is NULL or not _isElement(c_node):
16840  *         return NULL
16841  *     c_node = c_node.parent             # <<<<<<<<<<<<<<
16842  *     if c_node is NULL or not _isElement(c_node):
16843  *         return NULL
16844  */
16845   __pyx_v_c_node = __pyx_v_c_node->parent;
16846
16847   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":835
16848  *         return NULL
16849  *     c_node = c_node.parent
16850  *     if c_node is NULL or not _isElement(c_node):             # <<<<<<<<<<<<<<
16851  *         return NULL
16852  *     return c_node
16853  */
16854   if (!(__pyx_v_c_node == NULL)) {
16855     __pyx_t_1 = (!_isElement(__pyx_v_c_node));
16856   } else {
16857     __pyx_t_1 = (__pyx_v_c_node == NULL);
16858   }
16859   if (__pyx_t_1) {
16860
16861     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":836
16862  *     c_node = c_node.parent
16863  *     if c_node is NULL or not _isElement(c_node):
16864  *         return NULL             # <<<<<<<<<<<<<<
16865  *     return c_node
16866  * 
16867  */
16868     __pyx_r = NULL;
16869     goto __pyx_L0;
16870     goto __pyx_L4;
16871   }
16872   __pyx_L4:;
16873
16874   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":837
16875  *     if c_node is NULL or not _isElement(c_node):
16876  *         return NULL
16877  *     return c_node             # <<<<<<<<<<<<<<
16878  * 
16879  * cdef inline bint _tagMatches(xmlNode* c_node, char* c_href, char* c_name):
16880  */
16881   __pyx_r = __pyx_v_c_node;
16882   goto __pyx_L0;
16883
16884   __pyx_r = 0;
16885   __pyx_L0:;
16886   __Pyx_FinishRefcountContext();
16887   return __pyx_r;
16888 }
16889
16890 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":839
16891  *     return c_node
16892  * 
16893  * cdef inline bint _tagMatches(xmlNode* c_node, char* c_href, char* c_name):             # <<<<<<<<<<<<<<
16894  *     u"""Tests if the node matches namespace URI and tag name.
16895  * 
16896  */
16897
16898 static INLINE int __pyx_f_4lxml_5etree__tagMatches(xmlNode *__pyx_v_c_node, char *__pyx_v_c_href, char *__pyx_v_c_name) {
16899   char *__pyx_v_c_node_href;
16900   int __pyx_r;
16901   int __pyx_t_1;
16902   __Pyx_SetupRefcountContext("_tagMatches");
16903
16904   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":854
16905  *     """
16906  *     cdef char* c_node_href
16907  *     if c_node is NULL:             # <<<<<<<<<<<<<<
16908  *         return 0
16909  *     if c_node.type != tree.XML_ELEMENT_NODE:
16910  */
16911   __pyx_t_1 = (__pyx_v_c_node == NULL);
16912   if (__pyx_t_1) {
16913
16914     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":855
16915  *     cdef char* c_node_href
16916  *     if c_node is NULL:
16917  *         return 0             # <<<<<<<<<<<<<<
16918  *     if c_node.type != tree.XML_ELEMENT_NODE:
16919  *         # not an element, only succeed if we match everything
16920  */
16921     __pyx_r = 0;
16922     goto __pyx_L0;
16923     goto __pyx_L3;
16924   }
16925   __pyx_L3:;
16926
16927   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":856
16928  *     if c_node is NULL:
16929  *         return 0
16930  *     if c_node.type != tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
16931  *         # not an element, only succeed if we match everything
16932  *         return c_name is NULL and c_href is NULL
16933  */
16934   __pyx_t_1 = (__pyx_v_c_node->type != XML_ELEMENT_NODE);
16935   if (__pyx_t_1) {
16936
16937     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":858
16938  *     if c_node.type != tree.XML_ELEMENT_NODE:
16939  *         # not an element, only succeed if we match everything
16940  *         return c_name is NULL and c_href is NULL             # <<<<<<<<<<<<<<
16941  *     if c_name is NULL:
16942  *         if c_href is NULL:
16943  */
16944     if ((__pyx_v_c_name == NULL)) {
16945       __pyx_t_1 = (__pyx_v_c_href == NULL);
16946     } else {
16947       __pyx_t_1 = (__pyx_v_c_name == NULL);
16948     }
16949     __pyx_r = __pyx_t_1;
16950     goto __pyx_L0;
16951     goto __pyx_L4;
16952   }
16953   __pyx_L4:;
16954
16955   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":859
16956  *         # not an element, only succeed if we match everything
16957  *         return c_name is NULL and c_href is NULL
16958  *     if c_name is NULL:             # <<<<<<<<<<<<<<
16959  *         if c_href is NULL:
16960  *             # always match
16961  */
16962   __pyx_t_1 = (__pyx_v_c_name == NULL);
16963   if (__pyx_t_1) {
16964
16965     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":860
16966  *         return c_name is NULL and c_href is NULL
16967  *     if c_name is NULL:
16968  *         if c_href is NULL:             # <<<<<<<<<<<<<<
16969  *             # always match
16970  *             return 1
16971  */
16972     __pyx_t_1 = (__pyx_v_c_href == NULL);
16973     if (__pyx_t_1) {
16974
16975       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":862
16976  *         if c_href is NULL:
16977  *             # always match
16978  *             return 1             # <<<<<<<<<<<<<<
16979  *         else:
16980  *             c_node_href = _getNs(c_node)
16981  */
16982       __pyx_r = 1;
16983       goto __pyx_L0;
16984       goto __pyx_L6;
16985     }
16986     /*else*/ {
16987
16988       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":864
16989  *             return 1
16990  *         else:
16991  *             c_node_href = _getNs(c_node)             # <<<<<<<<<<<<<<
16992  *             if c_node_href is NULL:
16993  *                 return c_href[0] == c'\0'
16994  */
16995       __pyx_v_c_node_href = _getNs(__pyx_v_c_node);
16996
16997       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":865
16998  *         else:
16999  *             c_node_href = _getNs(c_node)
17000  *             if c_node_href is NULL:             # <<<<<<<<<<<<<<
17001  *                 return c_href[0] == c'\0'
17002  *             else:
17003  */
17004       __pyx_t_1 = (__pyx_v_c_node_href == NULL);
17005       if (__pyx_t_1) {
17006
17007         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":866
17008  *             c_node_href = _getNs(c_node)
17009  *             if c_node_href is NULL:
17010  *                 return c_href[0] == c'\0'             # <<<<<<<<<<<<<<
17011  *             else:
17012  *                 return cstd.strcmp(c_node_href, c_href) == 0
17013  */
17014         __pyx_r = ((__pyx_v_c_href[0]) == '\x00');
17015         goto __pyx_L0;
17016         goto __pyx_L7;
17017       }
17018       /*else*/ {
17019
17020         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":868
17021  *                 return c_href[0] == c'\0'
17022  *             else:
17023  *                 return cstd.strcmp(c_node_href, c_href) == 0             # <<<<<<<<<<<<<<
17024  *     elif c_href is NULL:
17025  *         if _getNs(c_node) is not NULL:
17026  */
17027         __pyx_r = (strcmp(__pyx_v_c_node_href, __pyx_v_c_href) == 0);
17028         goto __pyx_L0;
17029       }
17030       __pyx_L7:;
17031     }
17032     __pyx_L6:;
17033     goto __pyx_L5;
17034   }
17035
17036   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":869
17037  *             else:
17038  *                 return cstd.strcmp(c_node_href, c_href) == 0
17039  *     elif c_href is NULL:             # <<<<<<<<<<<<<<
17040  *         if _getNs(c_node) is not NULL:
17041  *             return 0
17042  */
17043   __pyx_t_1 = (__pyx_v_c_href == NULL);
17044   if (__pyx_t_1) {
17045
17046     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":870
17047  *                 return cstd.strcmp(c_node_href, c_href) == 0
17048  *     elif c_href is NULL:
17049  *         if _getNs(c_node) is not NULL:             # <<<<<<<<<<<<<<
17050  *             return 0
17051  *         return c_node.name == c_name or cstd.strcmp(c_node.name, c_name) == 0
17052  */
17053     __pyx_t_1 = (_getNs(__pyx_v_c_node) != NULL);
17054     if (__pyx_t_1) {
17055
17056       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":871
17057  *     elif c_href is NULL:
17058  *         if _getNs(c_node) is not NULL:
17059  *             return 0             # <<<<<<<<<<<<<<
17060  *         return c_node.name == c_name or cstd.strcmp(c_node.name, c_name) == 0
17061  *     elif c_node.name == c_name or cstd.strcmp(c_node.name, c_name) == 0:
17062  */
17063       __pyx_r = 0;
17064       goto __pyx_L0;
17065       goto __pyx_L8;
17066     }
17067     __pyx_L8:;
17068
17069     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":872
17070  *         if _getNs(c_node) is not NULL:
17071  *             return 0
17072  *         return c_node.name == c_name or cstd.strcmp(c_node.name, c_name) == 0             # <<<<<<<<<<<<<<
17073  *     elif c_node.name == c_name or cstd.strcmp(c_node.name, c_name) == 0:
17074  *         c_node_href = _getNs(c_node)
17075  */
17076     if (!(__pyx_v_c_node->name == __pyx_v_c_name)) {
17077       __pyx_t_1 = (strcmp(__pyx_v_c_node->name, __pyx_v_c_name) == 0);
17078     } else {
17079       __pyx_t_1 = (__pyx_v_c_node->name == __pyx_v_c_name);
17080     }
17081     __pyx_r = __pyx_t_1;
17082     goto __pyx_L0;
17083     goto __pyx_L5;
17084   }
17085
17086   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":873
17087  *             return 0
17088  *         return c_node.name == c_name or cstd.strcmp(c_node.name, c_name) == 0
17089  *     elif c_node.name == c_name or cstd.strcmp(c_node.name, c_name) == 0:             # <<<<<<<<<<<<<<
17090  *         c_node_href = _getNs(c_node)
17091  *         if c_node_href is NULL:
17092  */
17093   if (!(__pyx_v_c_node->name == __pyx_v_c_name)) {
17094     __pyx_t_1 = (strcmp(__pyx_v_c_node->name, __pyx_v_c_name) == 0);
17095   } else {
17096     __pyx_t_1 = (__pyx_v_c_node->name == __pyx_v_c_name);
17097   }
17098   if (__pyx_t_1) {
17099
17100     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":874
17101  *         return c_node.name == c_name or cstd.strcmp(c_node.name, c_name) == 0
17102  *     elif c_node.name == c_name or cstd.strcmp(c_node.name, c_name) == 0:
17103  *         c_node_href = _getNs(c_node)             # <<<<<<<<<<<<<<
17104  *         if c_node_href is NULL:
17105  *             return c_href[0] == c'\0'
17106  */
17107     __pyx_v_c_node_href = _getNs(__pyx_v_c_node);
17108
17109     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":875
17110  *     elif c_node.name == c_name or cstd.strcmp(c_node.name, c_name) == 0:
17111  *         c_node_href = _getNs(c_node)
17112  *         if c_node_href is NULL:             # <<<<<<<<<<<<<<
17113  *             return c_href[0] == c'\0'
17114  *         else:
17115  */
17116     __pyx_t_1 = (__pyx_v_c_node_href == NULL);
17117     if (__pyx_t_1) {
17118
17119       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":876
17120  *         c_node_href = _getNs(c_node)
17121  *         if c_node_href is NULL:
17122  *             return c_href[0] == c'\0'             # <<<<<<<<<<<<<<
17123  *         else:
17124  *             return cstd.strcmp(c_node_href, c_href) == 0
17125  */
17126       __pyx_r = ((__pyx_v_c_href[0]) == '\x00');
17127       goto __pyx_L0;
17128       goto __pyx_L9;
17129     }
17130     /*else*/ {
17131
17132       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":878
17133  *             return c_href[0] == c'\0'
17134  *         else:
17135  *             return cstd.strcmp(c_node_href, c_href) == 0             # <<<<<<<<<<<<<<
17136  *     else:
17137  *         return 0
17138  */
17139       __pyx_r = (strcmp(__pyx_v_c_node_href, __pyx_v_c_href) == 0);
17140       goto __pyx_L0;
17141     }
17142     __pyx_L9:;
17143     goto __pyx_L5;
17144   }
17145   /*else*/ {
17146
17147     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":880
17148  *             return cstd.strcmp(c_node_href, c_href) == 0
17149  *     else:
17150  *         return 0             # <<<<<<<<<<<<<<
17151  * 
17152  * cdef int _removeNode(_Document doc, xmlNode* c_node) except -1:
17153  */
17154     __pyx_r = 0;
17155     goto __pyx_L0;
17156   }
17157   __pyx_L5:;
17158
17159   __pyx_r = 0;
17160   __pyx_L0:;
17161   __Pyx_FinishRefcountContext();
17162   return __pyx_r;
17163 }
17164
17165 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":882
17166  *         return 0
17167  * 
17168  * cdef int _removeNode(_Document doc, xmlNode* c_node) except -1:             # <<<<<<<<<<<<<<
17169  *     u"""Unlink and free a node and subnodes if possible.  Otherwise, make sure
17170  *     it's self-contained.
17171  */
17172
17173 static  int __pyx_f_4lxml_5etree__removeNode(struct LxmlDocument *__pyx_v_doc, xmlNode *__pyx_v_c_node) {
17174   xmlNode *__pyx_v_c_next;
17175   int __pyx_r;
17176   int __pyx_t_1;
17177   int __pyx_t_2;
17178   __Pyx_SetupRefcountContext("_removeNode");
17179
17180   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":887
17181  *     """
17182  *     cdef xmlNode* c_next
17183  *     c_next = c_node.next             # <<<<<<<<<<<<<<
17184  *     tree.xmlUnlinkNode(c_node)
17185  *     _moveTail(c_next, c_node)
17186  */
17187   __pyx_v_c_next = __pyx_v_c_node->next;
17188
17189   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":888
17190  *     cdef xmlNode* c_next
17191  *     c_next = c_node.next
17192  *     tree.xmlUnlinkNode(c_node)             # <<<<<<<<<<<<<<
17193  *     _moveTail(c_next, c_node)
17194  *     if not attemptDeallocation(c_node):
17195  */
17196   xmlUnlinkNode(__pyx_v_c_node);
17197
17198   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":889
17199  *     c_next = c_node.next
17200  *     tree.xmlUnlinkNode(c_node)
17201  *     _moveTail(c_next, c_node)             # <<<<<<<<<<<<<<
17202  *     if not attemptDeallocation(c_node):
17203  *         # make namespaces absolute
17204  */
17205   __pyx_f_4lxml_5etree__moveTail(__pyx_v_c_next, __pyx_v_c_node);
17206
17207   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":890
17208  *     tree.xmlUnlinkNode(c_node)
17209  *     _moveTail(c_next, c_node)
17210  *     if not attemptDeallocation(c_node):             # <<<<<<<<<<<<<<
17211  *         # make namespaces absolute
17212  *         moveNodeToDocument(doc, c_node.doc, c_node)
17213  */
17214   __pyx_t_1 = (!__pyx_f_4lxml_5etree_attemptDeallocation(__pyx_v_c_node));
17215   if (__pyx_t_1) {
17216
17217     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":892
17218  *     if not attemptDeallocation(c_node):
17219  *         # make namespaces absolute
17220  *         moveNodeToDocument(doc, c_node.doc, c_node)             # <<<<<<<<<<<<<<
17221  *     return 0
17222  * 
17223  */
17224     __pyx_t_2 = __pyx_f_4lxml_5etree_moveNodeToDocument(__pyx_v_doc, __pyx_v_c_node->doc, __pyx_v_c_node); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17225     goto __pyx_L3;
17226   }
17227   __pyx_L3:;
17228
17229   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":893
17230  *         # make namespaces absolute
17231  *         moveNodeToDocument(doc, c_node.doc, c_node)
17232  *     return 0             # <<<<<<<<<<<<<<
17233  * 
17234  * cdef void _moveTail(xmlNode* c_tail, xmlNode* c_target):
17235  */
17236   __pyx_r = 0;
17237   goto __pyx_L0;
17238
17239   __pyx_r = 0;
17240   goto __pyx_L0;
17241   __pyx_L1_error:;
17242   __Pyx_AddTraceback("lxml.etree._removeNode");
17243   __pyx_r = -1;
17244   __pyx_L0:;
17245   __Pyx_FinishRefcountContext();
17246   return __pyx_r;
17247 }
17248
17249 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":895
17250  *     return 0
17251  * 
17252  * cdef void _moveTail(xmlNode* c_tail, xmlNode* c_target):             # <<<<<<<<<<<<<<
17253  *     cdef xmlNode* c_next
17254  *     # tail support: look for any text nodes trailing this node and
17255  */
17256
17257 static  void __pyx_f_4lxml_5etree__moveTail(xmlNode *__pyx_v_c_tail, xmlNode *__pyx_v_c_target) {
17258   xmlNode *__pyx_v_c_next;
17259   int __pyx_t_1;
17260   __Pyx_SetupRefcountContext("_moveTail");
17261
17262   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":899
17263  *     # tail support: look for any text nodes trailing this node and
17264  *     # move them too
17265  *     c_tail = _textNodeOrSkip(c_tail)             # <<<<<<<<<<<<<<
17266  *     while c_tail is not NULL:
17267  *         c_next = _textNodeOrSkip(c_tail.next)
17268  */
17269   __pyx_v_c_tail = __pyx_f_4lxml_5etree__textNodeOrSkip(__pyx_v_c_tail);
17270
17271   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":900
17272  *     # move them too
17273  *     c_tail = _textNodeOrSkip(c_tail)
17274  *     while c_tail is not NULL:             # <<<<<<<<<<<<<<
17275  *         c_next = _textNodeOrSkip(c_tail.next)
17276  *         tree.xmlUnlinkNode(c_tail)
17277  */
17278   while (1) {
17279     __pyx_t_1 = (__pyx_v_c_tail != NULL);
17280     if (!__pyx_t_1) break;
17281
17282     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":901
17283  *     c_tail = _textNodeOrSkip(c_tail)
17284  *     while c_tail is not NULL:
17285  *         c_next = _textNodeOrSkip(c_tail.next)             # <<<<<<<<<<<<<<
17286  *         tree.xmlUnlinkNode(c_tail)
17287  *         tree.xmlAddNextSibling(c_target, c_tail)
17288  */
17289     __pyx_v_c_next = __pyx_f_4lxml_5etree__textNodeOrSkip(__pyx_v_c_tail->next);
17290
17291     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":902
17292  *     while c_tail is not NULL:
17293  *         c_next = _textNodeOrSkip(c_tail.next)
17294  *         tree.xmlUnlinkNode(c_tail)             # <<<<<<<<<<<<<<
17295  *         tree.xmlAddNextSibling(c_target, c_tail)
17296  *         c_target = c_tail
17297  */
17298     xmlUnlinkNode(__pyx_v_c_tail);
17299
17300     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":903
17301  *         c_next = _textNodeOrSkip(c_tail.next)
17302  *         tree.xmlUnlinkNode(c_tail)
17303  *         tree.xmlAddNextSibling(c_target, c_tail)             # <<<<<<<<<<<<<<
17304  *         c_target = c_tail
17305  *         c_tail = c_next
17306  */
17307     xmlAddNextSibling(__pyx_v_c_target, __pyx_v_c_tail);
17308
17309     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":904
17310  *         tree.xmlUnlinkNode(c_tail)
17311  *         tree.xmlAddNextSibling(c_target, c_tail)
17312  *         c_target = c_tail             # <<<<<<<<<<<<<<
17313  *         c_tail = c_next
17314  * 
17315  */
17316     __pyx_v_c_target = __pyx_v_c_tail;
17317
17318     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":905
17319  *         tree.xmlAddNextSibling(c_target, c_tail)
17320  *         c_target = c_tail
17321  *         c_tail = c_next             # <<<<<<<<<<<<<<
17322  * 
17323  * cdef int _copyTail(xmlNode* c_tail, xmlNode* c_target) except -1:
17324  */
17325     __pyx_v_c_tail = __pyx_v_c_next;
17326   }
17327
17328   __Pyx_FinishRefcountContext();
17329 }
17330
17331 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":907
17332  *         c_tail = c_next
17333  * 
17334  * cdef int _copyTail(xmlNode* c_tail, xmlNode* c_target) except -1:             # <<<<<<<<<<<<<<
17335  *     cdef xmlNode* c_new_tail
17336  *     # tail copying support: look for any text nodes trailing this node and
17337  */
17338
17339 static  int __pyx_f_4lxml_5etree__copyTail(xmlNode *__pyx_v_c_tail, xmlNode *__pyx_v_c_target) {
17340   xmlNode *__pyx_v_c_new_tail;
17341   int __pyx_r;
17342   int __pyx_t_1;
17343   PyObject *__pyx_t_2 = NULL;
17344   __Pyx_SetupRefcountContext("_copyTail");
17345
17346   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":911
17347  *     # tail copying support: look for any text nodes trailing this node and
17348  *     # copy it to the target node
17349  *     c_tail = _textNodeOrSkip(c_tail)             # <<<<<<<<<<<<<<
17350  *     while c_tail is not NULL:
17351  *         if c_target.doc is not c_tail.doc:
17352  */
17353   __pyx_v_c_tail = __pyx_f_4lxml_5etree__textNodeOrSkip(__pyx_v_c_tail);
17354
17355   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":912
17356  *     # copy it to the target node
17357  *     c_tail = _textNodeOrSkip(c_tail)
17358  *     while c_tail is not NULL:             # <<<<<<<<<<<<<<
17359  *         if c_target.doc is not c_tail.doc:
17360  *             c_new_tail = tree.xmlDocCopyNode(c_tail, c_target.doc, 0)
17361  */
17362   while (1) {
17363     __pyx_t_1 = (__pyx_v_c_tail != NULL);
17364     if (!__pyx_t_1) break;
17365
17366     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":913
17367  *     c_tail = _textNodeOrSkip(c_tail)
17368  *     while c_tail is not NULL:
17369  *         if c_target.doc is not c_tail.doc:             # <<<<<<<<<<<<<<
17370  *             c_new_tail = tree.xmlDocCopyNode(c_tail, c_target.doc, 0)
17371  *         else:
17372  */
17373     __pyx_t_1 = (__pyx_v_c_target->doc != __pyx_v_c_tail->doc);
17374     if (__pyx_t_1) {
17375
17376       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":914
17377  *     while c_tail is not NULL:
17378  *         if c_target.doc is not c_tail.doc:
17379  *             c_new_tail = tree.xmlDocCopyNode(c_tail, c_target.doc, 0)             # <<<<<<<<<<<<<<
17380  *         else:
17381  *             c_new_tail = tree.xmlCopyNode(c_tail, 0)
17382  */
17383       __pyx_v_c_new_tail = xmlDocCopyNode(__pyx_v_c_tail, __pyx_v_c_target->doc, 0);
17384       goto __pyx_L5;
17385     }
17386     /*else*/ {
17387
17388       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":916
17389  *             c_new_tail = tree.xmlDocCopyNode(c_tail, c_target.doc, 0)
17390  *         else:
17391  *             c_new_tail = tree.xmlCopyNode(c_tail, 0)             # <<<<<<<<<<<<<<
17392  *         if c_new_tail is NULL:
17393  *             python.PyErr_NoMemory()
17394  */
17395       __pyx_v_c_new_tail = xmlCopyNode(__pyx_v_c_tail, 0);
17396     }
17397     __pyx_L5:;
17398
17399     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":917
17400  *         else:
17401  *             c_new_tail = tree.xmlCopyNode(c_tail, 0)
17402  *         if c_new_tail is NULL:             # <<<<<<<<<<<<<<
17403  *             python.PyErr_NoMemory()
17404  *         tree.xmlAddNextSibling(c_target, c_new_tail)
17405  */
17406     __pyx_t_1 = (__pyx_v_c_new_tail == NULL);
17407     if (__pyx_t_1) {
17408
17409       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":918
17410  *             c_new_tail = tree.xmlCopyNode(c_tail, 0)
17411  *         if c_new_tail is NULL:
17412  *             python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
17413  *         tree.xmlAddNextSibling(c_target, c_new_tail)
17414  *         c_target = c_new_tail
17415  */
17416       __pyx_t_2 = PyErr_NoMemory(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17417       __Pyx_GOTREF(__pyx_t_2);
17418       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17419       goto __pyx_L6;
17420     }
17421     __pyx_L6:;
17422
17423     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":919
17424  *         if c_new_tail is NULL:
17425  *             python.PyErr_NoMemory()
17426  *         tree.xmlAddNextSibling(c_target, c_new_tail)             # <<<<<<<<<<<<<<
17427  *         c_target = c_new_tail
17428  *         c_tail = _textNodeOrSkip(c_tail.next)
17429  */
17430     xmlAddNextSibling(__pyx_v_c_target, __pyx_v_c_new_tail);
17431
17432     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":920
17433  *             python.PyErr_NoMemory()
17434  *         tree.xmlAddNextSibling(c_target, c_new_tail)
17435  *         c_target = c_new_tail             # <<<<<<<<<<<<<<
17436  *         c_tail = _textNodeOrSkip(c_tail.next)
17437  *     return 0
17438  */
17439     __pyx_v_c_target = __pyx_v_c_new_tail;
17440
17441     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":921
17442  *         tree.xmlAddNextSibling(c_target, c_new_tail)
17443  *         c_target = c_new_tail
17444  *         c_tail = _textNodeOrSkip(c_tail.next)             # <<<<<<<<<<<<<<
17445  *     return 0
17446  * 
17447  */
17448     __pyx_v_c_tail = __pyx_f_4lxml_5etree__textNodeOrSkip(__pyx_v_c_tail->next);
17449   }
17450
17451   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":922
17452  *         c_target = c_new_tail
17453  *         c_tail = _textNodeOrSkip(c_tail.next)
17454  *     return 0             # <<<<<<<<<<<<<<
17455  * 
17456  * cdef int _copyNonElementSiblings(xmlNode* c_node, xmlNode* c_target) except -1:
17457  */
17458   __pyx_r = 0;
17459   goto __pyx_L0;
17460
17461   __pyx_r = 0;
17462   goto __pyx_L0;
17463   __pyx_L1_error:;
17464   __Pyx_XDECREF(__pyx_t_2);
17465   __Pyx_AddTraceback("lxml.etree._copyTail");
17466   __pyx_r = -1;
17467   __pyx_L0:;
17468   __Pyx_FinishRefcountContext();
17469   return __pyx_r;
17470 }
17471
17472 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":924
17473  *     return 0
17474  * 
17475  * cdef int _copyNonElementSiblings(xmlNode* c_node, xmlNode* c_target) except -1:             # <<<<<<<<<<<<<<
17476  *     cdef xmlNode* c_copy
17477  *     cdef xmlNode* c_sibling = c_node
17478  */
17479
17480 static  int __pyx_f_4lxml_5etree__copyNonElementSiblings(xmlNode *__pyx_v_c_node, xmlNode *__pyx_v_c_target) {
17481   xmlNode *__pyx_v_c_copy;
17482   xmlNode *__pyx_v_c_sibling;
17483   int __pyx_r;
17484   int __pyx_t_1;
17485   int __pyx_t_2;
17486   PyObject *__pyx_t_3 = NULL;
17487   __Pyx_SetupRefcountContext("_copyNonElementSiblings");
17488
17489   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":926
17490  * cdef int _copyNonElementSiblings(xmlNode* c_node, xmlNode* c_target) except -1:
17491  *     cdef xmlNode* c_copy
17492  *     cdef xmlNode* c_sibling = c_node             # <<<<<<<<<<<<<<
17493  *     while c_sibling.prev != NULL and \
17494  *             (c_sibling.prev.type == tree.XML_PI_NODE or \
17495  */
17496   __pyx_v_c_sibling = __pyx_v_c_node;
17497
17498   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":927
17499  *     cdef xmlNode* c_copy
17500  *     cdef xmlNode* c_sibling = c_node
17501  *     while c_sibling.prev != NULL and \             # <<<<<<<<<<<<<<
17502  *             (c_sibling.prev.type == tree.XML_PI_NODE or \
17503  *                  c_sibling.prev.type == tree.XML_COMMENT_NODE):
17504  */
17505   while (1) {
17506     if ((__pyx_v_c_sibling->prev != NULL)) {
17507
17508       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":928
17509  *     cdef xmlNode* c_sibling = c_node
17510  *     while c_sibling.prev != NULL and \
17511  *             (c_sibling.prev.type == tree.XML_PI_NODE or \             # <<<<<<<<<<<<<<
17512  *                  c_sibling.prev.type == tree.XML_COMMENT_NODE):
17513  *         c_sibling = c_sibling.prev
17514  */
17515       if (!(__pyx_v_c_sibling->prev->type == XML_PI_NODE)) {
17516
17517         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":929
17518  *     while c_sibling.prev != NULL and \
17519  *             (c_sibling.prev.type == tree.XML_PI_NODE or \
17520  *                  c_sibling.prev.type == tree.XML_COMMENT_NODE):             # <<<<<<<<<<<<<<
17521  *         c_sibling = c_sibling.prev
17522  *     while c_sibling != c_node:
17523  */
17524         __pyx_t_1 = (__pyx_v_c_sibling->prev->type == XML_COMMENT_NODE);
17525       } else {
17526         __pyx_t_1 = (__pyx_v_c_sibling->prev->type == XML_PI_NODE);
17527       }
17528       __pyx_t_2 = __pyx_t_1;
17529     } else {
17530       __pyx_t_2 = (__pyx_v_c_sibling->prev != NULL);
17531     }
17532     if (!__pyx_t_2) break;
17533
17534     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":930
17535  *             (c_sibling.prev.type == tree.XML_PI_NODE or \
17536  *                  c_sibling.prev.type == tree.XML_COMMENT_NODE):
17537  *         c_sibling = c_sibling.prev             # <<<<<<<<<<<<<<
17538  *     while c_sibling != c_node:
17539  *         c_copy = tree.xmlDocCopyNode(c_sibling, c_target.doc, 1)
17540  */
17541     __pyx_v_c_sibling = __pyx_v_c_sibling->prev;
17542   }
17543
17544   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":931
17545  *                  c_sibling.prev.type == tree.XML_COMMENT_NODE):
17546  *         c_sibling = c_sibling.prev
17547  *     while c_sibling != c_node:             # <<<<<<<<<<<<<<
17548  *         c_copy = tree.xmlDocCopyNode(c_sibling, c_target.doc, 1)
17549  *         if c_copy is NULL:
17550  */
17551   while (1) {
17552     __pyx_t_2 = (__pyx_v_c_sibling != __pyx_v_c_node);
17553     if (!__pyx_t_2) break;
17554
17555     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":932
17556  *         c_sibling = c_sibling.prev
17557  *     while c_sibling != c_node:
17558  *         c_copy = tree.xmlDocCopyNode(c_sibling, c_target.doc, 1)             # <<<<<<<<<<<<<<
17559  *         if c_copy is NULL:
17560  *             python.PyErr_NoMemory()
17561  */
17562     __pyx_v_c_copy = xmlDocCopyNode(__pyx_v_c_sibling, __pyx_v_c_target->doc, 1);
17563
17564     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":933
17565  *     while c_sibling != c_node:
17566  *         c_copy = tree.xmlDocCopyNode(c_sibling, c_target.doc, 1)
17567  *         if c_copy is NULL:             # <<<<<<<<<<<<<<
17568  *             python.PyErr_NoMemory()
17569  *         tree.xmlAddPrevSibling(c_target, c_copy)
17570  */
17571     __pyx_t_2 = (__pyx_v_c_copy == NULL);
17572     if (__pyx_t_2) {
17573
17574       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":934
17575  *         c_copy = tree.xmlDocCopyNode(c_sibling, c_target.doc, 1)
17576  *         if c_copy is NULL:
17577  *             python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
17578  *         tree.xmlAddPrevSibling(c_target, c_copy)
17579  *         c_sibling = c_sibling.next
17580  */
17581       __pyx_t_3 = PyErr_NoMemory(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17582       __Pyx_GOTREF(__pyx_t_3);
17583       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17584       goto __pyx_L7;
17585     }
17586     __pyx_L7:;
17587
17588     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":935
17589  *         if c_copy is NULL:
17590  *             python.PyErr_NoMemory()
17591  *         tree.xmlAddPrevSibling(c_target, c_copy)             # <<<<<<<<<<<<<<
17592  *         c_sibling = c_sibling.next
17593  *     while c_sibling.next != NULL and \
17594  */
17595     xmlAddPrevSibling(__pyx_v_c_target, __pyx_v_c_copy);
17596
17597     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":936
17598  *             python.PyErr_NoMemory()
17599  *         tree.xmlAddPrevSibling(c_target, c_copy)
17600  *         c_sibling = c_sibling.next             # <<<<<<<<<<<<<<
17601  *     while c_sibling.next != NULL and \
17602  *             (c_sibling.next.type == tree.XML_PI_NODE or \
17603  */
17604     __pyx_v_c_sibling = __pyx_v_c_sibling->next;
17605   }
17606
17607   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":937
17608  *         tree.xmlAddPrevSibling(c_target, c_copy)
17609  *         c_sibling = c_sibling.next
17610  *     while c_sibling.next != NULL and \             # <<<<<<<<<<<<<<
17611  *             (c_sibling.next.type == tree.XML_PI_NODE or \
17612  *                  c_sibling.next.type == tree.XML_COMMENT_NODE):
17613  */
17614   while (1) {
17615     if ((__pyx_v_c_sibling->next != NULL)) {
17616
17617       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":938
17618  *         c_sibling = c_sibling.next
17619  *     while c_sibling.next != NULL and \
17620  *             (c_sibling.next.type == tree.XML_PI_NODE or \             # <<<<<<<<<<<<<<
17621  *                  c_sibling.next.type == tree.XML_COMMENT_NODE):
17622  *         c_sibling = c_sibling.next
17623  */
17624       if (!(__pyx_v_c_sibling->next->type == XML_PI_NODE)) {
17625
17626         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":939
17627  *     while c_sibling.next != NULL and \
17628  *             (c_sibling.next.type == tree.XML_PI_NODE or \
17629  *                  c_sibling.next.type == tree.XML_COMMENT_NODE):             # <<<<<<<<<<<<<<
17630  *         c_sibling = c_sibling.next
17631  *         c_copy = tree.xmlDocCopyNode(c_sibling, c_target.doc, 1)
17632  */
17633         __pyx_t_2 = (__pyx_v_c_sibling->next->type == XML_COMMENT_NODE);
17634       } else {
17635         __pyx_t_2 = (__pyx_v_c_sibling->next->type == XML_PI_NODE);
17636       }
17637       __pyx_t_1 = __pyx_t_2;
17638     } else {
17639       __pyx_t_1 = (__pyx_v_c_sibling->next != NULL);
17640     }
17641     if (!__pyx_t_1) break;
17642
17643     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":940
17644  *             (c_sibling.next.type == tree.XML_PI_NODE or \
17645  *                  c_sibling.next.type == tree.XML_COMMENT_NODE):
17646  *         c_sibling = c_sibling.next             # <<<<<<<<<<<<<<
17647  *         c_copy = tree.xmlDocCopyNode(c_sibling, c_target.doc, 1)
17648  *         if c_copy is NULL:
17649  */
17650     __pyx_v_c_sibling = __pyx_v_c_sibling->next;
17651
17652     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":941
17653  *                  c_sibling.next.type == tree.XML_COMMENT_NODE):
17654  *         c_sibling = c_sibling.next
17655  *         c_copy = tree.xmlDocCopyNode(c_sibling, c_target.doc, 1)             # <<<<<<<<<<<<<<
17656  *         if c_copy is NULL:
17657  *             python.PyErr_NoMemory()
17658  */
17659     __pyx_v_c_copy = xmlDocCopyNode(__pyx_v_c_sibling, __pyx_v_c_target->doc, 1);
17660
17661     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":942
17662  *         c_sibling = c_sibling.next
17663  *         c_copy = tree.xmlDocCopyNode(c_sibling, c_target.doc, 1)
17664  *         if c_copy is NULL:             # <<<<<<<<<<<<<<
17665  *             python.PyErr_NoMemory()
17666  *         tree.xmlAddNextSibling(c_target, c_copy)
17667  */
17668     __pyx_t_1 = (__pyx_v_c_copy == NULL);
17669     if (__pyx_t_1) {
17670
17671       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":943
17672  *         c_copy = tree.xmlDocCopyNode(c_sibling, c_target.doc, 1)
17673  *         if c_copy is NULL:
17674  *             python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
17675  *         tree.xmlAddNextSibling(c_target, c_copy)
17676  * 
17677  */
17678       __pyx_t_3 = PyErr_NoMemory(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17679       __Pyx_GOTREF(__pyx_t_3);
17680       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17681       goto __pyx_L10;
17682     }
17683     __pyx_L10:;
17684
17685     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":944
17686  *         if c_copy is NULL:
17687  *             python.PyErr_NoMemory()
17688  *         tree.xmlAddNextSibling(c_target, c_copy)             # <<<<<<<<<<<<<<
17689  * 
17690  * cdef int _deleteSlice(_Document doc, xmlNode* c_node,
17691  */
17692     xmlAddNextSibling(__pyx_v_c_target, __pyx_v_c_copy);
17693   }
17694
17695   __pyx_r = 0;
17696   goto __pyx_L0;
17697   __pyx_L1_error:;
17698   __Pyx_XDECREF(__pyx_t_3);
17699   __Pyx_AddTraceback("lxml.etree._copyNonElementSiblings");
17700   __pyx_r = -1;
17701   __pyx_L0:;
17702   __Pyx_FinishRefcountContext();
17703   return __pyx_r;
17704 }
17705
17706 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":946
17707  *         tree.xmlAddNextSibling(c_target, c_copy)
17708  * 
17709  * cdef int _deleteSlice(_Document doc, xmlNode* c_node,             # <<<<<<<<<<<<<<
17710  *                       Py_ssize_t count, Py_ssize_t step) except -1:
17711  *     u"""Delete slice, ``count`` items starting with ``c_node`` with a step
17712  */
17713
17714 static  int __pyx_f_4lxml_5etree__deleteSlice(struct LxmlDocument *__pyx_v_doc, xmlNode *__pyx_v_c_node, Py_ssize_t __pyx_v_count, Py_ssize_t __pyx_v_step) {
17715   xmlNode *__pyx_v_c_next;
17716   Py_ssize_t __pyx_v_c;
17717   Py_ssize_t __pyx_v_i;
17718   _node_to_node_function __pyx_v_next_element;
17719   int __pyx_r;
17720   int __pyx_t_1;
17721   Py_ssize_t __pyx_t_2;
17722   int __pyx_t_3;
17723   __Pyx_SetupRefcountContext("_deleteSlice");
17724
17725   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":954
17726  *     cdef Py_ssize_t c, i
17727  *     cdef _node_to_node_function next_element
17728  *     if c_node is NULL:             # <<<<<<<<<<<<<<
17729  *         return 0
17730  *     if step > 0:
17731  */
17732   __pyx_t_1 = (__pyx_v_c_node == NULL);
17733   if (__pyx_t_1) {
17734
17735     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":955
17736  *     cdef _node_to_node_function next_element
17737  *     if c_node is NULL:
17738  *         return 0             # <<<<<<<<<<<<<<
17739  *     if step > 0:
17740  *         next_element = _nextElement
17741  */
17742     __pyx_r = 0;
17743     goto __pyx_L0;
17744     goto __pyx_L3;
17745   }
17746   __pyx_L3:;
17747
17748   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":956
17749  *     if c_node is NULL:
17750  *         return 0
17751  *     if step > 0:             # <<<<<<<<<<<<<<
17752  *         next_element = _nextElement
17753  *     else:
17754  */
17755   __pyx_t_1 = (__pyx_v_step > 0);
17756   if (__pyx_t_1) {
17757
17758     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":957
17759  *         return 0
17760  *     if step > 0:
17761  *         next_element = _nextElement             # <<<<<<<<<<<<<<
17762  *     else:
17763  *         step = -step
17764  */
17765     __pyx_v_next_element = __pyx_f_4lxml_5etree__nextElement;
17766     goto __pyx_L4;
17767   }
17768   /*else*/ {
17769
17770     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":959
17771  *         next_element = _nextElement
17772  *     else:
17773  *         step = -step             # <<<<<<<<<<<<<<
17774  *         next_element = _previousElement
17775  *     # now start deleting nodes
17776  */
17777     __pyx_v_step = (-__pyx_v_step);
17778
17779     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":960
17780  *     else:
17781  *         step = -step
17782  *         next_element = _previousElement             # <<<<<<<<<<<<<<
17783  *     # now start deleting nodes
17784  *     c = 0
17785  */
17786     __pyx_v_next_element = __pyx_f_4lxml_5etree__previousElement;
17787   }
17788   __pyx_L4:;
17789
17790   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":962
17791  *         next_element = _previousElement
17792  *     # now start deleting nodes
17793  *     c = 0             # <<<<<<<<<<<<<<
17794  *     c_next = c_node
17795  *     while c_node is not NULL and c < count:
17796  */
17797   __pyx_v_c = 0;
17798
17799   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":963
17800  *     # now start deleting nodes
17801  *     c = 0
17802  *     c_next = c_node             # <<<<<<<<<<<<<<
17803  *     while c_node is not NULL and c < count:
17804  *         for i from 0 <= i < step:
17805  */
17806   __pyx_v_c_next = __pyx_v_c_node;
17807
17808   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":964
17809  *     c = 0
17810  *     c_next = c_node
17811  *     while c_node is not NULL and c < count:             # <<<<<<<<<<<<<<
17812  *         for i from 0 <= i < step:
17813  *             c_next = next_element(c_next)
17814  */
17815   while (1) {
17816     if ((__pyx_v_c_node != NULL)) {
17817       __pyx_t_1 = (__pyx_v_c < __pyx_v_count);
17818     } else {
17819       __pyx_t_1 = (__pyx_v_c_node != NULL);
17820     }
17821     if (!__pyx_t_1) break;
17822
17823     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":965
17824  *     c_next = c_node
17825  *     while c_node is not NULL and c < count:
17826  *         for i from 0 <= i < step:             # <<<<<<<<<<<<<<
17827  *             c_next = next_element(c_next)
17828  *         _removeNode(doc, c_node)
17829  */
17830     __pyx_t_2 = __pyx_v_step;
17831     for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
17832
17833       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":966
17834  *     while c_node is not NULL and c < count:
17835  *         for i from 0 <= i < step:
17836  *             c_next = next_element(c_next)             # <<<<<<<<<<<<<<
17837  *         _removeNode(doc, c_node)
17838  *         c = c + 1
17839  */
17840       __pyx_v_c_next = __pyx_v_next_element(__pyx_v_c_next);
17841     }
17842
17843     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":967
17844  *         for i from 0 <= i < step:
17845  *             c_next = next_element(c_next)
17846  *         _removeNode(doc, c_node)             # <<<<<<<<<<<<<<
17847  *         c = c + 1
17848  *         c_node = c_next
17849  */
17850     __pyx_t_3 = __pyx_f_4lxml_5etree__removeNode(__pyx_v_doc, __pyx_v_c_node); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17851
17852     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":968
17853  *             c_next = next_element(c_next)
17854  *         _removeNode(doc, c_node)
17855  *         c = c + 1             # <<<<<<<<<<<<<<
17856  *         c_node = c_next
17857  *     return 0
17858  */
17859     __pyx_v_c = (__pyx_v_c + 1);
17860
17861     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":969
17862  *         _removeNode(doc, c_node)
17863  *         c = c + 1
17864  *         c_node = c_next             # <<<<<<<<<<<<<<
17865  *     return 0
17866  * 
17867  */
17868     __pyx_v_c_node = __pyx_v_c_next;
17869   }
17870
17871   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":970
17872  *         c = c + 1
17873  *         c_node = c_next
17874  *     return 0             # <<<<<<<<<<<<<<
17875  * 
17876  * cdef int _replaceSlice(_Element parent, xmlNode* c_node,
17877  */
17878   __pyx_r = 0;
17879   goto __pyx_L0;
17880
17881   __pyx_r = 0;
17882   goto __pyx_L0;
17883   __pyx_L1_error:;
17884   __Pyx_AddTraceback("lxml.etree._deleteSlice");
17885   __pyx_r = -1;
17886   __pyx_L0:;
17887   __Pyx_FinishRefcountContext();
17888   return __pyx_r;
17889 }
17890
17891 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":972
17892  *     return 0
17893  * 
17894  * cdef int _replaceSlice(_Element parent, xmlNode* c_node,             # <<<<<<<<<<<<<<
17895  *                        Py_ssize_t slicelength, Py_ssize_t step,
17896  *                        bint left_to_right, elements) except -1:
17897  */
17898
17899 static  int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent, xmlNode *__pyx_v_c_node, Py_ssize_t __pyx_v_slicelength, Py_ssize_t __pyx_v_step, int __pyx_v_left_to_right, PyObject *__pyx_v_elements) {
17900   xmlNode *__pyx_v_c_orig_neighbour;
17901   xmlNode *__pyx_v_c_next;
17902   xmlDoc *__pyx_v_c_source_doc;
17903   struct LxmlElement *__pyx_v_element;
17904   Py_ssize_t __pyx_v_seqlength;
17905   Py_ssize_t __pyx_v_i;
17906   Py_ssize_t __pyx_v_c;
17907   _node_to_node_function __pyx_v_next_element;
17908   int __pyx_r;
17909   int __pyx_t_1;
17910   PyObject *__pyx_t_2 = NULL;
17911   PyObject *__pyx_t_3 = NULL;
17912   Py_ssize_t __pyx_t_4;
17913   PyObject *__pyx_t_5 = NULL;
17914   int __pyx_t_6;
17915   Py_ssize_t __pyx_t_7;
17916   __Pyx_SetupRefcountContext("_replaceSlice");
17917   __Pyx_INCREF(__pyx_v_elements);
17918   __pyx_v_element = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
17919
17920   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":987
17921  *     cdef Py_ssize_t seqlength, i, c
17922  *     cdef _node_to_node_function next_element
17923  *     assert step > 0             # <<<<<<<<<<<<<<
17924  *     if left_to_right:
17925  *         next_element = _nextElement
17926  */
17927   #ifndef PYREX_WITHOUT_ASSERTIONS
17928   if (unlikely(!(__pyx_v_step > 0))) {
17929     PyErr_SetNone(PyExc_AssertionError);
17930     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17931   }
17932   #endif
17933
17934   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":988
17935  *     cdef _node_to_node_function next_element
17936  *     assert step > 0
17937  *     if left_to_right:             # <<<<<<<<<<<<<<
17938  *         next_element = _nextElement
17939  *     else:
17940  */
17941   __pyx_t_1 = __pyx_v_left_to_right;
17942   if (__pyx_t_1) {
17943
17944     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":989
17945  *     assert step > 0
17946  *     if left_to_right:
17947  *         next_element = _nextElement             # <<<<<<<<<<<<<<
17948  *     else:
17949  *         next_element = _previousElement
17950  */
17951     __pyx_v_next_element = __pyx_f_4lxml_5etree__nextElement;
17952     goto __pyx_L3;
17953   }
17954   /*else*/ {
17955
17956     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":991
17957  *         next_element = _nextElement
17958  *     else:
17959  *         next_element = _previousElement             # <<<<<<<<<<<<<<
17960  * 
17961  *     if not python.PyList_Check(elements) and \
17962  */
17963     __pyx_v_next_element = __pyx_f_4lxml_5etree__previousElement;
17964   }
17965   __pyx_L3:;
17966
17967   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":993
17968  *         next_element = _previousElement
17969  * 
17970  *     if not python.PyList_Check(elements) and \             # <<<<<<<<<<<<<<
17971  *             not python.PyTuple_Check(elements):
17972  *         elements = list(elements)
17973  */
17974   if ((!PyList_Check(__pyx_v_elements))) {
17975
17976     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":994
17977  * 
17978  *     if not python.PyList_Check(elements) and \
17979  *             not python.PyTuple_Check(elements):             # <<<<<<<<<<<<<<
17980  *         elements = list(elements)
17981  * 
17982  */
17983     __pyx_t_1 = (!PyTuple_Check(__pyx_v_elements));
17984   } else {
17985     __pyx_t_1 = (!PyList_Check(__pyx_v_elements));
17986   }
17987   if (__pyx_t_1) {
17988
17989     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":995
17990  *     if not python.PyList_Check(elements) and \
17991  *             not python.PyTuple_Check(elements):
17992  *         elements = list(elements)             # <<<<<<<<<<<<<<
17993  * 
17994  *     if step > 1:
17995  */
17996     __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17997     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
17998     __Pyx_INCREF(__pyx_v_elements);
17999     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_elements);
18000     __Pyx_GIVEREF(__pyx_v_elements);
18001     __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyList_Type)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18002     __Pyx_GOTREF(__pyx_t_3);
18003     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
18004     __Pyx_DECREF(__pyx_v_elements);
18005     __pyx_v_elements = __pyx_t_3;
18006     __pyx_t_3 = 0;
18007     goto __pyx_L4;
18008   }
18009   __pyx_L4:;
18010
18011   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":997
18012  *         elements = list(elements)
18013  * 
18014  *     if step > 1:             # <<<<<<<<<<<<<<
18015  *         # *replacing* children stepwise with list => check size!
18016  *         seqlength = len(elements)
18017  */
18018   __pyx_t_1 = (__pyx_v_step > 1);
18019   if (__pyx_t_1) {
18020
18021     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":999
18022  *     if step > 1:
18023  *         # *replacing* children stepwise with list => check size!
18024  *         seqlength = len(elements)             # <<<<<<<<<<<<<<
18025  *         if seqlength != slicelength:
18026  *             raise ValueError, u"attempt to assign sequence of size %d " \
18027  */
18028     __pyx_t_4 = PyObject_Length(__pyx_v_elements); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18029     __pyx_v_seqlength = __pyx_t_4;
18030
18031     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1000
18032  *         # *replacing* children stepwise with list => check size!
18033  *         seqlength = len(elements)
18034  *         if seqlength != slicelength:             # <<<<<<<<<<<<<<
18035  *             raise ValueError, u"attempt to assign sequence of size %d " \
18036  *                 u"to extended slice of size %d" % (seqlength, slicelength)
18037  */
18038     __pyx_t_1 = (__pyx_v_seqlength != __pyx_v_slicelength);
18039     if (__pyx_t_1) {
18040
18041       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1002
18042  *         if seqlength != slicelength:
18043  *             raise ValueError, u"attempt to assign sequence of size %d " \
18044  *                 u"to extended slice of size %d" % (seqlength, slicelength)             # <<<<<<<<<<<<<<
18045  * 
18046  *     if c_node is NULL:
18047  */
18048       __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_seqlength); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18049       __Pyx_GOTREF(__pyx_t_3);
18050       __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_slicelength); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18051       __Pyx_GOTREF(__pyx_t_2);
18052       __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18053       __Pyx_GOTREF(((PyObject *)__pyx_t_5));
18054       PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
18055       __Pyx_GIVEREF(__pyx_t_3);
18056       PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
18057       __Pyx_GIVEREF(__pyx_t_2);
18058       __pyx_t_3 = 0;
18059       __pyx_t_2 = 0;
18060       __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_248), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18061       __Pyx_GOTREF(__pyx_t_2);
18062       __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
18063       __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_2, 0);
18064       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18065       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18066       goto __pyx_L6;
18067     }
18068     __pyx_L6:;
18069     goto __pyx_L5;
18070   }
18071   __pyx_L5:;
18072
18073   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1004
18074  *                 u"to extended slice of size %d" % (seqlength, slicelength)
18075  * 
18076  *     if c_node is NULL:             # <<<<<<<<<<<<<<
18077  *         # no children yet => add all elements straight away
18078  *         if left_to_right:
18079  */
18080   __pyx_t_1 = (__pyx_v_c_node == NULL);
18081   if (__pyx_t_1) {
18082
18083     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1006
18084  *     if c_node is NULL:
18085  *         # no children yet => add all elements straight away
18086  *         if left_to_right:             # <<<<<<<<<<<<<<
18087  *             for element in elements:
18088  *                 assert element is not None, u"Node must not be None"
18089  */
18090     __pyx_t_1 = __pyx_v_left_to_right;
18091     if (__pyx_t_1) {
18092
18093       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1007
18094  *         # no children yet => add all elements straight away
18095  *         if left_to_right:
18096  *             for element in elements:             # <<<<<<<<<<<<<<
18097  *                 assert element is not None, u"Node must not be None"
18098  *                 _appendChild(parent, element)
18099  */
18100       if (PyList_CheckExact(__pyx_v_elements) || PyTuple_CheckExact(__pyx_v_elements)) {
18101         __pyx_t_4 = 0; __pyx_t_2 = __pyx_v_elements; __Pyx_INCREF(__pyx_t_2);
18102       } else {
18103         __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18104         __Pyx_GOTREF(__pyx_t_2);
18105       }
18106       for (;;) {
18107         if (likely(PyList_CheckExact(__pyx_t_2))) {
18108           if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
18109           __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
18110         } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
18111           if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
18112           __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
18113         } else {
18114           __pyx_t_5 = PyIter_Next(__pyx_t_2);
18115           if (!__pyx_t_5) {
18116             if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18117             break;
18118           }
18119           __Pyx_GOTREF(__pyx_t_5);
18120         }
18121         if (!(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18122         __Pyx_DECREF(((PyObject *)__pyx_v_element));
18123         __pyx_v_element = ((struct LxmlElement *)__pyx_t_5);
18124         __pyx_t_5 = 0;
18125
18126         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1008
18127  *         if left_to_right:
18128  *             for element in elements:
18129  *                 assert element is not None, u"Node must not be None"             # <<<<<<<<<<<<<<
18130  *                 _appendChild(parent, element)
18131  *         else:
18132  */
18133         #ifndef PYREX_WITHOUT_ASSERTIONS
18134         __pyx_t_1 = (((PyObject *)__pyx_v_element) != Py_None);
18135         if (unlikely(!__pyx_t_1)) {
18136           PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_249));
18137           {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18138         }
18139         #endif
18140
18141         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1009
18142  *             for element in elements:
18143  *                 assert element is not None, u"Node must not be None"
18144  *                 _appendChild(parent, element)             # <<<<<<<<<<<<<<
18145  *         else:
18146  *             for element in elements:
18147  */
18148         __pyx_t_6 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_parent, __pyx_v_element); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18149       }
18150       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18151       goto __pyx_L8;
18152     }
18153     /*else*/ {
18154
18155       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1011
18156  *                 _appendChild(parent, element)
18157  *         else:
18158  *             for element in elements:             # <<<<<<<<<<<<<<
18159  *                 assert element is not None, u"Node must not be None"
18160  *                 _prependChild(parent, element)
18161  */
18162       if (PyList_CheckExact(__pyx_v_elements) || PyTuple_CheckExact(__pyx_v_elements)) {
18163         __pyx_t_4 = 0; __pyx_t_2 = __pyx_v_elements; __Pyx_INCREF(__pyx_t_2);
18164       } else {
18165         __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18166         __Pyx_GOTREF(__pyx_t_2);
18167       }
18168       for (;;) {
18169         if (likely(PyList_CheckExact(__pyx_t_2))) {
18170           if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
18171           __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
18172         } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
18173           if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
18174           __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
18175         } else {
18176           __pyx_t_5 = PyIter_Next(__pyx_t_2);
18177           if (!__pyx_t_5) {
18178             if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18179             break;
18180           }
18181           __Pyx_GOTREF(__pyx_t_5);
18182         }
18183         if (!(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18184         __Pyx_DECREF(((PyObject *)__pyx_v_element));
18185         __pyx_v_element = ((struct LxmlElement *)__pyx_t_5);
18186         __pyx_t_5 = 0;
18187
18188         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1012
18189  *         else:
18190  *             for element in elements:
18191  *                 assert element is not None, u"Node must not be None"             # <<<<<<<<<<<<<<
18192  *                 _prependChild(parent, element)
18193  *         return 0
18194  */
18195         #ifndef PYREX_WITHOUT_ASSERTIONS
18196         __pyx_t_1 = (((PyObject *)__pyx_v_element) != Py_None);
18197         if (unlikely(!__pyx_t_1)) {
18198           PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_250));
18199           {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18200         }
18201         #endif
18202
18203         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1013
18204  *             for element in elements:
18205  *                 assert element is not None, u"Node must not be None"
18206  *                 _prependChild(parent, element)             # <<<<<<<<<<<<<<
18207  *         return 0
18208  * 
18209  */
18210         __pyx_t_6 = __pyx_f_4lxml_5etree__prependChild(__pyx_v_parent, __pyx_v_element); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18211       }
18212       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18213     }
18214     __pyx_L8:;
18215
18216     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1014
18217  *                 assert element is not None, u"Node must not be None"
18218  *                 _prependChild(parent, element)
18219  *         return 0             # <<<<<<<<<<<<<<
18220  * 
18221  *     # remove the elements first as some might be re-added
18222  */
18223     __pyx_r = 0;
18224     goto __pyx_L0;
18225     goto __pyx_L7;
18226   }
18227   __pyx_L7:;
18228
18229   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1017
18230  * 
18231  *     # remove the elements first as some might be re-added
18232  *     if left_to_right:             # <<<<<<<<<<<<<<
18233  *         # L->R, remember left neighbour
18234  *         c_orig_neighbour = _previousElement(c_node)
18235  */
18236   __pyx_t_1 = __pyx_v_left_to_right;
18237   if (__pyx_t_1) {
18238
18239     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1019
18240  *     if left_to_right:
18241  *         # L->R, remember left neighbour
18242  *         c_orig_neighbour = _previousElement(c_node)             # <<<<<<<<<<<<<<
18243  *     else:
18244  *         # R->L, remember right neighbour
18245  */
18246     __pyx_v_c_orig_neighbour = __pyx_f_4lxml_5etree__previousElement(__pyx_v_c_node);
18247     goto __pyx_L13;
18248   }
18249   /*else*/ {
18250
18251     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1022
18252  *     else:
18253  *         # R->L, remember right neighbour
18254  *         c_orig_neighbour = _nextElement(c_node)             # <<<<<<<<<<<<<<
18255  * 
18256  *     # We remove the original slice elements one by one. Since we hold
18257  */
18258     __pyx_v_c_orig_neighbour = __pyx_f_4lxml_5etree__nextElement(__pyx_v_c_node);
18259   }
18260   __pyx_L13:;
18261
18262   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1028
18263  *     # safe to let _removeNode() try (and fail) to free them even if
18264  *     # the element itself or one of its descendents will be reinserted.
18265  *     c = 0             # <<<<<<<<<<<<<<
18266  *     c_next = c_node
18267  *     while c_node is not NULL and c < slicelength:
18268  */
18269   __pyx_v_c = 0;
18270
18271   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1029
18272  *     # the element itself or one of its descendents will be reinserted.
18273  *     c = 0
18274  *     c_next = c_node             # <<<<<<<<<<<<<<
18275  *     while c_node is not NULL and c < slicelength:
18276  *         for i from 0 <= i < step:
18277  */
18278   __pyx_v_c_next = __pyx_v_c_node;
18279
18280   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1030
18281  *     c = 0
18282  *     c_next = c_node
18283  *     while c_node is not NULL and c < slicelength:             # <<<<<<<<<<<<<<
18284  *         for i from 0 <= i < step:
18285  *             c_next = next_element(c_next)
18286  */
18287   while (1) {
18288     if ((__pyx_v_c_node != NULL)) {
18289       __pyx_t_1 = (__pyx_v_c < __pyx_v_slicelength);
18290     } else {
18291       __pyx_t_1 = (__pyx_v_c_node != NULL);
18292     }
18293     if (!__pyx_t_1) break;
18294
18295     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1031
18296  *     c_next = c_node
18297  *     while c_node is not NULL and c < slicelength:
18298  *         for i from 0 <= i < step:             # <<<<<<<<<<<<<<
18299  *             c_next = next_element(c_next)
18300  *         _removeNode(parent._doc, c_node)
18301  */
18302     __pyx_t_4 = __pyx_v_step;
18303     for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
18304
18305       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1032
18306  *     while c_node is not NULL and c < slicelength:
18307  *         for i from 0 <= i < step:
18308  *             c_next = next_element(c_next)             # <<<<<<<<<<<<<<
18309  *         _removeNode(parent._doc, c_node)
18310  *         c = c + 1
18311  */
18312       __pyx_v_c_next = __pyx_v_next_element(__pyx_v_c_next);
18313     }
18314
18315     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1033
18316  *         for i from 0 <= i < step:
18317  *             c_next = next_element(c_next)
18318  *         _removeNode(parent._doc, c_node)             # <<<<<<<<<<<<<<
18319  *         c = c + 1
18320  *         c_node = c_next
18321  */
18322     __pyx_t_6 = __pyx_f_4lxml_5etree__removeNode(__pyx_v_parent->_doc, __pyx_v_c_node); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18323
18324     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1034
18325  *             c_next = next_element(c_next)
18326  *         _removeNode(parent._doc, c_node)
18327  *         c = c + 1             # <<<<<<<<<<<<<<
18328  *         c_node = c_next
18329  * 
18330  */
18331     __pyx_v_c = (__pyx_v_c + 1);
18332
18333     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1035
18334  *         _removeNode(parent._doc, c_node)
18335  *         c = c + 1
18336  *         c_node = c_next             # <<<<<<<<<<<<<<
18337  * 
18338  *     # make sure each element is inserted only once
18339  */
18340     __pyx_v_c_node = __pyx_v_c_next;
18341   }
18342
18343   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1038
18344  * 
18345  *     # make sure each element is inserted only once
18346  *     elements = iter(elements)             # <<<<<<<<<<<<<<
18347  * 
18348  *     # find the first node right of the new insertion point
18349  */
18350   __pyx_t_2 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18351   __Pyx_GOTREF(__pyx_t_2);
18352   __Pyx_DECREF(__pyx_v_elements);
18353   __pyx_v_elements = __pyx_t_2;
18354   __pyx_t_2 = 0;
18355
18356   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1041
18357  * 
18358  *     # find the first node right of the new insertion point
18359  *     if left_to_right:             # <<<<<<<<<<<<<<
18360  *         if c_orig_neighbour is not NULL:
18361  *             c_node = next_element(c_orig_neighbour)
18362  */
18363   __pyx_t_1 = __pyx_v_left_to_right;
18364   if (__pyx_t_1) {
18365
18366     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1042
18367  *     # find the first node right of the new insertion point
18368  *     if left_to_right:
18369  *         if c_orig_neighbour is not NULL:             # <<<<<<<<<<<<<<
18370  *             c_node = next_element(c_orig_neighbour)
18371  *         else:
18372  */
18373     __pyx_t_1 = (__pyx_v_c_orig_neighbour != NULL);
18374     if (__pyx_t_1) {
18375
18376       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1043
18377  *     if left_to_right:
18378  *         if c_orig_neighbour is not NULL:
18379  *             c_node = next_element(c_orig_neighbour)             # <<<<<<<<<<<<<<
18380  *         else:
18381  *             # before the first element
18382  */
18383       __pyx_v_c_node = __pyx_v_next_element(__pyx_v_c_orig_neighbour);
18384       goto __pyx_L19;
18385     }
18386     /*else*/ {
18387
18388       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1046
18389  *         else:
18390  *             # before the first element
18391  *             c_node = _findChildForwards(parent._c_node, 0)             # <<<<<<<<<<<<<<
18392  *     elif c_orig_neighbour is NULL:
18393  *         # at the end, but reversed stepping
18394  */
18395       __pyx_v_c_node = __pyx_f_4lxml_5etree__findChildForwards(__pyx_v_parent->_c_node, 0);
18396     }
18397     __pyx_L19:;
18398     goto __pyx_L18;
18399   }
18400
18401   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1047
18402  *             # before the first element
18403  *             c_node = _findChildForwards(parent._c_node, 0)
18404  *     elif c_orig_neighbour is NULL:             # <<<<<<<<<<<<<<
18405  *         # at the end, but reversed stepping
18406  *         # append one element and go to the next insertion point
18407  */
18408   __pyx_t_1 = (__pyx_v_c_orig_neighbour == NULL);
18409   if (__pyx_t_1) {
18410
18411     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1050
18412  *         # at the end, but reversed stepping
18413  *         # append one element and go to the next insertion point
18414  *         for element in elements:             # <<<<<<<<<<<<<<
18415  *             assert element is not None, u"Node must not be None"
18416  *             _appendChild(parent, element)
18417  */
18418     if (PyList_CheckExact(__pyx_v_elements) || PyTuple_CheckExact(__pyx_v_elements)) {
18419       __pyx_t_4 = 0; __pyx_t_2 = __pyx_v_elements; __Pyx_INCREF(__pyx_t_2);
18420     } else {
18421       __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18422       __Pyx_GOTREF(__pyx_t_2);
18423     }
18424     for (;;) {
18425       if (likely(PyList_CheckExact(__pyx_t_2))) {
18426         if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
18427         __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
18428       } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
18429         if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
18430         __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
18431       } else {
18432         __pyx_t_5 = PyIter_Next(__pyx_t_2);
18433         if (!__pyx_t_5) {
18434           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18435           break;
18436         }
18437         __Pyx_GOTREF(__pyx_t_5);
18438       }
18439       if (!(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18440       __Pyx_DECREF(((PyObject *)__pyx_v_element));
18441       __pyx_v_element = ((struct LxmlElement *)__pyx_t_5);
18442       __pyx_t_5 = 0;
18443
18444       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1051
18445  *         # append one element and go to the next insertion point
18446  *         for element in elements:
18447  *             assert element is not None, u"Node must not be None"             # <<<<<<<<<<<<<<
18448  *             _appendChild(parent, element)
18449  *             c_node = element._c_node
18450  */
18451       #ifndef PYREX_WITHOUT_ASSERTIONS
18452       __pyx_t_1 = (((PyObject *)__pyx_v_element) != Py_None);
18453       if (unlikely(!__pyx_t_1)) {
18454         PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_251));
18455         {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18456       }
18457       #endif
18458
18459       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1052
18460  *         for element in elements:
18461  *             assert element is not None, u"Node must not be None"
18462  *             _appendChild(parent, element)             # <<<<<<<<<<<<<<
18463  *             c_node = element._c_node
18464  *             if slicelength > 0:
18465  */
18466       __pyx_t_6 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_parent, __pyx_v_element); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18467
18468       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1053
18469  *             assert element is not None, u"Node must not be None"
18470  *             _appendChild(parent, element)
18471  *             c_node = element._c_node             # <<<<<<<<<<<<<<
18472  *             if slicelength > 0:
18473  *                 slicelength = slicelength - 1
18474  */
18475       __pyx_v_c_node = __pyx_v_element->_c_node;
18476
18477       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1054
18478  *             _appendChild(parent, element)
18479  *             c_node = element._c_node
18480  *             if slicelength > 0:             # <<<<<<<<<<<<<<
18481  *                 slicelength = slicelength - 1
18482  *                 for i from 1 <= i < step:
18483  */
18484       __pyx_t_1 = (__pyx_v_slicelength > 0);
18485       if (__pyx_t_1) {
18486
18487         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1055
18488  *             c_node = element._c_node
18489  *             if slicelength > 0:
18490  *                 slicelength = slicelength - 1             # <<<<<<<<<<<<<<
18491  *                 for i from 1 <= i < step:
18492  *                     c_node = next_element(c_node)
18493  */
18494         __pyx_v_slicelength = (__pyx_v_slicelength - 1);
18495
18496         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1056
18497  *             if slicelength > 0:
18498  *                 slicelength = slicelength - 1
18499  *                 for i from 1 <= i < step:             # <<<<<<<<<<<<<<
18500  *                     c_node = next_element(c_node)
18501  *             break
18502  */
18503         __pyx_t_7 = __pyx_v_step;
18504         for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {
18505
18506           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1057
18507  *                 slicelength = slicelength - 1
18508  *                 for i from 1 <= i < step:
18509  *                     c_node = next_element(c_node)             # <<<<<<<<<<<<<<
18510  *             break
18511  * 
18512  */
18513           __pyx_v_c_node = __pyx_v_next_element(__pyx_v_c_node);
18514         }
18515         goto __pyx_L22;
18516       }
18517       __pyx_L22:;
18518
18519       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1058
18520  *                 for i from 1 <= i < step:
18521  *                     c_node = next_element(c_node)
18522  *             break             # <<<<<<<<<<<<<<
18523  * 
18524  *     if left_to_right:
18525  */
18526       goto __pyx_L21_break;
18527     }
18528     __pyx_L21_break:;
18529     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18530     goto __pyx_L18;
18531   }
18532   __pyx_L18:;
18533
18534   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1060
18535  *             break
18536  * 
18537  *     if left_to_right:             # <<<<<<<<<<<<<<
18538  *         # adjust step size after removing slice as we are not stepping
18539  *         # over the newly inserted elements
18540  */
18541   __pyx_t_1 = __pyx_v_left_to_right;
18542   if (__pyx_t_1) {
18543
18544     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1063
18545  *         # adjust step size after removing slice as we are not stepping
18546  *         # over the newly inserted elements
18547  *         step = step - 1             # <<<<<<<<<<<<<<
18548  * 
18549  *     # now insert elements where we removed them
18550  */
18551     __pyx_v_step = (__pyx_v_step - 1);
18552     goto __pyx_L25;
18553   }
18554   __pyx_L25:;
18555
18556   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1066
18557  * 
18558  *     # now insert elements where we removed them
18559  *     if c_node is not NULL:             # <<<<<<<<<<<<<<
18560  *         for element in elements:
18561  *             assert element is not None, u"Node must not be None"
18562  */
18563   __pyx_t_1 = (__pyx_v_c_node != NULL);
18564   if (__pyx_t_1) {
18565
18566     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1067
18567  *     # now insert elements where we removed them
18568  *     if c_node is not NULL:
18569  *         for element in elements:             # <<<<<<<<<<<<<<
18570  *             assert element is not None, u"Node must not be None"
18571  *             # move element and tail over
18572  */
18573     if (PyList_CheckExact(__pyx_v_elements) || PyTuple_CheckExact(__pyx_v_elements)) {
18574       __pyx_t_4 = 0; __pyx_t_2 = __pyx_v_elements; __Pyx_INCREF(__pyx_t_2);
18575     } else {
18576       __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18577       __Pyx_GOTREF(__pyx_t_2);
18578     }
18579     for (;;) {
18580       if (likely(PyList_CheckExact(__pyx_t_2))) {
18581         if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
18582         __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
18583       } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
18584         if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
18585         __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
18586       } else {
18587         __pyx_t_5 = PyIter_Next(__pyx_t_2);
18588         if (!__pyx_t_5) {
18589           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18590           break;
18591         }
18592         __Pyx_GOTREF(__pyx_t_5);
18593       }
18594       if (!(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18595       __Pyx_DECREF(((PyObject *)__pyx_v_element));
18596       __pyx_v_element = ((struct LxmlElement *)__pyx_t_5);
18597       __pyx_t_5 = 0;
18598
18599       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1068
18600  *     if c_node is not NULL:
18601  *         for element in elements:
18602  *             assert element is not None, u"Node must not be None"             # <<<<<<<<<<<<<<
18603  *             # move element and tail over
18604  *             c_source_doc = element._c_node.doc
18605  */
18606       #ifndef PYREX_WITHOUT_ASSERTIONS
18607       __pyx_t_1 = (((PyObject *)__pyx_v_element) != Py_None);
18608       if (unlikely(!__pyx_t_1)) {
18609         PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_252));
18610         {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18611       }
18612       #endif
18613
18614       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1070
18615  *             assert element is not None, u"Node must not be None"
18616  *             # move element and tail over
18617  *             c_source_doc = element._c_node.doc             # <<<<<<<<<<<<<<
18618  *             c_next = element._c_node.next
18619  *             tree.xmlAddPrevSibling(c_node, element._c_node)
18620  */
18621       __pyx_v_c_source_doc = __pyx_v_element->_c_node->doc;
18622
18623       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1071
18624  *             # move element and tail over
18625  *             c_source_doc = element._c_node.doc
18626  *             c_next = element._c_node.next             # <<<<<<<<<<<<<<
18627  *             tree.xmlAddPrevSibling(c_node, element._c_node)
18628  *             _moveTail(c_next, element._c_node)
18629  */
18630       __pyx_v_c_next = __pyx_v_element->_c_node->next;
18631
18632       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1072
18633  *             c_source_doc = element._c_node.doc
18634  *             c_next = element._c_node.next
18635  *             tree.xmlAddPrevSibling(c_node, element._c_node)             # <<<<<<<<<<<<<<
18636  *             _moveTail(c_next, element._c_node)
18637  * 
18638  */
18639       xmlAddPrevSibling(__pyx_v_c_node, __pyx_v_element->_c_node);
18640
18641       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1073
18642  *             c_next = element._c_node.next
18643  *             tree.xmlAddPrevSibling(c_node, element._c_node)
18644  *             _moveTail(c_next, element._c_node)             # <<<<<<<<<<<<<<
18645  * 
18646  *             # integrate element into new document
18647  */
18648       __pyx_f_4lxml_5etree__moveTail(__pyx_v_c_next, __pyx_v_element->_c_node);
18649
18650       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1076
18651  * 
18652  *             # integrate element into new document
18653  *             moveNodeToDocument(parent._doc, c_source_doc, element._c_node)             # <<<<<<<<<<<<<<
18654  * 
18655  *             # stop at the end of the slice
18656  */
18657       __pyx_t_6 = __pyx_f_4lxml_5etree_moveNodeToDocument(__pyx_v_parent->_doc, __pyx_v_c_source_doc, __pyx_v_element->_c_node); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18658
18659       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1079
18660  * 
18661  *             # stop at the end of the slice
18662  *             if slicelength > 0:             # <<<<<<<<<<<<<<
18663  *                 slicelength = slicelength - 1
18664  *                 for i from 0 <= i < step:
18665  */
18666       __pyx_t_1 = (__pyx_v_slicelength > 0);
18667       if (__pyx_t_1) {
18668
18669         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1080
18670  *             # stop at the end of the slice
18671  *             if slicelength > 0:
18672  *                 slicelength = slicelength - 1             # <<<<<<<<<<<<<<
18673  *                 for i from 0 <= i < step:
18674  *                     c_node = next_element(c_node)
18675  */
18676         __pyx_v_slicelength = (__pyx_v_slicelength - 1);
18677
18678         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1081
18679  *             if slicelength > 0:
18680  *                 slicelength = slicelength - 1
18681  *                 for i from 0 <= i < step:             # <<<<<<<<<<<<<<
18682  *                     c_node = next_element(c_node)
18683  *                 if c_node is NULL:
18684  */
18685         __pyx_t_7 = __pyx_v_step;
18686         for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {
18687
18688           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1082
18689  *                 slicelength = slicelength - 1
18690  *                 for i from 0 <= i < step:
18691  *                     c_node = next_element(c_node)             # <<<<<<<<<<<<<<
18692  *                 if c_node is NULL:
18693  *                     break
18694  */
18695           __pyx_v_c_node = __pyx_v_next_element(__pyx_v_c_node);
18696         }
18697
18698         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1083
18699  *                 for i from 0 <= i < step:
18700  *                     c_node = next_element(c_node)
18701  *                 if c_node is NULL:             # <<<<<<<<<<<<<<
18702  *                     break
18703  *         else:
18704  */
18705         __pyx_t_1 = (__pyx_v_c_node == NULL);
18706         if (__pyx_t_1) {
18707
18708           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1084
18709  *                     c_node = next_element(c_node)
18710  *                 if c_node is NULL:
18711  *                     break             # <<<<<<<<<<<<<<
18712  *         else:
18713  *             # everything inserted
18714  */
18715           goto __pyx_L28_break;
18716           goto __pyx_L32;
18717         }
18718         __pyx_L32:;
18719         goto __pyx_L29;
18720       }
18721       __pyx_L29:;
18722     }
18723     /*else*/ {
18724
18725       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1087
18726  *         else:
18727  *             # everything inserted
18728  *             return 0             # <<<<<<<<<<<<<<
18729  * 
18730  *     # append the remaining elements at the respective end
18731  */
18732       __pyx_r = 0;
18733       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18734       goto __pyx_L0;
18735     }
18736     __pyx_L28_break:;
18737     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18738     goto __pyx_L26;
18739   }
18740   __pyx_L26:;
18741
18742   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1090
18743  * 
18744  *     # append the remaining elements at the respective end
18745  *     if left_to_right:             # <<<<<<<<<<<<<<
18746  *         for element in elements:
18747  *             assert element is not None, u"Node must not be None"
18748  */
18749   __pyx_t_1 = __pyx_v_left_to_right;
18750   if (__pyx_t_1) {
18751
18752     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1091
18753  *     # append the remaining elements at the respective end
18754  *     if left_to_right:
18755  *         for element in elements:             # <<<<<<<<<<<<<<
18756  *             assert element is not None, u"Node must not be None"
18757  *             _appendChild(parent, element)
18758  */
18759     if (PyList_CheckExact(__pyx_v_elements) || PyTuple_CheckExact(__pyx_v_elements)) {
18760       __pyx_t_4 = 0; __pyx_t_2 = __pyx_v_elements; __Pyx_INCREF(__pyx_t_2);
18761     } else {
18762       __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18763       __Pyx_GOTREF(__pyx_t_2);
18764     }
18765     for (;;) {
18766       if (likely(PyList_CheckExact(__pyx_t_2))) {
18767         if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
18768         __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
18769       } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
18770         if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
18771         __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
18772       } else {
18773         __pyx_t_5 = PyIter_Next(__pyx_t_2);
18774         if (!__pyx_t_5) {
18775           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18776           break;
18777         }
18778         __Pyx_GOTREF(__pyx_t_5);
18779       }
18780       if (!(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18781       __Pyx_DECREF(((PyObject *)__pyx_v_element));
18782       __pyx_v_element = ((struct LxmlElement *)__pyx_t_5);
18783       __pyx_t_5 = 0;
18784
18785       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1092
18786  *     if left_to_right:
18787  *         for element in elements:
18788  *             assert element is not None, u"Node must not be None"             # <<<<<<<<<<<<<<
18789  *             _appendChild(parent, element)
18790  *     else:
18791  */
18792       #ifndef PYREX_WITHOUT_ASSERTIONS
18793       __pyx_t_1 = (((PyObject *)__pyx_v_element) != Py_None);
18794       if (unlikely(!__pyx_t_1)) {
18795         PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_253));
18796         {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18797       }
18798       #endif
18799
18800       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1093
18801  *         for element in elements:
18802  *             assert element is not None, u"Node must not be None"
18803  *             _appendChild(parent, element)             # <<<<<<<<<<<<<<
18804  *     else:
18805  *         for element in elements:
18806  */
18807       __pyx_t_6 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_parent, __pyx_v_element); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18808     }
18809     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18810     goto __pyx_L33;
18811   }
18812   /*else*/ {
18813
18814     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1095
18815  *             _appendChild(parent, element)
18816  *     else:
18817  *         for element in elements:             # <<<<<<<<<<<<<<
18818  *             assert element is not None, u"Node must not be None"
18819  *             _prependChild(parent, element)
18820  */
18821     if (PyList_CheckExact(__pyx_v_elements) || PyTuple_CheckExact(__pyx_v_elements)) {
18822       __pyx_t_4 = 0; __pyx_t_2 = __pyx_v_elements; __Pyx_INCREF(__pyx_t_2);
18823     } else {
18824       __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18825       __Pyx_GOTREF(__pyx_t_2);
18826     }
18827     for (;;) {
18828       if (likely(PyList_CheckExact(__pyx_t_2))) {
18829         if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
18830         __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
18831       } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
18832         if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
18833         __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
18834       } else {
18835         __pyx_t_5 = PyIter_Next(__pyx_t_2);
18836         if (!__pyx_t_5) {
18837           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18838           break;
18839         }
18840         __Pyx_GOTREF(__pyx_t_5);
18841       }
18842       if (!(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18843       __Pyx_DECREF(((PyObject *)__pyx_v_element));
18844       __pyx_v_element = ((struct LxmlElement *)__pyx_t_5);
18845       __pyx_t_5 = 0;
18846
18847       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1096
18848  *     else:
18849  *         for element in elements:
18850  *             assert element is not None, u"Node must not be None"             # <<<<<<<<<<<<<<
18851  *             _prependChild(parent, element)
18852  * 
18853  */
18854       #ifndef PYREX_WITHOUT_ASSERTIONS
18855       __pyx_t_1 = (((PyObject *)__pyx_v_element) != Py_None);
18856       if (unlikely(!__pyx_t_1)) {
18857         PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_254));
18858         {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18859       }
18860       #endif
18861
18862       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1097
18863  *         for element in elements:
18864  *             assert element is not None, u"Node must not be None"
18865  *             _prependChild(parent, element)             # <<<<<<<<<<<<<<
18866  * 
18867  *     return 0
18868  */
18869       __pyx_t_6 = __pyx_f_4lxml_5etree__prependChild(__pyx_v_parent, __pyx_v_element); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18870     }
18871     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18872   }
18873   __pyx_L33:;
18874
18875   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1099
18876  *             _prependChild(parent, element)
18877  * 
18878  *     return 0             # <<<<<<<<<<<<<<
18879  * 
18880  * cdef int _appendChild(_Element parent, _Element child) except -1:
18881  */
18882   __pyx_r = 0;
18883   goto __pyx_L0;
18884
18885   __pyx_r = 0;
18886   goto __pyx_L0;
18887   __pyx_L1_error:;
18888   __Pyx_XDECREF(__pyx_t_2);
18889   __Pyx_XDECREF(__pyx_t_3);
18890   __Pyx_XDECREF(__pyx_t_5);
18891   __Pyx_AddTraceback("lxml.etree._replaceSlice");
18892   __pyx_r = -1;
18893   __pyx_L0:;
18894   __Pyx_DECREF((PyObject *)__pyx_v_element);
18895   __Pyx_DECREF(__pyx_v_elements);
18896   __Pyx_FinishRefcountContext();
18897   return __pyx_r;
18898 }
18899
18900 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1101
18901  *     return 0
18902  * 
18903  * cdef int _appendChild(_Element parent, _Element child) except -1:             # <<<<<<<<<<<<<<
18904  *     u"""Append a new child to a parent element.
18905  *     """
18906  */
18907
18908 static  int __pyx_f_4lxml_5etree__appendChild(struct LxmlElement *__pyx_v_parent, struct LxmlElement *__pyx_v_child) {
18909   xmlNode *__pyx_v_c_next;
18910   xmlNode *__pyx_v_c_node;
18911   xmlDoc *__pyx_v_c_source_doc;
18912   int __pyx_r;
18913   int __pyx_t_1;
18914   __Pyx_SetupRefcountContext("_appendChild");
18915
18916   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1107
18917  *     cdef xmlNode* c_node
18918  *     cdef xmlDoc* c_source_doc
18919  *     c_node = child._c_node             # <<<<<<<<<<<<<<
18920  *     c_source_doc = c_node.doc
18921  *     # store possible text node
18922  */
18923   __pyx_v_c_node = __pyx_v_child->_c_node;
18924
18925   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1108
18926  *     cdef xmlDoc* c_source_doc
18927  *     c_node = child._c_node
18928  *     c_source_doc = c_node.doc             # <<<<<<<<<<<<<<
18929  *     # store possible text node
18930  *     c_next = c_node.next
18931  */
18932   __pyx_v_c_source_doc = __pyx_v_c_node->doc;
18933
18934   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1110
18935  *     c_source_doc = c_node.doc
18936  *     # store possible text node
18937  *     c_next = c_node.next             # <<<<<<<<<<<<<<
18938  *     # move node itself
18939  *     tree.xmlUnlinkNode(c_node)
18940  */
18941   __pyx_v_c_next = __pyx_v_c_node->next;
18942
18943   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1112
18944  *     c_next = c_node.next
18945  *     # move node itself
18946  *     tree.xmlUnlinkNode(c_node)             # <<<<<<<<<<<<<<
18947  *     tree.xmlAddChild(parent._c_node, c_node)
18948  *     _moveTail(c_next, c_node)
18949  */
18950   xmlUnlinkNode(__pyx_v_c_node);
18951
18952   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1113
18953  *     # move node itself
18954  *     tree.xmlUnlinkNode(c_node)
18955  *     tree.xmlAddChild(parent._c_node, c_node)             # <<<<<<<<<<<<<<
18956  *     _moveTail(c_next, c_node)
18957  *     # uh oh, elements may be pointing to different doc when
18958  */
18959   xmlAddChild(__pyx_v_parent->_c_node, __pyx_v_c_node);
18960
18961   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1114
18962  *     tree.xmlUnlinkNode(c_node)
18963  *     tree.xmlAddChild(parent._c_node, c_node)
18964  *     _moveTail(c_next, c_node)             # <<<<<<<<<<<<<<
18965  *     # uh oh, elements may be pointing to different doc when
18966  *     # parent element has moved; change them too..
18967  */
18968   __pyx_f_4lxml_5etree__moveTail(__pyx_v_c_next, __pyx_v_c_node);
18969
18970   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1117
18971  *     # uh oh, elements may be pointing to different doc when
18972  *     # parent element has moved; change them too..
18973  *     moveNodeToDocument(parent._doc, c_source_doc, c_node)             # <<<<<<<<<<<<<<
18974  * 
18975  * cdef int _prependChild(_Element parent, _Element child) except -1:
18976  */
18977   __pyx_t_1 = __pyx_f_4lxml_5etree_moveNodeToDocument(__pyx_v_parent->_doc, __pyx_v_c_source_doc, __pyx_v_c_node); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18978
18979   __pyx_r = 0;
18980   goto __pyx_L0;
18981   __pyx_L1_error:;
18982   __Pyx_AddTraceback("lxml.etree._appendChild");
18983   __pyx_r = -1;
18984   __pyx_L0:;
18985   __Pyx_FinishRefcountContext();
18986   return __pyx_r;
18987 }
18988
18989 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1119
18990  *     moveNodeToDocument(parent._doc, c_source_doc, c_node)
18991  * 
18992  * cdef int _prependChild(_Element parent, _Element child) except -1:             # <<<<<<<<<<<<<<
18993  *     u"""Prepend a new child to a parent element.
18994  *     """
18995  */
18996
18997 static  int __pyx_f_4lxml_5etree__prependChild(struct LxmlElement *__pyx_v_parent, struct LxmlElement *__pyx_v_child) {
18998   xmlNode *__pyx_v_c_next;
18999   xmlNode *__pyx_v_c_child;
19000   xmlNode *__pyx_v_c_node;
19001   xmlDoc *__pyx_v_c_source_doc;
19002   int __pyx_r;
19003   int __pyx_t_1;
19004   int __pyx_t_2;
19005   __Pyx_SetupRefcountContext("_prependChild");
19006
19007   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1126
19008  *     cdef xmlNode* c_node
19009  *     cdef xmlDoc* c_source_doc
19010  *     c_node = child._c_node             # <<<<<<<<<<<<<<
19011  *     c_source_doc = c_node.doc
19012  *     # store possible text node
19013  */
19014   __pyx_v_c_node = __pyx_v_child->_c_node;
19015
19016   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1127
19017  *     cdef xmlDoc* c_source_doc
19018  *     c_node = child._c_node
19019  *     c_source_doc = c_node.doc             # <<<<<<<<<<<<<<
19020  *     # store possible text node
19021  *     c_next = c_node.next
19022  */
19023   __pyx_v_c_source_doc = __pyx_v_c_node->doc;
19024
19025   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1129
19026  *     c_source_doc = c_node.doc
19027  *     # store possible text node
19028  *     c_next = c_node.next             # <<<<<<<<<<<<<<
19029  *     # move node itself
19030  *     c_child = _findChildForwards(parent._c_node, 0)
19031  */
19032   __pyx_v_c_next = __pyx_v_c_node->next;
19033
19034   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1131
19035  *     c_next = c_node.next
19036  *     # move node itself
19037  *     c_child = _findChildForwards(parent._c_node, 0)             # <<<<<<<<<<<<<<
19038  *     if c_child is NULL:
19039  *         tree.xmlUnlinkNode(c_node)
19040  */
19041   __pyx_v_c_child = __pyx_f_4lxml_5etree__findChildForwards(__pyx_v_parent->_c_node, 0);
19042
19043   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1132
19044  *     # move node itself
19045  *     c_child = _findChildForwards(parent._c_node, 0)
19046  *     if c_child is NULL:             # <<<<<<<<<<<<<<
19047  *         tree.xmlUnlinkNode(c_node)
19048  *         tree.xmlAddChild(parent._c_node, c_node)
19049  */
19050   __pyx_t_1 = (__pyx_v_c_child == NULL);
19051   if (__pyx_t_1) {
19052
19053     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1133
19054  *     c_child = _findChildForwards(parent._c_node, 0)
19055  *     if c_child is NULL:
19056  *         tree.xmlUnlinkNode(c_node)             # <<<<<<<<<<<<<<
19057  *         tree.xmlAddChild(parent._c_node, c_node)
19058  *     else:
19059  */
19060     xmlUnlinkNode(__pyx_v_c_node);
19061
19062     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1134
19063  *     if c_child is NULL:
19064  *         tree.xmlUnlinkNode(c_node)
19065  *         tree.xmlAddChild(parent._c_node, c_node)             # <<<<<<<<<<<<<<
19066  *     else:
19067  *         tree.xmlAddPrevSibling(c_child, c_node)
19068  */
19069     xmlAddChild(__pyx_v_parent->_c_node, __pyx_v_c_node);
19070     goto __pyx_L3;
19071   }
19072   /*else*/ {
19073
19074     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1136
19075  *         tree.xmlAddChild(parent._c_node, c_node)
19076  *     else:
19077  *         tree.xmlAddPrevSibling(c_child, c_node)             # <<<<<<<<<<<<<<
19078  *     _moveTail(c_next, c_node)
19079  *     # uh oh, elements may be pointing to different doc when
19080  */
19081     xmlAddPrevSibling(__pyx_v_c_child, __pyx_v_c_node);
19082   }
19083   __pyx_L3:;
19084
19085   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1137
19086  *     else:
19087  *         tree.xmlAddPrevSibling(c_child, c_node)
19088  *     _moveTail(c_next, c_node)             # <<<<<<<<<<<<<<
19089  *     # uh oh, elements may be pointing to different doc when
19090  *     # parent element has moved; change them too..
19091  */
19092   __pyx_f_4lxml_5etree__moveTail(__pyx_v_c_next, __pyx_v_c_node);
19093
19094   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1140
19095  *     # uh oh, elements may be pointing to different doc when
19096  *     # parent element has moved; change them too..
19097  *     moveNodeToDocument(parent._doc, c_source_doc, c_node)             # <<<<<<<<<<<<<<
19098  * 
19099  * cdef int _appendSibling(_Element element, _Element sibling) except -1:
19100  */
19101   __pyx_t_2 = __pyx_f_4lxml_5etree_moveNodeToDocument(__pyx_v_parent->_doc, __pyx_v_c_source_doc, __pyx_v_c_node); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19102
19103   __pyx_r = 0;
19104   goto __pyx_L0;
19105   __pyx_L1_error:;
19106   __Pyx_AddTraceback("lxml.etree._prependChild");
19107   __pyx_r = -1;
19108   __pyx_L0:;
19109   __Pyx_FinishRefcountContext();
19110   return __pyx_r;
19111 }
19112
19113 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1142
19114  *     moveNodeToDocument(parent._doc, c_source_doc, c_node)
19115  * 
19116  * cdef int _appendSibling(_Element element, _Element sibling) except -1:             # <<<<<<<<<<<<<<
19117  *     u"""Append a new child to a parent element.
19118  *     """
19119  */
19120
19121 static  int __pyx_f_4lxml_5etree__appendSibling(struct LxmlElement *__pyx_v_element, struct LxmlElement *__pyx_v_sibling) {
19122   xmlNode *__pyx_v_c_next;
19123   xmlNode *__pyx_v_c_node;
19124   xmlDoc *__pyx_v_c_source_doc;
19125   int __pyx_r;
19126   int __pyx_t_1;
19127   __Pyx_SetupRefcountContext("_appendSibling");
19128
19129   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1148
19130  *     cdef xmlNode* c_node
19131  *     cdef xmlDoc* c_source_doc
19132  *     c_node = sibling._c_node             # <<<<<<<<<<<<<<
19133  *     c_source_doc = c_node.doc
19134  *     # store possible text node
19135  */
19136   __pyx_v_c_node = __pyx_v_sibling->_c_node;
19137
19138   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1149
19139  *     cdef xmlDoc* c_source_doc
19140  *     c_node = sibling._c_node
19141  *     c_source_doc = c_node.doc             # <<<<<<<<<<<<<<
19142  *     # store possible text node
19143  *     c_next = c_node.next
19144  */
19145   __pyx_v_c_source_doc = __pyx_v_c_node->doc;
19146
19147   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1151
19148  *     c_source_doc = c_node.doc
19149  *     # store possible text node
19150  *     c_next = c_node.next             # <<<<<<<<<<<<<<
19151  *     # move node itself
19152  *     tree.xmlAddNextSibling(element._c_node, c_node)
19153  */
19154   __pyx_v_c_next = __pyx_v_c_node->next;
19155
19156   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1153
19157  *     c_next = c_node.next
19158  *     # move node itself
19159  *     tree.xmlAddNextSibling(element._c_node, c_node)             # <<<<<<<<<<<<<<
19160  *     _moveTail(c_next, c_node)
19161  *     # uh oh, elements may be pointing to different doc when
19162  */
19163   xmlAddNextSibling(__pyx_v_element->_c_node, __pyx_v_c_node);
19164
19165   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1154
19166  *     # move node itself
19167  *     tree.xmlAddNextSibling(element._c_node, c_node)
19168  *     _moveTail(c_next, c_node)             # <<<<<<<<<<<<<<
19169  *     # uh oh, elements may be pointing to different doc when
19170  *     # parent element has moved; change them too..
19171  */
19172   __pyx_f_4lxml_5etree__moveTail(__pyx_v_c_next, __pyx_v_c_node);
19173
19174   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1157
19175  *     # uh oh, elements may be pointing to different doc when
19176  *     # parent element has moved; change them too..
19177  *     moveNodeToDocument(element._doc, c_source_doc, c_node)             # <<<<<<<<<<<<<<
19178  * 
19179  * cdef int _prependSibling(_Element element, _Element sibling) except -1:
19180  */
19181   __pyx_t_1 = __pyx_f_4lxml_5etree_moveNodeToDocument(__pyx_v_element->_doc, __pyx_v_c_source_doc, __pyx_v_c_node); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19182
19183   __pyx_r = 0;
19184   goto __pyx_L0;
19185   __pyx_L1_error:;
19186   __Pyx_AddTraceback("lxml.etree._appendSibling");
19187   __pyx_r = -1;
19188   __pyx_L0:;
19189   __Pyx_FinishRefcountContext();
19190   return __pyx_r;
19191 }
19192
19193 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1159
19194  *     moveNodeToDocument(element._doc, c_source_doc, c_node)
19195  * 
19196  * cdef int _prependSibling(_Element element, _Element sibling) except -1:             # <<<<<<<<<<<<<<
19197  *     u"""Append a new child to a parent element.
19198  *     """
19199  */
19200
19201 static  int __pyx_f_4lxml_5etree__prependSibling(struct LxmlElement *__pyx_v_element, struct LxmlElement *__pyx_v_sibling) {
19202   xmlNode *__pyx_v_c_next;
19203   xmlNode *__pyx_v_c_node;
19204   xmlDoc *__pyx_v_c_source_doc;
19205   int __pyx_r;
19206   int __pyx_t_1;
19207   __Pyx_SetupRefcountContext("_prependSibling");
19208
19209   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1165
19210  *     cdef xmlNode* c_node
19211  *     cdef xmlDoc* c_source_doc
19212  *     c_node = sibling._c_node             # <<<<<<<<<<<<<<
19213  *     c_source_doc = c_node.doc
19214  *     # store possible text node
19215  */
19216   __pyx_v_c_node = __pyx_v_sibling->_c_node;
19217
19218   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1166
19219  *     cdef xmlDoc* c_source_doc
19220  *     c_node = sibling._c_node
19221  *     c_source_doc = c_node.doc             # <<<<<<<<<<<<<<
19222  *     # store possible text node
19223  *     c_next = c_node.next
19224  */
19225   __pyx_v_c_source_doc = __pyx_v_c_node->doc;
19226
19227   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1168
19228  *     c_source_doc = c_node.doc
19229  *     # store possible text node
19230  *     c_next = c_node.next             # <<<<<<<<<<<<<<
19231  *     # move node itself
19232  *     tree.xmlAddPrevSibling(element._c_node, c_node)
19233  */
19234   __pyx_v_c_next = __pyx_v_c_node->next;
19235
19236   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1170
19237  *     c_next = c_node.next
19238  *     # move node itself
19239  *     tree.xmlAddPrevSibling(element._c_node, c_node)             # <<<<<<<<<<<<<<
19240  *     _moveTail(c_next, c_node)
19241  *     # uh oh, elements may be pointing to different doc when
19242  */
19243   xmlAddPrevSibling(__pyx_v_element->_c_node, __pyx_v_c_node);
19244
19245   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1171
19246  *     # move node itself
19247  *     tree.xmlAddPrevSibling(element._c_node, c_node)
19248  *     _moveTail(c_next, c_node)             # <<<<<<<<<<<<<<
19249  *     # uh oh, elements may be pointing to different doc when
19250  *     # parent element has moved; change them too..
19251  */
19252   __pyx_f_4lxml_5etree__moveTail(__pyx_v_c_next, __pyx_v_c_node);
19253
19254   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1174
19255  *     # uh oh, elements may be pointing to different doc when
19256  *     # parent element has moved; change them too..
19257  *     moveNodeToDocument(element._doc, c_source_doc, c_node)             # <<<<<<<<<<<<<<
19258  * 
19259  * cdef inline int isutf8(char* s):
19260  */
19261   __pyx_t_1 = __pyx_f_4lxml_5etree_moveNodeToDocument(__pyx_v_element->_doc, __pyx_v_c_source_doc, __pyx_v_c_node); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19262
19263   __pyx_r = 0;
19264   goto __pyx_L0;
19265   __pyx_L1_error:;
19266   __Pyx_AddTraceback("lxml.etree._prependSibling");
19267   __pyx_r = -1;
19268   __pyx_L0:;
19269   __Pyx_FinishRefcountContext();
19270   return __pyx_r;
19271 }
19272
19273 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1176
19274  *     moveNodeToDocument(element._doc, c_source_doc, c_node)
19275  * 
19276  * cdef inline int isutf8(char* s):             # <<<<<<<<<<<<<<
19277  *     cdef char c
19278  *     c = s[0]
19279  */
19280
19281 static INLINE int __pyx_f_4lxml_5etree_isutf8(char *__pyx_v_s) {
19282   char __pyx_v_c;
19283   int __pyx_r;
19284   int __pyx_t_1;
19285   long __pyx_t_2;
19286   __Pyx_SetupRefcountContext("isutf8");
19287
19288   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1178
19289  * cdef inline int isutf8(char* s):
19290  *     cdef char c
19291  *     c = s[0]             # <<<<<<<<<<<<<<
19292  *     while c != c'\0':
19293  *         if c & 0x80:
19294  */
19295   __pyx_v_c = (__pyx_v_s[0]);
19296
19297   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1179
19298  *     cdef char c
19299  *     c = s[0]
19300  *     while c != c'\0':             # <<<<<<<<<<<<<<
19301  *         if c & 0x80:
19302  *             return 1
19303  */
19304   while (1) {
19305     __pyx_t_1 = (__pyx_v_c != '\x00');
19306     if (!__pyx_t_1) break;
19307
19308     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1180
19309  *     c = s[0]
19310  *     while c != c'\0':
19311  *         if c & 0x80:             # <<<<<<<<<<<<<<
19312  *             return 1
19313  *         s = s + 1
19314  */
19315     __pyx_t_2 = (__pyx_v_c & 0x80);
19316     if (__pyx_t_2) {
19317
19318       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1181
19319  *     while c != c'\0':
19320  *         if c & 0x80:
19321  *             return 1             # <<<<<<<<<<<<<<
19322  *         s = s + 1
19323  *         c = s[0]
19324  */
19325       __pyx_r = 1;
19326       goto __pyx_L0;
19327       goto __pyx_L5;
19328     }
19329     __pyx_L5:;
19330
19331     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1182
19332  *         if c & 0x80:
19333  *             return 1
19334  *         s = s + 1             # <<<<<<<<<<<<<<
19335  *         c = s[0]
19336  *     return 0
19337  */
19338     __pyx_v_s = (__pyx_v_s + 1);
19339
19340     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1183
19341  *             return 1
19342  *         s = s + 1
19343  *         c = s[0]             # <<<<<<<<<<<<<<
19344  *     return 0
19345  * 
19346  */
19347     __pyx_v_c = (__pyx_v_s[0]);
19348   }
19349
19350   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1184
19351  *         s = s + 1
19352  *         c = s[0]
19353  *     return 0             # <<<<<<<<<<<<<<
19354  * 
19355  * cdef int check_string_utf8(pystring):
19356  */
19357   __pyx_r = 0;
19358   goto __pyx_L0;
19359
19360   __pyx_r = 0;
19361   __pyx_L0:;
19362   __Pyx_FinishRefcountContext();
19363   return __pyx_r;
19364 }
19365
19366 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1186
19367  *     return 0
19368  * 
19369  * cdef int check_string_utf8(pystring):             # <<<<<<<<<<<<<<
19370  *     u"""Check if a string looks like valid UTF-8 XML content.  Returns 0
19371  *     for ASCII, 1 for UTF-8 and -1 in the case of errors, such as NULL
19372  */
19373
19374 static  int __pyx_f_4lxml_5etree_check_string_utf8(PyObject *__pyx_v_pystring) {
19375   char *__pyx_v_s;
19376   char *__pyx_v_c_end;
19377   int __pyx_v_is_non_ascii;
19378   int __pyx_r;
19379   int __pyx_t_1;
19380   long __pyx_t_2;
19381   __Pyx_SetupRefcountContext("check_string_utf8");
19382
19383   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1195
19384  *     cdef char c
19385  *     cdef bint is_non_ascii
19386  *     s = _cstr(pystring)             # <<<<<<<<<<<<<<
19387  *     c_end = s + python.PyString_GET_SIZE(pystring)
19388  *     is_non_ascii = 0
19389  */
19390   __pyx_v_s = PyString_AS_STRING(__pyx_v_pystring);
19391
19392   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1196
19393  *     cdef bint is_non_ascii
19394  *     s = _cstr(pystring)
19395  *     c_end = s + python.PyString_GET_SIZE(pystring)             # <<<<<<<<<<<<<<
19396  *     is_non_ascii = 0
19397  *     while s < c_end:
19398  */
19399   __pyx_v_c_end = (__pyx_v_s + PyString_GET_SIZE(__pyx_v_pystring));
19400
19401   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1197
19402  *     s = _cstr(pystring)
19403  *     c_end = s + python.PyString_GET_SIZE(pystring)
19404  *     is_non_ascii = 0             # <<<<<<<<<<<<<<
19405  *     while s < c_end:
19406  *         if s[0] & 0x80:
19407  */
19408   __pyx_v_is_non_ascii = 0;
19409
19410   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1198
19411  *     c_end = s + python.PyString_GET_SIZE(pystring)
19412  *     is_non_ascii = 0
19413  *     while s < c_end:             # <<<<<<<<<<<<<<
19414  *         if s[0] & 0x80:
19415  *             # skip the entire multi byte sequence
19416  */
19417   while (1) {
19418     __pyx_t_1 = (__pyx_v_s < __pyx_v_c_end);
19419     if (!__pyx_t_1) break;
19420
19421     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1199
19422  *     is_non_ascii = 0
19423  *     while s < c_end:
19424  *         if s[0] & 0x80:             # <<<<<<<<<<<<<<
19425  *             # skip the entire multi byte sequence
19426  *             while s[0] & 0x80:
19427  */
19428     __pyx_t_2 = ((__pyx_v_s[0]) & 0x80);
19429     if (__pyx_t_2) {
19430
19431       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1201
19432  *         if s[0] & 0x80:
19433  *             # skip the entire multi byte sequence
19434  *             while s[0] & 0x80:             # <<<<<<<<<<<<<<
19435  *                 s += 1
19436  *             is_non_ascii = 1
19437  */
19438       while (1) {
19439         __pyx_t_2 = ((__pyx_v_s[0]) & 0x80);
19440         if (!__pyx_t_2) break;
19441
19442         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1202
19443  *             # skip the entire multi byte sequence
19444  *             while s[0] & 0x80:
19445  *                 s += 1             # <<<<<<<<<<<<<<
19446  *             is_non_ascii = 1
19447  *         elif not tree.xmlIsChar_ch(s[0]):
19448  */
19449         __pyx_v_s += 1;
19450       }
19451
19452       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1203
19453  *             while s[0] & 0x80:
19454  *                 s += 1
19455  *             is_non_ascii = 1             # <<<<<<<<<<<<<<
19456  *         elif not tree.xmlIsChar_ch(s[0]):
19457  *             return -1 # invalid!
19458  */
19459       __pyx_v_is_non_ascii = 1;
19460       goto __pyx_L5;
19461     }
19462
19463     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1204
19464  *                 s += 1
19465  *             is_non_ascii = 1
19466  *         elif not tree.xmlIsChar_ch(s[0]):             # <<<<<<<<<<<<<<
19467  *             return -1 # invalid!
19468  *         s += 1
19469  */
19470     __pyx_t_1 = (!xmlIsChar_ch((__pyx_v_s[0])));
19471     if (__pyx_t_1) {
19472
19473       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1205
19474  *             is_non_ascii = 1
19475  *         elif not tree.xmlIsChar_ch(s[0]):
19476  *             return -1 # invalid!             # <<<<<<<<<<<<<<
19477  *         s += 1
19478  *     return is_non_ascii
19479  */
19480       __pyx_r = -1;
19481       goto __pyx_L0;
19482       goto __pyx_L5;
19483     }
19484     __pyx_L5:;
19485
19486     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1206
19487  *         elif not tree.xmlIsChar_ch(s[0]):
19488  *             return -1 # invalid!
19489  *         s += 1             # <<<<<<<<<<<<<<
19490  *     return is_non_ascii
19491  * 
19492  */
19493     __pyx_v_s += 1;
19494   }
19495
19496   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1207
19497  *             return -1 # invalid!
19498  *         s += 1
19499  *     return is_non_ascii             # <<<<<<<<<<<<<<
19500  * 
19501  * cdef object funicode(char* s):
19502  */
19503   __pyx_r = __pyx_v_is_non_ascii;
19504   goto __pyx_L0;
19505
19506   __pyx_r = 0;
19507   __pyx_L0:;
19508   __Pyx_FinishRefcountContext();
19509   return __pyx_r;
19510 }
19511
19512 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1209
19513  *     return is_non_ascii
19514  * 
19515  * cdef object funicode(char* s):             # <<<<<<<<<<<<<<
19516  *     cdef Py_ssize_t slen
19517  *     cdef char* spos
19518  */
19519
19520 static  PyObject *__pyx_f_4lxml_5etree_funicode(char *__pyx_v_s) {
19521   Py_ssize_t __pyx_v_slen;
19522   char *__pyx_v_spos;
19523   int __pyx_v_is_non_ascii;
19524   PyObject *__pyx_r = NULL;
19525   int __pyx_t_1;
19526   PyObject *__pyx_t_2 = NULL;
19527   long __pyx_t_3;
19528   __Pyx_SetupRefcountContext("funicode");
19529
19530   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1213
19531  *     cdef char* spos
19532  *     cdef bint is_non_ascii
19533  *     if python.IS_PYTHON3:             # <<<<<<<<<<<<<<
19534  *         slen = cstd.strlen(s)
19535  *         return python.PyUnicode_DecodeUTF8(s, slen, NULL)
19536  */
19537   __pyx_t_1 = IS_PYTHON3;
19538   if (__pyx_t_1) {
19539
19540     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1214
19541  *     cdef bint is_non_ascii
19542  *     if python.IS_PYTHON3:
19543  *         slen = cstd.strlen(s)             # <<<<<<<<<<<<<<
19544  *         return python.PyUnicode_DecodeUTF8(s, slen, NULL)
19545  *     spos = s
19546  */
19547     __pyx_v_slen = strlen(__pyx_v_s);
19548
19549     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1215
19550  *     if python.IS_PYTHON3:
19551  *         slen = cstd.strlen(s)
19552  *         return python.PyUnicode_DecodeUTF8(s, slen, NULL)             # <<<<<<<<<<<<<<
19553  *     spos = s
19554  *     is_non_ascii = 0
19555  */
19556     __Pyx_XDECREF(__pyx_r);
19557     __pyx_t_2 = PyUnicode_DecodeUTF8(__pyx_v_s, __pyx_v_slen, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19558     __Pyx_GOTREF(__pyx_t_2);
19559     __pyx_r = __pyx_t_2;
19560     __pyx_t_2 = 0;
19561     goto __pyx_L0;
19562     goto __pyx_L3;
19563   }
19564   __pyx_L3:;
19565
19566   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1216
19567  *         slen = cstd.strlen(s)
19568  *         return python.PyUnicode_DecodeUTF8(s, slen, NULL)
19569  *     spos = s             # <<<<<<<<<<<<<<
19570  *     is_non_ascii = 0
19571  *     while spos[0] != c'\0':
19572  */
19573   __pyx_v_spos = __pyx_v_s;
19574
19575   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1217
19576  *         return python.PyUnicode_DecodeUTF8(s, slen, NULL)
19577  *     spos = s
19578  *     is_non_ascii = 0             # <<<<<<<<<<<<<<
19579  *     while spos[0] != c'\0':
19580  *         if spos[0] & 0x80:
19581  */
19582   __pyx_v_is_non_ascii = 0;
19583
19584   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1218
19585  *     spos = s
19586  *     is_non_ascii = 0
19587  *     while spos[0] != c'\0':             # <<<<<<<<<<<<<<
19588  *         if spos[0] & 0x80:
19589  *             is_non_ascii = 1
19590  */
19591   while (1) {
19592     __pyx_t_1 = ((__pyx_v_spos[0]) != '\x00');
19593     if (!__pyx_t_1) break;
19594
19595     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1219
19596  *     is_non_ascii = 0
19597  *     while spos[0] != c'\0':
19598  *         if spos[0] & 0x80:             # <<<<<<<<<<<<<<
19599  *             is_non_ascii = 1
19600  *             break
19601  */
19602     __pyx_t_3 = ((__pyx_v_spos[0]) & 0x80);
19603     if (__pyx_t_3) {
19604
19605       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1220
19606  *     while spos[0] != c'\0':
19607  *         if spos[0] & 0x80:
19608  *             is_non_ascii = 1             # <<<<<<<<<<<<<<
19609  *             break
19610  *         spos += 1
19611  */
19612       __pyx_v_is_non_ascii = 1;
19613
19614       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1221
19615  *         if spos[0] & 0x80:
19616  *             is_non_ascii = 1
19617  *             break             # <<<<<<<<<<<<<<
19618  *         spos += 1
19619  *     while spos[0] != c'\0':
19620  */
19621       goto __pyx_L5_break;
19622       goto __pyx_L6;
19623     }
19624     __pyx_L6:;
19625
19626     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1222
19627  *             is_non_ascii = 1
19628  *             break
19629  *         spos += 1             # <<<<<<<<<<<<<<
19630  *     while spos[0] != c'\0':
19631  *         spos += 1
19632  */
19633     __pyx_v_spos += 1;
19634   }
19635   __pyx_L5_break:;
19636
19637   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1223
19638  *             break
19639  *         spos += 1
19640  *     while spos[0] != c'\0':             # <<<<<<<<<<<<<<
19641  *         spos += 1
19642  *     slen = spos - s
19643  */
19644   while (1) {
19645     __pyx_t_1 = ((__pyx_v_spos[0]) != '\x00');
19646     if (!__pyx_t_1) break;
19647
19648     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1224
19649  *         spos += 1
19650  *     while spos[0] != c'\0':
19651  *         spos += 1             # <<<<<<<<<<<<<<
19652  *     slen = spos - s
19653  *     if is_non_ascii:
19654  */
19655     __pyx_v_spos += 1;
19656   }
19657
19658   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1225
19659  *     while spos[0] != c'\0':
19660  *         spos += 1
19661  *     slen = spos - s             # <<<<<<<<<<<<<<
19662  *     if is_non_ascii:
19663  *         return python.PyUnicode_DecodeUTF8(s, slen, NULL)
19664  */
19665   __pyx_v_slen = (__pyx_v_spos - __pyx_v_s);
19666
19667   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1226
19668  *         spos += 1
19669  *     slen = spos - s
19670  *     if is_non_ascii:             # <<<<<<<<<<<<<<
19671  *         return python.PyUnicode_DecodeUTF8(s, slen, NULL)
19672  *     return python.PyString_FromStringAndSize(s, slen)
19673  */
19674   __pyx_t_1 = __pyx_v_is_non_ascii;
19675   if (__pyx_t_1) {
19676
19677     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1227
19678  *     slen = spos - s
19679  *     if is_non_ascii:
19680  *         return python.PyUnicode_DecodeUTF8(s, slen, NULL)             # <<<<<<<<<<<<<<
19681  *     return python.PyString_FromStringAndSize(s, slen)
19682  * 
19683  */
19684     __Pyx_XDECREF(__pyx_r);
19685     __pyx_t_2 = PyUnicode_DecodeUTF8(__pyx_v_s, __pyx_v_slen, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19686     __Pyx_GOTREF(__pyx_t_2);
19687     __pyx_r = __pyx_t_2;
19688     __pyx_t_2 = 0;
19689     goto __pyx_L0;
19690     goto __pyx_L9;
19691   }
19692   __pyx_L9:;
19693
19694   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1228
19695  *     if is_non_ascii:
19696  *         return python.PyUnicode_DecodeUTF8(s, slen, NULL)
19697  *     return python.PyString_FromStringAndSize(s, slen)             # <<<<<<<<<<<<<<
19698  * 
19699  * cdef object _utf8(object s):
19700  */
19701   __Pyx_XDECREF(__pyx_r);
19702   __pyx_t_2 = PyString_FromStringAndSize(__pyx_v_s, __pyx_v_slen); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19703   __Pyx_GOTREF(__pyx_t_2);
19704   __pyx_r = __pyx_t_2;
19705   __pyx_t_2 = 0;
19706   goto __pyx_L0;
19707
19708   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19709   goto __pyx_L0;
19710   __pyx_L1_error:;
19711   __Pyx_XDECREF(__pyx_t_2);
19712   __Pyx_AddTraceback("lxml.etree.funicode");
19713   __pyx_r = 0;
19714   __pyx_L0:;
19715   __Pyx_XGIVEREF(__pyx_r);
19716   __Pyx_FinishRefcountContext();
19717   return __pyx_r;
19718 }
19719
19720 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1230
19721  *     return python.PyString_FromStringAndSize(s, slen)
19722  * 
19723  * cdef object _utf8(object s):             # <<<<<<<<<<<<<<
19724  *     cdef int invalid
19725  *     if python.PyString_CheckExact(s):
19726  */
19727
19728 static  PyObject *__pyx_f_4lxml_5etree__utf8(PyObject *__pyx_v_s) {
19729   int __pyx_v_invalid;
19730   PyObject *__pyx_r = NULL;
19731   int __pyx_t_1;
19732   PyObject *__pyx_t_2 = NULL;
19733   int __pyx_t_3;
19734   __Pyx_SetupRefcountContext("_utf8");
19735   __Pyx_INCREF(__pyx_v_s);
19736
19737   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1232
19738  * cdef object _utf8(object s):
19739  *     cdef int invalid
19740  *     if python.PyString_CheckExact(s):             # <<<<<<<<<<<<<<
19741  *         invalid = check_string_utf8(s)
19742  *     elif python.PyUnicode_CheckExact(s) or python.PyUnicode_Check(s):
19743  */
19744   __pyx_t_1 = PyString_CheckExact(__pyx_v_s);
19745   if (__pyx_t_1) {
19746
19747     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1233
19748  *     cdef int invalid
19749  *     if python.PyString_CheckExact(s):
19750  *         invalid = check_string_utf8(s)             # <<<<<<<<<<<<<<
19751  *     elif python.PyUnicode_CheckExact(s) or python.PyUnicode_Check(s):
19752  *         s = python.PyUnicode_AsUTF8String(s)
19753  */
19754     __pyx_v_invalid = __pyx_f_4lxml_5etree_check_string_utf8(__pyx_v_s);
19755     goto __pyx_L3;
19756   }
19757
19758   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1234
19759  *     if python.PyString_CheckExact(s):
19760  *         invalid = check_string_utf8(s)
19761  *     elif python.PyUnicode_CheckExact(s) or python.PyUnicode_Check(s):             # <<<<<<<<<<<<<<
19762  *         s = python.PyUnicode_AsUTF8String(s)
19763  *         invalid = check_string_utf8(s) == -1
19764  */
19765   if (!PyUnicode_CheckExact(__pyx_v_s)) {
19766     __pyx_t_1 = PyUnicode_Check(__pyx_v_s);
19767   } else {
19768     __pyx_t_1 = PyUnicode_CheckExact(__pyx_v_s);
19769   }
19770   if (__pyx_t_1) {
19771
19772     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1235
19773  *         invalid = check_string_utf8(s)
19774  *     elif python.PyUnicode_CheckExact(s) or python.PyUnicode_Check(s):
19775  *         s = python.PyUnicode_AsUTF8String(s)             # <<<<<<<<<<<<<<
19776  *         invalid = check_string_utf8(s) == -1
19777  *     elif python.PyString_Check(s):
19778  */
19779     __pyx_t_2 = PyUnicode_AsUTF8String(__pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19780     __Pyx_GOTREF(__pyx_t_2);
19781     __Pyx_DECREF(__pyx_v_s);
19782     __pyx_v_s = __pyx_t_2;
19783     __pyx_t_2 = 0;
19784
19785     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1236
19786  *     elif python.PyUnicode_CheckExact(s) or python.PyUnicode_Check(s):
19787  *         s = python.PyUnicode_AsUTF8String(s)
19788  *         invalid = check_string_utf8(s) == -1             # <<<<<<<<<<<<<<
19789  *     elif python.PyString_Check(s):
19790  *         invalid = check_string_utf8(s)
19791  */
19792     __pyx_v_invalid = (__pyx_f_4lxml_5etree_check_string_utf8(__pyx_v_s) == -1);
19793     goto __pyx_L3;
19794   }
19795
19796   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1237
19797  *         s = python.PyUnicode_AsUTF8String(s)
19798  *         invalid = check_string_utf8(s) == -1
19799  *     elif python.PyString_Check(s):             # <<<<<<<<<<<<<<
19800  *         invalid = check_string_utf8(s)
19801  *     else:
19802  */
19803   __pyx_t_1 = PyString_Check(__pyx_v_s);
19804   if (__pyx_t_1) {
19805
19806     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1238
19807  *         invalid = check_string_utf8(s) == -1
19808  *     elif python.PyString_Check(s):
19809  *         invalid = check_string_utf8(s)             # <<<<<<<<<<<<<<
19810  *     else:
19811  *         raise TypeError, u"Argument must be string or unicode."
19812  */
19813     __pyx_v_invalid = __pyx_f_4lxml_5etree_check_string_utf8(__pyx_v_s);
19814     goto __pyx_L3;
19815   }
19816   /*else*/ {
19817
19818     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1240
19819  *         invalid = check_string_utf8(s)
19820  *     else:
19821  *         raise TypeError, u"Argument must be string or unicode."             # <<<<<<<<<<<<<<
19822  *     if invalid:
19823  *         raise ValueError, \
19824  */
19825     __Pyx_Raise(__pyx_builtin_TypeError, ((PyObject *)__pyx_kp_255), 0);
19826     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19827   }
19828   __pyx_L3:;
19829
19830   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1241
19831  *     else:
19832  *         raise TypeError, u"Argument must be string or unicode."
19833  *     if invalid:             # <<<<<<<<<<<<<<
19834  *         raise ValueError, \
19835  *             u"All strings must be XML compatible: Unicode or ASCII, no NULL bytes"
19836  */
19837   __pyx_t_3 = __pyx_v_invalid;
19838   if (__pyx_t_3) {
19839
19840     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1243
19841  *     if invalid:
19842  *         raise ValueError, \
19843  *             u"All strings must be XML compatible: Unicode or ASCII, no NULL bytes"             # <<<<<<<<<<<<<<
19844  *     return s
19845  * 
19846  */
19847     __Pyx_Raise(__pyx_builtin_ValueError, ((PyObject *)__pyx_kp_256), 0);
19848     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19849     goto __pyx_L4;
19850   }
19851   __pyx_L4:;
19852
19853   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1244
19854  *         raise ValueError, \
19855  *             u"All strings must be XML compatible: Unicode or ASCII, no NULL bytes"
19856  *     return s             # <<<<<<<<<<<<<<
19857  * 
19858  * cdef bint _isFilePath(char* c_path):
19859  */
19860   __Pyx_XDECREF(__pyx_r);
19861   __Pyx_INCREF(__pyx_v_s);
19862   __pyx_r = __pyx_v_s;
19863   goto __pyx_L0;
19864
19865   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19866   goto __pyx_L0;
19867   __pyx_L1_error:;
19868   __Pyx_XDECREF(__pyx_t_2);
19869   __Pyx_AddTraceback("lxml.etree._utf8");
19870   __pyx_r = 0;
19871   __pyx_L0:;
19872   __Pyx_DECREF(__pyx_v_s);
19873   __Pyx_XGIVEREF(__pyx_r);
19874   __Pyx_FinishRefcountContext();
19875   return __pyx_r;
19876 }
19877
19878 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1246
19879  *     return s
19880  * 
19881  * cdef bint _isFilePath(char* c_path):             # <<<<<<<<<<<<<<
19882  *     u"simple heuristic to see if a path is a filename"
19883  *     cdef char c
19884  */
19885
19886 static  int __pyx_f_4lxml_5etree__isFilePath(char *__pyx_v_c_path) {
19887   char __pyx_v_c;
19888   int __pyx_r;
19889   int __pyx_t_1;
19890   int __pyx_t_2;
19891   int __pyx_t_3;
19892   __Pyx_SetupRefcountContext("_isFilePath");
19893
19894   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1250
19895  *     cdef char c
19896  *     # test if it looks like an absolute Unix path or a Windows network path
19897  *     if c_path[0] == c'/':             # <<<<<<<<<<<<<<
19898  *         return 1
19899  *     # test if it looks like an absolute Windows path
19900  */
19901   __pyx_t_1 = ((__pyx_v_c_path[0]) == '/');
19902   if (__pyx_t_1) {
19903
19904     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1251
19905  *     # test if it looks like an absolute Unix path or a Windows network path
19906  *     if c_path[0] == c'/':
19907  *         return 1             # <<<<<<<<<<<<<<
19908  *     # test if it looks like an absolute Windows path
19909  *     if (c_path[0] >= c'a' and c_path[0] <= c'z') or \
19910  */
19911     __pyx_r = 1;
19912     goto __pyx_L0;
19913     goto __pyx_L3;
19914   }
19915   __pyx_L3:;
19916
19917   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1253
19918  *         return 1
19919  *     # test if it looks like an absolute Windows path
19920  *     if (c_path[0] >= c'a' and c_path[0] <= c'z') or \             # <<<<<<<<<<<<<<
19921  *             (c_path[0] >= c'A' and c_path[0] <= c'Z'):
19922  *         if c_path[1] == c':':
19923  */
19924   if (((__pyx_v_c_path[0]) >= 'a')) {
19925     __pyx_t_1 = ((__pyx_v_c_path[0]) <= 'z');
19926   } else {
19927     __pyx_t_1 = ((__pyx_v_c_path[0]) >= 'a');
19928   }
19929   if (!__pyx_t_1) {
19930
19931     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1254
19932  *     # test if it looks like an absolute Windows path
19933  *     if (c_path[0] >= c'a' and c_path[0] <= c'z') or \
19934  *             (c_path[0] >= c'A' and c_path[0] <= c'Z'):             # <<<<<<<<<<<<<<
19935  *         if c_path[1] == c':':
19936  *             return 1
19937  */
19938     if (((__pyx_v_c_path[0]) >= 'A')) {
19939       __pyx_t_2 = ((__pyx_v_c_path[0]) <= 'Z');
19940     } else {
19941       __pyx_t_2 = ((__pyx_v_c_path[0]) >= 'A');
19942     }
19943     __pyx_t_3 = __pyx_t_2;
19944   } else {
19945     __pyx_t_3 = __pyx_t_1;
19946   }
19947   if (__pyx_t_3) {
19948
19949     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1255
19950  *     if (c_path[0] >= c'a' and c_path[0] <= c'z') or \
19951  *             (c_path[0] >= c'A' and c_path[0] <= c'Z'):
19952  *         if c_path[1] == c':':             # <<<<<<<<<<<<<<
19953  *             return 1
19954  *     # test if it looks like a relative path
19955  */
19956     __pyx_t_3 = ((__pyx_v_c_path[1]) == ':');
19957     if (__pyx_t_3) {
19958
19959       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1256
19960  *             (c_path[0] >= c'A' and c_path[0] <= c'Z'):
19961  *         if c_path[1] == c':':
19962  *             return 1             # <<<<<<<<<<<<<<
19963  *     # test if it looks like a relative path
19964  *     while c_path[0] != c'\0':
19965  */
19966       __pyx_r = 1;
19967       goto __pyx_L0;
19968       goto __pyx_L5;
19969     }
19970     __pyx_L5:;
19971     goto __pyx_L4;
19972   }
19973   __pyx_L4:;
19974
19975   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1258
19976  *             return 1
19977  *     # test if it looks like a relative path
19978  *     while c_path[0] != c'\0':             # <<<<<<<<<<<<<<
19979  *         c = c_path[0]
19980  *         if c == c':':
19981  */
19982   while (1) {
19983     __pyx_t_3 = ((__pyx_v_c_path[0]) != '\x00');
19984     if (!__pyx_t_3) break;
19985
19986     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1259
19987  *     # test if it looks like a relative path
19988  *     while c_path[0] != c'\0':
19989  *         c = c_path[0]             # <<<<<<<<<<<<<<
19990  *         if c == c':':
19991  *             return 0
19992  */
19993     __pyx_v_c = (__pyx_v_c_path[0]);
19994
19995     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1260
19996  *     while c_path[0] != c'\0':
19997  *         c = c_path[0]
19998  *         if c == c':':             # <<<<<<<<<<<<<<
19999  *             return 0
20000  *         elif c == c'/':
20001  */
20002     switch (__pyx_v_c) {
20003       case ':':
20004
20005       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1261
20006  *         c = c_path[0]
20007  *         if c == c':':
20008  *             return 0             # <<<<<<<<<<<<<<
20009  *         elif c == c'/':
20010  *             return 1
20011  */
20012       __pyx_r = 0;
20013       goto __pyx_L0;
20014       break;
20015
20016       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1262
20017  *         if c == c':':
20018  *             return 0
20019  *         elif c == c'/':             # <<<<<<<<<<<<<<
20020  *             return 1
20021  *         elif c == c'\\':
20022  */
20023       case '/':
20024
20025       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1263
20026  *             return 0
20027  *         elif c == c'/':
20028  *             return 1             # <<<<<<<<<<<<<<
20029  *         elif c == c'\\':
20030  *             return 1
20031  */
20032       __pyx_r = 1;
20033       goto __pyx_L0;
20034       break;
20035
20036       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1264
20037  *         elif c == c'/':
20038  *             return 1
20039  *         elif c == c'\\':             # <<<<<<<<<<<<<<
20040  *             return 1
20041  *         c_path += 1
20042  */
20043       case '\\':
20044
20045       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1265
20046  *             return 1
20047  *         elif c == c'\\':
20048  *             return 1             # <<<<<<<<<<<<<<
20049  *         c_path += 1
20050  *     return 1
20051  */
20052       __pyx_r = 1;
20053       goto __pyx_L0;
20054       break;
20055     }
20056
20057     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1266
20058  *         elif c == c'\\':
20059  *             return 1
20060  *         c_path += 1             # <<<<<<<<<<<<<<
20061  *     return 1
20062  * 
20063  */
20064     __pyx_v_c_path += 1;
20065   }
20066
20067   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1267
20068  *             return 1
20069  *         c_path += 1
20070  *     return 1             # <<<<<<<<<<<<<<
20071  * 
20072  * cdef object _encodeFilename(object filename):
20073  */
20074   __pyx_r = 1;
20075   goto __pyx_L0;
20076
20077   __pyx_r = 0;
20078   __pyx_L0:;
20079   __Pyx_FinishRefcountContext();
20080   return __pyx_r;
20081 }
20082
20083 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1269
20084  *     return 1
20085  * 
20086  * cdef object _encodeFilename(object filename):             # <<<<<<<<<<<<<<
20087  *     u"""Make sure a filename is 8-bit encoded (or None).
20088  *     """
20089  */
20090
20091 static  PyObject *__pyx_f_4lxml_5etree__encodeFilename(PyObject *__pyx_v_filename) {
20092   PyObject *__pyx_v_filename8;
20093   PyObject *__pyx_r = NULL;
20094   int __pyx_1;
20095   int __pyx_t_1;
20096   PyObject *__pyx_t_2 = NULL;
20097   char *__pyx_t_3;
20098   __Pyx_SetupRefcountContext("_encodeFilename");
20099   __pyx_v_filename8 = Py_None; __Pyx_INCREF(Py_None);
20100
20101   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1272
20102  *     u"""Make sure a filename is 8-bit encoded (or None).
20103  *     """
20104  *     if filename is None:             # <<<<<<<<<<<<<<
20105  *         return None
20106  *     elif python.PyString_Check(filename):
20107  */
20108   __pyx_t_1 = (__pyx_v_filename == Py_None);
20109   if (__pyx_t_1) {
20110
20111     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1273
20112  *     """
20113  *     if filename is None:
20114  *         return None             # <<<<<<<<<<<<<<
20115  *     elif python.PyString_Check(filename):
20116  *         return filename
20117  */
20118     __Pyx_XDECREF(__pyx_r);
20119     __Pyx_INCREF(Py_None);
20120     __pyx_r = Py_None;
20121     goto __pyx_L0;
20122     goto __pyx_L3;
20123   }
20124
20125   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1274
20126  *     if filename is None:
20127  *         return None
20128  *     elif python.PyString_Check(filename):             # <<<<<<<<<<<<<<
20129  *         return filename
20130  *     elif python.PyUnicode_Check(filename):
20131  */
20132   __pyx_t_1 = PyString_Check(__pyx_v_filename);
20133   if (__pyx_t_1) {
20134
20135     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1275
20136  *         return None
20137  *     elif python.PyString_Check(filename):
20138  *         return filename             # <<<<<<<<<<<<<<
20139  *     elif python.PyUnicode_Check(filename):
20140  *         filename8 = python.PyUnicode_AsEncodedString(
20141  */
20142     __Pyx_XDECREF(__pyx_r);
20143     __Pyx_INCREF(__pyx_v_filename);
20144     __pyx_r = __pyx_v_filename;
20145     goto __pyx_L0;
20146     goto __pyx_L3;
20147   }
20148
20149   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1276
20150  *     elif python.PyString_Check(filename):
20151  *         return filename
20152  *     elif python.PyUnicode_Check(filename):             # <<<<<<<<<<<<<<
20153  *         filename8 = python.PyUnicode_AsEncodedString(
20154  *             filename, 'UTF-8', NULL)
20155  */
20156   __pyx_t_1 = PyUnicode_Check(__pyx_v_filename);
20157   if (__pyx_t_1) {
20158
20159     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1278
20160  *     elif python.PyUnicode_Check(filename):
20161  *         filename8 = python.PyUnicode_AsEncodedString(
20162  *             filename, 'UTF-8', NULL)             # <<<<<<<<<<<<<<
20163  *         if _isFilePath(filename8):
20164  *             try:
20165  */
20166     __pyx_t_2 = PyUnicode_AsEncodedString(__pyx_v_filename, __pyx_k_257, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20167     __Pyx_GOTREF(__pyx_t_2);
20168     __Pyx_DECREF(__pyx_v_filename8);
20169     __pyx_v_filename8 = __pyx_t_2;
20170     __pyx_t_2 = 0;
20171
20172     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1279
20173  *         filename8 = python.PyUnicode_AsEncodedString(
20174  *             filename, 'UTF-8', NULL)
20175  *         if _isFilePath(filename8):             # <<<<<<<<<<<<<<
20176  *             try:
20177  *                 return python.PyUnicode_AsEncodedString(
20178  */
20179     __pyx_t_3 = __Pyx_PyBytes_AsString(__pyx_v_filename8); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20180     __pyx_t_1 = __pyx_f_4lxml_5etree__isFilePath(__pyx_t_3);
20181     if (__pyx_t_1) {
20182
20183       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1280
20184  *             filename, 'UTF-8', NULL)
20185  *         if _isFilePath(filename8):
20186  *             try:             # <<<<<<<<<<<<<<
20187  *                 return python.PyUnicode_AsEncodedString(
20188  *                     filename, _C_FILENAME_ENCODING, NULL)
20189  */
20190       {
20191         PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
20192         __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
20193         __Pyx_XGOTREF(__pyx_save_exc_type);
20194         __Pyx_XGOTREF(__pyx_save_exc_value);
20195         __Pyx_XGOTREF(__pyx_save_exc_tb);
20196         /*try:*/ {
20197
20198           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1281
20199  *         if _isFilePath(filename8):
20200  *             try:
20201  *                 return python.PyUnicode_AsEncodedString(             # <<<<<<<<<<<<<<
20202  *                     filename, _C_FILENAME_ENCODING, NULL)
20203  *             except UnicodeEncodeError:
20204  */
20205           __Pyx_XDECREF(__pyx_r);
20206
20207           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1282
20208  *             try:
20209  *                 return python.PyUnicode_AsEncodedString(
20210  *                     filename, _C_FILENAME_ENCODING, NULL)             # <<<<<<<<<<<<<<
20211  *             except UnicodeEncodeError:
20212  *                 pass
20213  */
20214           __pyx_t_2 = PyUnicode_AsEncodedString(__pyx_v_filename, __pyx_v_4lxml_5etree__C_FILENAME_ENCODING, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
20215           __Pyx_GOTREF(__pyx_t_2);
20216           __pyx_r = __pyx_t_2;
20217           __pyx_t_2 = 0;
20218           goto __pyx_L9_try_return;
20219         }
20220         __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
20221         __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
20222         __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
20223         goto __pyx_L12_try_end;
20224         __pyx_L9_try_return:;
20225         __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
20226         __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
20227         __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
20228         goto __pyx_L0;
20229         __pyx_L5_error:;
20230         __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20231
20232         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1283
20233  *                 return python.PyUnicode_AsEncodedString(
20234  *                     filename, _C_FILENAME_ENCODING, NULL)
20235  *             except UnicodeEncodeError:             # <<<<<<<<<<<<<<
20236  *                 pass
20237  *         return filename8
20238  */
20239         __pyx_1 = PyErr_ExceptionMatches(__pyx_builtin_UnicodeEncodeError);
20240         if (__pyx_1) {
20241           PyErr_Restore(0,0,0);
20242           goto __pyx_L6_exception_handled;
20243         }
20244         __Pyx_XDECREF(__pyx_save_exc_type);
20245         __Pyx_XDECREF(__pyx_save_exc_value);
20246         __Pyx_XDECREF(__pyx_save_exc_tb);
20247         goto __pyx_L1_error;
20248         __pyx_L6_exception_handled:;
20249         __Pyx_XGIVEREF(__pyx_save_exc_type);
20250         __Pyx_XGIVEREF(__pyx_save_exc_value);
20251         __Pyx_XGIVEREF(__pyx_save_exc_tb);
20252         __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
20253         __pyx_L12_try_end:;
20254       }
20255       goto __pyx_L4;
20256     }
20257     __pyx_L4:;
20258
20259     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1285
20260  *             except UnicodeEncodeError:
20261  *                 pass
20262  *         return filename8             # <<<<<<<<<<<<<<
20263  *     else:
20264  *         raise TypeError, u"Argument must be string or unicode."
20265  */
20266     __Pyx_XDECREF(__pyx_r);
20267     __Pyx_INCREF(__pyx_v_filename8);
20268     __pyx_r = __pyx_v_filename8;
20269     goto __pyx_L0;
20270     goto __pyx_L3;
20271   }
20272   /*else*/ {
20273
20274     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1287
20275  *         return filename8
20276  *     else:
20277  *         raise TypeError, u"Argument must be string or unicode."             # <<<<<<<<<<<<<<
20278  * 
20279  * cdef object _decodeFilename(char* c_path):
20280  */
20281     __Pyx_Raise(__pyx_builtin_TypeError, ((PyObject *)__pyx_kp_258), 0);
20282     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20283   }
20284   __pyx_L3:;
20285
20286   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20287   goto __pyx_L0;
20288   __pyx_L1_error:;
20289   __Pyx_XDECREF(__pyx_t_2);
20290   __Pyx_AddTraceback("lxml.etree._encodeFilename");
20291   __pyx_r = 0;
20292   __pyx_L0:;
20293   __Pyx_DECREF(__pyx_v_filename8);
20294   __Pyx_XGIVEREF(__pyx_r);
20295   __Pyx_FinishRefcountContext();
20296   return __pyx_r;
20297 }
20298
20299 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1289
20300  *         raise TypeError, u"Argument must be string or unicode."
20301  * 
20302  * cdef object _decodeFilename(char* c_path):             # <<<<<<<<<<<<<<
20303  *     u"""Make the filename a unicode string if we are in Py3.
20304  *     """
20305  */
20306
20307 static  PyObject *__pyx_f_4lxml_5etree__decodeFilename(char *__pyx_v_c_path) {
20308   Py_ssize_t __pyx_v_c_len;
20309   PyObject *__pyx_r = NULL;
20310   int __pyx_1;
20311   int __pyx_t_1;
20312   PyObject *__pyx_t_2 = NULL;
20313   PyObject *__pyx_t_3 = NULL;
20314   PyObject *__pyx_t_4 = NULL;
20315   PyObject *__pyx_t_5 = NULL;
20316   __Pyx_SetupRefcountContext("_decodeFilename");
20317
20318   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1292
20319  *     u"""Make the filename a unicode string if we are in Py3.
20320  *     """
20321  *     cdef Py_ssize_t c_len = cstd.strlen(c_path)             # <<<<<<<<<<<<<<
20322  *     if _isFilePath(c_path):
20323  *         try:
20324  */
20325   __pyx_v_c_len = strlen(__pyx_v_c_path);
20326
20327   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1293
20328  *     """
20329  *     cdef Py_ssize_t c_len = cstd.strlen(c_path)
20330  *     if _isFilePath(c_path):             # <<<<<<<<<<<<<<
20331  *         try:
20332  *             return python.PyUnicode_Decode(
20333  */
20334   __pyx_t_1 = __pyx_f_4lxml_5etree__isFilePath(__pyx_v_c_path);
20335   if (__pyx_t_1) {
20336
20337     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1294
20338  *     cdef Py_ssize_t c_len = cstd.strlen(c_path)
20339  *     if _isFilePath(c_path):
20340  *         try:             # <<<<<<<<<<<<<<
20341  *             return python.PyUnicode_Decode(
20342  *                 c_path, c_len, _C_FILENAME_ENCODING, NULL)
20343  */
20344     {
20345       PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
20346       __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
20347       __Pyx_XGOTREF(__pyx_save_exc_type);
20348       __Pyx_XGOTREF(__pyx_save_exc_value);
20349       __Pyx_XGOTREF(__pyx_save_exc_tb);
20350       /*try:*/ {
20351
20352         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1295
20353  *     if _isFilePath(c_path):
20354  *         try:
20355  *             return python.PyUnicode_Decode(             # <<<<<<<<<<<<<<
20356  *                 c_path, c_len, _C_FILENAME_ENCODING, NULL)
20357  *         except UnicodeDecodeError:
20358  */
20359         __Pyx_XDECREF(__pyx_r);
20360
20361         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1296
20362  *         try:
20363  *             return python.PyUnicode_Decode(
20364  *                 c_path, c_len, _C_FILENAME_ENCODING, NULL)             # <<<<<<<<<<<<<<
20365  *         except UnicodeDecodeError:
20366  *             pass
20367  */
20368         __pyx_t_2 = PyUnicode_Decode(__pyx_v_c_path, __pyx_v_c_len, __pyx_v_4lxml_5etree__C_FILENAME_ENCODING, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
20369         __Pyx_GOTREF(__pyx_t_2);
20370         __pyx_r = __pyx_t_2;
20371         __pyx_t_2 = 0;
20372         goto __pyx_L8_try_return;
20373       }
20374       __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
20375       __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
20376       __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
20377       goto __pyx_L11_try_end;
20378       __pyx_L8_try_return:;
20379       __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
20380       __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
20381       __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
20382       goto __pyx_L0;
20383       __pyx_L4_error:;
20384       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20385
20386       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1297
20387  *             return python.PyUnicode_Decode(
20388  *                 c_path, c_len, _C_FILENAME_ENCODING, NULL)
20389  *         except UnicodeDecodeError:             # <<<<<<<<<<<<<<
20390  *             pass
20391  *     try:
20392  */
20393       __pyx_1 = PyErr_ExceptionMatches(__pyx_builtin_UnicodeDecodeError);
20394       if (__pyx_1) {
20395         PyErr_Restore(0,0,0);
20396         goto __pyx_L5_exception_handled;
20397       }
20398       __Pyx_XDECREF(__pyx_save_exc_type);
20399       __Pyx_XDECREF(__pyx_save_exc_value);
20400       __Pyx_XDECREF(__pyx_save_exc_tb);
20401       goto __pyx_L1_error;
20402       __pyx_L5_exception_handled:;
20403       __Pyx_XGIVEREF(__pyx_save_exc_type);
20404       __Pyx_XGIVEREF(__pyx_save_exc_value);
20405       __Pyx_XGIVEREF(__pyx_save_exc_tb);
20406       __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
20407       __pyx_L11_try_end:;
20408     }
20409     goto __pyx_L3;
20410   }
20411   __pyx_L3:;
20412
20413   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1299
20414  *         except UnicodeDecodeError:
20415  *             pass
20416  *     try:             # <<<<<<<<<<<<<<
20417  *         return python.PyUnicode_DecodeUTF8(c_path, c_len, NULL)
20418  *     except UnicodeDecodeError:
20419  */
20420   {
20421     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
20422     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
20423     __Pyx_XGOTREF(__pyx_save_exc_type);
20424     __Pyx_XGOTREF(__pyx_save_exc_value);
20425     __Pyx_XGOTREF(__pyx_save_exc_tb);
20426     /*try:*/ {
20427
20428       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1300
20429  *             pass
20430  *     try:
20431  *         return python.PyUnicode_DecodeUTF8(c_path, c_len, NULL)             # <<<<<<<<<<<<<<
20432  *     except UnicodeDecodeError:
20433  *         # this is a stupid fallback, but it might still work...
20434  */
20435       __Pyx_XDECREF(__pyx_r);
20436       __pyx_t_2 = PyUnicode_DecodeUTF8(__pyx_v_c_path, __pyx_v_c_len, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1300; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
20437       __Pyx_GOTREF(__pyx_t_2);
20438       __pyx_r = __pyx_t_2;
20439       __pyx_t_2 = 0;
20440       goto __pyx_L16_try_return;
20441     }
20442     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
20443     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
20444     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
20445     goto __pyx_L19_try_end;
20446     __pyx_L16_try_return:;
20447     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
20448     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
20449     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
20450     goto __pyx_L0;
20451     __pyx_L12_error:;
20452     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20453
20454     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1301
20455  *     try:
20456  *         return python.PyUnicode_DecodeUTF8(c_path, c_len, NULL)
20457  *     except UnicodeDecodeError:             # <<<<<<<<<<<<<<
20458  *         # this is a stupid fallback, but it might still work...
20459  *         return python.PyUnicode_DecodeLatin1(c_path, c_len, 'replace')
20460  */
20461     __pyx_1 = PyErr_ExceptionMatches(__pyx_builtin_UnicodeDecodeError);
20462     if (__pyx_1) {
20463       __Pyx_AddTraceback("lxml.etree._decodeFilename");
20464       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;}
20465       __Pyx_GOTREF(__pyx_t_2);
20466       __Pyx_GOTREF(__pyx_t_3);
20467       __Pyx_GOTREF(__pyx_t_4);
20468
20469       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1303
20470  *     except UnicodeDecodeError:
20471  *         # this is a stupid fallback, but it might still work...
20472  *         return python.PyUnicode_DecodeLatin1(c_path, c_len, 'replace')             # <<<<<<<<<<<<<<
20473  * 
20474  * cdef object _encodeFilenameUTF8(object filename):
20475  */
20476       __Pyx_XDECREF(__pyx_r);
20477       __pyx_t_5 = PyUnicode_DecodeLatin1(__pyx_v_c_path, __pyx_v_c_len, __pyx_k_259); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;}
20478       __Pyx_GOTREF(__pyx_t_5);
20479       __pyx_r = __pyx_t_5;
20480       __pyx_t_5 = 0;
20481       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20482       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20483       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20484       goto __pyx_L15_except_return;
20485       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20486       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20487       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20488       goto __pyx_L13_exception_handled;
20489     }
20490     __pyx_L14_except_error:;
20491     __Pyx_XDECREF(__pyx_save_exc_type);
20492     __Pyx_XDECREF(__pyx_save_exc_value);
20493     __Pyx_XDECREF(__pyx_save_exc_tb);
20494     goto __pyx_L1_error;
20495     __pyx_L15_except_return:;
20496     __Pyx_XGIVEREF(__pyx_save_exc_type);
20497     __Pyx_XGIVEREF(__pyx_save_exc_value);
20498     __Pyx_XGIVEREF(__pyx_save_exc_tb);
20499     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
20500     goto __pyx_L0;
20501     __pyx_L13_exception_handled:;
20502     __Pyx_XGIVEREF(__pyx_save_exc_type);
20503     __Pyx_XGIVEREF(__pyx_save_exc_value);
20504     __Pyx_XGIVEREF(__pyx_save_exc_tb);
20505     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
20506     __pyx_L19_try_end:;
20507   }
20508
20509   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20510   goto __pyx_L0;
20511   __pyx_L1_error:;
20512   __Pyx_XDECREF(__pyx_t_2);
20513   __Pyx_XDECREF(__pyx_t_3);
20514   __Pyx_XDECREF(__pyx_t_4);
20515   __Pyx_XDECREF(__pyx_t_5);
20516   __Pyx_AddTraceback("lxml.etree._decodeFilename");
20517   __pyx_r = 0;
20518   __pyx_L0:;
20519   __Pyx_XGIVEREF(__pyx_r);
20520   __Pyx_FinishRefcountContext();
20521   return __pyx_r;
20522 }
20523
20524 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1305
20525  *         return python.PyUnicode_DecodeLatin1(c_path, c_len, 'replace')
20526  * 
20527  * cdef object _encodeFilenameUTF8(object filename):             # <<<<<<<<<<<<<<
20528  *     u"""Recode filename as UTF-8. Tries ASCII, local filesystem encoding and
20529  *     UTF-8 as source encoding.
20530  */
20531
20532 static  PyObject *__pyx_f_4lxml_5etree__encodeFilenameUTF8(PyObject *__pyx_v_filename) {
20533   char *__pyx_v_c_filename;
20534   PyObject *__pyx_v_decode_exc;
20535   PyObject *__pyx_r = NULL;
20536   int __pyx_1;
20537   PyObject *__pyx_2 = 0;
20538   PyObject *__pyx_3 = 0;
20539   PyObject *__pyx_4 = 0;
20540   int __pyx_t_1;
20541   PyObject *__pyx_t_2 = NULL;
20542   PyObject *__pyx_t_3 = NULL;
20543   PyObject *__pyx_t_4 = NULL;
20544   __Pyx_SetupRefcountContext("_encodeFilenameUTF8");
20545   __Pyx_INCREF(__pyx_v_filename);
20546   __pyx_v_decode_exc = Py_None; __Pyx_INCREF(Py_None);
20547
20548   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1310
20549  *     """
20550  *     cdef char* c_filename
20551  *     if filename is None:             # <<<<<<<<<<<<<<
20552  *         return None
20553  *     elif python.PyString_Check(filename):
20554  */
20555   __pyx_t_1 = (__pyx_v_filename == Py_None);
20556   if (__pyx_t_1) {
20557
20558     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1311
20559  *     cdef char* c_filename
20560  *     if filename is None:
20561  *         return None             # <<<<<<<<<<<<<<
20562  *     elif python.PyString_Check(filename):
20563  *         if not check_string_utf8(filename):
20564  */
20565     __Pyx_XDECREF(__pyx_r);
20566     __Pyx_INCREF(Py_None);
20567     __pyx_r = Py_None;
20568     goto __pyx_L0;
20569     goto __pyx_L3;
20570   }
20571
20572   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1312
20573  *     if filename is None:
20574  *         return None
20575  *     elif python.PyString_Check(filename):             # <<<<<<<<<<<<<<
20576  *         if not check_string_utf8(filename):
20577  *             # plain ASCII!
20578  */
20579   __pyx_t_1 = PyString_Check(__pyx_v_filename);
20580   if (__pyx_t_1) {
20581
20582     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1313
20583  *         return None
20584  *     elif python.PyString_Check(filename):
20585  *         if not check_string_utf8(filename):             # <<<<<<<<<<<<<<
20586  *             # plain ASCII!
20587  *             return filename
20588  */
20589     __pyx_t_1 = (!__pyx_f_4lxml_5etree_check_string_utf8(__pyx_v_filename));
20590     if (__pyx_t_1) {
20591
20592       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1315
20593  *         if not check_string_utf8(filename):
20594  *             # plain ASCII!
20595  *             return filename             # <<<<<<<<<<<<<<
20596  *         c_filename = _cstr(filename)
20597  *         try:
20598  */
20599       __Pyx_XDECREF(__pyx_r);
20600       __Pyx_INCREF(__pyx_v_filename);
20601       __pyx_r = __pyx_v_filename;
20602       goto __pyx_L0;
20603       goto __pyx_L4;
20604     }
20605     __pyx_L4:;
20606
20607     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1316
20608  *             # plain ASCII!
20609  *             return filename
20610  *         c_filename = _cstr(filename)             # <<<<<<<<<<<<<<
20611  *         try:
20612  *             # try to decode with default encoding
20613  */
20614     __pyx_v_c_filename = PyString_AS_STRING(__pyx_v_filename);
20615
20616     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1317
20617  *             return filename
20618  *         c_filename = _cstr(filename)
20619  *         try:             # <<<<<<<<<<<<<<
20620  *             # try to decode with default encoding
20621  *             filename = python.PyUnicode_Decode(
20622  */
20623     {
20624       PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
20625       __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
20626       __Pyx_XGOTREF(__pyx_save_exc_type);
20627       __Pyx_XGOTREF(__pyx_save_exc_value);
20628       __Pyx_XGOTREF(__pyx_save_exc_tb);
20629       /*try:*/ {
20630
20631         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1321
20632  *             filename = python.PyUnicode_Decode(
20633  *                 c_filename, python.PyString_GET_SIZE(filename),
20634  *                 _C_FILENAME_ENCODING, NULL)             # <<<<<<<<<<<<<<
20635  *         except UnicodeDecodeError, decode_exc:
20636  *             try:
20637  */
20638         __pyx_t_2 = PyUnicode_Decode(__pyx_v_c_filename, PyString_GET_SIZE(__pyx_v_filename), __pyx_v_4lxml_5etree__C_FILENAME_ENCODING, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
20639         __Pyx_GOTREF(__pyx_t_2);
20640         __Pyx_DECREF(__pyx_v_filename);
20641         __pyx_v_filename = __pyx_t_2;
20642         __pyx_t_2 = 0;
20643       }
20644       __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
20645       __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
20646       __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
20647       goto __pyx_L12_try_end;
20648       __pyx_L5_error:;
20649       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20650
20651       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1322
20652  *                 c_filename, python.PyString_GET_SIZE(filename),
20653  *                 _C_FILENAME_ENCODING, NULL)
20654  *         except UnicodeDecodeError, decode_exc:             # <<<<<<<<<<<<<<
20655  *             try:
20656  *                 # try if it's UTF-8
20657  */
20658       __pyx_1 = PyErr_ExceptionMatches(__pyx_builtin_UnicodeDecodeError);
20659       if (__pyx_1) {
20660         __Pyx_AddTraceback("lxml.etree._encodeFilenameUTF8");
20661         if (__Pyx_GetException(&__pyx_2, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
20662         __Pyx_GOTREF(__pyx_2);
20663         __Pyx_GOTREF(__pyx_3);
20664         __Pyx_GOTREF(__pyx_4);
20665         __Pyx_INCREF(__pyx_3);
20666         __Pyx_DECREF(__pyx_v_decode_exc);
20667         __pyx_v_decode_exc = __pyx_3;
20668
20669         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1323
20670  *                 _C_FILENAME_ENCODING, NULL)
20671  *         except UnicodeDecodeError, decode_exc:
20672  *             try:             # <<<<<<<<<<<<<<
20673  *                 # try if it's UTF-8
20674  *                 filename = python.PyUnicode_DecodeUTF8(
20675  */
20676         {
20677           PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
20678           __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
20679           __Pyx_XGOTREF(__pyx_save_exc_type);
20680           __Pyx_XGOTREF(__pyx_save_exc_value);
20681           __Pyx_XGOTREF(__pyx_save_exc_tb);
20682           /*try:*/ {
20683
20684             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1326
20685  *                 # try if it's UTF-8
20686  *                 filename = python.PyUnicode_DecodeUTF8(
20687  *                     c_filename, python.PyString_GET_SIZE(filename), NULL)             # <<<<<<<<<<<<<<
20688  *             except UnicodeDecodeError:
20689  *                 raise decode_exc # otherwise re-raise original exception
20690  */
20691             __pyx_t_2 = PyUnicode_DecodeUTF8(__pyx_v_c_filename, PyString_GET_SIZE(__pyx_v_filename), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
20692             __Pyx_GOTREF(__pyx_t_2);
20693             __Pyx_DECREF(__pyx_v_filename);
20694             __pyx_v_filename = __pyx_t_2;
20695             __pyx_t_2 = 0;
20696           }
20697           __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
20698           __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
20699           __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
20700           goto __pyx_L22_try_end;
20701           __pyx_L15_error:;
20702           __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20703
20704           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1327
20705  *                 filename = python.PyUnicode_DecodeUTF8(
20706  *                     c_filename, python.PyString_GET_SIZE(filename), NULL)
20707  *             except UnicodeDecodeError:             # <<<<<<<<<<<<<<
20708  *                 raise decode_exc # otherwise re-raise original exception
20709  *     if python.PyUnicode_Check(filename):
20710  */
20711           __pyx_1 = PyErr_ExceptionMatches(__pyx_builtin_UnicodeDecodeError);
20712           if (__pyx_1) {
20713             __Pyx_AddTraceback("lxml.etree._encodeFilenameUTF8");
20714             if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;}
20715             __Pyx_GOTREF(__pyx_t_2);
20716             __Pyx_GOTREF(__pyx_t_3);
20717             __Pyx_GOTREF(__pyx_t_4);
20718
20719             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1328
20720  *                     c_filename, python.PyString_GET_SIZE(filename), NULL)
20721  *             except UnicodeDecodeError:
20722  *                 raise decode_exc # otherwise re-raise original exception             # <<<<<<<<<<<<<<
20723  *     if python.PyUnicode_Check(filename):
20724  *         return python.PyUnicode_AsUTF8String(filename)
20725  */
20726             __Pyx_Raise(__pyx_v_decode_exc, 0, 0);
20727             {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __pyx_L17_except_error;}
20728             __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20729             __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20730             __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20731             goto __pyx_L16_exception_handled;
20732           }
20733           __pyx_L17_except_error:;
20734           __Pyx_XDECREF(__pyx_save_exc_type);
20735           __Pyx_XDECREF(__pyx_save_exc_value);
20736           __Pyx_XDECREF(__pyx_save_exc_tb);
20737           goto __pyx_L7_except_error;
20738           __pyx_L16_exception_handled:;
20739           __Pyx_XGIVEREF(__pyx_save_exc_type);
20740           __Pyx_XGIVEREF(__pyx_save_exc_value);
20741           __Pyx_XGIVEREF(__pyx_save_exc_tb);
20742           __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
20743           __pyx_L22_try_end:;
20744         }
20745         __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
20746         __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
20747         __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
20748         goto __pyx_L6_exception_handled;
20749       }
20750       __pyx_L7_except_error:;
20751       __Pyx_XDECREF(__pyx_save_exc_type);
20752       __Pyx_XDECREF(__pyx_save_exc_value);
20753       __Pyx_XDECREF(__pyx_save_exc_tb);
20754       goto __pyx_L1_error;
20755       __pyx_L6_exception_handled:;
20756       __Pyx_XGIVEREF(__pyx_save_exc_type);
20757       __Pyx_XGIVEREF(__pyx_save_exc_value);
20758       __Pyx_XGIVEREF(__pyx_save_exc_tb);
20759       __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
20760       __pyx_L12_try_end:;
20761     }
20762     goto __pyx_L3;
20763   }
20764   __pyx_L3:;
20765
20766   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1329
20767  *             except UnicodeDecodeError:
20768  *                 raise decode_exc # otherwise re-raise original exception
20769  *     if python.PyUnicode_Check(filename):             # <<<<<<<<<<<<<<
20770  *         return python.PyUnicode_AsUTF8String(filename)
20771  *     else:
20772  */
20773   __pyx_t_1 = PyUnicode_Check(__pyx_v_filename);
20774   if (__pyx_t_1) {
20775
20776     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1330
20777  *                 raise decode_exc # otherwise re-raise original exception
20778  *     if python.PyUnicode_Check(filename):
20779  *         return python.PyUnicode_AsUTF8String(filename)             # <<<<<<<<<<<<<<
20780  *     else:
20781  *         raise TypeError, u"Argument must be string or unicode."
20782  */
20783     __Pyx_XDECREF(__pyx_r);
20784     __pyx_t_4 = PyUnicode_AsUTF8String(__pyx_v_filename); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20785     __Pyx_GOTREF(__pyx_t_4);
20786     __pyx_r = __pyx_t_4;
20787     __pyx_t_4 = 0;
20788     goto __pyx_L0;
20789     goto __pyx_L25;
20790   }
20791   /*else*/ {
20792
20793     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1332
20794  *         return python.PyUnicode_AsUTF8String(filename)
20795  *     else:
20796  *         raise TypeError, u"Argument must be string or unicode."             # <<<<<<<<<<<<<<
20797  * 
20798  * cdef _getNsTag(tag):
20799  */
20800     __Pyx_Raise(__pyx_builtin_TypeError, ((PyObject *)__pyx_kp_260), 0);
20801     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20802   }
20803   __pyx_L25:;
20804
20805   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20806   goto __pyx_L0;
20807   __pyx_L1_error:;
20808   __Pyx_XDECREF(__pyx_2);
20809   __Pyx_XDECREF(__pyx_3);
20810   __Pyx_XDECREF(__pyx_4);
20811   __Pyx_XDECREF(__pyx_t_2);
20812   __Pyx_XDECREF(__pyx_t_3);
20813   __Pyx_XDECREF(__pyx_t_4);
20814   __Pyx_AddTraceback("lxml.etree._encodeFilenameUTF8");
20815   __pyx_r = 0;
20816   __pyx_L0:;
20817   __Pyx_DECREF(__pyx_v_decode_exc);
20818   __Pyx_DECREF(__pyx_v_filename);
20819   __Pyx_XGIVEREF(__pyx_r);
20820   __Pyx_FinishRefcountContext();
20821   return __pyx_r;
20822 }
20823
20824 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1334
20825  *         raise TypeError, u"Argument must be string or unicode."
20826  * 
20827  * cdef _getNsTag(tag):             # <<<<<<<<<<<<<<
20828  *     u"""Given a tag, find namespace URI and tag name.
20829  *     Return None for NS uri if no namespace URI available.
20830  */
20831
20832 static  PyObject *__pyx_f_4lxml_5etree__getNsTag(PyObject *__pyx_v_tag) {
20833   char *__pyx_v_c_tag;
20834   char *__pyx_v_c_ns_end;
20835   Py_ssize_t __pyx_v_taglen;
20836   Py_ssize_t __pyx_v_nslen;
20837   PyObject *__pyx_v_ns;
20838   PyObject *__pyx_r = NULL;
20839   int __pyx_t_1;
20840   int __pyx_t_2;
20841   PyObject *__pyx_t_3 = NULL;
20842   __Pyx_SetupRefcountContext("_getNsTag");
20843   __Pyx_INCREF(__pyx_v_tag);
20844   __pyx_v_ns = Py_None; __Pyx_INCREF(Py_None);
20845
20846   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1343
20847  *     cdef Py_ssize_t nslen
20848  *     # _isString() is much faster than isinstance()
20849  *     if not _isString(tag) and isinstance(tag, QName):             # <<<<<<<<<<<<<<
20850  *         tag = (<QName>tag).text
20851  *     tag = _utf8(tag)
20852  */
20853   if ((!_isString(__pyx_v_tag))) {
20854     __pyx_t_1 = PyObject_TypeCheck(__pyx_v_tag, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree_QName))); 
20855     __pyx_t_2 = __pyx_t_1;
20856   } else {
20857     __pyx_t_2 = (!_isString(__pyx_v_tag));
20858   }
20859   if (__pyx_t_2) {
20860
20861     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1344
20862  *     # _isString() is much faster than isinstance()
20863  *     if not _isString(tag) and isinstance(tag, QName):
20864  *         tag = (<QName>tag).text             # <<<<<<<<<<<<<<
20865  *     tag = _utf8(tag)
20866  *     c_tag = _cstr(tag)
20867  */
20868     __Pyx_INCREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_tag)->text);
20869     __Pyx_DECREF(__pyx_v_tag);
20870     __pyx_v_tag = ((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_tag)->text;
20871     goto __pyx_L3;
20872   }
20873   __pyx_L3:;
20874
20875   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1345
20876  *     if not _isString(tag) and isinstance(tag, QName):
20877  *         tag = (<QName>tag).text
20878  *     tag = _utf8(tag)             # <<<<<<<<<<<<<<
20879  *     c_tag = _cstr(tag)
20880  *     if c_tag[0] == c'{':
20881  */
20882   __pyx_t_3 = __pyx_f_4lxml_5etree__utf8(__pyx_v_tag); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20883   __Pyx_GOTREF(__pyx_t_3);
20884   __Pyx_DECREF(__pyx_v_tag);
20885   __pyx_v_tag = __pyx_t_3;
20886   __pyx_t_3 = 0;
20887
20888   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1346
20889  *         tag = (<QName>tag).text
20890  *     tag = _utf8(tag)
20891  *     c_tag = _cstr(tag)             # <<<<<<<<<<<<<<
20892  *     if c_tag[0] == c'{':
20893  *         c_tag = c_tag + 1
20894  */
20895   __pyx_v_c_tag = PyString_AS_STRING(__pyx_v_tag);
20896
20897   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1347
20898  *     tag = _utf8(tag)
20899  *     c_tag = _cstr(tag)
20900  *     if c_tag[0] == c'{':             # <<<<<<<<<<<<<<
20901  *         c_tag = c_tag + 1
20902  *         c_ns_end = cstd.strchr(c_tag, c'}')
20903  */
20904   __pyx_t_2 = ((__pyx_v_c_tag[0]) == '{');
20905     if (__pyx_t_2) {
20906
20907       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1348
20908  *     c_tag = _cstr(tag)
20909  *     if c_tag[0] == c'{':
20910  *         c_tag = c_tag + 1             # <<<<<<<<<<<<<<
20911  *         c_ns_end = cstd.strchr(c_tag, c'}')
20912  *         if c_ns_end is NULL:
20913  */
20914       __pyx_v_c_tag = (__pyx_v_c_tag + 1);
20915
20916       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1349
20917  *     if c_tag[0] == c'{':
20918  *         c_tag = c_tag + 1
20919  *         c_ns_end = cstd.strchr(c_tag, c'}')             # <<<<<<<<<<<<<<
20920  *         if c_ns_end is NULL:
20921  *             raise ValueError, u"Invalid tag name"
20922  */
20923     __pyx_v_c_ns_end = strchr(__pyx_v_c_tag, '}');
20924
20925     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1350
20926  *         c_tag = c_tag + 1
20927  *         c_ns_end = cstd.strchr(c_tag, c'}')
20928  *         if c_ns_end is NULL:             # <<<<<<<<<<<<<<
20929  *             raise ValueError, u"Invalid tag name"
20930  *         nslen  = c_ns_end - c_tag
20931  */
20932     __pyx_t_2 = (__pyx_v_c_ns_end == NULL);
20933     if (__pyx_t_2) {
20934
20935       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1351
20936  *         c_ns_end = cstd.strchr(c_tag, c'}')
20937  *         if c_ns_end is NULL:
20938  *             raise ValueError, u"Invalid tag name"             # <<<<<<<<<<<<<<
20939  *         nslen  = c_ns_end - c_tag
20940  *         taglen = python.PyString_GET_SIZE(tag) - nslen - 2
20941  */
20942       __Pyx_Raise(__pyx_builtin_ValueError, ((PyObject *)__pyx_kp_261), 0);
20943       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20944       goto __pyx_L5;
20945     }
20946     __pyx_L5:;
20947
20948     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1352
20949  *         if c_ns_end is NULL:
20950  *             raise ValueError, u"Invalid tag name"
20951  *         nslen  = c_ns_end - c_tag             # <<<<<<<<<<<<<<
20952  *         taglen = python.PyString_GET_SIZE(tag) - nslen - 2
20953  *         if taglen == 0:
20954  */
20955     __pyx_v_nslen = (__pyx_v_c_ns_end - __pyx_v_c_tag);
20956
20957     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1353
20958  *             raise ValueError, u"Invalid tag name"
20959  *         nslen  = c_ns_end - c_tag
20960  *         taglen = python.PyString_GET_SIZE(tag) - nslen - 2             # <<<<<<<<<<<<<<
20961  *         if taglen == 0:
20962  *             raise ValueError, u"Empty tag name"
20963  */
20964     __pyx_v_taglen = ((PyString_GET_SIZE(__pyx_v_tag) - __pyx_v_nslen) - 2);
20965
20966     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1354
20967  *         nslen  = c_ns_end - c_tag
20968  *         taglen = python.PyString_GET_SIZE(tag) - nslen - 2
20969  *         if taglen == 0:             # <<<<<<<<<<<<<<
20970  *             raise ValueError, u"Empty tag name"
20971  *         if nslen > 0:
20972  */
20973     __pyx_t_2 = (__pyx_v_taglen == 0);
20974     if (__pyx_t_2) {
20975
20976       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1355
20977  *         taglen = python.PyString_GET_SIZE(tag) - nslen - 2
20978  *         if taglen == 0:
20979  *             raise ValueError, u"Empty tag name"             # <<<<<<<<<<<<<<
20980  *         if nslen > 0:
20981  *             ns = python.PyString_FromStringAndSize(c_tag,   nslen)
20982  */
20983       __Pyx_Raise(__pyx_builtin_ValueError, ((PyObject *)__pyx_kp_262), 0);
20984       {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20985       goto __pyx_L6;
20986     }
20987     __pyx_L6:;
20988
20989     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1356
20990  *         if taglen == 0:
20991  *             raise ValueError, u"Empty tag name"
20992  *         if nslen > 0:             # <<<<<<<<<<<<<<
20993  *             ns = python.PyString_FromStringAndSize(c_tag,   nslen)
20994  *         tag = python.PyString_FromStringAndSize(c_ns_end+1, taglen)
20995  */
20996     __pyx_t_2 = (__pyx_v_nslen > 0);
20997     if (__pyx_t_2) {
20998
20999       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1357
21000  *             raise ValueError, u"Empty tag name"
21001  *         if nslen > 0:
21002  *             ns = python.PyString_FromStringAndSize(c_tag,   nslen)             # <<<<<<<<<<<<<<
21003  *         tag = python.PyString_FromStringAndSize(c_ns_end+1, taglen)
21004  *     elif python.PyString_GET_SIZE(tag) == 0:
21005  */
21006       __pyx_t_3 = PyString_FromStringAndSize(__pyx_v_c_tag, __pyx_v_nslen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21007       __Pyx_GOTREF(__pyx_t_3);
21008       __Pyx_DECREF(__pyx_v_ns);
21009       __pyx_v_ns = __pyx_t_3;
21010       __pyx_t_3 = 0;
21011       goto __pyx_L7;
21012     }
21013     __pyx_L7:;
21014
21015     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1358
21016  *         if nslen > 0:
21017  *             ns = python.PyString_FromStringAndSize(c_tag,   nslen)
21018  *         tag = python.PyString_FromStringAndSize(c_ns_end+1, taglen)             # <<<<<<<<<<<<<<
21019  *     elif python.PyString_GET_SIZE(tag) == 0:
21020  *         raise ValueError, u"Empty tag name"
21021  */
21022     __pyx_t_3 = PyString_FromStringAndSize((__pyx_v_c_ns_end + 1), __pyx_v_taglen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21023     __Pyx_GOTREF(__pyx_t_3);
21024     __Pyx_DECREF(__pyx_v_tag);
21025     __pyx_v_tag = __pyx_t_3;
21026     __pyx_t_3 = 0;
21027     goto __pyx_L4;
21028   }
21029
21030   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1359
21031  *             ns = python.PyString_FromStringAndSize(c_tag,   nslen)
21032  *         tag = python.PyString_FromStringAndSize(c_ns_end+1, taglen)
21033  *     elif python.PyString_GET_SIZE(tag) == 0:             # <<<<<<<<<<<<<<
21034  *         raise ValueError, u"Empty tag name"
21035  *     return ns, tag
21036  */
21037   __pyx_t_2 = (PyString_GET_SIZE(__pyx_v_tag) == 0);
21038   if (__pyx_t_2) {
21039
21040     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1360
21041  *         tag = python.PyString_FromStringAndSize(c_ns_end+1, taglen)
21042  *     elif python.PyString_GET_SIZE(tag) == 0:
21043  *         raise ValueError, u"Empty tag name"             # <<<<<<<<<<<<<<
21044  *     return ns, tag
21045  * 
21046  */
21047     __Pyx_Raise(__pyx_builtin_ValueError, ((PyObject *)__pyx_kp_263), 0);
21048     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21049     goto __pyx_L4;
21050   }
21051   __pyx_L4:;
21052
21053   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1361
21054  *     elif python.PyString_GET_SIZE(tag) == 0:
21055  *         raise ValueError, u"Empty tag name"
21056  *     return ns, tag             # <<<<<<<<<<<<<<
21057  * 
21058  * cdef inline int _pyXmlNameIsValid(name_utf8):
21059  */
21060   __Pyx_XDECREF(__pyx_r);
21061   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21062   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
21063   __Pyx_INCREF(__pyx_v_ns);
21064   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_ns);
21065   __Pyx_GIVEREF(__pyx_v_ns);
21066   __Pyx_INCREF(__pyx_v_tag);
21067   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_tag);
21068   __Pyx_GIVEREF(__pyx_v_tag);
21069   __pyx_r = ((PyObject *)__pyx_t_3);
21070   __pyx_t_3 = 0;
21071   goto __pyx_L0;
21072
21073   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21074   goto __pyx_L0;
21075   __pyx_L1_error:;
21076   __Pyx_XDECREF(__pyx_t_3);
21077   __Pyx_AddTraceback("lxml.etree._getNsTag");
21078   __pyx_r = 0;
21079   __pyx_L0:;
21080   __Pyx_DECREF(__pyx_v_ns);
21081   __Pyx_DECREF(__pyx_v_tag);
21082   __Pyx_XGIVEREF(__pyx_r);
21083   __Pyx_FinishRefcountContext();
21084   return __pyx_r;
21085 }
21086
21087 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1363
21088  *     return ns, tag
21089  * 
21090  * cdef inline int _pyXmlNameIsValid(name_utf8):             # <<<<<<<<<<<<<<
21091  *     return _xmlNameIsValid(_cstr(name_utf8))
21092  * 
21093  */
21094
21095 static INLINE int __pyx_f_4lxml_5etree__pyXmlNameIsValid(PyObject *__pyx_v_name_utf8) {
21096   int __pyx_r;
21097   __Pyx_SetupRefcountContext("_pyXmlNameIsValid");
21098
21099   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1364
21100  * 
21101  * cdef inline int _pyXmlNameIsValid(name_utf8):
21102  *     return _xmlNameIsValid(_cstr(name_utf8))             # <<<<<<<<<<<<<<
21103  * 
21104  * cdef inline int _pyHtmlNameIsValid(name_utf8):
21105  */
21106   __pyx_r = __pyx_f_4lxml_5etree__xmlNameIsValid(PyString_AS_STRING(__pyx_v_name_utf8));
21107   goto __pyx_L0;
21108
21109   __pyx_r = 0;
21110   __pyx_L0:;
21111   __Pyx_FinishRefcountContext();
21112   return __pyx_r;
21113 }
21114
21115 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1366
21116  *     return _xmlNameIsValid(_cstr(name_utf8))
21117  * 
21118  * cdef inline int _pyHtmlNameIsValid(name_utf8):             # <<<<<<<<<<<<<<
21119  *     return _htmlNameIsValid(_cstr(name_utf8))
21120  * 
21121  */
21122
21123 static INLINE int __pyx_f_4lxml_5etree__pyHtmlNameIsValid(PyObject *__pyx_v_name_utf8) {
21124   int __pyx_r;
21125   __Pyx_SetupRefcountContext("_pyHtmlNameIsValid");
21126
21127   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1367
21128  * 
21129  * cdef inline int _pyHtmlNameIsValid(name_utf8):
21130  *     return _htmlNameIsValid(_cstr(name_utf8))             # <<<<<<<<<<<<<<
21131  * 
21132  * cdef inline int _xmlNameIsValid(char* c_name):
21133  */
21134   __pyx_r = __pyx_f_4lxml_5etree__htmlNameIsValid(PyString_AS_STRING(__pyx_v_name_utf8));
21135   goto __pyx_L0;
21136
21137   __pyx_r = 0;
21138   __pyx_L0:;
21139   __Pyx_FinishRefcountContext();
21140   return __pyx_r;
21141 }
21142
21143 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1369
21144  *     return _htmlNameIsValid(_cstr(name_utf8))
21145  * 
21146  * cdef inline int _xmlNameIsValid(char* c_name):             # <<<<<<<<<<<<<<
21147  *     return tree.xmlValidateNCName(c_name, 0) == 0
21148  * 
21149  */
21150
21151 static INLINE int __pyx_f_4lxml_5etree__xmlNameIsValid(char *__pyx_v_c_name) {
21152   int __pyx_r;
21153   __Pyx_SetupRefcountContext("_xmlNameIsValid");
21154
21155   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1370
21156  * 
21157  * cdef inline int _xmlNameIsValid(char* c_name):
21158  *     return tree.xmlValidateNCName(c_name, 0) == 0             # <<<<<<<<<<<<<<
21159  * 
21160  * cdef int _htmlNameIsValid(char* c_name):
21161  */
21162   __pyx_r = (xmlValidateNCName(__pyx_v_c_name, 0) == 0);
21163   goto __pyx_L0;
21164
21165   __pyx_r = 0;
21166   __pyx_L0:;
21167   __Pyx_FinishRefcountContext();
21168   return __pyx_r;
21169 }
21170
21171 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1372
21172  *     return tree.xmlValidateNCName(c_name, 0) == 0
21173  * 
21174  * cdef int _htmlNameIsValid(char* c_name):             # <<<<<<<<<<<<<<
21175  *     cdef char c
21176  *     if c_name is NULL or c_name[0] == c'\0':
21177  */
21178
21179 static  int __pyx_f_4lxml_5etree__htmlNameIsValid(char *__pyx_v_c_name) {
21180   char __pyx_v_c;
21181   int __pyx_r;
21182   int __pyx_t_1;
21183   __Pyx_SetupRefcountContext("_htmlNameIsValid");
21184
21185   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1374
21186  * cdef int _htmlNameIsValid(char* c_name):
21187  *     cdef char c
21188  *     if c_name is NULL or c_name[0] == c'\0':             # <<<<<<<<<<<<<<
21189  *         return 0
21190  *     while c_name[0] != c'\0':
21191  */
21192   if (!(__pyx_v_c_name == NULL)) {
21193     __pyx_t_1 = ((__pyx_v_c_name[0]) == '\x00');
21194   } else {
21195     __pyx_t_1 = (__pyx_v_c_name == NULL);
21196   }
21197   if (__pyx_t_1) {
21198
21199     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1375
21200  *     cdef char c
21201  *     if c_name is NULL or c_name[0] == c'\0':
21202  *         return 0             # <<<<<<<<<<<<<<
21203  *     while c_name[0] != c'\0':
21204  *         c = c_name[0]
21205  */
21206     __pyx_r = 0;
21207     goto __pyx_L0;
21208     goto __pyx_L3;
21209   }
21210   __pyx_L3:;
21211
21212   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1376
21213  *     if c_name is NULL or c_name[0] == c'\0':
21214  *         return 0
21215  *     while c_name[0] != c'\0':             # <<<<<<<<<<<<<<
21216  *         c = c_name[0]
21217  *         if c in (c'&', c'<', c'>', c'/', c'"', c"'",
21218  */
21219   while (1) {
21220     __pyx_t_1 = ((__pyx_v_c_name[0]) != '\x00');
21221     if (!__pyx_t_1) break;
21222
21223     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1377
21224  *         return 0
21225  *     while c_name[0] != c'\0':
21226  *         c = c_name[0]             # <<<<<<<<<<<<<<
21227  *         if c in (c'&', c'<', c'>', c'/', c'"', c"'",
21228  *                  c'\t', c'\n', c'\x0B', c'\x0C', c'\r', c' '):
21229  */
21230     __pyx_v_c = (__pyx_v_c_name[0]);
21231
21232     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1378
21233  *     while c_name[0] != c'\0':
21234  *         c = c_name[0]
21235  *         if c in (c'&', c'<', c'>', c'/', c'"', c"'",             # <<<<<<<<<<<<<<
21236  *                  c'\t', c'\n', c'\x0B', c'\x0C', c'\r', c' '):
21237  *             return 0
21238  */
21239     switch (__pyx_v_c) {
21240       case '&':
21241       case '<':
21242       case '>':
21243       case '/':
21244       case '"':
21245       case '\'':
21246
21247       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1379
21248  *         c = c_name[0]
21249  *         if c in (c'&', c'<', c'>', c'/', c'"', c"'",
21250  *                  c'\t', c'\n', c'\x0B', c'\x0C', c'\r', c' '):             # <<<<<<<<<<<<<<
21251  *             return 0
21252  *         c_name = c_name + 1
21253  */
21254       case '\t':
21255       case '\n':
21256       case '\x0B':
21257       case '\x0C':
21258       case '\r':
21259       case ' ':
21260
21261       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1380
21262  *         if c in (c'&', c'<', c'>', c'/', c'"', c"'",
21263  *                  c'\t', c'\n', c'\x0B', c'\x0C', c'\r', c' '):
21264  *             return 0             # <<<<<<<<<<<<<<
21265  *         c_name = c_name + 1
21266  *     return 1
21267  */
21268       __pyx_r = 0;
21269       goto __pyx_L0;
21270       break;
21271     }
21272
21273     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1381
21274  *                  c'\t', c'\n', c'\x0B', c'\x0C', c'\r', c' '):
21275  *             return 0
21276  *         c_name = c_name + 1             # <<<<<<<<<<<<<<
21277  *     return 1
21278  * 
21279  */
21280     __pyx_v_c_name = (__pyx_v_c_name + 1);
21281   }
21282
21283   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1382
21284  *             return 0
21285  *         c_name = c_name + 1
21286  *     return 1             # <<<<<<<<<<<<<<
21287  * 
21288  * cdef bint _characterReferenceIsValid(char* c_name):
21289  */
21290   __pyx_r = 1;
21291   goto __pyx_L0;
21292
21293   __pyx_r = 0;
21294   __pyx_L0:;
21295   __Pyx_FinishRefcountContext();
21296   return __pyx_r;
21297 }
21298
21299 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1384
21300  *     return 1
21301  * 
21302  * cdef bint _characterReferenceIsValid(char* c_name):             # <<<<<<<<<<<<<<
21303  *     cdef bint is_hex
21304  *     if c_name[0] == c'x':
21305  */
21306
21307 static  int __pyx_f_4lxml_5etree__characterReferenceIsValid(char *__pyx_v_c_name) {
21308   int __pyx_v_is_hex;
21309   int __pyx_r;
21310   int __pyx_t_1;
21311   int __pyx_t_2;
21312   __Pyx_SetupRefcountContext("_characterReferenceIsValid");
21313
21314   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1386
21315  * cdef bint _characterReferenceIsValid(char* c_name):
21316  *     cdef bint is_hex
21317  *     if c_name[0] == c'x':             # <<<<<<<<<<<<<<
21318  *         c_name += 1
21319  *         is_hex = 1
21320  */
21321   __pyx_t_1 = ((__pyx_v_c_name[0]) == 'x');
21322   if (__pyx_t_1) {
21323
21324     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1387
21325  *     cdef bint is_hex
21326  *     if c_name[0] == c'x':
21327  *         c_name += 1             # <<<<<<<<<<<<<<
21328  *         is_hex = 1
21329  *     else:
21330  */
21331     __pyx_v_c_name += 1;
21332
21333     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1388
21334  *     if c_name[0] == c'x':
21335  *         c_name += 1
21336  *         is_hex = 1             # <<<<<<<<<<<<<<
21337  *     else:
21338  *         is_hex = 0
21339  */
21340     __pyx_v_is_hex = 1;
21341     goto __pyx_L3;
21342   }
21343   /*else*/ {
21344
21345     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1390
21346  *         is_hex = 1
21347  *     else:
21348  *         is_hex = 0             # <<<<<<<<<<<<<<
21349  *     if c_name[0] == c'\0':
21350  *         return 0
21351  */
21352     __pyx_v_is_hex = 0;
21353   }
21354   __pyx_L3:;
21355
21356   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1391
21357  *     else:
21358  *         is_hex = 0
21359  *     if c_name[0] == c'\0':             # <<<<<<<<<<<<<<
21360  *         return 0
21361  *     while c_name[0] != c'\0':
21362  */
21363   __pyx_t_1 = ((__pyx_v_c_name[0]) == '\x00');
21364   if (__pyx_t_1) {
21365
21366     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1392
21367  *         is_hex = 0
21368  *     if c_name[0] == c'\0':
21369  *         return 0             # <<<<<<<<<<<<<<
21370  *     while c_name[0] != c'\0':
21371  *         if c_name[0] < c'0' or c_name[0] > c'9':
21372  */
21373     __pyx_r = 0;
21374     goto __pyx_L0;
21375     goto __pyx_L4;
21376   }
21377   __pyx_L4:;
21378
21379   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1393
21380  *     if c_name[0] == c'\0':
21381  *         return 0
21382  *     while c_name[0] != c'\0':             # <<<<<<<<<<<<<<
21383  *         if c_name[0] < c'0' or c_name[0] > c'9':
21384  *             if not is_hex:
21385  */
21386   while (1) {
21387     __pyx_t_1 = ((__pyx_v_c_name[0]) != '\x00');
21388     if (!__pyx_t_1) break;
21389
21390     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1394
21391  *         return 0
21392  *     while c_name[0] != c'\0':
21393  *         if c_name[0] < c'0' or c_name[0] > c'9':             # <<<<<<<<<<<<<<
21394  *             if not is_hex:
21395  *                 return 0
21396  */
21397     if (!((__pyx_v_c_name[0]) < '0')) {
21398       __pyx_t_1 = ((__pyx_v_c_name[0]) > '9');
21399     } else {
21400       __pyx_t_1 = ((__pyx_v_c_name[0]) < '0');
21401     }
21402     if (__pyx_t_1) {
21403
21404       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1395
21405  *     while c_name[0] != c'\0':
21406  *         if c_name[0] < c'0' or c_name[0] > c'9':
21407  *             if not is_hex:             # <<<<<<<<<<<<<<
21408  *                 return 0
21409  *             if not (c_name[0] >= c'a' and c_name[0] <= c'f'):
21410  */
21411       __pyx_t_1 = (!__pyx_v_is_hex);
21412       if (__pyx_t_1) {
21413
21414         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1396
21415  *         if c_name[0] < c'0' or c_name[0] > c'9':
21416  *             if not is_hex:
21417  *                 return 0             # <<<<<<<<<<<<<<
21418  *             if not (c_name[0] >= c'a' and c_name[0] <= c'f'):
21419  *                 if not (c_name[0] >= c'A' and c_name[0] <= c'F'):
21420  */
21421         __pyx_r = 0;
21422         goto __pyx_L0;
21423         goto __pyx_L8;
21424       }
21425       __pyx_L8:;
21426
21427       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1397
21428  *             if not is_hex:
21429  *                 return 0
21430  *             if not (c_name[0] >= c'a' and c_name[0] <= c'f'):             # <<<<<<<<<<<<<<
21431  *                 if not (c_name[0] >= c'A' and c_name[0] <= c'F'):
21432  *                     return 0
21433  */
21434       if (((__pyx_v_c_name[0]) >= 'a')) {
21435         __pyx_t_1 = ((__pyx_v_c_name[0]) <= 'f');
21436       } else {
21437         __pyx_t_1 = ((__pyx_v_c_name[0]) >= 'a');
21438       }
21439       __pyx_t_2 = (!__pyx_t_1);
21440       if (__pyx_t_2) {
21441
21442         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1398
21443  *                 return 0
21444  *             if not (c_name[0] >= c'a' and c_name[0] <= c'f'):
21445  *                 if not (c_name[0] >= c'A' and c_name[0] <= c'F'):             # <<<<<<<<<<<<<<
21446  *                     return 0
21447  *         c_name += 1
21448  */
21449         if (((__pyx_v_c_name[0]) >= 'A')) {
21450           __pyx_t_2 = ((__pyx_v_c_name[0]) <= 'F');
21451         } else {
21452           __pyx_t_2 = ((__pyx_v_c_name[0]) >= 'A');
21453         }
21454         __pyx_t_1 = (!__pyx_t_2);
21455         if (__pyx_t_1) {
21456
21457           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1399
21458  *             if not (c_name[0] >= c'a' and c_name[0] <= c'f'):
21459  *                 if not (c_name[0] >= c'A' and c_name[0] <= c'F'):
21460  *                     return 0             # <<<<<<<<<<<<<<
21461  *         c_name += 1
21462  *     return 1
21463  */
21464           __pyx_r = 0;
21465           goto __pyx_L0;
21466           goto __pyx_L10;
21467         }
21468         __pyx_L10:;
21469         goto __pyx_L9;
21470       }
21471       __pyx_L9:;
21472       goto __pyx_L7;
21473     }
21474     __pyx_L7:;
21475
21476     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1400
21477  *                 if not (c_name[0] >= c'A' and c_name[0] <= c'F'):
21478  *                     return 0
21479  *         c_name += 1             # <<<<<<<<<<<<<<
21480  *     return 1
21481  * 
21482  */
21483     __pyx_v_c_name += 1;
21484   }
21485
21486   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1401
21487  *                     return 0
21488  *         c_name += 1
21489  *     return 1             # <<<<<<<<<<<<<<
21490  * 
21491  * cdef int _tagValidOrRaise(tag_utf) except -1:
21492  */
21493   __pyx_r = 1;
21494   goto __pyx_L0;
21495
21496   __pyx_r = 0;
21497   __pyx_L0:;
21498   __Pyx_FinishRefcountContext();
21499   return __pyx_r;
21500 }
21501
21502 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1403
21503  *     return 1
21504  * 
21505  * cdef int _tagValidOrRaise(tag_utf) except -1:             # <<<<<<<<<<<<<<
21506  *     if not _pyXmlNameIsValid(tag_utf):
21507  *         raise ValueError, u"Invalid tag name %r" % \
21508  */
21509
21510 static  int __pyx_f_4lxml_5etree__tagValidOrRaise(PyObject *__pyx_v_tag_utf) {
21511   int __pyx_r;
21512   int __pyx_t_1;
21513   PyObject *__pyx_t_2 = NULL;
21514   PyObject *__pyx_t_3 = NULL;
21515   __Pyx_SetupRefcountContext("_tagValidOrRaise");
21516
21517   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1404
21518  * 
21519  * cdef int _tagValidOrRaise(tag_utf) except -1:
21520  *     if not _pyXmlNameIsValid(tag_utf):             # <<<<<<<<<<<<<<
21521  *         raise ValueError, u"Invalid tag name %r" % \
21522  *             python.PyUnicode_FromEncodedObject(tag_utf, 'UTF-8', NULL)
21523  */
21524   __pyx_t_1 = (!__pyx_f_4lxml_5etree__pyXmlNameIsValid(__pyx_v_tag_utf));
21525   if (__pyx_t_1) {
21526
21527     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1406
21528  *     if not _pyXmlNameIsValid(tag_utf):
21529  *         raise ValueError, u"Invalid tag name %r" % \
21530  *             python.PyUnicode_FromEncodedObject(tag_utf, 'UTF-8', NULL)             # <<<<<<<<<<<<<<
21531  *     return 0
21532  * 
21533  */
21534     __pyx_t_2 = PyUnicode_FromEncodedObject(__pyx_v_tag_utf, __pyx_k_265, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21535     __Pyx_GOTREF(__pyx_t_2);
21536     __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_264), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21537     __Pyx_GOTREF(__pyx_t_3);
21538     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21539     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_3, 0);
21540     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21541     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21542     goto __pyx_L3;
21543   }
21544   __pyx_L3:;
21545
21546   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1407
21547  *         raise ValueError, u"Invalid tag name %r" % \
21548  *             python.PyUnicode_FromEncodedObject(tag_utf, 'UTF-8', NULL)
21549  *     return 0             # <<<<<<<<<<<<<<
21550  * 
21551  * cdef int _htmlTagValidOrRaise(tag_utf) except -1:
21552  */
21553   __pyx_r = 0;
21554   goto __pyx_L0;
21555
21556   __pyx_r = 0;
21557   goto __pyx_L0;
21558   __pyx_L1_error:;
21559   __Pyx_XDECREF(__pyx_t_2);
21560   __Pyx_XDECREF(__pyx_t_3);
21561   __Pyx_AddTraceback("lxml.etree._tagValidOrRaise");
21562   __pyx_r = -1;
21563   __pyx_L0:;
21564   __Pyx_FinishRefcountContext();
21565   return __pyx_r;
21566 }
21567
21568 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1409
21569  *     return 0
21570  * 
21571  * cdef int _htmlTagValidOrRaise(tag_utf) except -1:             # <<<<<<<<<<<<<<
21572  *     if not _pyHtmlNameIsValid(tag_utf):
21573  *         raise ValueError, u"Invalid HTML tag name %r" % \
21574  */
21575
21576 static  int __pyx_f_4lxml_5etree__htmlTagValidOrRaise(PyObject *__pyx_v_tag_utf) {
21577   int __pyx_r;
21578   int __pyx_t_1;
21579   PyObject *__pyx_t_2 = NULL;
21580   PyObject *__pyx_t_3 = NULL;
21581   __Pyx_SetupRefcountContext("_htmlTagValidOrRaise");
21582
21583   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1410
21584  * 
21585  * cdef int _htmlTagValidOrRaise(tag_utf) except -1:
21586  *     if not _pyHtmlNameIsValid(tag_utf):             # <<<<<<<<<<<<<<
21587  *         raise ValueError, u"Invalid HTML tag name %r" % \
21588  *             python.PyUnicode_FromEncodedObject(tag_utf, 'UTF-8', NULL)
21589  */
21590   __pyx_t_1 = (!__pyx_f_4lxml_5etree__pyHtmlNameIsValid(__pyx_v_tag_utf));
21591   if (__pyx_t_1) {
21592
21593     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1412
21594  *     if not _pyHtmlNameIsValid(tag_utf):
21595  *         raise ValueError, u"Invalid HTML tag name %r" % \
21596  *             python.PyUnicode_FromEncodedObject(tag_utf, 'UTF-8', NULL)             # <<<<<<<<<<<<<<
21597  *     return 0
21598  * 
21599  */
21600     __pyx_t_2 = PyUnicode_FromEncodedObject(__pyx_v_tag_utf, __pyx_k_267, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21601     __Pyx_GOTREF(__pyx_t_2);
21602     __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_266), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21603     __Pyx_GOTREF(__pyx_t_3);
21604     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21605     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_3, 0);
21606     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21607     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21608     goto __pyx_L3;
21609   }
21610   __pyx_L3:;
21611
21612   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1413
21613  *         raise ValueError, u"Invalid HTML tag name %r" % \
21614  *             python.PyUnicode_FromEncodedObject(tag_utf, 'UTF-8', NULL)
21615  *     return 0             # <<<<<<<<<<<<<<
21616  * 
21617  * cdef int _attributeValidOrRaise(name_utf) except -1:
21618  */
21619   __pyx_r = 0;
21620   goto __pyx_L0;
21621
21622   __pyx_r = 0;
21623   goto __pyx_L0;
21624   __pyx_L1_error:;
21625   __Pyx_XDECREF(__pyx_t_2);
21626   __Pyx_XDECREF(__pyx_t_3);
21627   __Pyx_AddTraceback("lxml.etree._htmlTagValidOrRaise");
21628   __pyx_r = -1;
21629   __pyx_L0:;
21630   __Pyx_FinishRefcountContext();
21631   return __pyx_r;
21632 }
21633
21634 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1415
21635  *     return 0
21636  * 
21637  * cdef int _attributeValidOrRaise(name_utf) except -1:             # <<<<<<<<<<<<<<
21638  *     if not _pyXmlNameIsValid(name_utf):
21639  *         raise ValueError, u"Invalid attribute name %r" % \
21640  */
21641
21642 static  int __pyx_f_4lxml_5etree__attributeValidOrRaise(PyObject *__pyx_v_name_utf) {
21643   int __pyx_r;
21644   int __pyx_t_1;
21645   PyObject *__pyx_t_2 = NULL;
21646   PyObject *__pyx_t_3 = NULL;
21647   __Pyx_SetupRefcountContext("_attributeValidOrRaise");
21648
21649   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1416
21650  * 
21651  * cdef int _attributeValidOrRaise(name_utf) except -1:
21652  *     if not _pyXmlNameIsValid(name_utf):             # <<<<<<<<<<<<<<
21653  *         raise ValueError, u"Invalid attribute name %r" % \
21654  *             python.PyUnicode_FromEncodedObject(name_utf, 'UTF-8', NULL)
21655  */
21656   __pyx_t_1 = (!__pyx_f_4lxml_5etree__pyXmlNameIsValid(__pyx_v_name_utf));
21657   if (__pyx_t_1) {
21658
21659     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1418
21660  *     if not _pyXmlNameIsValid(name_utf):
21661  *         raise ValueError, u"Invalid attribute name %r" % \
21662  *             python.PyUnicode_FromEncodedObject(name_utf, 'UTF-8', NULL)             # <<<<<<<<<<<<<<
21663  *     return 0
21664  * 
21665  */
21666     __pyx_t_2 = PyUnicode_FromEncodedObject(__pyx_v_name_utf, __pyx_k_269, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21667     __Pyx_GOTREF(__pyx_t_2);
21668     __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_268), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21669     __Pyx_GOTREF(__pyx_t_3);
21670     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21671     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_3, 0);
21672     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21673     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21674     goto __pyx_L3;
21675   }
21676   __pyx_L3:;
21677
21678   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1419
21679  *         raise ValueError, u"Invalid attribute name %r" % \
21680  *             python.PyUnicode_FromEncodedObject(name_utf, 'UTF-8', NULL)
21681  *     return 0             # <<<<<<<<<<<<<<
21682  * 
21683  * cdef int _prefixValidOrRaise(tag_utf) except -1:
21684  */
21685   __pyx_r = 0;
21686   goto __pyx_L0;
21687
21688   __pyx_r = 0;
21689   goto __pyx_L0;
21690   __pyx_L1_error:;
21691   __Pyx_XDECREF(__pyx_t_2);
21692   __Pyx_XDECREF(__pyx_t_3);
21693   __Pyx_AddTraceback("lxml.etree._attributeValidOrRaise");
21694   __pyx_r = -1;
21695   __pyx_L0:;
21696   __Pyx_FinishRefcountContext();
21697   return __pyx_r;
21698 }
21699
21700 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1421
21701  *     return 0
21702  * 
21703  * cdef int _prefixValidOrRaise(tag_utf) except -1:             # <<<<<<<<<<<<<<
21704  *     if not _pyXmlNameIsValid(tag_utf):
21705  *         raise ValueError, u"Invalid namespace prefix %r" % \
21706  */
21707
21708 static  int __pyx_f_4lxml_5etree__prefixValidOrRaise(PyObject *__pyx_v_tag_utf) {
21709   int __pyx_r;
21710   int __pyx_t_1;
21711   PyObject *__pyx_t_2 = NULL;
21712   PyObject *__pyx_t_3 = NULL;
21713   __Pyx_SetupRefcountContext("_prefixValidOrRaise");
21714
21715   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1422
21716  * 
21717  * cdef int _prefixValidOrRaise(tag_utf) except -1:
21718  *     if not _pyXmlNameIsValid(tag_utf):             # <<<<<<<<<<<<<<
21719  *         raise ValueError, u"Invalid namespace prefix %r" % \
21720  *             python.PyUnicode_FromEncodedObject(tag_utf, 'UTF-8', NULL)
21721  */
21722   __pyx_t_1 = (!__pyx_f_4lxml_5etree__pyXmlNameIsValid(__pyx_v_tag_utf));
21723   if (__pyx_t_1) {
21724
21725     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1424
21726  *     if not _pyXmlNameIsValid(tag_utf):
21727  *         raise ValueError, u"Invalid namespace prefix %r" % \
21728  *             python.PyUnicode_FromEncodedObject(tag_utf, 'UTF-8', NULL)             # <<<<<<<<<<<<<<
21729  *     return 0
21730  * 
21731  */
21732     __pyx_t_2 = PyUnicode_FromEncodedObject(__pyx_v_tag_utf, __pyx_k_271, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21733     __Pyx_GOTREF(__pyx_t_2);
21734     __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_270), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21735     __Pyx_GOTREF(__pyx_t_3);
21736     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21737     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_3, 0);
21738     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21739     {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21740     goto __pyx_L3;
21741   }
21742   __pyx_L3:;
21743
21744   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1425
21745  *         raise ValueError, u"Invalid namespace prefix %r" % \
21746  *             python.PyUnicode_FromEncodedObject(tag_utf, 'UTF-8', NULL)
21747  *     return 0             # <<<<<<<<<<<<<<
21748  * 
21749  * cdef inline object _namespacedName(xmlNode* c_node):
21750  */
21751   __pyx_r = 0;
21752   goto __pyx_L0;
21753
21754   __pyx_r = 0;
21755   goto __pyx_L0;
21756   __pyx_L1_error:;
21757   __Pyx_XDECREF(__pyx_t_2);
21758   __Pyx_XDECREF(__pyx_t_3);
21759   __Pyx_AddTraceback("lxml.etree._prefixValidOrRaise");
21760   __pyx_r = -1;
21761   __pyx_L0:;
21762   __Pyx_FinishRefcountContext();
21763   return __pyx_r;
21764 }
21765
21766 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1427
21767  *     return 0
21768  * 
21769  * cdef inline object _namespacedName(xmlNode* c_node):             # <<<<<<<<<<<<<<
21770  *     return _namespacedNameFromNsName(_getNs(c_node), c_node.name)
21771  * 
21772  */
21773
21774 static INLINE PyObject *__pyx_f_4lxml_5etree__namespacedName(xmlNode *__pyx_v_c_node) {
21775   PyObject *__pyx_r = NULL;
21776   PyObject *__pyx_t_1 = NULL;
21777   __Pyx_SetupRefcountContext("_namespacedName");
21778
21779   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1428
21780  * 
21781  * cdef inline object _namespacedName(xmlNode* c_node):
21782  *     return _namespacedNameFromNsName(_getNs(c_node), c_node.name)             # <<<<<<<<<<<<<<
21783  * 
21784  * cdef object _namespacedNameFromNsName(char* href, char* name):
21785  */
21786   __Pyx_XDECREF(__pyx_r);
21787   __pyx_t_1 = __pyx_f_4lxml_5etree__namespacedNameFromNsName(_getNs(__pyx_v_c_node), __pyx_v_c_node->name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21788   __Pyx_GOTREF(__pyx_t_1);
21789   __pyx_r = __pyx_t_1;
21790   __pyx_t_1 = 0;
21791   goto __pyx_L0;
21792
21793   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21794   goto __pyx_L0;
21795   __pyx_L1_error:;
21796   __Pyx_XDECREF(__pyx_t_1);
21797   __Pyx_AddTraceback("lxml.etree._namespacedName");
21798   __pyx_r = 0;
21799   __pyx_L0:;
21800   __Pyx_XGIVEREF(__pyx_r);
21801   __Pyx_FinishRefcountContext();
21802   return __pyx_r;
21803 }
21804
21805 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1430
21806  *     return _namespacedNameFromNsName(_getNs(c_node), c_node.name)
21807  * 
21808  * cdef object _namespacedNameFromNsName(char* href, char* name):             # <<<<<<<<<<<<<<
21809  *     if href is NULL:
21810  *         return funicode(name)
21811  */
21812
21813 static  PyObject *__pyx_f_4lxml_5etree__namespacedNameFromNsName(char *__pyx_v_href, char *__pyx_v_name) {
21814   PyObject *__pyx_v_s;
21815   PyObject *__pyx_r = NULL;
21816   int __pyx_t_1;
21817   PyObject *__pyx_t_2 = NULL;
21818   __Pyx_SetupRefcountContext("_namespacedNameFromNsName");
21819   __pyx_v_s = Py_None; __Pyx_INCREF(Py_None);
21820
21821   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1431
21822  * 
21823  * cdef object _namespacedNameFromNsName(char* href, char* name):
21824  *     if href is NULL:             # <<<<<<<<<<<<<<
21825  *         return funicode(name)
21826  *     elif python.IS_PYTHON3:
21827  */
21828   __pyx_t_1 = (__pyx_v_href == NULL);
21829   if (__pyx_t_1) {
21830
21831     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1432
21832  * cdef object _namespacedNameFromNsName(char* href, char* name):
21833  *     if href is NULL:
21834  *         return funicode(name)             # <<<<<<<<<<<<<<
21835  *     elif python.IS_PYTHON3:
21836  *         return python.PyUnicode_FromFormat("{%s}%s", href, name)
21837  */
21838     __Pyx_XDECREF(__pyx_r);
21839     __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21840     __Pyx_GOTREF(__pyx_t_2);
21841     __pyx_r = __pyx_t_2;
21842     __pyx_t_2 = 0;
21843     goto __pyx_L0;
21844     goto __pyx_L3;
21845   }
21846
21847   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1433
21848  *     if href is NULL:
21849  *         return funicode(name)
21850  *     elif python.IS_PYTHON3:             # <<<<<<<<<<<<<<
21851  *         return python.PyUnicode_FromFormat("{%s}%s", href, name)
21852  *     else:
21853  */
21854   __pyx_t_1 = IS_PYTHON3;
21855   if (__pyx_t_1) {
21856
21857     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1434
21858  *         return funicode(name)
21859  *     elif python.IS_PYTHON3:
21860  *         return python.PyUnicode_FromFormat("{%s}%s", href, name)             # <<<<<<<<<<<<<<
21861  *     else:
21862  *         s = python.PyString_FromFormat("{%s}%s", href, name)
21863  */
21864     __Pyx_XDECREF(__pyx_r);
21865     __pyx_t_2 = PyUnicode_FromFormat(__pyx_k_272, __pyx_v_href, __pyx_v_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21866     __Pyx_GOTREF(__pyx_t_2);
21867     __pyx_r = __pyx_t_2;
21868     __pyx_t_2 = 0;
21869     goto __pyx_L0;
21870     goto __pyx_L3;
21871   }
21872   /*else*/ {
21873
21874     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1436
21875  *         return python.PyUnicode_FromFormat("{%s}%s", href, name)
21876  *     else:
21877  *         s = python.PyString_FromFormat("{%s}%s", href, name)             # <<<<<<<<<<<<<<
21878  *         if isutf8(href) or isutf8(name):
21879  *             return python.PyUnicode_FromEncodedObject(s, 'UTF-8', NULL)
21880  */
21881     __pyx_t_2 = PyString_FromFormat(__pyx_k_273, __pyx_v_href, __pyx_v_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21882     __Pyx_GOTREF(__pyx_t_2);
21883     __Pyx_DECREF(__pyx_v_s);
21884     __pyx_v_s = __pyx_t_2;
21885     __pyx_t_2 = 0;
21886
21887     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1437
21888  *     else:
21889  *         s = python.PyString_FromFormat("{%s}%s", href, name)
21890  *         if isutf8(href) or isutf8(name):             # <<<<<<<<<<<<<<
21891  *             return python.PyUnicode_FromEncodedObject(s, 'UTF-8', NULL)
21892  *         else:
21893  */
21894     if (!__pyx_f_4lxml_5etree_isutf8(__pyx_v_href)) {
21895       __pyx_t_1 = __pyx_f_4lxml_5etree_isutf8(__pyx_v_name);
21896     } else {
21897       __pyx_t_1 = __pyx_f_4lxml_5etree_isutf8(__pyx_v_href);
21898     }
21899     if (__pyx_t_1) {
21900
21901       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1438
21902  *         s = python.PyString_FromFormat("{%s}%s", href, name)
21903  *         if isutf8(href) or isutf8(name):
21904  *             return python.PyUnicode_FromEncodedObject(s, 'UTF-8', NULL)             # <<<<<<<<<<<<<<
21905  *         else:
21906  *             return s
21907  */
21908       __Pyx_XDECREF(__pyx_r);
21909       __pyx_t_2 = PyUnicode_FromEncodedObject(__pyx_v_s, __pyx_k_274, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21910       __Pyx_GOTREF(__pyx_t_2);
21911       __pyx_r = __pyx_t_2;
21912       __pyx_t_2 = 0;
21913       goto __pyx_L0;
21914       goto __pyx_L4;
21915     }
21916     /*else*/ {
21917
21918       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1440
21919  *             return python.PyUnicode_FromEncodedObject(s, 'UTF-8', NULL)
21920  *         else:
21921  *             return s             # <<<<<<<<<<<<<<
21922  * 
21923  * cdef _getFilenameForFile(source):
21924  */
21925       __Pyx_XDECREF(__pyx_r);
21926       __Pyx_INCREF(__pyx_v_s);
21927       __pyx_r = __pyx_v_s;
21928       goto __pyx_L0;
21929     }
21930     __pyx_L4:;
21931   }
21932   __pyx_L3:;
21933
21934   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
21935   goto __pyx_L0;
21936   __pyx_L1_error:;
21937   __Pyx_XDECREF(__pyx_t_2);
21938   __Pyx_AddTraceback("lxml.etree._namespacedNameFromNsName");
21939   __pyx_r = 0;
21940   __pyx_L0:;
21941   __Pyx_DECREF(__pyx_v_s);
21942   __Pyx_XGIVEREF(__pyx_r);
21943   __Pyx_FinishRefcountContext();
21944   return __pyx_r;
21945 }
21946
21947 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1442
21948  *             return s
21949  * 
21950  * cdef _getFilenameForFile(source):             # <<<<<<<<<<<<<<
21951  *     u"""Given a Python File or Gzip object, give filename back.
21952  * 
21953  */
21954
21955 static  PyObject *__pyx_f_4lxml_5etree__getFilenameForFile(PyObject *__pyx_v_source) {
21956   PyObject *__pyx_v_filename;
21957   PyObject *__pyx_v_geturl;
21958   PyObject *__pyx_r = NULL;
21959   PyObject *__pyx_t_1 = NULL;
21960   int __pyx_t_2;
21961   PyObject *__pyx_t_3 = NULL;
21962   __Pyx_SetupRefcountContext("_getFilenameForFile");
21963   __pyx_v_filename = Py_None; __Pyx_INCREF(Py_None);
21964   __pyx_v_geturl = Py_None; __Pyx_INCREF(Py_None);
21965
21966   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1448
21967  *     """
21968  *     # file instances have a name attribute
21969  *     filename = getattr3(source, u'name', None)             # <<<<<<<<<<<<<<
21970  *     if filename is not None:
21971  *         return os_path_abspath(filename)
21972  */
21973   __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_source, ((PyObject *)__pyx_kp_275), Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21974   __Pyx_GOTREF(__pyx_t_1);
21975   __Pyx_DECREF(__pyx_v_filename);
21976   __pyx_v_filename = __pyx_t_1;
21977   __pyx_t_1 = 0;
21978
21979   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1449
21980  *     # file instances have a name attribute
21981  *     filename = getattr3(source, u'name', None)
21982  *     if filename is not None:             # <<<<<<<<<<<<<<
21983  *         return os_path_abspath(filename)
21984  *     # urllib2 provides a geturl() method
21985  */
21986   __pyx_t_2 = (__pyx_v_filename != Py_None);
21987   if (__pyx_t_2) {
21988
21989     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1450
21990  *     filename = getattr3(source, u'name', None)
21991  *     if filename is not None:
21992  *         return os_path_abspath(filename)             # <<<<<<<<<<<<<<
21993  *     # urllib2 provides a geturl() method
21994  *     geturl = getattr3(source, u'geturl', None)
21995  */
21996     __Pyx_XDECREF(__pyx_r);
21997     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21998     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
21999     __Pyx_INCREF(__pyx_v_filename);
22000     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
22001     __Pyx_GIVEREF(__pyx_v_filename);
22002     __pyx_t_3 = PyObject_Call(__pyx_v_4lxml_5etree_os_path_abspath, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22003     __Pyx_GOTREF(__pyx_t_3);
22004     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
22005     __pyx_r = __pyx_t_3;
22006     __pyx_t_3 = 0;
22007     goto __pyx_L0;
22008     goto __pyx_L3;
22009   }
22010   __pyx_L3:;
22011
22012   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1452
22013  *         return os_path_abspath(filename)
22014  *     # urllib2 provides a geturl() method
22015  *     geturl = getattr3(source, u'geturl', None)             # <<<<<<<<<<<<<<
22016  *     if geturl is not None:
22017  *         return geturl()
22018  */
22019   __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_source, ((PyObject *)__pyx_kp_276), Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22020   __Pyx_GOTREF(__pyx_t_3);
22021   __Pyx_DECREF(__pyx_v_geturl);
22022   __pyx_v_geturl = __pyx_t_3;
22023   __pyx_t_3 = 0;
22024
22025   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1453
22026  *     # urllib2 provides a geturl() method
22027  *     geturl = getattr3(source, u'geturl', None)
22028  *     if geturl is not None:             # <<<<<<<<<<<<<<
22029  *         return geturl()
22030  *     # gzip file instances have a filename attribute (before Py3k)
22031  */
22032   __pyx_t_2 = (__pyx_v_geturl != Py_None);
22033   if (__pyx_t_2) {
22034
22035     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1454
22036  *     geturl = getattr3(source, u'geturl', None)
22037  *     if geturl is not None:
22038  *         return geturl()             # <<<<<<<<<<<<<<
22039  *     # gzip file instances have a filename attribute (before Py3k)
22040  *     filename = getattr3(source, u'filename', None)
22041  */
22042     __Pyx_XDECREF(__pyx_r);
22043     __pyx_t_3 = PyObject_Call(__pyx_v_geturl, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22044     __Pyx_GOTREF(__pyx_t_3);
22045     __pyx_r = __pyx_t_3;
22046     __pyx_t_3 = 0;
22047     goto __pyx_L0;
22048     goto __pyx_L4;
22049   }
22050   __pyx_L4:;
22051
22052   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1456
22053  *         return geturl()
22054  *     # gzip file instances have a filename attribute (before Py3k)
22055  *     filename = getattr3(source, u'filename', None)             # <<<<<<<<<<<<<<
22056  *     if filename is not None:
22057  *         return os_path_abspath(filename)
22058  */
22059   __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_source, ((PyObject *)__pyx_kp_277), Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22060   __Pyx_GOTREF(__pyx_t_3);
22061   __Pyx_DECREF(__pyx_v_filename);
22062   __pyx_v_filename = __pyx_t_3;
22063   __pyx_t_3 = 0;
22064
22065   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1457
22066  *     # gzip file instances have a filename attribute (before Py3k)
22067  *     filename = getattr3(source, u'filename', None)
22068  *     if filename is not None:             # <<<<<<<<<<<<<<
22069  *         return os_path_abspath(filename)
22070  *     # can't determine filename
22071  */
22072   __pyx_t_2 = (__pyx_v_filename != Py_None);
22073   if (__pyx_t_2) {
22074
22075     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1458
22076  *     filename = getattr3(source, u'filename', None)
22077  *     if filename is not None:
22078  *         return os_path_abspath(filename)             # <<<<<<<<<<<<<<
22079  *     # can't determine filename
22080  *     return None
22081  */
22082     __Pyx_XDECREF(__pyx_r);
22083     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22084     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
22085     __Pyx_INCREF(__pyx_v_filename);
22086     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_filename);
22087     __Pyx_GIVEREF(__pyx_v_filename);
22088     __pyx_t_1 = PyObject_Call(__pyx_v_4lxml_5etree_os_path_abspath, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22089     __Pyx_GOTREF(__pyx_t_1);
22090     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
22091     __pyx_r = __pyx_t_1;
22092     __pyx_t_1 = 0;
22093     goto __pyx_L0;
22094     goto __pyx_L5;
22095   }
22096   __pyx_L5:;
22097
22098   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":1460
22099  *         return os_path_abspath(filename)
22100  *     # can't determine filename
22101  *     return None             # <<<<<<<<<<<<<<
22102  */
22103   __Pyx_XDECREF(__pyx_r);
22104   __Pyx_INCREF(Py_None);
22105   __pyx_r = Py_None;
22106   goto __pyx_L0;
22107
22108   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22109   goto __pyx_L0;
22110   __pyx_L1_error:;
22111   __Pyx_XDECREF(__pyx_t_1);
22112   __Pyx_XDECREF(__pyx_t_3);
22113   __Pyx_AddTraceback("lxml.etree._getFilenameForFile");
22114   __pyx_r = 0;
22115   __pyx_L0:;
22116   __Pyx_DECREF(__pyx_v_filename);
22117   __Pyx_DECREF(__pyx_v_geturl);
22118   __Pyx_XGIVEREF(__pyx_r);
22119   __Pyx_FinishRefcountContext();
22120   return __pyx_r;
22121 }
22122
22123 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":7
22124  * # module level API functions
22125  * 
22126  * def clear_error_log():             # <<<<<<<<<<<<<<
22127  *     u"""clear_error_log()
22128  * 
22129  */
22130
22131 static PyObject *__pyx_pf_4lxml_5etree_clear_error_log(PyObject *__pyx_self, PyObject *unused); /*proto*/
22132 static char __pyx_doc_4lxml_5etree_clear_error_log[] = "clear_error_log()\n\n    Clear the global error log.  Note that this log is already bound to a\n    fixed size.\n\n    Note: since lxml 2.2, the global error log is local to a thread\n    and this function will only clear the global error log of the\n    current thread.\n    ";
22133 static PyObject *__pyx_pf_4lxml_5etree_clear_error_log(PyObject *__pyx_self, PyObject *unused) {
22134   PyObject *__pyx_r = NULL;
22135   PyObject *__pyx_t_1 = NULL;
22136   PyObject *__pyx_t_2 = NULL;
22137   __Pyx_SetupRefcountContext("clear_error_log");
22138   __pyx_self = __pyx_self;
22139
22140   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":17
22141  *     current thread.
22142  *     """
22143  *     _getGlobalErrorLog().clear()             # <<<<<<<<<<<<<<
22144  * 
22145  * # dummy function: no debug output at all
22146  */
22147   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__getGlobalErrorLog()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22148   __Pyx_GOTREF(__pyx_t_1);
22149   __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_kp_clear); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22150   __Pyx_GOTREF(__pyx_t_2);
22151   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22152   __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22153   __Pyx_GOTREF(__pyx_t_1);
22154   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22155   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22156
22157   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22158   goto __pyx_L0;
22159   __pyx_L1_error:;
22160   __Pyx_XDECREF(__pyx_t_1);
22161   __Pyx_XDECREF(__pyx_t_2);
22162   __Pyx_AddTraceback("lxml.etree.clear_error_log");
22163   __pyx_r = NULL;
22164   __pyx_L0:;
22165   __Pyx_XGIVEREF(__pyx_r);
22166   __Pyx_FinishRefcountContext();
22167   return __pyx_r;
22168 }
22169
22170 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":20
22171  * 
22172  * # dummy function: no debug output at all
22173  * cdef void _nullGenericErrorFunc(void* ctxt, char* msg, ...) nogil:             # <<<<<<<<<<<<<<
22174  *     pass
22175  * 
22176  */
22177
22178 static  void __pyx_f_4lxml_5etree__nullGenericErrorFunc(void *__pyx_v_ctxt, char *__pyx_v_msg, ...) {
22179
22180 }
22181
22182 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":25
22183  * # setup for global log:
22184  * 
22185  * cdef void _initThreadLogging():             # <<<<<<<<<<<<<<
22186  *     # disable generic error lines from libxml2
22187  *     xmlerror.xmlThrDefSetGenericErrorFunc(NULL, _nullGenericErrorFunc)
22188  */
22189
22190 static  void __pyx_f_4lxml_5etree__initThreadLogging(void) {
22191   __Pyx_SetupRefcountContext("_initThreadLogging");
22192
22193   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":27
22194  * cdef void _initThreadLogging():
22195  *     # disable generic error lines from libxml2
22196  *     xmlerror.xmlThrDefSetGenericErrorFunc(NULL, _nullGenericErrorFunc)             # <<<<<<<<<<<<<<
22197  *     xmlerror.xmlSetGenericErrorFunc(NULL, _nullGenericErrorFunc)
22198  * 
22199  */
22200   xmlThrDefSetGenericErrorFunc(NULL, __pyx_f_4lxml_5etree__nullGenericErrorFunc);
22201
22202   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":28
22203  *     # disable generic error lines from libxml2
22204  *     xmlerror.xmlThrDefSetGenericErrorFunc(NULL, _nullGenericErrorFunc)
22205  *     xmlerror.xmlSetGenericErrorFunc(NULL, _nullGenericErrorFunc)             # <<<<<<<<<<<<<<
22206  * 
22207  *     # divert error messages to the global error log
22208  */
22209   xmlSetGenericErrorFunc(NULL, __pyx_f_4lxml_5etree__nullGenericErrorFunc);
22210
22211   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":31
22212  * 
22213  *     # divert error messages to the global error log
22214  *     xmlerror.xmlThrDefSetStructuredErrorFunc(NULL, _receiveError)             # <<<<<<<<<<<<<<
22215  *     connectErrorLog(NULL)
22216  * 
22217  */
22218   xmlThrDefSetStructuredErrorFunc(NULL, __pyx_f_4lxml_5etree__receiveError);
22219
22220   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":32
22221  *     # divert error messages to the global error log
22222  *     xmlerror.xmlThrDefSetStructuredErrorFunc(NULL, _receiveError)
22223  *     connectErrorLog(NULL)             # <<<<<<<<<<<<<<
22224  * 
22225  * cdef void connectErrorLog(void* log):
22226  */
22227   __pyx_f_4lxml_5etree_connectErrorLog(NULL);
22228
22229   __Pyx_FinishRefcountContext();
22230 }
22231
22232 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":34
22233  *     connectErrorLog(NULL)
22234  * 
22235  * cdef void connectErrorLog(void* log):             # <<<<<<<<<<<<<<
22236  *     xmlerror.xmlSetStructuredErrorFunc(log, _receiveError)
22237  *     xslt.xsltSetGenericErrorFunc(log, _receiveXSLTError)
22238  */
22239
22240 static  void __pyx_f_4lxml_5etree_connectErrorLog(void *__pyx_v_log) {
22241   __Pyx_SetupRefcountContext("connectErrorLog");
22242
22243   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":35
22244  * 
22245  * cdef void connectErrorLog(void* log):
22246  *     xmlerror.xmlSetStructuredErrorFunc(log, _receiveError)             # <<<<<<<<<<<<<<
22247  *     xslt.xsltSetGenericErrorFunc(log, _receiveXSLTError)
22248  * 
22249  */
22250   xmlSetStructuredErrorFunc(__pyx_v_log, __pyx_f_4lxml_5etree__receiveError);
22251
22252   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":36
22253  * cdef void connectErrorLog(void* log):
22254  *     xmlerror.xmlSetStructuredErrorFunc(log, _receiveError)
22255  *     xslt.xsltSetGenericErrorFunc(log, _receiveXSLTError)             # <<<<<<<<<<<<<<
22256  * 
22257  * 
22258  */
22259   xsltSetGenericErrorFunc(__pyx_v_log, __pyx_f_4lxml_5etree__receiveXSLTError);
22260
22261   __Pyx_FinishRefcountContext();
22262 }
22263
22264 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":50
22265  *     cdef readonly object filename
22266  * 
22267  *     cdef _setError(self, xmlerror.xmlError* error):             # <<<<<<<<<<<<<<
22268  *         cdef int size
22269  *         self.domain   = error.domain
22270  */
22271
22272 static  PyObject *__pyx_f_4lxml_5etree_9_LogEntry__setError(struct __pyx_obj_4lxml_5etree__LogEntry *__pyx_v_self, xmlError *__pyx_v_error) {
22273   int __pyx_v_size;
22274   PyObject *__pyx_r = NULL;
22275   PyObject *__pyx_1 = 0;
22276   PyObject *__pyx_t_1 = NULL;
22277   int __pyx_t_2;
22278   PyObject *__pyx_t_3 = NULL;
22279   PyObject *__pyx_t_4 = NULL;
22280   PyObject *__pyx_t_5 = NULL;
22281   PyObject *__pyx_t_6 = NULL;
22282   PyObject *__pyx_t_7 = NULL;
22283   PyObject *__pyx_t_8 = NULL;
22284   __Pyx_SetupRefcountContext("_setError");
22285
22286   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":52
22287  *     cdef _setError(self, xmlerror.xmlError* error):
22288  *         cdef int size
22289  *         self.domain   = error.domain             # <<<<<<<<<<<<<<
22290  *         self.type     = error.code
22291  *         self.level    = <int>error.level
22292  */
22293   __pyx_t_1 = PyInt_FromLong(__pyx_v_error->domain); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22294   __Pyx_GOTREF(__pyx_t_1);
22295   __Pyx_GIVEREF(__pyx_t_1);
22296   __Pyx_GOTREF(__pyx_v_self->domain);
22297   __Pyx_DECREF(__pyx_v_self->domain);
22298   __pyx_v_self->domain = __pyx_t_1;
22299   __pyx_t_1 = 0;
22300
22301   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":53
22302  *         cdef int size
22303  *         self.domain   = error.domain
22304  *         self.type     = error.code             # <<<<<<<<<<<<<<
22305  *         self.level    = <int>error.level
22306  *         self.line     = error.line
22307  */
22308   __pyx_t_1 = PyInt_FromLong(__pyx_v_error->code); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22309   __Pyx_GOTREF(__pyx_t_1);
22310   __Pyx_GIVEREF(__pyx_t_1);
22311   __Pyx_GOTREF(__pyx_v_self->type);
22312   __Pyx_DECREF(__pyx_v_self->type);
22313   __pyx_v_self->type = __pyx_t_1;
22314   __pyx_t_1 = 0;
22315
22316   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":54
22317  *         self.domain   = error.domain
22318  *         self.type     = error.code
22319  *         self.level    = <int>error.level             # <<<<<<<<<<<<<<
22320  *         self.line     = error.line
22321  *         self.column   = error.int2
22322  */
22323   __pyx_t_1 = PyInt_FromLong(((int)__pyx_v_error->level)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22324   __Pyx_GOTREF(__pyx_t_1);
22325   __Pyx_GIVEREF(__pyx_t_1);
22326   __Pyx_GOTREF(__pyx_v_self->level);
22327   __Pyx_DECREF(__pyx_v_self->level);
22328   __pyx_v_self->level = __pyx_t_1;
22329   __pyx_t_1 = 0;
22330
22331   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":55
22332  *         self.type     = error.code
22333  *         self.level    = <int>error.level
22334  *         self.line     = error.line             # <<<<<<<<<<<<<<
22335  *         self.column   = error.int2
22336  *         size = cstd.strlen(error.message)
22337  */
22338   __pyx_t_1 = PyInt_FromLong(__pyx_v_error->line); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22339   __Pyx_GOTREF(__pyx_t_1);
22340   __Pyx_GIVEREF(__pyx_t_1);
22341   __Pyx_GOTREF(__pyx_v_self->line);
22342   __Pyx_DECREF(__pyx_v_self->line);
22343   __pyx_v_self->line = __pyx_t_1;
22344   __pyx_t_1 = 0;
22345
22346   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":56
22347  *         self.level    = <int>error.level
22348  *         self.line     = error.line
22349  *         self.column   = error.int2             # <<<<<<<<<<<<<<
22350  *         size = cstd.strlen(error.message)
22351  *         if size > 0 and error.message[size-1] == c'\n':
22352  */
22353   __pyx_t_1 = PyInt_FromLong(__pyx_v_error->int2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22354   __Pyx_GOTREF(__pyx_t_1);
22355   __Pyx_GIVEREF(__pyx_t_1);
22356   __Pyx_GOTREF(__pyx_v_self->column);
22357   __Pyx_DECREF(__pyx_v_self->column);
22358   __pyx_v_self->column = __pyx_t_1;
22359   __pyx_t_1 = 0;
22360
22361   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":57
22362  *         self.line     = error.line
22363  *         self.column   = error.int2
22364  *         size = cstd.strlen(error.message)             # <<<<<<<<<<<<<<
22365  *         if size > 0 and error.message[size-1] == c'\n':
22366  *             size = size - 1 # strip EOL
22367  */
22368   __pyx_v_size = strlen(__pyx_v_error->message);
22369
22370   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":58
22371  *         self.column   = error.int2
22372  *         size = cstd.strlen(error.message)
22373  *         if size > 0 and error.message[size-1] == c'\n':             # <<<<<<<<<<<<<<
22374  *             size = size - 1 # strip EOL
22375  *         try:
22376  */
22377   if ((__pyx_v_size > 0)) {
22378     __pyx_t_2 = ((__pyx_v_error->message[(__pyx_v_size - 1)]) == '\n');
22379   } else {
22380     __pyx_t_2 = (__pyx_v_size > 0);
22381   }
22382   if (__pyx_t_2) {
22383
22384     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":59
22385  *         size = cstd.strlen(error.message)
22386  *         if size > 0 and error.message[size-1] == c'\n':
22387  *             size = size - 1 # strip EOL             # <<<<<<<<<<<<<<
22388  *         try:
22389  *             self.message = python.PyUnicode_DecodeUTF8(
22390  */
22391     __pyx_v_size = (__pyx_v_size - 1);
22392     goto __pyx_L3;
22393   }
22394   __pyx_L3:;
22395
22396   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":60
22397  *         if size > 0 and error.message[size-1] == c'\n':
22398  *             size = size - 1 # strip EOL
22399  *         try:             # <<<<<<<<<<<<<<
22400  *             self.message = python.PyUnicode_DecodeUTF8(
22401  *                 error.message, size, NULL)
22402  */
22403   {
22404     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
22405     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
22406     __Pyx_XGOTREF(__pyx_save_exc_type);
22407     __Pyx_XGOTREF(__pyx_save_exc_value);
22408     __Pyx_XGOTREF(__pyx_save_exc_tb);
22409     /*try:*/ {
22410
22411       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":62
22412  *         try:
22413  *             self.message = python.PyUnicode_DecodeUTF8(
22414  *                 error.message, size, NULL)             # <<<<<<<<<<<<<<
22415  *         except:
22416  *             try:
22417  */
22418       __pyx_t_1 = PyUnicode_DecodeUTF8(__pyx_v_error->message, __pyx_v_size, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
22419       __Pyx_GOTREF(__pyx_t_1);
22420
22421       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":61
22422  *             size = size - 1 # strip EOL
22423  *         try:
22424  *             self.message = python.PyUnicode_DecodeUTF8(             # <<<<<<<<<<<<<<
22425  *                 error.message, size, NULL)
22426  *         except:
22427  */
22428       __Pyx_GIVEREF(__pyx_t_1);
22429       __Pyx_GOTREF(__pyx_v_self->message);
22430       __Pyx_DECREF(__pyx_v_self->message);
22431       __pyx_v_self->message = __pyx_t_1;
22432       __pyx_t_1 = 0;
22433     }
22434     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
22435     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
22436     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
22437     goto __pyx_L11_try_end;
22438     __pyx_L4_error:;
22439     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22440
22441     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":63
22442  *             self.message = python.PyUnicode_DecodeUTF8(
22443  *                 error.message, size, NULL)
22444  *         except:             # <<<<<<<<<<<<<<
22445  *             try:
22446  *                 self.message = python.PyUnicode_DecodeASCII(
22447  */
22448     /*except:*/ {
22449       __Pyx_AddTraceback("lxml.etree._setError");
22450       if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
22451       __Pyx_GOTREF(__pyx_t_1);
22452       __Pyx_GOTREF(__pyx_t_3);
22453       __Pyx_GOTREF(__pyx_t_4);
22454
22455       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":64
22456  *                 error.message, size, NULL)
22457  *         except:
22458  *             try:             # <<<<<<<<<<<<<<
22459  *                 self.message = python.PyUnicode_DecodeASCII(
22460  *                     error.message, size, 'backslashreplace')
22461  */
22462       {
22463         PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
22464         __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
22465         __Pyx_XGOTREF(__pyx_save_exc_type);
22466         __Pyx_XGOTREF(__pyx_save_exc_value);
22467         __Pyx_XGOTREF(__pyx_save_exc_tb);
22468         /*try:*/ {
22469
22470           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":65
22471  *         except:
22472  *             try:
22473  *                 self.message = python.PyUnicode_DecodeASCII(             # <<<<<<<<<<<<<<
22474  *                     error.message, size, 'backslashreplace')
22475  *             except:
22476  */
22477           __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_python); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
22478           __Pyx_GOTREF(__pyx_1);
22479           __pyx_t_5 = PyObject_GetAttr(__pyx_1, __pyx_kp_278); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
22480           __Pyx_GOTREF(__pyx_t_5);
22481           __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
22482
22483           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":66
22484  *             try:
22485  *                 self.message = python.PyUnicode_DecodeASCII(
22486  *                     error.message, size, 'backslashreplace')             # <<<<<<<<<<<<<<
22487  *             except:
22488  *                 self.message = u'<undecodable error message>'
22489  */
22490           __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_error->message); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
22491           __Pyx_GOTREF(__pyx_t_6);
22492           __pyx_t_7 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
22493           __Pyx_GOTREF(__pyx_t_7);
22494           __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
22495           __Pyx_GOTREF(((PyObject *)__pyx_t_8));
22496           PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
22497           __Pyx_GIVEREF(__pyx_t_6);
22498           PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7);
22499           __Pyx_GIVEREF(__pyx_t_7);
22500           __Pyx_INCREF(__pyx_kp_279);
22501           PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_kp_279);
22502           __Pyx_GIVEREF(__pyx_kp_279);
22503           __pyx_t_6 = 0;
22504           __pyx_t_7 = 0;
22505           __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
22506           __Pyx_GOTREF(__pyx_t_7);
22507           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22508           __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
22509
22510           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":65
22511  *         except:
22512  *             try:
22513  *                 self.message = python.PyUnicode_DecodeASCII(             # <<<<<<<<<<<<<<
22514  *                     error.message, size, 'backslashreplace')
22515  *             except:
22516  */
22517           __Pyx_GIVEREF(__pyx_t_7);
22518           __Pyx_GOTREF(__pyx_v_self->message);
22519           __Pyx_DECREF(__pyx_v_self->message);
22520           __pyx_v_self->message = __pyx_t_7;
22521           __pyx_t_7 = 0;
22522         }
22523         __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
22524         __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
22525         __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
22526         goto __pyx_L21_try_end;
22527         __pyx_L14_error:;
22528         __Pyx_XDECREF(__pyx_1); __pyx_1 = 0;
22529         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
22530         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
22531         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
22532         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
22533
22534         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":67
22535  *                 self.message = python.PyUnicode_DecodeASCII(
22536  *                     error.message, size, 'backslashreplace')
22537  *             except:             # <<<<<<<<<<<<<<
22538  *                 self.message = u'<undecodable error message>'
22539  *         if error.file is NULL:
22540  */
22541         /*except:*/ {
22542           __Pyx_AddTraceback("lxml.etree._setError");
22543           if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
22544           __Pyx_GOTREF(__pyx_t_7);
22545           __Pyx_GOTREF(__pyx_t_8);
22546           __Pyx_GOTREF(__pyx_t_5);
22547
22548           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":68
22549  *                     error.message, size, 'backslashreplace')
22550  *             except:
22551  *                 self.message = u'<undecodable error message>'             # <<<<<<<<<<<<<<
22552  *         if error.file is NULL:
22553  *             self.filename = u'<string>'
22554  */
22555           __Pyx_INCREF(((PyObject *)__pyx_kp_280));
22556           __Pyx_GIVEREF(((PyObject *)__pyx_kp_280));
22557           __Pyx_GOTREF(__pyx_v_self->message);
22558           __Pyx_DECREF(__pyx_v_self->message);
22559           __pyx_v_self->message = ((PyObject *)__pyx_kp_280);
22560           __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22561           __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
22562           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22563           goto __pyx_L15_exception_handled;
22564         }
22565         __pyx_L16_except_error:;
22566         __Pyx_XDECREF(__pyx_save_exc_type);
22567         __Pyx_XDECREF(__pyx_save_exc_value);
22568         __Pyx_XDECREF(__pyx_save_exc_tb);
22569         goto __pyx_L6_except_error;
22570         __pyx_L15_exception_handled:;
22571         __Pyx_XGIVEREF(__pyx_save_exc_type);
22572         __Pyx_XGIVEREF(__pyx_save_exc_value);
22573         __Pyx_XGIVEREF(__pyx_save_exc_tb);
22574         __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
22575         __pyx_L21_try_end:;
22576       }
22577       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22578       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22579       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22580       goto __pyx_L5_exception_handled;
22581     }
22582     __pyx_L6_except_error:;
22583     __Pyx_XDECREF(__pyx_save_exc_type);
22584     __Pyx_XDECREF(__pyx_save_exc_value);
22585     __Pyx_XDECREF(__pyx_save_exc_tb);
22586     goto __pyx_L1_error;
22587     __pyx_L5_exception_handled:;
22588     __Pyx_XGIVEREF(__pyx_save_exc_type);
22589     __Pyx_XGIVEREF(__pyx_save_exc_value);
22590     __Pyx_XGIVEREF(__pyx_save_exc_tb);
22591     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
22592     __pyx_L11_try_end:;
22593   }
22594
22595   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":69
22596  *             except:
22597  *                 self.message = u'<undecodable error message>'
22598  *         if error.file is NULL:             # <<<<<<<<<<<<<<
22599  *             self.filename = u'<string>'
22600  *         else:
22601  */
22602   __pyx_t_2 = (__pyx_v_error->file == NULL);
22603   if (__pyx_t_2) {
22604
22605     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":70
22606  *                 self.message = u'<undecodable error message>'
22607  *         if error.file is NULL:
22608  *             self.filename = u'<string>'             # <<<<<<<<<<<<<<
22609  *         else:
22610  *             self.filename = _decodeFilename(error.file)
22611  */
22612     __Pyx_INCREF(((PyObject *)__pyx_kp_281));
22613     __Pyx_GIVEREF(((PyObject *)__pyx_kp_281));
22614     __Pyx_GOTREF(__pyx_v_self->filename);
22615     __Pyx_DECREF(__pyx_v_self->filename);
22616     __pyx_v_self->filename = ((PyObject *)__pyx_kp_281);
22617     goto __pyx_L24;
22618   }
22619   /*else*/ {
22620
22621     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":72
22622  *             self.filename = u'<string>'
22623  *         else:
22624  *             self.filename = _decodeFilename(error.file)             # <<<<<<<<<<<<<<
22625  * 
22626  *     cdef _setGeneric(self, int domain, int type, int level, int line,
22627  */
22628     __pyx_t_4 = __pyx_f_4lxml_5etree__decodeFilename(__pyx_v_error->file); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22629     __Pyx_GOTREF(__pyx_t_4);
22630     __Pyx_GIVEREF(__pyx_t_4);
22631     __Pyx_GOTREF(__pyx_v_self->filename);
22632     __Pyx_DECREF(__pyx_v_self->filename);
22633     __pyx_v_self->filename = __pyx_t_4;
22634     __pyx_t_4 = 0;
22635   }
22636   __pyx_L24:;
22637
22638   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22639   goto __pyx_L0;
22640   __pyx_L1_error:;
22641   __Pyx_XDECREF(__pyx_1);
22642   __Pyx_XDECREF(__pyx_t_1);
22643   __Pyx_XDECREF(__pyx_t_3);
22644   __Pyx_XDECREF(__pyx_t_4);
22645   __Pyx_XDECREF(__pyx_t_5);
22646   __Pyx_XDECREF(__pyx_t_6);
22647   __Pyx_XDECREF(__pyx_t_7);
22648   __Pyx_XDECREF(__pyx_t_8);
22649   __Pyx_AddTraceback("lxml.etree._LogEntry._setError");
22650   __pyx_r = 0;
22651   __pyx_L0:;
22652   __Pyx_XGIVEREF(__pyx_r);
22653   __Pyx_FinishRefcountContext();
22654   return __pyx_r;
22655 }
22656
22657 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":74
22658  *             self.filename = _decodeFilename(error.file)
22659  * 
22660  *     cdef _setGeneric(self, int domain, int type, int level, int line,             # <<<<<<<<<<<<<<
22661  *                      message, filename):
22662  *         self.domain  = domain
22663  */
22664
22665 static  PyObject *__pyx_f_4lxml_5etree_9_LogEntry__setGeneric(struct __pyx_obj_4lxml_5etree__LogEntry *__pyx_v_self, int __pyx_v_domain, int __pyx_v_type, int __pyx_v_level, int __pyx_v_line, PyObject *__pyx_v_message, PyObject *__pyx_v_filename) {
22666   PyObject *__pyx_r = NULL;
22667   PyObject *__pyx_t_1 = NULL;
22668   __Pyx_SetupRefcountContext("_setGeneric");
22669
22670   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":76
22671  *     cdef _setGeneric(self, int domain, int type, int level, int line,
22672  *                      message, filename):
22673  *         self.domain  = domain             # <<<<<<<<<<<<<<
22674  *         self.type    = type
22675  *         self.level   = level
22676  */
22677   __pyx_t_1 = PyInt_FromLong(__pyx_v_domain); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22678   __Pyx_GOTREF(__pyx_t_1);
22679   __Pyx_GIVEREF(__pyx_t_1);
22680   __Pyx_GOTREF(__pyx_v_self->domain);
22681   __Pyx_DECREF(__pyx_v_self->domain);
22682   __pyx_v_self->domain = __pyx_t_1;
22683   __pyx_t_1 = 0;
22684
22685   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":77
22686  *                      message, filename):
22687  *         self.domain  = domain
22688  *         self.type    = type             # <<<<<<<<<<<<<<
22689  *         self.level   = level
22690  *         self.line    = line
22691  */
22692   __pyx_t_1 = PyInt_FromLong(__pyx_v_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22693   __Pyx_GOTREF(__pyx_t_1);
22694   __Pyx_GIVEREF(__pyx_t_1);
22695   __Pyx_GOTREF(__pyx_v_self->type);
22696   __Pyx_DECREF(__pyx_v_self->type);
22697   __pyx_v_self->type = __pyx_t_1;
22698   __pyx_t_1 = 0;
22699
22700   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":78
22701  *         self.domain  = domain
22702  *         self.type    = type
22703  *         self.level   = level             # <<<<<<<<<<<<<<
22704  *         self.line    = line
22705  *         self.column  = 0
22706  */
22707   __pyx_t_1 = PyInt_FromLong(__pyx_v_level); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22708   __Pyx_GOTREF(__pyx_t_1);
22709   __Pyx_GIVEREF(__pyx_t_1);
22710   __Pyx_GOTREF(__pyx_v_self->level);
22711   __Pyx_DECREF(__pyx_v_self->level);
22712   __pyx_v_self->level = __pyx_t_1;
22713   __pyx_t_1 = 0;
22714
22715   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":79
22716  *         self.type    = type
22717  *         self.level   = level
22718  *         self.line    = line             # <<<<<<<<<<<<<<
22719  *         self.column  = 0
22720  *         self.message = message
22721  */
22722   __pyx_t_1 = PyInt_FromLong(__pyx_v_line); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22723   __Pyx_GOTREF(__pyx_t_1);
22724   __Pyx_GIVEREF(__pyx_t_1);
22725   __Pyx_GOTREF(__pyx_v_self->line);
22726   __Pyx_DECREF(__pyx_v_self->line);
22727   __pyx_v_self->line = __pyx_t_1;
22728   __pyx_t_1 = 0;
22729
22730   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":80
22731  *         self.level   = level
22732  *         self.line    = line
22733  *         self.column  = 0             # <<<<<<<<<<<<<<
22734  *         self.message = message
22735  *         self.filename = filename
22736  */
22737   __Pyx_INCREF(__pyx_int_0);
22738   __Pyx_GIVEREF(__pyx_int_0);
22739   __Pyx_GOTREF(__pyx_v_self->column);
22740   __Pyx_DECREF(__pyx_v_self->column);
22741   __pyx_v_self->column = __pyx_int_0;
22742
22743   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":81
22744  *         self.line    = line
22745  *         self.column  = 0
22746  *         self.message = message             # <<<<<<<<<<<<<<
22747  *         self.filename = filename
22748  * 
22749  */
22750   __Pyx_INCREF(__pyx_v_message);
22751   __Pyx_GIVEREF(__pyx_v_message);
22752   __Pyx_GOTREF(__pyx_v_self->message);
22753   __Pyx_DECREF(__pyx_v_self->message);
22754   __pyx_v_self->message = __pyx_v_message;
22755
22756   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":82
22757  *         self.column  = 0
22758  *         self.message = message
22759  *         self.filename = filename             # <<<<<<<<<<<<<<
22760  * 
22761  *     def __repr__(self):
22762  */
22763   __Pyx_INCREF(__pyx_v_filename);
22764   __Pyx_GIVEREF(__pyx_v_filename);
22765   __Pyx_GOTREF(__pyx_v_self->filename);
22766   __Pyx_DECREF(__pyx_v_self->filename);
22767   __pyx_v_self->filename = __pyx_v_filename;
22768
22769   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22770   goto __pyx_L0;
22771   __pyx_L1_error:;
22772   __Pyx_XDECREF(__pyx_t_1);
22773   __Pyx_AddTraceback("lxml.etree._LogEntry._setGeneric");
22774   __pyx_r = 0;
22775   __pyx_L0:;
22776   __Pyx_XGIVEREF(__pyx_r);
22777   __Pyx_FinishRefcountContext();
22778   return __pyx_r;
22779 }
22780
22781 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":84
22782  *         self.filename = filename
22783  * 
22784  *     def __repr__(self):             # <<<<<<<<<<<<<<
22785  *         return u"%s:%d:%d:%s:%s:%s: %s" % (
22786  *             self.filename, self.line, self.column, self.level_name,
22787  */
22788
22789 static PyObject *__pyx_pf_4lxml_5etree_9_LogEntry___repr__(PyObject *__pyx_v_self); /*proto*/
22790 static PyObject *__pyx_pf_4lxml_5etree_9_LogEntry___repr__(PyObject *__pyx_v_self) {
22791   PyObject *__pyx_r = NULL;
22792   PyObject *__pyx_t_1 = NULL;
22793   PyObject *__pyx_t_2 = NULL;
22794   PyObject *__pyx_t_3 = NULL;
22795   PyObject *__pyx_t_4 = NULL;
22796   __Pyx_SetupRefcountContext("__repr__");
22797
22798   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":85
22799  * 
22800  *     def __repr__(self):
22801  *         return u"%s:%d:%d:%s:%s:%s: %s" % (             # <<<<<<<<<<<<<<
22802  *             self.filename, self.line, self.column, self.level_name,
22803  *             self.domain_name, self.type_name, self.message)
22804  */
22805   __Pyx_XDECREF(__pyx_r);
22806
22807   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":86
22808  *     def __repr__(self):
22809  *         return u"%s:%d:%d:%s:%s:%s: %s" % (
22810  *             self.filename, self.line, self.column, self.level_name,             # <<<<<<<<<<<<<<
22811  *             self.domain_name, self.type_name, self.message)
22812  * 
22813  */
22814   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_level_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22815   __Pyx_GOTREF(__pyx_t_1);
22816
22817   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":87
22818  *         return u"%s:%d:%d:%s:%s:%s: %s" % (
22819  *             self.filename, self.line, self.column, self.level_name,
22820  *             self.domain_name, self.type_name, self.message)             # <<<<<<<<<<<<<<
22821  * 
22822  *     property domain_name:
22823  */
22824   __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_domain_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22825   __Pyx_GOTREF(__pyx_t_2);
22826   __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_type_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22827   __Pyx_GOTREF(__pyx_t_3);
22828   __pyx_t_4 = PyTuple_New(7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22829   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
22830   __Pyx_INCREF(((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->filename);
22831   PyTuple_SET_ITEM(__pyx_t_4, 0, ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->filename);
22832   __Pyx_GIVEREF(((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->filename);
22833   __Pyx_INCREF(((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->line);
22834   PyTuple_SET_ITEM(__pyx_t_4, 1, ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->line);
22835   __Pyx_GIVEREF(((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->line);
22836   __Pyx_INCREF(((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->column);
22837   PyTuple_SET_ITEM(__pyx_t_4, 2, ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->column);
22838   __Pyx_GIVEREF(((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->column);
22839   PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_1);
22840   __Pyx_GIVEREF(__pyx_t_1);
22841   PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_2);
22842   __Pyx_GIVEREF(__pyx_t_2);
22843   PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_3);
22844   __Pyx_GIVEREF(__pyx_t_3);
22845   __Pyx_INCREF(((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->message);
22846   PyTuple_SET_ITEM(__pyx_t_4, 6, ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->message);
22847   __Pyx_GIVEREF(((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->message);
22848   __pyx_t_1 = 0;
22849   __pyx_t_2 = 0;
22850   __pyx_t_3 = 0;
22851   __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_282), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22852   __Pyx_GOTREF(__pyx_t_3);
22853   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
22854   __pyx_r = __pyx_t_3;
22855   __pyx_t_3 = 0;
22856   goto __pyx_L0;
22857
22858   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22859   goto __pyx_L0;
22860   __pyx_L1_error:;
22861   __Pyx_XDECREF(__pyx_t_1);
22862   __Pyx_XDECREF(__pyx_t_2);
22863   __Pyx_XDECREF(__pyx_t_3);
22864   __Pyx_XDECREF(__pyx_t_4);
22865   __Pyx_AddTraceback("lxml.etree._LogEntry.__repr__");
22866   __pyx_r = NULL;
22867   __pyx_L0:;
22868   __Pyx_XGIVEREF(__pyx_r);
22869   __Pyx_FinishRefcountContext();
22870   return __pyx_r;
22871 }
22872
22873 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":90
22874  * 
22875  *     property domain_name:
22876  *         def __get__(self):             # <<<<<<<<<<<<<<
22877  *             return ErrorDomains._getName(self.domain, u"unknown")
22878  * 
22879  */
22880
22881 static PyObject *__pyx_pf_4lxml_5etree_9_LogEntry_11domain_name___get__(PyObject *__pyx_v_self); /*proto*/
22882 static PyObject *__pyx_pf_4lxml_5etree_9_LogEntry_11domain_name___get__(PyObject *__pyx_v_self) {
22883   PyObject *__pyx_r = NULL;
22884   PyObject *__pyx_1 = 0;
22885   PyObject *__pyx_t_1 = NULL;
22886   PyObject *__pyx_t_2 = NULL;
22887   PyObject *__pyx_t_3 = NULL;
22888   __Pyx_SetupRefcountContext("__get__");
22889
22890   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":91
22891  *     property domain_name:
22892  *         def __get__(self):
22893  *             return ErrorDomains._getName(self.domain, u"unknown")             # <<<<<<<<<<<<<<
22894  * 
22895  *     property type_name:
22896  */
22897   __Pyx_XDECREF(__pyx_r);
22898   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ErrorDomains); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22899   __Pyx_GOTREF(__pyx_1);
22900   __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp__getName); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22901   __Pyx_GOTREF(__pyx_t_1);
22902   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
22903   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22904   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
22905   __Pyx_INCREF(((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->domain);
22906   PyTuple_SET_ITEM(__pyx_t_2, 0, ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->domain);
22907   __Pyx_GIVEREF(((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->domain);
22908   __Pyx_INCREF(((PyObject *)__pyx_kp_283));
22909   PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_kp_283));
22910   __Pyx_GIVEREF(((PyObject *)__pyx_kp_283));
22911   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22912   __Pyx_GOTREF(__pyx_t_3);
22913   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22914   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
22915   __pyx_r = __pyx_t_3;
22916   __pyx_t_3 = 0;
22917   goto __pyx_L0;
22918
22919   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
22920   goto __pyx_L0;
22921   __pyx_L1_error:;
22922   __Pyx_XDECREF(__pyx_1);
22923   __Pyx_XDECREF(__pyx_t_1);
22924   __Pyx_XDECREF(__pyx_t_2);
22925   __Pyx_XDECREF(__pyx_t_3);
22926   __Pyx_AddTraceback("lxml.etree._LogEntry.domain_name.__get__");
22927   __pyx_r = NULL;
22928   __pyx_L0:;
22929   __Pyx_XGIVEREF(__pyx_r);
22930   __Pyx_FinishRefcountContext();
22931   return __pyx_r;
22932 }
22933
22934 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":94
22935  * 
22936  *     property type_name:
22937  *         def __get__(self):             # <<<<<<<<<<<<<<
22938  *             if self.domain == ErrorDomains.RELAXNGV:
22939  *                 getName = RelaxNGErrorTypes._getName
22940  */
22941
22942 static PyObject *__pyx_pf_4lxml_5etree_9_LogEntry_9type_name___get__(PyObject *__pyx_v_self); /*proto*/
22943 static PyObject *__pyx_pf_4lxml_5etree_9_LogEntry_9type_name___get__(PyObject *__pyx_v_self) {
22944   PyObject *__pyx_v_getName;
22945   PyObject *__pyx_r = NULL;
22946   PyObject *__pyx_1 = 0;
22947   PyObject *__pyx_t_1 = NULL;
22948   PyObject *__pyx_t_2 = NULL;
22949   int __pyx_t_3;
22950   __Pyx_SetupRefcountContext("__get__");
22951   __pyx_v_getName = Py_None; __Pyx_INCREF(Py_None);
22952
22953   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":95
22954  *     property type_name:
22955  *         def __get__(self):
22956  *             if self.domain == ErrorDomains.RELAXNGV:             # <<<<<<<<<<<<<<
22957  *                 getName = RelaxNGErrorTypes._getName
22958  *             else:
22959  */
22960   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ErrorDomains); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22961   __Pyx_GOTREF(__pyx_1);
22962   __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_RELAXNGV); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22963   __Pyx_GOTREF(__pyx_t_1);
22964   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
22965   __pyx_t_2 = PyObject_RichCompare(((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->domain, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22966   __Pyx_GOTREF(__pyx_t_2);
22967   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22968   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22969   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22970   if (__pyx_t_3) {
22971
22972     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":96
22973  *         def __get__(self):
22974  *             if self.domain == ErrorDomains.RELAXNGV:
22975  *                 getName = RelaxNGErrorTypes._getName             # <<<<<<<<<<<<<<
22976  *             else:
22977  *                 getName = ErrorTypes._getName
22978  */
22979     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_RelaxNGErrorTypes); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22980     __Pyx_GOTREF(__pyx_1);
22981     __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp__getName); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22982     __Pyx_GOTREF(__pyx_t_2);
22983     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
22984     __Pyx_DECREF(__pyx_v_getName);
22985     __pyx_v_getName = __pyx_t_2;
22986     __pyx_t_2 = 0;
22987     goto __pyx_L5;
22988   }
22989   /*else*/ {
22990
22991     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":98
22992  *                 getName = RelaxNGErrorTypes._getName
22993  *             else:
22994  *                 getName = ErrorTypes._getName             # <<<<<<<<<<<<<<
22995  *             return getName(self.type, u"unknown")
22996  * 
22997  */
22998     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ErrorTypes); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22999     __Pyx_GOTREF(__pyx_1);
23000     __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp__getName); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23001     __Pyx_GOTREF(__pyx_t_2);
23002     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
23003     __Pyx_DECREF(__pyx_v_getName);
23004     __pyx_v_getName = __pyx_t_2;
23005     __pyx_t_2 = 0;
23006   }
23007   __pyx_L5:;
23008
23009   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":99
23010  *             else:
23011  *                 getName = ErrorTypes._getName
23012  *             return getName(self.type, u"unknown")             # <<<<<<<<<<<<<<
23013  * 
23014  *     property level_name:
23015  */
23016   __Pyx_XDECREF(__pyx_r);
23017   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23018   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
23019   __Pyx_INCREF(((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->type);
23020   PyTuple_SET_ITEM(__pyx_t_2, 0, ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->type);
23021   __Pyx_GIVEREF(((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->type);
23022   __Pyx_INCREF(((PyObject *)__pyx_kp_284));
23023   PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_kp_284));
23024   __Pyx_GIVEREF(((PyObject *)__pyx_kp_284));
23025   __pyx_t_1 = PyObject_Call(__pyx_v_getName, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23026   __Pyx_GOTREF(__pyx_t_1);
23027   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
23028   __pyx_r = __pyx_t_1;
23029   __pyx_t_1 = 0;
23030   goto __pyx_L0;
23031
23032   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23033   goto __pyx_L0;
23034   __pyx_L1_error:;
23035   __Pyx_XDECREF(__pyx_1);
23036   __Pyx_XDECREF(__pyx_t_1);
23037   __Pyx_XDECREF(__pyx_t_2);
23038   __Pyx_AddTraceback("lxml.etree._LogEntry.type_name.__get__");
23039   __pyx_r = NULL;
23040   __pyx_L0:;
23041   __Pyx_DECREF(__pyx_v_getName);
23042   __Pyx_XGIVEREF(__pyx_r);
23043   __Pyx_FinishRefcountContext();
23044   return __pyx_r;
23045 }
23046
23047 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":102
23048  * 
23049  *     property level_name:
23050  *         def __get__(self):             # <<<<<<<<<<<<<<
23051  *             return ErrorLevels._getName(self.level, u"unknown")
23052  * 
23053  */
23054
23055 static PyObject *__pyx_pf_4lxml_5etree_9_LogEntry_10level_name___get__(PyObject *__pyx_v_self); /*proto*/
23056 static PyObject *__pyx_pf_4lxml_5etree_9_LogEntry_10level_name___get__(PyObject *__pyx_v_self) {
23057   PyObject *__pyx_r = NULL;
23058   PyObject *__pyx_1 = 0;
23059   PyObject *__pyx_t_1 = NULL;
23060   PyObject *__pyx_t_2 = NULL;
23061   PyObject *__pyx_t_3 = NULL;
23062   __Pyx_SetupRefcountContext("__get__");
23063
23064   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":103
23065  *     property level_name:
23066  *         def __get__(self):
23067  *             return ErrorLevels._getName(self.level, u"unknown")             # <<<<<<<<<<<<<<
23068  * 
23069  * cdef class _BaseErrorLog:
23070  */
23071   __Pyx_XDECREF(__pyx_r);
23072   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ErrorLevels); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23073   __Pyx_GOTREF(__pyx_1);
23074   __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp__getName); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23075   __Pyx_GOTREF(__pyx_t_1);
23076   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
23077   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23078   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
23079   __Pyx_INCREF(((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->level);
23080   PyTuple_SET_ITEM(__pyx_t_2, 0, ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->level);
23081   __Pyx_GIVEREF(((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->level);
23082   __Pyx_INCREF(((PyObject *)__pyx_kp_285));
23083   PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_kp_285));
23084   __Pyx_GIVEREF(((PyObject *)__pyx_kp_285));
23085   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23086   __Pyx_GOTREF(__pyx_t_3);
23087   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23088   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
23089   __pyx_r = __pyx_t_3;
23090   __pyx_t_3 = 0;
23091   goto __pyx_L0;
23092
23093   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23094   goto __pyx_L0;
23095   __pyx_L1_error:;
23096   __Pyx_XDECREF(__pyx_1);
23097   __Pyx_XDECREF(__pyx_t_1);
23098   __Pyx_XDECREF(__pyx_t_2);
23099   __Pyx_XDECREF(__pyx_t_3);
23100   __Pyx_AddTraceback("lxml.etree._LogEntry.level_name.__get__");
23101   __pyx_r = NULL;
23102   __pyx_L0:;
23103   __Pyx_XGIVEREF(__pyx_r);
23104   __Pyx_FinishRefcountContext();
23105   return __pyx_r;
23106 }
23107
23108 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":108
23109  *     cdef _LogEntry _first_error
23110  *     cdef readonly object last_error
23111  *     def __init__(self, first_error, last_error):             # <<<<<<<<<<<<<<
23112  *         self._first_error = first_error
23113  *         self.last_error = last_error
23114  */
23115
23116 static int __pyx_pf_4lxml_5etree_13_BaseErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
23117 static int __pyx_pf_4lxml_5etree_13_BaseErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
23118   PyObject *__pyx_v_first_error = 0;
23119   PyObject *__pyx_v_last_error = 0;
23120   int __pyx_r;
23121   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_first_error,&__pyx_kp_last_error,0};
23122   __Pyx_SetupRefcountContext("__init__");
23123   if (unlikely(__pyx_kwds)) {
23124     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
23125     PyObject* values[2] = {0,0};
23126     switch (PyTuple_GET_SIZE(__pyx_args)) {
23127       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
23128       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
23129       case  0: break;
23130       default: goto __pyx_L5_argtuple_error;
23131     }
23132     switch (PyTuple_GET_SIZE(__pyx_args)) {
23133       case  0:
23134       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_first_error);
23135       if (likely(values[0])) kw_args--;
23136       else goto __pyx_L5_argtuple_error;
23137       case  1:
23138       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_last_error);
23139       if (likely(values[1])) kw_args--;
23140       else {
23141         __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
23142       }
23143     }
23144     if (unlikely(kw_args > 0)) {
23145       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
23146     }
23147     __pyx_v_first_error = values[0];
23148     __pyx_v_last_error = values[1];
23149   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
23150     goto __pyx_L5_argtuple_error;
23151   } else {
23152     __pyx_v_first_error = PyTuple_GET_ITEM(__pyx_args, 0);
23153     __pyx_v_last_error = PyTuple_GET_ITEM(__pyx_args, 1);
23154   }
23155   goto __pyx_L4_argument_unpacking_done;
23156   __pyx_L5_argtuple_error:;
23157   __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
23158   __pyx_L3_error:;
23159   __Pyx_AddTraceback("lxml.etree._BaseErrorLog.__init__");
23160   return -1;
23161   __pyx_L4_argument_unpacking_done:;
23162
23163   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":109
23164  *     cdef readonly object last_error
23165  *     def __init__(self, first_error, last_error):
23166  *         self._first_error = first_error             # <<<<<<<<<<<<<<
23167  *         self.last_error = last_error
23168  * 
23169  */
23170   if (!(__Pyx_TypeTest(__pyx_v_first_error, __pyx_ptype_4lxml_5etree__LogEntry))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23171   __Pyx_INCREF(__pyx_v_first_error);
23172   __Pyx_GIVEREF(__pyx_v_first_error);
23173   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self)->_first_error);
23174   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self)->_first_error));
23175   ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self)->_first_error = ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_first_error);
23176
23177   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":110
23178  *     def __init__(self, first_error, last_error):
23179  *         self._first_error = first_error
23180  *         self.last_error = last_error             # <<<<<<<<<<<<<<
23181  * 
23182  *     def copy(self):
23183  */
23184   __Pyx_INCREF(__pyx_v_last_error);
23185   __Pyx_GIVEREF(__pyx_v_last_error);
23186   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self)->last_error);
23187   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self)->last_error);
23188   ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self)->last_error = __pyx_v_last_error;
23189
23190   __pyx_r = 0;
23191   goto __pyx_L0;
23192   __pyx_L1_error:;
23193   __Pyx_AddTraceback("lxml.etree._BaseErrorLog.__init__");
23194   __pyx_r = -1;
23195   __pyx_L0:;
23196   __Pyx_FinishRefcountContext();
23197   return __pyx_r;
23198 }
23199
23200 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":112
23201  *         self.last_error = last_error
23202  * 
23203  *     def copy(self):             # <<<<<<<<<<<<<<
23204  *         return _BaseErrorLog(self._first_error, self.last_error)
23205  * 
23206  */
23207
23208 static PyObject *__pyx_pf_4lxml_5etree_13_BaseErrorLog_copy(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
23209 static PyObject *__pyx_pf_4lxml_5etree_13_BaseErrorLog_copy(PyObject *__pyx_v_self, PyObject *unused) {
23210   PyObject *__pyx_r = NULL;
23211   PyObject *__pyx_t_1 = NULL;
23212   PyObject *__pyx_t_2 = NULL;
23213   __Pyx_SetupRefcountContext("copy");
23214
23215   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":113
23216  * 
23217  *     def copy(self):
23218  *         return _BaseErrorLog(self._first_error, self.last_error)             # <<<<<<<<<<<<<<
23219  * 
23220  *     def __repr__(self):
23221  */
23222   __Pyx_XDECREF(__pyx_r);
23223   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23224   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
23225   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self)->_first_error));
23226   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self)->_first_error));
23227   __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self)->_first_error));
23228   __Pyx_INCREF(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self)->last_error);
23229   PyTuple_SET_ITEM(__pyx_t_1, 1, ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self)->last_error);
23230   __Pyx_GIVEREF(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self)->last_error);
23231   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__BaseErrorLog)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23232   __Pyx_GOTREF(__pyx_t_2);
23233   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
23234   __pyx_r = __pyx_t_2;
23235   __pyx_t_2 = 0;
23236   goto __pyx_L0;
23237
23238   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23239   goto __pyx_L0;
23240   __pyx_L1_error:;
23241   __Pyx_XDECREF(__pyx_t_1);
23242   __Pyx_XDECREF(__pyx_t_2);
23243   __Pyx_AddTraceback("lxml.etree._BaseErrorLog.copy");
23244   __pyx_r = NULL;
23245   __pyx_L0:;
23246   __Pyx_XGIVEREF(__pyx_r);
23247   __Pyx_FinishRefcountContext();
23248   return __pyx_r;
23249 }
23250
23251 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":115
23252  *         return _BaseErrorLog(self._first_error, self.last_error)
23253  * 
23254  *     def __repr__(self):             # <<<<<<<<<<<<<<
23255  *         return u''
23256  * 
23257  */
23258
23259 static PyObject *__pyx_pf_4lxml_5etree_13_BaseErrorLog___repr__(PyObject *__pyx_v_self); /*proto*/
23260 static PyObject *__pyx_pf_4lxml_5etree_13_BaseErrorLog___repr__(PyObject *__pyx_v_self) {
23261   PyObject *__pyx_r = NULL;
23262   __Pyx_SetupRefcountContext("__repr__");
23263
23264   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":116
23265  * 
23266  *     def __repr__(self):
23267  *         return u''             # <<<<<<<<<<<<<<
23268  * 
23269  *     cdef void _receive(self, xmlerror.xmlError* error):
23270  */
23271   __Pyx_XDECREF(__pyx_r);
23272   __Pyx_INCREF(((PyObject *)__pyx_kp_286));
23273   __pyx_r = ((PyObject *)__pyx_kp_286);
23274   goto __pyx_L0;
23275
23276   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23277   __pyx_L0:;
23278   __Pyx_XGIVEREF(__pyx_r);
23279   __Pyx_FinishRefcountContext();
23280   return __pyx_r;
23281 }
23282
23283 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":118
23284  *         return u''
23285  * 
23286  *     cdef void _receive(self, xmlerror.xmlError* error):             # <<<<<<<<<<<<<<
23287  *         cdef bint is_error
23288  *         cdef _LogEntry entry
23289  */
23290
23291 static  void __pyx_f_4lxml_5etree_13_BaseErrorLog__receive(struct __pyx_obj_4lxml_5etree__BaseErrorLog *__pyx_v_self, xmlError *__pyx_v_error) {
23292   int __pyx_v_is_error;
23293   struct __pyx_obj_4lxml_5etree__LogEntry *__pyx_v_entry;
23294   struct __pyx_obj_4lxml_5etree__BaseErrorLog *__pyx_v_global_log;
23295   PyObject *__pyx_t_1 = NULL;
23296   int __pyx_t_2;
23297   PyObject *__pyx_t_3 = NULL;
23298   PyObject *__pyx_t_4 = NULL;
23299   __Pyx_SetupRefcountContext("_receive");
23300   __pyx_v_entry = ((struct __pyx_obj_4lxml_5etree__LogEntry *)Py_None); __Pyx_INCREF(Py_None);
23301   __pyx_v_global_log = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)Py_None); __Pyx_INCREF(Py_None);
23302
23303   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":122
23304  *         cdef _LogEntry entry
23305  *         cdef _BaseErrorLog global_log
23306  *         entry = _LogEntry()             # <<<<<<<<<<<<<<
23307  *         entry._setError(error)
23308  *         is_error = error.level == xmlerror.XML_ERR_ERROR or \
23309  */
23310   __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__LogEntry)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23311   __Pyx_GOTREF(__pyx_t_1);
23312   if (!(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__LogEntry))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23313   __Pyx_DECREF(((PyObject *)__pyx_v_entry));
23314   __pyx_v_entry = ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_t_1);
23315   __pyx_t_1 = 0;
23316
23317   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":123
23318  *         cdef _BaseErrorLog global_log
23319  *         entry = _LogEntry()
23320  *         entry._setError(error)             # <<<<<<<<<<<<<<
23321  *         is_error = error.level == xmlerror.XML_ERR_ERROR or \
23322  *                    error.level == xmlerror.XML_ERR_FATAL
23323  */
23324   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__LogEntry *)__pyx_v_entry->__pyx_vtab)->_setError(__pyx_v_entry, __pyx_v_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23325   __Pyx_GOTREF(__pyx_t_1);
23326   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23327
23328   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":124
23329  *         entry = _LogEntry()
23330  *         entry._setError(error)
23331  *         is_error = error.level == xmlerror.XML_ERR_ERROR or \             # <<<<<<<<<<<<<<
23332  *                    error.level == xmlerror.XML_ERR_FATAL
23333  *         global_log = _getGlobalErrorLog()
23334  */
23335   if (!(__pyx_v_error->level == XML_ERR_ERROR)) {
23336
23337     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":125
23338  *         entry._setError(error)
23339  *         is_error = error.level == xmlerror.XML_ERR_ERROR or \
23340  *                    error.level == xmlerror.XML_ERR_FATAL             # <<<<<<<<<<<<<<
23341  *         global_log = _getGlobalErrorLog()
23342  *         if global_log is not self:
23343  */
23344     __pyx_t_2 = (__pyx_v_error->level == XML_ERR_FATAL);
23345   } else {
23346     __pyx_t_2 = (__pyx_v_error->level == XML_ERR_ERROR);
23347   }
23348   __pyx_v_is_error = __pyx_t_2;
23349
23350   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":126
23351  *         is_error = error.level == xmlerror.XML_ERR_ERROR or \
23352  *                    error.level == xmlerror.XML_ERR_FATAL
23353  *         global_log = _getGlobalErrorLog()             # <<<<<<<<<<<<<<
23354  *         if global_log is not self:
23355  *             global_log.receive(entry)
23356  */
23357   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__getGlobalErrorLog()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23358   __Pyx_GOTREF(__pyx_t_1);
23359   __Pyx_DECREF(((PyObject *)__pyx_v_global_log));
23360   __pyx_v_global_log = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_t_1);
23361   __pyx_t_1 = 0;
23362
23363   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":127
23364  *                    error.level == xmlerror.XML_ERR_FATAL
23365  *         global_log = _getGlobalErrorLog()
23366  *         if global_log is not self:             # <<<<<<<<<<<<<<
23367  *             global_log.receive(entry)
23368  *             if is_error:
23369  */
23370   __pyx_t_2 = (__pyx_v_global_log != __pyx_v_self);
23371   if (__pyx_t_2) {
23372
23373     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":128
23374  *         global_log = _getGlobalErrorLog()
23375  *         if global_log is not self:
23376  *             global_log.receive(entry)             # <<<<<<<<<<<<<<
23377  *             if is_error:
23378  *                 global_log.last_error = entry
23379  */
23380     __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_global_log), __pyx_kp_receive); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23381     __Pyx_GOTREF(__pyx_t_1);
23382     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23383     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
23384     __Pyx_INCREF(((PyObject *)__pyx_v_entry));
23385     PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_entry));
23386     __Pyx_GIVEREF(((PyObject *)__pyx_v_entry));
23387     __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23388     __Pyx_GOTREF(__pyx_t_4);
23389     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23390     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
23391     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23392
23393     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":129
23394  *         if global_log is not self:
23395  *             global_log.receive(entry)
23396  *             if is_error:             # <<<<<<<<<<<<<<
23397  *                 global_log.last_error = entry
23398  *         self.receive(entry)
23399  */
23400     __pyx_t_2 = __pyx_v_is_error;
23401     if (__pyx_t_2) {
23402
23403       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":130
23404  *             global_log.receive(entry)
23405  *             if is_error:
23406  *                 global_log.last_error = entry             # <<<<<<<<<<<<<<
23407  *         self.receive(entry)
23408  *         if is_error:
23409  */
23410       __Pyx_INCREF(((PyObject *)__pyx_v_entry));
23411       __Pyx_GIVEREF(((PyObject *)__pyx_v_entry));
23412       __Pyx_GOTREF(__pyx_v_global_log->last_error);
23413       __Pyx_DECREF(__pyx_v_global_log->last_error);
23414       __pyx_v_global_log->last_error = ((PyObject *)__pyx_v_entry);
23415       goto __pyx_L4;
23416     }
23417     __pyx_L4:;
23418     goto __pyx_L3;
23419   }
23420   __pyx_L3:;
23421
23422   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":131
23423  *             if is_error:
23424  *                 global_log.last_error = entry
23425  *         self.receive(entry)             # <<<<<<<<<<<<<<
23426  *         if is_error:
23427  *             self.last_error = entry
23428  */
23429   __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_kp_receive); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23430   __Pyx_GOTREF(__pyx_t_4);
23431   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23432   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
23433   __Pyx_INCREF(((PyObject *)__pyx_v_entry));
23434   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_entry));
23435   __Pyx_GIVEREF(((PyObject *)__pyx_v_entry));
23436   __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23437   __Pyx_GOTREF(__pyx_t_1);
23438   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23439   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
23440   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23441
23442   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":132
23443  *                 global_log.last_error = entry
23444  *         self.receive(entry)
23445  *         if is_error:             # <<<<<<<<<<<<<<
23446  *             self.last_error = entry
23447  * 
23448  */
23449   __pyx_t_2 = __pyx_v_is_error;
23450   if (__pyx_t_2) {
23451
23452     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":133
23453  *         self.receive(entry)
23454  *         if is_error:
23455  *             self.last_error = entry             # <<<<<<<<<<<<<<
23456  * 
23457  *     cdef void _receiveGeneric(self, int domain, int type, int level, int line,
23458  */
23459     __Pyx_INCREF(((PyObject *)__pyx_v_entry));
23460     __Pyx_GIVEREF(((PyObject *)__pyx_v_entry));
23461     __Pyx_GOTREF(__pyx_v_self->last_error);
23462     __Pyx_DECREF(__pyx_v_self->last_error);
23463     __pyx_v_self->last_error = ((PyObject *)__pyx_v_entry);
23464     goto __pyx_L5;
23465   }
23466   __pyx_L5:;
23467
23468   goto __pyx_L0;
23469   __pyx_L1_error:;
23470   __Pyx_XDECREF(__pyx_t_1);
23471   __Pyx_XDECREF(__pyx_t_3);
23472   __Pyx_XDECREF(__pyx_t_4);
23473   __Pyx_WriteUnraisable("lxml.etree._BaseErrorLog._receive");
23474   __pyx_L0:;
23475   __Pyx_DECREF((PyObject *)__pyx_v_entry);
23476   __Pyx_DECREF((PyObject *)__pyx_v_global_log);
23477   __Pyx_FinishRefcountContext();
23478 }
23479
23480 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":135
23481  *             self.last_error = entry
23482  * 
23483  *     cdef void _receiveGeneric(self, int domain, int type, int level, int line,             # <<<<<<<<<<<<<<
23484  *                               message, filename):
23485  *         cdef bint is_error
23486  */
23487
23488 static  void __pyx_f_4lxml_5etree_13_BaseErrorLog__receiveGeneric(struct __pyx_obj_4lxml_5etree__BaseErrorLog *__pyx_v_self, int __pyx_v_domain, int __pyx_v_type, int __pyx_v_level, int __pyx_v_line, PyObject *__pyx_v_message, PyObject *__pyx_v_filename) {
23489   int __pyx_v_is_error;
23490   struct __pyx_obj_4lxml_5etree__LogEntry *__pyx_v_entry;
23491   struct __pyx_obj_4lxml_5etree__BaseErrorLog *__pyx_v_global_log;
23492   PyObject *__pyx_t_1 = NULL;
23493   int __pyx_t_2;
23494   PyObject *__pyx_t_3 = NULL;
23495   PyObject *__pyx_t_4 = NULL;
23496   __Pyx_SetupRefcountContext("_receiveGeneric");
23497   __pyx_v_entry = ((struct __pyx_obj_4lxml_5etree__LogEntry *)Py_None); __Pyx_INCREF(Py_None);
23498   __pyx_v_global_log = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)Py_None); __Pyx_INCREF(Py_None);
23499
23500   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":140
23501  *         cdef _LogEntry entry
23502  *         cdef _BaseErrorLog global_log
23503  *         entry = _LogEntry()             # <<<<<<<<<<<<<<
23504  *         entry._setGeneric(domain, type, level, line, message, filename)
23505  *         is_error = level == xmlerror.XML_ERR_ERROR or \
23506  */
23507   __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__LogEntry)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23508   __Pyx_GOTREF(__pyx_t_1);
23509   if (!(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__LogEntry))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23510   __Pyx_DECREF(((PyObject *)__pyx_v_entry));
23511   __pyx_v_entry = ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_t_1);
23512   __pyx_t_1 = 0;
23513
23514   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":141
23515  *         cdef _BaseErrorLog global_log
23516  *         entry = _LogEntry()
23517  *         entry._setGeneric(domain, type, level, line, message, filename)             # <<<<<<<<<<<<<<
23518  *         is_error = level == xmlerror.XML_ERR_ERROR or \
23519  *                    level == xmlerror.XML_ERR_FATAL
23520  */
23521   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__LogEntry *)__pyx_v_entry->__pyx_vtab)->_setGeneric(__pyx_v_entry, __pyx_v_domain, __pyx_v_type, __pyx_v_level, __pyx_v_line, __pyx_v_message, __pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23522   __Pyx_GOTREF(__pyx_t_1);
23523   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23524
23525   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":142
23526  *         entry = _LogEntry()
23527  *         entry._setGeneric(domain, type, level, line, message, filename)
23528  *         is_error = level == xmlerror.XML_ERR_ERROR or \             # <<<<<<<<<<<<<<
23529  *                    level == xmlerror.XML_ERR_FATAL
23530  *         global_log = _getGlobalErrorLog()
23531  */
23532   if (!(__pyx_v_level == XML_ERR_ERROR)) {
23533
23534     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":143
23535  *         entry._setGeneric(domain, type, level, line, message, filename)
23536  *         is_error = level == xmlerror.XML_ERR_ERROR or \
23537  *                    level == xmlerror.XML_ERR_FATAL             # <<<<<<<<<<<<<<
23538  *         global_log = _getGlobalErrorLog()
23539  *         if global_log is not self:
23540  */
23541     __pyx_t_2 = (__pyx_v_level == XML_ERR_FATAL);
23542   } else {
23543     __pyx_t_2 = (__pyx_v_level == XML_ERR_ERROR);
23544   }
23545   __pyx_v_is_error = __pyx_t_2;
23546
23547   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":144
23548  *         is_error = level == xmlerror.XML_ERR_ERROR or \
23549  *                    level == xmlerror.XML_ERR_FATAL
23550  *         global_log = _getGlobalErrorLog()             # <<<<<<<<<<<<<<
23551  *         if global_log is not self:
23552  *             global_log.receive(entry)
23553  */
23554   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__getGlobalErrorLog()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23555   __Pyx_GOTREF(__pyx_t_1);
23556   __Pyx_DECREF(((PyObject *)__pyx_v_global_log));
23557   __pyx_v_global_log = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_t_1);
23558   __pyx_t_1 = 0;
23559
23560   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":145
23561  *                    level == xmlerror.XML_ERR_FATAL
23562  *         global_log = _getGlobalErrorLog()
23563  *         if global_log is not self:             # <<<<<<<<<<<<<<
23564  *             global_log.receive(entry)
23565  *             if is_error:
23566  */
23567   __pyx_t_2 = (__pyx_v_global_log != __pyx_v_self);
23568   if (__pyx_t_2) {
23569
23570     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":146
23571  *         global_log = _getGlobalErrorLog()
23572  *         if global_log is not self:
23573  *             global_log.receive(entry)             # <<<<<<<<<<<<<<
23574  *             if is_error:
23575  *                 global_log.last_error = entry
23576  */
23577     __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_global_log), __pyx_kp_receive); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23578     __Pyx_GOTREF(__pyx_t_1);
23579     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23580     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
23581     __Pyx_INCREF(((PyObject *)__pyx_v_entry));
23582     PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_entry));
23583     __Pyx_GIVEREF(((PyObject *)__pyx_v_entry));
23584     __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23585     __Pyx_GOTREF(__pyx_t_4);
23586     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23587     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
23588     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23589
23590     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":147
23591  *         if global_log is not self:
23592  *             global_log.receive(entry)
23593  *             if is_error:             # <<<<<<<<<<<<<<
23594  *                 global_log.last_error = entry
23595  *         self.receive(entry)
23596  */
23597     __pyx_t_2 = __pyx_v_is_error;
23598     if (__pyx_t_2) {
23599
23600       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":148
23601  *             global_log.receive(entry)
23602  *             if is_error:
23603  *                 global_log.last_error = entry             # <<<<<<<<<<<<<<
23604  *         self.receive(entry)
23605  *         if is_error:
23606  */
23607       __Pyx_INCREF(((PyObject *)__pyx_v_entry));
23608       __Pyx_GIVEREF(((PyObject *)__pyx_v_entry));
23609       __Pyx_GOTREF(__pyx_v_global_log->last_error);
23610       __Pyx_DECREF(__pyx_v_global_log->last_error);
23611       __pyx_v_global_log->last_error = ((PyObject *)__pyx_v_entry);
23612       goto __pyx_L4;
23613     }
23614     __pyx_L4:;
23615     goto __pyx_L3;
23616   }
23617   __pyx_L3:;
23618
23619   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":149
23620  *             if is_error:
23621  *                 global_log.last_error = entry
23622  *         self.receive(entry)             # <<<<<<<<<<<<<<
23623  *         if is_error:
23624  *             self.last_error = entry
23625  */
23626   __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_kp_receive); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23627   __Pyx_GOTREF(__pyx_t_4);
23628   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23629   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
23630   __Pyx_INCREF(((PyObject *)__pyx_v_entry));
23631   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_entry));
23632   __Pyx_GIVEREF(((PyObject *)__pyx_v_entry));
23633   __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23634   __Pyx_GOTREF(__pyx_t_1);
23635   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23636   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
23637   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23638
23639   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":150
23640  *                 global_log.last_error = entry
23641  *         self.receive(entry)
23642  *         if is_error:             # <<<<<<<<<<<<<<
23643  *             self.last_error = entry
23644  * 
23645  */
23646   __pyx_t_2 = __pyx_v_is_error;
23647   if (__pyx_t_2) {
23648
23649     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":151
23650  *         self.receive(entry)
23651  *         if is_error:
23652  *             self.last_error = entry             # <<<<<<<<<<<<<<
23653  * 
23654  *     cdef _buildParseException(self, exctype, default_message):
23655  */
23656     __Pyx_INCREF(((PyObject *)__pyx_v_entry));
23657     __Pyx_GIVEREF(((PyObject *)__pyx_v_entry));
23658     __Pyx_GOTREF(__pyx_v_self->last_error);
23659     __Pyx_DECREF(__pyx_v_self->last_error);
23660     __pyx_v_self->last_error = ((PyObject *)__pyx_v_entry);
23661     goto __pyx_L5;
23662   }
23663   __pyx_L5:;
23664
23665   goto __pyx_L0;
23666   __pyx_L1_error:;
23667   __Pyx_XDECREF(__pyx_t_1);
23668   __Pyx_XDECREF(__pyx_t_3);
23669   __Pyx_XDECREF(__pyx_t_4);
23670   __Pyx_WriteUnraisable("lxml.etree._BaseErrorLog._receiveGeneric");
23671   __pyx_L0:;
23672   __Pyx_DECREF((PyObject *)__pyx_v_entry);
23673   __Pyx_DECREF((PyObject *)__pyx_v_global_log);
23674   __Pyx_FinishRefcountContext();
23675 }
23676
23677 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":153
23678  *             self.last_error = entry
23679  * 
23680  *     cdef _buildParseException(self, exctype, default_message):             # <<<<<<<<<<<<<<
23681  *         code = xmlerror.XML_ERR_INTERNAL_ERROR
23682  *         if self._first_error is None:
23683  */
23684
23685 static  PyObject *__pyx_f_4lxml_5etree_13_BaseErrorLog__buildParseException(struct __pyx_obj_4lxml_5etree__BaseErrorLog *__pyx_v_self, PyObject *__pyx_v_exctype, PyObject *__pyx_v_default_message) {
23686   PyObject *__pyx_v_code;
23687   PyObject *__pyx_v_message;
23688   PyObject *__pyx_v_line;
23689   PyObject *__pyx_v_column;
23690   PyObject *__pyx_r = NULL;
23691   PyObject *__pyx_t_1 = NULL;
23692   int __pyx_t_2;
23693   PyObject *__pyx_t_3 = NULL;
23694   int __pyx_t_4;
23695   int __pyx_t_5;
23696   int __pyx_t_6;
23697   __Pyx_SetupRefcountContext("_buildParseException");
23698   __pyx_v_code = Py_None; __Pyx_INCREF(Py_None);
23699   __pyx_v_message = Py_None; __Pyx_INCREF(Py_None);
23700   __pyx_v_line = Py_None; __Pyx_INCREF(Py_None);
23701   __pyx_v_column = Py_None; __Pyx_INCREF(Py_None);
23702
23703   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":154
23704  * 
23705  *     cdef _buildParseException(self, exctype, default_message):
23706  *         code = xmlerror.XML_ERR_INTERNAL_ERROR             # <<<<<<<<<<<<<<
23707  *         if self._first_error is None:
23708  *             return exctype(default_message, code, 0, 0)
23709  */
23710   __pyx_t_1 = PyInt_FromLong(XML_ERR_INTERNAL_ERROR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23711   __Pyx_GOTREF(__pyx_t_1);
23712   __Pyx_DECREF(__pyx_v_code);
23713   __pyx_v_code = __pyx_t_1;
23714   __pyx_t_1 = 0;
23715
23716   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":155
23717  *     cdef _buildParseException(self, exctype, default_message):
23718  *         code = xmlerror.XML_ERR_INTERNAL_ERROR
23719  *         if self._first_error is None:             # <<<<<<<<<<<<<<
23720  *             return exctype(default_message, code, 0, 0)
23721  *         if self._first_error is None or \
23722  */
23723   __pyx_t_2 = (((PyObject *)__pyx_v_self->_first_error) == Py_None);
23724   if (__pyx_t_2) {
23725
23726     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":156
23727  *         code = xmlerror.XML_ERR_INTERNAL_ERROR
23728  *         if self._first_error is None:
23729  *             return exctype(default_message, code, 0, 0)             # <<<<<<<<<<<<<<
23730  *         if self._first_error is None or \
23731  *                 self._first_error.message is None or \
23732  */
23733     __Pyx_XDECREF(__pyx_r);
23734     __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23735     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
23736     __Pyx_INCREF(__pyx_v_default_message);
23737     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_default_message);
23738     __Pyx_GIVEREF(__pyx_v_default_message);
23739     __Pyx_INCREF(__pyx_v_code);
23740     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_code);
23741     __Pyx_GIVEREF(__pyx_v_code);
23742     __Pyx_INCREF(__pyx_int_0);
23743     PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_int_0);
23744     __Pyx_GIVEREF(__pyx_int_0);
23745     __Pyx_INCREF(__pyx_int_0);
23746     PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_int_0);
23747     __Pyx_GIVEREF(__pyx_int_0);
23748     __pyx_t_3 = PyObject_Call(__pyx_v_exctype, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23749     __Pyx_GOTREF(__pyx_t_3);
23750     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
23751     __pyx_r = __pyx_t_3;
23752     __pyx_t_3 = 0;
23753     goto __pyx_L0;
23754     goto __pyx_L3;
23755   }
23756   __pyx_L3:;
23757
23758   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":157
23759  *         if self._first_error is None:
23760  *             return exctype(default_message, code, 0, 0)
23761  *         if self._first_error is None or \             # <<<<<<<<<<<<<<
23762  *                 self._first_error.message is None or \
23763  *                 not self._first_error.message:
23764  */
23765   __pyx_t_2 = (((PyObject *)__pyx_v_self->_first_error) == Py_None);
23766   if (!__pyx_t_2) {
23767
23768     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":158
23769  *             return exctype(default_message, code, 0, 0)
23770  *         if self._first_error is None or \
23771  *                 self._first_error.message is None or \             # <<<<<<<<<<<<<<
23772  *                 not self._first_error.message:
23773  *             message = default_message
23774  */
23775     __pyx_t_4 = (__pyx_v_self->_first_error->message == Py_None);
23776     if (!__pyx_t_4) {
23777
23778       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":159
23779  *         if self._first_error is None or \
23780  *                 self._first_error.message is None or \
23781  *                 not self._first_error.message:             # <<<<<<<<<<<<<<
23782  *             message = default_message
23783  *             line = 0
23784  */
23785       __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_self->_first_error->message); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23786       __pyx_t_6 = (!__pyx_t_5);
23787     } else {
23788       __pyx_t_6 = __pyx_t_4;
23789     }
23790     __pyx_t_4 = __pyx_t_6;
23791   } else {
23792     __pyx_t_4 = __pyx_t_2;
23793   }
23794   if (__pyx_t_4) {
23795
23796     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":160
23797  *                 self._first_error.message is None or \
23798  *                 not self._first_error.message:
23799  *             message = default_message             # <<<<<<<<<<<<<<
23800  *             line = 0
23801  *             column = 0
23802  */
23803     __Pyx_INCREF(__pyx_v_default_message);
23804     __Pyx_DECREF(__pyx_v_message);
23805     __pyx_v_message = __pyx_v_default_message;
23806
23807     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":161
23808  *                 not self._first_error.message:
23809  *             message = default_message
23810  *             line = 0             # <<<<<<<<<<<<<<
23811  *             column = 0
23812  *         else:
23813  */
23814     __Pyx_INCREF(__pyx_int_0);
23815     __Pyx_DECREF(__pyx_v_line);
23816     __pyx_v_line = __pyx_int_0;
23817
23818     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":162
23819  *             message = default_message
23820  *             line = 0
23821  *             column = 0             # <<<<<<<<<<<<<<
23822  *         else:
23823  *             message = self._first_error.message
23824  */
23825     __Pyx_INCREF(__pyx_int_0);
23826     __Pyx_DECREF(__pyx_v_column);
23827     __pyx_v_column = __pyx_int_0;
23828     goto __pyx_L4;
23829   }
23830   /*else*/ {
23831
23832     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":164
23833  *             column = 0
23834  *         else:
23835  *             message = self._first_error.message             # <<<<<<<<<<<<<<
23836  *             code = self._first_error.type
23837  *             line = self._first_error.line
23838  */
23839     __Pyx_INCREF(__pyx_v_self->_first_error->message);
23840     __Pyx_DECREF(__pyx_v_message);
23841     __pyx_v_message = __pyx_v_self->_first_error->message;
23842
23843     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":165
23844  *         else:
23845  *             message = self._first_error.message
23846  *             code = self._first_error.type             # <<<<<<<<<<<<<<
23847  *             line = self._first_error.line
23848  *             column = self._first_error.column
23849  */
23850     __Pyx_INCREF(__pyx_v_self->_first_error->type);
23851     __Pyx_DECREF(__pyx_v_code);
23852     __pyx_v_code = __pyx_v_self->_first_error->type;
23853
23854     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":166
23855  *             message = self._first_error.message
23856  *             code = self._first_error.type
23857  *             line = self._first_error.line             # <<<<<<<<<<<<<<
23858  *             column = self._first_error.column
23859  *             if line > 0:
23860  */
23861     __Pyx_INCREF(__pyx_v_self->_first_error->line);
23862     __Pyx_DECREF(__pyx_v_line);
23863     __pyx_v_line = __pyx_v_self->_first_error->line;
23864
23865     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":167
23866  *             code = self._first_error.type
23867  *             line = self._first_error.line
23868  *             column = self._first_error.column             # <<<<<<<<<<<<<<
23869  *             if line > 0:
23870  *                 if column > 0:
23871  */
23872     __Pyx_INCREF(__pyx_v_self->_first_error->column);
23873     __Pyx_DECREF(__pyx_v_column);
23874     __pyx_v_column = __pyx_v_self->_first_error->column;
23875
23876     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":168
23877  *             line = self._first_error.line
23878  *             column = self._first_error.column
23879  *             if line > 0:             # <<<<<<<<<<<<<<
23880  *                 if column > 0:
23881  *                     message = u"%s, line %d, column %d" % (message, line, column)
23882  */
23883     __pyx_t_3 = PyObject_RichCompare(__pyx_v_line, __pyx_int_0, Py_GT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23884     __Pyx_GOTREF(__pyx_t_3);
23885     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23886     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23887     if (__pyx_t_4) {
23888
23889       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":169
23890  *             column = self._first_error.column
23891  *             if line > 0:
23892  *                 if column > 0:             # <<<<<<<<<<<<<<
23893  *                     message = u"%s, line %d, column %d" % (message, line, column)
23894  *                 else:
23895  */
23896       __pyx_t_3 = PyObject_RichCompare(__pyx_v_column, __pyx_int_0, Py_GT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23897       __Pyx_GOTREF(__pyx_t_3);
23898       __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23899       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
23900       if (__pyx_t_4) {
23901
23902         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":170
23903  *             if line > 0:
23904  *                 if column > 0:
23905  *                     message = u"%s, line %d, column %d" % (message, line, column)             # <<<<<<<<<<<<<<
23906  *                 else:
23907  *                     message = u"%s, line %d" % (message, line)
23908  */
23909         __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23910         __Pyx_GOTREF(((PyObject *)__pyx_t_3));
23911         __Pyx_INCREF(__pyx_v_message);
23912         PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_message);
23913         __Pyx_GIVEREF(__pyx_v_message);
23914         __Pyx_INCREF(__pyx_v_line);
23915         PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_line);
23916         __Pyx_GIVEREF(__pyx_v_line);
23917         __Pyx_INCREF(__pyx_v_column);
23918         PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_column);
23919         __Pyx_GIVEREF(__pyx_v_column);
23920         __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_287), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23921         __Pyx_GOTREF(__pyx_t_1);
23922         __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
23923         __Pyx_DECREF(__pyx_v_message);
23924         __pyx_v_message = __pyx_t_1;
23925         __pyx_t_1 = 0;
23926         goto __pyx_L6;
23927       }
23928       /*else*/ {
23929
23930         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":172
23931  *                     message = u"%s, line %d, column %d" % (message, line, column)
23932  *                 else:
23933  *                     message = u"%s, line %d" % (message, line)             # <<<<<<<<<<<<<<
23934  *         return exctype(message, code, line, column)
23935  * 
23936  */
23937         __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23938         __Pyx_GOTREF(((PyObject *)__pyx_t_1));
23939         __Pyx_INCREF(__pyx_v_message);
23940         PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_message);
23941         __Pyx_GIVEREF(__pyx_v_message);
23942         __Pyx_INCREF(__pyx_v_line);
23943         PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_line);
23944         __Pyx_GIVEREF(__pyx_v_line);
23945         __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_288), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23946         __Pyx_GOTREF(__pyx_t_3);
23947         __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
23948         __Pyx_DECREF(__pyx_v_message);
23949         __pyx_v_message = __pyx_t_3;
23950         __pyx_t_3 = 0;
23951       }
23952       __pyx_L6:;
23953       goto __pyx_L5;
23954     }
23955     __pyx_L5:;
23956   }
23957   __pyx_L4:;
23958
23959   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":173
23960  *                 else:
23961  *                     message = u"%s, line %d" % (message, line)
23962  *         return exctype(message, code, line, column)             # <<<<<<<<<<<<<<
23963  * 
23964  *     cdef _buildExceptionMessage(self, default_message):
23965  */
23966   __Pyx_XDECREF(__pyx_r);
23967   __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23968   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
23969   __Pyx_INCREF(__pyx_v_message);
23970   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_message);
23971   __Pyx_GIVEREF(__pyx_v_message);
23972   __Pyx_INCREF(__pyx_v_code);
23973   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_code);
23974   __Pyx_GIVEREF(__pyx_v_code);
23975   __Pyx_INCREF(__pyx_v_line);
23976   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_line);
23977   __Pyx_GIVEREF(__pyx_v_line);
23978   __Pyx_INCREF(__pyx_v_column);
23979   PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_column);
23980   __Pyx_GIVEREF(__pyx_v_column);
23981   __pyx_t_1 = PyObject_Call(__pyx_v_exctype, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
23982   __Pyx_GOTREF(__pyx_t_1);
23983   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
23984   __pyx_r = __pyx_t_1;
23985   __pyx_t_1 = 0;
23986   goto __pyx_L0;
23987
23988   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23989   goto __pyx_L0;
23990   __pyx_L1_error:;
23991   __Pyx_XDECREF(__pyx_t_1);
23992   __Pyx_XDECREF(__pyx_t_3);
23993   __Pyx_AddTraceback("lxml.etree._BaseErrorLog._buildParseException");
23994   __pyx_r = 0;
23995   __pyx_L0:;
23996   __Pyx_DECREF(__pyx_v_code);
23997   __Pyx_DECREF(__pyx_v_message);
23998   __Pyx_DECREF(__pyx_v_line);
23999   __Pyx_DECREF(__pyx_v_column);
24000   __Pyx_XGIVEREF(__pyx_r);
24001   __Pyx_FinishRefcountContext();
24002   return __pyx_r;
24003 }
24004
24005 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":175
24006  *         return exctype(message, code, line, column)
24007  * 
24008  *     cdef _buildExceptionMessage(self, default_message):             # <<<<<<<<<<<<<<
24009  *         if self._first_error is None:
24010  *             return default_message
24011  */
24012
24013 static  PyObject *__pyx_f_4lxml_5etree_13_BaseErrorLog__buildExceptionMessage(struct __pyx_obj_4lxml_5etree__BaseErrorLog *__pyx_v_self, PyObject *__pyx_v_default_message) {
24014   PyObject *__pyx_v_message;
24015   PyObject *__pyx_r = NULL;
24016   int __pyx_t_1;
24017   int __pyx_t_2;
24018   int __pyx_t_3;
24019   PyObject *__pyx_t_4 = NULL;
24020   PyObject *__pyx_t_5 = NULL;
24021   __Pyx_SetupRefcountContext("_buildExceptionMessage");
24022   __pyx_v_message = Py_None; __Pyx_INCREF(Py_None);
24023
24024   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":176
24025  * 
24026  *     cdef _buildExceptionMessage(self, default_message):
24027  *         if self._first_error is None:             # <<<<<<<<<<<<<<
24028  *             return default_message
24029  *         if self._first_error.message is not None and self._first_error.message:
24030  */
24031   __pyx_t_1 = (((PyObject *)__pyx_v_self->_first_error) == Py_None);
24032   if (__pyx_t_1) {
24033
24034     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":177
24035  *     cdef _buildExceptionMessage(self, default_message):
24036  *         if self._first_error is None:
24037  *             return default_message             # <<<<<<<<<<<<<<
24038  *         if self._first_error.message is not None and self._first_error.message:
24039  *             message = self._first_error.message
24040  */
24041     __Pyx_XDECREF(__pyx_r);
24042     __Pyx_INCREF(__pyx_v_default_message);
24043     __pyx_r = __pyx_v_default_message;
24044     goto __pyx_L0;
24045     goto __pyx_L3;
24046   }
24047   __pyx_L3:;
24048
24049   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":178
24050  *         if self._first_error is None:
24051  *             return default_message
24052  *         if self._first_error.message is not None and self._first_error.message:             # <<<<<<<<<<<<<<
24053  *             message = self._first_error.message
24054  *         elif default_message is None:
24055  */
24056   __pyx_t_1 = (__pyx_v_self->_first_error->message != Py_None);
24057   if (__pyx_t_1) {
24058     __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->_first_error->message); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24059     __pyx_t_3 = __pyx_t_2;
24060   } else {
24061     __pyx_t_3 = __pyx_t_1;
24062   }
24063   if (__pyx_t_3) {
24064
24065     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":179
24066  *             return default_message
24067  *         if self._first_error.message is not None and self._first_error.message:
24068  *             message = self._first_error.message             # <<<<<<<<<<<<<<
24069  *         elif default_message is None:
24070  *             return None
24071  */
24072     __Pyx_INCREF(__pyx_v_self->_first_error->message);
24073     __Pyx_DECREF(__pyx_v_message);
24074     __pyx_v_message = __pyx_v_self->_first_error->message;
24075     goto __pyx_L4;
24076   }
24077
24078   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":180
24079  *         if self._first_error.message is not None and self._first_error.message:
24080  *             message = self._first_error.message
24081  *         elif default_message is None:             # <<<<<<<<<<<<<<
24082  *             return None
24083  *         else:
24084  */
24085   __pyx_t_3 = (__pyx_v_default_message == Py_None);
24086   if (__pyx_t_3) {
24087
24088     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":181
24089  *             message = self._first_error.message
24090  *         elif default_message is None:
24091  *             return None             # <<<<<<<<<<<<<<
24092  *         else:
24093  *             message = default_message
24094  */
24095     __Pyx_XDECREF(__pyx_r);
24096     __Pyx_INCREF(Py_None);
24097     __pyx_r = Py_None;
24098     goto __pyx_L0;
24099     goto __pyx_L4;
24100   }
24101   /*else*/ {
24102
24103     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":183
24104  *             return None
24105  *         else:
24106  *             message = default_message             # <<<<<<<<<<<<<<
24107  *         if self._first_error.line > 0:
24108  *             if self._first_error.column > 0:
24109  */
24110     __Pyx_INCREF(__pyx_v_default_message);
24111     __Pyx_DECREF(__pyx_v_message);
24112     __pyx_v_message = __pyx_v_default_message;
24113   }
24114   __pyx_L4:;
24115
24116   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":184
24117  *         else:
24118  *             message = default_message
24119  *         if self._first_error.line > 0:             # <<<<<<<<<<<<<<
24120  *             if self._first_error.column > 0:
24121  *                 message = u"%s, line %d, column %d" % (
24122  */
24123   __pyx_t_4 = PyObject_RichCompare(__pyx_v_self->_first_error->line, __pyx_int_0, Py_GT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24124   __Pyx_GOTREF(__pyx_t_4);
24125   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24126   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24127   if (__pyx_t_3) {
24128
24129     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":185
24130  *             message = default_message
24131  *         if self._first_error.line > 0:
24132  *             if self._first_error.column > 0:             # <<<<<<<<<<<<<<
24133  *                 message = u"%s, line %d, column %d" % (
24134  *                     message, self._first_error.line, self._first_error.column)
24135  */
24136     __pyx_t_4 = PyObject_RichCompare(__pyx_v_self->_first_error->column, __pyx_int_0, Py_GT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24137     __Pyx_GOTREF(__pyx_t_4);
24138     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24139     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24140     if (__pyx_t_3) {
24141
24142       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":187
24143  *             if self._first_error.column > 0:
24144  *                 message = u"%s, line %d, column %d" % (
24145  *                     message, self._first_error.line, self._first_error.column)             # <<<<<<<<<<<<<<
24146  *             else:
24147  *                 message = u"%s, line %d" % (message, self._first_error.line)
24148  */
24149       __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24150       __Pyx_GOTREF(((PyObject *)__pyx_t_4));
24151       __Pyx_INCREF(__pyx_v_message);
24152       PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_message);
24153       __Pyx_GIVEREF(__pyx_v_message);
24154       __Pyx_INCREF(__pyx_v_self->_first_error->line);
24155       PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->_first_error->line);
24156       __Pyx_GIVEREF(__pyx_v_self->_first_error->line);
24157       __Pyx_INCREF(__pyx_v_self->_first_error->column);
24158       PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_self->_first_error->column);
24159       __Pyx_GIVEREF(__pyx_v_self->_first_error->column);
24160       __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_289), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24161       __Pyx_GOTREF(__pyx_t_5);
24162       __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
24163       __Pyx_DECREF(__pyx_v_message);
24164       __pyx_v_message = __pyx_t_5;
24165       __pyx_t_5 = 0;
24166       goto __pyx_L6;
24167     }
24168     /*else*/ {
24169
24170       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":189
24171  *                     message, self._first_error.line, self._first_error.column)
24172  *             else:
24173  *                 message = u"%s, line %d" % (message, self._first_error.line)             # <<<<<<<<<<<<<<
24174  *         return message
24175  * 
24176  */
24177       __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24178       __Pyx_GOTREF(((PyObject *)__pyx_t_5));
24179       __Pyx_INCREF(__pyx_v_message);
24180       PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_message);
24181       __Pyx_GIVEREF(__pyx_v_message);
24182       __Pyx_INCREF(__pyx_v_self->_first_error->line);
24183       PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_self->_first_error->line);
24184       __Pyx_GIVEREF(__pyx_v_self->_first_error->line);
24185       __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_290), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24186       __Pyx_GOTREF(__pyx_t_4);
24187       __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
24188       __Pyx_DECREF(__pyx_v_message);
24189       __pyx_v_message = __pyx_t_4;
24190       __pyx_t_4 = 0;
24191     }
24192     __pyx_L6:;
24193     goto __pyx_L5;
24194   }
24195   __pyx_L5:;
24196
24197   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":190
24198  *             else:
24199  *                 message = u"%s, line %d" % (message, self._first_error.line)
24200  *         return message             # <<<<<<<<<<<<<<
24201  * 
24202  * cdef class _ListErrorLog(_BaseErrorLog):
24203  */
24204   __Pyx_XDECREF(__pyx_r);
24205   __Pyx_INCREF(__pyx_v_message);
24206   __pyx_r = __pyx_v_message;
24207   goto __pyx_L0;
24208
24209   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24210   goto __pyx_L0;
24211   __pyx_L1_error:;
24212   __Pyx_XDECREF(__pyx_t_4);
24213   __Pyx_XDECREF(__pyx_t_5);
24214   __Pyx_AddTraceback("lxml.etree._BaseErrorLog._buildExceptionMessage");
24215   __pyx_r = 0;
24216   __pyx_L0:;
24217   __Pyx_DECREF(__pyx_v_message);
24218   __Pyx_XGIVEREF(__pyx_r);
24219   __Pyx_FinishRefcountContext();
24220   return __pyx_r;
24221 }
24222
24223 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":195
24224  *     u"Immutable base version of a list based error log."
24225  *     cdef list _entries
24226  *     def __init__(self, entries, first_error, last_error):             # <<<<<<<<<<<<<<
24227  *         if entries:
24228  *             if first_error is None:
24229  */
24230
24231 static int __pyx_pf_4lxml_5etree_13_ListErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
24232 static int __pyx_pf_4lxml_5etree_13_ListErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
24233   PyObject *__pyx_v_entries = 0;
24234   PyObject *__pyx_v_first_error = 0;
24235   PyObject *__pyx_v_last_error = 0;
24236   int __pyx_r;
24237   PyObject *__pyx_1 = 0;
24238   int __pyx_t_1;
24239   PyObject *__pyx_t_2 = NULL;
24240   PyObject *__pyx_t_3 = NULL;
24241   PyObject *__pyx_t_4 = NULL;
24242   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_entries,&__pyx_kp_first_error,&__pyx_kp_last_error,0};
24243   __Pyx_SetupRefcountContext("__init__");
24244   if (unlikely(__pyx_kwds)) {
24245     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
24246     PyObject* values[3] = {0,0,0};
24247     switch (PyTuple_GET_SIZE(__pyx_args)) {
24248       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
24249       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
24250       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
24251       case  0: break;
24252       default: goto __pyx_L5_argtuple_error;
24253     }
24254     switch (PyTuple_GET_SIZE(__pyx_args)) {
24255       case  0:
24256       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_entries);
24257       if (likely(values[0])) kw_args--;
24258       else goto __pyx_L5_argtuple_error;
24259       case  1:
24260       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_first_error);
24261       if (likely(values[1])) kw_args--;
24262       else {
24263         __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
24264       }
24265       case  2:
24266       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_last_error);
24267       if (likely(values[2])) kw_args--;
24268       else {
24269         __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
24270       }
24271     }
24272     if (unlikely(kw_args > 0)) {
24273       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
24274     }
24275     __pyx_v_entries = values[0];
24276     __pyx_v_first_error = values[1];
24277     __pyx_v_last_error = values[2];
24278   } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
24279     goto __pyx_L5_argtuple_error;
24280   } else {
24281     __pyx_v_entries = PyTuple_GET_ITEM(__pyx_args, 0);
24282     __pyx_v_first_error = PyTuple_GET_ITEM(__pyx_args, 1);
24283     __pyx_v_last_error = PyTuple_GET_ITEM(__pyx_args, 2);
24284   }
24285   goto __pyx_L4_argument_unpacking_done;
24286   __pyx_L5_argtuple_error:;
24287   __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
24288   __pyx_L3_error:;
24289   __Pyx_AddTraceback("lxml.etree._ListErrorLog.__init__");
24290   return -1;
24291   __pyx_L4_argument_unpacking_done:;
24292   __Pyx_INCREF(__pyx_v_first_error);
24293   __Pyx_INCREF(__pyx_v_last_error);
24294
24295   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":196
24296  *     cdef list _entries
24297  *     def __init__(self, entries, first_error, last_error):
24298  *         if entries:             # <<<<<<<<<<<<<<
24299  *             if first_error is None:
24300  *                 first_error = entries[0]
24301  */
24302   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_entries); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24303   if (__pyx_t_1) {
24304
24305     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":197
24306  *     def __init__(self, entries, first_error, last_error):
24307  *         if entries:
24308  *             if first_error is None:             # <<<<<<<<<<<<<<
24309  *                 first_error = entries[0]
24310  *             if last_error is None:
24311  */
24312     __pyx_t_1 = (__pyx_v_first_error == Py_None);
24313     if (__pyx_t_1) {
24314
24315       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":198
24316  *         if entries:
24317  *             if first_error is None:
24318  *                 first_error = entries[0]             # <<<<<<<<<<<<<<
24319  *             if last_error is None:
24320  *                 last_error = entries[-1]
24321  */
24322       __pyx_1 = __Pyx_GetItemInt(__pyx_v_entries, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24323       __Pyx_GOTREF(__pyx_1);
24324       __Pyx_DECREF(__pyx_v_first_error);
24325       __pyx_v_first_error = __pyx_1;
24326       __pyx_1 = 0;
24327       goto __pyx_L7;
24328     }
24329     __pyx_L7:;
24330
24331     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":199
24332  *             if first_error is None:
24333  *                 first_error = entries[0]
24334  *             if last_error is None:             # <<<<<<<<<<<<<<
24335  *                 last_error = entries[-1]
24336  *         _BaseErrorLog.__init__(self, first_error, last_error)
24337  */
24338     __pyx_t_1 = (__pyx_v_last_error == Py_None);
24339     if (__pyx_t_1) {
24340
24341       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":200
24342  *                 first_error = entries[0]
24343  *             if last_error is None:
24344  *                 last_error = entries[-1]             # <<<<<<<<<<<<<<
24345  *         _BaseErrorLog.__init__(self, first_error, last_error)
24346  *         self._entries = entries
24347  */
24348       __pyx_1 = __Pyx_GetItemInt(__pyx_v_entries, -1, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24349       __Pyx_GOTREF(__pyx_1);
24350       __Pyx_DECREF(__pyx_v_last_error);
24351       __pyx_v_last_error = __pyx_1;
24352       __pyx_1 = 0;
24353       goto __pyx_L8;
24354     }
24355     __pyx_L8:;
24356     goto __pyx_L6;
24357   }
24358   __pyx_L6:;
24359
24360   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":201
24361  *             if last_error is None:
24362  *                 last_error = entries[-1]
24363  *         _BaseErrorLog.__init__(self, first_error, last_error)             # <<<<<<<<<<<<<<
24364  *         self._entries = entries
24365  * 
24366  */
24367   __pyx_t_2 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__BaseErrorLog)), __pyx_kp___init__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24368   __Pyx_GOTREF(__pyx_t_2);
24369   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24370   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
24371   __Pyx_INCREF(__pyx_v_self);
24372   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self);
24373   __Pyx_GIVEREF(__pyx_v_self);
24374   __Pyx_INCREF(__pyx_v_first_error);
24375   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_first_error);
24376   __Pyx_GIVEREF(__pyx_v_first_error);
24377   __Pyx_INCREF(__pyx_v_last_error);
24378   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_last_error);
24379   __Pyx_GIVEREF(__pyx_v_last_error);
24380   __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24381   __Pyx_GOTREF(__pyx_t_4);
24382   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24383   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
24384   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24385
24386   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":202
24387  *                 last_error = entries[-1]
24388  *         _BaseErrorLog.__init__(self, first_error, last_error)
24389  *         self._entries = entries             # <<<<<<<<<<<<<<
24390  * 
24391  *     def copy(self):
24392  */
24393   if (!(likely(PyList_CheckExact(__pyx_v_entries)) || (__pyx_v_entries) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected list, got %s", Py_TYPE(__pyx_v_entries)->tp_name), 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24394   __Pyx_INCREF(__pyx_v_entries);
24395   __Pyx_GIVEREF(__pyx_v_entries);
24396   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries);
24397   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries));
24398   ((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries = ((PyObject *)__pyx_v_entries);
24399
24400   __pyx_r = 0;
24401   goto __pyx_L0;
24402   __pyx_L1_error:;
24403   __Pyx_XDECREF(__pyx_1);
24404   __Pyx_XDECREF(__pyx_t_2);
24405   __Pyx_XDECREF(__pyx_t_3);
24406   __Pyx_XDECREF(__pyx_t_4);
24407   __Pyx_AddTraceback("lxml.etree._ListErrorLog.__init__");
24408   __pyx_r = -1;
24409   __pyx_L0:;
24410   __Pyx_DECREF(__pyx_v_first_error);
24411   __Pyx_DECREF(__pyx_v_last_error);
24412   __Pyx_FinishRefcountContext();
24413   return __pyx_r;
24414 }
24415
24416 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":204
24417  *         self._entries = entries
24418  * 
24419  *     def copy(self):             # <<<<<<<<<<<<<<
24420  *         u"""Creates a shallow copy of this error log.  Reuses the list of
24421  *         entries.
24422  */
24423
24424 static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_copy(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
24425 static char __pyx_doc_4lxml_5etree_13_ListErrorLog_copy[] = "Creates a shallow copy of this error log.  Reuses the list of\n        entries.\n        ";
24426 static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_copy(PyObject *__pyx_v_self, PyObject *unused) {
24427   PyObject *__pyx_r = NULL;
24428   PyObject *__pyx_t_1 = NULL;
24429   PyObject *__pyx_t_2 = NULL;
24430   __Pyx_SetupRefcountContext("copy");
24431
24432   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":208
24433  *         entries.
24434  *         """
24435  *         return _ListErrorLog(self._entries, self._first_error, self.last_error)             # <<<<<<<<<<<<<<
24436  * 
24437  *     def __iter__(self):
24438  */
24439   __Pyx_XDECREF(__pyx_r);
24440   __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24441   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
24442   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries));
24443   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries));
24444   __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries));
24445   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->__pyx_base._first_error));
24446   PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->__pyx_base._first_error));
24447   __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->__pyx_base._first_error));
24448   __Pyx_INCREF(((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->__pyx_base.last_error);
24449   PyTuple_SET_ITEM(__pyx_t_1, 2, ((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->__pyx_base.last_error);
24450   __Pyx_GIVEREF(((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->__pyx_base.last_error);
24451   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ListErrorLog)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24452   __Pyx_GOTREF(__pyx_t_2);
24453   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
24454   __pyx_r = __pyx_t_2;
24455   __pyx_t_2 = 0;
24456   goto __pyx_L0;
24457
24458   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24459   goto __pyx_L0;
24460   __pyx_L1_error:;
24461   __Pyx_XDECREF(__pyx_t_1);
24462   __Pyx_XDECREF(__pyx_t_2);
24463   __Pyx_AddTraceback("lxml.etree._ListErrorLog.copy");
24464   __pyx_r = NULL;
24465   __pyx_L0:;
24466   __Pyx_XGIVEREF(__pyx_r);
24467   __Pyx_FinishRefcountContext();
24468   return __pyx_r;
24469 }
24470
24471 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":210
24472  *         return _ListErrorLog(self._entries, self._first_error, self.last_error)
24473  * 
24474  *     def __iter__(self):             # <<<<<<<<<<<<<<
24475  *         return iter(self._entries)
24476  * 
24477  */
24478
24479 static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog___iter__(PyObject *__pyx_v_self); /*proto*/
24480 static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog___iter__(PyObject *__pyx_v_self) {
24481   PyObject *__pyx_r = NULL;
24482   PyObject *__pyx_t_1 = NULL;
24483   __Pyx_SetupRefcountContext("__iter__");
24484
24485   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":211
24486  * 
24487  *     def __iter__(self):
24488  *         return iter(self._entries)             # <<<<<<<<<<<<<<
24489  * 
24490  *     def __repr__(self):
24491  */
24492   __Pyx_XDECREF(__pyx_r);
24493   __pyx_t_1 = PyObject_GetIter(((PyObject *)((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24494   __Pyx_GOTREF(__pyx_t_1);
24495   __pyx_r = __pyx_t_1;
24496   __pyx_t_1 = 0;
24497   goto __pyx_L0;
24498
24499   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24500   goto __pyx_L0;
24501   __pyx_L1_error:;
24502   __Pyx_XDECREF(__pyx_t_1);
24503   __Pyx_AddTraceback("lxml.etree._ListErrorLog.__iter__");
24504   __pyx_r = NULL;
24505   __pyx_L0:;
24506   __Pyx_XGIVEREF(__pyx_r);
24507   __Pyx_FinishRefcountContext();
24508   return __pyx_r;
24509 }
24510
24511 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":213
24512  *         return iter(self._entries)
24513  * 
24514  *     def __repr__(self):             # <<<<<<<<<<<<<<
24515  *         cdef list l = []
24516  *         for entry in self._entries:
24517  */
24518
24519 static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog___repr__(PyObject *__pyx_v_self); /*proto*/
24520 static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog___repr__(PyObject *__pyx_v_self) {
24521   PyObject *__pyx_v_l = 0;
24522   PyObject *__pyx_v_entry;
24523   PyObject *__pyx_r = NULL;
24524   PyObject *__pyx_t_1 = NULL;
24525   Py_ssize_t __pyx_t_2;
24526   PyObject *__pyx_t_3 = NULL;
24527   int __pyx_t_4;
24528   PyObject *__pyx_t_5 = NULL;
24529   __Pyx_SetupRefcountContext("__repr__");
24530   __pyx_v_entry = Py_None; __Pyx_INCREF(Py_None);
24531
24532   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":214
24533  * 
24534  *     def __repr__(self):
24535  *         cdef list l = []             # <<<<<<<<<<<<<<
24536  *         for entry in self._entries:
24537  *             l.append(repr(entry))
24538  */
24539   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24540   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
24541   __pyx_v_l = __pyx_t_1;
24542   __pyx_t_1 = 0;
24543
24544   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":215
24545  *     def __repr__(self):
24546  *         cdef list l = []
24547  *         for entry in self._entries:             # <<<<<<<<<<<<<<
24548  *             l.append(repr(entry))
24549  *         return u'\n'.join(l)
24550  */
24551   if (likely(((PyObject *)((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries) != Py_None)) {
24552     __pyx_t_2 = 0; __pyx_t_1 = ((PyObject *)((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries); __Pyx_INCREF(__pyx_t_1);
24553   } else {
24554     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24555   }
24556   for (;;) {
24557     if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
24558     __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++;
24559     __Pyx_DECREF(__pyx_v_entry);
24560     __pyx_v_entry = __pyx_t_3;
24561     __pyx_t_3 = 0;
24562
24563     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":216
24564  *         cdef list l = []
24565  *         for entry in self._entries:
24566  *             l.append(repr(entry))             # <<<<<<<<<<<<<<
24567  *         return u'\n'.join(l)
24568  * 
24569  */
24570     __pyx_t_3 = PyObject_Repr(__pyx_v_entry); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24571     __Pyx_GOTREF(__pyx_t_3);
24572     __pyx_t_4 = PyList_Append(((PyObject *)__pyx_v_l), __pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24573     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24574   }
24575   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24576
24577   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":217
24578  *         for entry in self._entries:
24579  *             l.append(repr(entry))
24580  *         return u'\n'.join(l)             # <<<<<<<<<<<<<<
24581  * 
24582  *     def __getitem__(self, index):
24583  */
24584   __Pyx_XDECREF(__pyx_r);
24585   __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_291), __pyx_kp_join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24586   __Pyx_GOTREF(__pyx_t_1);
24587   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24588   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
24589   __Pyx_INCREF(((PyObject *)__pyx_v_l));
24590   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_l));
24591   __Pyx_GIVEREF(((PyObject *)__pyx_v_l));
24592   __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24593   __Pyx_GOTREF(__pyx_t_5);
24594   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24595   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
24596   __pyx_r = __pyx_t_5;
24597   __pyx_t_5 = 0;
24598   goto __pyx_L0;
24599
24600   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24601   goto __pyx_L0;
24602   __pyx_L1_error:;
24603   __Pyx_XDECREF(__pyx_t_1);
24604   __Pyx_XDECREF(__pyx_t_3);
24605   __Pyx_XDECREF(__pyx_t_5);
24606   __Pyx_AddTraceback("lxml.etree._ListErrorLog.__repr__");
24607   __pyx_r = NULL;
24608   __pyx_L0:;
24609   __Pyx_XDECREF(__pyx_v_l);
24610   __Pyx_DECREF(__pyx_v_entry);
24611   __Pyx_XGIVEREF(__pyx_r);
24612   __Pyx_FinishRefcountContext();
24613   return __pyx_r;
24614 }
24615
24616 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":219
24617  *         return u'\n'.join(l)
24618  * 
24619  *     def __getitem__(self, index):             # <<<<<<<<<<<<<<
24620  *         return self._entries[index]
24621  * 
24622  */
24623
24624 static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
24625 static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
24626   PyObject *__pyx_r = NULL;
24627   PyObject *__pyx_1 = 0;
24628   __Pyx_SetupRefcountContext("__getitem__");
24629
24630   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":220
24631  * 
24632  *     def __getitem__(self, index):
24633  *         return self._entries[index]             # <<<<<<<<<<<<<<
24634  * 
24635  *     def __len__(self):
24636  */
24637   __Pyx_XDECREF(__pyx_r);
24638   __pyx_1 = PyObject_GetItem(((PyObject *)((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries), __pyx_v_index); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24639   __Pyx_GOTREF(__pyx_1);
24640   __pyx_r = __pyx_1;
24641   __pyx_1 = 0;
24642   goto __pyx_L0;
24643
24644   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24645   goto __pyx_L0;
24646   __pyx_L1_error:;
24647   __Pyx_XDECREF(__pyx_1);
24648   __Pyx_AddTraceback("lxml.etree._ListErrorLog.__getitem__");
24649   __pyx_r = NULL;
24650   __pyx_L0:;
24651   __Pyx_XGIVEREF(__pyx_r);
24652   __Pyx_FinishRefcountContext();
24653   return __pyx_r;
24654 }
24655
24656 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":222
24657  *         return self._entries[index]
24658  * 
24659  *     def __len__(self):             # <<<<<<<<<<<<<<
24660  *         return len(self._entries)
24661  * 
24662  */
24663
24664 static Py_ssize_t __pyx_pf_4lxml_5etree_13_ListErrorLog___len__(PyObject *__pyx_v_self); /*proto*/
24665 static Py_ssize_t __pyx_pf_4lxml_5etree_13_ListErrorLog___len__(PyObject *__pyx_v_self) {
24666   Py_ssize_t __pyx_r;
24667   Py_ssize_t __pyx_t_1;
24668   __Pyx_SetupRefcountContext("__len__");
24669
24670   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":223
24671  * 
24672  *     def __len__(self):
24673  *         return len(self._entries)             # <<<<<<<<<<<<<<
24674  * 
24675  *     def __contains__(self, error_type):
24676  */
24677   __pyx_t_1 = PyObject_Length(((PyObject *)((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24678   __pyx_r = __pyx_t_1;
24679   goto __pyx_L0;
24680
24681   __pyx_r = 0;
24682   goto __pyx_L0;
24683   __pyx_L1_error:;
24684   __Pyx_AddTraceback("lxml.etree._ListErrorLog.__len__");
24685   __pyx_r = -1;
24686   __pyx_L0:;
24687   __Pyx_FinishRefcountContext();
24688   return __pyx_r;
24689 }
24690
24691 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":225
24692  *         return len(self._entries)
24693  * 
24694  *     def __contains__(self, error_type):             # <<<<<<<<<<<<<<
24695  *         for entry in self._entries:
24696  *             if entry.type == error_type:
24697  */
24698
24699 static int __pyx_pf_4lxml_5etree_13_ListErrorLog___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_error_type); /*proto*/
24700 static int __pyx_pf_4lxml_5etree_13_ListErrorLog___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_error_type) {
24701   PyObject *__pyx_v_entry;
24702   int __pyx_r;
24703   Py_ssize_t __pyx_t_1;
24704   PyObject *__pyx_t_2 = NULL;
24705   PyObject *__pyx_t_3 = NULL;
24706   PyObject *__pyx_t_4 = NULL;
24707   int __pyx_t_5;
24708   __Pyx_SetupRefcountContext("__contains__");
24709   __pyx_v_entry = Py_None; __Pyx_INCREF(Py_None);
24710
24711   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":226
24712  * 
24713  *     def __contains__(self, error_type):
24714  *         for entry in self._entries:             # <<<<<<<<<<<<<<
24715  *             if entry.type == error_type:
24716  *                 return True
24717  */
24718   if (likely(((PyObject *)((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries) != Py_None)) {
24719     __pyx_t_1 = 0; __pyx_t_2 = ((PyObject *)((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries); __Pyx_INCREF(__pyx_t_2);
24720   } else {
24721     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24722   }
24723   for (;;) {
24724     if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break;
24725     __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
24726     __Pyx_DECREF(__pyx_v_entry);
24727     __pyx_v_entry = __pyx_t_3;
24728     __pyx_t_3 = 0;
24729
24730     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":227
24731  *     def __contains__(self, error_type):
24732  *         for entry in self._entries:
24733  *             if entry.type == error_type:             # <<<<<<<<<<<<<<
24734  *                 return True
24735  *         return False
24736  */
24737     __pyx_t_3 = PyObject_GetAttr(__pyx_v_entry, __pyx_kp_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24738     __Pyx_GOTREF(__pyx_t_3);
24739     __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_error_type, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24740     __Pyx_GOTREF(__pyx_t_4);
24741     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
24742     __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24743     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24744     if (__pyx_t_5) {
24745
24746       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":228
24747  *         for entry in self._entries:
24748  *             if entry.type == error_type:
24749  *                 return True             # <<<<<<<<<<<<<<
24750  *         return False
24751  * 
24752  */
24753       __pyx_r = 1;
24754       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24755       goto __pyx_L0;
24756       goto __pyx_L7;
24757     }
24758     __pyx_L7:;
24759   }
24760   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24761
24762   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":229
24763  *             if entry.type == error_type:
24764  *                 return True
24765  *         return False             # <<<<<<<<<<<<<<
24766  * 
24767  *     def __nonzero__(self):
24768  */
24769   __pyx_r = 0;
24770   goto __pyx_L0;
24771
24772   __pyx_r = 0;
24773   goto __pyx_L0;
24774   __pyx_L1_error:;
24775   __Pyx_XDECREF(__pyx_t_2);
24776   __Pyx_XDECREF(__pyx_t_3);
24777   __Pyx_XDECREF(__pyx_t_4);
24778   __Pyx_AddTraceback("lxml.etree._ListErrorLog.__contains__");
24779   __pyx_r = -1;
24780   __pyx_L0:;
24781   __Pyx_DECREF(__pyx_v_entry);
24782   __Pyx_FinishRefcountContext();
24783   return __pyx_r;
24784 }
24785
24786 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":231
24787  *         return False
24788  * 
24789  *     def __nonzero__(self):             # <<<<<<<<<<<<<<
24790  *         cdef bint result
24791  *         result = self._entries
24792  */
24793
24794 static int __pyx_pf_4lxml_5etree_13_ListErrorLog___nonzero__(PyObject *__pyx_v_self); /*proto*/
24795 static int __pyx_pf_4lxml_5etree_13_ListErrorLog___nonzero__(PyObject *__pyx_v_self) {
24796   int __pyx_v_result;
24797   int __pyx_r;
24798   int __pyx_t_1;
24799   __Pyx_SetupRefcountContext("__nonzero__");
24800
24801   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":233
24802  *     def __nonzero__(self):
24803  *         cdef bint result
24804  *         result = self._entries             # <<<<<<<<<<<<<<
24805  *         return result
24806  * 
24807  */
24808   __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries)); if (unlikely((__pyx_t_1 == (int)-1))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24809   __pyx_v_result = __pyx_t_1;
24810
24811   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":234
24812  *         cdef bint result
24813  *         result = self._entries
24814  *         return result             # <<<<<<<<<<<<<<
24815  * 
24816  *     def filter_domains(self, domains):
24817  */
24818   __pyx_r = __pyx_v_result;
24819   goto __pyx_L0;
24820
24821   __pyx_r = 0;
24822   goto __pyx_L0;
24823   __pyx_L1_error:;
24824   __Pyx_AddTraceback("lxml.etree._ListErrorLog.__nonzero__");
24825   __pyx_r = -1;
24826   __pyx_L0:;
24827   __Pyx_FinishRefcountContext();
24828   return __pyx_r;
24829 }
24830
24831 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":236
24832  *         return result
24833  * 
24834  *     def filter_domains(self, domains):             # <<<<<<<<<<<<<<
24835  *         u"""Filter the errors by the given domains and return a new error log
24836  *         containing the matches.
24837  */
24838
24839 static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_domains(PyObject *__pyx_v_self, PyObject *__pyx_v_domains); /*proto*/
24840 static char __pyx_doc_4lxml_5etree_13_ListErrorLog_filter_domains[] = "Filter the errors by the given domains and return a new error log\n        containing the matches.\n        ";
24841 static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_domains(PyObject *__pyx_v_self, PyObject *__pyx_v_domains) {
24842   struct __pyx_obj_4lxml_5etree__LogEntry *__pyx_v_entry;
24843   PyObject *__pyx_v_filtered = 0;
24844   PyObject *__pyx_r = NULL;
24845   PyObject *__pyx_t_1 = NULL;
24846   int __pyx_t_2;
24847   Py_ssize_t __pyx_t_3;
24848   PyObject *__pyx_t_4 = NULL;
24849   int __pyx_t_5;
24850   __Pyx_SetupRefcountContext("filter_domains");
24851   __Pyx_INCREF(__pyx_v_domains);
24852   __pyx_v_entry = ((struct __pyx_obj_4lxml_5etree__LogEntry *)Py_None); __Pyx_INCREF(Py_None);
24853
24854   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":241
24855  *         """
24856  *         cdef _LogEntry entry
24857  *         cdef list filtered = []             # <<<<<<<<<<<<<<
24858  *         if not python.PySequence_Check(domains):
24859  *             domains = (domains,)
24860  */
24861   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24862   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
24863   __pyx_v_filtered = __pyx_t_1;
24864   __pyx_t_1 = 0;
24865
24866   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":242
24867  *         cdef _LogEntry entry
24868  *         cdef list filtered = []
24869  *         if not python.PySequence_Check(domains):             # <<<<<<<<<<<<<<
24870  *             domains = (domains,)
24871  *         for entry in self._entries:
24872  */
24873   __pyx_t_2 = (!PySequence_Check(__pyx_v_domains));
24874   if (__pyx_t_2) {
24875
24876     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":243
24877  *         cdef list filtered = []
24878  *         if not python.PySequence_Check(domains):
24879  *             domains = (domains,)             # <<<<<<<<<<<<<<
24880  *         for entry in self._entries:
24881  *             if entry.domain in domains:
24882  */
24883     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24884     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
24885     __Pyx_INCREF(__pyx_v_domains);
24886     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_domains);
24887     __Pyx_GIVEREF(__pyx_v_domains);
24888     __Pyx_DECREF(__pyx_v_domains);
24889     __pyx_v_domains = ((PyObject *)__pyx_t_1);
24890     __pyx_t_1 = 0;
24891     goto __pyx_L5;
24892   }
24893   __pyx_L5:;
24894
24895   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":244
24896  *         if not python.PySequence_Check(domains):
24897  *             domains = (domains,)
24898  *         for entry in self._entries:             # <<<<<<<<<<<<<<
24899  *             if entry.domain in domains:
24900  *                 filtered.append(entry)
24901  */
24902   if (likely(((PyObject *)((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries) != Py_None)) {
24903     __pyx_t_3 = 0; __pyx_t_1 = ((PyObject *)((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries); __Pyx_INCREF(__pyx_t_1);
24904   } else {
24905     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24906   }
24907   for (;;) {
24908     if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
24909     __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++;
24910     if (!(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__LogEntry))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24911     __Pyx_DECREF(((PyObject *)__pyx_v_entry));
24912     __pyx_v_entry = ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_t_4);
24913     __pyx_t_4 = 0;
24914
24915     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":245
24916  *             domains = (domains,)
24917  *         for entry in self._entries:
24918  *             if entry.domain in domains:             # <<<<<<<<<<<<<<
24919  *                 filtered.append(entry)
24920  *         return _ListErrorLog(filtered, None, None)
24921  */
24922     __pyx_t_2 = (PySequence_Contains(__pyx_v_domains, __pyx_v_entry->domain)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24923     if (__pyx_t_2) {
24924
24925       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":246
24926  *         for entry in self._entries:
24927  *             if entry.domain in domains:
24928  *                 filtered.append(entry)             # <<<<<<<<<<<<<<
24929  *         return _ListErrorLog(filtered, None, None)
24930  * 
24931  */
24932       __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_filtered), ((PyObject *)__pyx_v_entry)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24933       goto __pyx_L8;
24934     }
24935     __pyx_L8:;
24936   }
24937   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24938
24939   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":247
24940  *             if entry.domain in domains:
24941  *                 filtered.append(entry)
24942  *         return _ListErrorLog(filtered, None, None)             # <<<<<<<<<<<<<<
24943  * 
24944  *     def filter_types(self, types):
24945  */
24946   __Pyx_XDECREF(__pyx_r);
24947   __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24948   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
24949   __Pyx_INCREF(((PyObject *)__pyx_v_filtered));
24950   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_filtered));
24951   __Pyx_GIVEREF(((PyObject *)__pyx_v_filtered));
24952   __Pyx_INCREF(Py_None);
24953   PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
24954   __Pyx_GIVEREF(Py_None);
24955   __Pyx_INCREF(Py_None);
24956   PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
24957   __Pyx_GIVEREF(Py_None);
24958   __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ListErrorLog)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
24959   __Pyx_GOTREF(__pyx_t_4);
24960   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
24961   __pyx_r = __pyx_t_4;
24962   __pyx_t_4 = 0;
24963   goto __pyx_L0;
24964
24965   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24966   goto __pyx_L0;
24967   __pyx_L1_error:;
24968   __Pyx_XDECREF(__pyx_t_1);
24969   __Pyx_XDECREF(__pyx_t_4);
24970   __Pyx_AddTraceback("lxml.etree._ListErrorLog.filter_domains");
24971   __pyx_r = NULL;
24972   __pyx_L0:;
24973   __Pyx_DECREF((PyObject *)__pyx_v_entry);
24974   __Pyx_XDECREF(__pyx_v_filtered);
24975   __Pyx_DECREF(__pyx_v_domains);
24976   __Pyx_XGIVEREF(__pyx_r);
24977   __Pyx_FinishRefcountContext();
24978   return __pyx_r;
24979 }
24980
24981 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":249
24982  *         return _ListErrorLog(filtered, None, None)
24983  * 
24984  *     def filter_types(self, types):             # <<<<<<<<<<<<<<
24985  *         u"""filter_types(self, types)
24986  * 
24987  */
24988
24989 static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_types(PyObject *__pyx_v_self, PyObject *__pyx_v_types); /*proto*/
24990 static char __pyx_doc_4lxml_5etree_13_ListErrorLog_filter_types[] = "filter_types(self, types)\n\n        Filter the errors by the given types and return a new error\n        log containing the matches.\n        ";
24991 static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_types(PyObject *__pyx_v_self, PyObject *__pyx_v_types) {
24992   struct __pyx_obj_4lxml_5etree__LogEntry *__pyx_v_entry;
24993   PyObject *__pyx_v_filtered = 0;
24994   PyObject *__pyx_r = NULL;
24995   PyObject *__pyx_t_1 = NULL;
24996   int __pyx_t_2;
24997   Py_ssize_t __pyx_t_3;
24998   PyObject *__pyx_t_4 = NULL;
24999   int __pyx_t_5;
25000   __Pyx_SetupRefcountContext("filter_types");
25001   __Pyx_INCREF(__pyx_v_types);
25002   __pyx_v_entry = ((struct __pyx_obj_4lxml_5etree__LogEntry *)Py_None); __Pyx_INCREF(Py_None);
25003
25004   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":256
25005  *         """
25006  *         cdef _LogEntry entry
25007  *         cdef list filtered = []             # <<<<<<<<<<<<<<
25008  *         if not python.PySequence_Check(types):
25009  *             types = (types,)
25010  */
25011   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25012   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
25013   __pyx_v_filtered = __pyx_t_1;
25014   __pyx_t_1 = 0;
25015
25016   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":257
25017  *         cdef _LogEntry entry
25018  *         cdef list filtered = []
25019  *         if not python.PySequence_Check(types):             # <<<<<<<<<<<<<<
25020  *             types = (types,)
25021  *         for entry in self._entries:
25022  */
25023   __pyx_t_2 = (!PySequence_Check(__pyx_v_types));
25024   if (__pyx_t_2) {
25025
25026     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":258
25027  *         cdef list filtered = []
25028  *         if not python.PySequence_Check(types):
25029  *             types = (types,)             # <<<<<<<<<<<<<<
25030  *         for entry in self._entries:
25031  *             if entry.type in types:
25032  */
25033     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25034     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
25035     __Pyx_INCREF(__pyx_v_types);
25036     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_types);
25037     __Pyx_GIVEREF(__pyx_v_types);
25038     __Pyx_DECREF(__pyx_v_types);
25039     __pyx_v_types = ((PyObject *)__pyx_t_1);
25040     __pyx_t_1 = 0;
25041     goto __pyx_L5;
25042   }
25043   __pyx_L5:;
25044
25045   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":259
25046  *         if not python.PySequence_Check(types):
25047  *             types = (types,)
25048  *         for entry in self._entries:             # <<<<<<<<<<<<<<
25049  *             if entry.type in types:
25050  *                 filtered.append(entry)
25051  */
25052   if (likely(((PyObject *)((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries) != Py_None)) {
25053     __pyx_t_3 = 0; __pyx_t_1 = ((PyObject *)((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries); __Pyx_INCREF(__pyx_t_1);
25054   } else {
25055     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25056   }
25057   for (;;) {
25058     if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
25059     __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++;
25060     if (!(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__LogEntry))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25061     __Pyx_DECREF(((PyObject *)__pyx_v_entry));
25062     __pyx_v_entry = ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_t_4);
25063     __pyx_t_4 = 0;
25064
25065     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":260
25066  *             types = (types,)
25067  *         for entry in self._entries:
25068  *             if entry.type in types:             # <<<<<<<<<<<<<<
25069  *                 filtered.append(entry)
25070  *         return _ListErrorLog(filtered, None, None)
25071  */
25072     __pyx_t_2 = (PySequence_Contains(__pyx_v_types, __pyx_v_entry->type)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25073     if (__pyx_t_2) {
25074
25075       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":261
25076  *         for entry in self._entries:
25077  *             if entry.type in types:
25078  *                 filtered.append(entry)             # <<<<<<<<<<<<<<
25079  *         return _ListErrorLog(filtered, None, None)
25080  * 
25081  */
25082       __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_filtered), ((PyObject *)__pyx_v_entry)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25083       goto __pyx_L8;
25084     }
25085     __pyx_L8:;
25086   }
25087   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25088
25089   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":262
25090  *             if entry.type in types:
25091  *                 filtered.append(entry)
25092  *         return _ListErrorLog(filtered, None, None)             # <<<<<<<<<<<<<<
25093  * 
25094  *     def filter_levels(self, levels):
25095  */
25096   __Pyx_XDECREF(__pyx_r);
25097   __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25098   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
25099   __Pyx_INCREF(((PyObject *)__pyx_v_filtered));
25100   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_filtered));
25101   __Pyx_GIVEREF(((PyObject *)__pyx_v_filtered));
25102   __Pyx_INCREF(Py_None);
25103   PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
25104   __Pyx_GIVEREF(Py_None);
25105   __Pyx_INCREF(Py_None);
25106   PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
25107   __Pyx_GIVEREF(Py_None);
25108   __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ListErrorLog)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25109   __Pyx_GOTREF(__pyx_t_4);
25110   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
25111   __pyx_r = __pyx_t_4;
25112   __pyx_t_4 = 0;
25113   goto __pyx_L0;
25114
25115   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25116   goto __pyx_L0;
25117   __pyx_L1_error:;
25118   __Pyx_XDECREF(__pyx_t_1);
25119   __Pyx_XDECREF(__pyx_t_4);
25120   __Pyx_AddTraceback("lxml.etree._ListErrorLog.filter_types");
25121   __pyx_r = NULL;
25122   __pyx_L0:;
25123   __Pyx_DECREF((PyObject *)__pyx_v_entry);
25124   __Pyx_XDECREF(__pyx_v_filtered);
25125   __Pyx_DECREF(__pyx_v_types);
25126   __Pyx_XGIVEREF(__pyx_r);
25127   __Pyx_FinishRefcountContext();
25128   return __pyx_r;
25129 }
25130
25131 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":264
25132  *         return _ListErrorLog(filtered, None, None)
25133  * 
25134  *     def filter_levels(self, levels):             # <<<<<<<<<<<<<<
25135  *         u"""filter_levels(self, levels)
25136  * 
25137  */
25138
25139 static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_levels(PyObject *__pyx_v_self, PyObject *__pyx_v_levels); /*proto*/
25140 static char __pyx_doc_4lxml_5etree_13_ListErrorLog_filter_levels[] = "filter_levels(self, levels)\n\n        Filter the errors by the given error levels and return a new\n        error log containing the matches.\n        ";
25141 static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_levels(PyObject *__pyx_v_self, PyObject *__pyx_v_levels) {
25142   struct __pyx_obj_4lxml_5etree__LogEntry *__pyx_v_entry;
25143   PyObject *__pyx_v_filtered = 0;
25144   PyObject *__pyx_r = NULL;
25145   PyObject *__pyx_t_1 = NULL;
25146   int __pyx_t_2;
25147   Py_ssize_t __pyx_t_3;
25148   PyObject *__pyx_t_4 = NULL;
25149   int __pyx_t_5;
25150   __Pyx_SetupRefcountContext("filter_levels");
25151   __Pyx_INCREF(__pyx_v_levels);
25152   __pyx_v_entry = ((struct __pyx_obj_4lxml_5etree__LogEntry *)Py_None); __Pyx_INCREF(Py_None);
25153
25154   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":271
25155  *         """
25156  *         cdef _LogEntry entry
25157  *         cdef list filtered = []             # <<<<<<<<<<<<<<
25158  *         if not python.PySequence_Check(levels):
25159  *             levels = (levels,)
25160  */
25161   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25162   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
25163   __pyx_v_filtered = __pyx_t_1;
25164   __pyx_t_1 = 0;
25165
25166   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":272
25167  *         cdef _LogEntry entry
25168  *         cdef list filtered = []
25169  *         if not python.PySequence_Check(levels):             # <<<<<<<<<<<<<<
25170  *             levels = (levels,)
25171  *         for entry in self._entries:
25172  */
25173   __pyx_t_2 = (!PySequence_Check(__pyx_v_levels));
25174   if (__pyx_t_2) {
25175
25176     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":273
25177  *         cdef list filtered = []
25178  *         if not python.PySequence_Check(levels):
25179  *             levels = (levels,)             # <<<<<<<<<<<<<<
25180  *         for entry in self._entries:
25181  *             if entry.level in levels:
25182  */
25183     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25184     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
25185     __Pyx_INCREF(__pyx_v_levels);
25186     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_levels);
25187     __Pyx_GIVEREF(__pyx_v_levels);
25188     __Pyx_DECREF(__pyx_v_levels);
25189     __pyx_v_levels = ((PyObject *)__pyx_t_1);
25190     __pyx_t_1 = 0;
25191     goto __pyx_L5;
25192   }
25193   __pyx_L5:;
25194
25195   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":274
25196  *         if not python.PySequence_Check(levels):
25197  *             levels = (levels,)
25198  *         for entry in self._entries:             # <<<<<<<<<<<<<<
25199  *             if entry.level in levels:
25200  *                 filtered.append(entry)
25201  */
25202   if (likely(((PyObject *)((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries) != Py_None)) {
25203     __pyx_t_3 = 0; __pyx_t_1 = ((PyObject *)((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries); __Pyx_INCREF(__pyx_t_1);
25204   } else {
25205     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25206   }
25207   for (;;) {
25208     if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
25209     __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++;
25210     if (!(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__LogEntry))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25211     __Pyx_DECREF(((PyObject *)__pyx_v_entry));
25212     __pyx_v_entry = ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_t_4);
25213     __pyx_t_4 = 0;
25214
25215     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":275
25216  *             levels = (levels,)
25217  *         for entry in self._entries:
25218  *             if entry.level in levels:             # <<<<<<<<<<<<<<
25219  *                 filtered.append(entry)
25220  *         return _ListErrorLog(filtered, None, None)
25221  */
25222     __pyx_t_2 = (PySequence_Contains(__pyx_v_levels, __pyx_v_entry->level)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25223     if (__pyx_t_2) {
25224
25225       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":276
25226  *         for entry in self._entries:
25227  *             if entry.level in levels:
25228  *                 filtered.append(entry)             # <<<<<<<<<<<<<<
25229  *         return _ListErrorLog(filtered, None, None)
25230  * 
25231  */
25232       __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_filtered), ((PyObject *)__pyx_v_entry)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25233       goto __pyx_L8;
25234     }
25235     __pyx_L8:;
25236   }
25237   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25238
25239   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":277
25240  *             if entry.level in levels:
25241  *                 filtered.append(entry)
25242  *         return _ListErrorLog(filtered, None, None)             # <<<<<<<<<<<<<<
25243  * 
25244  *     def filter_from_level(self, level):
25245  */
25246   __Pyx_XDECREF(__pyx_r);
25247   __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25248   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
25249   __Pyx_INCREF(((PyObject *)__pyx_v_filtered));
25250   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_filtered));
25251   __Pyx_GIVEREF(((PyObject *)__pyx_v_filtered));
25252   __Pyx_INCREF(Py_None);
25253   PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
25254   __Pyx_GIVEREF(Py_None);
25255   __Pyx_INCREF(Py_None);
25256   PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
25257   __Pyx_GIVEREF(Py_None);
25258   __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ListErrorLog)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25259   __Pyx_GOTREF(__pyx_t_4);
25260   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
25261   __pyx_r = __pyx_t_4;
25262   __pyx_t_4 = 0;
25263   goto __pyx_L0;
25264
25265   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25266   goto __pyx_L0;
25267   __pyx_L1_error:;
25268   __Pyx_XDECREF(__pyx_t_1);
25269   __Pyx_XDECREF(__pyx_t_4);
25270   __Pyx_AddTraceback("lxml.etree._ListErrorLog.filter_levels");
25271   __pyx_r = NULL;
25272   __pyx_L0:;
25273   __Pyx_DECREF((PyObject *)__pyx_v_entry);
25274   __Pyx_XDECREF(__pyx_v_filtered);
25275   __Pyx_DECREF(__pyx_v_levels);
25276   __Pyx_XGIVEREF(__pyx_r);
25277   __Pyx_FinishRefcountContext();
25278   return __pyx_r;
25279 }
25280
25281 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":279
25282  *         return _ListErrorLog(filtered, None, None)
25283  * 
25284  *     def filter_from_level(self, level):             # <<<<<<<<<<<<<<
25285  *         u"""filter_from_level(self, level)
25286  * 
25287  */
25288
25289 static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_from_level(PyObject *__pyx_v_self, PyObject *__pyx_v_level); /*proto*/
25290 static char __pyx_doc_4lxml_5etree_13_ListErrorLog_filter_from_level[] = "filter_from_level(self, level)\n\n        Return a log with all messages of the requested level of worse.\n        ";
25291 static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_from_level(PyObject *__pyx_v_self, PyObject *__pyx_v_level) {
25292   struct __pyx_obj_4lxml_5etree__LogEntry *__pyx_v_entry;
25293   PyObject *__pyx_v_filtered = 0;
25294   PyObject *__pyx_r = NULL;
25295   PyObject *__pyx_t_1 = NULL;
25296   Py_ssize_t __pyx_t_2;
25297   PyObject *__pyx_t_3 = NULL;
25298   int __pyx_t_4;
25299   int __pyx_t_5;
25300   __Pyx_SetupRefcountContext("filter_from_level");
25301   __pyx_v_entry = ((struct __pyx_obj_4lxml_5etree__LogEntry *)Py_None); __Pyx_INCREF(Py_None);
25302
25303   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":285
25304  *         """
25305  *         cdef _LogEntry entry
25306  *         cdef list filtered = []             # <<<<<<<<<<<<<<
25307  *         for entry in self._entries:
25308  *             if entry.level >= level:
25309  */
25310   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25311   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
25312   __pyx_v_filtered = __pyx_t_1;
25313   __pyx_t_1 = 0;
25314
25315   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":286
25316  *         cdef _LogEntry entry
25317  *         cdef list filtered = []
25318  *         for entry in self._entries:             # <<<<<<<<<<<<<<
25319  *             if entry.level >= level:
25320  *                 filtered.append(entry)
25321  */
25322   if (likely(((PyObject *)((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries) != Py_None)) {
25323     __pyx_t_2 = 0; __pyx_t_1 = ((PyObject *)((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries); __Pyx_INCREF(__pyx_t_1);
25324   } else {
25325     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25326   }
25327   for (;;) {
25328     if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
25329     __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++;
25330     if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4lxml_5etree__LogEntry))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25331     __Pyx_DECREF(((PyObject *)__pyx_v_entry));
25332     __pyx_v_entry = ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_t_3);
25333     __pyx_t_3 = 0;
25334
25335     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":287
25336  *         cdef list filtered = []
25337  *         for entry in self._entries:
25338  *             if entry.level >= level:             # <<<<<<<<<<<<<<
25339  *                 filtered.append(entry)
25340  *         return _ListErrorLog(filtered, None, None)
25341  */
25342     __pyx_t_3 = PyObject_RichCompare(__pyx_v_entry->level, __pyx_v_level, Py_GE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25343     __Pyx_GOTREF(__pyx_t_3);
25344     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25345     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
25346     if (__pyx_t_4) {
25347
25348       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":288
25349  *         for entry in self._entries:
25350  *             if entry.level >= level:
25351  *                 filtered.append(entry)             # <<<<<<<<<<<<<<
25352  *         return _ListErrorLog(filtered, None, None)
25353  * 
25354  */
25355       __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_filtered), ((PyObject *)__pyx_v_entry)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25356       goto __pyx_L7;
25357     }
25358     __pyx_L7:;
25359   }
25360   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25361
25362   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":289
25363  *             if entry.level >= level:
25364  *                 filtered.append(entry)
25365  *         return _ListErrorLog(filtered, None, None)             # <<<<<<<<<<<<<<
25366  * 
25367  *     def filter_from_fatals(self):
25368  */
25369   __Pyx_XDECREF(__pyx_r);
25370   __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25371   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
25372   __Pyx_INCREF(((PyObject *)__pyx_v_filtered));
25373   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_filtered));
25374   __Pyx_GIVEREF(((PyObject *)__pyx_v_filtered));
25375   __Pyx_INCREF(Py_None);
25376   PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
25377   __Pyx_GIVEREF(Py_None);
25378   __Pyx_INCREF(Py_None);
25379   PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
25380   __Pyx_GIVEREF(Py_None);
25381   __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ListErrorLog)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25382   __Pyx_GOTREF(__pyx_t_3);
25383   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
25384   __pyx_r = __pyx_t_3;
25385   __pyx_t_3 = 0;
25386   goto __pyx_L0;
25387
25388   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25389   goto __pyx_L0;
25390   __pyx_L1_error:;
25391   __Pyx_XDECREF(__pyx_t_1);
25392   __Pyx_XDECREF(__pyx_t_3);
25393   __Pyx_AddTraceback("lxml.etree._ListErrorLog.filter_from_level");
25394   __pyx_r = NULL;
25395   __pyx_L0:;
25396   __Pyx_DECREF((PyObject *)__pyx_v_entry);
25397   __Pyx_XDECREF(__pyx_v_filtered);
25398   __Pyx_XGIVEREF(__pyx_r);
25399   __Pyx_FinishRefcountContext();
25400   return __pyx_r;
25401 }
25402
25403 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":291
25404  *         return _ListErrorLog(filtered, None, None)
25405  * 
25406  *     def filter_from_fatals(self):             # <<<<<<<<<<<<<<
25407  *         u"""filter_from_fatals(self)
25408  * 
25409  */
25410
25411 static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_from_fatals(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
25412 static char __pyx_doc_4lxml_5etree_13_ListErrorLog_filter_from_fatals[] = "filter_from_fatals(self)\n\n        Convenience method to get all fatal error messages.\n        ";
25413 static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_from_fatals(PyObject *__pyx_v_self, PyObject *unused) {
25414   PyObject *__pyx_r = NULL;
25415   PyObject *__pyx_1 = 0;
25416   PyObject *__pyx_t_1 = NULL;
25417   PyObject *__pyx_t_2 = NULL;
25418   PyObject *__pyx_t_3 = NULL;
25419   __Pyx_SetupRefcountContext("filter_from_fatals");
25420
25421   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":296
25422  *         Convenience method to get all fatal error messages.
25423  *         """
25424  *         return self.filter_from_level(ErrorLevels.FATAL)             # <<<<<<<<<<<<<<
25425  * 
25426  *     def filter_from_errors(self):
25427  */
25428   __Pyx_XDECREF(__pyx_r);
25429   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_filter_from_level); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25430   __Pyx_GOTREF(__pyx_t_1);
25431   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ErrorLevels); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25432   __Pyx_GOTREF(__pyx_1);
25433   __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_FATAL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25434   __Pyx_GOTREF(__pyx_t_2);
25435   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
25436   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25437   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
25438   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
25439   __Pyx_GIVEREF(__pyx_t_2);
25440   __pyx_t_2 = 0;
25441   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25442   __Pyx_GOTREF(__pyx_t_2);
25443   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25444   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
25445   __pyx_r = __pyx_t_2;
25446   __pyx_t_2 = 0;
25447   goto __pyx_L0;
25448
25449   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25450   goto __pyx_L0;
25451   __pyx_L1_error:;
25452   __Pyx_XDECREF(__pyx_1);
25453   __Pyx_XDECREF(__pyx_t_1);
25454   __Pyx_XDECREF(__pyx_t_2);
25455   __Pyx_XDECREF(__pyx_t_3);
25456   __Pyx_AddTraceback("lxml.etree._ListErrorLog.filter_from_fatals");
25457   __pyx_r = NULL;
25458   __pyx_L0:;
25459   __Pyx_XGIVEREF(__pyx_r);
25460   __Pyx_FinishRefcountContext();
25461   return __pyx_r;
25462 }
25463
25464 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":298
25465  *         return self.filter_from_level(ErrorLevels.FATAL)
25466  * 
25467  *     def filter_from_errors(self):             # <<<<<<<<<<<<<<
25468  *         u"""filter_from_errors(self)
25469  * 
25470  */
25471
25472 static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_from_errors(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
25473 static char __pyx_doc_4lxml_5etree_13_ListErrorLog_filter_from_errors[] = "filter_from_errors(self)\n\n        Convenience method to get all error messages or worse.\n        ";
25474 static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_from_errors(PyObject *__pyx_v_self, PyObject *unused) {
25475   PyObject *__pyx_r = NULL;
25476   PyObject *__pyx_1 = 0;
25477   PyObject *__pyx_t_1 = NULL;
25478   PyObject *__pyx_t_2 = NULL;
25479   PyObject *__pyx_t_3 = NULL;
25480   __Pyx_SetupRefcountContext("filter_from_errors");
25481
25482   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":303
25483  *         Convenience method to get all error messages or worse.
25484  *         """
25485  *         return self.filter_from_level(ErrorLevels.ERROR)             # <<<<<<<<<<<<<<
25486  * 
25487  *     def filter_from_warnings(self):
25488  */
25489   __Pyx_XDECREF(__pyx_r);
25490   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_filter_from_level); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25491   __Pyx_GOTREF(__pyx_t_1);
25492   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ErrorLevels); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25493   __Pyx_GOTREF(__pyx_1);
25494   __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_ERROR); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25495   __Pyx_GOTREF(__pyx_t_2);
25496   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
25497   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25498   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
25499   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
25500   __Pyx_GIVEREF(__pyx_t_2);
25501   __pyx_t_2 = 0;
25502   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25503   __Pyx_GOTREF(__pyx_t_2);
25504   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25505   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
25506   __pyx_r = __pyx_t_2;
25507   __pyx_t_2 = 0;
25508   goto __pyx_L0;
25509
25510   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25511   goto __pyx_L0;
25512   __pyx_L1_error:;
25513   __Pyx_XDECREF(__pyx_1);
25514   __Pyx_XDECREF(__pyx_t_1);
25515   __Pyx_XDECREF(__pyx_t_2);
25516   __Pyx_XDECREF(__pyx_t_3);
25517   __Pyx_AddTraceback("lxml.etree._ListErrorLog.filter_from_errors");
25518   __pyx_r = NULL;
25519   __pyx_L0:;
25520   __Pyx_XGIVEREF(__pyx_r);
25521   __Pyx_FinishRefcountContext();
25522   return __pyx_r;
25523 }
25524
25525 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":305
25526  *         return self.filter_from_level(ErrorLevels.ERROR)
25527  * 
25528  *     def filter_from_warnings(self):             # <<<<<<<<<<<<<<
25529  *         u"""filter_from_warnings(self)
25530  * 
25531  */
25532
25533 static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_from_warnings(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
25534 static char __pyx_doc_4lxml_5etree_13_ListErrorLog_filter_from_warnings[] = "filter_from_warnings(self)\n\n        Convenience method to get all warnings or worse.\n        ";
25535 static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_from_warnings(PyObject *__pyx_v_self, PyObject *unused) {
25536   PyObject *__pyx_r = NULL;
25537   PyObject *__pyx_1 = 0;
25538   PyObject *__pyx_t_1 = NULL;
25539   PyObject *__pyx_t_2 = NULL;
25540   PyObject *__pyx_t_3 = NULL;
25541   __Pyx_SetupRefcountContext("filter_from_warnings");
25542
25543   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":310
25544  *         Convenience method to get all warnings or worse.
25545  *         """
25546  *         return self.filter_from_level(ErrorLevels.WARNING)             # <<<<<<<<<<<<<<
25547  * 
25548  * cdef class _ErrorLog(_ListErrorLog):
25549  */
25550   __Pyx_XDECREF(__pyx_r);
25551   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_filter_from_level); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25552   __Pyx_GOTREF(__pyx_t_1);
25553   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ErrorLevels); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25554   __Pyx_GOTREF(__pyx_1);
25555   __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_WARNING); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25556   __Pyx_GOTREF(__pyx_t_2);
25557   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
25558   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25559   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
25560   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
25561   __Pyx_GIVEREF(__pyx_t_2);
25562   __pyx_t_2 = 0;
25563   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25564   __Pyx_GOTREF(__pyx_t_2);
25565   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25566   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
25567   __pyx_r = __pyx_t_2;
25568   __pyx_t_2 = 0;
25569   goto __pyx_L0;
25570
25571   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25572   goto __pyx_L0;
25573   __pyx_L1_error:;
25574   __Pyx_XDECREF(__pyx_1);
25575   __Pyx_XDECREF(__pyx_t_1);
25576   __Pyx_XDECREF(__pyx_t_2);
25577   __Pyx_XDECREF(__pyx_t_3);
25578   __Pyx_AddTraceback("lxml.etree._ListErrorLog.filter_from_warnings");
25579   __pyx_r = NULL;
25580   __pyx_L0:;
25581   __Pyx_XGIVEREF(__pyx_r);
25582   __Pyx_FinishRefcountContext();
25583   return __pyx_r;
25584 }
25585
25586 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":313
25587  * 
25588  * cdef class _ErrorLog(_ListErrorLog):
25589  *     def __init__(self):             # <<<<<<<<<<<<<<
25590  *         _ListErrorLog.__init__(self, [], None, None)
25591  * 
25592  */
25593
25594 static int __pyx_pf_4lxml_5etree_9_ErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
25595 static int __pyx_pf_4lxml_5etree_9_ErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
25596   int __pyx_r;
25597   PyObject *__pyx_t_1 = NULL;
25598   PyObject *__pyx_t_2 = NULL;
25599   PyObject *__pyx_t_3 = NULL;
25600   __Pyx_SetupRefcountContext("__init__");
25601   if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
25602     __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
25603   if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
25604
25605   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":314
25606  * cdef class _ErrorLog(_ListErrorLog):
25607  *     def __init__(self):
25608  *         _ListErrorLog.__init__(self, [], None, None)             # <<<<<<<<<<<<<<
25609  * 
25610  *     cdef void connect(self):
25611  */
25612   __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ListErrorLog)), __pyx_kp___init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25613   __Pyx_GOTREF(__pyx_t_1);
25614   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25615   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
25616   __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25617   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
25618   __Pyx_INCREF(__pyx_v_self);
25619   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self);
25620   __Pyx_GIVEREF(__pyx_v_self);
25621   PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_t_2));
25622   __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
25623   __Pyx_INCREF(Py_None);
25624   PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None);
25625   __Pyx_GIVEREF(Py_None);
25626   __Pyx_INCREF(Py_None);
25627   PyTuple_SET_ITEM(__pyx_t_3, 3, Py_None);
25628   __Pyx_GIVEREF(Py_None);
25629   __pyx_t_2 = 0;
25630   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25631   __Pyx_GOTREF(__pyx_t_2);
25632   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25633   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
25634   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25635
25636   __pyx_r = 0;
25637   goto __pyx_L0;
25638   __pyx_L1_error:;
25639   __Pyx_XDECREF(__pyx_t_1);
25640   __Pyx_XDECREF(__pyx_t_2);
25641   __Pyx_XDECREF(__pyx_t_3);
25642   __Pyx_AddTraceback("lxml.etree._ErrorLog.__init__");
25643   __pyx_r = -1;
25644   __pyx_L0:;
25645   __Pyx_FinishRefcountContext();
25646   return __pyx_r;
25647 }
25648
25649 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":316
25650  *         _ListErrorLog.__init__(self, [], None, None)
25651  * 
25652  *     cdef void connect(self):             # <<<<<<<<<<<<<<
25653  *         self._first_error = None
25654  *         del self._entries[:]
25655  */
25656
25657 static  void __pyx_f_4lxml_5etree_9_ErrorLog_connect(struct __pyx_obj_4lxml_5etree__ErrorLog *__pyx_v_self) {
25658   __Pyx_SetupRefcountContext("connect");
25659
25660   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":317
25661  * 
25662  *     cdef void connect(self):
25663  *         self._first_error = None             # <<<<<<<<<<<<<<
25664  *         del self._entries[:]
25665  *         connectErrorLog(<void*>self)
25666  */
25667   __Pyx_INCREF(Py_None);
25668   __Pyx_GIVEREF(Py_None);
25669   __Pyx_GOTREF(__pyx_v_self->__pyx_base.__pyx_base._first_error);
25670   __Pyx_DECREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._first_error));
25671   __pyx_v_self->__pyx_base.__pyx_base._first_error = ((struct __pyx_obj_4lxml_5etree__LogEntry *)Py_None);
25672
25673   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":318
25674  *     cdef void connect(self):
25675  *         self._first_error = None
25676  *         del self._entries[:]             # <<<<<<<<<<<<<<
25677  *         connectErrorLog(<void*>self)
25678  * 
25679  */
25680   if (PySequence_DelSlice(((PyObject *)__pyx_v_self->__pyx_base._entries), 0, PY_SSIZE_T_MAX) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25681
25682   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":319
25683  *         self._first_error = None
25684  *         del self._entries[:]
25685  *         connectErrorLog(<void*>self)             # <<<<<<<<<<<<<<
25686  * 
25687  *     cdef void disconnect(self):
25688  */
25689   __pyx_f_4lxml_5etree_connectErrorLog(((void *)__pyx_v_self));
25690
25691   goto __pyx_L0;
25692   __pyx_L1_error:;
25693   __Pyx_WriteUnraisable("lxml.etree._ErrorLog.connect");
25694   __pyx_L0:;
25695   __Pyx_FinishRefcountContext();
25696 }
25697
25698 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":321
25699  *         connectErrorLog(<void*>self)
25700  * 
25701  *     cdef void disconnect(self):             # <<<<<<<<<<<<<<
25702  *         connectErrorLog(NULL)
25703  * 
25704  */
25705
25706 static  void __pyx_f_4lxml_5etree_9_ErrorLog_disconnect(struct __pyx_obj_4lxml_5etree__ErrorLog *__pyx_v_self) {
25707   __Pyx_SetupRefcountContext("disconnect");
25708
25709   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":322
25710  * 
25711  *     cdef void disconnect(self):
25712  *         connectErrorLog(NULL)             # <<<<<<<<<<<<<<
25713  * 
25714  *     def clear(self):
25715  */
25716   __pyx_f_4lxml_5etree_connectErrorLog(NULL);
25717
25718   __Pyx_FinishRefcountContext();
25719 }
25720
25721 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":324
25722  *         connectErrorLog(NULL)
25723  * 
25724  *     def clear(self):             # <<<<<<<<<<<<<<
25725  *         self._first_error = None
25726  *         del self._entries[:]
25727  */
25728
25729 static PyObject *__pyx_pf_4lxml_5etree_9_ErrorLog_clear(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
25730 static PyObject *__pyx_pf_4lxml_5etree_9_ErrorLog_clear(PyObject *__pyx_v_self, PyObject *unused) {
25731   PyObject *__pyx_r = NULL;
25732   __Pyx_SetupRefcountContext("clear");
25733
25734   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":325
25735  * 
25736  *     def clear(self):
25737  *         self._first_error = None             # <<<<<<<<<<<<<<
25738  *         del self._entries[:]
25739  * 
25740  */
25741   __Pyx_INCREF(Py_None);
25742   __Pyx_GIVEREF(Py_None);
25743   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base._first_error);
25744   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base._first_error));
25745   ((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base._first_error = ((struct __pyx_obj_4lxml_5etree__LogEntry *)Py_None);
25746
25747   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":326
25748  *     def clear(self):
25749  *         self._first_error = None
25750  *         del self._entries[:]             # <<<<<<<<<<<<<<
25751  * 
25752  *     def copy(self):
25753  */
25754   if (PySequence_DelSlice(((PyObject *)((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_v_self)->__pyx_base._entries), 0, PY_SSIZE_T_MAX) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25755
25756   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25757   goto __pyx_L0;
25758   __pyx_L1_error:;
25759   __Pyx_AddTraceback("lxml.etree._ErrorLog.clear");
25760   __pyx_r = NULL;
25761   __pyx_L0:;
25762   __Pyx_XGIVEREF(__pyx_r);
25763   __Pyx_FinishRefcountContext();
25764   return __pyx_r;
25765 }
25766
25767 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":328
25768  *         del self._entries[:]
25769  * 
25770  *     def copy(self):             # <<<<<<<<<<<<<<
25771  *         u"""Creates a shallow copy of this error log and the list of entries.
25772  *         """
25773  */
25774
25775 static PyObject *__pyx_pf_4lxml_5etree_9_ErrorLog_copy(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
25776 static char __pyx_doc_4lxml_5etree_9_ErrorLog_copy[] = "Creates a shallow copy of this error log and the list of entries.\n        ";
25777 static PyObject *__pyx_pf_4lxml_5etree_9_ErrorLog_copy(PyObject *__pyx_v_self, PyObject *unused) {
25778   PyObject *__pyx_r = NULL;
25779   PyObject *__pyx_1 = 0;
25780   PyObject *__pyx_t_1 = NULL;
25781   PyObject *__pyx_t_2 = NULL;
25782   __Pyx_SetupRefcountContext("copy");
25783
25784   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":331
25785  *         u"""Creates a shallow copy of this error log and the list of entries.
25786  *         """
25787  *         return _ListErrorLog(self._entries[:], self._first_error,             # <<<<<<<<<<<<<<
25788  *                              self.last_error)
25789  * 
25790  */
25791   __Pyx_XDECREF(__pyx_r);
25792   __pyx_1 = PySequence_GetSlice(((PyObject *)((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_v_self)->__pyx_base._entries), 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25793   __Pyx_GOTREF(((PyObject *)__pyx_1));
25794
25795   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":332
25796  *         """
25797  *         return _ListErrorLog(self._entries[:], self._first_error,
25798  *                              self.last_error)             # <<<<<<<<<<<<<<
25799  * 
25800  *     def __iter__(self):
25801  */
25802   __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25803   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
25804   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_1));
25805   __Pyx_GIVEREF(((PyObject *)__pyx_1));
25806   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base._first_error));
25807   PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base._first_error));
25808   __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base._first_error));
25809   __Pyx_INCREF(((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base.last_error);
25810   PyTuple_SET_ITEM(__pyx_t_1, 2, ((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base.last_error);
25811   __Pyx_GIVEREF(((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base.last_error);
25812   __pyx_1 = 0;
25813   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ListErrorLog)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25814   __Pyx_GOTREF(__pyx_t_2);
25815   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
25816   __pyx_r = __pyx_t_2;
25817   __pyx_t_2 = 0;
25818   goto __pyx_L0;
25819
25820   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25821   goto __pyx_L0;
25822   __pyx_L1_error:;
25823   __Pyx_XDECREF(__pyx_1);
25824   __Pyx_XDECREF(__pyx_t_1);
25825   __Pyx_XDECREF(__pyx_t_2);
25826   __Pyx_AddTraceback("lxml.etree._ErrorLog.copy");
25827   __pyx_r = NULL;
25828   __pyx_L0:;
25829   __Pyx_XGIVEREF(__pyx_r);
25830   __Pyx_FinishRefcountContext();
25831   return __pyx_r;
25832 }
25833
25834 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":334
25835  *                              self.last_error)
25836  * 
25837  *     def __iter__(self):             # <<<<<<<<<<<<<<
25838  *         return iter(self._entries[:])
25839  * 
25840  */
25841
25842 static PyObject *__pyx_pf_4lxml_5etree_9_ErrorLog___iter__(PyObject *__pyx_v_self); /*proto*/
25843 static PyObject *__pyx_pf_4lxml_5etree_9_ErrorLog___iter__(PyObject *__pyx_v_self) {
25844   PyObject *__pyx_r = NULL;
25845   PyObject *__pyx_1 = 0;
25846   PyObject *__pyx_t_1 = NULL;
25847   __Pyx_SetupRefcountContext("__iter__");
25848
25849   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":335
25850  * 
25851  *     def __iter__(self):
25852  *         return iter(self._entries[:])             # <<<<<<<<<<<<<<
25853  * 
25854  *     def receive(self, entry):
25855  */
25856   __Pyx_XDECREF(__pyx_r);
25857   __pyx_1 = PySequence_GetSlice(((PyObject *)((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_v_self)->__pyx_base._entries), 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25858   __Pyx_GOTREF(((PyObject *)__pyx_1));
25859   __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25860   __Pyx_GOTREF(__pyx_t_1);
25861   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
25862   __pyx_r = __pyx_t_1;
25863   __pyx_t_1 = 0;
25864   goto __pyx_L0;
25865
25866   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25867   goto __pyx_L0;
25868   __pyx_L1_error:;
25869   __Pyx_XDECREF(__pyx_1);
25870   __Pyx_XDECREF(__pyx_t_1);
25871   __Pyx_AddTraceback("lxml.etree._ErrorLog.__iter__");
25872   __pyx_r = NULL;
25873   __pyx_L0:;
25874   __Pyx_XGIVEREF(__pyx_r);
25875   __Pyx_FinishRefcountContext();
25876   return __pyx_r;
25877 }
25878
25879 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":337
25880  *         return iter(self._entries[:])
25881  * 
25882  *     def receive(self, entry):             # <<<<<<<<<<<<<<
25883  *         if self._first_error is None:
25884  *             self._first_error = entry
25885  */
25886
25887 static PyObject *__pyx_pf_4lxml_5etree_9_ErrorLog_receive(PyObject *__pyx_v_self, PyObject *__pyx_v_entry); /*proto*/
25888 static PyObject *__pyx_pf_4lxml_5etree_9_ErrorLog_receive(PyObject *__pyx_v_self, PyObject *__pyx_v_entry) {
25889   PyObject *__pyx_r = NULL;
25890   int __pyx_t_1;
25891   int __pyx_t_2;
25892   __Pyx_SetupRefcountContext("receive");
25893
25894   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":338
25895  * 
25896  *     def receive(self, entry):
25897  *         if self._first_error is None:             # <<<<<<<<<<<<<<
25898  *             self._first_error = entry
25899  *         self._entries.append(entry)
25900  */
25901   __pyx_t_1 = (((PyObject *)((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base._first_error) == Py_None);
25902   if (__pyx_t_1) {
25903
25904     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":339
25905  *     def receive(self, entry):
25906  *         if self._first_error is None:
25907  *             self._first_error = entry             # <<<<<<<<<<<<<<
25908  *         self._entries.append(entry)
25909  * 
25910  */
25911     if (!(__Pyx_TypeTest(__pyx_v_entry, __pyx_ptype_4lxml_5etree__LogEntry))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25912     __Pyx_INCREF(__pyx_v_entry);
25913     __Pyx_GIVEREF(__pyx_v_entry);
25914     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base._first_error);
25915     __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base._first_error));
25916     ((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base._first_error = ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_entry);
25917     goto __pyx_L5;
25918   }
25919   __pyx_L5:;
25920
25921   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":340
25922  *         if self._first_error is None:
25923  *             self._first_error = entry
25924  *         self._entries.append(entry)             # <<<<<<<<<<<<<<
25925  * 
25926  * cdef class _DomainErrorLog(_ErrorLog):
25927  */
25928   __pyx_t_2 = PyList_Append(((PyObject *)((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_v_self)->__pyx_base._entries), __pyx_v_entry); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25929
25930   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
25931   goto __pyx_L0;
25932   __pyx_L1_error:;
25933   __Pyx_AddTraceback("lxml.etree._ErrorLog.receive");
25934   __pyx_r = NULL;
25935   __pyx_L0:;
25936   __Pyx_XGIVEREF(__pyx_r);
25937   __Pyx_FinishRefcountContext();
25938   return __pyx_r;
25939 }
25940
25941 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":343
25942  * 
25943  * cdef class _DomainErrorLog(_ErrorLog):
25944  *     def __init__(self, domains):             # <<<<<<<<<<<<<<
25945  *         _ErrorLog.__init__(self)
25946  *         self._accepted_domains = tuple(domains)
25947  */
25948
25949 static int __pyx_pf_4lxml_5etree_15_DomainErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
25950 static int __pyx_pf_4lxml_5etree_15_DomainErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
25951   PyObject *__pyx_v_domains = 0;
25952   int __pyx_r;
25953   PyObject *__pyx_t_1 = NULL;
25954   PyObject *__pyx_t_2 = NULL;
25955   PyObject *__pyx_t_3 = NULL;
25956   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_domains,0};
25957   __Pyx_SetupRefcountContext("__init__");
25958   if (unlikely(__pyx_kwds)) {
25959     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
25960     PyObject* values[1] = {0};
25961     switch (PyTuple_GET_SIZE(__pyx_args)) {
25962       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
25963       case  0: break;
25964       default: goto __pyx_L5_argtuple_error;
25965     }
25966     switch (PyTuple_GET_SIZE(__pyx_args)) {
25967       case  0:
25968       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_domains);
25969       if (likely(values[0])) kw_args--;
25970       else goto __pyx_L5_argtuple_error;
25971     }
25972     if (unlikely(kw_args > 0)) {
25973       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
25974     }
25975     __pyx_v_domains = values[0];
25976   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
25977     goto __pyx_L5_argtuple_error;
25978   } else {
25979     __pyx_v_domains = PyTuple_GET_ITEM(__pyx_args, 0);
25980   }
25981   goto __pyx_L4_argument_unpacking_done;
25982   __pyx_L5_argtuple_error:;
25983   __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
25984   __pyx_L3_error:;
25985   __Pyx_AddTraceback("lxml.etree._DomainErrorLog.__init__");
25986   return -1;
25987   __pyx_L4_argument_unpacking_done:;
25988
25989   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":344
25990  * cdef class _DomainErrorLog(_ErrorLog):
25991  *     def __init__(self, domains):
25992  *         _ErrorLog.__init__(self)             # <<<<<<<<<<<<<<
25993  *         self._accepted_domains = tuple(domains)
25994  * 
25995  */
25996   __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ErrorLog)), __pyx_kp___init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25997   __Pyx_GOTREF(__pyx_t_1);
25998   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
25999   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
26000   __Pyx_INCREF(__pyx_v_self);
26001   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
26002   __Pyx_GIVEREF(__pyx_v_self);
26003   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26004   __Pyx_GOTREF(__pyx_t_3);
26005   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26006   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
26007   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26008
26009   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":345
26010  *     def __init__(self, domains):
26011  *         _ErrorLog.__init__(self)
26012  *         self._accepted_domains = tuple(domains)             # <<<<<<<<<<<<<<
26013  * 
26014  *     def receive(self, entry):
26015  */
26016   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26017   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
26018   __Pyx_INCREF(__pyx_v_domains);
26019   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_domains);
26020   __Pyx_GIVEREF(__pyx_v_domains);
26021   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyTuple_Type)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26022   __Pyx_GOTREF(__pyx_t_2);
26023   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
26024   if (PyObject_SetAttr(__pyx_v_self, __pyx_kp__accepted_domains, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26025   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26026
26027   __pyx_r = 0;
26028   goto __pyx_L0;
26029   __pyx_L1_error:;
26030   __Pyx_XDECREF(__pyx_t_1);
26031   __Pyx_XDECREF(__pyx_t_2);
26032   __Pyx_XDECREF(__pyx_t_3);
26033   __Pyx_AddTraceback("lxml.etree._DomainErrorLog.__init__");
26034   __pyx_r = -1;
26035   __pyx_L0:;
26036   __Pyx_FinishRefcountContext();
26037   return __pyx_r;
26038 }
26039
26040 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":347
26041  *         self._accepted_domains = tuple(domains)
26042  * 
26043  *     def receive(self, entry):             # <<<<<<<<<<<<<<
26044  *         if entry.domain in self._accepted_domains:
26045  *             _ErrorLog.receive(self, entry)
26046  */
26047
26048 static PyObject *__pyx_pf_4lxml_5etree_15_DomainErrorLog_receive(PyObject *__pyx_v_self, PyObject *__pyx_v_entry); /*proto*/
26049 static PyObject *__pyx_pf_4lxml_5etree_15_DomainErrorLog_receive(PyObject *__pyx_v_self, PyObject *__pyx_v_entry) {
26050   PyObject *__pyx_r = NULL;
26051   PyObject *__pyx_t_1 = NULL;
26052   PyObject *__pyx_t_2 = NULL;
26053   int __pyx_t_3;
26054   PyObject *__pyx_t_4 = NULL;
26055   __Pyx_SetupRefcountContext("receive");
26056
26057   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":348
26058  * 
26059  *     def receive(self, entry):
26060  *         if entry.domain in self._accepted_domains:             # <<<<<<<<<<<<<<
26061  *             _ErrorLog.receive(self, entry)
26062  * 
26063  */
26064   __pyx_t_1 = PyObject_GetAttr(__pyx_v_entry, __pyx_kp_domain); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26065   __Pyx_GOTREF(__pyx_t_1);
26066   __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp__accepted_domains); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26067   __Pyx_GOTREF(__pyx_t_2);
26068   __pyx_t_3 = (PySequence_Contains(__pyx_t_2, __pyx_t_1)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26069   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26070   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26071   if (__pyx_t_3) {
26072
26073     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":349
26074  *     def receive(self, entry):
26075  *         if entry.domain in self._accepted_domains:
26076  *             _ErrorLog.receive(self, entry)             # <<<<<<<<<<<<<<
26077  * 
26078  * cdef class _RotatingErrorLog(_ErrorLog):
26079  */
26080     __pyx_t_2 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ErrorLog)), __pyx_kp_receive); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26081     __Pyx_GOTREF(__pyx_t_2);
26082     __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26083     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
26084     __Pyx_INCREF(__pyx_v_self);
26085     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
26086     __Pyx_GIVEREF(__pyx_v_self);
26087     __Pyx_INCREF(__pyx_v_entry);
26088     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_entry);
26089     __Pyx_GIVEREF(__pyx_v_entry);
26090     __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26091     __Pyx_GOTREF(__pyx_t_4);
26092     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26093     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
26094     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26095     goto __pyx_L5;
26096   }
26097   __pyx_L5:;
26098
26099   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
26100   goto __pyx_L0;
26101   __pyx_L1_error:;
26102   __Pyx_XDECREF(__pyx_t_1);
26103   __Pyx_XDECREF(__pyx_t_2);
26104   __Pyx_XDECREF(__pyx_t_4);
26105   __Pyx_AddTraceback("lxml.etree._DomainErrorLog.receive");
26106   __pyx_r = NULL;
26107   __pyx_L0:;
26108   __Pyx_XGIVEREF(__pyx_r);
26109   __Pyx_FinishRefcountContext();
26110   return __pyx_r;
26111 }
26112
26113 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":353
26114  * cdef class _RotatingErrorLog(_ErrorLog):
26115  *     cdef int _max_len
26116  *     def __init__(self, max_len):             # <<<<<<<<<<<<<<
26117  *         _ErrorLog.__init__(self)
26118  *         self._max_len = max_len
26119  */
26120
26121 static int __pyx_pf_4lxml_5etree_17_RotatingErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
26122 static int __pyx_pf_4lxml_5etree_17_RotatingErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
26123   PyObject *__pyx_v_max_len = 0;
26124   int __pyx_r;
26125   PyObject *__pyx_t_1 = NULL;
26126   PyObject *__pyx_t_2 = NULL;
26127   PyObject *__pyx_t_3 = NULL;
26128   int __pyx_t_4;
26129   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_max_len,0};
26130   __Pyx_SetupRefcountContext("__init__");
26131   if (unlikely(__pyx_kwds)) {
26132     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
26133     PyObject* values[1] = {0};
26134     switch (PyTuple_GET_SIZE(__pyx_args)) {
26135       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26136       case  0: break;
26137       default: goto __pyx_L5_argtuple_error;
26138     }
26139     switch (PyTuple_GET_SIZE(__pyx_args)) {
26140       case  0:
26141       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_max_len);
26142       if (likely(values[0])) kw_args--;
26143       else goto __pyx_L5_argtuple_error;
26144     }
26145     if (unlikely(kw_args > 0)) {
26146       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
26147     }
26148     __pyx_v_max_len = values[0];
26149   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
26150     goto __pyx_L5_argtuple_error;
26151   } else {
26152     __pyx_v_max_len = PyTuple_GET_ITEM(__pyx_args, 0);
26153   }
26154   goto __pyx_L4_argument_unpacking_done;
26155   __pyx_L5_argtuple_error:;
26156   __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
26157   __pyx_L3_error:;
26158   __Pyx_AddTraceback("lxml.etree._RotatingErrorLog.__init__");
26159   return -1;
26160   __pyx_L4_argument_unpacking_done:;
26161
26162   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":354
26163  *     cdef int _max_len
26164  *     def __init__(self, max_len):
26165  *         _ErrorLog.__init__(self)             # <<<<<<<<<<<<<<
26166  *         self._max_len = max_len
26167  * 
26168  */
26169   __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ErrorLog)), __pyx_kp___init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26170   __Pyx_GOTREF(__pyx_t_1);
26171   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26172   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
26173   __Pyx_INCREF(__pyx_v_self);
26174   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
26175   __Pyx_GIVEREF(__pyx_v_self);
26176   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26177   __Pyx_GOTREF(__pyx_t_3);
26178   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26179   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
26180   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26181
26182   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":355
26183  *     def __init__(self, max_len):
26184  *         _ErrorLog.__init__(self)
26185  *         self._max_len = max_len             # <<<<<<<<<<<<<<
26186  * 
26187  *     def receive(self, entry):
26188  */
26189   __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_max_len); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26190   ((struct __pyx_obj_4lxml_5etree__RotatingErrorLog *)__pyx_v_self)->_max_len = __pyx_t_4;
26191
26192   __pyx_r = 0;
26193   goto __pyx_L0;
26194   __pyx_L1_error:;
26195   __Pyx_XDECREF(__pyx_t_1);
26196   __Pyx_XDECREF(__pyx_t_2);
26197   __Pyx_XDECREF(__pyx_t_3);
26198   __Pyx_AddTraceback("lxml.etree._RotatingErrorLog.__init__");
26199   __pyx_r = -1;
26200   __pyx_L0:;
26201   __Pyx_FinishRefcountContext();
26202   return __pyx_r;
26203 }
26204
26205 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":357
26206  *         self._max_len = max_len
26207  * 
26208  *     def receive(self, entry):             # <<<<<<<<<<<<<<
26209  *         if python.PyList_GET_SIZE(self._entries) > self._max_len:
26210  *             del self._entries[0]
26211  */
26212
26213 static PyObject *__pyx_pf_4lxml_5etree_17_RotatingErrorLog_receive(PyObject *__pyx_v_self, PyObject *__pyx_v_entry); /*proto*/
26214 static PyObject *__pyx_pf_4lxml_5etree_17_RotatingErrorLog_receive(PyObject *__pyx_v_self, PyObject *__pyx_v_entry) {
26215   PyObject *__pyx_r = NULL;
26216   int __pyx_t_1;
26217   int __pyx_t_2;
26218   __Pyx_SetupRefcountContext("receive");
26219
26220   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":358
26221  * 
26222  *     def receive(self, entry):
26223  *         if python.PyList_GET_SIZE(self._entries) > self._max_len:             # <<<<<<<<<<<<<<
26224  *             del self._entries[0]
26225  *         self._entries.append(entry)
26226  */
26227   __pyx_t_1 = (PyList_GET_SIZE(((PyObject *)((struct __pyx_obj_4lxml_5etree__RotatingErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base._entries)) > ((struct __pyx_obj_4lxml_5etree__RotatingErrorLog *)__pyx_v_self)->_max_len);
26228   if (__pyx_t_1) {
26229
26230     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":359
26231  *     def receive(self, entry):
26232  *         if python.PyList_GET_SIZE(self._entries) > self._max_len:
26233  *             del self._entries[0]             # <<<<<<<<<<<<<<
26234  *         self._entries.append(entry)
26235  * 
26236  */
26237     if (__Pyx_DelItemInt(((PyObject *)((struct __pyx_obj_4lxml_5etree__RotatingErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base._entries), 0, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26238     goto __pyx_L5;
26239   }
26240   __pyx_L5:;
26241
26242   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":360
26243  *         if python.PyList_GET_SIZE(self._entries) > self._max_len:
26244  *             del self._entries[0]
26245  *         self._entries.append(entry)             # <<<<<<<<<<<<<<
26246  * 
26247  * cdef class PyErrorLog(_BaseErrorLog):
26248  */
26249   __pyx_t_2 = PyList_Append(((PyObject *)((struct __pyx_obj_4lxml_5etree__RotatingErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base._entries), __pyx_v_entry); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26250
26251   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
26252   goto __pyx_L0;
26253   __pyx_L1_error:;
26254   __Pyx_AddTraceback("lxml.etree._RotatingErrorLog.receive");
26255   __pyx_r = NULL;
26256   __pyx_L0:;
26257   __Pyx_XGIVEREF(__pyx_r);
26258   __Pyx_FinishRefcountContext();
26259   return __pyx_r;
26260 }
26261
26262 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":384
26263  *     cdef object _map_level
26264  *     cdef object _log
26265  *     def __init__(self, logger_name=None):             # <<<<<<<<<<<<<<
26266  *         _BaseErrorLog.__init__(self, None, None)
26267  *         import logging
26268  */
26269
26270 static int __pyx_pf_4lxml_5etree_10PyErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
26271 static int __pyx_pf_4lxml_5etree_10PyErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
26272   PyObject *__pyx_v_logger_name = 0;
26273   PyObject *__pyx_v_logging;
26274   PyObject *__pyx_v_logger;
26275   int __pyx_r;
26276   PyObject *__pyx_1 = 0;
26277   PyObject *__pyx_2 = 0;
26278   PyObject *__pyx_t_1 = NULL;
26279   PyObject *__pyx_t_2 = NULL;
26280   PyObject *__pyx_t_3 = NULL;
26281   int __pyx_t_4;
26282   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_logger_name,0};
26283   __Pyx_SetupRefcountContext("__init__");
26284   if (unlikely(__pyx_kwds)) {
26285     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
26286     PyObject* values[1] = {0};
26287     values[0] = Py_None;
26288     switch (PyTuple_GET_SIZE(__pyx_args)) {
26289       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26290       case  0: break;
26291       default: goto __pyx_L5_argtuple_error;
26292     }
26293     switch (PyTuple_GET_SIZE(__pyx_args)) {
26294       case  0:
26295       if (kw_args > 1) {
26296         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_logger_name);
26297         if (unlikely(value)) { values[0] = value; kw_args--; }
26298       }
26299     }
26300     if (unlikely(kw_args > 0)) {
26301       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
26302     }
26303     __pyx_v_logger_name = values[0];
26304   } else {
26305     __pyx_v_logger_name = Py_None;
26306     switch (PyTuple_GET_SIZE(__pyx_args)) {
26307       case  1: __pyx_v_logger_name = PyTuple_GET_ITEM(__pyx_args, 0);
26308       case  0: break;
26309       default: goto __pyx_L5_argtuple_error;
26310     }
26311   }
26312   goto __pyx_L4_argument_unpacking_done;
26313   __pyx_L5_argtuple_error:;
26314   __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
26315   __pyx_L3_error:;
26316   __Pyx_AddTraceback("lxml.etree.PyErrorLog.__init__");
26317   return -1;
26318   __pyx_L4_argument_unpacking_done:;
26319   __pyx_v_logging = Py_None; __Pyx_INCREF(Py_None);
26320   __pyx_v_logger = Py_None; __Pyx_INCREF(Py_None);
26321
26322   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":385
26323  *     cdef object _log
26324  *     def __init__(self, logger_name=None):
26325  *         _BaseErrorLog.__init__(self, None, None)             # <<<<<<<<<<<<<<
26326  *         import logging
26327  *         self.level_map = {
26328  */
26329   __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__BaseErrorLog)), __pyx_kp___init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26330   __Pyx_GOTREF(__pyx_t_1);
26331   __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26332   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
26333   __Pyx_INCREF(__pyx_v_self);
26334   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
26335   __Pyx_GIVEREF(__pyx_v_self);
26336   __Pyx_INCREF(Py_None);
26337   PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
26338   __Pyx_GIVEREF(Py_None);
26339   __Pyx_INCREF(Py_None);
26340   PyTuple_SET_ITEM(__pyx_t_2, 2, Py_None);
26341   __Pyx_GIVEREF(Py_None);
26342   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26343   __Pyx_GOTREF(__pyx_t_3);
26344   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26345   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
26346   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26347
26348   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":386
26349  *     def __init__(self, logger_name=None):
26350  *         _BaseErrorLog.__init__(self, None, None)
26351  *         import logging             # <<<<<<<<<<<<<<
26352  *         self.level_map = {
26353  *             ErrorLevels.WARNING : logging.WARNING,
26354  */
26355   __pyx_1 = __Pyx_Import(__pyx_kp_logging, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26356   __Pyx_GOTREF(__pyx_1);
26357   __Pyx_DECREF(__pyx_v_logging);
26358   __pyx_v_logging = __pyx_1;
26359   __pyx_1 = 0;
26360
26361   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":387
26362  *         _BaseErrorLog.__init__(self, None, None)
26363  *         import logging
26364  *         self.level_map = {             # <<<<<<<<<<<<<<
26365  *             ErrorLevels.WARNING : logging.WARNING,
26366  *             ErrorLevels.ERROR   : logging.ERROR,
26367  */
26368   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26369   __Pyx_GOTREF(((PyObject *)__pyx_1));
26370
26371   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":388
26372  *         import logging
26373  *         self.level_map = {
26374  *             ErrorLevels.WARNING : logging.WARNING,             # <<<<<<<<<<<<<<
26375  *             ErrorLevels.ERROR   : logging.ERROR,
26376  *             ErrorLevels.FATAL   : logging.CRITICAL
26377  */
26378   __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_ErrorLevels); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26379   __Pyx_GOTREF(__pyx_2);
26380   __pyx_t_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_WARNING); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26381   __Pyx_GOTREF(__pyx_t_3);
26382   __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
26383   __pyx_t_2 = PyObject_GetAttr(__pyx_v_logging, __pyx_kp_WARNING); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26384   __Pyx_GOTREF(__pyx_t_2);
26385   if (PyDict_SetItem(__pyx_1, __pyx_t_3, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26386   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26387   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26388
26389   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":389
26390  *         self.level_map = {
26391  *             ErrorLevels.WARNING : logging.WARNING,
26392  *             ErrorLevels.ERROR   : logging.ERROR,             # <<<<<<<<<<<<<<
26393  *             ErrorLevels.FATAL   : logging.CRITICAL
26394  *             }
26395  */
26396   __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_ErrorLevels); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26397   __Pyx_GOTREF(__pyx_2);
26398   __pyx_t_2 = PyObject_GetAttr(__pyx_2, __pyx_kp_ERROR); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26399   __Pyx_GOTREF(__pyx_t_2);
26400   __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
26401   __pyx_t_3 = PyObject_GetAttr(__pyx_v_logging, __pyx_kp_ERROR); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26402   __Pyx_GOTREF(__pyx_t_3);
26403   if (PyDict_SetItem(__pyx_1, __pyx_t_2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26404   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26405   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26406
26407   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":390
26408  *             ErrorLevels.WARNING : logging.WARNING,
26409  *             ErrorLevels.ERROR   : logging.ERROR,
26410  *             ErrorLevels.FATAL   : logging.CRITICAL             # <<<<<<<<<<<<<<
26411  *             }
26412  *         self._map_level = self.level_map.get
26413  */
26414   __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_ErrorLevels); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26415   __Pyx_GOTREF(__pyx_2);
26416   __pyx_t_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_FATAL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26417   __Pyx_GOTREF(__pyx_t_3);
26418   __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
26419   __pyx_t_2 = PyObject_GetAttr(__pyx_v_logging, __pyx_kp_CRITICAL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26420   __Pyx_GOTREF(__pyx_t_2);
26421   if (PyDict_SetItem(__pyx_1, __pyx_t_3, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26422   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26423   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26424
26425   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":387
26426  *         _BaseErrorLog.__init__(self, None, None)
26427  *         import logging
26428  *         self.level_map = {             # <<<<<<<<<<<<<<
26429  *             ErrorLevels.WARNING : logging.WARNING,
26430  *             ErrorLevels.ERROR   : logging.ERROR,
26431  */
26432   __Pyx_GIVEREF(((PyObject *)__pyx_1));
26433   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_PyErrorLog *)__pyx_v_self)->level_map);
26434   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_PyErrorLog *)__pyx_v_self)->level_map);
26435   ((struct __pyx_obj_4lxml_5etree_PyErrorLog *)__pyx_v_self)->level_map = ((PyObject *)__pyx_1);
26436   __pyx_1 = 0;
26437
26438   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":392
26439  *             ErrorLevels.FATAL   : logging.CRITICAL
26440  *             }
26441  *         self._map_level = self.level_map.get             # <<<<<<<<<<<<<<
26442  *         if logger_name:
26443  *             logger = logging.getLogger(logger_name)
26444  */
26445   __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_4lxml_5etree_PyErrorLog *)__pyx_v_self)->level_map, __pyx_kp_get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26446   __Pyx_GOTREF(__pyx_t_2);
26447   __Pyx_GIVEREF(__pyx_t_2);
26448   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_PyErrorLog *)__pyx_v_self)->_map_level);
26449   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_PyErrorLog *)__pyx_v_self)->_map_level);
26450   ((struct __pyx_obj_4lxml_5etree_PyErrorLog *)__pyx_v_self)->_map_level = __pyx_t_2;
26451   __pyx_t_2 = 0;
26452
26453   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":393
26454  *             }
26455  *         self._map_level = self.level_map.get
26456  *         if logger_name:             # <<<<<<<<<<<<<<
26457  *             logger = logging.getLogger(logger_name)
26458  *         else:
26459  */
26460   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_logger_name); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26461   if (__pyx_t_4) {
26462
26463     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":394
26464  *         self._map_level = self.level_map.get
26465  *         if logger_name:
26466  *             logger = logging.getLogger(logger_name)             # <<<<<<<<<<<<<<
26467  *         else:
26468  *             logger = logging.getLogger()
26469  */
26470     __pyx_t_2 = PyObject_GetAttr(__pyx_v_logging, __pyx_kp_getLogger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26471     __Pyx_GOTREF(__pyx_t_2);
26472     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26473     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
26474     __Pyx_INCREF(__pyx_v_logger_name);
26475     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_logger_name);
26476     __Pyx_GIVEREF(__pyx_v_logger_name);
26477     __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26478     __Pyx_GOTREF(__pyx_t_1);
26479     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26480     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
26481     __Pyx_DECREF(__pyx_v_logger);
26482     __pyx_v_logger = __pyx_t_1;
26483     __pyx_t_1 = 0;
26484     goto __pyx_L6;
26485   }
26486   /*else*/ {
26487
26488     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":396
26489  *             logger = logging.getLogger(logger_name)
26490  *         else:
26491  *             logger = logging.getLogger()             # <<<<<<<<<<<<<<
26492  *         self._log = logger.log
26493  * 
26494  */
26495     __pyx_t_1 = PyObject_GetAttr(__pyx_v_logging, __pyx_kp_getLogger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26496     __Pyx_GOTREF(__pyx_t_1);
26497     __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26498     __Pyx_GOTREF(__pyx_t_3);
26499     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26500     __Pyx_DECREF(__pyx_v_logger);
26501     __pyx_v_logger = __pyx_t_3;
26502     __pyx_t_3 = 0;
26503   }
26504   __pyx_L6:;
26505
26506   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":397
26507  *         else:
26508  *             logger = logging.getLogger()
26509  *         self._log = logger.log             # <<<<<<<<<<<<<<
26510  * 
26511  *     def copy(self):
26512  */
26513   __pyx_t_3 = PyObject_GetAttr(__pyx_v_logger, __pyx_kp_log); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26514   __Pyx_GOTREF(__pyx_t_3);
26515   __Pyx_GIVEREF(__pyx_t_3);
26516   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_PyErrorLog *)__pyx_v_self)->_log);
26517   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_PyErrorLog *)__pyx_v_self)->_log);
26518   ((struct __pyx_obj_4lxml_5etree_PyErrorLog *)__pyx_v_self)->_log = __pyx_t_3;
26519   __pyx_t_3 = 0;
26520
26521   __pyx_r = 0;
26522   goto __pyx_L0;
26523   __pyx_L1_error:;
26524   __Pyx_XDECREF(__pyx_1);
26525   __Pyx_XDECREF(__pyx_2);
26526   __Pyx_XDECREF(__pyx_t_1);
26527   __Pyx_XDECREF(__pyx_t_2);
26528   __Pyx_XDECREF(__pyx_t_3);
26529   __Pyx_AddTraceback("lxml.etree.PyErrorLog.__init__");
26530   __pyx_r = -1;
26531   __pyx_L0:;
26532   __Pyx_DECREF(__pyx_v_logging);
26533   __Pyx_DECREF(__pyx_v_logger);
26534   __Pyx_FinishRefcountContext();
26535   return __pyx_r;
26536 }
26537
26538 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":399
26539  *         self._log = logger.log
26540  * 
26541  *     def copy(self):             # <<<<<<<<<<<<<<
26542  *         u"""Dummy method that returns an empty error log.
26543  *         """
26544  */
26545
26546 static PyObject *__pyx_pf_4lxml_5etree_10PyErrorLog_copy(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
26547 static char __pyx_doc_4lxml_5etree_10PyErrorLog_copy[] = "Dummy method that returns an empty error log.\n        ";
26548 static PyObject *__pyx_pf_4lxml_5etree_10PyErrorLog_copy(PyObject *__pyx_v_self, PyObject *unused) {
26549   PyObject *__pyx_r = NULL;
26550   PyObject *__pyx_t_1 = NULL;
26551   PyObject *__pyx_t_2 = NULL;
26552   __Pyx_SetupRefcountContext("copy");
26553
26554   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":402
26555  *         u"""Dummy method that returns an empty error log.
26556  *         """
26557  *         return _ListErrorLog([], None, None)             # <<<<<<<<<<<<<<
26558  * 
26559  *     def log(self, log_entry, message, *args):
26560  */
26561   __Pyx_XDECREF(__pyx_r);
26562   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26563   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
26564   __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26565   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
26566   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
26567   __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
26568   __Pyx_INCREF(Py_None);
26569   PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
26570   __Pyx_GIVEREF(Py_None);
26571   __Pyx_INCREF(Py_None);
26572   PyTuple_SET_ITEM(__pyx_t_2, 2, Py_None);
26573   __Pyx_GIVEREF(Py_None);
26574   __pyx_t_1 = 0;
26575   __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ListErrorLog)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26576   __Pyx_GOTREF(__pyx_t_1);
26577   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
26578   __pyx_r = __pyx_t_1;
26579   __pyx_t_1 = 0;
26580   goto __pyx_L0;
26581
26582   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
26583   goto __pyx_L0;
26584   __pyx_L1_error:;
26585   __Pyx_XDECREF(__pyx_t_1);
26586   __Pyx_XDECREF(__pyx_t_2);
26587   __Pyx_AddTraceback("lxml.etree.PyErrorLog.copy");
26588   __pyx_r = NULL;
26589   __pyx_L0:;
26590   __Pyx_XGIVEREF(__pyx_r);
26591   __Pyx_FinishRefcountContext();
26592   return __pyx_r;
26593 }
26594
26595 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":404
26596  *         return _ListErrorLog([], None, None)
26597  * 
26598  *     def log(self, log_entry, message, *args):             # <<<<<<<<<<<<<<
26599  *         u"""log(self, log_entry, message, *args)
26600  * 
26601  */
26602
26603 static PyObject *__pyx_pf_4lxml_5etree_10PyErrorLog_log(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
26604 static char __pyx_doc_4lxml_5etree_10PyErrorLog_log[] = "log(self, log_entry, message, *args)\n\n        Called by the .receive() method to log a _LogEntry instance to\n        the Python logging system.  This handles the error level\n        mapping.\n\n        In the default implementation, the ``message`` argument\n        receives a complete log line, and there are no further\n        ``args``.  To change the message format, it is best to\n        override the .receive() method instead of this one.\n        ";
26605 static PyObject *__pyx_pf_4lxml_5etree_10PyErrorLog_log(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
26606   PyObject *__pyx_v_log_entry = 0;
26607   PyObject *__pyx_v_message = 0;
26608   PyObject *__pyx_v_args = 0;
26609   PyObject *__pyx_r = NULL;
26610   PyObject *__pyx_1 = 0;
26611   PyObject *__pyx_t_1 = NULL;
26612   PyObject *__pyx_t_2 = NULL;
26613   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_log_entry,&__pyx_kp_message,0};
26614   __Pyx_SetupRefcountContext("log");
26615   if (PyTuple_GET_SIZE(__pyx_args) > 2) {
26616     __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args)); __Pyx_GOTREF(__pyx_v_args);
26617     if (unlikely(!__pyx_v_args)) return NULL;
26618   } else {
26619     __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
26620   }
26621   if (unlikely(__pyx_kwds)) {
26622     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
26623     PyObject* values[2] = {0,0};
26624     switch (PyTuple_GET_SIZE(__pyx_args)) {
26625       default:
26626       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
26627       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26628       case  0: break;
26629     }
26630     switch (PyTuple_GET_SIZE(__pyx_args)) {
26631       case  0:
26632       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_log_entry);
26633       if (likely(values[0])) kw_args--;
26634       else goto __pyx_L5_argtuple_error;
26635       case  1:
26636       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_message);
26637       if (likely(values[1])) kw_args--;
26638       else {
26639         __Pyx_RaiseArgtupleInvalid("log", 0, 2, 2, 1); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
26640       }
26641     }
26642     if (unlikely(kw_args > 0)) {
26643       const Py_ssize_t used_pos_args = (PyTuple_GET_SIZE(__pyx_args) < 2) ? PyTuple_GET_SIZE(__pyx_args) : 2;
26644       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "log") < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
26645     }
26646     __pyx_v_log_entry = values[0];
26647     __pyx_v_message = values[1];
26648   } else if (PyTuple_GET_SIZE(__pyx_args) < 2) {
26649     goto __pyx_L5_argtuple_error;
26650   } else {
26651     __pyx_v_log_entry = PyTuple_GET_ITEM(__pyx_args, 0);
26652     __pyx_v_message = PyTuple_GET_ITEM(__pyx_args, 1);
26653   }
26654   goto __pyx_L4_argument_unpacking_done;
26655   __pyx_L5_argtuple_error:;
26656   __Pyx_RaiseArgtupleInvalid("log", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[7]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
26657   __pyx_L3_error:;
26658   __Pyx_DECREF(__pyx_v_args);
26659   __Pyx_AddTraceback("lxml.etree.PyErrorLog.log");
26660   return NULL;
26661   __pyx_L4_argument_unpacking_done:;
26662
26663   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":417
26664  *         """
26665  *         self._log(
26666  *             self._map_level(log_entry.level, 0),             # <<<<<<<<<<<<<<
26667  *             message, *args
26668  *             )
26669  */
26670   __pyx_t_1 = PyObject_GetAttr(__pyx_v_log_entry, __pyx_kp_level); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26671   __Pyx_GOTREF(__pyx_t_1);
26672   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26673   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
26674   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
26675   __Pyx_GIVEREF(__pyx_t_1);
26676   __Pyx_INCREF(__pyx_int_0);
26677   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0);
26678   __Pyx_GIVEREF(__pyx_int_0);
26679   __pyx_t_1 = 0;
26680   __pyx_t_1 = PyObject_Call(((struct __pyx_obj_4lxml_5etree_PyErrorLog *)__pyx_v_self)->_map_level, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26681   __Pyx_GOTREF(__pyx_t_1);
26682   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
26683
26684   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":418
26685  *         self._log(
26686  *             self._map_level(log_entry.level, 0),
26687  *             message, *args             # <<<<<<<<<<<<<<
26688  *             )
26689  * 
26690  */
26691   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26692   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
26693   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
26694   __Pyx_GIVEREF(__pyx_t_1);
26695   __Pyx_INCREF(__pyx_v_message);
26696   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_message);
26697   __Pyx_GIVEREF(__pyx_v_message);
26698   __pyx_t_1 = 0;
26699
26700   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":419
26701  *             self._map_level(log_entry.level, 0),
26702  *             message, *args
26703  *             )             # <<<<<<<<<<<<<<
26704  * 
26705  *     def receive(self, _LogEntry log_entry):
26706  */
26707   __pyx_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26708   __Pyx_GOTREF(((PyObject *)__pyx_1));
26709   __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26710   __Pyx_GOTREF(__pyx_t_1);
26711   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
26712   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
26713   __pyx_t_2 = PyObject_Call(((struct __pyx_obj_4lxml_5etree_PyErrorLog *)__pyx_v_self)->_log, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26714   __Pyx_GOTREF(__pyx_t_2);
26715   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26716   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26717
26718   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
26719   goto __pyx_L0;
26720   __pyx_L1_error:;
26721   __Pyx_XDECREF(__pyx_1);
26722   __Pyx_XDECREF(__pyx_t_1);
26723   __Pyx_XDECREF(__pyx_t_2);
26724   __Pyx_AddTraceback("lxml.etree.PyErrorLog.log");
26725   __pyx_r = NULL;
26726   __pyx_L0:;
26727   __Pyx_DECREF(__pyx_v_args);
26728   __Pyx_XGIVEREF(__pyx_r);
26729   __Pyx_FinishRefcountContext();
26730   return __pyx_r;
26731 }
26732
26733 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":421
26734  *             )
26735  * 
26736  *     def receive(self, _LogEntry log_entry):             # <<<<<<<<<<<<<<
26737  *         u"""receive(self, log_entry)
26738  * 
26739  */
26740
26741 static PyObject *__pyx_pf_4lxml_5etree_10PyErrorLog_receive(PyObject *__pyx_v_self, PyObject *__pyx_v_log_entry); /*proto*/
26742 static char __pyx_doc_4lxml_5etree_10PyErrorLog_receive[] = "receive(self, log_entry)\n\n        Receive a _LogEntry instance from the logging system.  Calls\n        the .log() method with appropriate parameters::\n\n            self.log(log_entry, repr(log_entry))\n\n        You can override this method to provide your own log output\n        format.\n        ";
26743 static PyObject *__pyx_pf_4lxml_5etree_10PyErrorLog_receive(PyObject *__pyx_v_self, PyObject *__pyx_v_log_entry) {
26744   PyObject *__pyx_r = NULL;
26745   PyObject *__pyx_t_1 = NULL;
26746   PyObject *__pyx_t_2 = NULL;
26747   PyObject *__pyx_t_3 = NULL;
26748   __Pyx_SetupRefcountContext("receive");
26749   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_log_entry), __pyx_ptype_4lxml_5etree__LogEntry, 1, "log_entry", 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26750
26751   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":432
26752  *         format.
26753  *         """
26754  *         self.log(log_entry, repr(log_entry))             # <<<<<<<<<<<<<<
26755  * 
26756  * # thread-local, global list log to collect error output messages from
26757  */
26758   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_log); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26759   __Pyx_GOTREF(__pyx_t_1);
26760   __pyx_t_2 = PyObject_Repr(__pyx_v_log_entry); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26761   __Pyx_GOTREF(__pyx_t_2);
26762   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26763   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
26764   __Pyx_INCREF(__pyx_v_log_entry);
26765   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_log_entry);
26766   __Pyx_GIVEREF(__pyx_v_log_entry);
26767   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
26768   __Pyx_GIVEREF(__pyx_t_2);
26769   __pyx_t_2 = 0;
26770   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
26771   __Pyx_GOTREF(__pyx_t_2);
26772   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
26773   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
26774   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26775
26776   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
26777   goto __pyx_L0;
26778   __pyx_L1_error:;
26779   __Pyx_XDECREF(__pyx_t_1);
26780   __Pyx_XDECREF(__pyx_t_2);
26781   __Pyx_XDECREF(__pyx_t_3);
26782   __Pyx_AddTraceback("lxml.etree.PyErrorLog.receive");
26783   __pyx_r = NULL;
26784   __pyx_L0:;
26785   __Pyx_XGIVEREF(__pyx_r);
26786   __Pyx_FinishRefcountContext();
26787   return __pyx_r;
26788 }
26789
26790 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":440
26791  * __GLOBAL_ERROR_LOG = _RotatingErrorLog(__MAX_LOG_SIZE)
26792  * 
26793  * cdef _BaseErrorLog _getGlobalErrorLog():             # <<<<<<<<<<<<<<
26794  *     u"""Retrieve the global error log of this thread."""
26795  *     cdef python.PyObject* thread_dict
26796  */
26797
26798 static  struct __pyx_obj_4lxml_5etree__BaseErrorLog *__pyx_f_4lxml_5etree__getGlobalErrorLog(void) {
26799   PyObject *__pyx_v_thread_dict;
26800   PyObject *__pyx_v_log;
26801   struct __pyx_obj_4lxml_5etree__BaseErrorLog *__pyx_r = NULL;
26802   PyObject *__pyx_1 = 0;
26803   int __pyx_2;
26804   int __pyx_t_1;
26805   PyObject *__pyx_t_2 = NULL;
26806   PyObject *__pyx_t_3 = NULL;
26807   PyObject *__pyx_t_4 = NULL;
26808   PyObject *__pyx_t_5 = NULL;
26809   PyObject *__pyx_t_6 = NULL;
26810   __Pyx_SetupRefcountContext("_getGlobalErrorLog");
26811   __pyx_v_log = Py_None; __Pyx_INCREF(Py_None);
26812
26813   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":443
26814  *     u"""Retrieve the global error log of this thread."""
26815  *     cdef python.PyObject* thread_dict
26816  *     thread_dict = python.PyThreadState_GetDict()             # <<<<<<<<<<<<<<
26817  *     if thread_dict is NULL:
26818  *         return __GLOBAL_ERROR_LOG
26819  */
26820   __pyx_v_thread_dict = PyThreadState_GetDict();
26821
26822   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":444
26823  *     cdef python.PyObject* thread_dict
26824  *     thread_dict = python.PyThreadState_GetDict()
26825  *     if thread_dict is NULL:             # <<<<<<<<<<<<<<
26826  *         return __GLOBAL_ERROR_LOG
26827  *     try:
26828  */
26829   __pyx_t_1 = (__pyx_v_thread_dict == NULL);
26830   if (__pyx_t_1) {
26831
26832     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":445
26833  *     thread_dict = python.PyThreadState_GetDict()
26834  *     if thread_dict is NULL:
26835  *         return __GLOBAL_ERROR_LOG             # <<<<<<<<<<<<<<
26836  *     try:
26837  *         return (<object>thread_dict)[u"_GlobalErrorLog"]
26838  */
26839     __Pyx_XDECREF(((PyObject *)__pyx_r));
26840     __Pyx_INCREF(((PyObject *)__pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG));
26841     __pyx_r = __pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG;
26842     goto __pyx_L0;
26843     goto __pyx_L3;
26844   }
26845   __pyx_L3:;
26846
26847   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":446
26848  *     if thread_dict is NULL:
26849  *         return __GLOBAL_ERROR_LOG
26850  *     try:             # <<<<<<<<<<<<<<
26851  *         return (<object>thread_dict)[u"_GlobalErrorLog"]
26852  *     except KeyError:
26853  */
26854   {
26855     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
26856     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
26857     __Pyx_XGOTREF(__pyx_save_exc_type);
26858     __Pyx_XGOTREF(__pyx_save_exc_value);
26859     __Pyx_XGOTREF(__pyx_save_exc_tb);
26860     /*try:*/ {
26861
26862       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":447
26863  *         return __GLOBAL_ERROR_LOG
26864  *     try:
26865  *         return (<object>thread_dict)[u"_GlobalErrorLog"]             # <<<<<<<<<<<<<<
26866  *     except KeyError:
26867  *         log = (<object>thread_dict)[u"_GlobalErrorLog"] = \
26868  */
26869       __Pyx_XDECREF(((PyObject *)__pyx_r));
26870       __pyx_1 = PyObject_GetItem(((PyObject *)__pyx_v_thread_dict), ((PyObject *)__pyx_kp_292)); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
26871       __Pyx_GOTREF(__pyx_1);
26872       if (!(__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__BaseErrorLog))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
26873       __pyx_r = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_1);
26874       __pyx_1 = 0;
26875       goto __pyx_L8_try_return;
26876     }
26877     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
26878     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
26879     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
26880     goto __pyx_L11_try_end;
26881     __pyx_L8_try_return:;
26882     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
26883     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
26884     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
26885     goto __pyx_L0;
26886     __pyx_L4_error:;
26887     __Pyx_XDECREF(__pyx_1); __pyx_1 = 0;
26888
26889     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":448
26890  *     try:
26891  *         return (<object>thread_dict)[u"_GlobalErrorLog"]
26892  *     except KeyError:             # <<<<<<<<<<<<<<
26893  *         log = (<object>thread_dict)[u"_GlobalErrorLog"] = \
26894  *               _RotatingErrorLog(__MAX_LOG_SIZE)
26895  */
26896     __pyx_2 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
26897     if (__pyx_2) {
26898       __Pyx_AddTraceback("lxml.etree._getGlobalErrorLog");
26899       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
26900       __Pyx_GOTREF(__pyx_t_2);
26901       __Pyx_GOTREF(__pyx_t_3);
26902       __Pyx_GOTREF(__pyx_t_4);
26903
26904       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":450
26905  *     except KeyError:
26906  *         log = (<object>thread_dict)[u"_GlobalErrorLog"] = \
26907  *               _RotatingErrorLog(__MAX_LOG_SIZE)             # <<<<<<<<<<<<<<
26908  *         return log
26909  * 
26910  */
26911       __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
26912       __Pyx_GOTREF(((PyObject *)__pyx_t_5));
26913       __Pyx_INCREF(__pyx_int_100);
26914       PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_100);
26915       __Pyx_GIVEREF(__pyx_int_100);
26916       __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__RotatingErrorLog)), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
26917       __Pyx_GOTREF(__pyx_t_6);
26918       __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
26919       __Pyx_INCREF(__pyx_t_6);
26920       __Pyx_DECREF(__pyx_v_log);
26921       __pyx_v_log = __pyx_t_6;
26922
26923       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":449
26924  *         return (<object>thread_dict)[u"_GlobalErrorLog"]
26925  *     except KeyError:
26926  *         log = (<object>thread_dict)[u"_GlobalErrorLog"] = \             # <<<<<<<<<<<<<<
26927  *               _RotatingErrorLog(__MAX_LOG_SIZE)
26928  *         return log
26929  */
26930       if (PyObject_SetItem(((PyObject *)__pyx_v_thread_dict), ((PyObject *)__pyx_kp_293), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
26931       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26932
26933       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":451
26934  *         log = (<object>thread_dict)[u"_GlobalErrorLog"] = \
26935  *               _RotatingErrorLog(__MAX_LOG_SIZE)
26936  *         return log             # <<<<<<<<<<<<<<
26937  * 
26938  * cdef _setGlobalErrorLog(_BaseErrorLog log):
26939  */
26940       __Pyx_XDECREF(((PyObject *)__pyx_r));
26941       if (!(__Pyx_TypeTest(__pyx_v_log, __pyx_ptype_4lxml_5etree__BaseErrorLog))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
26942       __Pyx_INCREF(__pyx_v_log);
26943       __pyx_r = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_log);
26944       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26945       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26946       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26947       goto __pyx_L7_except_return;
26948       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26949       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26950       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26951       goto __pyx_L5_exception_handled;
26952     }
26953     __pyx_L6_except_error:;
26954     __Pyx_XDECREF(__pyx_save_exc_type);
26955     __Pyx_XDECREF(__pyx_save_exc_value);
26956     __Pyx_XDECREF(__pyx_save_exc_tb);
26957     goto __pyx_L1_error;
26958     __pyx_L7_except_return:;
26959     __Pyx_XGIVEREF(__pyx_save_exc_type);
26960     __Pyx_XGIVEREF(__pyx_save_exc_value);
26961     __Pyx_XGIVEREF(__pyx_save_exc_tb);
26962     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
26963     goto __pyx_L0;
26964     __pyx_L5_exception_handled:;
26965     __Pyx_XGIVEREF(__pyx_save_exc_type);
26966     __Pyx_XGIVEREF(__pyx_save_exc_value);
26967     __Pyx_XGIVEREF(__pyx_save_exc_tb);
26968     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
26969     __pyx_L11_try_end:;
26970   }
26971
26972   __pyx_r = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)Py_None); __Pyx_INCREF(Py_None);
26973   goto __pyx_L0;
26974   __pyx_L1_error:;
26975   __Pyx_XDECREF(__pyx_1);
26976   __Pyx_XDECREF(__pyx_t_2);
26977   __Pyx_XDECREF(__pyx_t_3);
26978   __Pyx_XDECREF(__pyx_t_4);
26979   __Pyx_XDECREF(__pyx_t_5);
26980   __Pyx_XDECREF(__pyx_t_6);
26981   __Pyx_AddTraceback("lxml.etree._getGlobalErrorLog");
26982   __pyx_r = 0;
26983   __pyx_L0:;
26984   __Pyx_DECREF(__pyx_v_log);
26985   __Pyx_XGIVEREF((PyObject *)__pyx_r);
26986   __Pyx_FinishRefcountContext();
26987   return __pyx_r;
26988 }
26989
26990 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":453
26991  *         return log
26992  * 
26993  * cdef _setGlobalErrorLog(_BaseErrorLog log):             # <<<<<<<<<<<<<<
26994  *     u"""Set the global error log of this thread."""
26995  *     cdef python.PyObject* thread_dict
26996  */
26997
26998 static  PyObject *__pyx_f_4lxml_5etree__setGlobalErrorLog(struct __pyx_obj_4lxml_5etree__BaseErrorLog *__pyx_v_log) {
26999   PyObject *__pyx_v_thread_dict;
27000   PyObject *__pyx_r = NULL;
27001   int __pyx_t_1;
27002   __Pyx_SetupRefcountContext("_setGlobalErrorLog");
27003
27004   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":456
27005  *     u"""Set the global error log of this thread."""
27006  *     cdef python.PyObject* thread_dict
27007  *     thread_dict = python.PyThreadState_GetDict()             # <<<<<<<<<<<<<<
27008  *     if thread_dict is NULL:
27009  *         global __GLOBAL_ERROR_LOG
27010  */
27011   __pyx_v_thread_dict = PyThreadState_GetDict();
27012
27013   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":457
27014  *     cdef python.PyObject* thread_dict
27015  *     thread_dict = python.PyThreadState_GetDict()
27016  *     if thread_dict is NULL:             # <<<<<<<<<<<<<<
27017  *         global __GLOBAL_ERROR_LOG
27018  *         __GLOBAL_ERROR_LOG = log
27019  */
27020   __pyx_t_1 = (__pyx_v_thread_dict == NULL);
27021   if (__pyx_t_1) {
27022
27023     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":459
27024  *     if thread_dict is NULL:
27025  *         global __GLOBAL_ERROR_LOG
27026  *         __GLOBAL_ERROR_LOG = log             # <<<<<<<<<<<<<<
27027  *     else:
27028  *         (<object>thread_dict)[u"_GlobalErrorLog"] = log
27029  */
27030     __Pyx_INCREF(((PyObject *)__pyx_v_log));
27031     __Pyx_GOTREF(((PyObject *)__pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG));
27032     __Pyx_DECREF(((PyObject *)__pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG));
27033     __Pyx_GIVEREF(((PyObject *)__pyx_v_log));
27034     __pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG = __pyx_v_log;
27035     goto __pyx_L3;
27036   }
27037   /*else*/ {
27038
27039     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":461
27040  *         __GLOBAL_ERROR_LOG = log
27041  *     else:
27042  *         (<object>thread_dict)[u"_GlobalErrorLog"] = log             # <<<<<<<<<<<<<<
27043  * 
27044  * cdef __copyGlobalErrorLog():
27045  */
27046     if (PyObject_SetItem(((PyObject *)__pyx_v_thread_dict), ((PyObject *)__pyx_kp_294), ((PyObject *)__pyx_v_log)) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27047   }
27048   __pyx_L3:;
27049
27050   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
27051   goto __pyx_L0;
27052   __pyx_L1_error:;
27053   __Pyx_AddTraceback("lxml.etree._setGlobalErrorLog");
27054   __pyx_r = 0;
27055   __pyx_L0:;
27056   __Pyx_XGIVEREF(__pyx_r);
27057   __Pyx_FinishRefcountContext();
27058   return __pyx_r;
27059 }
27060
27061 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":463
27062  *         (<object>thread_dict)[u"_GlobalErrorLog"] = log
27063  * 
27064  * cdef __copyGlobalErrorLog():             # <<<<<<<<<<<<<<
27065  *     u"Helper function for properties in exceptions."
27066  *     return _getGlobalErrorLog().copy()
27067  */
27068
27069 static  PyObject *__pyx_f_4lxml_5etree___copyGlobalErrorLog(void) {
27070   PyObject *__pyx_r = NULL;
27071   PyObject *__pyx_t_1 = NULL;
27072   PyObject *__pyx_t_2 = NULL;
27073   __Pyx_SetupRefcountContext("__copyGlobalErrorLog");
27074
27075   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":465
27076  * cdef __copyGlobalErrorLog():
27077  *     u"Helper function for properties in exceptions."
27078  *     return _getGlobalErrorLog().copy()             # <<<<<<<<<<<<<<
27079  * 
27080  * def use_global_python_log(PyErrorLog log not None):
27081  */
27082   __Pyx_XDECREF(__pyx_r);
27083   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__getGlobalErrorLog()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27084   __Pyx_GOTREF(__pyx_t_1);
27085   __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_kp_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27086   __Pyx_GOTREF(__pyx_t_2);
27087   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27088   __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27089   __Pyx_GOTREF(__pyx_t_1);
27090   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27091   __pyx_r = __pyx_t_1;
27092   __pyx_t_1 = 0;
27093   goto __pyx_L0;
27094
27095   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
27096   goto __pyx_L0;
27097   __pyx_L1_error:;
27098   __Pyx_XDECREF(__pyx_t_1);
27099   __Pyx_XDECREF(__pyx_t_2);
27100   __Pyx_AddTraceback("lxml.etree.__copyGlobalErrorLog");
27101   __pyx_r = 0;
27102   __pyx_L0:;
27103   __Pyx_XGIVEREF(__pyx_r);
27104   __Pyx_FinishRefcountContext();
27105   return __pyx_r;
27106 }
27107
27108 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":467
27109  *     return _getGlobalErrorLog().copy()
27110  * 
27111  * def use_global_python_log(PyErrorLog log not None):             # <<<<<<<<<<<<<<
27112  *     u"""use_global_python_log(log)
27113  * 
27114  */
27115
27116 static PyObject *__pyx_pf_4lxml_5etree_use_global_python_log(PyObject *__pyx_self, PyObject *__pyx_v_log); /*proto*/
27117 static char __pyx_doc_4lxml_5etree_use_global_python_log[] = "use_global_python_log(log)\n\n    Replace the global error log by an etree.PyErrorLog that uses the\n    standard Python logging package.\n\n    Note that this disables access to the global error log from exceptions.\n    Parsers, XSLT etc. will continue to provide their normal local error log.\n\n    Note: prior to lxml 2.2, this changed the error log globally.\n    Since lxml 2.2, the global error log is local to a thread and this\n    function will only set the global error log of the current thread.\n    ";
27118 static PyObject *__pyx_pf_4lxml_5etree_use_global_python_log(PyObject *__pyx_self, PyObject *__pyx_v_log) {
27119   PyObject *__pyx_r = NULL;
27120   PyObject *__pyx_t_1 = NULL;
27121   __Pyx_SetupRefcountContext("use_global_python_log");
27122   __pyx_self = __pyx_self;
27123   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_log), __pyx_ptype_4lxml_5etree_PyErrorLog, 0, "log", 0))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27124
27125   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":480
27126  *     function will only set the global error log of the current thread.
27127  *     """
27128  *     _setGlobalErrorLog(log)             # <<<<<<<<<<<<<<
27129  * 
27130  * 
27131  */
27132   __pyx_t_1 = __pyx_f_4lxml_5etree__setGlobalErrorLog(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_log)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27133   __Pyx_GOTREF(__pyx_t_1);
27134   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27135
27136   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
27137   goto __pyx_L0;
27138   __pyx_L1_error:;
27139   __Pyx_XDECREF(__pyx_t_1);
27140   __Pyx_AddTraceback("lxml.etree.use_global_python_log");
27141   __pyx_r = NULL;
27142   __pyx_L0:;
27143   __Pyx_XGIVEREF(__pyx_r);
27144   __Pyx_FinishRefcountContext();
27145   return __pyx_r;
27146 }
27147
27148 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":484
27149  * 
27150  * # local log functions: forward error to logger object
27151  * cdef void _forwardError(void* c_log_handler, xmlerror.xmlError* error) with gil:             # <<<<<<<<<<<<<<
27152  *     cdef _BaseErrorLog log_handler
27153  *     if c_log_handler is not NULL:
27154  */
27155
27156 static  void __pyx_f_4lxml_5etree__forwardError(void *__pyx_v_c_log_handler, xmlError *__pyx_v_error) {
27157   struct __pyx_obj_4lxml_5etree__BaseErrorLog *__pyx_v_log_handler;
27158   int __pyx_t_1;
27159   PyObject *__pyx_t_2 = NULL;
27160   PyGILState_STATE _save = PyGILState_Ensure();
27161   __Pyx_SetupRefcountContext("_forwardError");
27162   __pyx_v_log_handler = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)Py_None); __Pyx_INCREF(Py_None);
27163
27164   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":486
27165  * cdef void _forwardError(void* c_log_handler, xmlerror.xmlError* error) with gil:
27166  *     cdef _BaseErrorLog log_handler
27167  *     if c_log_handler is not NULL:             # <<<<<<<<<<<<<<
27168  *         log_handler = <_BaseErrorLog>c_log_handler
27169  *     else:
27170  */
27171   __pyx_t_1 = (__pyx_v_c_log_handler != NULL);
27172   if (__pyx_t_1) {
27173
27174     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":487
27175  *     cdef _BaseErrorLog log_handler
27176  *     if c_log_handler is not NULL:
27177  *         log_handler = <_BaseErrorLog>c_log_handler             # <<<<<<<<<<<<<<
27178  *     else:
27179  *         log_handler = _getGlobalErrorLog()
27180  */
27181     __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_c_log_handler)));
27182     __Pyx_DECREF(((PyObject *)__pyx_v_log_handler));
27183     __pyx_v_log_handler = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_c_log_handler);
27184     goto __pyx_L3;
27185   }
27186   /*else*/ {
27187
27188     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":489
27189  *         log_handler = <_BaseErrorLog>c_log_handler
27190  *     else:
27191  *         log_handler = _getGlobalErrorLog()             # <<<<<<<<<<<<<<
27192  *     log_handler._receive(error)
27193  * 
27194  */
27195     __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__getGlobalErrorLog()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27196     __Pyx_GOTREF(__pyx_t_2);
27197     __Pyx_DECREF(((PyObject *)__pyx_v_log_handler));
27198     __pyx_v_log_handler = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_t_2);
27199     __pyx_t_2 = 0;
27200   }
27201   __pyx_L3:;
27202
27203   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":490
27204  *     else:
27205  *         log_handler = _getGlobalErrorLog()
27206  *     log_handler._receive(error)             # <<<<<<<<<<<<<<
27207  * 
27208  * cdef void _receiveError(void* c_log_handler, xmlerror.xmlError* error) nogil:
27209  */
27210   ((struct __pyx_vtabstruct_4lxml_5etree__BaseErrorLog *)__pyx_v_log_handler->__pyx_vtab)->_receive(__pyx_v_log_handler, __pyx_v_error);
27211
27212   goto __pyx_L0;
27213   __pyx_L1_error:;
27214   __Pyx_XDECREF(__pyx_t_2);
27215   __Pyx_WriteUnraisable("lxml.etree._forwardError");
27216   __pyx_L0:;
27217   __Pyx_DECREF((PyObject *)__pyx_v_log_handler);
27218   __Pyx_FinishRefcountContext();
27219   PyGILState_Release(_save);
27220 }
27221
27222 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":492
27223  *     log_handler._receive(error)
27224  * 
27225  * cdef void _receiveError(void* c_log_handler, xmlerror.xmlError* error) nogil:             # <<<<<<<<<<<<<<
27226  *     # no Python objects here, may be called without thread context !
27227  *     # when we declare a Python object, Pyrex will INCREF(None) !
27228  */
27229
27230 static  void __pyx_f_4lxml_5etree__receiveError(void *__pyx_v_c_log_handler, xmlError *__pyx_v_error) {
27231   int __pyx_t_1;
27232
27233   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":495
27234  *     # no Python objects here, may be called without thread context !
27235  *     # when we declare a Python object, Pyrex will INCREF(None) !
27236  *     if __DEBUG != 0:             # <<<<<<<<<<<<<<
27237  *         _forwardError(c_log_handler, error)
27238  * 
27239  */
27240   __pyx_t_1 = (1 != 0);
27241   if (__pyx_t_1) {
27242
27243     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":496
27244  *     # when we declare a Python object, Pyrex will INCREF(None) !
27245  *     if __DEBUG != 0:
27246  *         _forwardError(c_log_handler, error)             # <<<<<<<<<<<<<<
27247  * 
27248  * cdef void _receiveXSLTError(void* c_log_handler, char* msg, ...) nogil:
27249  */
27250     __pyx_f_4lxml_5etree__forwardError(__pyx_v_c_log_handler, __pyx_v_error);
27251     goto __pyx_L3;
27252   }
27253   __pyx_L3:;
27254
27255 }
27256
27257 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":498
27258  *         _forwardError(c_log_handler, error)
27259  * 
27260  * cdef void _receiveXSLTError(void* c_log_handler, char* msg, ...) nogil:             # <<<<<<<<<<<<<<
27261  *     # no Python objects here, may be called without thread context !
27262  *     # when we declare a Python object, Pyrex will INCREF(None) !
27263  */
27264
27265 static  void __pyx_f_4lxml_5etree__receiveXSLTError(void *__pyx_v_c_log_handler, char *__pyx_v_msg, ...) {
27266   xmlError __pyx_v_c_error;
27267   va_list __pyx_v_args;
27268   char *__pyx_v_c_text;
27269   char *__pyx_v_c_message;
27270   char *__pyx_v_c_element;
27271   int __pyx_v_text_size;
27272   int __pyx_v_element_size;
27273   int __pyx_t_1;
27274
27275   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":507
27276  *     cdef char* c_element
27277  *     cdef int i, text_size, element_size
27278  *     if __DEBUG == 0 or msg is NULL:             # <<<<<<<<<<<<<<
27279  *         return
27280  *     if msg[0] == c'\n' or msg[0] == c'\0':
27281  */
27282   if (!(1 == 0)) {
27283     __pyx_t_1 = (__pyx_v_msg == NULL);
27284   } else {
27285     __pyx_t_1 = (1 == 0);
27286   }
27287   if (__pyx_t_1) {
27288
27289     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":508
27290  *     cdef int i, text_size, element_size
27291  *     if __DEBUG == 0 or msg is NULL:
27292  *         return             # <<<<<<<<<<<<<<
27293  *     if msg[0] == c'\n' or msg[0] == c'\0':
27294  *         return
27295  */
27296     goto __pyx_L0;
27297     goto __pyx_L3;
27298   }
27299   __pyx_L3:;
27300
27301   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":509
27302  *     if __DEBUG == 0 or msg is NULL:
27303  *         return
27304  *     if msg[0] == c'\n' or msg[0] == c'\0':             # <<<<<<<<<<<<<<
27305  *         return
27306  * 
27307  */
27308   if (!((__pyx_v_msg[0]) == '\n')) {
27309     __pyx_t_1 = ((__pyx_v_msg[0]) == '\x00');
27310   } else {
27311     __pyx_t_1 = ((__pyx_v_msg[0]) == '\n');
27312   }
27313   if (__pyx_t_1) {
27314
27315     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":510
27316  *         return
27317  *     if msg[0] == c'\n' or msg[0] == c'\0':
27318  *         return             # <<<<<<<<<<<<<<
27319  * 
27320  *     cstd.va_start(args, msg)
27321  */
27322     goto __pyx_L0;
27323     goto __pyx_L4;
27324   }
27325   __pyx_L4:;
27326
27327   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":512
27328  *         return
27329  * 
27330  *     cstd.va_start(args, msg)             # <<<<<<<<<<<<<<
27331  *     if msg[0] == c'%' and msg[1] == c's':
27332  *         c_text = cstd.va_charptr(args)
27333  */
27334   va_start(__pyx_v_args, __pyx_v_msg);
27335
27336   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":513
27337  * 
27338  *     cstd.va_start(args, msg)
27339  *     if msg[0] == c'%' and msg[1] == c's':             # <<<<<<<<<<<<<<
27340  *         c_text = cstd.va_charptr(args)
27341  *     else:
27342  */
27343   if (((__pyx_v_msg[0]) == '%')) {
27344     __pyx_t_1 = ((__pyx_v_msg[1]) == 's');
27345   } else {
27346     __pyx_t_1 = ((__pyx_v_msg[0]) == '%');
27347   }
27348   if (__pyx_t_1) {
27349
27350     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":514
27351  *     cstd.va_start(args, msg)
27352  *     if msg[0] == c'%' and msg[1] == c's':
27353  *         c_text = cstd.va_charptr(args)             # <<<<<<<<<<<<<<
27354  *     else:
27355  *         c_text = NULL
27356  */
27357     __pyx_v_c_text = va_charptr(__pyx_v_args);
27358     goto __pyx_L5;
27359   }
27360   /*else*/ {
27361
27362     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":516
27363  *         c_text = cstd.va_charptr(args)
27364  *     else:
27365  *         c_text = NULL             # <<<<<<<<<<<<<<
27366  *     if cstd.strstr(msg, 'file %s'):
27367  *         c_error.file = cstd.va_charptr(args)
27368  */
27369     __pyx_v_c_text = NULL;
27370   }
27371   __pyx_L5:;
27372
27373   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":517
27374  *     else:
27375  *         c_text = NULL
27376  *     if cstd.strstr(msg, 'file %s'):             # <<<<<<<<<<<<<<
27377  *         c_error.file = cstd.va_charptr(args)
27378  *         if c_error.file and \
27379  */
27380   __pyx_t_1 = (strstr(__pyx_v_msg, __pyx_k_295) != 0);
27381   if (__pyx_t_1) {
27382
27383     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":518
27384  *         c_text = NULL
27385  *     if cstd.strstr(msg, 'file %s'):
27386  *         c_error.file = cstd.va_charptr(args)             # <<<<<<<<<<<<<<
27387  *         if c_error.file and \
27388  *                 cstd.strncmp(c_error.file,
27389  */
27390     __pyx_v_c_error.file = va_charptr(__pyx_v_args);
27391
27392     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":519
27393  *     if cstd.strstr(msg, 'file %s'):
27394  *         c_error.file = cstd.va_charptr(args)
27395  *         if c_error.file and \             # <<<<<<<<<<<<<<
27396  *                 cstd.strncmp(c_error.file,
27397  *                             'string://__STRING__XSLT', 23) == 0:
27398  */
27399     if ((__pyx_v_c_error.file != 0)) {
27400
27401       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":521
27402  *         if c_error.file and \
27403  *                 cstd.strncmp(c_error.file,
27404  *                             'string://__STRING__XSLT', 23) == 0:             # <<<<<<<<<<<<<<
27405  *             c_error.file = '<xslt>'
27406  *     else:
27407  */
27408       __pyx_t_1 = (strncmp(__pyx_v_c_error.file, __pyx_k_296, 23) == 0);
27409     } else {
27410       __pyx_t_1 = (__pyx_v_c_error.file != 0);
27411     }
27412     if (__pyx_t_1) {
27413
27414       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":522
27415  *                 cstd.strncmp(c_error.file,
27416  *                             'string://__STRING__XSLT', 23) == 0:
27417  *             c_error.file = '<xslt>'             # <<<<<<<<<<<<<<
27418  *     else:
27419  *         c_error.file = NULL
27420  */
27421       __pyx_v_c_error.file = __pyx_k_297;
27422       goto __pyx_L7;
27423     }
27424     __pyx_L7:;
27425     goto __pyx_L6;
27426   }
27427   /*else*/ {
27428
27429     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":524
27430  *             c_error.file = '<xslt>'
27431  *     else:
27432  *         c_error.file = NULL             # <<<<<<<<<<<<<<
27433  *     if cstd.strstr(msg, 'line %d'):
27434  *         c_error.line = cstd.va_int(args)
27435  */
27436     __pyx_v_c_error.file = NULL;
27437   }
27438   __pyx_L6:;
27439
27440   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":525
27441  *     else:
27442  *         c_error.file = NULL
27443  *     if cstd.strstr(msg, 'line %d'):             # <<<<<<<<<<<<<<
27444  *         c_error.line = cstd.va_int(args)
27445  *     else:
27446  */
27447   __pyx_t_1 = (strstr(__pyx_v_msg, __pyx_k_298) != 0);
27448   if (__pyx_t_1) {
27449
27450     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":526
27451  *         c_error.file = NULL
27452  *     if cstd.strstr(msg, 'line %d'):
27453  *         c_error.line = cstd.va_int(args)             # <<<<<<<<<<<<<<
27454  *     else:
27455  *         c_error.line = 0
27456  */
27457     __pyx_v_c_error.line = va_int(__pyx_v_args);
27458     goto __pyx_L8;
27459   }
27460   /*else*/ {
27461
27462     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":528
27463  *         c_error.line = cstd.va_int(args)
27464  *     else:
27465  *         c_error.line = 0             # <<<<<<<<<<<<<<
27466  *     if cstd.strstr(msg, 'element %s'):
27467  *         c_element = cstd.va_charptr(args)
27468  */
27469     __pyx_v_c_error.line = 0;
27470   }
27471   __pyx_L8:;
27472
27473   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":529
27474  *     else:
27475  *         c_error.line = 0
27476  *     if cstd.strstr(msg, 'element %s'):             # <<<<<<<<<<<<<<
27477  *         c_element = cstd.va_charptr(args)
27478  *     else:
27479  */
27480   __pyx_t_1 = (strstr(__pyx_v_msg, __pyx_k_299) != 0);
27481   if (__pyx_t_1) {
27482
27483     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":530
27484  *         c_error.line = 0
27485  *     if cstd.strstr(msg, 'element %s'):
27486  *         c_element = cstd.va_charptr(args)             # <<<<<<<<<<<<<<
27487  *     else:
27488  *         c_element = NULL
27489  */
27490     __pyx_v_c_element = va_charptr(__pyx_v_args);
27491     goto __pyx_L9;
27492   }
27493   /*else*/ {
27494
27495     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":532
27496  *         c_element = cstd.va_charptr(args)
27497  *     else:
27498  *         c_element = NULL             # <<<<<<<<<<<<<<
27499  *     cstd.va_end(args)
27500  * 
27501  */
27502     __pyx_v_c_element = NULL;
27503   }
27504   __pyx_L9:;
27505
27506   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":533
27507  *     else:
27508  *         c_element = NULL
27509  *     cstd.va_end(args)             # <<<<<<<<<<<<<<
27510  * 
27511  *     c_message = NULL
27512  */
27513   va_end(__pyx_v_args);
27514
27515   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":535
27516  *     cstd.va_end(args)
27517  * 
27518  *     c_message = NULL             # <<<<<<<<<<<<<<
27519  *     if c_text is NULL:
27520  *         if c_element is not NULL and \
27521  */
27522   __pyx_v_c_message = NULL;
27523
27524   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":536
27525  * 
27526  *     c_message = NULL
27527  *     if c_text is NULL:             # <<<<<<<<<<<<<<
27528  *         if c_element is not NULL and \
27529  *                 cstd.strchr(msg, c'%') == cstd.strrchr(msg, c'%'):
27530  */
27531   __pyx_t_1 = (__pyx_v_c_text == NULL);
27532   if (__pyx_t_1) {
27533
27534     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":537
27535  *     c_message = NULL
27536  *     if c_text is NULL:
27537  *         if c_element is not NULL and \             # <<<<<<<<<<<<<<
27538  *                 cstd.strchr(msg, c'%') == cstd.strrchr(msg, c'%'):
27539  *             # special case: a single occurrence of 'element %s'
27540  */
27541     if ((__pyx_v_c_element != NULL)) {
27542
27543       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":538
27544  *     if c_text is NULL:
27545  *         if c_element is not NULL and \
27546  *                 cstd.strchr(msg, c'%') == cstd.strrchr(msg, c'%'):             # <<<<<<<<<<<<<<
27547  *             # special case: a single occurrence of 'element %s'
27548  *             text_size    = cstd.strlen(msg)
27549  */
27550       __pyx_t_1 = (strchr(__pyx_v_msg, '%') == strrchr(__pyx_v_msg, '%'));
27551     } else {
27552       __pyx_t_1 = (__pyx_v_c_element != NULL);
27553     }
27554     if (__pyx_t_1) {
27555
27556       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":540
27557  *                 cstd.strchr(msg, c'%') == cstd.strrchr(msg, c'%'):
27558  *             # special case: a single occurrence of 'element %s'
27559  *             text_size    = cstd.strlen(msg)             # <<<<<<<<<<<<<<
27560  *             element_size = cstd.strlen(c_element)
27561  *             c_message = <char*>cstd.malloc(
27562  */
27563       __pyx_v_text_size = strlen(__pyx_v_msg);
27564
27565       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":541
27566  *             # special case: a single occurrence of 'element %s'
27567  *             text_size    = cstd.strlen(msg)
27568  *             element_size = cstd.strlen(c_element)             # <<<<<<<<<<<<<<
27569  *             c_message = <char*>cstd.malloc(
27570  *                 (text_size + element_size + 1) * sizeof(char))
27571  */
27572       __pyx_v_element_size = strlen(__pyx_v_c_element);
27573
27574       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":543
27575  *             element_size = cstd.strlen(c_element)
27576  *             c_message = <char*>cstd.malloc(
27577  *                 (text_size + element_size + 1) * sizeof(char))             # <<<<<<<<<<<<<<
27578  *             cstd.sprintf(c_message, msg, c_element)
27579  *             c_error.message = c_message
27580  */
27581       __pyx_v_c_message = ((char *)malloc((((__pyx_v_text_size + __pyx_v_element_size) + 1) * (sizeof(char)))));
27582
27583       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":544
27584  *             c_message = <char*>cstd.malloc(
27585  *                 (text_size + element_size + 1) * sizeof(char))
27586  *             cstd.sprintf(c_message, msg, c_element)             # <<<<<<<<<<<<<<
27587  *             c_error.message = c_message
27588  *         else:
27589  */
27590       sprintf(__pyx_v_c_message, __pyx_v_msg, __pyx_v_c_element);
27591
27592       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":545
27593  *                 (text_size + element_size + 1) * sizeof(char))
27594  *             cstd.sprintf(c_message, msg, c_element)
27595  *             c_error.message = c_message             # <<<<<<<<<<<<<<
27596  *         else:
27597  *             c_error.message = ''
27598  */
27599       __pyx_v_c_error.message = __pyx_v_c_message;
27600       goto __pyx_L11;
27601     }
27602     /*else*/ {
27603
27604       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":547
27605  *             c_error.message = c_message
27606  *         else:
27607  *             c_error.message = ''             # <<<<<<<<<<<<<<
27608  *     elif c_element is NULL:
27609  *         c_error.message = c_text
27610  */
27611       __pyx_v_c_error.message = __pyx_k_300;
27612     }
27613     __pyx_L11:;
27614     goto __pyx_L10;
27615   }
27616
27617   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":548
27618  *         else:
27619  *             c_error.message = ''
27620  *     elif c_element is NULL:             # <<<<<<<<<<<<<<
27621  *         c_error.message = c_text
27622  *     else:
27623  */
27624   __pyx_t_1 = (__pyx_v_c_element == NULL);
27625   if (__pyx_t_1) {
27626
27627     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":549
27628  *             c_error.message = ''
27629  *     elif c_element is NULL:
27630  *         c_error.message = c_text             # <<<<<<<<<<<<<<
27631  *     else:
27632  *         text_size    = cstd.strlen(c_text)
27633  */
27634     __pyx_v_c_error.message = __pyx_v_c_text;
27635     goto __pyx_L10;
27636   }
27637   /*else*/ {
27638
27639     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":551
27640  *         c_error.message = c_text
27641  *     else:
27642  *         text_size    = cstd.strlen(c_text)             # <<<<<<<<<<<<<<
27643  *         element_size = cstd.strlen(c_element)
27644  *         c_message = <char*>cstd.malloc(
27645  */
27646     __pyx_v_text_size = strlen(__pyx_v_c_text);
27647
27648     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":552
27649  *     else:
27650  *         text_size    = cstd.strlen(c_text)
27651  *         element_size = cstd.strlen(c_element)             # <<<<<<<<<<<<<<
27652  *         c_message = <char*>cstd.malloc(
27653  *             (text_size + 12 + element_size + 1) * sizeof(char))
27654  */
27655     __pyx_v_element_size = strlen(__pyx_v_c_element);
27656
27657     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":554
27658  *         element_size = cstd.strlen(c_element)
27659  *         c_message = <char*>cstd.malloc(
27660  *             (text_size + 12 + element_size + 1) * sizeof(char))             # <<<<<<<<<<<<<<
27661  *         cstd.sprintf(c_message, "%s, element '%s'", c_text, c_element)
27662  *         c_error.message = c_message
27663  */
27664     __pyx_v_c_message = ((char *)malloc(((((__pyx_v_text_size + 12) + __pyx_v_element_size) + 1) * (sizeof(char)))));
27665
27666     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":555
27667  *         c_message = <char*>cstd.malloc(
27668  *             (text_size + 12 + element_size + 1) * sizeof(char))
27669  *         cstd.sprintf(c_message, "%s, element '%s'", c_text, c_element)             # <<<<<<<<<<<<<<
27670  *         c_error.message = c_message
27671  * 
27672  */
27673     sprintf(__pyx_v_c_message, __pyx_k_301, __pyx_v_c_text, __pyx_v_c_element);
27674
27675     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":556
27676  *             (text_size + 12 + element_size + 1) * sizeof(char))
27677  *         cstd.sprintf(c_message, "%s, element '%s'", c_text, c_element)
27678  *         c_error.message = c_message             # <<<<<<<<<<<<<<
27679  * 
27680  *     c_error.domain = xmlerror.XML_FROM_XSLT
27681  */
27682     __pyx_v_c_error.message = __pyx_v_c_message;
27683   }
27684   __pyx_L10:;
27685
27686   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":558
27687  *         c_error.message = c_message
27688  * 
27689  *     c_error.domain = xmlerror.XML_FROM_XSLT             # <<<<<<<<<<<<<<
27690  *     c_error.code   = xmlerror.XML_ERR_OK    # what else?
27691  *     c_error.level  = xmlerror.XML_ERR_ERROR # what else?
27692  */
27693   __pyx_v_c_error.domain = XML_FROM_XSLT;
27694
27695   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":559
27696  * 
27697  *     c_error.domain = xmlerror.XML_FROM_XSLT
27698  *     c_error.code   = xmlerror.XML_ERR_OK    # what else?             # <<<<<<<<<<<<<<
27699  *     c_error.level  = xmlerror.XML_ERR_ERROR # what else?
27700  *     c_error.int2   = 0
27701  */
27702   __pyx_v_c_error.code = XML_ERR_OK;
27703
27704   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":560
27705  *     c_error.domain = xmlerror.XML_FROM_XSLT
27706  *     c_error.code   = xmlerror.XML_ERR_OK    # what else?
27707  *     c_error.level  = xmlerror.XML_ERR_ERROR # what else?             # <<<<<<<<<<<<<<
27708  *     c_error.int2   = 0
27709  * 
27710  */
27711   __pyx_v_c_error.level = XML_ERR_ERROR;
27712
27713   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":561
27714  *     c_error.code   = xmlerror.XML_ERR_OK    # what else?
27715  *     c_error.level  = xmlerror.XML_ERR_ERROR # what else?
27716  *     c_error.int2   = 0             # <<<<<<<<<<<<<<
27717  * 
27718  *     _forwardError(c_log_handler, &c_error)
27719  */
27720   __pyx_v_c_error.int2 = 0;
27721
27722   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":563
27723  *     c_error.int2   = 0
27724  * 
27725  *     _forwardError(c_log_handler, &c_error)             # <<<<<<<<<<<<<<
27726  * 
27727  *     if c_message is not NULL:
27728  */
27729   __pyx_f_4lxml_5etree__forwardError(__pyx_v_c_log_handler, (&__pyx_v_c_error));
27730
27731   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":565
27732  *     _forwardError(c_log_handler, &c_error)
27733  * 
27734  *     if c_message is not NULL:             # <<<<<<<<<<<<<<
27735  *         cstd.free(c_message)
27736  * 
27737  */
27738   __pyx_t_1 = (__pyx_v_c_message != NULL);
27739   if (__pyx_t_1) {
27740
27741     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":566
27742  * 
27743  *     if c_message is not NULL:
27744  *         cstd.free(c_message)             # <<<<<<<<<<<<<<
27745  * 
27746  * ################################################################################
27747  */
27748     free(__pyx_v_c_message);
27749     goto __pyx_L12;
27750   }
27751   __pyx_L12:;
27752
27753   __pyx_L0:;
27754 }
27755
27756 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":572
27757  * ################################################################################
27758  * 
27759  * cdef void __initErrorConstants():             # <<<<<<<<<<<<<<
27760  *     u"Called at setup time to parse the constants and build the classes below."
27761  *     cdef dict reverse_dict
27762  */
27763
27764 static  void __pyx_f_4lxml_5etree___initErrorConstants(void) {
27765   PyObject *__pyx_v_reverse_dict;
27766   PyObject *__pyx_v_find_constants;
27767   PyObject *__pyx_v_const_defs;
27768   PyObject *__pyx_v_cls;
27769   PyObject *__pyx_v_constant_tuple;
27770   PyObject *__pyx_v_constants;
27771   PyObject *__pyx_v_name;
27772   PyObject *__pyx_v_value;
27773   PyObject *__pyx_1 = 0;
27774   PyObject *__pyx_2 = 0;
27775   PyObject *__pyx_3 = 0;
27776   PyObject *__pyx_t_1 = NULL;
27777   PyObject *__pyx_t_2 = NULL;
27778   PyObject *__pyx_t_3 = NULL;
27779   PyObject *__pyx_t_4 = NULL;
27780   PyObject *__pyx_t_5 = NULL;
27781   Py_ssize_t __pyx_t_6;
27782   Py_ssize_t __pyx_t_7;
27783   Py_ssize_t __pyx_t_8;
27784   __Pyx_SetupRefcountContext("__initErrorConstants");
27785   __pyx_v_reverse_dict = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
27786   __pyx_v_find_constants = Py_None; __Pyx_INCREF(Py_None);
27787   __pyx_v_const_defs = Py_None; __Pyx_INCREF(Py_None);
27788   __pyx_v_cls = Py_None; __Pyx_INCREF(Py_None);
27789   __pyx_v_constant_tuple = Py_None; __Pyx_INCREF(Py_None);
27790   __pyx_v_constants = Py_None; __Pyx_INCREF(Py_None);
27791   __pyx_v_name = Py_None; __Pyx_INCREF(Py_None);
27792   __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);
27793
27794   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":575
27795  *     u"Called at setup time to parse the constants and build the classes below."
27796  *     cdef dict reverse_dict
27797  *     find_constants = re.compile(ur"\s*([a-zA-Z0-9_]+)\s*=\s*([0-9]+)").findall             # <<<<<<<<<<<<<<
27798  *     const_defs = ((ErrorLevels,          __ERROR_LEVELS),
27799  *                   (ErrorDomains,         __ERROR_DOMAINS),
27800  */
27801   __pyx_t_1 = PyObject_GetAttr(__pyx_v_4lxml_5etree_re, __pyx_kp_compile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27802   __Pyx_GOTREF(__pyx_t_1);
27803   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27804   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
27805   __Pyx_INCREF(((PyObject *)__pyx_kp_302));
27806   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_302));
27807   __Pyx_GIVEREF(((PyObject *)__pyx_kp_302));
27808   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27809   __Pyx_GOTREF(__pyx_t_3);
27810   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27811   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
27812   __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_kp_findall); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27813   __Pyx_GOTREF(__pyx_t_2);
27814   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27815   __Pyx_DECREF(__pyx_v_find_constants);
27816   __pyx_v_find_constants = __pyx_t_2;
27817   __pyx_t_2 = 0;
27818
27819   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":576
27820  *     cdef dict reverse_dict
27821  *     find_constants = re.compile(ur"\s*([a-zA-Z0-9_]+)\s*=\s*([0-9]+)").findall
27822  *     const_defs = ((ErrorLevels,          __ERROR_LEVELS),             # <<<<<<<<<<<<<<
27823  *                   (ErrorDomains,         __ERROR_DOMAINS),
27824  *                   (ErrorTypes,           __PARSER_ERROR_TYPES),
27825  */
27826   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ErrorLevels); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27827   __Pyx_GOTREF(__pyx_1);
27828   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27829   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
27830   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_1);
27831   __Pyx_GIVEREF(__pyx_1);
27832   __Pyx_INCREF(__pyx_v_4lxml_5etree___ERROR_LEVELS);
27833   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_4lxml_5etree___ERROR_LEVELS);
27834   __Pyx_GIVEREF(__pyx_v_4lxml_5etree___ERROR_LEVELS);
27835   __pyx_1 = 0;
27836
27837   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":577
27838  *     find_constants = re.compile(ur"\s*([a-zA-Z0-9_]+)\s*=\s*([0-9]+)").findall
27839  *     const_defs = ((ErrorLevels,          __ERROR_LEVELS),
27840  *                   (ErrorDomains,         __ERROR_DOMAINS),             # <<<<<<<<<<<<<<
27841  *                   (ErrorTypes,           __PARSER_ERROR_TYPES),
27842  *                   (RelaxNGErrorTypes,    __RELAXNG_ERROR_TYPES))
27843  */
27844   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ErrorDomains); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27845   __Pyx_GOTREF(__pyx_1);
27846   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27847   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
27848   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_1);
27849   __Pyx_GIVEREF(__pyx_1);
27850   __Pyx_INCREF(__pyx_v_4lxml_5etree___ERROR_DOMAINS);
27851   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_4lxml_5etree___ERROR_DOMAINS);
27852   __Pyx_GIVEREF(__pyx_v_4lxml_5etree___ERROR_DOMAINS);
27853   __pyx_1 = 0;
27854
27855   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":578
27856  *     const_defs = ((ErrorLevels,          __ERROR_LEVELS),
27857  *                   (ErrorDomains,         __ERROR_DOMAINS),
27858  *                   (ErrorTypes,           __PARSER_ERROR_TYPES),             # <<<<<<<<<<<<<<
27859  *                   (RelaxNGErrorTypes,    __RELAXNG_ERROR_TYPES))
27860  *     for cls, constant_tuple in const_defs:
27861  */
27862   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ErrorTypes); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27863   __Pyx_GOTREF(__pyx_1);
27864   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27865   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
27866   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_1);
27867   __Pyx_GIVEREF(__pyx_1);
27868   __Pyx_INCREF(__pyx_v_4lxml_5etree___PARSER_ERROR_TYPES);
27869   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_4lxml_5etree___PARSER_ERROR_TYPES);
27870   __Pyx_GIVEREF(__pyx_v_4lxml_5etree___PARSER_ERROR_TYPES);
27871   __pyx_1 = 0;
27872
27873   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":579
27874  *                   (ErrorDomains,         __ERROR_DOMAINS),
27875  *                   (ErrorTypes,           __PARSER_ERROR_TYPES),
27876  *                   (RelaxNGErrorTypes,    __RELAXNG_ERROR_TYPES))             # <<<<<<<<<<<<<<
27877  *     for cls, constant_tuple in const_defs:
27878  *         reverse_dict = {}
27879  */
27880   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_RelaxNGErrorTypes); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27881   __Pyx_GOTREF(__pyx_1);
27882   __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27883   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
27884   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_1);
27885   __Pyx_GIVEREF(__pyx_1);
27886   __Pyx_INCREF(__pyx_v_4lxml_5etree___RELAXNG_ERROR_TYPES);
27887   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_4lxml_5etree___RELAXNG_ERROR_TYPES);
27888   __Pyx_GIVEREF(__pyx_v_4lxml_5etree___RELAXNG_ERROR_TYPES);
27889   __pyx_1 = 0;
27890   __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27891   __Pyx_GOTREF(((PyObject *)__pyx_t_5));
27892   PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_2));
27893   __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
27894   PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_t_3));
27895   __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
27896   PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_t_1));
27897   __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
27898   PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_t_4));
27899   __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
27900   __pyx_t_2 = 0;
27901   __pyx_t_3 = 0;
27902   __pyx_t_1 = 0;
27903   __pyx_t_4 = 0;
27904   __Pyx_DECREF(__pyx_v_const_defs);
27905   __pyx_v_const_defs = ((PyObject *)__pyx_t_5);
27906   __pyx_t_5 = 0;
27907
27908   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":580
27909  *                   (ErrorTypes,           __PARSER_ERROR_TYPES),
27910  *                   (RelaxNGErrorTypes,    __RELAXNG_ERROR_TYPES))
27911  *     for cls, constant_tuple in const_defs:             # <<<<<<<<<<<<<<
27912  *         reverse_dict = {}
27913  *         cls._names   = reverse_dict
27914  */
27915   if (PyList_CheckExact(__pyx_v_const_defs) || PyTuple_CheckExact(__pyx_v_const_defs)) {
27916     __pyx_t_6 = 0; __pyx_t_5 = __pyx_v_const_defs; __Pyx_INCREF(__pyx_t_5);
27917   } else {
27918     __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_const_defs); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27919     __Pyx_GOTREF(__pyx_t_5);
27920   }
27921   for (;;) {
27922     if (likely(PyList_CheckExact(__pyx_t_5))) {
27923       if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
27924       __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++;
27925     } else if (likely(PyTuple_CheckExact(__pyx_t_5))) {
27926       if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
27927       __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++;
27928     } else {
27929       __pyx_t_4 = PyIter_Next(__pyx_t_5);
27930       if (!__pyx_t_4) {
27931         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27932         break;
27933       }
27934       __Pyx_GOTREF(__pyx_t_4);
27935     }
27936     if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 2)) {
27937       PyObject* tuple = __pyx_t_4;
27938       __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
27939       __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
27940       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27941       __Pyx_DECREF(__pyx_v_cls);
27942       __pyx_v_cls = __pyx_2;
27943       __pyx_2 = 0;
27944       __Pyx_DECREF(__pyx_v_constant_tuple);
27945       __pyx_v_constant_tuple = __pyx_3;
27946       __pyx_3 = 0;
27947     } else {
27948       __pyx_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27949       __Pyx_GOTREF(__pyx_1);
27950       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27951       __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27952       __Pyx_GOTREF(__pyx_2);
27953       __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27954       __Pyx_GOTREF(__pyx_3);
27955       if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27956       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
27957       __Pyx_DECREF(__pyx_v_cls);
27958       __pyx_v_cls = __pyx_2;
27959       __pyx_2 = 0;
27960       __Pyx_DECREF(__pyx_v_constant_tuple);
27961       __pyx_v_constant_tuple = __pyx_3;
27962       __pyx_3 = 0;
27963     }
27964
27965     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":581
27966  *                   (RelaxNGErrorTypes,    __RELAXNG_ERROR_TYPES))
27967  *     for cls, constant_tuple in const_defs:
27968  *         reverse_dict = {}             # <<<<<<<<<<<<<<
27969  *         cls._names   = reverse_dict
27970  *         cls._getName = reverse_dict.get
27971  */
27972     __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27973     __Pyx_GOTREF(((PyObject *)__pyx_1));
27974     __Pyx_DECREF(((PyObject *)__pyx_v_reverse_dict));
27975     __pyx_v_reverse_dict = __pyx_1;
27976     __pyx_1 = 0;
27977
27978     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":582
27979  *     for cls, constant_tuple in const_defs:
27980  *         reverse_dict = {}
27981  *         cls._names   = reverse_dict             # <<<<<<<<<<<<<<
27982  *         cls._getName = reverse_dict.get
27983  *         for constants in constant_tuple:
27984  */
27985     if (PyObject_SetAttr(__pyx_v_cls, __pyx_kp__names, ((PyObject *)__pyx_v_reverse_dict)) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27986
27987     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":583
27988  *         reverse_dict = {}
27989  *         cls._names   = reverse_dict
27990  *         cls._getName = reverse_dict.get             # <<<<<<<<<<<<<<
27991  *         for constants in constant_tuple:
27992  *             #print len(constants) + 1
27993  */
27994     __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_reverse_dict), __pyx_kp_get); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27995     __Pyx_GOTREF(__pyx_t_4);
27996     if (PyObject_SetAttr(__pyx_v_cls, __pyx_kp__getName, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27997     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27998
27999     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":584
28000  *         cls._names   = reverse_dict
28001  *         cls._getName = reverse_dict.get
28002  *         for constants in constant_tuple:             # <<<<<<<<<<<<<<
28003  *             #print len(constants) + 1
28004  *             for name, value in find_constants(constants):
28005  */
28006     if (PyList_CheckExact(__pyx_v_constant_tuple) || PyTuple_CheckExact(__pyx_v_constant_tuple)) {
28007       __pyx_t_7 = 0; __pyx_t_4 = __pyx_v_constant_tuple; __Pyx_INCREF(__pyx_t_4);
28008     } else {
28009       __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_constant_tuple); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28010       __Pyx_GOTREF(__pyx_t_4);
28011     }
28012     for (;;) {
28013       if (likely(PyList_CheckExact(__pyx_t_4))) {
28014         if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break;
28015         __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++;
28016       } else if (likely(PyTuple_CheckExact(__pyx_t_4))) {
28017         if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
28018         __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++;
28019       } else {
28020         __pyx_t_1 = PyIter_Next(__pyx_t_4);
28021         if (!__pyx_t_1) {
28022           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28023           break;
28024         }
28025         __Pyx_GOTREF(__pyx_t_1);
28026       }
28027       __Pyx_DECREF(__pyx_v_constants);
28028       __pyx_v_constants = __pyx_t_1;
28029       __pyx_t_1 = 0;
28030
28031       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":586
28032  *         for constants in constant_tuple:
28033  *             #print len(constants) + 1
28034  *             for name, value in find_constants(constants):             # <<<<<<<<<<<<<<
28035  *                 value = int(value)
28036  *                 python.PyObject_SetAttr(cls, name, value)
28037  */
28038       __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28039       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
28040       __Pyx_INCREF(__pyx_v_constants);
28041       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_constants);
28042       __Pyx_GIVEREF(__pyx_v_constants);
28043       __pyx_t_3 = PyObject_Call(__pyx_v_find_constants, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28044       __Pyx_GOTREF(__pyx_t_3);
28045       __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
28046       if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
28047         __pyx_t_8 = 0; __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1);
28048       } else {
28049         __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28050         __Pyx_GOTREF(__pyx_t_1);
28051       }
28052       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28053       for (;;) {
28054         if (likely(PyList_CheckExact(__pyx_t_1))) {
28055           if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break;
28056           __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++;
28057         } else if (likely(PyTuple_CheckExact(__pyx_t_1))) {
28058           if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
28059           __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++;
28060         } else {
28061           __pyx_t_3 = PyIter_Next(__pyx_t_1);
28062           if (!__pyx_t_3) {
28063             if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28064             break;
28065           }
28066           __Pyx_GOTREF(__pyx_t_3);
28067         }
28068         if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) {
28069           PyObject* tuple = __pyx_t_3;
28070           __pyx_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_3);
28071           __pyx_1 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_1);
28072           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28073           __Pyx_DECREF(__pyx_v_name);
28074           __pyx_v_name = __pyx_3;
28075           __pyx_3 = 0;
28076           __Pyx_DECREF(__pyx_v_value);
28077           __pyx_v_value = __pyx_1;
28078           __pyx_1 = 0;
28079         } else {
28080           __pyx_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28081           __Pyx_GOTREF(__pyx_2);
28082           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28083           __pyx_3 = __Pyx_UnpackItem(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28084           __Pyx_GOTREF(__pyx_3);
28085           __pyx_1 = __Pyx_UnpackItem(__pyx_2, 1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28086           __Pyx_GOTREF(__pyx_1);
28087           if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28088           __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
28089           __Pyx_DECREF(__pyx_v_name);
28090           __pyx_v_name = __pyx_3;
28091           __pyx_3 = 0;
28092           __Pyx_DECREF(__pyx_v_value);
28093           __pyx_v_value = __pyx_1;
28094           __pyx_1 = 0;
28095         }
28096
28097         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":587
28098  *             #print len(constants) + 1
28099  *             for name, value in find_constants(constants):
28100  *                 value = int(value)             # <<<<<<<<<<<<<<
28101  *                 python.PyObject_SetAttr(cls, name, value)
28102  *                 reverse_dict[value] = name
28103  */
28104         __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28105         __Pyx_GOTREF(((PyObject *)__pyx_t_3));
28106         __Pyx_INCREF(__pyx_v_value);
28107         PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_value);
28108         __Pyx_GIVEREF(__pyx_v_value);
28109         __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28110         __Pyx_GOTREF(__pyx_t_2);
28111         __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
28112         __Pyx_DECREF(__pyx_v_value);
28113         __pyx_v_value = __pyx_t_2;
28114         __pyx_t_2 = 0;
28115
28116         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":588
28117  *             for name, value in find_constants(constants):
28118  *                 value = int(value)
28119  *                 python.PyObject_SetAttr(cls, name, value)             # <<<<<<<<<<<<<<
28120  *                 reverse_dict[value] = name
28121  * 
28122  */
28123         PyObject_SetAttr(__pyx_v_cls, __pyx_v_name, __pyx_v_value);
28124
28125         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":589
28126  *                 value = int(value)
28127  *                 python.PyObject_SetAttr(cls, name, value)
28128  *                 reverse_dict[value] = name             # <<<<<<<<<<<<<<
28129  * 
28130  * 
28131  */
28132         if (PyDict_SetItem(((PyObject *)__pyx_v_reverse_dict), __pyx_v_value, __pyx_v_name) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28133       }
28134       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28135     }
28136     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28137   }
28138   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
28139
28140   goto __pyx_L0;
28141   __pyx_L1_error:;
28142   __Pyx_XDECREF(__pyx_1);
28143   __Pyx_XDECREF(__pyx_2);
28144   __Pyx_XDECREF(__pyx_3);
28145   __Pyx_XDECREF(__pyx_t_1);
28146   __Pyx_XDECREF(__pyx_t_2);
28147   __Pyx_XDECREF(__pyx_t_3);
28148   __Pyx_XDECREF(__pyx_t_4);
28149   __Pyx_XDECREF(__pyx_t_5);
28150   __Pyx_WriteUnraisable("lxml.etree.__initErrorConstants");
28151   __pyx_L0:;
28152   __Pyx_DECREF(__pyx_v_reverse_dict);
28153   __Pyx_DECREF(__pyx_v_find_constants);
28154   __Pyx_DECREF(__pyx_v_const_defs);
28155   __Pyx_DECREF(__pyx_v_cls);
28156   __Pyx_DECREF(__pyx_v_constant_tuple);
28157   __Pyx_DECREF(__pyx_v_constants);
28158   __Pyx_DECREF(__pyx_v_name);
28159   __Pyx_DECREF(__pyx_v_value);
28160   __Pyx_FinishRefcountContext();
28161 }
28162
28163 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":262
28164  *     cdef _BaseParser _parser
28165  * 
28166  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
28167  *         # if there are no more references to the document, it is safe
28168  *         # to clean the whole thing up, as all nodes have a reference to
28169  */
28170
28171 static void __pyx_pf_4lxml_5etree_9_Document___dealloc__(PyObject *__pyx_v_self); /*proto*/
28172 static void __pyx_pf_4lxml_5etree_9_Document___dealloc__(PyObject *__pyx_v_self) {
28173   __Pyx_SetupRefcountContext("__dealloc__");
28174
28175   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":270
28176  *         #print <long>self._c_doc, self._c_doc.dict is __GLOBAL_PARSER_CONTEXT._c_dict
28177  *         #print <long>self._c_doc, canDeallocateChildNodes(<xmlNode*>self._c_doc)
28178  *         tree.xmlFreeDoc(self._c_doc)             # <<<<<<<<<<<<<<
28179  *         #_deallocDocument(self._c_doc)
28180  * 
28181  */
28182   xmlFreeDoc(((struct LxmlDocument *)__pyx_v_self)->_c_doc);
28183
28184   __Pyx_FinishRefcountContext();
28185 }
28186
28187 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":273
28188  *         #_deallocDocument(self._c_doc)
28189  * 
28190  *     cdef getroot(self):             # <<<<<<<<<<<<<<
28191  *         cdef xmlNode* c_node
28192  *         c_node = tree.xmlDocGetRootElement(self._c_doc)
28193  */
28194
28195 static  PyObject *__pyx_f_4lxml_5etree_9_Document_getroot(struct LxmlDocument *__pyx_v_self) {
28196   xmlNode *__pyx_v_c_node;
28197   PyObject *__pyx_r = NULL;
28198   int __pyx_t_1;
28199   PyObject *__pyx_t_2 = NULL;
28200   __Pyx_SetupRefcountContext("getroot");
28201
28202   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":275
28203  *     cdef getroot(self):
28204  *         cdef xmlNode* c_node
28205  *         c_node = tree.xmlDocGetRootElement(self._c_doc)             # <<<<<<<<<<<<<<
28206  *         if c_node is NULL:
28207  *             return None
28208  */
28209   __pyx_v_c_node = xmlDocGetRootElement(__pyx_v_self->_c_doc);
28210
28211   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":276
28212  *         cdef xmlNode* c_node
28213  *         c_node = tree.xmlDocGetRootElement(self._c_doc)
28214  *         if c_node is NULL:             # <<<<<<<<<<<<<<
28215  *             return None
28216  *         return _elementFactory(self, c_node)
28217  */
28218   __pyx_t_1 = (__pyx_v_c_node == NULL);
28219   if (__pyx_t_1) {
28220
28221     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":277
28222  *         c_node = tree.xmlDocGetRootElement(self._c_doc)
28223  *         if c_node is NULL:
28224  *             return None             # <<<<<<<<<<<<<<
28225  *         return _elementFactory(self, c_node)
28226  * 
28227  */
28228     __Pyx_XDECREF(__pyx_r);
28229     __Pyx_INCREF(Py_None);
28230     __pyx_r = Py_None;
28231     goto __pyx_L0;
28232     goto __pyx_L3;
28233   }
28234   __pyx_L3:;
28235
28236   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":278
28237  *         if c_node is NULL:
28238  *             return None
28239  *         return _elementFactory(self, c_node)             # <<<<<<<<<<<<<<
28240  * 
28241  *     cdef bint hasdoctype(self):
28242  */
28243   __Pyx_XDECREF(__pyx_r);
28244   __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_self, __pyx_v_c_node)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28245   __Pyx_GOTREF(__pyx_t_2);
28246   __pyx_r = __pyx_t_2;
28247   __pyx_t_2 = 0;
28248   goto __pyx_L0;
28249
28250   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
28251   goto __pyx_L0;
28252   __pyx_L1_error:;
28253   __Pyx_XDECREF(__pyx_t_2);
28254   __Pyx_AddTraceback("lxml.etree._Document.getroot");
28255   __pyx_r = 0;
28256   __pyx_L0:;
28257   __Pyx_XGIVEREF(__pyx_r);
28258   __Pyx_FinishRefcountContext();
28259   return __pyx_r;
28260 }
28261
28262 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":280
28263  *         return _elementFactory(self, c_node)
28264  * 
28265  *     cdef bint hasdoctype(self):             # <<<<<<<<<<<<<<
28266  *         return self._c_doc.intSubset is not NULL
28267  * 
28268  */
28269
28270 static  int __pyx_f_4lxml_5etree_9_Document_hasdoctype(struct LxmlDocument *__pyx_v_self) {
28271   int __pyx_r;
28272   __Pyx_SetupRefcountContext("hasdoctype");
28273
28274   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":281
28275  * 
28276  *     cdef bint hasdoctype(self):
28277  *         return self._c_doc.intSubset is not NULL             # <<<<<<<<<<<<<<
28278  * 
28279  *     cdef getdoctype(self):
28280  */
28281   __pyx_r = (__pyx_v_self->_c_doc->intSubset != NULL);
28282   goto __pyx_L0;
28283
28284   __pyx_r = 0;
28285   __pyx_L0:;
28286   __Pyx_FinishRefcountContext();
28287   return __pyx_r;
28288 }
28289
28290 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":283
28291  *         return self._c_doc.intSubset is not NULL
28292  * 
28293  *     cdef getdoctype(self):             # <<<<<<<<<<<<<<
28294  *         cdef tree.xmlDtd* c_dtd
28295  *         cdef xmlNode* c_root_node
28296  */
28297
28298 static  PyObject *__pyx_f_4lxml_5etree_9_Document_getdoctype(struct LxmlDocument *__pyx_v_self) {
28299   xmlDtd *__pyx_v_c_dtd;
28300   xmlNode *__pyx_v_c_root_node;
28301   PyObject *__pyx_v_public_id;
28302   PyObject *__pyx_v_sys_url;
28303   PyObject *__pyx_v_root_name;
28304   PyObject *__pyx_r = NULL;
28305   int __pyx_t_1;
28306   PyObject *__pyx_t_2 = NULL;
28307   int __pyx_t_3;
28308   __Pyx_SetupRefcountContext("getdoctype");
28309   __pyx_v_public_id = Py_None; __Pyx_INCREF(Py_None);
28310   __pyx_v_sys_url = Py_None; __Pyx_INCREF(Py_None);
28311   __pyx_v_root_name = Py_None; __Pyx_INCREF(Py_None);
28312
28313   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":286
28314  *         cdef tree.xmlDtd* c_dtd
28315  *         cdef xmlNode* c_root_node
28316  *         public_id = None             # <<<<<<<<<<<<<<
28317  *         sys_url   = None
28318  *         c_dtd = self._c_doc.intSubset
28319  */
28320   __Pyx_INCREF(Py_None);
28321   __Pyx_DECREF(__pyx_v_public_id);
28322   __pyx_v_public_id = Py_None;
28323
28324   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":287
28325  *         cdef xmlNode* c_root_node
28326  *         public_id = None
28327  *         sys_url   = None             # <<<<<<<<<<<<<<
28328  *         c_dtd = self._c_doc.intSubset
28329  *         if c_dtd is not NULL:
28330  */
28331   __Pyx_INCREF(Py_None);
28332   __Pyx_DECREF(__pyx_v_sys_url);
28333   __pyx_v_sys_url = Py_None;
28334
28335   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":288
28336  *         public_id = None
28337  *         sys_url   = None
28338  *         c_dtd = self._c_doc.intSubset             # <<<<<<<<<<<<<<
28339  *         if c_dtd is not NULL:
28340  *             if c_dtd.ExternalID is not NULL:
28341  */
28342   __pyx_v_c_dtd = __pyx_v_self->_c_doc->intSubset;
28343
28344   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":289
28345  *         sys_url   = None
28346  *         c_dtd = self._c_doc.intSubset
28347  *         if c_dtd is not NULL:             # <<<<<<<<<<<<<<
28348  *             if c_dtd.ExternalID is not NULL:
28349  *                 public_id = funicode(c_dtd.ExternalID)
28350  */
28351   __pyx_t_1 = (__pyx_v_c_dtd != NULL);
28352   if (__pyx_t_1) {
28353
28354     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":290
28355  *         c_dtd = self._c_doc.intSubset
28356  *         if c_dtd is not NULL:
28357  *             if c_dtd.ExternalID is not NULL:             # <<<<<<<<<<<<<<
28358  *                 public_id = funicode(c_dtd.ExternalID)
28359  *             if c_dtd.SystemID is not NULL:
28360  */
28361     __pyx_t_1 = (__pyx_v_c_dtd->ExternalID != NULL);
28362     if (__pyx_t_1) {
28363
28364       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":291
28365  *         if c_dtd is not NULL:
28366  *             if c_dtd.ExternalID is not NULL:
28367  *                 public_id = funicode(c_dtd.ExternalID)             # <<<<<<<<<<<<<<
28368  *             if c_dtd.SystemID is not NULL:
28369  *                 sys_url = funicode(c_dtd.SystemID)
28370  */
28371       __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_dtd->ExternalID); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28372       __Pyx_GOTREF(__pyx_t_2);
28373       __Pyx_DECREF(__pyx_v_public_id);
28374       __pyx_v_public_id = __pyx_t_2;
28375       __pyx_t_2 = 0;
28376       goto __pyx_L4;
28377     }
28378     __pyx_L4:;
28379
28380     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":292
28381  *             if c_dtd.ExternalID is not NULL:
28382  *                 public_id = funicode(c_dtd.ExternalID)
28383  *             if c_dtd.SystemID is not NULL:             # <<<<<<<<<<<<<<
28384  *                 sys_url = funicode(c_dtd.SystemID)
28385  *         c_dtd = self._c_doc.extSubset
28386  */
28387     __pyx_t_1 = (__pyx_v_c_dtd->SystemID != NULL);
28388     if (__pyx_t_1) {
28389
28390       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":293
28391  *                 public_id = funicode(c_dtd.ExternalID)
28392  *             if c_dtd.SystemID is not NULL:
28393  *                 sys_url = funicode(c_dtd.SystemID)             # <<<<<<<<<<<<<<
28394  *         c_dtd = self._c_doc.extSubset
28395  *         if c_dtd is not NULL:
28396  */
28397       __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_dtd->SystemID); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28398       __Pyx_GOTREF(__pyx_t_2);
28399       __Pyx_DECREF(__pyx_v_sys_url);
28400       __pyx_v_sys_url = __pyx_t_2;
28401       __pyx_t_2 = 0;
28402       goto __pyx_L5;
28403     }
28404     __pyx_L5:;
28405     goto __pyx_L3;
28406   }
28407   __pyx_L3:;
28408
28409   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":294
28410  *             if c_dtd.SystemID is not NULL:
28411  *                 sys_url = funicode(c_dtd.SystemID)
28412  *         c_dtd = self._c_doc.extSubset             # <<<<<<<<<<<<<<
28413  *         if c_dtd is not NULL:
28414  *             if not public_id and c_dtd.ExternalID is not NULL:
28415  */
28416   __pyx_v_c_dtd = __pyx_v_self->_c_doc->extSubset;
28417
28418   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":295
28419  *                 sys_url = funicode(c_dtd.SystemID)
28420  *         c_dtd = self._c_doc.extSubset
28421  *         if c_dtd is not NULL:             # <<<<<<<<<<<<<<
28422  *             if not public_id and c_dtd.ExternalID is not NULL:
28423  *                 public_id = funicode(c_dtd.ExternalID)
28424  */
28425   __pyx_t_1 = (__pyx_v_c_dtd != NULL);
28426   if (__pyx_t_1) {
28427
28428     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":296
28429  *         c_dtd = self._c_doc.extSubset
28430  *         if c_dtd is not NULL:
28431  *             if not public_id and c_dtd.ExternalID is not NULL:             # <<<<<<<<<<<<<<
28432  *                 public_id = funicode(c_dtd.ExternalID)
28433  *             if not sys_url and c_dtd.SystemID is not NULL:
28434  */
28435     __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_public_id); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28436     if ((!__pyx_t_1)) {
28437       __pyx_t_3 = (__pyx_v_c_dtd->ExternalID != NULL);
28438     } else {
28439       __pyx_t_3 = (!__pyx_t_1);
28440     }
28441     if (__pyx_t_3) {
28442
28443       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":297
28444  *         if c_dtd is not NULL:
28445  *             if not public_id and c_dtd.ExternalID is not NULL:
28446  *                 public_id = funicode(c_dtd.ExternalID)             # <<<<<<<<<<<<<<
28447  *             if not sys_url and c_dtd.SystemID is not NULL:
28448  *                 sys_url = funicode(c_dtd.SystemID)
28449  */
28450       __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_dtd->ExternalID); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28451       __Pyx_GOTREF(__pyx_t_2);
28452       __Pyx_DECREF(__pyx_v_public_id);
28453       __pyx_v_public_id = __pyx_t_2;
28454       __pyx_t_2 = 0;
28455       goto __pyx_L7;
28456     }
28457     __pyx_L7:;
28458
28459     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":298
28460  *             if not public_id and c_dtd.ExternalID is not NULL:
28461  *                 public_id = funicode(c_dtd.ExternalID)
28462  *             if not sys_url and c_dtd.SystemID is not NULL:             # <<<<<<<<<<<<<<
28463  *                 sys_url = funicode(c_dtd.SystemID)
28464  *         c_root_node = tree.xmlDocGetRootElement(self._c_doc)
28465  */
28466     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_sys_url); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28467     if ((!__pyx_t_3)) {
28468       __pyx_t_1 = (__pyx_v_c_dtd->SystemID != NULL);
28469     } else {
28470       __pyx_t_1 = (!__pyx_t_3);
28471     }
28472     if (__pyx_t_1) {
28473
28474       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":299
28475  *                 public_id = funicode(c_dtd.ExternalID)
28476  *             if not sys_url and c_dtd.SystemID is not NULL:
28477  *                 sys_url = funicode(c_dtd.SystemID)             # <<<<<<<<<<<<<<
28478  *         c_root_node = tree.xmlDocGetRootElement(self._c_doc)
28479  *         if c_root_node is NULL:
28480  */
28481       __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_dtd->SystemID); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28482       __Pyx_GOTREF(__pyx_t_2);
28483       __Pyx_DECREF(__pyx_v_sys_url);
28484       __pyx_v_sys_url = __pyx_t_2;
28485       __pyx_t_2 = 0;
28486       goto __pyx_L8;
28487     }
28488     __pyx_L8:;
28489     goto __pyx_L6;
28490   }
28491   __pyx_L6:;
28492
28493   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":300
28494  *             if not sys_url and c_dtd.SystemID is not NULL:
28495  *                 sys_url = funicode(c_dtd.SystemID)
28496  *         c_root_node = tree.xmlDocGetRootElement(self._c_doc)             # <<<<<<<<<<<<<<
28497  *         if c_root_node is NULL:
28498  *             root_name = None
28499  */
28500   __pyx_v_c_root_node = xmlDocGetRootElement(__pyx_v_self->_c_doc);
28501
28502   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":301
28503  *                 sys_url = funicode(c_dtd.SystemID)
28504  *         c_root_node = tree.xmlDocGetRootElement(self._c_doc)
28505  *         if c_root_node is NULL:             # <<<<<<<<<<<<<<
28506  *             root_name = None
28507  *         else:
28508  */
28509   __pyx_t_1 = (__pyx_v_c_root_node == NULL);
28510   if (__pyx_t_1) {
28511
28512     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":302
28513  *         c_root_node = tree.xmlDocGetRootElement(self._c_doc)
28514  *         if c_root_node is NULL:
28515  *             root_name = None             # <<<<<<<<<<<<<<
28516  *         else:
28517  *             root_name = funicode(c_root_node.name)
28518  */
28519     __Pyx_INCREF(Py_None);
28520     __Pyx_DECREF(__pyx_v_root_name);
28521     __pyx_v_root_name = Py_None;
28522     goto __pyx_L9;
28523   }
28524   /*else*/ {
28525
28526     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":304
28527  *             root_name = None
28528  *         else:
28529  *             root_name = funicode(c_root_node.name)             # <<<<<<<<<<<<<<
28530  *         return (root_name, public_id, sys_url)
28531  * 
28532  */
28533     __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_root_node->name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28534     __Pyx_GOTREF(__pyx_t_2);
28535     __Pyx_DECREF(__pyx_v_root_name);
28536     __pyx_v_root_name = __pyx_t_2;
28537     __pyx_t_2 = 0;
28538   }
28539   __pyx_L9:;
28540
28541   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":305
28542  *         else:
28543  *             root_name = funicode(c_root_node.name)
28544  *         return (root_name, public_id, sys_url)             # <<<<<<<<<<<<<<
28545  * 
28546  *     cdef getxmlinfo(self):
28547  */
28548   __Pyx_XDECREF(__pyx_r);
28549   __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28550   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
28551   __Pyx_INCREF(__pyx_v_root_name);
28552   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_root_name);
28553   __Pyx_GIVEREF(__pyx_v_root_name);
28554   __Pyx_INCREF(__pyx_v_public_id);
28555   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_public_id);
28556   __Pyx_GIVEREF(__pyx_v_public_id);
28557   __Pyx_INCREF(__pyx_v_sys_url);
28558   PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_sys_url);
28559   __Pyx_GIVEREF(__pyx_v_sys_url);
28560   __pyx_r = ((PyObject *)__pyx_t_2);
28561   __pyx_t_2 = 0;
28562   goto __pyx_L0;
28563
28564   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
28565   goto __pyx_L0;
28566   __pyx_L1_error:;
28567   __Pyx_XDECREF(__pyx_t_2);
28568   __Pyx_AddTraceback("lxml.etree._Document.getdoctype");
28569   __pyx_r = 0;
28570   __pyx_L0:;
28571   __Pyx_DECREF(__pyx_v_public_id);
28572   __Pyx_DECREF(__pyx_v_sys_url);
28573   __Pyx_DECREF(__pyx_v_root_name);
28574   __Pyx_XGIVEREF(__pyx_r);
28575   __Pyx_FinishRefcountContext();
28576   return __pyx_r;
28577 }
28578
28579 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":307
28580  *         return (root_name, public_id, sys_url)
28581  * 
28582  *     cdef getxmlinfo(self):             # <<<<<<<<<<<<<<
28583  *         cdef xmlDoc* c_doc
28584  *         c_doc = self._c_doc
28585  */
28586
28587 static  PyObject *__pyx_f_4lxml_5etree_9_Document_getxmlinfo(struct LxmlDocument *__pyx_v_self) {
28588   xmlDoc *__pyx_v_c_doc;
28589   PyObject *__pyx_v_version;
28590   PyObject *__pyx_v_encoding;
28591   PyObject *__pyx_r = NULL;
28592   int __pyx_t_1;
28593   PyObject *__pyx_t_2 = NULL;
28594   __Pyx_SetupRefcountContext("getxmlinfo");
28595   __pyx_v_version = Py_None; __Pyx_INCREF(Py_None);
28596   __pyx_v_encoding = Py_None; __Pyx_INCREF(Py_None);
28597
28598   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":309
28599  *     cdef getxmlinfo(self):
28600  *         cdef xmlDoc* c_doc
28601  *         c_doc = self._c_doc             # <<<<<<<<<<<<<<
28602  *         if c_doc.version is NULL:
28603  *             version = None
28604  */
28605   __pyx_v_c_doc = __pyx_v_self->_c_doc;
28606
28607   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":310
28608  *         cdef xmlDoc* c_doc
28609  *         c_doc = self._c_doc
28610  *         if c_doc.version is NULL:             # <<<<<<<<<<<<<<
28611  *             version = None
28612  *         else:
28613  */
28614   __pyx_t_1 = (__pyx_v_c_doc->version == NULL);
28615   if (__pyx_t_1) {
28616
28617     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":311
28618  *         c_doc = self._c_doc
28619  *         if c_doc.version is NULL:
28620  *             version = None             # <<<<<<<<<<<<<<
28621  *         else:
28622  *             version = funicode(c_doc.version)
28623  */
28624     __Pyx_INCREF(Py_None);
28625     __Pyx_DECREF(__pyx_v_version);
28626     __pyx_v_version = Py_None;
28627     goto __pyx_L3;
28628   }
28629   /*else*/ {
28630
28631     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":313
28632  *             version = None
28633  *         else:
28634  *             version = funicode(c_doc.version)             # <<<<<<<<<<<<<<
28635  *         if c_doc.encoding is NULL:
28636  *             encoding = None
28637  */
28638     __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_doc->version); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28639     __Pyx_GOTREF(__pyx_t_2);
28640     __Pyx_DECREF(__pyx_v_version);
28641     __pyx_v_version = __pyx_t_2;
28642     __pyx_t_2 = 0;
28643   }
28644   __pyx_L3:;
28645
28646   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":314
28647  *         else:
28648  *             version = funicode(c_doc.version)
28649  *         if c_doc.encoding is NULL:             # <<<<<<<<<<<<<<
28650  *             encoding = None
28651  *         else:
28652  */
28653   __pyx_t_1 = (__pyx_v_c_doc->encoding == NULL);
28654   if (__pyx_t_1) {
28655
28656     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":315
28657  *             version = funicode(c_doc.version)
28658  *         if c_doc.encoding is NULL:
28659  *             encoding = None             # <<<<<<<<<<<<<<
28660  *         else:
28661  *             encoding = funicode(c_doc.encoding)
28662  */
28663     __Pyx_INCREF(Py_None);
28664     __Pyx_DECREF(__pyx_v_encoding);
28665     __pyx_v_encoding = Py_None;
28666     goto __pyx_L4;
28667   }
28668   /*else*/ {
28669
28670     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":317
28671  *             encoding = None
28672  *         else:
28673  *             encoding = funicode(c_doc.encoding)             # <<<<<<<<<<<<<<
28674  *         return (version, encoding)
28675  * 
28676  */
28677     __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_doc->encoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28678     __Pyx_GOTREF(__pyx_t_2);
28679     __Pyx_DECREF(__pyx_v_encoding);
28680     __pyx_v_encoding = __pyx_t_2;
28681     __pyx_t_2 = 0;
28682   }
28683   __pyx_L4:;
28684
28685   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":318
28686  *         else:
28687  *             encoding = funicode(c_doc.encoding)
28688  *         return (version, encoding)             # <<<<<<<<<<<<<<
28689  * 
28690  *     cdef isstandalone(self):
28691  */
28692   __Pyx_XDECREF(__pyx_r);
28693   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28694   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
28695   __Pyx_INCREF(__pyx_v_version);
28696   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_version);
28697   __Pyx_GIVEREF(__pyx_v_version);
28698   __Pyx_INCREF(__pyx_v_encoding);
28699   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_encoding);
28700   __Pyx_GIVEREF(__pyx_v_encoding);
28701   __pyx_r = ((PyObject *)__pyx_t_2);
28702   __pyx_t_2 = 0;
28703   goto __pyx_L0;
28704
28705   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
28706   goto __pyx_L0;
28707   __pyx_L1_error:;
28708   __Pyx_XDECREF(__pyx_t_2);
28709   __Pyx_AddTraceback("lxml.etree._Document.getxmlinfo");
28710   __pyx_r = 0;
28711   __pyx_L0:;
28712   __Pyx_DECREF(__pyx_v_version);
28713   __Pyx_DECREF(__pyx_v_encoding);
28714   __Pyx_XGIVEREF(__pyx_r);
28715   __Pyx_FinishRefcountContext();
28716   return __pyx_r;
28717 }
28718
28719 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":320
28720  *         return (version, encoding)
28721  * 
28722  *     cdef isstandalone(self):             # <<<<<<<<<<<<<<
28723  *         if self._c_doc.standalone == -1:
28724  *             return None
28725  */
28726
28727 static  PyObject *__pyx_f_4lxml_5etree_9_Document_isstandalone(struct LxmlDocument *__pyx_v_self) {
28728   PyObject *__pyx_r = NULL;
28729   int __pyx_t_1;
28730   PyObject *__pyx_t_2 = NULL;
28731   __Pyx_SetupRefcountContext("isstandalone");
28732
28733   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":321
28734  * 
28735  *     cdef isstandalone(self):
28736  *         if self._c_doc.standalone == -1:             # <<<<<<<<<<<<<<
28737  *             return None
28738  *         else:
28739  */
28740   __pyx_t_1 = (__pyx_v_self->_c_doc->standalone == -1);
28741   if (__pyx_t_1) {
28742
28743     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":322
28744  *     cdef isstandalone(self):
28745  *         if self._c_doc.standalone == -1:
28746  *             return None             # <<<<<<<<<<<<<<
28747  *         else:
28748  *             return <bint>(self._c_doc.standalone == 1)
28749  */
28750     __Pyx_XDECREF(__pyx_r);
28751     __Pyx_INCREF(Py_None);
28752     __pyx_r = Py_None;
28753     goto __pyx_L0;
28754     goto __pyx_L3;
28755   }
28756   /*else*/ {
28757
28758     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":324
28759  *             return None
28760  *         else:
28761  *             return <bint>(self._c_doc.standalone == 1)             # <<<<<<<<<<<<<<
28762  * 
28763  *     cdef buildNewPrefix(self):
28764  */
28765     __Pyx_XDECREF(__pyx_r);
28766     __pyx_t_2 = __Pyx_PyBool_FromLong(((int)(__pyx_v_self->_c_doc->standalone == 1))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28767     __Pyx_GOTREF(__pyx_t_2);
28768     __pyx_r = __pyx_t_2;
28769     __pyx_t_2 = 0;
28770     goto __pyx_L0;
28771   }
28772   __pyx_L3:;
28773
28774   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
28775   goto __pyx_L0;
28776   __pyx_L1_error:;
28777   __Pyx_XDECREF(__pyx_t_2);
28778   __Pyx_AddTraceback("lxml.etree._Document.isstandalone");
28779   __pyx_r = 0;
28780   __pyx_L0:;
28781   __Pyx_XGIVEREF(__pyx_r);
28782   __Pyx_FinishRefcountContext();
28783   return __pyx_r;
28784 }
28785
28786 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":326
28787  *             return <bint>(self._c_doc.standalone == 1)
28788  * 
28789  *     cdef buildNewPrefix(self):             # <<<<<<<<<<<<<<
28790  *         if self._ns_counter < python.PyTuple_GET_SIZE(_PREFIX_CACHE):
28791  *             ns = python.PyTuple_GET_ITEM(_PREFIX_CACHE, self._ns_counter)
28792  */
28793
28794 static  PyObject *__pyx_f_4lxml_5etree_9_Document_buildNewPrefix(struct LxmlDocument *__pyx_v_self) {
28795   PyObject *__pyx_v_ns;
28796   PyObject *__pyx_r = NULL;
28797   PyObject *__pyx_1 = 0;
28798   int __pyx_t_1;
28799   PyObject *__pyx_t_2 = NULL;
28800   __Pyx_SetupRefcountContext("buildNewPrefix");
28801   __pyx_v_ns = Py_None; __Pyx_INCREF(Py_None);
28802
28803   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":327
28804  * 
28805  *     cdef buildNewPrefix(self):
28806  *         if self._ns_counter < python.PyTuple_GET_SIZE(_PREFIX_CACHE):             # <<<<<<<<<<<<<<
28807  *             ns = python.PyTuple_GET_ITEM(_PREFIX_CACHE, self._ns_counter)
28808  *             python.Py_INCREF(ns)
28809  */
28810   __pyx_t_1 = (__pyx_v_self->_ns_counter < PyTuple_GET_SIZE(__pyx_v_4lxml_5etree__PREFIX_CACHE));
28811   if (__pyx_t_1) {
28812
28813     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":328
28814  *     cdef buildNewPrefix(self):
28815  *         if self._ns_counter < python.PyTuple_GET_SIZE(_PREFIX_CACHE):
28816  *             ns = python.PyTuple_GET_ITEM(_PREFIX_CACHE, self._ns_counter)             # <<<<<<<<<<<<<<
28817  *             python.Py_INCREF(ns)
28818  *         else:
28819  */
28820     __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_4lxml_5etree__PREFIX_CACHE, __pyx_v_self->_ns_counter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28821     __Pyx_GOTREF(__pyx_t_2);
28822     __Pyx_DECREF(__pyx_v_ns);
28823     __pyx_v_ns = __pyx_t_2;
28824     __pyx_t_2 = 0;
28825
28826     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":329
28827  *         if self._ns_counter < python.PyTuple_GET_SIZE(_PREFIX_CACHE):
28828  *             ns = python.PyTuple_GET_ITEM(_PREFIX_CACHE, self._ns_counter)
28829  *             python.Py_INCREF(ns)             # <<<<<<<<<<<<<<
28830  *         else:
28831  *             ns = python.PyString_FromFormat("ns%d", self._ns_counter)
28832  */
28833     Py_INCREF(__pyx_v_ns);
28834     goto __pyx_L3;
28835   }
28836   /*else*/ {
28837
28838     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":331
28839  *             python.Py_INCREF(ns)
28840  *         else:
28841  *             ns = python.PyString_FromFormat("ns%d", self._ns_counter)             # <<<<<<<<<<<<<<
28842  *         if self._prefix_tail is not None:
28843  *             ns += self._prefix_tail
28844  */
28845     __pyx_t_2 = PyString_FromFormat(__pyx_k_303, __pyx_v_self->_ns_counter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28846     __Pyx_GOTREF(__pyx_t_2);
28847     __Pyx_DECREF(__pyx_v_ns);
28848     __pyx_v_ns = __pyx_t_2;
28849     __pyx_t_2 = 0;
28850   }
28851   __pyx_L3:;
28852
28853   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":332
28854  *         else:
28855  *             ns = python.PyString_FromFormat("ns%d", self._ns_counter)
28856  *         if self._prefix_tail is not None:             # <<<<<<<<<<<<<<
28857  *             ns += self._prefix_tail
28858  *         self._ns_counter += 1
28859  */
28860   __pyx_t_1 = (__pyx_v_self->_prefix_tail != Py_None);
28861   if (__pyx_t_1) {
28862
28863     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":333
28864  *             ns = python.PyString_FromFormat("ns%d", self._ns_counter)
28865  *         if self._prefix_tail is not None:
28866  *             ns += self._prefix_tail             # <<<<<<<<<<<<<<
28867  *         self._ns_counter += 1
28868  *         if self._ns_counter < 0:
28869  */
28870     __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_ns, __pyx_v_self->_prefix_tail); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28871     __Pyx_GOTREF(__pyx_1);
28872     __Pyx_DECREF(__pyx_v_ns);
28873     __pyx_v_ns = __pyx_1;
28874     __pyx_1 = 0;
28875     goto __pyx_L4;
28876   }
28877   __pyx_L4:;
28878
28879   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":334
28880  *         if self._prefix_tail is not None:
28881  *             ns += self._prefix_tail
28882  *         self._ns_counter += 1             # <<<<<<<<<<<<<<
28883  *         if self._ns_counter < 0:
28884  *             # overflow!
28885  */
28886   __pyx_v_self->_ns_counter += 1;
28887
28888   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":335
28889  *             ns += self._prefix_tail
28890  *         self._ns_counter += 1
28891  *         if self._ns_counter < 0:             # <<<<<<<<<<<<<<
28892  *             # overflow!
28893  *             self._ns_counter = 0
28894  */
28895   __pyx_t_1 = (__pyx_v_self->_ns_counter < 0);
28896   if (__pyx_t_1) {
28897
28898     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":337
28899  *         if self._ns_counter < 0:
28900  *             # overflow!
28901  *             self._ns_counter = 0             # <<<<<<<<<<<<<<
28902  *             if self._prefix_tail is None:
28903  *                 self._prefix_tail = "A"
28904  */
28905     __pyx_v_self->_ns_counter = 0;
28906
28907     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":338
28908  *             # overflow!
28909  *             self._ns_counter = 0
28910  *             if self._prefix_tail is None:             # <<<<<<<<<<<<<<
28911  *                 self._prefix_tail = "A"
28912  *             else:
28913  */
28914     __pyx_t_1 = (__pyx_v_self->_prefix_tail == Py_None);
28915     if (__pyx_t_1) {
28916
28917       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":339
28918  *             self._ns_counter = 0
28919  *             if self._prefix_tail is None:
28920  *                 self._prefix_tail = "A"             # <<<<<<<<<<<<<<
28921  *             else:
28922  *                 self._prefix_tail += "A"
28923  */
28924       __Pyx_INCREF(__pyx_kp_304);
28925       __Pyx_GIVEREF(__pyx_kp_304);
28926       __Pyx_GOTREF(__pyx_v_self->_prefix_tail);
28927       __Pyx_DECREF(__pyx_v_self->_prefix_tail);
28928       __pyx_v_self->_prefix_tail = __pyx_kp_304;
28929       goto __pyx_L6;
28930     }
28931     /*else*/ {
28932
28933       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":341
28934  *                 self._prefix_tail = "A"
28935  *             else:
28936  *                 self._prefix_tail += "A"             # <<<<<<<<<<<<<<
28937  *         return ns
28938  * 
28939  */
28940       __pyx_1 = PyNumber_InPlaceAdd(__pyx_v_self->_prefix_tail, __pyx_kp_305); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28941       __Pyx_GOTREF(__pyx_1);
28942       __Pyx_GIVEREF(__pyx_1);
28943       __Pyx_GOTREF(__pyx_v_self->_prefix_tail);
28944       __Pyx_DECREF(__pyx_v_self->_prefix_tail);
28945       __pyx_v_self->_prefix_tail = __pyx_1;
28946       __pyx_1 = 0;
28947     }
28948     __pyx_L6:;
28949     goto __pyx_L5;
28950   }
28951   __pyx_L5:;
28952
28953   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":342
28954  *             else:
28955  *                 self._prefix_tail += "A"
28956  *         return ns             # <<<<<<<<<<<<<<
28957  * 
28958  *     cdef xmlNs* _findOrBuildNodeNs(self, xmlNode* c_node,
28959  */
28960   __Pyx_XDECREF(__pyx_r);
28961   __Pyx_INCREF(__pyx_v_ns);
28962   __pyx_r = __pyx_v_ns;
28963   goto __pyx_L0;
28964
28965   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
28966   goto __pyx_L0;
28967   __pyx_L1_error:;
28968   __Pyx_XDECREF(__pyx_1);
28969   __Pyx_XDECREF(__pyx_t_2);
28970   __Pyx_AddTraceback("lxml.etree._Document.buildNewPrefix");
28971   __pyx_r = 0;
28972   __pyx_L0:;
28973   __Pyx_DECREF(__pyx_v_ns);
28974   __Pyx_XGIVEREF(__pyx_r);
28975   __Pyx_FinishRefcountContext();
28976   return __pyx_r;
28977 }
28978
28979 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":344
28980  *         return ns
28981  * 
28982  *     cdef xmlNs* _findOrBuildNodeNs(self, xmlNode* c_node,             # <<<<<<<<<<<<<<
28983  *                                    char* c_href, char* c_prefix) except NULL:
28984  *         u"""Get or create namespace structure for a node.  Reuses the prefix if
28985  */
28986
28987 static  xmlNs *__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocument *__pyx_v_self, xmlNode *__pyx_v_c_node, char *__pyx_v_c_href, char *__pyx_v_c_prefix) {
28988   xmlNs *__pyx_v_c_ns;
28989   PyObject *__pyx_v_dict_result;
28990   PyObject *__pyx_v_prefix;
28991   xmlNs *__pyx_r;
28992   int __pyx_t_1;
28993   PyObject *__pyx_t_2 = NULL;
28994   PyObject *__pyx_t_3 = NULL;
28995   PyObject *__pyx_t_4 = NULL;
28996   __Pyx_SetupRefcountContext("_findOrBuildNodeNs");
28997   __pyx_v_prefix = Py_None; __Pyx_INCREF(Py_None);
28998
28999   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":352
29000  *         cdef xmlNs* c_doc_ns
29001  *         cdef python.PyObject* dict_result
29002  *         if c_node.type != tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
29003  *             assert c_node.type == tree.XML_ELEMENT_NODE, \
29004  *                 u"invalid node type %d, expected %d" % (
29005  */
29006   __pyx_t_1 = (__pyx_v_c_node->type != XML_ELEMENT_NODE);
29007   if (__pyx_t_1) {
29008
29009     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":353
29010  *         cdef python.PyObject* dict_result
29011  *         if c_node.type != tree.XML_ELEMENT_NODE:
29012  *             assert c_node.type == tree.XML_ELEMENT_NODE, \             # <<<<<<<<<<<<<<
29013  *                 u"invalid node type %d, expected %d" % (
29014  *                 c_node.type, tree.XML_ELEMENT_NODE)
29015  */
29016     #ifndef PYREX_WITHOUT_ASSERTIONS
29017     if (unlikely(!(__pyx_v_c_node->type == XML_ELEMENT_NODE))) {
29018
29019       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":355
29020  *             assert c_node.type == tree.XML_ELEMENT_NODE, \
29021  *                 u"invalid node type %d, expected %d" % (
29022  *                 c_node.type, tree.XML_ELEMENT_NODE)             # <<<<<<<<<<<<<<
29023  *         # look for existing ns
29024  *         c_ns = tree.xmlSearchNsByHref(self._c_doc, c_node, c_href)
29025  */
29026       __pyx_t_2 = PyInt_FromLong(__pyx_v_c_node->type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29027       __Pyx_GOTREF(__pyx_t_2);
29028       __pyx_t_3 = PyInt_FromLong(XML_ELEMENT_NODE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29029       __Pyx_GOTREF(__pyx_t_3);
29030       __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29031       __Pyx_GOTREF(((PyObject *)__pyx_t_4));
29032       PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
29033       __Pyx_GIVEREF(__pyx_t_2);
29034       PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
29035       __Pyx_GIVEREF(__pyx_t_3);
29036       __pyx_t_2 = 0;
29037       __pyx_t_3 = 0;
29038       __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_306), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29039       __Pyx_GOTREF(__pyx_t_3);
29040       __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
29041       PyErr_SetObject(PyExc_AssertionError, __pyx_t_3);
29042       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29043       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29044     }
29045     #endif
29046     goto __pyx_L3;
29047   }
29048   __pyx_L3:;
29049
29050   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":357
29051  *                 c_node.type, tree.XML_ELEMENT_NODE)
29052  *         # look for existing ns
29053  *         c_ns = tree.xmlSearchNsByHref(self._c_doc, c_node, c_href)             # <<<<<<<<<<<<<<
29054  *         if c_ns is not NULL:
29055  *             return c_ns
29056  */
29057   __pyx_v_c_ns = xmlSearchNsByHref(__pyx_v_self->_c_doc, __pyx_v_c_node, __pyx_v_c_href);
29058
29059   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":358
29060  *         # look for existing ns
29061  *         c_ns = tree.xmlSearchNsByHref(self._c_doc, c_node, c_href)
29062  *         if c_ns is not NULL:             # <<<<<<<<<<<<<<
29063  *             return c_ns
29064  * 
29065  */
29066   __pyx_t_1 = (__pyx_v_c_ns != NULL);
29067   if (__pyx_t_1) {
29068
29069     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":359
29070  *         c_ns = tree.xmlSearchNsByHref(self._c_doc, c_node, c_href)
29071  *         if c_ns is not NULL:
29072  *             return c_ns             # <<<<<<<<<<<<<<
29073  * 
29074  *         if c_prefix is NULL:
29075  */
29076     __pyx_r = __pyx_v_c_ns;
29077     goto __pyx_L0;
29078     goto __pyx_L4;
29079   }
29080   __pyx_L4:;
29081
29082   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":361
29083  *             return c_ns
29084  * 
29085  *         if c_prefix is NULL:             # <<<<<<<<<<<<<<
29086  *             dict_result = python.PyDict_GetItem(
29087  *                 _DEFAULT_NAMESPACE_PREFIXES, c_href)
29088  */
29089   __pyx_t_1 = (__pyx_v_c_prefix == NULL);
29090   if (__pyx_t_1) {
29091
29092     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":363
29093  *         if c_prefix is NULL:
29094  *             dict_result = python.PyDict_GetItem(
29095  *                 _DEFAULT_NAMESPACE_PREFIXES, c_href)             # <<<<<<<<<<<<<<
29096  *             if dict_result is not NULL:
29097  *                 prefix = <object>dict_result
29098  */
29099     __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_c_href); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29100     __Pyx_GOTREF(__pyx_t_3);
29101     __pyx_v_dict_result = PyDict_GetItem(__pyx_v_4lxml_5etree__DEFAULT_NAMESPACE_PREFIXES, __pyx_t_3);
29102     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29103
29104     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":364
29105  *             dict_result = python.PyDict_GetItem(
29106  *                 _DEFAULT_NAMESPACE_PREFIXES, c_href)
29107  *             if dict_result is not NULL:             # <<<<<<<<<<<<<<
29108  *                 prefix = <object>dict_result
29109  *             else:
29110  */
29111     __pyx_t_1 = (__pyx_v_dict_result != NULL);
29112     if (__pyx_t_1) {
29113
29114       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":365
29115  *                 _DEFAULT_NAMESPACE_PREFIXES, c_href)
29116  *             if dict_result is not NULL:
29117  *                 prefix = <object>dict_result             # <<<<<<<<<<<<<<
29118  *             else:
29119  *                 prefix = self.buildNewPrefix()
29120  */
29121       __Pyx_INCREF(((PyObject *)__pyx_v_dict_result));
29122       __Pyx_DECREF(__pyx_v_prefix);
29123       __pyx_v_prefix = ((PyObject *)__pyx_v_dict_result);
29124       goto __pyx_L6;
29125     }
29126     /*else*/ {
29127
29128       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":367
29129  *                 prefix = <object>dict_result
29130  *             else:
29131  *                 prefix = self.buildNewPrefix()             # <<<<<<<<<<<<<<
29132  *             c_prefix = _cstr(prefix)
29133  * 
29134  */
29135       __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_self->__pyx_vtab)->buildNewPrefix(__pyx_v_self); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29136       __Pyx_GOTREF(__pyx_t_3);
29137       __Pyx_DECREF(__pyx_v_prefix);
29138       __pyx_v_prefix = __pyx_t_3;
29139       __pyx_t_3 = 0;
29140     }
29141     __pyx_L6:;
29142
29143     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":368
29144  *             else:
29145  *                 prefix = self.buildNewPrefix()
29146  *             c_prefix = _cstr(prefix)             # <<<<<<<<<<<<<<
29147  * 
29148  *         # make sure the prefix is not in use already
29149  */
29150     __pyx_v_c_prefix = PyString_AS_STRING(__pyx_v_prefix);
29151     goto __pyx_L5;
29152   }
29153   __pyx_L5:;
29154
29155   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":371
29156  * 
29157  *         # make sure the prefix is not in use already
29158  *         while tree.xmlSearchNs(self._c_doc, c_node, c_prefix) is not NULL:             # <<<<<<<<<<<<<<
29159  *             prefix = self.buildNewPrefix()
29160  *             c_prefix = _cstr(prefix)
29161  */
29162   while (1) {
29163     __pyx_t_1 = (xmlSearchNs(__pyx_v_self->_c_doc, __pyx_v_c_node, __pyx_v_c_prefix) != NULL);
29164     if (!__pyx_t_1) break;
29165
29166     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":372
29167  *         # make sure the prefix is not in use already
29168  *         while tree.xmlSearchNs(self._c_doc, c_node, c_prefix) is not NULL:
29169  *             prefix = self.buildNewPrefix()             # <<<<<<<<<<<<<<
29170  *             c_prefix = _cstr(prefix)
29171  * 
29172  */
29173     __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_self->__pyx_vtab)->buildNewPrefix(__pyx_v_self); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29174     __Pyx_GOTREF(__pyx_t_3);
29175     __Pyx_DECREF(__pyx_v_prefix);
29176     __pyx_v_prefix = __pyx_t_3;
29177     __pyx_t_3 = 0;
29178
29179     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":373
29180  *         while tree.xmlSearchNs(self._c_doc, c_node, c_prefix) is not NULL:
29181  *             prefix = self.buildNewPrefix()
29182  *             c_prefix = _cstr(prefix)             # <<<<<<<<<<<<<<
29183  * 
29184  *         c_ns = tree.xmlNewNs(c_node, c_href, c_prefix)
29185  */
29186     __pyx_v_c_prefix = PyString_AS_STRING(__pyx_v_prefix);
29187   }
29188
29189   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":375
29190  *             c_prefix = _cstr(prefix)
29191  * 
29192  *         c_ns = tree.xmlNewNs(c_node, c_href, c_prefix)             # <<<<<<<<<<<<<<
29193  *         if c_ns is NULL:
29194  *             python.PyErr_NoMemory()
29195  */
29196   __pyx_v_c_ns = xmlNewNs(__pyx_v_c_node, __pyx_v_c_href, __pyx_v_c_prefix);
29197
29198   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":376
29199  * 
29200  *         c_ns = tree.xmlNewNs(c_node, c_href, c_prefix)
29201  *         if c_ns is NULL:             # <<<<<<<<<<<<<<
29202  *             python.PyErr_NoMemory()
29203  *         return c_ns
29204  */
29205   __pyx_t_1 = (__pyx_v_c_ns == NULL);
29206   if (__pyx_t_1) {
29207
29208     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":377
29209  *         c_ns = tree.xmlNewNs(c_node, c_href, c_prefix)
29210  *         if c_ns is NULL:
29211  *             python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
29212  *         return c_ns
29213  * 
29214  */
29215     __pyx_t_3 = PyErr_NoMemory(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29216     __Pyx_GOTREF(__pyx_t_3);
29217     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29218     goto __pyx_L9;
29219   }
29220   __pyx_L9:;
29221
29222   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":378
29223  *         if c_ns is NULL:
29224  *             python.PyErr_NoMemory()
29225  *         return c_ns             # <<<<<<<<<<<<<<
29226  * 
29227  *     cdef int _setNodeNs(self, xmlNode* c_node, char* href) except -1:
29228  */
29229   __pyx_r = __pyx_v_c_ns;
29230   goto __pyx_L0;
29231
29232   __pyx_r = 0;
29233   goto __pyx_L0;
29234   __pyx_L1_error:;
29235   __Pyx_XDECREF(__pyx_t_2);
29236   __Pyx_XDECREF(__pyx_t_3);
29237   __Pyx_XDECREF(__pyx_t_4);
29238   __Pyx_AddTraceback("lxml.etree._Document._findOrBuildNodeNs");
29239   __pyx_r = NULL;
29240   __pyx_L0:;
29241   __Pyx_DECREF(__pyx_v_prefix);
29242   __Pyx_FinishRefcountContext();
29243   return __pyx_r;
29244 }
29245
29246 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":380
29247  *         return c_ns
29248  * 
29249  *     cdef int _setNodeNs(self, xmlNode* c_node, char* href) except -1:             # <<<<<<<<<<<<<<
29250  *         u"Lookup namespace structure and set it for the node."
29251  *         cdef xmlNs* c_ns
29252  */
29253
29254 static  int __pyx_f_4lxml_5etree_9_Document__setNodeNs(struct LxmlDocument *__pyx_v_self, xmlNode *__pyx_v_c_node, char *__pyx_v_href) {
29255   xmlNs *__pyx_v_c_ns;
29256   int __pyx_r;
29257   xmlNs *__pyx_t_1;
29258   __Pyx_SetupRefcountContext("_setNodeNs");
29259
29260   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":383
29261  *         u"Lookup namespace structure and set it for the node."
29262  *         cdef xmlNs* c_ns
29263  *         c_ns = self._findOrBuildNodeNs(c_node, href, NULL)             # <<<<<<<<<<<<<<
29264  *         tree.xmlSetNs(c_node, c_ns)
29265  * 
29266  */
29267   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_self->__pyx_vtab)->_findOrBuildNodeNs(__pyx_v_self, __pyx_v_c_node, __pyx_v_href, NULL); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29268   __pyx_v_c_ns = __pyx_t_1;
29269
29270   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":384
29271  *         cdef xmlNs* c_ns
29272  *         c_ns = self._findOrBuildNodeNs(c_node, href, NULL)
29273  *         tree.xmlSetNs(c_node, c_ns)             # <<<<<<<<<<<<<<
29274  * 
29275  * cdef __initPrefixCache():
29276  */
29277   xmlSetNs(__pyx_v_c_node, __pyx_v_c_ns);
29278
29279   __pyx_r = 0;
29280   goto __pyx_L0;
29281   __pyx_L1_error:;
29282   __Pyx_AddTraceback("lxml.etree._Document._setNodeNs");
29283   __pyx_r = -1;
29284   __pyx_L0:;
29285   __Pyx_FinishRefcountContext();
29286   return __pyx_r;
29287 }
29288
29289 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":386
29290  *         tree.xmlSetNs(c_node, c_ns)
29291  * 
29292  * cdef __initPrefixCache():             # <<<<<<<<<<<<<<
29293  *     cdef int i
29294  *     return tuple([ python.PyString_FromFormat("ns%d", i)
29295  */
29296
29297 static  PyObject *__pyx_f_4lxml_5etree___initPrefixCache(void) {
29298   int __pyx_v_i;
29299   PyObject *__pyx_r = NULL;
29300   PyObject *__pyx_t_1 = NULL;
29301   PyObject *__pyx_t_2 = NULL;
29302   int __pyx_t_3;
29303   __Pyx_SetupRefcountContext("__initPrefixCache");
29304
29305   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":388
29306  * cdef __initPrefixCache():
29307  *     cdef int i
29308  *     return tuple([ python.PyString_FromFormat("ns%d", i)             # <<<<<<<<<<<<<<
29309  *                    for i from 0 <= i < 30 ])
29310  * 
29311  */
29312   __Pyx_XDECREF(__pyx_r);
29313   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29314   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
29315
29316   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":389
29317  *     cdef int i
29318  *     return tuple([ python.PyString_FromFormat("ns%d", i)
29319  *                    for i from 0 <= i < 30 ])             # <<<<<<<<<<<<<<
29320  * 
29321  * cdef object _PREFIX_CACHE
29322  */
29323   for (__pyx_v_i = 0; __pyx_v_i < 30; __pyx_v_i++) {
29324
29325     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":388
29326  * cdef __initPrefixCache():
29327  *     cdef int i
29328  *     return tuple([ python.PyString_FromFormat("ns%d", i)             # <<<<<<<<<<<<<<
29329  *                    for i from 0 <= i < 30 ])
29330  * 
29331  */
29332     __pyx_t_2 = PyString_FromFormat(__pyx_k_307, __pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29333     __Pyx_GOTREF(__pyx_t_2);
29334     __pyx_t_3 = PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_2); if (unlikely(__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29335     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29336   }
29337   __pyx_t_2 = ((PyObject *)PyList_AsTuple(__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29338   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
29339   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
29340   __pyx_r = ((PyObject *)__pyx_t_2);
29341   __pyx_t_2 = 0;
29342   goto __pyx_L0;
29343
29344   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
29345   goto __pyx_L0;
29346   __pyx_L1_error:;
29347   __Pyx_XDECREF(__pyx_t_1);
29348   __Pyx_XDECREF(__pyx_t_2);
29349   __Pyx_AddTraceback("lxml.etree.__initPrefixCache");
29350   __pyx_r = 0;
29351   __pyx_L0:;
29352   __Pyx_XGIVEREF(__pyx_r);
29353   __Pyx_FinishRefcountContext();
29354   return __pyx_r;
29355 }
29356
29357 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":398
29358  *     cdef _Document NEW_DOCUMENT "PY_NEW" (object t)
29359  * 
29360  * cdef _Document _documentFactory(xmlDoc* c_doc, _BaseParser parser):             # <<<<<<<<<<<<<<
29361  *     cdef _Document result
29362  *     result = NEW_DOCUMENT(_Document)
29363  */
29364
29365 static  struct LxmlDocument *__pyx_f_4lxml_5etree__documentFactory(xmlDoc *__pyx_v_c_doc, struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser) {
29366   struct LxmlDocument *__pyx_v_result;
29367   struct LxmlDocument *__pyx_r = NULL;
29368   PyObject *__pyx_t_1 = NULL;
29369   int __pyx_t_2;
29370   __Pyx_SetupRefcountContext("_documentFactory");
29371   __Pyx_INCREF((PyObject *)__pyx_v_parser);
29372   __pyx_v_result = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
29373
29374   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":400
29375  * cdef _Document _documentFactory(xmlDoc* c_doc, _BaseParser parser):
29376  *     cdef _Document result
29377  *     result = NEW_DOCUMENT(_Document)             # <<<<<<<<<<<<<<
29378  *     result._c_doc = c_doc
29379  *     result._ns_counter = 0
29380  */
29381   __pyx_t_1 = ((PyObject *)PY_NEW(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Document)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29382   __Pyx_GOTREF(__pyx_t_1);
29383   __Pyx_DECREF(((PyObject *)__pyx_v_result));
29384   __pyx_v_result = ((struct LxmlDocument *)__pyx_t_1);
29385   __pyx_t_1 = 0;
29386
29387   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":401
29388  *     cdef _Document result
29389  *     result = NEW_DOCUMENT(_Document)
29390  *     result._c_doc = c_doc             # <<<<<<<<<<<<<<
29391  *     result._ns_counter = 0
29392  *     result._prefix_tail = None
29393  */
29394   __pyx_v_result->_c_doc = __pyx_v_c_doc;
29395
29396   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":402
29397  *     result = NEW_DOCUMENT(_Document)
29398  *     result._c_doc = c_doc
29399  *     result._ns_counter = 0             # <<<<<<<<<<<<<<
29400  *     result._prefix_tail = None
29401  *     if parser is None:
29402  */
29403   __pyx_v_result->_ns_counter = 0;
29404
29405   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":403
29406  *     result._c_doc = c_doc
29407  *     result._ns_counter = 0
29408  *     result._prefix_tail = None             # <<<<<<<<<<<<<<
29409  *     if parser is None:
29410  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
29411  */
29412   __Pyx_INCREF(Py_None);
29413   __Pyx_GIVEREF(Py_None);
29414   __Pyx_GOTREF(__pyx_v_result->_prefix_tail);
29415   __Pyx_DECREF(__pyx_v_result->_prefix_tail);
29416   __pyx_v_result->_prefix_tail = Py_None;
29417
29418   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":404
29419  *     result._ns_counter = 0
29420  *     result._prefix_tail = None
29421  *     if parser is None:             # <<<<<<<<<<<<<<
29422  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
29423  *     result._parser = parser
29424  */
29425   __pyx_t_2 = (((PyObject *)__pyx_v_parser) == Py_None);
29426   if (__pyx_t_2) {
29427
29428     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":405
29429  *     result._prefix_tail = None
29430  *     if parser is None:
29431  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()             # <<<<<<<<<<<<<<
29432  *     result._parser = parser
29433  *     return result
29434  */
29435     __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->getDefaultParser(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29436     __Pyx_GOTREF(__pyx_t_1);
29437     __Pyx_DECREF(((PyObject *)__pyx_v_parser));
29438     __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_1);
29439     __pyx_t_1 = 0;
29440     goto __pyx_L3;
29441   }
29442   __pyx_L3:;
29443
29444   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":406
29445  *     if parser is None:
29446  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
29447  *     result._parser = parser             # <<<<<<<<<<<<<<
29448  *     return result
29449  * 
29450  */
29451   __Pyx_INCREF(((PyObject *)__pyx_v_parser));
29452   __Pyx_GIVEREF(((PyObject *)__pyx_v_parser));
29453   __Pyx_GOTREF(__pyx_v_result->_parser);
29454   __Pyx_DECREF(((PyObject *)__pyx_v_result->_parser));
29455   __pyx_v_result->_parser = __pyx_v_parser;
29456
29457   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":407
29458  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
29459  *     result._parser = parser
29460  *     return result             # <<<<<<<<<<<<<<
29461  * 
29462  * 
29463  */
29464   __Pyx_XDECREF(((PyObject *)__pyx_r));
29465   __Pyx_INCREF(((PyObject *)__pyx_v_result));
29466   __pyx_r = __pyx_v_result;
29467   goto __pyx_L0;
29468
29469   __pyx_r = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
29470   goto __pyx_L0;
29471   __pyx_L1_error:;
29472   __Pyx_XDECREF(__pyx_t_1);
29473   __Pyx_AddTraceback("lxml.etree._documentFactory");
29474   __pyx_r = 0;
29475   __pyx_L0:;
29476   __Pyx_DECREF((PyObject *)__pyx_v_result);
29477   __Pyx_DECREF((PyObject *)__pyx_v_parser);
29478   __Pyx_XGIVEREF((PyObject *)__pyx_r);
29479   __Pyx_FinishRefcountContext();
29480   return __pyx_r;
29481 }
29482
29483 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":413
29484  *     u"Document information provided by parser and DTD."
29485  *     cdef _Document _doc
29486  *     def __init__(self, tree):             # <<<<<<<<<<<<<<
29487  *         u"Create a DocInfo object for an ElementTree object or root Element."
29488  *         self._doc = _documentOrRaise(tree)
29489  */
29490
29491 static int __pyx_pf_4lxml_5etree_7DocInfo___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
29492 static char __pyx_doc_4lxml_5etree_7DocInfo___init__[] = "Create a DocInfo object for an ElementTree object or root Element.";
29493 static int __pyx_pf_4lxml_5etree_7DocInfo___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
29494   PyObject *__pyx_v_tree = 0;
29495   PyObject *__pyx_v_root_name;
29496   PyObject *__pyx_v_public_id;
29497   PyObject *__pyx_v_system_url;
29498   int __pyx_r;
29499   PyObject *__pyx_1 = 0;
29500   PyObject *__pyx_2 = 0;
29501   PyObject *__pyx_3 = 0;
29502   PyObject *__pyx_4 = 0;
29503   PyObject *__pyx_t_1 = NULL;
29504   int __pyx_t_2;
29505   int __pyx_t_3;
29506   int __pyx_t_4;
29507   int __pyx_t_5;
29508   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_tree,0};
29509   __Pyx_SetupRefcountContext("__init__");
29510   if (unlikely(__pyx_kwds)) {
29511     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
29512     PyObject* values[1] = {0};
29513     switch (PyTuple_GET_SIZE(__pyx_args)) {
29514       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
29515       case  0: break;
29516       default: goto __pyx_L5_argtuple_error;
29517     }
29518     switch (PyTuple_GET_SIZE(__pyx_args)) {
29519       case  0:
29520       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_tree);
29521       if (likely(values[0])) kw_args--;
29522       else goto __pyx_L5_argtuple_error;
29523     }
29524     if (unlikely(kw_args > 0)) {
29525       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
29526     }
29527     __pyx_v_tree = values[0];
29528   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
29529     goto __pyx_L5_argtuple_error;
29530   } else {
29531     __pyx_v_tree = PyTuple_GET_ITEM(__pyx_args, 0);
29532   }
29533   goto __pyx_L4_argument_unpacking_done;
29534   __pyx_L5_argtuple_error:;
29535   __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
29536   __pyx_L3_error:;
29537   __Pyx_AddTraceback("lxml.etree.DocInfo.__init__");
29538   return -1;
29539   __pyx_L4_argument_unpacking_done:;
29540   __pyx_v_root_name = Py_None; __Pyx_INCREF(Py_None);
29541   __pyx_v_public_id = Py_None; __Pyx_INCREF(Py_None);
29542   __pyx_v_system_url = Py_None; __Pyx_INCREF(Py_None);
29543
29544   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":415
29545  *     def __init__(self, tree):
29546  *         u"Create a DocInfo object for an ElementTree object or root Element."
29547  *         self._doc = _documentOrRaise(tree)             # <<<<<<<<<<<<<<
29548  *         root_name, public_id, system_url = self._doc.getdoctype()
29549  *         if not root_name and (public_id or system_url):
29550  */
29551   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v_tree)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29552   __Pyx_GOTREF(__pyx_t_1);
29553   __Pyx_GIVEREF(__pyx_t_1);
29554   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc);
29555   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc));
29556   ((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc = ((struct LxmlDocument *)__pyx_t_1);
29557   __pyx_t_1 = 0;
29558
29559   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":416
29560  *         u"Create a DocInfo object for an ElementTree object or root Element."
29561  *         self._doc = _documentOrRaise(tree)
29562  *         root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<<
29563  *         if not root_name and (public_id or system_url):
29564  *             raise ValueError, u"Could not find root node"
29565  */
29566   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc->__pyx_vtab)->getdoctype(((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29567   __Pyx_GOTREF(__pyx_t_1);
29568   if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 3)) {
29569     PyObject* tuple = __pyx_t_1;
29570     __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
29571     __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
29572     __pyx_4 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_4);
29573     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29574     __Pyx_DECREF(__pyx_v_root_name);
29575     __pyx_v_root_name = __pyx_2;
29576     __pyx_2 = 0;
29577     __Pyx_DECREF(__pyx_v_public_id);
29578     __pyx_v_public_id = __pyx_3;
29579     __pyx_3 = 0;
29580     __Pyx_DECREF(__pyx_v_system_url);
29581     __pyx_v_system_url = __pyx_4;
29582     __pyx_4 = 0;
29583   } else {
29584     __pyx_1 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29585     __Pyx_GOTREF(__pyx_1);
29586     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29587     __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29588     __Pyx_GOTREF(__pyx_2);
29589     __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29590     __Pyx_GOTREF(__pyx_3);
29591     __pyx_4 = __Pyx_UnpackItem(__pyx_1, 2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29592     __Pyx_GOTREF(__pyx_4);
29593     if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29594     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
29595     __Pyx_DECREF(__pyx_v_root_name);
29596     __pyx_v_root_name = __pyx_2;
29597     __pyx_2 = 0;
29598     __Pyx_DECREF(__pyx_v_public_id);
29599     __pyx_v_public_id = __pyx_3;
29600     __pyx_3 = 0;
29601     __Pyx_DECREF(__pyx_v_system_url);
29602     __pyx_v_system_url = __pyx_4;
29603     __pyx_4 = 0;
29604   }
29605
29606   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":417
29607  *         self._doc = _documentOrRaise(tree)
29608  *         root_name, public_id, system_url = self._doc.getdoctype()
29609  *         if not root_name and (public_id or system_url):             # <<<<<<<<<<<<<<
29610  *             raise ValueError, u"Could not find root node"
29611  * 
29612  */
29613   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_root_name); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29614   __pyx_t_3 = (!__pyx_t_2);
29615   if (__pyx_t_3) {
29616     __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_public_id); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29617     if (!__pyx_t_2) {
29618       __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_system_url); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29619       __pyx_t_5 = __pyx_t_4;
29620     } else {
29621       __pyx_t_5 = __pyx_t_2;
29622     }
29623     __pyx_t_2 = __pyx_t_5;
29624   } else {
29625     __pyx_t_2 = __pyx_t_3;
29626   }
29627   if (__pyx_t_2) {
29628
29629     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":418
29630  *         root_name, public_id, system_url = self._doc.getdoctype()
29631  *         if not root_name and (public_id or system_url):
29632  *             raise ValueError, u"Could not find root node"             # <<<<<<<<<<<<<<
29633  * 
29634  *     property root_name:
29635  */
29636     __Pyx_Raise(__pyx_builtin_ValueError, ((PyObject *)__pyx_kp_308), 0);
29637     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29638     goto __pyx_L6;
29639   }
29640   __pyx_L6:;
29641
29642   __pyx_r = 0;
29643   goto __pyx_L0;
29644   __pyx_L1_error:;
29645   __Pyx_XDECREF(__pyx_1);
29646   __Pyx_XDECREF(__pyx_2);
29647   __Pyx_XDECREF(__pyx_3);
29648   __Pyx_XDECREF(__pyx_4);
29649   __Pyx_XDECREF(__pyx_t_1);
29650   __Pyx_AddTraceback("lxml.etree.DocInfo.__init__");
29651   __pyx_r = -1;
29652   __pyx_L0:;
29653   __Pyx_DECREF(__pyx_v_root_name);
29654   __Pyx_DECREF(__pyx_v_public_id);
29655   __Pyx_DECREF(__pyx_v_system_url);
29656   __Pyx_FinishRefcountContext();
29657   return __pyx_r;
29658 }
29659
29660 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":422
29661  *     property root_name:
29662  *         u"Returns the name of the root node as defined by the DOCTYPE."
29663  *         def __get__(self):             # <<<<<<<<<<<<<<
29664  *             root_name, public_id, system_url = self._doc.getdoctype()
29665  *             return root_name
29666  */
29667
29668 static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_9root_name___get__(PyObject *__pyx_v_self); /*proto*/
29669 static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_9root_name___get__(PyObject *__pyx_v_self) {
29670   PyObject *__pyx_v_root_name;
29671   PyObject *__pyx_v_public_id;
29672   PyObject *__pyx_v_system_url;
29673   PyObject *__pyx_r = NULL;
29674   PyObject *__pyx_1 = 0;
29675   PyObject *__pyx_2 = 0;
29676   PyObject *__pyx_3 = 0;
29677   PyObject *__pyx_4 = 0;
29678   PyObject *__pyx_t_1 = NULL;
29679   __Pyx_SetupRefcountContext("__get__");
29680   __pyx_v_root_name = Py_None; __Pyx_INCREF(Py_None);
29681   __pyx_v_public_id = Py_None; __Pyx_INCREF(Py_None);
29682   __pyx_v_system_url = Py_None; __Pyx_INCREF(Py_None);
29683
29684   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":423
29685  *         u"Returns the name of the root node as defined by the DOCTYPE."
29686  *         def __get__(self):
29687  *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<<
29688  *             return root_name
29689  * 
29690  */
29691   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc->__pyx_vtab)->getdoctype(((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29692   __Pyx_GOTREF(__pyx_t_1);
29693   if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 3)) {
29694     PyObject* tuple = __pyx_t_1;
29695     __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
29696     __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
29697     __pyx_4 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_4);
29698     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29699     __Pyx_DECREF(__pyx_v_root_name);
29700     __pyx_v_root_name = __pyx_2;
29701     __pyx_2 = 0;
29702     __Pyx_DECREF(__pyx_v_public_id);
29703     __pyx_v_public_id = __pyx_3;
29704     __pyx_3 = 0;
29705     __Pyx_DECREF(__pyx_v_system_url);
29706     __pyx_v_system_url = __pyx_4;
29707     __pyx_4 = 0;
29708   } else {
29709     __pyx_1 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29710     __Pyx_GOTREF(__pyx_1);
29711     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29712     __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29713     __Pyx_GOTREF(__pyx_2);
29714     __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29715     __Pyx_GOTREF(__pyx_3);
29716     __pyx_4 = __Pyx_UnpackItem(__pyx_1, 2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29717     __Pyx_GOTREF(__pyx_4);
29718     if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29719     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
29720     __Pyx_DECREF(__pyx_v_root_name);
29721     __pyx_v_root_name = __pyx_2;
29722     __pyx_2 = 0;
29723     __Pyx_DECREF(__pyx_v_public_id);
29724     __pyx_v_public_id = __pyx_3;
29725     __pyx_3 = 0;
29726     __Pyx_DECREF(__pyx_v_system_url);
29727     __pyx_v_system_url = __pyx_4;
29728     __pyx_4 = 0;
29729   }
29730
29731   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":424
29732  *         def __get__(self):
29733  *             root_name, public_id, system_url = self._doc.getdoctype()
29734  *             return root_name             # <<<<<<<<<<<<<<
29735  * 
29736  *     property public_id:
29737  */
29738   __Pyx_XDECREF(__pyx_r);
29739   __Pyx_INCREF(__pyx_v_root_name);
29740   __pyx_r = __pyx_v_root_name;
29741   goto __pyx_L0;
29742
29743   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
29744   goto __pyx_L0;
29745   __pyx_L1_error:;
29746   __Pyx_XDECREF(__pyx_1);
29747   __Pyx_XDECREF(__pyx_2);
29748   __Pyx_XDECREF(__pyx_3);
29749   __Pyx_XDECREF(__pyx_4);
29750   __Pyx_XDECREF(__pyx_t_1);
29751   __Pyx_AddTraceback("lxml.etree.DocInfo.root_name.__get__");
29752   __pyx_r = NULL;
29753   __pyx_L0:;
29754   __Pyx_DECREF(__pyx_v_root_name);
29755   __Pyx_DECREF(__pyx_v_public_id);
29756   __Pyx_DECREF(__pyx_v_system_url);
29757   __Pyx_XGIVEREF(__pyx_r);
29758   __Pyx_FinishRefcountContext();
29759   return __pyx_r;
29760 }
29761
29762 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":428
29763  *     property public_id:
29764  *         u"Returns the public ID of the DOCTYPE."
29765  *         def __get__(self):             # <<<<<<<<<<<<<<
29766  *             root_name, public_id, system_url = self._doc.getdoctype()
29767  *             return public_id
29768  */
29769
29770 static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_9public_id___get__(PyObject *__pyx_v_self); /*proto*/
29771 static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_9public_id___get__(PyObject *__pyx_v_self) {
29772   PyObject *__pyx_v_root_name;
29773   PyObject *__pyx_v_public_id;
29774   PyObject *__pyx_v_system_url;
29775   PyObject *__pyx_r = NULL;
29776   PyObject *__pyx_1 = 0;
29777   PyObject *__pyx_2 = 0;
29778   PyObject *__pyx_3 = 0;
29779   PyObject *__pyx_4 = 0;
29780   PyObject *__pyx_t_1 = NULL;
29781   __Pyx_SetupRefcountContext("__get__");
29782   __pyx_v_root_name = Py_None; __Pyx_INCREF(Py_None);
29783   __pyx_v_public_id = Py_None; __Pyx_INCREF(Py_None);
29784   __pyx_v_system_url = Py_None; __Pyx_INCREF(Py_None);
29785
29786   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":429
29787  *         u"Returns the public ID of the DOCTYPE."
29788  *         def __get__(self):
29789  *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<<
29790  *             return public_id
29791  * 
29792  */
29793   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc->__pyx_vtab)->getdoctype(((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29794   __Pyx_GOTREF(__pyx_t_1);
29795   if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 3)) {
29796     PyObject* tuple = __pyx_t_1;
29797     __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
29798     __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
29799     __pyx_4 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_4);
29800     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29801     __Pyx_DECREF(__pyx_v_root_name);
29802     __pyx_v_root_name = __pyx_2;
29803     __pyx_2 = 0;
29804     __Pyx_DECREF(__pyx_v_public_id);
29805     __pyx_v_public_id = __pyx_3;
29806     __pyx_3 = 0;
29807     __Pyx_DECREF(__pyx_v_system_url);
29808     __pyx_v_system_url = __pyx_4;
29809     __pyx_4 = 0;
29810   } else {
29811     __pyx_1 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29812     __Pyx_GOTREF(__pyx_1);
29813     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29814     __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29815     __Pyx_GOTREF(__pyx_2);
29816     __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29817     __Pyx_GOTREF(__pyx_3);
29818     __pyx_4 = __Pyx_UnpackItem(__pyx_1, 2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29819     __Pyx_GOTREF(__pyx_4);
29820     if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29821     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
29822     __Pyx_DECREF(__pyx_v_root_name);
29823     __pyx_v_root_name = __pyx_2;
29824     __pyx_2 = 0;
29825     __Pyx_DECREF(__pyx_v_public_id);
29826     __pyx_v_public_id = __pyx_3;
29827     __pyx_3 = 0;
29828     __Pyx_DECREF(__pyx_v_system_url);
29829     __pyx_v_system_url = __pyx_4;
29830     __pyx_4 = 0;
29831   }
29832
29833   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":430
29834  *         def __get__(self):
29835  *             root_name, public_id, system_url = self._doc.getdoctype()
29836  *             return public_id             # <<<<<<<<<<<<<<
29837  * 
29838  *     property system_url:
29839  */
29840   __Pyx_XDECREF(__pyx_r);
29841   __Pyx_INCREF(__pyx_v_public_id);
29842   __pyx_r = __pyx_v_public_id;
29843   goto __pyx_L0;
29844
29845   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
29846   goto __pyx_L0;
29847   __pyx_L1_error:;
29848   __Pyx_XDECREF(__pyx_1);
29849   __Pyx_XDECREF(__pyx_2);
29850   __Pyx_XDECREF(__pyx_3);
29851   __Pyx_XDECREF(__pyx_4);
29852   __Pyx_XDECREF(__pyx_t_1);
29853   __Pyx_AddTraceback("lxml.etree.DocInfo.public_id.__get__");
29854   __pyx_r = NULL;
29855   __pyx_L0:;
29856   __Pyx_DECREF(__pyx_v_root_name);
29857   __Pyx_DECREF(__pyx_v_public_id);
29858   __Pyx_DECREF(__pyx_v_system_url);
29859   __Pyx_XGIVEREF(__pyx_r);
29860   __Pyx_FinishRefcountContext();
29861   return __pyx_r;
29862 }
29863
29864 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":434
29865  *     property system_url:
29866  *         u"Returns the system ID of the DOCTYPE."
29867  *         def __get__(self):             # <<<<<<<<<<<<<<
29868  *             root_name, public_id, system_url = self._doc.getdoctype()
29869  *             return system_url
29870  */
29871
29872 static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_10system_url___get__(PyObject *__pyx_v_self); /*proto*/
29873 static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_10system_url___get__(PyObject *__pyx_v_self) {
29874   PyObject *__pyx_v_root_name;
29875   PyObject *__pyx_v_public_id;
29876   PyObject *__pyx_v_system_url;
29877   PyObject *__pyx_r = NULL;
29878   PyObject *__pyx_1 = 0;
29879   PyObject *__pyx_2 = 0;
29880   PyObject *__pyx_3 = 0;
29881   PyObject *__pyx_4 = 0;
29882   PyObject *__pyx_t_1 = NULL;
29883   __Pyx_SetupRefcountContext("__get__");
29884   __pyx_v_root_name = Py_None; __Pyx_INCREF(Py_None);
29885   __pyx_v_public_id = Py_None; __Pyx_INCREF(Py_None);
29886   __pyx_v_system_url = Py_None; __Pyx_INCREF(Py_None);
29887
29888   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":435
29889  *         u"Returns the system ID of the DOCTYPE."
29890  *         def __get__(self):
29891  *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<<
29892  *             return system_url
29893  * 
29894  */
29895   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc->__pyx_vtab)->getdoctype(((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29896   __Pyx_GOTREF(__pyx_t_1);
29897   if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 3)) {
29898     PyObject* tuple = __pyx_t_1;
29899     __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
29900     __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
29901     __pyx_4 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_4);
29902     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29903     __Pyx_DECREF(__pyx_v_root_name);
29904     __pyx_v_root_name = __pyx_2;
29905     __pyx_2 = 0;
29906     __Pyx_DECREF(__pyx_v_public_id);
29907     __pyx_v_public_id = __pyx_3;
29908     __pyx_3 = 0;
29909     __Pyx_DECREF(__pyx_v_system_url);
29910     __pyx_v_system_url = __pyx_4;
29911     __pyx_4 = 0;
29912   } else {
29913     __pyx_1 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29914     __Pyx_GOTREF(__pyx_1);
29915     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29916     __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29917     __Pyx_GOTREF(__pyx_2);
29918     __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29919     __Pyx_GOTREF(__pyx_3);
29920     __pyx_4 = __Pyx_UnpackItem(__pyx_1, 2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29921     __Pyx_GOTREF(__pyx_4);
29922     if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29923     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
29924     __Pyx_DECREF(__pyx_v_root_name);
29925     __pyx_v_root_name = __pyx_2;
29926     __pyx_2 = 0;
29927     __Pyx_DECREF(__pyx_v_public_id);
29928     __pyx_v_public_id = __pyx_3;
29929     __pyx_3 = 0;
29930     __Pyx_DECREF(__pyx_v_system_url);
29931     __pyx_v_system_url = __pyx_4;
29932     __pyx_4 = 0;
29933   }
29934
29935   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":436
29936  *         def __get__(self):
29937  *             root_name, public_id, system_url = self._doc.getdoctype()
29938  *             return system_url             # <<<<<<<<<<<<<<
29939  * 
29940  *     property xml_version:
29941  */
29942   __Pyx_XDECREF(__pyx_r);
29943   __Pyx_INCREF(__pyx_v_system_url);
29944   __pyx_r = __pyx_v_system_url;
29945   goto __pyx_L0;
29946
29947   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
29948   goto __pyx_L0;
29949   __pyx_L1_error:;
29950   __Pyx_XDECREF(__pyx_1);
29951   __Pyx_XDECREF(__pyx_2);
29952   __Pyx_XDECREF(__pyx_3);
29953   __Pyx_XDECREF(__pyx_4);
29954   __Pyx_XDECREF(__pyx_t_1);
29955   __Pyx_AddTraceback("lxml.etree.DocInfo.system_url.__get__");
29956   __pyx_r = NULL;
29957   __pyx_L0:;
29958   __Pyx_DECREF(__pyx_v_root_name);
29959   __Pyx_DECREF(__pyx_v_public_id);
29960   __Pyx_DECREF(__pyx_v_system_url);
29961   __Pyx_XGIVEREF(__pyx_r);
29962   __Pyx_FinishRefcountContext();
29963   return __pyx_r;
29964 }
29965
29966 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":440
29967  *     property xml_version:
29968  *         u"Returns the XML version as declared by the document."
29969  *         def __get__(self):             # <<<<<<<<<<<<<<
29970  *             xml_version, encoding = self._doc.getxmlinfo()
29971  *             return xml_version
29972  */
29973
29974 static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_11xml_version___get__(PyObject *__pyx_v_self); /*proto*/
29975 static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_11xml_version___get__(PyObject *__pyx_v_self) {
29976   PyObject *__pyx_v_xml_version;
29977   PyObject *__pyx_v_encoding;
29978   PyObject *__pyx_r = NULL;
29979   PyObject *__pyx_1 = 0;
29980   PyObject *__pyx_2 = 0;
29981   PyObject *__pyx_3 = 0;
29982   PyObject *__pyx_t_1 = NULL;
29983   __Pyx_SetupRefcountContext("__get__");
29984   __pyx_v_xml_version = Py_None; __Pyx_INCREF(Py_None);
29985   __pyx_v_encoding = Py_None; __Pyx_INCREF(Py_None);
29986
29987   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":441
29988  *         u"Returns the XML version as declared by the document."
29989  *         def __get__(self):
29990  *             xml_version, encoding = self._doc.getxmlinfo()             # <<<<<<<<<<<<<<
29991  *             return xml_version
29992  * 
29993  */
29994   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc->__pyx_vtab)->getxmlinfo(((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29995   __Pyx_GOTREF(__pyx_t_1);
29996   if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 2)) {
29997     PyObject* tuple = __pyx_t_1;
29998     __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
29999     __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
30000     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30001     __Pyx_DECREF(__pyx_v_xml_version);
30002     __pyx_v_xml_version = __pyx_2;
30003     __pyx_2 = 0;
30004     __Pyx_DECREF(__pyx_v_encoding);
30005     __pyx_v_encoding = __pyx_3;
30006     __pyx_3 = 0;
30007   } else {
30008     __pyx_1 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30009     __Pyx_GOTREF(__pyx_1);
30010     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30011     __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30012     __Pyx_GOTREF(__pyx_2);
30013     __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30014     __Pyx_GOTREF(__pyx_3);
30015     if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30016     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
30017     __Pyx_DECREF(__pyx_v_xml_version);
30018     __pyx_v_xml_version = __pyx_2;
30019     __pyx_2 = 0;
30020     __Pyx_DECREF(__pyx_v_encoding);
30021     __pyx_v_encoding = __pyx_3;
30022     __pyx_3 = 0;
30023   }
30024
30025   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":442
30026  *         def __get__(self):
30027  *             xml_version, encoding = self._doc.getxmlinfo()
30028  *             return xml_version             # <<<<<<<<<<<<<<
30029  * 
30030  *     property encoding:
30031  */
30032   __Pyx_XDECREF(__pyx_r);
30033   __Pyx_INCREF(__pyx_v_xml_version);
30034   __pyx_r = __pyx_v_xml_version;
30035   goto __pyx_L0;
30036
30037   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
30038   goto __pyx_L0;
30039   __pyx_L1_error:;
30040   __Pyx_XDECREF(__pyx_1);
30041   __Pyx_XDECREF(__pyx_2);
30042   __Pyx_XDECREF(__pyx_3);
30043   __Pyx_XDECREF(__pyx_t_1);
30044   __Pyx_AddTraceback("lxml.etree.DocInfo.xml_version.__get__");
30045   __pyx_r = NULL;
30046   __pyx_L0:;
30047   __Pyx_DECREF(__pyx_v_xml_version);
30048   __Pyx_DECREF(__pyx_v_encoding);
30049   __Pyx_XGIVEREF(__pyx_r);
30050   __Pyx_FinishRefcountContext();
30051   return __pyx_r;
30052 }
30053
30054 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":446
30055  *     property encoding:
30056  *         u"Returns the encoding name as declared by the document."
30057  *         def __get__(self):             # <<<<<<<<<<<<<<
30058  *             xml_version, encoding = self._doc.getxmlinfo()
30059  *             return encoding
30060  */
30061
30062 static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_8encoding___get__(PyObject *__pyx_v_self); /*proto*/
30063 static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_8encoding___get__(PyObject *__pyx_v_self) {
30064   PyObject *__pyx_v_xml_version;
30065   PyObject *__pyx_v_encoding;
30066   PyObject *__pyx_r = NULL;
30067   PyObject *__pyx_1 = 0;
30068   PyObject *__pyx_2 = 0;
30069   PyObject *__pyx_3 = 0;
30070   PyObject *__pyx_t_1 = NULL;
30071   __Pyx_SetupRefcountContext("__get__");
30072   __pyx_v_xml_version = Py_None; __Pyx_INCREF(Py_None);
30073   __pyx_v_encoding = Py_None; __Pyx_INCREF(Py_None);
30074
30075   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":447
30076  *         u"Returns the encoding name as declared by the document."
30077  *         def __get__(self):
30078  *             xml_version, encoding = self._doc.getxmlinfo()             # <<<<<<<<<<<<<<
30079  *             return encoding
30080  * 
30081  */
30082   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc->__pyx_vtab)->getxmlinfo(((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30083   __Pyx_GOTREF(__pyx_t_1);
30084   if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 2)) {
30085     PyObject* tuple = __pyx_t_1;
30086     __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
30087     __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
30088     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30089     __Pyx_DECREF(__pyx_v_xml_version);
30090     __pyx_v_xml_version = __pyx_2;
30091     __pyx_2 = 0;
30092     __Pyx_DECREF(__pyx_v_encoding);
30093     __pyx_v_encoding = __pyx_3;
30094     __pyx_3 = 0;
30095   } else {
30096     __pyx_1 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30097     __Pyx_GOTREF(__pyx_1);
30098     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30099     __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30100     __Pyx_GOTREF(__pyx_2);
30101     __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30102     __Pyx_GOTREF(__pyx_3);
30103     if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30104     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
30105     __Pyx_DECREF(__pyx_v_xml_version);
30106     __pyx_v_xml_version = __pyx_2;
30107     __pyx_2 = 0;
30108     __Pyx_DECREF(__pyx_v_encoding);
30109     __pyx_v_encoding = __pyx_3;
30110     __pyx_3 = 0;
30111   }
30112
30113   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":448
30114  *         def __get__(self):
30115  *             xml_version, encoding = self._doc.getxmlinfo()
30116  *             return encoding             # <<<<<<<<<<<<<<
30117  * 
30118  *     property standalone:
30119  */
30120   __Pyx_XDECREF(__pyx_r);
30121   __Pyx_INCREF(__pyx_v_encoding);
30122   __pyx_r = __pyx_v_encoding;
30123   goto __pyx_L0;
30124
30125   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
30126   goto __pyx_L0;
30127   __pyx_L1_error:;
30128   __Pyx_XDECREF(__pyx_1);
30129   __Pyx_XDECREF(__pyx_2);
30130   __Pyx_XDECREF(__pyx_3);
30131   __Pyx_XDECREF(__pyx_t_1);
30132   __Pyx_AddTraceback("lxml.etree.DocInfo.encoding.__get__");
30133   __pyx_r = NULL;
30134   __pyx_L0:;
30135   __Pyx_DECREF(__pyx_v_xml_version);
30136   __Pyx_DECREF(__pyx_v_encoding);
30137   __Pyx_XGIVEREF(__pyx_r);
30138   __Pyx_FinishRefcountContext();
30139   return __pyx_r;
30140 }
30141
30142 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":458
30143  *         ``standalone`` flag was set to ``'yes'`` or not.
30144  *         """
30145  *         def __get__(self):             # <<<<<<<<<<<<<<
30146  *             return self._doc.isstandalone()
30147  * 
30148  */
30149
30150 static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_10standalone___get__(PyObject *__pyx_v_self); /*proto*/
30151 static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_10standalone___get__(PyObject *__pyx_v_self) {
30152   PyObject *__pyx_r = NULL;
30153   PyObject *__pyx_t_1 = NULL;
30154   __Pyx_SetupRefcountContext("__get__");
30155
30156   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":459
30157  *         """
30158  *         def __get__(self):
30159  *             return self._doc.isstandalone()             # <<<<<<<<<<<<<<
30160  * 
30161  *     property URL:
30162  */
30163   __Pyx_XDECREF(__pyx_r);
30164   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc->__pyx_vtab)->isstandalone(((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30165   __Pyx_GOTREF(__pyx_t_1);
30166   __pyx_r = __pyx_t_1;
30167   __pyx_t_1 = 0;
30168   goto __pyx_L0;
30169
30170   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
30171   goto __pyx_L0;
30172   __pyx_L1_error:;
30173   __Pyx_XDECREF(__pyx_t_1);
30174   __Pyx_AddTraceback("lxml.etree.DocInfo.standalone.__get__");
30175   __pyx_r = NULL;
30176   __pyx_L0:;
30177   __Pyx_XGIVEREF(__pyx_r);
30178   __Pyx_FinishRefcountContext();
30179   return __pyx_r;
30180 }
30181
30182 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":463
30183  *     property URL:
30184  *         u"The source URL of the document (or None if unknown)."
30185  *         def __get__(self):             # <<<<<<<<<<<<<<
30186  *             if self._doc._c_doc.URL is NULL:
30187  *                 return None
30188  */
30189
30190 static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_3URL___get__(PyObject *__pyx_v_self); /*proto*/
30191 static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_3URL___get__(PyObject *__pyx_v_self) {
30192   PyObject *__pyx_r = NULL;
30193   int __pyx_t_1;
30194   PyObject *__pyx_t_2 = NULL;
30195   __Pyx_SetupRefcountContext("__get__");
30196
30197   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":464
30198  *         u"The source URL of the document (or None if unknown)."
30199  *         def __get__(self):
30200  *             if self._doc._c_doc.URL is NULL:             # <<<<<<<<<<<<<<
30201  *                 return None
30202  *             return _decodeFilename(self._doc._c_doc.URL)
30203  */
30204   __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc->_c_doc->URL == NULL);
30205   if (__pyx_t_1) {
30206
30207     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":465
30208  *         def __get__(self):
30209  *             if self._doc._c_doc.URL is NULL:
30210  *                 return None             # <<<<<<<<<<<<<<
30211  *             return _decodeFilename(self._doc._c_doc.URL)
30212  *         def __set__(self, url):
30213  */
30214     __Pyx_XDECREF(__pyx_r);
30215     __Pyx_INCREF(Py_None);
30216     __pyx_r = Py_None;
30217     goto __pyx_L0;
30218     goto __pyx_L5;
30219   }
30220   __pyx_L5:;
30221
30222   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":466
30223  *             if self._doc._c_doc.URL is NULL:
30224  *                 return None
30225  *             return _decodeFilename(self._doc._c_doc.URL)             # <<<<<<<<<<<<<<
30226  *         def __set__(self, url):
30227  *             cdef char* c_oldurl
30228  */
30229   __Pyx_XDECREF(__pyx_r);
30230   __pyx_t_2 = __pyx_f_4lxml_5etree__decodeFilename(((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc->_c_doc->URL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30231   __Pyx_GOTREF(__pyx_t_2);
30232   __pyx_r = __pyx_t_2;
30233   __pyx_t_2 = 0;
30234   goto __pyx_L0;
30235
30236   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
30237   goto __pyx_L0;
30238   __pyx_L1_error:;
30239   __Pyx_XDECREF(__pyx_t_2);
30240   __Pyx_AddTraceback("lxml.etree.DocInfo.URL.__get__");
30241   __pyx_r = NULL;
30242   __pyx_L0:;
30243   __Pyx_XGIVEREF(__pyx_r);
30244   __Pyx_FinishRefcountContext();
30245   return __pyx_r;
30246 }
30247
30248 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":467
30249  *                 return None
30250  *             return _decodeFilename(self._doc._c_doc.URL)
30251  *         def __set__(self, url):             # <<<<<<<<<<<<<<
30252  *             cdef char* c_oldurl
30253  *             url = _encodeFilename(url)
30254  */
30255
30256 static int __pyx_pf_4lxml_5etree_7DocInfo_3URL___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_url); /*proto*/
30257 static int __pyx_pf_4lxml_5etree_7DocInfo_3URL___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_url) {
30258   char *__pyx_v_c_oldurl;
30259   int __pyx_r;
30260   PyObject *__pyx_t_1 = NULL;
30261   int __pyx_t_2;
30262   __Pyx_SetupRefcountContext("__set__");
30263   __Pyx_INCREF(__pyx_v_url);
30264
30265   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":469
30266  *         def __set__(self, url):
30267  *             cdef char* c_oldurl
30268  *             url = _encodeFilename(url)             # <<<<<<<<<<<<<<
30269  *             c_oldurl = self._doc._c_doc.URL
30270  *             if url is None:
30271  */
30272   __pyx_t_1 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_url); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30273   __Pyx_GOTREF(__pyx_t_1);
30274   __Pyx_DECREF(__pyx_v_url);
30275   __pyx_v_url = __pyx_t_1;
30276   __pyx_t_1 = 0;
30277
30278   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":470
30279  *             cdef char* c_oldurl
30280  *             url = _encodeFilename(url)
30281  *             c_oldurl = self._doc._c_doc.URL             # <<<<<<<<<<<<<<
30282  *             if url is None:
30283  *                 self._doc._c_doc.URL = NULL
30284  */
30285   __pyx_v_c_oldurl = ((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc->_c_doc->URL;
30286
30287   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":471
30288  *             url = _encodeFilename(url)
30289  *             c_oldurl = self._doc._c_doc.URL
30290  *             if url is None:             # <<<<<<<<<<<<<<
30291  *                 self._doc._c_doc.URL = NULL
30292  *             else:
30293  */
30294   __pyx_t_2 = (__pyx_v_url == Py_None);
30295   if (__pyx_t_2) {
30296
30297     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":472
30298  *             c_oldurl = self._doc._c_doc.URL
30299  *             if url is None:
30300  *                 self._doc._c_doc.URL = NULL             # <<<<<<<<<<<<<<
30301  *             else:
30302  *                 self._doc._c_doc.URL = tree.xmlStrdup(_cstr(url))
30303  */
30304     ((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc->_c_doc->URL = NULL;
30305     goto __pyx_L5;
30306   }
30307   /*else*/ {
30308
30309     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":474
30310  *                 self._doc._c_doc.URL = NULL
30311  *             else:
30312  *                 self._doc._c_doc.URL = tree.xmlStrdup(_cstr(url))             # <<<<<<<<<<<<<<
30313  *             if c_oldurl is not NULL:
30314  *                 tree.xmlFree(c_oldurl)
30315  */
30316     ((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc->_c_doc->URL = xmlStrdup(PyString_AS_STRING(__pyx_v_url));
30317   }
30318   __pyx_L5:;
30319
30320   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":475
30321  *             else:
30322  *                 self._doc._c_doc.URL = tree.xmlStrdup(_cstr(url))
30323  *             if c_oldurl is not NULL:             # <<<<<<<<<<<<<<
30324  *                 tree.xmlFree(c_oldurl)
30325  * 
30326  */
30327   __pyx_t_2 = (__pyx_v_c_oldurl != NULL);
30328   if (__pyx_t_2) {
30329
30330     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":476
30331  *                 self._doc._c_doc.URL = tree.xmlStrdup(_cstr(url))
30332  *             if c_oldurl is not NULL:
30333  *                 tree.xmlFree(c_oldurl)             # <<<<<<<<<<<<<<
30334  * 
30335  *     property doctype:
30336  */
30337     xmlFree(__pyx_v_c_oldurl);
30338     goto __pyx_L6;
30339   }
30340   __pyx_L6:;
30341
30342   __pyx_r = 0;
30343   goto __pyx_L0;
30344   __pyx_L1_error:;
30345   __Pyx_XDECREF(__pyx_t_1);
30346   __Pyx_AddTraceback("lxml.etree.DocInfo.URL.__set__");
30347   __pyx_r = -1;
30348   __pyx_L0:;
30349   __Pyx_DECREF(__pyx_v_url);
30350   __Pyx_FinishRefcountContext();
30351   return __pyx_r;
30352 }
30353
30354 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":480
30355  *     property doctype:
30356  *         u"Returns a DOCTYPE declaration string for the document."
30357  *         def __get__(self):             # <<<<<<<<<<<<<<
30358  *             root_name, public_id, system_url = self._doc.getdoctype()
30359  *             if public_id:
30360  */
30361
30362 static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(PyObject *__pyx_v_self); /*proto*/
30363 static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(PyObject *__pyx_v_self) {
30364   PyObject *__pyx_v_root_name;
30365   PyObject *__pyx_v_public_id;
30366   PyObject *__pyx_v_system_url;
30367   PyObject *__pyx_r = NULL;
30368   PyObject *__pyx_1 = 0;
30369   PyObject *__pyx_2 = 0;
30370   PyObject *__pyx_3 = 0;
30371   PyObject *__pyx_4 = 0;
30372   PyObject *__pyx_t_1 = NULL;
30373   int __pyx_t_2;
30374   PyObject *__pyx_t_3 = NULL;
30375   __Pyx_SetupRefcountContext("__get__");
30376   __pyx_v_root_name = Py_None; __Pyx_INCREF(Py_None);
30377   __pyx_v_public_id = Py_None; __Pyx_INCREF(Py_None);
30378   __pyx_v_system_url = Py_None; __Pyx_INCREF(Py_None);
30379
30380   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":481
30381  *         u"Returns a DOCTYPE declaration string for the document."
30382  *         def __get__(self):
30383  *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<<
30384  *             if public_id:
30385  *                 if system_url:
30386  */
30387   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc->__pyx_vtab)->getdoctype(((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30388   __Pyx_GOTREF(__pyx_t_1);
30389   if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 3)) {
30390     PyObject* tuple = __pyx_t_1;
30391     __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
30392     __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
30393     __pyx_4 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_4);
30394     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30395     __Pyx_DECREF(__pyx_v_root_name);
30396     __pyx_v_root_name = __pyx_2;
30397     __pyx_2 = 0;
30398     __Pyx_DECREF(__pyx_v_public_id);
30399     __pyx_v_public_id = __pyx_3;
30400     __pyx_3 = 0;
30401     __Pyx_DECREF(__pyx_v_system_url);
30402     __pyx_v_system_url = __pyx_4;
30403     __pyx_4 = 0;
30404   } else {
30405     __pyx_1 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30406     __Pyx_GOTREF(__pyx_1);
30407     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
30408     __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30409     __Pyx_GOTREF(__pyx_2);
30410     __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30411     __Pyx_GOTREF(__pyx_3);
30412     __pyx_4 = __Pyx_UnpackItem(__pyx_1, 2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30413     __Pyx_GOTREF(__pyx_4);
30414     if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30415     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
30416     __Pyx_DECREF(__pyx_v_root_name);
30417     __pyx_v_root_name = __pyx_2;
30418     __pyx_2 = 0;
30419     __Pyx_DECREF(__pyx_v_public_id);
30420     __pyx_v_public_id = __pyx_3;
30421     __pyx_3 = 0;
30422     __Pyx_DECREF(__pyx_v_system_url);
30423     __pyx_v_system_url = __pyx_4;
30424     __pyx_4 = 0;
30425   }
30426
30427   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":482
30428  *         def __get__(self):
30429  *             root_name, public_id, system_url = self._doc.getdoctype()
30430  *             if public_id:             # <<<<<<<<<<<<<<
30431  *                 if system_url:
30432  *                     return u'<!DOCTYPE %s PUBLIC "%s" "%s">' % (
30433  */
30434   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_public_id); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30435   if (__pyx_t_2) {
30436
30437     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":483
30438  *             root_name, public_id, system_url = self._doc.getdoctype()
30439  *             if public_id:
30440  *                 if system_url:             # <<<<<<<<<<<<<<
30441  *                     return u'<!DOCTYPE %s PUBLIC "%s" "%s">' % (
30442  *                         root_name, public_id, system_url)
30443  */
30444     __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_system_url); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30445     if (__pyx_t_2) {
30446
30447       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":484
30448  *             if public_id:
30449  *                 if system_url:
30450  *                     return u'<!DOCTYPE %s PUBLIC "%s" "%s">' % (             # <<<<<<<<<<<<<<
30451  *                         root_name, public_id, system_url)
30452  *                 else:
30453  */
30454       __Pyx_XDECREF(__pyx_r);
30455
30456       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":485
30457  *                 if system_url:
30458  *                     return u'<!DOCTYPE %s PUBLIC "%s" "%s">' % (
30459  *                         root_name, public_id, system_url)             # <<<<<<<<<<<<<<
30460  *                 else:
30461  *                     return u'<!DOCTYPE %s PUBLIC "%s">' % (
30462  */
30463       __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30464       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
30465       __Pyx_INCREF(__pyx_v_root_name);
30466       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_root_name);
30467       __Pyx_GIVEREF(__pyx_v_root_name);
30468       __Pyx_INCREF(__pyx_v_public_id);
30469       PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_public_id);
30470       __Pyx_GIVEREF(__pyx_v_public_id);
30471       __Pyx_INCREF(__pyx_v_system_url);
30472       PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_system_url);
30473       __Pyx_GIVEREF(__pyx_v_system_url);
30474       __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_309), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30475       __Pyx_GOTREF(__pyx_t_3);
30476       __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
30477       __pyx_r = __pyx_t_3;
30478       __pyx_t_3 = 0;
30479       goto __pyx_L0;
30480       goto __pyx_L6;
30481     }
30482     /*else*/ {
30483
30484       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":487
30485  *                         root_name, public_id, system_url)
30486  *                 else:
30487  *                     return u'<!DOCTYPE %s PUBLIC "%s">' % (             # <<<<<<<<<<<<<<
30488  *                         root_name, public_id)
30489  *             elif system_url:
30490  */
30491       __Pyx_XDECREF(__pyx_r);
30492
30493       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":488
30494  *                 else:
30495  *                     return u'<!DOCTYPE %s PUBLIC "%s">' % (
30496  *                         root_name, public_id)             # <<<<<<<<<<<<<<
30497  *             elif system_url:
30498  *                 return u'<!DOCTYPE %s SYSTEM "%s">' % (
30499  */
30500       __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30501       __Pyx_GOTREF(((PyObject *)__pyx_t_3));
30502       __Pyx_INCREF(__pyx_v_root_name);
30503       PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_root_name);
30504       __Pyx_GIVEREF(__pyx_v_root_name);
30505       __Pyx_INCREF(__pyx_v_public_id);
30506       PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_public_id);
30507       __Pyx_GIVEREF(__pyx_v_public_id);
30508       __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_310), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30509       __Pyx_GOTREF(__pyx_t_1);
30510       __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
30511       __pyx_r = __pyx_t_1;
30512       __pyx_t_1 = 0;
30513       goto __pyx_L0;
30514     }
30515     __pyx_L6:;
30516     goto __pyx_L5;
30517   }
30518
30519   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":489
30520  *                     return u'<!DOCTYPE %s PUBLIC "%s">' % (
30521  *                         root_name, public_id)
30522  *             elif system_url:             # <<<<<<<<<<<<<<
30523  *                 return u'<!DOCTYPE %s SYSTEM "%s">' % (
30524  *                     root_name, system_url)
30525  */
30526   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_system_url); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30527   if (__pyx_t_2) {
30528
30529     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":490
30530  *                         root_name, public_id)
30531  *             elif system_url:
30532  *                 return u'<!DOCTYPE %s SYSTEM "%s">' % (             # <<<<<<<<<<<<<<
30533  *                     root_name, system_url)
30534  *             elif self._doc.hasdoctype():
30535  */
30536     __Pyx_XDECREF(__pyx_r);
30537
30538     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":491
30539  *             elif system_url:
30540  *                 return u'<!DOCTYPE %s SYSTEM "%s">' % (
30541  *                     root_name, system_url)             # <<<<<<<<<<<<<<
30542  *             elif self._doc.hasdoctype():
30543  *                 return u'<!DOCTYPE %s>' % root_name
30544  */
30545     __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30546     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
30547     __Pyx_INCREF(__pyx_v_root_name);
30548     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_root_name);
30549     __Pyx_GIVEREF(__pyx_v_root_name);
30550     __Pyx_INCREF(__pyx_v_system_url);
30551     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_system_url);
30552     __Pyx_GIVEREF(__pyx_v_system_url);
30553     __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_311), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30554     __Pyx_GOTREF(__pyx_t_3);
30555     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
30556     __pyx_r = __pyx_t_3;
30557     __pyx_t_3 = 0;
30558     goto __pyx_L0;
30559     goto __pyx_L5;
30560   }
30561
30562   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":492
30563  *                 return u'<!DOCTYPE %s SYSTEM "%s">' % (
30564  *                     root_name, system_url)
30565  *             elif self._doc.hasdoctype():             # <<<<<<<<<<<<<<
30566  *                 return u'<!DOCTYPE %s>' % root_name
30567  *             else:
30568  */
30569   __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc->__pyx_vtab)->hasdoctype(((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc);
30570   if (__pyx_t_2) {
30571
30572     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":493
30573  *                     root_name, system_url)
30574  *             elif self._doc.hasdoctype():
30575  *                 return u'<!DOCTYPE %s>' % root_name             # <<<<<<<<<<<<<<
30576  *             else:
30577  *                 return u""
30578  */
30579     __Pyx_XDECREF(__pyx_r);
30580     __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_312), __pyx_v_root_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30581     __Pyx_GOTREF(__pyx_t_3);
30582     __pyx_r = __pyx_t_3;
30583     __pyx_t_3 = 0;
30584     goto __pyx_L0;
30585     goto __pyx_L5;
30586   }
30587   /*else*/ {
30588
30589     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":495
30590  *                 return u'<!DOCTYPE %s>' % root_name
30591  *             else:
30592  *                 return u""             # <<<<<<<<<<<<<<
30593  * 
30594  *     property internalDTD:
30595  */
30596     __Pyx_XDECREF(__pyx_r);
30597     __Pyx_INCREF(((PyObject *)__pyx_kp_313));
30598     __pyx_r = ((PyObject *)__pyx_kp_313);
30599     goto __pyx_L0;
30600   }
30601   __pyx_L5:;
30602
30603   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
30604   goto __pyx_L0;
30605   __pyx_L1_error:;
30606   __Pyx_XDECREF(__pyx_1);
30607   __Pyx_XDECREF(__pyx_2);
30608   __Pyx_XDECREF(__pyx_3);
30609   __Pyx_XDECREF(__pyx_4);
30610   __Pyx_XDECREF(__pyx_t_1);
30611   __Pyx_XDECREF(__pyx_t_3);
30612   __Pyx_AddTraceback("lxml.etree.DocInfo.doctype.__get__");
30613   __pyx_r = NULL;
30614   __pyx_L0:;
30615   __Pyx_DECREF(__pyx_v_root_name);
30616   __Pyx_DECREF(__pyx_v_public_id);
30617   __Pyx_DECREF(__pyx_v_system_url);
30618   __Pyx_XGIVEREF(__pyx_r);
30619   __Pyx_FinishRefcountContext();
30620   return __pyx_r;
30621 }
30622
30623 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":499
30624  *     property internalDTD:
30625  *         u"Returns a DTD validator based on the internal subset of the document."
30626  *         def __get__(self):             # <<<<<<<<<<<<<<
30627  *             return _dtdFactory(self._doc._c_doc.intSubset)
30628  * 
30629  */
30630
30631 static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_11internalDTD___get__(PyObject *__pyx_v_self); /*proto*/
30632 static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_11internalDTD___get__(PyObject *__pyx_v_self) {
30633   PyObject *__pyx_r = NULL;
30634   PyObject *__pyx_t_1 = NULL;
30635   __Pyx_SetupRefcountContext("__get__");
30636
30637   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":500
30638  *         u"Returns a DTD validator based on the internal subset of the document."
30639  *         def __get__(self):
30640  *             return _dtdFactory(self._doc._c_doc.intSubset)             # <<<<<<<<<<<<<<
30641  * 
30642  *     property externalDTD:
30643  */
30644   __Pyx_XDECREF(__pyx_r);
30645   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__dtdFactory(((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc->_c_doc->intSubset)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30646   __Pyx_GOTREF(__pyx_t_1);
30647   __pyx_r = __pyx_t_1;
30648   __pyx_t_1 = 0;
30649   goto __pyx_L0;
30650
30651   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
30652   goto __pyx_L0;
30653   __pyx_L1_error:;
30654   __Pyx_XDECREF(__pyx_t_1);
30655   __Pyx_AddTraceback("lxml.etree.DocInfo.internalDTD.__get__");
30656   __pyx_r = NULL;
30657   __pyx_L0:;
30658   __Pyx_XGIVEREF(__pyx_r);
30659   __Pyx_FinishRefcountContext();
30660   return __pyx_r;
30661 }
30662
30663 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":504
30664  *     property externalDTD:
30665  *         u"Returns a DTD validator based on the external subset of the document."
30666  *         def __get__(self):             # <<<<<<<<<<<<<<
30667  *             return _dtdFactory(self._doc._c_doc.extSubset)
30668  * 
30669  */
30670
30671 static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_11externalDTD___get__(PyObject *__pyx_v_self); /*proto*/
30672 static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_11externalDTD___get__(PyObject *__pyx_v_self) {
30673   PyObject *__pyx_r = NULL;
30674   PyObject *__pyx_t_1 = NULL;
30675   __Pyx_SetupRefcountContext("__get__");
30676
30677   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":505
30678  *         u"Returns a DTD validator based on the external subset of the document."
30679  *         def __get__(self):
30680  *             return _dtdFactory(self._doc._c_doc.extSubset)             # <<<<<<<<<<<<<<
30681  * 
30682  * 
30683  */
30684   __Pyx_XDECREF(__pyx_r);
30685   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__dtdFactory(((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc->_c_doc->extSubset)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30686   __Pyx_GOTREF(__pyx_t_1);
30687   __pyx_r = __pyx_t_1;
30688   __pyx_t_1 = 0;
30689   goto __pyx_L0;
30690
30691   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
30692   goto __pyx_L0;
30693   __pyx_L1_error:;
30694   __Pyx_XDECREF(__pyx_t_1);
30695   __Pyx_AddTraceback("lxml.etree.DocInfo.externalDTD.__get__");
30696   __pyx_r = NULL;
30697   __pyx_L0:;
30698   __Pyx_XGIVEREF(__pyx_r);
30699   __Pyx_FinishRefcountContext();
30700   return __pyx_r;
30701 }
30702
30703 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":522
30704  *     cdef object _attrib
30705  * 
30706  *     def _init(self):             # <<<<<<<<<<<<<<
30707  *         u"""_init(self)
30708  * 
30709  */
30710
30711 static PyObject *__pyx_pf_4lxml_5etree_8_Element__init(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
30712 static char __pyx_doc_4lxml_5etree_8_Element__init[] = "_init(self)\n\n        Called after object initialisation.  Custom subclasses may override\n        this if they recursively call _init() in the superclasses.\n        ";
30713 static PyObject *__pyx_pf_4lxml_5etree_8_Element__init(PyObject *__pyx_v_self, PyObject *unused) {
30714   PyObject *__pyx_r = NULL;
30715   __Pyx_SetupRefcountContext("_init");
30716
30717   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
30718   __Pyx_XGIVEREF(__pyx_r);
30719   __Pyx_FinishRefcountContext();
30720   return __pyx_r;
30721 }
30722
30723 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":529
30724  *         """
30725  * 
30726  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
30727  *         #print "trying to free node:", <int>self._c_node
30728  *         #displayNode(self._c_node, 0)
30729  */
30730
30731 static void __pyx_pf_4lxml_5etree_8_Element___dealloc__(PyObject *__pyx_v_self); /*proto*/
30732 static void __pyx_pf_4lxml_5etree_8_Element___dealloc__(PyObject *__pyx_v_self) {
30733   int __pyx_t_1;
30734   int __pyx_t_2;
30735   __Pyx_SetupRefcountContext("__dealloc__");
30736
30737   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":532
30738  *         #print "trying to free node:", <int>self._c_node
30739  *         #displayNode(self._c_node, 0)
30740  *         if self._c_node is not NULL:             # <<<<<<<<<<<<<<
30741  *             _unregisterProxy(self)
30742  *             attemptDeallocation(self._c_node)
30743  */
30744   __pyx_t_1 = (((struct LxmlElement *)__pyx_v_self)->_c_node != NULL);
30745   if (__pyx_t_1) {
30746
30747     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":533
30748  *         #displayNode(self._c_node, 0)
30749  *         if self._c_node is not NULL:
30750  *             _unregisterProxy(self)             # <<<<<<<<<<<<<<
30751  *             attemptDeallocation(self._c_node)
30752  *         _releaseProxy(self)
30753  */
30754     __pyx_t_2 = __pyx_f_4lxml_5etree__unregisterProxy(((struct LxmlElement *)__pyx_v_self)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30755
30756     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":534
30757  *         if self._c_node is not NULL:
30758  *             _unregisterProxy(self)
30759  *             attemptDeallocation(self._c_node)             # <<<<<<<<<<<<<<
30760  *         _releaseProxy(self)
30761  * 
30762  */
30763     __pyx_f_4lxml_5etree_attemptDeallocation(((struct LxmlElement *)__pyx_v_self)->_c_node);
30764     goto __pyx_L5;
30765   }
30766   __pyx_L5:;
30767
30768   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":535
30769  *             _unregisterProxy(self)
30770  *             attemptDeallocation(self._c_node)
30771  *         _releaseProxy(self)             # <<<<<<<<<<<<<<
30772  * 
30773  *     # MANIPULATORS
30774  */
30775   __pyx_f_4lxml_5etree__releaseProxy(((struct LxmlElement *)__pyx_v_self));
30776
30777   goto __pyx_L0;
30778   __pyx_L1_error:;
30779   __Pyx_AddTraceback("lxml.etree._Element.__dealloc__");
30780   __pyx_L0:;
30781   __Pyx_FinishRefcountContext();
30782 }
30783
30784 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":539
30785  *     # MANIPULATORS
30786  * 
30787  *     def __setitem__(self, x, value):             # <<<<<<<<<<<<<<
30788  *         u"""__setitem__(self, x, value)
30789  * 
30790  */
30791
30792 static int __pyx_pf_4lxml_5etree_8_Element___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_value); /*proto*/
30793 static char __pyx_doc_4lxml_5etree_8_Element___setitem__[] = "__setitem__(self, x, value)\n\n        Replaces the given subelement index or slice.\n        ";
30794 static int __pyx_pf_4lxml_5etree_8_Element___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_value) {
30795   xmlNode *__pyx_v_c_node;
30796   xmlNode *__pyx_v_c_next;
30797   xmlDoc *__pyx_v_c_source_doc;
30798   struct LxmlElement *__pyx_v_element;
30799   int __pyx_v_left_to_right;
30800   Py_ssize_t __pyx_v_slicelength;
30801   Py_ssize_t __pyx_v_step;
30802   int __pyx_r;
30803   int __pyx_t_1;
30804   int __pyx_t_2;
30805   Py_ssize_t __pyx_t_3;
30806   __Pyx_SetupRefcountContext("__setitem__");
30807   __pyx_v_element = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
30808
30809   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":550
30810  *         cdef bint left_to_right
30811  *         cdef Py_ssize_t slicelength, step
30812  *         if value is None:             # <<<<<<<<<<<<<<
30813  *             raise ValueError, u"cannot assign None"
30814  *         if python.PySlice_Check(x):
30815  */
30816   __pyx_t_1 = (__pyx_v_value == Py_None);
30817   if (__pyx_t_1) {
30818
30819     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":551
30820  *         cdef Py_ssize_t slicelength, step
30821  *         if value is None:
30822  *             raise ValueError, u"cannot assign None"             # <<<<<<<<<<<<<<
30823  *         if python.PySlice_Check(x):
30824  *             # slice assignment
30825  */
30826     __Pyx_Raise(__pyx_builtin_ValueError, ((PyObject *)__pyx_kp_314), 0);
30827     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30828     goto __pyx_L5;
30829   }
30830   __pyx_L5:;
30831
30832   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":552
30833  *         if value is None:
30834  *             raise ValueError, u"cannot assign None"
30835  *         if python.PySlice_Check(x):             # <<<<<<<<<<<<<<
30836  *             # slice assignment
30837  *             _findChildSlice(<python.slice>x, self._c_node, &c_node, &step, &slicelength)
30838  */
30839   __pyx_t_1 = PySlice_Check(__pyx_v_x);
30840   if (__pyx_t_1) {
30841
30842     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":554
30843  *         if python.PySlice_Check(x):
30844  *             # slice assignment
30845  *             _findChildSlice(<python.slice>x, self._c_node, &c_node, &step, &slicelength)             # <<<<<<<<<<<<<<
30846  *             if step > 0:
30847  *                 left_to_right = 1
30848  */
30849     __pyx_t_2 = __pyx_f_4lxml_5etree__findChildSlice(((PySliceObject *)__pyx_v_x), ((struct LxmlElement *)__pyx_v_self)->_c_node, (&__pyx_v_c_node), (&__pyx_v_step), (&__pyx_v_slicelength)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30850
30851     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":555
30852  *             # slice assignment
30853  *             _findChildSlice(<python.slice>x, self._c_node, &c_node, &step, &slicelength)
30854  *             if step > 0:             # <<<<<<<<<<<<<<
30855  *                 left_to_right = 1
30856  *             else:
30857  */
30858     __pyx_t_1 = (__pyx_v_step > 0);
30859     if (__pyx_t_1) {
30860
30861       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":556
30862  *             _findChildSlice(<python.slice>x, self._c_node, &c_node, &step, &slicelength)
30863  *             if step > 0:
30864  *                 left_to_right = 1             # <<<<<<<<<<<<<<
30865  *             else:
30866  *                 left_to_right = 0
30867  */
30868       __pyx_v_left_to_right = 1;
30869       goto __pyx_L7;
30870     }
30871     /*else*/ {
30872
30873       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":558
30874  *                 left_to_right = 1
30875  *             else:
30876  *                 left_to_right = 0             # <<<<<<<<<<<<<<
30877  *                 step = -step
30878  *             _replaceSlice(self, c_node, slicelength, step, left_to_right, value)
30879  */
30880       __pyx_v_left_to_right = 0;
30881
30882       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":559
30883  *             else:
30884  *                 left_to_right = 0
30885  *                 step = -step             # <<<<<<<<<<<<<<
30886  *             _replaceSlice(self, c_node, slicelength, step, left_to_right, value)
30887  *             return
30888  */
30889       __pyx_v_step = (-__pyx_v_step);
30890     }
30891     __pyx_L7:;
30892
30893     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":560
30894  *                 left_to_right = 0
30895  *                 step = -step
30896  *             _replaceSlice(self, c_node, slicelength, step, left_to_right, value)             # <<<<<<<<<<<<<<
30897  *             return
30898  *         else:
30899  */
30900     __pyx_t_2 = __pyx_f_4lxml_5etree__replaceSlice(((struct LxmlElement *)__pyx_v_self), __pyx_v_c_node, __pyx_v_slicelength, __pyx_v_step, __pyx_v_left_to_right, __pyx_v_value); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30901
30902     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":561
30903  *                 step = -step
30904  *             _replaceSlice(self, c_node, slicelength, step, left_to_right, value)
30905  *             return             # <<<<<<<<<<<<<<
30906  *         else:
30907  *             # otherwise: normal item assignment
30908  */
30909     __pyx_r = 0;
30910     goto __pyx_L0;
30911     goto __pyx_L6;
30912   }
30913   /*else*/ {
30914
30915     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":564
30916  *         else:
30917  *             # otherwise: normal item assignment
30918  *             element = value             # <<<<<<<<<<<<<<
30919  *             c_node = _findChild(self._c_node, x)
30920  *             if c_node is NULL:
30921  */
30922     if (!(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30923     __Pyx_INCREF(__pyx_v_value);
30924     __Pyx_DECREF(((PyObject *)__pyx_v_element));
30925     __pyx_v_element = ((struct LxmlElement *)__pyx_v_value);
30926
30927     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":565
30928  *             # otherwise: normal item assignment
30929  *             element = value
30930  *             c_node = _findChild(self._c_node, x)             # <<<<<<<<<<<<<<
30931  *             if c_node is NULL:
30932  *                 raise IndexError, u"list index out of range"
30933  */
30934     __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_x); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30935     __pyx_v_c_node = __pyx_f_4lxml_5etree__findChild(((struct LxmlElement *)__pyx_v_self)->_c_node, __pyx_t_3);
30936
30937     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":566
30938  *             element = value
30939  *             c_node = _findChild(self._c_node, x)
30940  *             if c_node is NULL:             # <<<<<<<<<<<<<<
30941  *                 raise IndexError, u"list index out of range"
30942  *             c_source_doc = element._c_node.doc
30943  */
30944     __pyx_t_1 = (__pyx_v_c_node == NULL);
30945     if (__pyx_t_1) {
30946
30947       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":567
30948  *             c_node = _findChild(self._c_node, x)
30949  *             if c_node is NULL:
30950  *                 raise IndexError, u"list index out of range"             # <<<<<<<<<<<<<<
30951  *             c_source_doc = element._c_node.doc
30952  *             c_next = element._c_node.next
30953  */
30954       __Pyx_Raise(__pyx_builtin_IndexError, ((PyObject *)__pyx_kp_315), 0);
30955       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30956       goto __pyx_L8;
30957     }
30958     __pyx_L8:;
30959
30960     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":568
30961  *             if c_node is NULL:
30962  *                 raise IndexError, u"list index out of range"
30963  *             c_source_doc = element._c_node.doc             # <<<<<<<<<<<<<<
30964  *             c_next = element._c_node.next
30965  *             _removeText(c_node.next)
30966  */
30967     __pyx_v_c_source_doc = __pyx_v_element->_c_node->doc;
30968
30969     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":569
30970  *                 raise IndexError, u"list index out of range"
30971  *             c_source_doc = element._c_node.doc
30972  *             c_next = element._c_node.next             # <<<<<<<<<<<<<<
30973  *             _removeText(c_node.next)
30974  *             tree.xmlReplaceNode(c_node, element._c_node)
30975  */
30976     __pyx_v_c_next = __pyx_v_element->_c_node->next;
30977
30978     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":570
30979  *             c_source_doc = element._c_node.doc
30980  *             c_next = element._c_node.next
30981  *             _removeText(c_node.next)             # <<<<<<<<<<<<<<
30982  *             tree.xmlReplaceNode(c_node, element._c_node)
30983  *             _moveTail(c_next, element._c_node)
30984  */
30985     __pyx_f_4lxml_5etree__removeText(__pyx_v_c_node->next);
30986
30987     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":571
30988  *             c_next = element._c_node.next
30989  *             _removeText(c_node.next)
30990  *             tree.xmlReplaceNode(c_node, element._c_node)             # <<<<<<<<<<<<<<
30991  *             _moveTail(c_next, element._c_node)
30992  *             moveNodeToDocument(self._doc, c_source_doc, element._c_node)
30993  */
30994     xmlReplaceNode(__pyx_v_c_node, __pyx_v_element->_c_node);
30995
30996     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":572
30997  *             _removeText(c_node.next)
30998  *             tree.xmlReplaceNode(c_node, element._c_node)
30999  *             _moveTail(c_next, element._c_node)             # <<<<<<<<<<<<<<
31000  *             moveNodeToDocument(self._doc, c_source_doc, element._c_node)
31001  *             if not attemptDeallocation(c_node):
31002  */
31003     __pyx_f_4lxml_5etree__moveTail(__pyx_v_c_next, __pyx_v_element->_c_node);
31004
31005     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":573
31006  *             tree.xmlReplaceNode(c_node, element._c_node)
31007  *             _moveTail(c_next, element._c_node)
31008  *             moveNodeToDocument(self._doc, c_source_doc, element._c_node)             # <<<<<<<<<<<<<<
31009  *             if not attemptDeallocation(c_node):
31010  *                 moveNodeToDocument(self._doc, c_node.doc, c_node)
31011  */
31012     __pyx_t_2 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlElement *)__pyx_v_self)->_doc, __pyx_v_c_source_doc, __pyx_v_element->_c_node); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31013
31014     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":574
31015  *             _moveTail(c_next, element._c_node)
31016  *             moveNodeToDocument(self._doc, c_source_doc, element._c_node)
31017  *             if not attemptDeallocation(c_node):             # <<<<<<<<<<<<<<
31018  *                 moveNodeToDocument(self._doc, c_node.doc, c_node)
31019  * 
31020  */
31021     __pyx_t_1 = (!__pyx_f_4lxml_5etree_attemptDeallocation(__pyx_v_c_node));
31022     if (__pyx_t_1) {
31023
31024       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":575
31025  *             moveNodeToDocument(self._doc, c_source_doc, element._c_node)
31026  *             if not attemptDeallocation(c_node):
31027  *                 moveNodeToDocument(self._doc, c_node.doc, c_node)             # <<<<<<<<<<<<<<
31028  * 
31029  *     def __delitem__(self, x):
31030  */
31031       __pyx_t_2 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlElement *)__pyx_v_self)->_doc, __pyx_v_c_node->doc, __pyx_v_c_node); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31032       goto __pyx_L9;
31033     }
31034     __pyx_L9:;
31035   }
31036   __pyx_L6:;
31037
31038   __pyx_r = 0;
31039   goto __pyx_L0;
31040   __pyx_L1_error:;
31041   __Pyx_AddTraceback("lxml.etree._Element.__setitem__");
31042   __pyx_r = -1;
31043   __pyx_L0:;
31044   __Pyx_DECREF((PyObject *)__pyx_v_element);
31045   __Pyx_FinishRefcountContext();
31046   return __pyx_r;
31047 }
31048
31049 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":577
31050  *                 moveNodeToDocument(self._doc, c_node.doc, c_node)
31051  * 
31052  *     def __delitem__(self, x):             # <<<<<<<<<<<<<<
31053  *         u"""__delitem__(self, x)
31054  * 
31055  */
31056
31057 static int __pyx_pf_4lxml_5etree_8_Element___delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
31058 static char __pyx_doc_4lxml_5etree_8_Element___delitem__[] = "__delitem__(self, x)\n\n        Deletes the given subelement or a slice.\n        ";
31059 static int __pyx_pf_4lxml_5etree_8_Element___delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
31060   xmlNode *__pyx_v_c_node;
31061   xmlNode *__pyx_v_c_next;
31062   Py_ssize_t __pyx_v_step;
31063   Py_ssize_t __pyx_v_slicelength;
31064   int __pyx_r;
31065   int __pyx_t_1;
31066   int __pyx_t_2;
31067   Py_ssize_t __pyx_t_3;
31068   PyObject *__pyx_t_4 = NULL;
31069   __Pyx_SetupRefcountContext("__delitem__");
31070
31071   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":585
31072  *         cdef xmlNode* c_next
31073  *         cdef Py_ssize_t step, slicelength
31074  *         if python.PySlice_Check(x):             # <<<<<<<<<<<<<<
31075  *             # slice deletion
31076  *             if _isFullSlice(<python.slice>x):
31077  */
31078   __pyx_t_1 = PySlice_Check(__pyx_v_x);
31079   if (__pyx_t_1) {
31080
31081     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":587
31082  *         if python.PySlice_Check(x):
31083  *             # slice deletion
31084  *             if _isFullSlice(<python.slice>x):             # <<<<<<<<<<<<<<
31085  *                 c_node = self._c_node.children
31086  *                 if c_node is not NULL:
31087  */
31088     __pyx_t_1 = __pyx_f_4lxml_5etree__isFullSlice(((PySliceObject *)__pyx_v_x));
31089     if (__pyx_t_1) {
31090
31091       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":588
31092  *             # slice deletion
31093  *             if _isFullSlice(<python.slice>x):
31094  *                 c_node = self._c_node.children             # <<<<<<<<<<<<<<
31095  *                 if c_node is not NULL:
31096  *                     if not _isElement(c_node):
31097  */
31098       __pyx_v_c_node = ((struct LxmlElement *)__pyx_v_self)->_c_node->children;
31099
31100       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":589
31101  *             if _isFullSlice(<python.slice>x):
31102  *                 c_node = self._c_node.children
31103  *                 if c_node is not NULL:             # <<<<<<<<<<<<<<
31104  *                     if not _isElement(c_node):
31105  *                         c_node = _nextElement(c_node)
31106  */
31107       __pyx_t_1 = (__pyx_v_c_node != NULL);
31108       if (__pyx_t_1) {
31109
31110         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":590
31111  *                 c_node = self._c_node.children
31112  *                 if c_node is not NULL:
31113  *                     if not _isElement(c_node):             # <<<<<<<<<<<<<<
31114  *                         c_node = _nextElement(c_node)
31115  *                     while c_node is not NULL:
31116  */
31117         __pyx_t_1 = (!_isElement(__pyx_v_c_node));
31118         if (__pyx_t_1) {
31119
31120           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":591
31121  *                 if c_node is not NULL:
31122  *                     if not _isElement(c_node):
31123  *                         c_node = _nextElement(c_node)             # <<<<<<<<<<<<<<
31124  *                     while c_node is not NULL:
31125  *                         c_next = _nextElement(c_node)
31126  */
31127           __pyx_v_c_node = __pyx_f_4lxml_5etree__nextElement(__pyx_v_c_node);
31128           goto __pyx_L8;
31129         }
31130         __pyx_L8:;
31131
31132         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":592
31133  *                     if not _isElement(c_node):
31134  *                         c_node = _nextElement(c_node)
31135  *                     while c_node is not NULL:             # <<<<<<<<<<<<<<
31136  *                         c_next = _nextElement(c_node)
31137  *                         _removeNode(self._doc, c_node)
31138  */
31139         while (1) {
31140           __pyx_t_1 = (__pyx_v_c_node != NULL);
31141           if (!__pyx_t_1) break;
31142
31143           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":593
31144  *                         c_node = _nextElement(c_node)
31145  *                     while c_node is not NULL:
31146  *                         c_next = _nextElement(c_node)             # <<<<<<<<<<<<<<
31147  *                         _removeNode(self._doc, c_node)
31148  *                         c_node = c_next
31149  */
31150           __pyx_v_c_next = __pyx_f_4lxml_5etree__nextElement(__pyx_v_c_node);
31151
31152           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":594
31153  *                     while c_node is not NULL:
31154  *                         c_next = _nextElement(c_node)
31155  *                         _removeNode(self._doc, c_node)             # <<<<<<<<<<<<<<
31156  *                         c_node = c_next
31157  *             else:
31158  */
31159           __pyx_t_2 = __pyx_f_4lxml_5etree__removeNode(((struct LxmlElement *)__pyx_v_self)->_doc, __pyx_v_c_node); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31160
31161           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":595
31162  *                         c_next = _nextElement(c_node)
31163  *                         _removeNode(self._doc, c_node)
31164  *                         c_node = c_next             # <<<<<<<<<<<<<<
31165  *             else:
31166  *                 _findChildSlice(<python.slice>x, self._c_node, &c_node, &step, &slicelength)
31167  */
31168           __pyx_v_c_node = __pyx_v_c_next;
31169         }
31170         goto __pyx_L7;
31171       }
31172       __pyx_L7:;
31173       goto __pyx_L6;
31174     }
31175     /*else*/ {
31176
31177       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":597
31178  *                         c_node = c_next
31179  *             else:
31180  *                 _findChildSlice(<python.slice>x, self._c_node, &c_node, &step, &slicelength)             # <<<<<<<<<<<<<<
31181  *                 _deleteSlice(self._doc, c_node, slicelength, step)
31182  *         else:
31183  */
31184       __pyx_t_2 = __pyx_f_4lxml_5etree__findChildSlice(((PySliceObject *)__pyx_v_x), ((struct LxmlElement *)__pyx_v_self)->_c_node, (&__pyx_v_c_node), (&__pyx_v_step), (&__pyx_v_slicelength)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31185
31186       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":598
31187  *             else:
31188  *                 _findChildSlice(<python.slice>x, self._c_node, &c_node, &step, &slicelength)
31189  *                 _deleteSlice(self._doc, c_node, slicelength, step)             # <<<<<<<<<<<<<<
31190  *         else:
31191  *             # item deletion
31192  */
31193       __pyx_t_2 = __pyx_f_4lxml_5etree__deleteSlice(((struct LxmlElement *)__pyx_v_self)->_doc, __pyx_v_c_node, __pyx_v_slicelength, __pyx_v_step); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31194     }
31195     __pyx_L6:;
31196     goto __pyx_L5;
31197   }
31198   /*else*/ {
31199
31200     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":601
31201  *         else:
31202  *             # item deletion
31203  *             c_node = _findChild(self._c_node, x)             # <<<<<<<<<<<<<<
31204  *             if c_node is NULL:
31205  *                 raise IndexError, u"index out of range: %d" % x
31206  */
31207     __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_x); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31208     __pyx_v_c_node = __pyx_f_4lxml_5etree__findChild(((struct LxmlElement *)__pyx_v_self)->_c_node, __pyx_t_3);
31209
31210     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":602
31211  *             # item deletion
31212  *             c_node = _findChild(self._c_node, x)
31213  *             if c_node is NULL:             # <<<<<<<<<<<<<<
31214  *                 raise IndexError, u"index out of range: %d" % x
31215  *             _removeText(c_node.next)
31216  */
31217     __pyx_t_1 = (__pyx_v_c_node == NULL);
31218     if (__pyx_t_1) {
31219
31220       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":603
31221  *             c_node = _findChild(self._c_node, x)
31222  *             if c_node is NULL:
31223  *                 raise IndexError, u"index out of range: %d" % x             # <<<<<<<<<<<<<<
31224  *             _removeText(c_node.next)
31225  *             _removeNode(self._doc, c_node)
31226  */
31227       __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_316), __pyx_v_x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31228       __Pyx_GOTREF(__pyx_t_4);
31229       __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_4, 0);
31230       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
31231       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31232       goto __pyx_L11;
31233     }
31234     __pyx_L11:;
31235
31236     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":604
31237  *             if c_node is NULL:
31238  *                 raise IndexError, u"index out of range: %d" % x
31239  *             _removeText(c_node.next)             # <<<<<<<<<<<<<<
31240  *             _removeNode(self._doc, c_node)
31241  * 
31242  */
31243     __pyx_f_4lxml_5etree__removeText(__pyx_v_c_node->next);
31244
31245     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":605
31246  *                 raise IndexError, u"index out of range: %d" % x
31247  *             _removeText(c_node.next)
31248  *             _removeNode(self._doc, c_node)             # <<<<<<<<<<<<<<
31249  * 
31250  *     def __deepcopy__(self, memo):
31251  */
31252     __pyx_t_2 = __pyx_f_4lxml_5etree__removeNode(((struct LxmlElement *)__pyx_v_self)->_doc, __pyx_v_c_node); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31253   }
31254   __pyx_L5:;
31255
31256   __pyx_r = 0;
31257   goto __pyx_L0;
31258   __pyx_L1_error:;
31259   __Pyx_XDECREF(__pyx_t_4);
31260   __Pyx_AddTraceback("lxml.etree._Element.__delitem__");
31261   __pyx_r = -1;
31262   __pyx_L0:;
31263   __Pyx_FinishRefcountContext();
31264   return __pyx_r;
31265 }
31266
31267 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":607
31268  *             _removeNode(self._doc, c_node)
31269  * 
31270  *     def __deepcopy__(self, memo):             # <<<<<<<<<<<<<<
31271  *         u"__deepcopy__(self, memo)"
31272  *         return self.__copy__()
31273  */
31274
31275 static PyObject *__pyx_pf_4lxml_5etree_8_Element___deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo); /*proto*/
31276 static char __pyx_doc_4lxml_5etree_8_Element___deepcopy__[] = "__deepcopy__(self, memo)";
31277 static PyObject *__pyx_pf_4lxml_5etree_8_Element___deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo) {
31278   PyObject *__pyx_r = NULL;
31279   PyObject *__pyx_t_1 = NULL;
31280   PyObject *__pyx_t_2 = NULL;
31281   __Pyx_SetupRefcountContext("__deepcopy__");
31282
31283   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":609
31284  *     def __deepcopy__(self, memo):
31285  *         u"__deepcopy__(self, memo)"
31286  *         return self.__copy__()             # <<<<<<<<<<<<<<
31287  * 
31288  *     def __copy__(self):
31289  */
31290   __Pyx_XDECREF(__pyx_r);
31291   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp___copy__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31292   __Pyx_GOTREF(__pyx_t_1);
31293   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31294   __Pyx_GOTREF(__pyx_t_2);
31295   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
31296   __pyx_r = __pyx_t_2;
31297   __pyx_t_2 = 0;
31298   goto __pyx_L0;
31299
31300   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
31301   goto __pyx_L0;
31302   __pyx_L1_error:;
31303   __Pyx_XDECREF(__pyx_t_1);
31304   __Pyx_XDECREF(__pyx_t_2);
31305   __Pyx_AddTraceback("lxml.etree._Element.__deepcopy__");
31306   __pyx_r = NULL;
31307   __pyx_L0:;
31308   __Pyx_XGIVEREF(__pyx_r);
31309   __Pyx_FinishRefcountContext();
31310   return __pyx_r;
31311 }
31312
31313 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":611
31314  *         return self.__copy__()
31315  * 
31316  *     def __copy__(self):             # <<<<<<<<<<<<<<
31317  *         u"__copy__(self)"
31318  *         cdef xmlDoc* c_doc
31319  */
31320
31321 static PyObject *__pyx_pf_4lxml_5etree_8_Element___copy__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
31322 static char __pyx_doc_4lxml_5etree_8_Element___copy__[] = "__copy__(self)";
31323 static PyObject *__pyx_pf_4lxml_5etree_8_Element___copy__(PyObject *__pyx_v_self, PyObject *unused) {
31324   xmlDoc *__pyx_v_c_doc;
31325   xmlNode *__pyx_v_c_node;
31326   struct LxmlDocument *__pyx_v_new_doc;
31327   PyObject *__pyx_v_root;
31328   PyObject *__pyx_r = NULL;
31329   xmlDoc *__pyx_t_1;
31330   PyObject *__pyx_t_2 = NULL;
31331   int __pyx_t_3;
31332   __Pyx_SetupRefcountContext("__copy__");
31333   __pyx_v_new_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
31334   __pyx_v_root = Py_None; __Pyx_INCREF(Py_None);
31335
31336   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":616
31337  *         cdef xmlNode* c_node
31338  *         cdef _Document new_doc
31339  *         c_doc = _copyDocRoot(self._doc._c_doc, self._c_node) # recursive             # <<<<<<<<<<<<<<
31340  *         new_doc = _documentFactory(c_doc, self._doc._parser)
31341  *         root = new_doc.getroot()
31342  */
31343   __pyx_t_1 = __pyx_f_4lxml_5etree__copyDocRoot(((struct LxmlElement *)__pyx_v_self)->_doc->_c_doc, ((struct LxmlElement *)__pyx_v_self)->_c_node); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31344   __pyx_v_c_doc = __pyx_t_1;
31345
31346   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":617
31347  *         cdef _Document new_doc
31348  *         c_doc = _copyDocRoot(self._doc._c_doc, self._c_node) # recursive
31349  *         new_doc = _documentFactory(c_doc, self._doc._parser)             # <<<<<<<<<<<<<<
31350  *         root = new_doc.getroot()
31351  *         if root is not None:
31352  */
31353   __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, ((struct LxmlElement *)__pyx_v_self)->_doc->_parser)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31354   __Pyx_GOTREF(__pyx_t_2);
31355   __Pyx_DECREF(((PyObject *)__pyx_v_new_doc));
31356   __pyx_v_new_doc = ((struct LxmlDocument *)__pyx_t_2);
31357   __pyx_t_2 = 0;
31358
31359   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":618
31360  *         c_doc = _copyDocRoot(self._doc._c_doc, self._c_node) # recursive
31361  *         new_doc = _documentFactory(c_doc, self._doc._parser)
31362  *         root = new_doc.getroot()             # <<<<<<<<<<<<<<
31363  *         if root is not None:
31364  *             return root
31365  */
31366   __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_new_doc->__pyx_vtab)->getroot(__pyx_v_new_doc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31367   __Pyx_GOTREF(__pyx_t_2);
31368   __Pyx_DECREF(__pyx_v_root);
31369   __pyx_v_root = __pyx_t_2;
31370   __pyx_t_2 = 0;
31371
31372   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":619
31373  *         new_doc = _documentFactory(c_doc, self._doc._parser)
31374  *         root = new_doc.getroot()
31375  *         if root is not None:             # <<<<<<<<<<<<<<
31376  *             return root
31377  *         # Comment/PI
31378  */
31379   __pyx_t_3 = (__pyx_v_root != Py_None);
31380   if (__pyx_t_3) {
31381
31382     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":620
31383  *         root = new_doc.getroot()
31384  *         if root is not None:
31385  *             return root             # <<<<<<<<<<<<<<
31386  *         # Comment/PI
31387  *         c_node = c_doc.children
31388  */
31389     __Pyx_XDECREF(__pyx_r);
31390     __Pyx_INCREF(__pyx_v_root);
31391     __pyx_r = __pyx_v_root;
31392     goto __pyx_L0;
31393     goto __pyx_L5;
31394   }
31395   __pyx_L5:;
31396
31397   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":622
31398  *             return root
31399  *         # Comment/PI
31400  *         c_node = c_doc.children             # <<<<<<<<<<<<<<
31401  *         while c_node is not NULL and c_node.type != self._c_node.type:
31402  *             c_node = c_node.next
31403  */
31404   __pyx_v_c_node = __pyx_v_c_doc->children;
31405
31406   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":623
31407  *         # Comment/PI
31408  *         c_node = c_doc.children
31409  *         while c_node is not NULL and c_node.type != self._c_node.type:             # <<<<<<<<<<<<<<
31410  *             c_node = c_node.next
31411  *         if c_node is NULL:
31412  */
31413   while (1) {
31414     if ((__pyx_v_c_node != NULL)) {
31415       __pyx_t_3 = (__pyx_v_c_node->type != ((struct LxmlElement *)__pyx_v_self)->_c_node->type);
31416     } else {
31417       __pyx_t_3 = (__pyx_v_c_node != NULL);
31418     }
31419     if (!__pyx_t_3) break;
31420
31421     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":624
31422  *         c_node = c_doc.children
31423  *         while c_node is not NULL and c_node.type != self._c_node.type:
31424  *             c_node = c_node.next             # <<<<<<<<<<<<<<
31425  *         if c_node is NULL:
31426  *             return None
31427  */
31428     __pyx_v_c_node = __pyx_v_c_node->next;
31429   }
31430
31431   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":625
31432  *         while c_node is not NULL and c_node.type != self._c_node.type:
31433  *             c_node = c_node.next
31434  *         if c_node is NULL:             # <<<<<<<<<<<<<<
31435  *             return None
31436  *         return _elementFactory(new_doc, c_node)
31437  */
31438   __pyx_t_3 = (__pyx_v_c_node == NULL);
31439   if (__pyx_t_3) {
31440
31441     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":626
31442  *             c_node = c_node.next
31443  *         if c_node is NULL:
31444  *             return None             # <<<<<<<<<<<<<<
31445  *         return _elementFactory(new_doc, c_node)
31446  * 
31447  */
31448     __Pyx_XDECREF(__pyx_r);
31449     __Pyx_INCREF(Py_None);
31450     __pyx_r = Py_None;
31451     goto __pyx_L0;
31452     goto __pyx_L8;
31453   }
31454   __pyx_L8:;
31455
31456   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":627
31457  *         if c_node is NULL:
31458  *             return None
31459  *         return _elementFactory(new_doc, c_node)             # <<<<<<<<<<<<<<
31460  * 
31461  *     def set(self, key, value):
31462  */
31463   __Pyx_XDECREF(__pyx_r);
31464   __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_new_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31465   __Pyx_GOTREF(__pyx_t_2);
31466   __pyx_r = __pyx_t_2;
31467   __pyx_t_2 = 0;
31468   goto __pyx_L0;
31469
31470   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
31471   goto __pyx_L0;
31472   __pyx_L1_error:;
31473   __Pyx_XDECREF(__pyx_t_2);
31474   __Pyx_AddTraceback("lxml.etree._Element.__copy__");
31475   __pyx_r = NULL;
31476   __pyx_L0:;
31477   __Pyx_DECREF((PyObject *)__pyx_v_new_doc);
31478   __Pyx_DECREF(__pyx_v_root);
31479   __Pyx_XGIVEREF(__pyx_r);
31480   __Pyx_FinishRefcountContext();
31481   return __pyx_r;
31482 }
31483
31484 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":629
31485  *         return _elementFactory(new_doc, c_node)
31486  * 
31487  *     def set(self, key, value):             # <<<<<<<<<<<<<<
31488  *         u"""set(self, key, value)
31489  * 
31490  */
31491
31492 static PyObject *__pyx_pf_4lxml_5etree_8_Element_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
31493 static char __pyx_doc_4lxml_5etree_8_Element_set[] = "set(self, key, value)\n\n        Sets an element attribute.\n        ";
31494 static PyObject *__pyx_pf_4lxml_5etree_8_Element_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
31495   PyObject *__pyx_v_key = 0;
31496   PyObject *__pyx_v_value = 0;
31497   PyObject *__pyx_r = NULL;
31498   int __pyx_t_1;
31499   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_key,&__pyx_kp_value,0};
31500   __Pyx_SetupRefcountContext("set");
31501   if (unlikely(__pyx_kwds)) {
31502     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
31503     PyObject* values[2] = {0,0};
31504     switch (PyTuple_GET_SIZE(__pyx_args)) {
31505       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
31506       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
31507       case  0: break;
31508       default: goto __pyx_L5_argtuple_error;
31509     }
31510     switch (PyTuple_GET_SIZE(__pyx_args)) {
31511       case  0:
31512       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_key);
31513       if (likely(values[0])) kw_args--;
31514       else goto __pyx_L5_argtuple_error;
31515       case  1:
31516       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_value);
31517       if (likely(values[1])) kw_args--;
31518       else {
31519         __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
31520       }
31521     }
31522     if (unlikely(kw_args > 0)) {
31523       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "set") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
31524     }
31525     __pyx_v_key = values[0];
31526     __pyx_v_value = values[1];
31527   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
31528     goto __pyx_L5_argtuple_error;
31529   } else {
31530     __pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 0);
31531     __pyx_v_value = PyTuple_GET_ITEM(__pyx_args, 1);
31532   }
31533   goto __pyx_L4_argument_unpacking_done;
31534   __pyx_L5_argtuple_error:;
31535   __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
31536   __pyx_L3_error:;
31537   __Pyx_AddTraceback("lxml.etree._Element.set");
31538   return NULL;
31539   __pyx_L4_argument_unpacking_done:;
31540
31541   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":634
31542  *         Sets an element attribute.
31543  *         """
31544  *         _setAttributeValue(self, key, value)             # <<<<<<<<<<<<<<
31545  * 
31546  *     def append(self, _Element element not None):
31547  */
31548   __pyx_t_1 = __pyx_f_4lxml_5etree__setAttributeValue(((struct LxmlElement *)__pyx_v_self), __pyx_v_key, __pyx_v_value); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31549
31550   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
31551   goto __pyx_L0;
31552   __pyx_L1_error:;
31553   __Pyx_AddTraceback("lxml.etree._Element.set");
31554   __pyx_r = NULL;
31555   __pyx_L0:;
31556   __Pyx_XGIVEREF(__pyx_r);
31557   __Pyx_FinishRefcountContext();
31558   return __pyx_r;
31559 }
31560
31561 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":636
31562  *         _setAttributeValue(self, key, value)
31563  * 
31564  *     def append(self, _Element element not None):             # <<<<<<<<<<<<<<
31565  *         u"""append(self, element)
31566  * 
31567  */
31568
31569 static PyObject *__pyx_pf_4lxml_5etree_8_Element_append(PyObject *__pyx_v_self, PyObject *__pyx_v_element); /*proto*/
31570 static char __pyx_doc_4lxml_5etree_8_Element_append[] = "append(self, element)\n\n        Adds a subelement to the end of this element.\n        ";
31571 static PyObject *__pyx_pf_4lxml_5etree_8_Element_append(PyObject *__pyx_v_self, PyObject *__pyx_v_element) {
31572   PyObject *__pyx_r = NULL;
31573   int __pyx_t_1;
31574   __Pyx_SetupRefcountContext("append");
31575   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31576
31577   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":641
31578  *         Adds a subelement to the end of this element.
31579  *         """
31580  *         _appendChild(self, element)             # <<<<<<<<<<<<<<
31581  * 
31582  *     def addnext(self, _Element element):
31583  */
31584   __pyx_t_1 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_v_self), ((struct LxmlElement *)__pyx_v_element)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31585
31586   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
31587   goto __pyx_L0;
31588   __pyx_L1_error:;
31589   __Pyx_AddTraceback("lxml.etree._Element.append");
31590   __pyx_r = NULL;
31591   __pyx_L0:;
31592   __Pyx_XGIVEREF(__pyx_r);
31593   __Pyx_FinishRefcountContext();
31594   return __pyx_r;
31595 }
31596
31597 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":643
31598  *         _appendChild(self, element)
31599  * 
31600  *     def addnext(self, _Element element):             # <<<<<<<<<<<<<<
31601  *         u"""addnext(self, element)
31602  * 
31603  */
31604
31605 static PyObject *__pyx_pf_4lxml_5etree_8_Element_addnext(PyObject *__pyx_v_self, PyObject *__pyx_v_element); /*proto*/
31606 static char __pyx_doc_4lxml_5etree_8_Element_addnext[] = "addnext(self, element)\n\n        Adds the element as a following sibling directly after this\n        element.\n\n        This is normally used to set a processing instruction or comment after\n        the root node of a document.  Note that tail text is automatically\n        discarded when adding at the root level.\n        ";
31607 static PyObject *__pyx_pf_4lxml_5etree_8_Element_addnext(PyObject *__pyx_v_self, PyObject *__pyx_v_element) {
31608   PyObject *__pyx_r = NULL;
31609   int __pyx_t_1;
31610   int __pyx_t_2;
31611   __Pyx_SetupRefcountContext("addnext");
31612   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 1, "element", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31613
31614   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":653
31615  *         discarded when adding at the root level.
31616  *         """
31617  *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):             # <<<<<<<<<<<<<<
31618  *             if element._c_node.type != tree.XML_PI_NODE:
31619  *                 if element._c_node.type != tree.XML_COMMENT_NODE:
31620  */
31621   if ((((struct LxmlElement *)__pyx_v_self)->_c_node->parent != NULL)) {
31622     __pyx_t_1 = (!_isElement(((struct LxmlElement *)__pyx_v_self)->_c_node->parent));
31623   } else {
31624     __pyx_t_1 = (((struct LxmlElement *)__pyx_v_self)->_c_node->parent != NULL);
31625   }
31626   if (__pyx_t_1) {
31627
31628     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":654
31629  *         """
31630  *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):
31631  *             if element._c_node.type != tree.XML_PI_NODE:             # <<<<<<<<<<<<<<
31632  *                 if element._c_node.type != tree.XML_COMMENT_NODE:
31633  *                     raise TypeError, u"Only processing instructions and comments can be siblings of the root element"
31634  */
31635     __pyx_t_1 = (((struct LxmlElement *)__pyx_v_element)->_c_node->type != XML_PI_NODE);
31636     if (__pyx_t_1) {
31637
31638       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":655
31639  *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):
31640  *             if element._c_node.type != tree.XML_PI_NODE:
31641  *                 if element._c_node.type != tree.XML_COMMENT_NODE:             # <<<<<<<<<<<<<<
31642  *                     raise TypeError, u"Only processing instructions and comments can be siblings of the root element"
31643  *             element.tail = None
31644  */
31645       __pyx_t_1 = (((struct LxmlElement *)__pyx_v_element)->_c_node->type != XML_COMMENT_NODE);
31646       if (__pyx_t_1) {
31647
31648         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":656
31649  *             if element._c_node.type != tree.XML_PI_NODE:
31650  *                 if element._c_node.type != tree.XML_COMMENT_NODE:
31651  *                     raise TypeError, u"Only processing instructions and comments can be siblings of the root element"             # <<<<<<<<<<<<<<
31652  *             element.tail = None
31653  *         _appendSibling(self, element)
31654  */
31655         __Pyx_Raise(__pyx_builtin_TypeError, ((PyObject *)__pyx_kp_317), 0);
31656         {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31657         goto __pyx_L7;
31658       }
31659       __pyx_L7:;
31660       goto __pyx_L6;
31661     }
31662     __pyx_L6:;
31663
31664     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":657
31665  *                 if element._c_node.type != tree.XML_COMMENT_NODE:
31666  *                     raise TypeError, u"Only processing instructions and comments can be siblings of the root element"
31667  *             element.tail = None             # <<<<<<<<<<<<<<
31668  *         _appendSibling(self, element)
31669  * 
31670  */
31671     if (PyObject_SetAttr(__pyx_v_element, __pyx_kp_tail, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31672     goto __pyx_L5;
31673   }
31674   __pyx_L5:;
31675
31676   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":658
31677  *                     raise TypeError, u"Only processing instructions and comments can be siblings of the root element"
31678  *             element.tail = None
31679  *         _appendSibling(self, element)             # <<<<<<<<<<<<<<
31680  * 
31681  *     def addprevious(self, _Element element):
31682  */
31683   __pyx_t_2 = __pyx_f_4lxml_5etree__appendSibling(((struct LxmlElement *)__pyx_v_self), ((struct LxmlElement *)__pyx_v_element)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31684
31685   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
31686   goto __pyx_L0;
31687   __pyx_L1_error:;
31688   __Pyx_AddTraceback("lxml.etree._Element.addnext");
31689   __pyx_r = NULL;
31690   __pyx_L0:;
31691   __Pyx_XGIVEREF(__pyx_r);
31692   __Pyx_FinishRefcountContext();
31693   return __pyx_r;
31694 }
31695
31696 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":660
31697  *         _appendSibling(self, element)
31698  * 
31699  *     def addprevious(self, _Element element):             # <<<<<<<<<<<<<<
31700  *         u"""addprevious(self, element)
31701  * 
31702  */
31703
31704 static PyObject *__pyx_pf_4lxml_5etree_8_Element_addprevious(PyObject *__pyx_v_self, PyObject *__pyx_v_element); /*proto*/
31705 static char __pyx_doc_4lxml_5etree_8_Element_addprevious[] = "addprevious(self, element)\n\n        Adds the element as a preceding sibling directly before this\n        element.\n\n        This is normally used to set a processing instruction or comment\n        before the root node of a document.  Note that tail text is\n        automatically discarded when adding at the root level.\n        ";
31706 static PyObject *__pyx_pf_4lxml_5etree_8_Element_addprevious(PyObject *__pyx_v_self, PyObject *__pyx_v_element) {
31707   PyObject *__pyx_r = NULL;
31708   int __pyx_t_1;
31709   int __pyx_t_2;
31710   __Pyx_SetupRefcountContext("addprevious");
31711   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 1, "element", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31712
31713   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":670
31714  *         automatically discarded when adding at the root level.
31715  *         """
31716  *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):             # <<<<<<<<<<<<<<
31717  *             if element._c_node.type != tree.XML_PI_NODE:
31718  *                 if element._c_node.type != tree.XML_COMMENT_NODE:
31719  */
31720   if ((((struct LxmlElement *)__pyx_v_self)->_c_node->parent != NULL)) {
31721     __pyx_t_1 = (!_isElement(((struct LxmlElement *)__pyx_v_self)->_c_node->parent));
31722   } else {
31723     __pyx_t_1 = (((struct LxmlElement *)__pyx_v_self)->_c_node->parent != NULL);
31724   }
31725   if (__pyx_t_1) {
31726
31727     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":671
31728  *         """
31729  *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):
31730  *             if element._c_node.type != tree.XML_PI_NODE:             # <<<<<<<<<<<<<<
31731  *                 if element._c_node.type != tree.XML_COMMENT_NODE:
31732  *                     raise TypeError, u"Only processing instructions and comments can be siblings of the root element"
31733  */
31734     __pyx_t_1 = (((struct LxmlElement *)__pyx_v_element)->_c_node->type != XML_PI_NODE);
31735     if (__pyx_t_1) {
31736
31737       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":672
31738  *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):
31739  *             if element._c_node.type != tree.XML_PI_NODE:
31740  *                 if element._c_node.type != tree.XML_COMMENT_NODE:             # <<<<<<<<<<<<<<
31741  *                     raise TypeError, u"Only processing instructions and comments can be siblings of the root element"
31742  *             element.tail = None
31743  */
31744       __pyx_t_1 = (((struct LxmlElement *)__pyx_v_element)->_c_node->type != XML_COMMENT_NODE);
31745       if (__pyx_t_1) {
31746
31747         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":673
31748  *             if element._c_node.type != tree.XML_PI_NODE:
31749  *                 if element._c_node.type != tree.XML_COMMENT_NODE:
31750  *                     raise TypeError, u"Only processing instructions and comments can be siblings of the root element"             # <<<<<<<<<<<<<<
31751  *             element.tail = None
31752  *         _prependSibling(self, element)
31753  */
31754         __Pyx_Raise(__pyx_builtin_TypeError, ((PyObject *)__pyx_kp_318), 0);
31755         {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31756         goto __pyx_L7;
31757       }
31758       __pyx_L7:;
31759       goto __pyx_L6;
31760     }
31761     __pyx_L6:;
31762
31763     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":674
31764  *                 if element._c_node.type != tree.XML_COMMENT_NODE:
31765  *                     raise TypeError, u"Only processing instructions and comments can be siblings of the root element"
31766  *             element.tail = None             # <<<<<<<<<<<<<<
31767  *         _prependSibling(self, element)
31768  * 
31769  */
31770     if (PyObject_SetAttr(__pyx_v_element, __pyx_kp_tail, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31771     goto __pyx_L5;
31772   }
31773   __pyx_L5:;
31774
31775   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":675
31776  *                     raise TypeError, u"Only processing instructions and comments can be siblings of the root element"
31777  *             element.tail = None
31778  *         _prependSibling(self, element)             # <<<<<<<<<<<<<<
31779  * 
31780  *     def extend(self, elements):
31781  */
31782   __pyx_t_2 = __pyx_f_4lxml_5etree__prependSibling(((struct LxmlElement *)__pyx_v_self), ((struct LxmlElement *)__pyx_v_element)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31783
31784   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
31785   goto __pyx_L0;
31786   __pyx_L1_error:;
31787   __Pyx_AddTraceback("lxml.etree._Element.addprevious");
31788   __pyx_r = NULL;
31789   __pyx_L0:;
31790   __Pyx_XGIVEREF(__pyx_r);
31791   __Pyx_FinishRefcountContext();
31792   return __pyx_r;
31793 }
31794
31795 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":677
31796  *         _prependSibling(self, element)
31797  * 
31798  *     def extend(self, elements):             # <<<<<<<<<<<<<<
31799  *         u"""extend(self, elements)
31800  * 
31801  */
31802
31803 static PyObject *__pyx_pf_4lxml_5etree_8_Element_extend(PyObject *__pyx_v_self, PyObject *__pyx_v_elements); /*proto*/
31804 static char __pyx_doc_4lxml_5etree_8_Element_extend[] = "extend(self, elements)\n\n        Extends the current children by the elements in the iterable.\n        ";
31805 static PyObject *__pyx_pf_4lxml_5etree_8_Element_extend(PyObject *__pyx_v_self, PyObject *__pyx_v_elements) {
31806   PyObject *__pyx_v_element;
31807   PyObject *__pyx_r = NULL;
31808   Py_ssize_t __pyx_t_1;
31809   PyObject *__pyx_t_2 = NULL;
31810   PyObject *__pyx_t_3 = NULL;
31811   int __pyx_t_4;
31812   __Pyx_SetupRefcountContext("extend");
31813   __pyx_v_element = Py_None; __Pyx_INCREF(Py_None);
31814
31815   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":682
31816  *         Extends the current children by the elements in the iterable.
31817  *         """
31818  *         for element in elements:             # <<<<<<<<<<<<<<
31819  *             _appendChild(self, element)
31820  * 
31821  */
31822   if (PyList_CheckExact(__pyx_v_elements) || PyTuple_CheckExact(__pyx_v_elements)) {
31823     __pyx_t_1 = 0; __pyx_t_2 = __pyx_v_elements; __Pyx_INCREF(__pyx_t_2);
31824   } else {
31825     __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31826     __Pyx_GOTREF(__pyx_t_2);
31827   }
31828   for (;;) {
31829     if (likely(PyList_CheckExact(__pyx_t_2))) {
31830       if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break;
31831       __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
31832     } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
31833       if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
31834       __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
31835     } else {
31836       __pyx_t_3 = PyIter_Next(__pyx_t_2);
31837       if (!__pyx_t_3) {
31838         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31839         break;
31840       }
31841       __Pyx_GOTREF(__pyx_t_3);
31842     }
31843     __Pyx_DECREF(__pyx_v_element);
31844     __pyx_v_element = __pyx_t_3;
31845     __pyx_t_3 = 0;
31846
31847     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":683
31848  *         """
31849  *         for element in elements:
31850  *             _appendChild(self, element)             # <<<<<<<<<<<<<<
31851  * 
31852  *     def clear(self):
31853  */
31854     if (!(__Pyx_TypeTest(__pyx_v_element, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31855     __pyx_t_4 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_v_self), ((struct LxmlElement *)__pyx_v_element)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
31856   }
31857   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
31858
31859   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
31860   goto __pyx_L0;
31861   __pyx_L1_error:;
31862   __Pyx_XDECREF(__pyx_t_2);
31863   __Pyx_XDECREF(__pyx_t_3);
31864   __Pyx_AddTraceback("lxml.etree._Element.extend");
31865   __pyx_r = NULL;
31866   __pyx_L0:;
31867   __Pyx_DECREF(__pyx_v_element);
31868   __Pyx_XGIVEREF(__pyx_r);
31869   __Pyx_FinishRefcountContext();
31870   return __pyx_r;
31871 }
31872
31873 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":685
31874  *             _appendChild(self, element)
31875  * 
31876  *     def clear(self):             # <<<<<<<<<<<<<<
31877  *         u"""clear(self)
31878  * 
31879  */
31880
31881 static PyObject *__pyx_pf_4lxml_5etree_8_Element_clear(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
31882 static char __pyx_doc_4lxml_5etree_8_Element_clear[] = "clear(self)\n\n        Resets an element.  This function removes all subelements, clears\n        all attributes and sets the text and tail properties to None.\n        ";
31883 static PyObject *__pyx_pf_4lxml_5etree_8_Element_clear(PyObject *__pyx_v_self, PyObject *unused) {
31884   xmlAttr *__pyx_v_c_attr;
31885   xmlAttr *__pyx_v_c_attr_next;
31886   xmlNode *__pyx_v_c_node;
31887   xmlNode *__pyx_v_c_node_next;
31888   PyObject *__pyx_r = NULL;
31889   int __pyx_t_1;
31890   int __pyx_t_2;
31891   __Pyx_SetupRefcountContext("clear");
31892
31893   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":695
31894  *         cdef xmlNode* c_node
31895  *         cdef xmlNode* c_node_next
31896  *         c_node = self._c_node             # <<<<<<<<<<<<<<
31897  *         # remove self.text and self.tail
31898  *         _removeText(c_node.children)
31899  */
31900   __pyx_v_c_node = ((struct LxmlElement *)__pyx_v_self)->_c_node;
31901
31902   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":697
31903  *         c_node = self._c_node
31904  *         # remove self.text and self.tail
31905  *         _removeText(c_node.children)             # <<<<<<<<<<<<<<
31906  *         _removeText(c_node.next)
31907  *         # remove all attributes
31908  */
31909   __pyx_f_4lxml_5etree__removeText(__pyx_v_c_node->children);
31910
31911   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":698
31912  *         # remove self.text and self.tail
31913  *         _removeText(c_node.children)
31914  *         _removeText(c_node.next)             # <<<<<<<<<<<<<<
31915  *         # remove all attributes
31916  *         c_attr = c_node.properties
31917  */
31918   __pyx_f_4lxml_5etree__removeText(__pyx_v_c_node->next);
31919
31920   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":700
31921  *         _removeText(c_node.next)
31922  *         # remove all attributes
31923  *         c_attr = c_node.properties             # <<<<<<<<<<<<<<
31924  *         while c_attr is not NULL:
31925  *             c_attr_next = c_attr.next
31926  */
31927   __pyx_v_c_attr = __pyx_v_c_node->properties;
31928
31929   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":701
31930  *         # remove all attributes
31931  *         c_attr = c_node.properties
31932  *         while c_attr is not NULL:             # <<<<<<<<<<<<<<
31933  *             c_attr_next = c_attr.next
31934  *             tree.xmlRemoveProp(c_attr)
31935  */
31936   while (1) {
31937     __pyx_t_1 = (__pyx_v_c_attr != NULL);
31938     if (!__pyx_t_1) break;
31939
31940     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":702
31941  *         c_attr = c_node.properties
31942  *         while c_attr is not NULL:
31943  *             c_attr_next = c_attr.next             # <<<<<<<<<<<<<<
31944  *             tree.xmlRemoveProp(c_attr)
31945  *             c_attr = c_attr_next
31946  */
31947     __pyx_v_c_attr_next = __pyx_v_c_attr->next;
31948
31949     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":703
31950  *         while c_attr is not NULL:
31951  *             c_attr_next = c_attr.next
31952  *             tree.xmlRemoveProp(c_attr)             # <<<<<<<<<<<<<<
31953  *             c_attr = c_attr_next
31954  *         # remove all subelements
31955  */
31956     xmlRemoveProp(__pyx_v_c_attr);
31957
31958     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":704
31959  *             c_attr_next = c_attr.next
31960  *             tree.xmlRemoveProp(c_attr)
31961  *             c_attr = c_attr_next             # <<<<<<<<<<<<<<
31962  *         # remove all subelements
31963  *         c_node = c_node.children
31964  */
31965     __pyx_v_c_attr = __pyx_v_c_attr_next;
31966   }
31967
31968   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":706
31969  *             c_attr = c_attr_next
31970  *         # remove all subelements
31971  *         c_node = c_node.children             # <<<<<<<<<<<<<<
31972  *         if c_node is not NULL:
31973  *             if not _isElement(c_node):
31974  */
31975   __pyx_v_c_node = __pyx_v_c_node->children;
31976
31977   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":707
31978  *         # remove all subelements
31979  *         c_node = c_node.children
31980  *         if c_node is not NULL:             # <<<<<<<<<<<<<<
31981  *             if not _isElement(c_node):
31982  *                 c_node = _nextElement(c_node)
31983  */
31984   __pyx_t_1 = (__pyx_v_c_node != NULL);
31985   if (__pyx_t_1) {
31986
31987     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":708
31988  *         c_node = c_node.children
31989  *         if c_node is not NULL:
31990  *             if not _isElement(c_node):             # <<<<<<<<<<<<<<
31991  *                 c_node = _nextElement(c_node)
31992  *             while c_node is not NULL:
31993  */
31994     __pyx_t_1 = (!_isElement(__pyx_v_c_node));
31995     if (__pyx_t_1) {
31996
31997       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":709
31998  *         if c_node is not NULL:
31999  *             if not _isElement(c_node):
32000  *                 c_node = _nextElement(c_node)             # <<<<<<<<<<<<<<
32001  *             while c_node is not NULL:
32002  *                 c_node_next = _nextElement(c_node)
32003  */
32004       __pyx_v_c_node = __pyx_f_4lxml_5etree__nextElement(__pyx_v_c_node);
32005       goto __pyx_L8;
32006     }
32007     __pyx_L8:;
32008
32009     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":710
32010  *             if not _isElement(c_node):
32011  *                 c_node = _nextElement(c_node)
32012  *             while c_node is not NULL:             # <<<<<<<<<<<<<<
32013  *                 c_node_next = _nextElement(c_node)
32014  *                 _removeNode(self._doc, c_node)
32015  */
32016     while (1) {
32017       __pyx_t_1 = (__pyx_v_c_node != NULL);
32018       if (!__pyx_t_1) break;
32019
32020       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":711
32021  *                 c_node = _nextElement(c_node)
32022  *             while c_node is not NULL:
32023  *                 c_node_next = _nextElement(c_node)             # <<<<<<<<<<<<<<
32024  *                 _removeNode(self._doc, c_node)
32025  *                 c_node = c_node_next
32026  */
32027       __pyx_v_c_node_next = __pyx_f_4lxml_5etree__nextElement(__pyx_v_c_node);
32028
32029       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":712
32030  *             while c_node is not NULL:
32031  *                 c_node_next = _nextElement(c_node)
32032  *                 _removeNode(self._doc, c_node)             # <<<<<<<<<<<<<<
32033  *                 c_node = c_node_next
32034  * 
32035  */
32036       __pyx_t_2 = __pyx_f_4lxml_5etree__removeNode(((struct LxmlElement *)__pyx_v_self)->_doc, __pyx_v_c_node); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32037
32038       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":713
32039  *                 c_node_next = _nextElement(c_node)
32040  *                 _removeNode(self._doc, c_node)
32041  *                 c_node = c_node_next             # <<<<<<<<<<<<<<
32042  * 
32043  *     def insert(self, index, _Element element not None):
32044  */
32045       __pyx_v_c_node = __pyx_v_c_node_next;
32046     }
32047     goto __pyx_L7;
32048   }
32049   __pyx_L7:;
32050
32051   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
32052   goto __pyx_L0;
32053   __pyx_L1_error:;
32054   __Pyx_AddTraceback("lxml.etree._Element.clear");
32055   __pyx_r = NULL;
32056   __pyx_L0:;
32057   __Pyx_XGIVEREF(__pyx_r);
32058   __Pyx_FinishRefcountContext();
32059   return __pyx_r;
32060 }
32061
32062 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":715
32063  *                 c_node = c_node_next
32064  * 
32065  *     def insert(self, index, _Element element not None):             # <<<<<<<<<<<<<<
32066  *         u"""insert(self, index, element)
32067  * 
32068  */
32069
32070 static PyObject *__pyx_pf_4lxml_5etree_8_Element_insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
32071 static char __pyx_doc_4lxml_5etree_8_Element_insert[] = "insert(self, index, element)\n\n        Inserts a subelement at the given position in this element\n        ";
32072 static PyObject *__pyx_pf_4lxml_5etree_8_Element_insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
32073   PyObject *__pyx_v_index = 0;
32074   struct LxmlElement *__pyx_v_element = 0;
32075   xmlNode *__pyx_v_c_node;
32076   xmlNode *__pyx_v_c_next;
32077   xmlDoc *__pyx_v_c_source_doc;
32078   PyObject *__pyx_r = NULL;
32079   Py_ssize_t __pyx_t_1;
32080   int __pyx_t_2;
32081   int __pyx_t_3;
32082   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_index,&__pyx_kp_element,0};
32083   __Pyx_SetupRefcountContext("insert");
32084   if (unlikely(__pyx_kwds)) {
32085     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
32086     PyObject* values[2] = {0,0};
32087     switch (PyTuple_GET_SIZE(__pyx_args)) {
32088       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
32089       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
32090       case  0: break;
32091       default: goto __pyx_L5_argtuple_error;
32092     }
32093     switch (PyTuple_GET_SIZE(__pyx_args)) {
32094       case  0:
32095       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_index);
32096       if (likely(values[0])) kw_args--;
32097       else goto __pyx_L5_argtuple_error;
32098       case  1:
32099       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_element);
32100       if (likely(values[1])) kw_args--;
32101       else {
32102         __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
32103       }
32104     }
32105     if (unlikely(kw_args > 0)) {
32106       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "insert") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
32107     }
32108     __pyx_v_index = values[0];
32109     __pyx_v_element = ((struct LxmlElement *)values[1]);
32110   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
32111     goto __pyx_L5_argtuple_error;
32112   } else {
32113     __pyx_v_index = PyTuple_GET_ITEM(__pyx_args, 0);
32114     __pyx_v_element = ((struct LxmlElement *)PyTuple_GET_ITEM(__pyx_args, 1));
32115   }
32116   goto __pyx_L4_argument_unpacking_done;
32117   __pyx_L5_argtuple_error:;
32118   __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
32119   __pyx_L3_error:;
32120   __Pyx_AddTraceback("lxml.etree._Element.insert");
32121   return NULL;
32122   __pyx_L4_argument_unpacking_done:;
32123   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32124
32125   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":723
32126  *         cdef xmlNode* c_next
32127  *         cdef xmlDoc* c_source_doc
32128  *         c_node = _findChild(self._c_node, index)             # <<<<<<<<<<<<<<
32129  *         if c_node is NULL:
32130  *             _appendChild(self, element)
32131  */
32132   __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32133   __pyx_v_c_node = __pyx_f_4lxml_5etree__findChild(((struct LxmlElement *)__pyx_v_self)->_c_node, __pyx_t_1);
32134
32135   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":724
32136  *         cdef xmlDoc* c_source_doc
32137  *         c_node = _findChild(self._c_node, index)
32138  *         if c_node is NULL:             # <<<<<<<<<<<<<<
32139  *             _appendChild(self, element)
32140  *             return
32141  */
32142   __pyx_t_2 = (__pyx_v_c_node == NULL);
32143   if (__pyx_t_2) {
32144
32145     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":725
32146  *         c_node = _findChild(self._c_node, index)
32147  *         if c_node is NULL:
32148  *             _appendChild(self, element)             # <<<<<<<<<<<<<<
32149  *             return
32150  *         c_source_doc = c_node.doc
32151  */
32152     __pyx_t_3 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_v_self), __pyx_v_element); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32153
32154     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":726
32155  *         if c_node is NULL:
32156  *             _appendChild(self, element)
32157  *             return             # <<<<<<<<<<<<<<
32158  *         c_source_doc = c_node.doc
32159  *         c_next = element._c_node.next
32160  */
32161     __Pyx_XDECREF(__pyx_r);
32162     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
32163     goto __pyx_L0;
32164     goto __pyx_L6;
32165   }
32166   __pyx_L6:;
32167
32168   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":727
32169  *             _appendChild(self, element)
32170  *             return
32171  *         c_source_doc = c_node.doc             # <<<<<<<<<<<<<<
32172  *         c_next = element._c_node.next
32173  *         tree.xmlAddPrevSibling(c_node, element._c_node)
32174  */
32175   __pyx_v_c_source_doc = __pyx_v_c_node->doc;
32176
32177   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":728
32178  *             return
32179  *         c_source_doc = c_node.doc
32180  *         c_next = element._c_node.next             # <<<<<<<<<<<<<<
32181  *         tree.xmlAddPrevSibling(c_node, element._c_node)
32182  *         _moveTail(c_next, element._c_node)
32183  */
32184   __pyx_v_c_next = __pyx_v_element->_c_node->next;
32185
32186   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":729
32187  *         c_source_doc = c_node.doc
32188  *         c_next = element._c_node.next
32189  *         tree.xmlAddPrevSibling(c_node, element._c_node)             # <<<<<<<<<<<<<<
32190  *         _moveTail(c_next, element._c_node)
32191  *         moveNodeToDocument(self._doc, c_source_doc, element._c_node)
32192  */
32193   xmlAddPrevSibling(__pyx_v_c_node, __pyx_v_element->_c_node);
32194
32195   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":730
32196  *         c_next = element._c_node.next
32197  *         tree.xmlAddPrevSibling(c_node, element._c_node)
32198  *         _moveTail(c_next, element._c_node)             # <<<<<<<<<<<<<<
32199  *         moveNodeToDocument(self._doc, c_source_doc, element._c_node)
32200  * 
32201  */
32202   __pyx_f_4lxml_5etree__moveTail(__pyx_v_c_next, __pyx_v_element->_c_node);
32203
32204   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":731
32205  *         tree.xmlAddPrevSibling(c_node, element._c_node)
32206  *         _moveTail(c_next, element._c_node)
32207  *         moveNodeToDocument(self._doc, c_source_doc, element._c_node)             # <<<<<<<<<<<<<<
32208  * 
32209  *     def remove(self, _Element element not None):
32210  */
32211   __pyx_t_3 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlElement *)__pyx_v_self)->_doc, __pyx_v_c_source_doc, __pyx_v_element->_c_node); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32212
32213   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
32214   goto __pyx_L0;
32215   __pyx_L1_error:;
32216   __Pyx_AddTraceback("lxml.etree._Element.insert");
32217   __pyx_r = NULL;
32218   __pyx_L0:;
32219   __Pyx_XGIVEREF(__pyx_r);
32220   __Pyx_FinishRefcountContext();
32221   return __pyx_r;
32222 }
32223
32224 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":733
32225  *         moveNodeToDocument(self._doc, c_source_doc, element._c_node)
32226  * 
32227  *     def remove(self, _Element element not None):             # <<<<<<<<<<<<<<
32228  *         u"""remove(self, element)
32229  * 
32230  */
32231
32232 static PyObject *__pyx_pf_4lxml_5etree_8_Element_remove(PyObject *__pyx_v_self, PyObject *__pyx_v_element); /*proto*/
32233 static char __pyx_doc_4lxml_5etree_8_Element_remove[] = "remove(self, element)\n\n        Removes a matching subelement. Unlike the find methods, this\n        method compares elements based on identity, not on tag value\n        or contents.\n        ";
32234 static PyObject *__pyx_pf_4lxml_5etree_8_Element_remove(PyObject *__pyx_v_self, PyObject *__pyx_v_element) {
32235   xmlNode *__pyx_v_c_node;
32236   xmlNode *__pyx_v_c_next;
32237   PyObject *__pyx_r = NULL;
32238   int __pyx_t_1;
32239   int __pyx_t_2;
32240   __Pyx_SetupRefcountContext("remove");
32241   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32242
32243   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":742
32244  *         cdef xmlNode* c_node
32245  *         cdef xmlNode* c_next
32246  *         c_node = element._c_node             # <<<<<<<<<<<<<<
32247  *         if c_node.parent is not self._c_node:
32248  *             raise ValueError, u"Element is not a child of this node."
32249  */
32250   __pyx_v_c_node = ((struct LxmlElement *)__pyx_v_element)->_c_node;
32251
32252   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":743
32253  *         cdef xmlNode* c_next
32254  *         c_node = element._c_node
32255  *         if c_node.parent is not self._c_node:             # <<<<<<<<<<<<<<
32256  *             raise ValueError, u"Element is not a child of this node."
32257  *         c_next = element._c_node.next
32258  */
32259   __pyx_t_1 = (__pyx_v_c_node->parent != ((struct LxmlElement *)__pyx_v_self)->_c_node);
32260   if (__pyx_t_1) {
32261
32262     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":744
32263  *         c_node = element._c_node
32264  *         if c_node.parent is not self._c_node:
32265  *             raise ValueError, u"Element is not a child of this node."             # <<<<<<<<<<<<<<
32266  *         c_next = element._c_node.next
32267  *         tree.xmlUnlinkNode(c_node)
32268  */
32269     __Pyx_Raise(__pyx_builtin_ValueError, ((PyObject *)__pyx_kp_319), 0);
32270     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32271     goto __pyx_L5;
32272   }
32273   __pyx_L5:;
32274
32275   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":745
32276  *         if c_node.parent is not self._c_node:
32277  *             raise ValueError, u"Element is not a child of this node."
32278  *         c_next = element._c_node.next             # <<<<<<<<<<<<<<
32279  *         tree.xmlUnlinkNode(c_node)
32280  *         _moveTail(c_next, c_node)
32281  */
32282   __pyx_v_c_next = ((struct LxmlElement *)__pyx_v_element)->_c_node->next;
32283
32284   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":746
32285  *             raise ValueError, u"Element is not a child of this node."
32286  *         c_next = element._c_node.next
32287  *         tree.xmlUnlinkNode(c_node)             # <<<<<<<<<<<<<<
32288  *         _moveTail(c_next, c_node)
32289  *         # fix namespace declarations
32290  */
32291   xmlUnlinkNode(__pyx_v_c_node);
32292
32293   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":747
32294  *         c_next = element._c_node.next
32295  *         tree.xmlUnlinkNode(c_node)
32296  *         _moveTail(c_next, c_node)             # <<<<<<<<<<<<<<
32297  *         # fix namespace declarations
32298  *         moveNodeToDocument(self._doc, c_node.doc, c_node)
32299  */
32300   __pyx_f_4lxml_5etree__moveTail(__pyx_v_c_next, __pyx_v_c_node);
32301
32302   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":749
32303  *         _moveTail(c_next, c_node)
32304  *         # fix namespace declarations
32305  *         moveNodeToDocument(self._doc, c_node.doc, c_node)             # <<<<<<<<<<<<<<
32306  * 
32307  *     def replace(self, _Element old_element not None,
32308  */
32309   __pyx_t_2 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlElement *)__pyx_v_self)->_doc, __pyx_v_c_node->doc, __pyx_v_c_node); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32310
32311   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
32312   goto __pyx_L0;
32313   __pyx_L1_error:;
32314   __Pyx_AddTraceback("lxml.etree._Element.remove");
32315   __pyx_r = NULL;
32316   __pyx_L0:;
32317   __Pyx_XGIVEREF(__pyx_r);
32318   __Pyx_FinishRefcountContext();
32319   return __pyx_r;
32320 }
32321
32322 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":751
32323  *         moveNodeToDocument(self._doc, c_node.doc, c_node)
32324  * 
32325  *     def replace(self, _Element old_element not None,             # <<<<<<<<<<<<<<
32326  *                 _Element new_element not None):
32327  *         u"""replace(self, old_element, new_element)
32328  */
32329
32330 static PyObject *__pyx_pf_4lxml_5etree_8_Element_replace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
32331 static char __pyx_doc_4lxml_5etree_8_Element_replace[] = "replace(self, old_element, new_element)\n\n        Replaces a subelement with the element passed as second argument.\n        ";
32332 static PyObject *__pyx_pf_4lxml_5etree_8_Element_replace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
32333   struct LxmlElement *__pyx_v_old_element = 0;
32334   struct LxmlElement *__pyx_v_new_element = 0;
32335   xmlNode *__pyx_v_c_old_node;
32336   xmlNode *__pyx_v_c_old_next;
32337   xmlNode *__pyx_v_c_new_node;
32338   xmlNode *__pyx_v_c_new_next;
32339   xmlDoc *__pyx_v_c_source_doc;
32340   PyObject *__pyx_r = NULL;
32341   int __pyx_t_1;
32342   int __pyx_t_2;
32343   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_old_element,&__pyx_kp_new_element,0};
32344   __Pyx_SetupRefcountContext("replace");
32345   if (unlikely(__pyx_kwds)) {
32346     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
32347     PyObject* values[2] = {0,0};
32348     switch (PyTuple_GET_SIZE(__pyx_args)) {
32349       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
32350       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
32351       case  0: break;
32352       default: goto __pyx_L5_argtuple_error;
32353     }
32354     switch (PyTuple_GET_SIZE(__pyx_args)) {
32355       case  0:
32356       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_old_element);
32357       if (likely(values[0])) kw_args--;
32358       else goto __pyx_L5_argtuple_error;
32359       case  1:
32360       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_new_element);
32361       if (likely(values[1])) kw_args--;
32362       else {
32363         __Pyx_RaiseArgtupleInvalid("replace", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
32364       }
32365     }
32366     if (unlikely(kw_args > 0)) {
32367       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "replace") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
32368     }
32369     __pyx_v_old_element = ((struct LxmlElement *)values[0]);
32370     __pyx_v_new_element = ((struct LxmlElement *)values[1]);
32371   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
32372     goto __pyx_L5_argtuple_error;
32373   } else {
32374     __pyx_v_old_element = ((struct LxmlElement *)PyTuple_GET_ITEM(__pyx_args, 0));
32375     __pyx_v_new_element = ((struct LxmlElement *)PyTuple_GET_ITEM(__pyx_args, 1));
32376   }
32377   goto __pyx_L4_argument_unpacking_done;
32378   __pyx_L5_argtuple_error:;
32379   __Pyx_RaiseArgtupleInvalid("replace", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
32380   __pyx_L3_error:;
32381   __Pyx_AddTraceback("lxml.etree._Element.replace");
32382   return NULL;
32383   __pyx_L4_argument_unpacking_done:;
32384   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old_element), __pyx_ptype_4lxml_5etree__Element, 0, "old_element", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32385   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_element), __pyx_ptype_4lxml_5etree__Element, 0, "new_element", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32386
32387   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":762
32388  *         cdef xmlNode* c_new_next
32389  *         cdef xmlDoc* c_source_doc
32390  *         c_old_node = old_element._c_node             # <<<<<<<<<<<<<<
32391  *         if c_old_node.parent is not self._c_node:
32392  *             raise ValueError, u"Element is not a child of this node."
32393  */
32394   __pyx_v_c_old_node = __pyx_v_old_element->_c_node;
32395
32396   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":763
32397  *         cdef xmlDoc* c_source_doc
32398  *         c_old_node = old_element._c_node
32399  *         if c_old_node.parent is not self._c_node:             # <<<<<<<<<<<<<<
32400  *             raise ValueError, u"Element is not a child of this node."
32401  *         c_old_next = c_old_node.next
32402  */
32403   __pyx_t_1 = (__pyx_v_c_old_node->parent != ((struct LxmlElement *)__pyx_v_self)->_c_node);
32404   if (__pyx_t_1) {
32405
32406     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":764
32407  *         c_old_node = old_element._c_node
32408  *         if c_old_node.parent is not self._c_node:
32409  *             raise ValueError, u"Element is not a child of this node."             # <<<<<<<<<<<<<<
32410  *         c_old_next = c_old_node.next
32411  *         c_new_node = new_element._c_node
32412  */
32413     __Pyx_Raise(__pyx_builtin_ValueError, ((PyObject *)__pyx_kp_320), 0);
32414     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32415     goto __pyx_L6;
32416   }
32417   __pyx_L6:;
32418
32419   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":765
32420  *         if c_old_node.parent is not self._c_node:
32421  *             raise ValueError, u"Element is not a child of this node."
32422  *         c_old_next = c_old_node.next             # <<<<<<<<<<<<<<
32423  *         c_new_node = new_element._c_node
32424  *         c_new_next = c_new_node.next
32425  */
32426   __pyx_v_c_old_next = __pyx_v_c_old_node->next;
32427
32428   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":766
32429  *             raise ValueError, u"Element is not a child of this node."
32430  *         c_old_next = c_old_node.next
32431  *         c_new_node = new_element._c_node             # <<<<<<<<<<<<<<
32432  *         c_new_next = c_new_node.next
32433  *         c_source_doc = c_new_node.doc
32434  */
32435   __pyx_v_c_new_node = __pyx_v_new_element->_c_node;
32436
32437   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":767
32438  *         c_old_next = c_old_node.next
32439  *         c_new_node = new_element._c_node
32440  *         c_new_next = c_new_node.next             # <<<<<<<<<<<<<<
32441  *         c_source_doc = c_new_node.doc
32442  *         tree.xmlReplaceNode(c_old_node, c_new_node)
32443  */
32444   __pyx_v_c_new_next = __pyx_v_c_new_node->next;
32445
32446   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":768
32447  *         c_new_node = new_element._c_node
32448  *         c_new_next = c_new_node.next
32449  *         c_source_doc = c_new_node.doc             # <<<<<<<<<<<<<<
32450  *         tree.xmlReplaceNode(c_old_node, c_new_node)
32451  *         _moveTail(c_new_next, c_new_node)
32452  */
32453   __pyx_v_c_source_doc = __pyx_v_c_new_node->doc;
32454
32455   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":769
32456  *         c_new_next = c_new_node.next
32457  *         c_source_doc = c_new_node.doc
32458  *         tree.xmlReplaceNode(c_old_node, c_new_node)             # <<<<<<<<<<<<<<
32459  *         _moveTail(c_new_next, c_new_node)
32460  *         _moveTail(c_old_next, c_old_node)
32461  */
32462   xmlReplaceNode(__pyx_v_c_old_node, __pyx_v_c_new_node);
32463
32464   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":770
32465  *         c_source_doc = c_new_node.doc
32466  *         tree.xmlReplaceNode(c_old_node, c_new_node)
32467  *         _moveTail(c_new_next, c_new_node)             # <<<<<<<<<<<<<<
32468  *         _moveTail(c_old_next, c_old_node)
32469  *         moveNodeToDocument(self._doc, c_source_doc, c_new_node)
32470  */
32471   __pyx_f_4lxml_5etree__moveTail(__pyx_v_c_new_next, __pyx_v_c_new_node);
32472
32473   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":771
32474  *         tree.xmlReplaceNode(c_old_node, c_new_node)
32475  *         _moveTail(c_new_next, c_new_node)
32476  *         _moveTail(c_old_next, c_old_node)             # <<<<<<<<<<<<<<
32477  *         moveNodeToDocument(self._doc, c_source_doc, c_new_node)
32478  *         # fix namespace declarations
32479  */
32480   __pyx_f_4lxml_5etree__moveTail(__pyx_v_c_old_next, __pyx_v_c_old_node);
32481
32482   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":772
32483  *         _moveTail(c_new_next, c_new_node)
32484  *         _moveTail(c_old_next, c_old_node)
32485  *         moveNodeToDocument(self._doc, c_source_doc, c_new_node)             # <<<<<<<<<<<<<<
32486  *         # fix namespace declarations
32487  *         moveNodeToDocument(self._doc, c_old_node.doc, c_old_node)
32488  */
32489   __pyx_t_2 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlElement *)__pyx_v_self)->_doc, __pyx_v_c_source_doc, __pyx_v_c_new_node); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32490
32491   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":774
32492  *         moveNodeToDocument(self._doc, c_source_doc, c_new_node)
32493  *         # fix namespace declarations
32494  *         moveNodeToDocument(self._doc, c_old_node.doc, c_old_node)             # <<<<<<<<<<<<<<
32495  * 
32496  *     # PROPERTIES
32497  */
32498   __pyx_t_2 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlElement *)__pyx_v_self)->_doc, __pyx_v_c_old_node->doc, __pyx_v_c_old_node); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32499
32500   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
32501   goto __pyx_L0;
32502   __pyx_L1_error:;
32503   __Pyx_AddTraceback("lxml.etree._Element.replace");
32504   __pyx_r = NULL;
32505   __pyx_L0:;
32506   __Pyx_XGIVEREF(__pyx_r);
32507   __Pyx_FinishRefcountContext();
32508   return __pyx_r;
32509 }
32510
32511 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":780
32512  *         u"""Element tag
32513  *         """
32514  *         def __get__(self):             # <<<<<<<<<<<<<<
32515  *             if self._tag is not None:
32516  *                 return self._tag
32517  */
32518
32519 static PyObject *__pyx_pf_4lxml_5etree_8_Element_3tag___get__(PyObject *__pyx_v_self); /*proto*/
32520 static PyObject *__pyx_pf_4lxml_5etree_8_Element_3tag___get__(PyObject *__pyx_v_self) {
32521   PyObject *__pyx_r = NULL;
32522   int __pyx_t_1;
32523   PyObject *__pyx_t_2 = NULL;
32524   __Pyx_SetupRefcountContext("__get__");
32525
32526   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":781
32527  *         """
32528  *         def __get__(self):
32529  *             if self._tag is not None:             # <<<<<<<<<<<<<<
32530  *                 return self._tag
32531  *             self._tag = _namespacedName(self._c_node)
32532  */
32533   __pyx_t_1 = (((struct LxmlElement *)__pyx_v_self)->_tag != Py_None);
32534   if (__pyx_t_1) {
32535
32536     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":782
32537  *         def __get__(self):
32538  *             if self._tag is not None:
32539  *                 return self._tag             # <<<<<<<<<<<<<<
32540  *             self._tag = _namespacedName(self._c_node)
32541  *             return self._tag
32542  */
32543     __Pyx_XDECREF(__pyx_r);
32544     __Pyx_INCREF(((struct LxmlElement *)__pyx_v_self)->_tag);
32545     __pyx_r = ((struct LxmlElement *)__pyx_v_self)->_tag;
32546     goto __pyx_L0;
32547     goto __pyx_L5;
32548   }
32549   __pyx_L5:;
32550
32551   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":783
32552  *             if self._tag is not None:
32553  *                 return self._tag
32554  *             self._tag = _namespacedName(self._c_node)             # <<<<<<<<<<<<<<
32555  *             return self._tag
32556  * 
32557  */
32558   __pyx_t_2 = __pyx_f_4lxml_5etree__namespacedName(((struct LxmlElement *)__pyx_v_self)->_c_node); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32559   __Pyx_GOTREF(__pyx_t_2);
32560   __Pyx_GIVEREF(__pyx_t_2);
32561   __Pyx_GOTREF(((struct LxmlElement *)__pyx_v_self)->_tag);
32562   __Pyx_DECREF(((struct LxmlElement *)__pyx_v_self)->_tag);
32563   ((struct LxmlElement *)__pyx_v_self)->_tag = __pyx_t_2;
32564   __pyx_t_2 = 0;
32565
32566   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":784
32567  *                 return self._tag
32568  *             self._tag = _namespacedName(self._c_node)
32569  *             return self._tag             # <<<<<<<<<<<<<<
32570  * 
32571  *         def __set__(self, value):
32572  */
32573   __Pyx_XDECREF(__pyx_r);
32574   __Pyx_INCREF(((struct LxmlElement *)__pyx_v_self)->_tag);
32575   __pyx_r = ((struct LxmlElement *)__pyx_v_self)->_tag;
32576   goto __pyx_L0;
32577
32578   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
32579   goto __pyx_L0;
32580   __pyx_L1_error:;
32581   __Pyx_XDECREF(__pyx_t_2);
32582   __Pyx_AddTraceback("lxml.etree._Element.tag.__get__");
32583   __pyx_r = NULL;
32584   __pyx_L0:;
32585   __Pyx_XGIVEREF(__pyx_r);
32586   __Pyx_FinishRefcountContext();
32587   return __pyx_r;
32588 }
32589
32590 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":786
32591  *             return self._tag
32592  * 
32593  *         def __set__(self, value):             # <<<<<<<<<<<<<<
32594  *             cdef _BaseParser parser
32595  *             ns, name = _getNsTag(value)
32596  */
32597
32598 static int __pyx_pf_4lxml_5etree_8_Element_3tag___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
32599 static int __pyx_pf_4lxml_5etree_8_Element_3tag___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
32600   struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser;
32601   PyObject *__pyx_v_ns;
32602   PyObject *__pyx_v_name;
32603   int __pyx_r;
32604   PyObject *__pyx_1 = 0;
32605   PyObject *__pyx_2 = 0;
32606   PyObject *__pyx_3 = 0;
32607   PyObject *__pyx_t_1 = NULL;
32608   int __pyx_t_2;
32609   int __pyx_t_3;
32610   int __pyx_t_4;
32611   __Pyx_SetupRefcountContext("__set__");
32612   __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None); __Pyx_INCREF(Py_None);
32613   __pyx_v_ns = Py_None; __Pyx_INCREF(Py_None);
32614   __pyx_v_name = Py_None; __Pyx_INCREF(Py_None);
32615
32616   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":788
32617  *         def __set__(self, value):
32618  *             cdef _BaseParser parser
32619  *             ns, name = _getNsTag(value)             # <<<<<<<<<<<<<<
32620  *             parser = self._doc._parser
32621  *             if parser is not None and parser._for_html:
32622  */
32623   __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32624   __Pyx_GOTREF(__pyx_t_1);
32625   if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 2)) {
32626     PyObject* tuple = __pyx_t_1;
32627     __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
32628     __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
32629     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32630     __Pyx_DECREF(__pyx_v_ns);
32631     __pyx_v_ns = __pyx_2;
32632     __pyx_2 = 0;
32633     __Pyx_DECREF(__pyx_v_name);
32634     __pyx_v_name = __pyx_3;
32635     __pyx_3 = 0;
32636   } else {
32637     __pyx_1 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32638     __Pyx_GOTREF(__pyx_1);
32639     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32640     __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32641     __Pyx_GOTREF(__pyx_2);
32642     __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32643     __Pyx_GOTREF(__pyx_3);
32644     if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32645     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
32646     __Pyx_DECREF(__pyx_v_ns);
32647     __pyx_v_ns = __pyx_2;
32648     __pyx_2 = 0;
32649     __Pyx_DECREF(__pyx_v_name);
32650     __pyx_v_name = __pyx_3;
32651     __pyx_3 = 0;
32652   }
32653
32654   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":789
32655  *             cdef _BaseParser parser
32656  *             ns, name = _getNsTag(value)
32657  *             parser = self._doc._parser             # <<<<<<<<<<<<<<
32658  *             if parser is not None and parser._for_html:
32659  *                 _htmlTagValidOrRaise(name)
32660  */
32661   __Pyx_INCREF(((PyObject *)((struct LxmlElement *)__pyx_v_self)->_doc->_parser));
32662   __Pyx_DECREF(((PyObject *)__pyx_v_parser));
32663   __pyx_v_parser = ((struct LxmlElement *)__pyx_v_self)->_doc->_parser;
32664
32665   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":790
32666  *             ns, name = _getNsTag(value)
32667  *             parser = self._doc._parser
32668  *             if parser is not None and parser._for_html:             # <<<<<<<<<<<<<<
32669  *                 _htmlTagValidOrRaise(name)
32670  *             else:
32671  */
32672   __pyx_t_2 = (((PyObject *)__pyx_v_parser) != Py_None);
32673   if (__pyx_t_2) {
32674     __pyx_t_3 = __pyx_v_parser->_for_html;
32675   } else {
32676     __pyx_t_3 = __pyx_t_2;
32677   }
32678   if (__pyx_t_3) {
32679
32680     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":791
32681  *             parser = self._doc._parser
32682  *             if parser is not None and parser._for_html:
32683  *                 _htmlTagValidOrRaise(name)             # <<<<<<<<<<<<<<
32684  *             else:
32685  *                 _tagValidOrRaise(name)
32686  */
32687     __pyx_t_4 = __pyx_f_4lxml_5etree__htmlTagValidOrRaise(__pyx_v_name); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32688     goto __pyx_L5;
32689   }
32690   /*else*/ {
32691
32692     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":793
32693  *                 _htmlTagValidOrRaise(name)
32694  *             else:
32695  *                 _tagValidOrRaise(name)             # <<<<<<<<<<<<<<
32696  *             self._tag = value
32697  *             tree.xmlNodeSetName(self._c_node, _cstr(name))
32698  */
32699     __pyx_t_4 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_name); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32700   }
32701   __pyx_L5:;
32702
32703   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":794
32704  *             else:
32705  *                 _tagValidOrRaise(name)
32706  *             self._tag = value             # <<<<<<<<<<<<<<
32707  *             tree.xmlNodeSetName(self._c_node, _cstr(name))
32708  *             if ns is None:
32709  */
32710   __Pyx_INCREF(__pyx_v_value);
32711   __Pyx_GIVEREF(__pyx_v_value);
32712   __Pyx_GOTREF(((struct LxmlElement *)__pyx_v_self)->_tag);
32713   __Pyx_DECREF(((struct LxmlElement *)__pyx_v_self)->_tag);
32714   ((struct LxmlElement *)__pyx_v_self)->_tag = __pyx_v_value;
32715
32716   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":795
32717  *                 _tagValidOrRaise(name)
32718  *             self._tag = value
32719  *             tree.xmlNodeSetName(self._c_node, _cstr(name))             # <<<<<<<<<<<<<<
32720  *             if ns is None:
32721  *                 self._c_node.ns = NULL
32722  */
32723   xmlNodeSetName(((struct LxmlElement *)__pyx_v_self)->_c_node, PyString_AS_STRING(__pyx_v_name));
32724
32725   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":796
32726  *             self._tag = value
32727  *             tree.xmlNodeSetName(self._c_node, _cstr(name))
32728  *             if ns is None:             # <<<<<<<<<<<<<<
32729  *                 self._c_node.ns = NULL
32730  *             else:
32731  */
32732   __pyx_t_3 = (__pyx_v_ns == Py_None);
32733   if (__pyx_t_3) {
32734
32735     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":797
32736  *             tree.xmlNodeSetName(self._c_node, _cstr(name))
32737  *             if ns is None:
32738  *                 self._c_node.ns = NULL             # <<<<<<<<<<<<<<
32739  *             else:
32740  *                 self._doc._setNodeNs(self._c_node, _cstr(ns))
32741  */
32742     ((struct LxmlElement *)__pyx_v_self)->_c_node->ns = NULL;
32743     goto __pyx_L6;
32744   }
32745   /*else*/ {
32746
32747     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":799
32748  *                 self._c_node.ns = NULL
32749  *             else:
32750  *                 self._doc._setNodeNs(self._c_node, _cstr(ns))             # <<<<<<<<<<<<<<
32751  * 
32752  *     property attrib:
32753  */
32754     __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)((struct LxmlElement *)__pyx_v_self)->_doc->__pyx_vtab)->_setNodeNs(((struct LxmlElement *)__pyx_v_self)->_doc, ((struct LxmlElement *)__pyx_v_self)->_c_node, PyString_AS_STRING(__pyx_v_ns)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32755   }
32756   __pyx_L6:;
32757
32758   __pyx_r = 0;
32759   goto __pyx_L0;
32760   __pyx_L1_error:;
32761   __Pyx_XDECREF(__pyx_1);
32762   __Pyx_XDECREF(__pyx_2);
32763   __Pyx_XDECREF(__pyx_3);
32764   __Pyx_XDECREF(__pyx_t_1);
32765   __Pyx_AddTraceback("lxml.etree._Element.tag.__set__");
32766   __pyx_r = -1;
32767   __pyx_L0:;
32768   __Pyx_DECREF((PyObject *)__pyx_v_parser);
32769   __Pyx_DECREF(__pyx_v_ns);
32770   __Pyx_DECREF(__pyx_v_name);
32771   __Pyx_FinishRefcountContext();
32772   return __pyx_r;
32773 }
32774
32775 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":805
32776  *         keys(), values() and items() to access element attributes.
32777  *         """
32778  *         def __get__(self):             # <<<<<<<<<<<<<<
32779  *             if self._attrib is None:
32780  *                 self._attrib = _Attrib(self)
32781  */
32782
32783 static PyObject *__pyx_pf_4lxml_5etree_8_Element_6attrib___get__(PyObject *__pyx_v_self); /*proto*/
32784 static PyObject *__pyx_pf_4lxml_5etree_8_Element_6attrib___get__(PyObject *__pyx_v_self) {
32785   PyObject *__pyx_r = NULL;
32786   int __pyx_t_1;
32787   PyObject *__pyx_t_2 = NULL;
32788   PyObject *__pyx_t_3 = NULL;
32789   __Pyx_SetupRefcountContext("__get__");
32790
32791   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":806
32792  *         """
32793  *         def __get__(self):
32794  *             if self._attrib is None:             # <<<<<<<<<<<<<<
32795  *                 self._attrib = _Attrib(self)
32796  *             return self._attrib
32797  */
32798   __pyx_t_1 = (((struct LxmlElement *)__pyx_v_self)->_attrib == Py_None);
32799   if (__pyx_t_1) {
32800
32801     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":807
32802  *         def __get__(self):
32803  *             if self._attrib is None:
32804  *                 self._attrib = _Attrib(self)             # <<<<<<<<<<<<<<
32805  *             return self._attrib
32806  * 
32807  */
32808     __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32809     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
32810     __Pyx_INCREF(__pyx_v_self);
32811     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
32812     __Pyx_GIVEREF(__pyx_v_self);
32813     __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Attrib)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32814     __Pyx_GOTREF(__pyx_t_3);
32815     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
32816     __Pyx_GIVEREF(__pyx_t_3);
32817     __Pyx_GOTREF(((struct LxmlElement *)__pyx_v_self)->_attrib);
32818     __Pyx_DECREF(((struct LxmlElement *)__pyx_v_self)->_attrib);
32819     ((struct LxmlElement *)__pyx_v_self)->_attrib = __pyx_t_3;
32820     __pyx_t_3 = 0;
32821     goto __pyx_L5;
32822   }
32823   __pyx_L5:;
32824
32825   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":808
32826  *             if self._attrib is None:
32827  *                 self._attrib = _Attrib(self)
32828  *             return self._attrib             # <<<<<<<<<<<<<<
32829  * 
32830  *     property text:
32831  */
32832   __Pyx_XDECREF(__pyx_r);
32833   __Pyx_INCREF(((struct LxmlElement *)__pyx_v_self)->_attrib);
32834   __pyx_r = ((struct LxmlElement *)__pyx_v_self)->_attrib;
32835   goto __pyx_L0;
32836
32837   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
32838   goto __pyx_L0;
32839   __pyx_L1_error:;
32840   __Pyx_XDECREF(__pyx_t_2);
32841   __Pyx_XDECREF(__pyx_t_3);
32842   __Pyx_AddTraceback("lxml.etree._Element.attrib.__get__");
32843   __pyx_r = NULL;
32844   __pyx_L0:;
32845   __Pyx_XGIVEREF(__pyx_r);
32846   __Pyx_FinishRefcountContext();
32847   return __pyx_r;
32848 }
32849
32850 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":814
32851  *         the value None, if there was no text.
32852  *         """
32853  *         def __get__(self):             # <<<<<<<<<<<<<<
32854  *             return _collectText(self._c_node.children)
32855  * 
32856  */
32857
32858 static PyObject *__pyx_pf_4lxml_5etree_8_Element_4text___get__(PyObject *__pyx_v_self); /*proto*/
32859 static PyObject *__pyx_pf_4lxml_5etree_8_Element_4text___get__(PyObject *__pyx_v_self) {
32860   PyObject *__pyx_r = NULL;
32861   PyObject *__pyx_t_1 = NULL;
32862   __Pyx_SetupRefcountContext("__get__");
32863
32864   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":815
32865  *         """
32866  *         def __get__(self):
32867  *             return _collectText(self._c_node.children)             # <<<<<<<<<<<<<<
32868  * 
32869  *         def __set__(self, value):
32870  */
32871   __Pyx_XDECREF(__pyx_r);
32872   __pyx_t_1 = __pyx_f_4lxml_5etree__collectText(((struct LxmlElement *)__pyx_v_self)->_c_node->children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32873   __Pyx_GOTREF(__pyx_t_1);
32874   __pyx_r = __pyx_t_1;
32875   __pyx_t_1 = 0;
32876   goto __pyx_L0;
32877
32878   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
32879   goto __pyx_L0;
32880   __pyx_L1_error:;
32881   __Pyx_XDECREF(__pyx_t_1);
32882   __Pyx_AddTraceback("lxml.etree._Element.text.__get__");
32883   __pyx_r = NULL;
32884   __pyx_L0:;
32885   __Pyx_XGIVEREF(__pyx_r);
32886   __Pyx_FinishRefcountContext();
32887   return __pyx_r;
32888 }
32889
32890 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":817
32891  *             return _collectText(self._c_node.children)
32892  * 
32893  *         def __set__(self, value):             # <<<<<<<<<<<<<<
32894  *             if isinstance(value, QName):
32895  *                 value = python.PyUnicode_FromEncodedObject(
32896  */
32897
32898 static int __pyx_pf_4lxml_5etree_8_Element_4text___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
32899 static int __pyx_pf_4lxml_5etree_8_Element_4text___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
32900   int __pyx_r;
32901   int __pyx_t_1;
32902   PyObject *__pyx_t_2 = NULL;
32903   PyObject *__pyx_t_3 = NULL;
32904   int __pyx_t_4;
32905   __Pyx_SetupRefcountContext("__set__");
32906   __Pyx_INCREF(__pyx_v_value);
32907
32908   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":818
32909  * 
32910  *         def __set__(self, value):
32911  *             if isinstance(value, QName):             # <<<<<<<<<<<<<<
32912  *                 value = python.PyUnicode_FromEncodedObject(
32913  *                     _resolveQNameText(self, value), 'UTF-8', 'strict')
32914  */
32915   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_value, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree_QName))); 
32916   if (__pyx_t_1) {
32917
32918     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":820
32919  *             if isinstance(value, QName):
32920  *                 value = python.PyUnicode_FromEncodedObject(
32921  *                     _resolveQNameText(self, value), 'UTF-8', 'strict')             # <<<<<<<<<<<<<<
32922  *             _setNodeText(self._c_node, value)
32923  * 
32924  */
32925     __pyx_t_2 = __pyx_f_4lxml_5etree__resolveQNameText(((struct LxmlElement *)__pyx_v_self), __pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32926     __Pyx_GOTREF(__pyx_t_2);
32927     __pyx_t_3 = PyUnicode_FromEncodedObject(__pyx_t_2, __pyx_k_321, __pyx_k_322); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32928     __Pyx_GOTREF(__pyx_t_3);
32929     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
32930     __Pyx_DECREF(__pyx_v_value);
32931     __pyx_v_value = __pyx_t_3;
32932     __pyx_t_3 = 0;
32933     goto __pyx_L5;
32934   }
32935   __pyx_L5:;
32936
32937   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":821
32938  *                 value = python.PyUnicode_FromEncodedObject(
32939  *                     _resolveQNameText(self, value), 'UTF-8', 'strict')
32940  *             _setNodeText(self._c_node, value)             # <<<<<<<<<<<<<<
32941  * 
32942  *         # using 'del el.text' is the wrong thing to do
32943  */
32944   __pyx_t_4 = __pyx_f_4lxml_5etree__setNodeText(((struct LxmlElement *)__pyx_v_self)->_c_node, __pyx_v_value); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32945
32946   __pyx_r = 0;
32947   goto __pyx_L0;
32948   __pyx_L1_error:;
32949   __Pyx_XDECREF(__pyx_t_2);
32950   __Pyx_XDECREF(__pyx_t_3);
32951   __Pyx_AddTraceback("lxml.etree._Element.text.__set__");
32952   __pyx_r = -1;
32953   __pyx_L0:;
32954   __Pyx_DECREF(__pyx_v_value);
32955   __Pyx_FinishRefcountContext();
32956   return __pyx_r;
32957 }
32958
32959 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":832
32960  *         there was no text.
32961  *         """
32962  *         def __get__(self):             # <<<<<<<<<<<<<<
32963  *             return _collectText(self._c_node.next)
32964  * 
32965  */
32966
32967 static PyObject *__pyx_pf_4lxml_5etree_8_Element_4tail___get__(PyObject *__pyx_v_self); /*proto*/
32968 static PyObject *__pyx_pf_4lxml_5etree_8_Element_4tail___get__(PyObject *__pyx_v_self) {
32969   PyObject *__pyx_r = NULL;
32970   PyObject *__pyx_t_1 = NULL;
32971   __Pyx_SetupRefcountContext("__get__");
32972
32973   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":833
32974  *         """
32975  *         def __get__(self):
32976  *             return _collectText(self._c_node.next)             # <<<<<<<<<<<<<<
32977  * 
32978  *         def __set__(self, value):
32979  */
32980   __Pyx_XDECREF(__pyx_r);
32981   __pyx_t_1 = __pyx_f_4lxml_5etree__collectText(((struct LxmlElement *)__pyx_v_self)->_c_node->next); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
32982   __Pyx_GOTREF(__pyx_t_1);
32983   __pyx_r = __pyx_t_1;
32984   __pyx_t_1 = 0;
32985   goto __pyx_L0;
32986
32987   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
32988   goto __pyx_L0;
32989   __pyx_L1_error:;
32990   __Pyx_XDECREF(__pyx_t_1);
32991   __Pyx_AddTraceback("lxml.etree._Element.tail.__get__");
32992   __pyx_r = NULL;
32993   __pyx_L0:;
32994   __Pyx_XGIVEREF(__pyx_r);
32995   __Pyx_FinishRefcountContext();
32996   return __pyx_r;
32997 }
32998
32999 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":835
33000  *             return _collectText(self._c_node.next)
33001  * 
33002  *         def __set__(self, value):             # <<<<<<<<<<<<<<
33003  *             _setTailText(self._c_node, value)
33004  * 
33005  */
33006
33007 static int __pyx_pf_4lxml_5etree_8_Element_4tail___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
33008 static int __pyx_pf_4lxml_5etree_8_Element_4tail___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
33009   int __pyx_r;
33010   int __pyx_t_1;
33011   __Pyx_SetupRefcountContext("__set__");
33012
33013   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":836
33014  * 
33015  *         def __set__(self, value):
33016  *             _setTailText(self._c_node, value)             # <<<<<<<<<<<<<<
33017  * 
33018  *         # using 'del el.tail' is the wrong thing to do
33019  */
33020   __pyx_t_1 = __pyx_f_4lxml_5etree__setTailText(((struct LxmlElement *)__pyx_v_self)->_c_node, __pyx_v_value); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33021
33022   __pyx_r = 0;
33023   goto __pyx_L0;
33024   __pyx_L1_error:;
33025   __Pyx_AddTraceback("lxml.etree._Element.tail.__set__");
33026   __pyx_r = -1;
33027   __pyx_L0:;
33028   __Pyx_FinishRefcountContext();
33029   return __pyx_r;
33030 }
33031
33032 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":846
33033  *         u"""Namespace prefix or None.
33034  *         """
33035  *         def __get__(self):             # <<<<<<<<<<<<<<
33036  *             if self._c_node.ns is not NULL:
33037  *                 if self._c_node.ns.prefix is not NULL:
33038  */
33039
33040 static PyObject *__pyx_pf_4lxml_5etree_8_Element_6prefix___get__(PyObject *__pyx_v_self); /*proto*/
33041 static PyObject *__pyx_pf_4lxml_5etree_8_Element_6prefix___get__(PyObject *__pyx_v_self) {
33042   PyObject *__pyx_r = NULL;
33043   int __pyx_t_1;
33044   PyObject *__pyx_t_2 = NULL;
33045   __Pyx_SetupRefcountContext("__get__");
33046
33047   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":847
33048  *         """
33049  *         def __get__(self):
33050  *             if self._c_node.ns is not NULL:             # <<<<<<<<<<<<<<
33051  *                 if self._c_node.ns.prefix is not NULL:
33052  *                     return funicode(self._c_node.ns.prefix)
33053  */
33054   __pyx_t_1 = (((struct LxmlElement *)__pyx_v_self)->_c_node->ns != NULL);
33055   if (__pyx_t_1) {
33056
33057     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":848
33058  *         def __get__(self):
33059  *             if self._c_node.ns is not NULL:
33060  *                 if self._c_node.ns.prefix is not NULL:             # <<<<<<<<<<<<<<
33061  *                     return funicode(self._c_node.ns.prefix)
33062  *             return None
33063  */
33064     __pyx_t_1 = (((struct LxmlElement *)__pyx_v_self)->_c_node->ns->prefix != NULL);
33065     if (__pyx_t_1) {
33066
33067       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":849
33068  *             if self._c_node.ns is not NULL:
33069  *                 if self._c_node.ns.prefix is not NULL:
33070  *                     return funicode(self._c_node.ns.prefix)             # <<<<<<<<<<<<<<
33071  *             return None
33072  * 
33073  */
33074       __Pyx_XDECREF(__pyx_r);
33075       __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(((struct LxmlElement *)__pyx_v_self)->_c_node->ns->prefix); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33076       __Pyx_GOTREF(__pyx_t_2);
33077       __pyx_r = __pyx_t_2;
33078       __pyx_t_2 = 0;
33079       goto __pyx_L0;
33080       goto __pyx_L6;
33081     }
33082     __pyx_L6:;
33083     goto __pyx_L5;
33084   }
33085   __pyx_L5:;
33086
33087   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":850
33088  *                 if self._c_node.ns.prefix is not NULL:
33089  *                     return funicode(self._c_node.ns.prefix)
33090  *             return None             # <<<<<<<<<<<<<<
33091  * 
33092  *     # not in ElementTree, read-only
33093  */
33094   __Pyx_XDECREF(__pyx_r);
33095   __Pyx_INCREF(Py_None);
33096   __pyx_r = Py_None;
33097   goto __pyx_L0;
33098
33099   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
33100   goto __pyx_L0;
33101   __pyx_L1_error:;
33102   __Pyx_XDECREF(__pyx_t_2);
33103   __Pyx_AddTraceback("lxml.etree._Element.prefix.__get__");
33104   __pyx_r = NULL;
33105   __pyx_L0:;
33106   __Pyx_XGIVEREF(__pyx_r);
33107   __Pyx_FinishRefcountContext();
33108   return __pyx_r;
33109 }
33110
33111 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":856
33112  *         u"""Original line number as found by the parser or None if unknown.
33113  *         """
33114  *         def __get__(self):             # <<<<<<<<<<<<<<
33115  *             cdef long line
33116  *             line = tree.xmlGetLineNo(self._c_node)
33117  */
33118
33119 static PyObject *__pyx_pf_4lxml_5etree_8_Element_10sourceline___get__(PyObject *__pyx_v_self); /*proto*/
33120 static PyObject *__pyx_pf_4lxml_5etree_8_Element_10sourceline___get__(PyObject *__pyx_v_self) {
33121   long __pyx_v_line;
33122   PyObject *__pyx_r = NULL;
33123   int __pyx_t_1;
33124   PyObject *__pyx_t_2 = NULL;
33125   __Pyx_SetupRefcountContext("__get__");
33126
33127   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":858
33128  *         def __get__(self):
33129  *             cdef long line
33130  *             line = tree.xmlGetLineNo(self._c_node)             # <<<<<<<<<<<<<<
33131  *             if line > 0:
33132  *                 return line
33133  */
33134   __pyx_v_line = xmlGetLineNo(((struct LxmlElement *)__pyx_v_self)->_c_node);
33135
33136   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":859
33137  *             cdef long line
33138  *             line = tree.xmlGetLineNo(self._c_node)
33139  *             if line > 0:             # <<<<<<<<<<<<<<
33140  *                 return line
33141  *             else:
33142  */
33143   __pyx_t_1 = (__pyx_v_line > 0);
33144   if (__pyx_t_1) {
33145
33146     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":860
33147  *             line = tree.xmlGetLineNo(self._c_node)
33148  *             if line > 0:
33149  *                 return line             # <<<<<<<<<<<<<<
33150  *             else:
33151  *                 return None
33152  */
33153     __Pyx_XDECREF(__pyx_r);
33154     __pyx_t_2 = PyInt_FromLong(__pyx_v_line); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33155     __Pyx_GOTREF(__pyx_t_2);
33156     __pyx_r = __pyx_t_2;
33157     __pyx_t_2 = 0;
33158     goto __pyx_L0;
33159     goto __pyx_L5;
33160   }
33161   /*else*/ {
33162
33163     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":862
33164  *                 return line
33165  *             else:
33166  *                 return None             # <<<<<<<<<<<<<<
33167  * 
33168  *         def __set__(self, line):
33169  */
33170     __Pyx_XDECREF(__pyx_r);
33171     __Pyx_INCREF(Py_None);
33172     __pyx_r = Py_None;
33173     goto __pyx_L0;
33174   }
33175   __pyx_L5:;
33176
33177   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
33178   goto __pyx_L0;
33179   __pyx_L1_error:;
33180   __Pyx_XDECREF(__pyx_t_2);
33181   __Pyx_AddTraceback("lxml.etree._Element.sourceline.__get__");
33182   __pyx_r = NULL;
33183   __pyx_L0:;
33184   __Pyx_XGIVEREF(__pyx_r);
33185   __Pyx_FinishRefcountContext();
33186   return __pyx_r;
33187 }
33188
33189 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":864
33190  *                 return None
33191  * 
33192  *         def __set__(self, line):             # <<<<<<<<<<<<<<
33193  *             if line < 0:
33194  *                 self._c_node.line = 0
33195  */
33196
33197 static int __pyx_pf_4lxml_5etree_8_Element_10sourceline___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_line); /*proto*/
33198 static int __pyx_pf_4lxml_5etree_8_Element_10sourceline___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_line) {
33199   int __pyx_r;
33200   PyObject *__pyx_t_1 = NULL;
33201   int __pyx_t_2;
33202   unsigned short __pyx_t_3;
33203   __Pyx_SetupRefcountContext("__set__");
33204
33205   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":865
33206  * 
33207  *         def __set__(self, line):
33208  *             if line < 0:             # <<<<<<<<<<<<<<
33209  *                 self._c_node.line = 0
33210  *             else:
33211  */
33212   __pyx_t_1 = PyObject_RichCompare(__pyx_v_line, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33213   __Pyx_GOTREF(__pyx_t_1);
33214   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33215   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
33216   if (__pyx_t_2) {
33217
33218     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":866
33219  *         def __set__(self, line):
33220  *             if line < 0:
33221  *                 self._c_node.line = 0             # <<<<<<<<<<<<<<
33222  *             else:
33223  *                 self._c_node.line = line
33224  */
33225     ((struct LxmlElement *)__pyx_v_self)->_c_node->line = 0;
33226     goto __pyx_L5;
33227   }
33228   /*else*/ {
33229
33230     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":868
33231  *                 self._c_node.line = 0
33232  *             else:
33233  *                 self._c_node.line = line             # <<<<<<<<<<<<<<
33234  * 
33235  *     # not in ElementTree, read-only
33236  */
33237     __pyx_t_3 = __Pyx_PyInt_AsUnsignedShort(__pyx_v_line); if (unlikely((__pyx_t_3 == (unsigned short)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33238     ((struct LxmlElement *)__pyx_v_self)->_c_node->line = __pyx_t_3;
33239   }
33240   __pyx_L5:;
33241
33242   __pyx_r = 0;
33243   goto __pyx_L0;
33244   __pyx_L1_error:;
33245   __Pyx_XDECREF(__pyx_t_1);
33246   __Pyx_AddTraceback("lxml.etree._Element.sourceline.__set__");
33247   __pyx_r = -1;
33248   __pyx_L0:;
33249   __Pyx_FinishRefcountContext();
33250   return __pyx_r;
33251 }
33252
33253 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":874
33254  *         u"""Namespace prefix->URI mapping known in the context of this Element.
33255  *         """
33256  *         def __get__(self):             # <<<<<<<<<<<<<<
33257  *             cdef xmlNode* c_node
33258  *             cdef xmlNs* c_ns
33259  */
33260
33261 static PyObject *__pyx_pf_4lxml_5etree_8_Element_5nsmap___get__(PyObject *__pyx_v_self); /*proto*/
33262 static PyObject *__pyx_pf_4lxml_5etree_8_Element_5nsmap___get__(PyObject *__pyx_v_self) {
33263   xmlNode *__pyx_v_c_node;
33264   xmlNs *__pyx_v_c_ns;
33265   PyObject *__pyx_v_nsmap = 0;
33266   PyObject *__pyx_v_prefix;
33267   PyObject *__pyx_r = NULL;
33268   PyObject *__pyx_1 = 0;
33269   int __pyx_t_1;
33270   PyObject *__pyx_t_2 = NULL;
33271   __Pyx_SetupRefcountContext("__get__");
33272   __pyx_v_prefix = Py_None; __Pyx_INCREF(Py_None);
33273
33274   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":877
33275  *             cdef xmlNode* c_node
33276  *             cdef xmlNs* c_ns
33277  *             cdef dict nsmap = {}             # <<<<<<<<<<<<<<
33278  *             c_node = self._c_node
33279  *             while c_node is not NULL and c_node.type == tree.XML_ELEMENT_NODE:
33280  */
33281   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33282   __Pyx_GOTREF(((PyObject *)__pyx_1));
33283   __pyx_v_nsmap = __pyx_1;
33284   __pyx_1 = 0;
33285
33286   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":878
33287  *             cdef xmlNs* c_ns
33288  *             cdef dict nsmap = {}
33289  *             c_node = self._c_node             # <<<<<<<<<<<<<<
33290  *             while c_node is not NULL and c_node.type == tree.XML_ELEMENT_NODE:
33291  *                 c_ns = c_node.nsDef
33292  */
33293   __pyx_v_c_node = ((struct LxmlElement *)__pyx_v_self)->_c_node;
33294
33295   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":879
33296  *             cdef dict nsmap = {}
33297  *             c_node = self._c_node
33298  *             while c_node is not NULL and c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
33299  *                 c_ns = c_node.nsDef
33300  *                 while c_ns is not NULL:
33301  */
33302   while (1) {
33303     if ((__pyx_v_c_node != NULL)) {
33304       __pyx_t_1 = (__pyx_v_c_node->type == XML_ELEMENT_NODE);
33305     } else {
33306       __pyx_t_1 = (__pyx_v_c_node != NULL);
33307     }
33308     if (!__pyx_t_1) break;
33309
33310     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":880
33311  *             c_node = self._c_node
33312  *             while c_node is not NULL and c_node.type == tree.XML_ELEMENT_NODE:
33313  *                 c_ns = c_node.nsDef             # <<<<<<<<<<<<<<
33314  *                 while c_ns is not NULL:
33315  *                     if c_ns.prefix is NULL:
33316  */
33317     __pyx_v_c_ns = __pyx_v_c_node->nsDef;
33318
33319     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":881
33320  *             while c_node is not NULL and c_node.type == tree.XML_ELEMENT_NODE:
33321  *                 c_ns = c_node.nsDef
33322  *                 while c_ns is not NULL:             # <<<<<<<<<<<<<<
33323  *                     if c_ns.prefix is NULL:
33324  *                         prefix = None
33325  */
33326     while (1) {
33327       __pyx_t_1 = (__pyx_v_c_ns != NULL);
33328       if (!__pyx_t_1) break;
33329
33330       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":882
33331  *                 c_ns = c_node.nsDef
33332  *                 while c_ns is not NULL:
33333  *                     if c_ns.prefix is NULL:             # <<<<<<<<<<<<<<
33334  *                         prefix = None
33335  *                     else:
33336  */
33337       __pyx_t_1 = (__pyx_v_c_ns->prefix == NULL);
33338       if (__pyx_t_1) {
33339
33340         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":883
33341  *                 while c_ns is not NULL:
33342  *                     if c_ns.prefix is NULL:
33343  *                         prefix = None             # <<<<<<<<<<<<<<
33344  *                     else:
33345  *                         prefix = funicode(c_ns.prefix)
33346  */
33347         __Pyx_INCREF(Py_None);
33348         __Pyx_DECREF(__pyx_v_prefix);
33349         __pyx_v_prefix = Py_None;
33350         goto __pyx_L9;
33351       }
33352       /*else*/ {
33353
33354         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":885
33355  *                         prefix = None
33356  *                     else:
33357  *                         prefix = funicode(c_ns.prefix)             # <<<<<<<<<<<<<<
33358  *                     if not python.PyDict_GetItem(nsmap, prefix):
33359  *                         nsmap[prefix] = funicode(c_ns.href)
33360  */
33361         __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_ns->prefix); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33362         __Pyx_GOTREF(__pyx_t_2);
33363         __Pyx_DECREF(__pyx_v_prefix);
33364         __pyx_v_prefix = __pyx_t_2;
33365         __pyx_t_2 = 0;
33366       }
33367       __pyx_L9:;
33368
33369       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":886
33370  *                     else:
33371  *                         prefix = funicode(c_ns.prefix)
33372  *                     if not python.PyDict_GetItem(nsmap, prefix):             # <<<<<<<<<<<<<<
33373  *                         nsmap[prefix] = funicode(c_ns.href)
33374  *                     c_ns = c_ns.next
33375  */
33376       __pyx_t_1 = (!(PyDict_GetItem(((PyObject *)__pyx_v_nsmap), __pyx_v_prefix) != 0));
33377       if (__pyx_t_1) {
33378
33379         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":887
33380  *                         prefix = funicode(c_ns.prefix)
33381  *                     if not python.PyDict_GetItem(nsmap, prefix):
33382  *                         nsmap[prefix] = funicode(c_ns.href)             # <<<<<<<<<<<<<<
33383  *                     c_ns = c_ns.next
33384  *                 c_node = c_node.parent
33385  */
33386         __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_ns->href); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33387         __Pyx_GOTREF(__pyx_t_2);
33388         if (PyDict_SetItem(((PyObject *)__pyx_v_nsmap), __pyx_v_prefix, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33389         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
33390         goto __pyx_L10;
33391       }
33392       __pyx_L10:;
33393
33394       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":888
33395  *                     if not python.PyDict_GetItem(nsmap, prefix):
33396  *                         nsmap[prefix] = funicode(c_ns.href)
33397  *                     c_ns = c_ns.next             # <<<<<<<<<<<<<<
33398  *                 c_node = c_node.parent
33399  *             return nsmap
33400  */
33401       __pyx_v_c_ns = __pyx_v_c_ns->next;
33402     }
33403
33404     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":889
33405  *                         nsmap[prefix] = funicode(c_ns.href)
33406  *                     c_ns = c_ns.next
33407  *                 c_node = c_node.parent             # <<<<<<<<<<<<<<
33408  *             return nsmap
33409  * 
33410  */
33411     __pyx_v_c_node = __pyx_v_c_node->parent;
33412   }
33413
33414   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":890
33415  *                     c_ns = c_ns.next
33416  *                 c_node = c_node.parent
33417  *             return nsmap             # <<<<<<<<<<<<<<
33418  * 
33419  *     # not in ElementTree, read-only
33420  */
33421   __Pyx_XDECREF(__pyx_r);
33422   __Pyx_INCREF(((PyObject *)__pyx_v_nsmap));
33423   __pyx_r = ((PyObject *)__pyx_v_nsmap);
33424   goto __pyx_L0;
33425
33426   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
33427   goto __pyx_L0;
33428   __pyx_L1_error:;
33429   __Pyx_XDECREF(__pyx_1);
33430   __Pyx_XDECREF(__pyx_t_2);
33431   __Pyx_AddTraceback("lxml.etree._Element.nsmap.__get__");
33432   __pyx_r = NULL;
33433   __pyx_L0:;
33434   __Pyx_XDECREF(__pyx_v_nsmap);
33435   __Pyx_DECREF(__pyx_v_prefix);
33436   __Pyx_XGIVEREF(__pyx_r);
33437   __Pyx_FinishRefcountContext();
33438   return __pyx_r;
33439 }
33440
33441 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":904
33442  *         Element, regardless of the document type (XML or HTML).
33443  *         """
33444  *         def __get__(self):             # <<<<<<<<<<<<<<
33445  *             cdef char* c_base
33446  *             c_base = tree.xmlNodeGetBase(self._doc._c_doc, self._c_node)
33447  */
33448
33449 static PyObject *__pyx_pf_4lxml_5etree_8_Element_4base___get__(PyObject *__pyx_v_self); /*proto*/
33450 static PyObject *__pyx_pf_4lxml_5etree_8_Element_4base___get__(PyObject *__pyx_v_self) {
33451   char *__pyx_v_c_base;
33452   PyObject *__pyx_v_base;
33453   PyObject *__pyx_r = NULL;
33454   int __pyx_t_1;
33455   PyObject *__pyx_t_2 = NULL;
33456   __Pyx_SetupRefcountContext("__get__");
33457   __pyx_v_base = Py_None; __Pyx_INCREF(Py_None);
33458
33459   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":906
33460  *         def __get__(self):
33461  *             cdef char* c_base
33462  *             c_base = tree.xmlNodeGetBase(self._doc._c_doc, self._c_node)             # <<<<<<<<<<<<<<
33463  *             if c_base is NULL:
33464  *                 if self._doc._c_doc.URL is NULL:
33465  */
33466   __pyx_v_c_base = xmlNodeGetBase(((struct LxmlElement *)__pyx_v_self)->_doc->_c_doc, ((struct LxmlElement *)__pyx_v_self)->_c_node);
33467
33468   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":907
33469  *             cdef char* c_base
33470  *             c_base = tree.xmlNodeGetBase(self._doc._c_doc, self._c_node)
33471  *             if c_base is NULL:             # <<<<<<<<<<<<<<
33472  *                 if self._doc._c_doc.URL is NULL:
33473  *                     return None
33474  */
33475   __pyx_t_1 = (__pyx_v_c_base == NULL);
33476   if (__pyx_t_1) {
33477
33478     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":908
33479  *             c_base = tree.xmlNodeGetBase(self._doc._c_doc, self._c_node)
33480  *             if c_base is NULL:
33481  *                 if self._doc._c_doc.URL is NULL:             # <<<<<<<<<<<<<<
33482  *                     return None
33483  *                 return _decodeFilename(self._doc._c_doc.URL)
33484  */
33485     __pyx_t_1 = (((struct LxmlElement *)__pyx_v_self)->_doc->_c_doc->URL == NULL);
33486     if (__pyx_t_1) {
33487
33488       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":909
33489  *             if c_base is NULL:
33490  *                 if self._doc._c_doc.URL is NULL:
33491  *                     return None             # <<<<<<<<<<<<<<
33492  *                 return _decodeFilename(self._doc._c_doc.URL)
33493  *             base = _decodeFilename(c_base)
33494  */
33495       __Pyx_XDECREF(__pyx_r);
33496       __Pyx_INCREF(Py_None);
33497       __pyx_r = Py_None;
33498       goto __pyx_L0;
33499       goto __pyx_L6;
33500     }
33501     __pyx_L6:;
33502
33503     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":910
33504  *                 if self._doc._c_doc.URL is NULL:
33505  *                     return None
33506  *                 return _decodeFilename(self._doc._c_doc.URL)             # <<<<<<<<<<<<<<
33507  *             base = _decodeFilename(c_base)
33508  *             tree.xmlFree(c_base)
33509  */
33510     __Pyx_XDECREF(__pyx_r);
33511     __pyx_t_2 = __pyx_f_4lxml_5etree__decodeFilename(((struct LxmlElement *)__pyx_v_self)->_doc->_c_doc->URL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33512     __Pyx_GOTREF(__pyx_t_2);
33513     __pyx_r = __pyx_t_2;
33514     __pyx_t_2 = 0;
33515     goto __pyx_L0;
33516     goto __pyx_L5;
33517   }
33518   __pyx_L5:;
33519
33520   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":911
33521  *                     return None
33522  *                 return _decodeFilename(self._doc._c_doc.URL)
33523  *             base = _decodeFilename(c_base)             # <<<<<<<<<<<<<<
33524  *             tree.xmlFree(c_base)
33525  *             return base
33526  */
33527   __pyx_t_2 = __pyx_f_4lxml_5etree__decodeFilename(__pyx_v_c_base); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33528   __Pyx_GOTREF(__pyx_t_2);
33529   __Pyx_DECREF(__pyx_v_base);
33530   __pyx_v_base = __pyx_t_2;
33531   __pyx_t_2 = 0;
33532
33533   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":912
33534  *                 return _decodeFilename(self._doc._c_doc.URL)
33535  *             base = _decodeFilename(c_base)
33536  *             tree.xmlFree(c_base)             # <<<<<<<<<<<<<<
33537  *             return base
33538  *         def __set__(self, url):
33539  */
33540   xmlFree(__pyx_v_c_base);
33541
33542   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":913
33543  *             base = _decodeFilename(c_base)
33544  *             tree.xmlFree(c_base)
33545  *             return base             # <<<<<<<<<<<<<<
33546  *         def __set__(self, url):
33547  *             cdef char* c_base
33548  */
33549   __Pyx_XDECREF(__pyx_r);
33550   __Pyx_INCREF(__pyx_v_base);
33551   __pyx_r = __pyx_v_base;
33552   goto __pyx_L0;
33553
33554   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
33555   goto __pyx_L0;
33556   __pyx_L1_error:;
33557   __Pyx_XDECREF(__pyx_t_2);
33558   __Pyx_AddTraceback("lxml.etree._Element.base.__get__");
33559   __pyx_r = NULL;
33560   __pyx_L0:;
33561   __Pyx_DECREF(__pyx_v_base);
33562   __Pyx_XGIVEREF(__pyx_r);
33563   __Pyx_FinishRefcountContext();
33564   return __pyx_r;
33565 }
33566
33567 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":914
33568  *             tree.xmlFree(c_base)
33569  *             return base
33570  *         def __set__(self, url):             # <<<<<<<<<<<<<<
33571  *             cdef char* c_base
33572  *             if url is None:
33573  */
33574
33575 static int __pyx_pf_4lxml_5etree_8_Element_4base___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_url); /*proto*/
33576 static int __pyx_pf_4lxml_5etree_8_Element_4base___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_url) {
33577   char *__pyx_v_c_base;
33578   int __pyx_r;
33579   int __pyx_t_1;
33580   PyObject *__pyx_t_2 = NULL;
33581   __Pyx_SetupRefcountContext("__set__");
33582   __Pyx_INCREF(__pyx_v_url);
33583
33584   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":916
33585  *         def __set__(self, url):
33586  *             cdef char* c_base
33587  *             if url is None:             # <<<<<<<<<<<<<<
33588  *                 c_base = NULL
33589  *             else:
33590  */
33591   __pyx_t_1 = (__pyx_v_url == Py_None);
33592   if (__pyx_t_1) {
33593
33594     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":917
33595  *             cdef char* c_base
33596  *             if url is None:
33597  *                 c_base = NULL             # <<<<<<<<<<<<<<
33598  *             else:
33599  *                 url = _encodeFilename(url)
33600  */
33601     __pyx_v_c_base = NULL;
33602     goto __pyx_L5;
33603   }
33604   /*else*/ {
33605
33606     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":919
33607  *                 c_base = NULL
33608  *             else:
33609  *                 url = _encodeFilename(url)             # <<<<<<<<<<<<<<
33610  *                 c_base = _cstr(url)
33611  *             tree.xmlNodeSetBase(self._c_node, c_base)
33612  */
33613     __pyx_t_2 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_url); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33614     __Pyx_GOTREF(__pyx_t_2);
33615     __Pyx_DECREF(__pyx_v_url);
33616     __pyx_v_url = __pyx_t_2;
33617     __pyx_t_2 = 0;
33618
33619     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":920
33620  *             else:
33621  *                 url = _encodeFilename(url)
33622  *                 c_base = _cstr(url)             # <<<<<<<<<<<<<<
33623  *             tree.xmlNodeSetBase(self._c_node, c_base)
33624  * 
33625  */
33626     __pyx_v_c_base = PyString_AS_STRING(__pyx_v_url);
33627   }
33628   __pyx_L5:;
33629
33630   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":921
33631  *                 url = _encodeFilename(url)
33632  *                 c_base = _cstr(url)
33633  *             tree.xmlNodeSetBase(self._c_node, c_base)             # <<<<<<<<<<<<<<
33634  * 
33635  *     # ACCESSORS
33636  */
33637   xmlNodeSetBase(((struct LxmlElement *)__pyx_v_self)->_c_node, __pyx_v_c_base);
33638
33639   __pyx_r = 0;
33640   goto __pyx_L0;
33641   __pyx_L1_error:;
33642   __Pyx_XDECREF(__pyx_t_2);
33643   __Pyx_AddTraceback("lxml.etree._Element.base.__set__");
33644   __pyx_r = -1;
33645   __pyx_L0:;
33646   __Pyx_DECREF(__pyx_v_url);
33647   __Pyx_FinishRefcountContext();
33648   return __pyx_r;
33649 }
33650
33651 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":924
33652  * 
33653  *     # ACCESSORS
33654  *     def __repr__(self):             # <<<<<<<<<<<<<<
33655  *         u"__repr__(self)"
33656  *         return u"<Element %s at %x>" % (self.tag, id(self))
33657  */
33658
33659 static PyObject *__pyx_pf_4lxml_5etree_8_Element___repr__(PyObject *__pyx_v_self); /*proto*/
33660 static char __pyx_doc_4lxml_5etree_8_Element___repr__[] = "__repr__(self)";
33661 static PyObject *__pyx_pf_4lxml_5etree_8_Element___repr__(PyObject *__pyx_v_self) {
33662   PyObject *__pyx_r = NULL;
33663   PyObject *__pyx_t_1 = NULL;
33664   PyObject *__pyx_t_2 = NULL;
33665   PyObject *__pyx_t_3 = NULL;
33666   __Pyx_SetupRefcountContext("__repr__");
33667
33668   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":926
33669  *     def __repr__(self):
33670  *         u"__repr__(self)"
33671  *         return u"<Element %s at %x>" % (self.tag, id(self))             # <<<<<<<<<<<<<<
33672  * 
33673  *     def __getitem__(self, x):
33674  */
33675   __Pyx_XDECREF(__pyx_r);
33676   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_tag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33677   __Pyx_GOTREF(__pyx_t_1);
33678   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33679   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
33680   __Pyx_INCREF(__pyx_v_self);
33681   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
33682   __Pyx_GIVEREF(__pyx_v_self);
33683   __pyx_t_3 = PyObject_Call(__pyx_builtin_id, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33684   __Pyx_GOTREF(__pyx_t_3);
33685   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
33686   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33687   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
33688   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
33689   __Pyx_GIVEREF(__pyx_t_1);
33690   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
33691   __Pyx_GIVEREF(__pyx_t_3);
33692   __pyx_t_1 = 0;
33693   __pyx_t_3 = 0;
33694   __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_323), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33695   __Pyx_GOTREF(__pyx_t_3);
33696   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
33697   __pyx_r = __pyx_t_3;
33698   __pyx_t_3 = 0;
33699   goto __pyx_L0;
33700
33701   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
33702   goto __pyx_L0;
33703   __pyx_L1_error:;
33704   __Pyx_XDECREF(__pyx_t_1);
33705   __Pyx_XDECREF(__pyx_t_2);
33706   __Pyx_XDECREF(__pyx_t_3);
33707   __Pyx_AddTraceback("lxml.etree._Element.__repr__");
33708   __pyx_r = NULL;
33709   __pyx_L0:;
33710   __Pyx_XGIVEREF(__pyx_r);
33711   __Pyx_FinishRefcountContext();
33712   return __pyx_r;
33713 }
33714
33715 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":928
33716  *         return u"<Element %s at %x>" % (self.tag, id(self))
33717  * 
33718  *     def __getitem__(self, x):             # <<<<<<<<<<<<<<
33719  *         u"""Returns the subelement at the given position or the requested
33720  *         slice.
33721  */
33722
33723 static PyObject *__pyx_pf_4lxml_5etree_8_Element___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
33724 static char __pyx_doc_4lxml_5etree_8_Element___getitem__[] = "Returns the subelement at the given position or the requested\n        slice.\n        ";
33725 static PyObject *__pyx_pf_4lxml_5etree_8_Element___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
33726   xmlNode *__pyx_v_c_node;
33727   Py_ssize_t __pyx_v_step;
33728   Py_ssize_t __pyx_v_slicelength;
33729   Py_ssize_t __pyx_v_c;
33730   Py_ssize_t __pyx_v_i;
33731   _node_to_node_function __pyx_v_next_element;
33732   PyObject *__pyx_v_result;
33733   PyObject *__pyx_r = NULL;
33734   int __pyx_t_1;
33735   PyObject *__pyx_t_2 = NULL;
33736   int __pyx_t_3;
33737   Py_ssize_t __pyx_t_4;
33738   __Pyx_SetupRefcountContext("__getitem__");
33739   __pyx_v_result = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
33740
33741   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":937
33742  *         cdef _node_to_node_function next_element
33743  *         cdef list result
33744  *         if python.PySlice_Check(x):             # <<<<<<<<<<<<<<
33745  *             # slicing
33746  *             if _isFullSlice(<python.slice>x):
33747  */
33748   __pyx_t_1 = PySlice_Check(__pyx_v_x);
33749   if (__pyx_t_1) {
33750
33751     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":939
33752  *         if python.PySlice_Check(x):
33753  *             # slicing
33754  *             if _isFullSlice(<python.slice>x):             # <<<<<<<<<<<<<<
33755  *                 return _collectChildren(self)
33756  *             _findChildSlice(<python.slice>x, self._c_node, &c_node, &step, &slicelength)
33757  */
33758     __pyx_t_1 = __pyx_f_4lxml_5etree__isFullSlice(((PySliceObject *)__pyx_v_x));
33759     if (__pyx_t_1) {
33760
33761       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":940
33762  *             # slicing
33763  *             if _isFullSlice(<python.slice>x):
33764  *                 return _collectChildren(self)             # <<<<<<<<<<<<<<
33765  *             _findChildSlice(<python.slice>x, self._c_node, &c_node, &step, &slicelength)
33766  *             if c_node is NULL:
33767  */
33768       __Pyx_XDECREF(__pyx_r);
33769       __pyx_t_2 = __pyx_f_4lxml_5etree__collectChildren(((struct LxmlElement *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33770       __Pyx_GOTREF(__pyx_t_2);
33771       __pyx_r = __pyx_t_2;
33772       __pyx_t_2 = 0;
33773       goto __pyx_L0;
33774       goto __pyx_L6;
33775     }
33776     __pyx_L6:;
33777
33778     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":941
33779  *             if _isFullSlice(<python.slice>x):
33780  *                 return _collectChildren(self)
33781  *             _findChildSlice(<python.slice>x, self._c_node, &c_node, &step, &slicelength)             # <<<<<<<<<<<<<<
33782  *             if c_node is NULL:
33783  *                 return []
33784  */
33785     __pyx_t_3 = __pyx_f_4lxml_5etree__findChildSlice(((PySliceObject *)__pyx_v_x), ((struct LxmlElement *)__pyx_v_self)->_c_node, (&__pyx_v_c_node), (&__pyx_v_step), (&__pyx_v_slicelength)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33786
33787     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":942
33788  *                 return _collectChildren(self)
33789  *             _findChildSlice(<python.slice>x, self._c_node, &c_node, &step, &slicelength)
33790  *             if c_node is NULL:             # <<<<<<<<<<<<<<
33791  *                 return []
33792  *             if step > 0:
33793  */
33794     __pyx_t_1 = (__pyx_v_c_node == NULL);
33795     if (__pyx_t_1) {
33796
33797       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":943
33798  *             _findChildSlice(<python.slice>x, self._c_node, &c_node, &step, &slicelength)
33799  *             if c_node is NULL:
33800  *                 return []             # <<<<<<<<<<<<<<
33801  *             if step > 0:
33802  *                 next_element = _nextElement
33803  */
33804       __Pyx_XDECREF(__pyx_r);
33805       __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33806       __Pyx_GOTREF(((PyObject *)__pyx_t_2));
33807       __pyx_r = ((PyObject *)__pyx_t_2);
33808       __pyx_t_2 = 0;
33809       goto __pyx_L0;
33810       goto __pyx_L7;
33811     }
33812     __pyx_L7:;
33813
33814     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":944
33815  *             if c_node is NULL:
33816  *                 return []
33817  *             if step > 0:             # <<<<<<<<<<<<<<
33818  *                 next_element = _nextElement
33819  *             else:
33820  */
33821     __pyx_t_1 = (__pyx_v_step > 0);
33822     if (__pyx_t_1) {
33823
33824       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":945
33825  *                 return []
33826  *             if step > 0:
33827  *                 next_element = _nextElement             # <<<<<<<<<<<<<<
33828  *             else:
33829  *                 step = -step
33830  */
33831       __pyx_v_next_element = __pyx_f_4lxml_5etree__nextElement;
33832       goto __pyx_L8;
33833     }
33834     /*else*/ {
33835
33836       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":947
33837  *                 next_element = _nextElement
33838  *             else:
33839  *                 step = -step             # <<<<<<<<<<<<<<
33840  *                 next_element = _previousElement
33841  *             result = []
33842  */
33843       __pyx_v_step = (-__pyx_v_step);
33844
33845       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":948
33846  *             else:
33847  *                 step = -step
33848  *                 next_element = _previousElement             # <<<<<<<<<<<<<<
33849  *             result = []
33850  *             c = 0
33851  */
33852       __pyx_v_next_element = __pyx_f_4lxml_5etree__previousElement;
33853     }
33854     __pyx_L8:;
33855
33856     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":949
33857  *                 step = -step
33858  *                 next_element = _previousElement
33859  *             result = []             # <<<<<<<<<<<<<<
33860  *             c = 0
33861  *             while c_node is not NULL and c < slicelength:
33862  */
33863     __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33864     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
33865     __Pyx_DECREF(((PyObject *)__pyx_v_result));
33866     __pyx_v_result = __pyx_t_2;
33867     __pyx_t_2 = 0;
33868
33869     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":950
33870  *                 next_element = _previousElement
33871  *             result = []
33872  *             c = 0             # <<<<<<<<<<<<<<
33873  *             while c_node is not NULL and c < slicelength:
33874  *                 result.append(_elementFactory(self._doc, c_node))
33875  */
33876     __pyx_v_c = 0;
33877
33878     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":951
33879  *             result = []
33880  *             c = 0
33881  *             while c_node is not NULL and c < slicelength:             # <<<<<<<<<<<<<<
33882  *                 result.append(_elementFactory(self._doc, c_node))
33883  *                 c = c + 1
33884  */
33885     while (1) {
33886       if ((__pyx_v_c_node != NULL)) {
33887         __pyx_t_1 = (__pyx_v_c < __pyx_v_slicelength);
33888       } else {
33889         __pyx_t_1 = (__pyx_v_c_node != NULL);
33890       }
33891       if (!__pyx_t_1) break;
33892
33893       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":952
33894  *             c = 0
33895  *             while c_node is not NULL and c < slicelength:
33896  *                 result.append(_elementFactory(self._doc, c_node))             # <<<<<<<<<<<<<<
33897  *                 c = c + 1
33898  *                 for i from 0 <= i < step:
33899  */
33900       __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlElement *)__pyx_v_self)->_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33901       __Pyx_GOTREF(__pyx_t_2);
33902       __pyx_t_3 = PyList_Append(((PyObject *)__pyx_v_result), __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33903       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
33904
33905       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":953
33906  *             while c_node is not NULL and c < slicelength:
33907  *                 result.append(_elementFactory(self._doc, c_node))
33908  *                 c = c + 1             # <<<<<<<<<<<<<<
33909  *                 for i from 0 <= i < step:
33910  *                     c_node = next_element(c_node)
33911  */
33912       __pyx_v_c = (__pyx_v_c + 1);
33913
33914       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":954
33915  *                 result.append(_elementFactory(self._doc, c_node))
33916  *                 c = c + 1
33917  *                 for i from 0 <= i < step:             # <<<<<<<<<<<<<<
33918  *                     c_node = next_element(c_node)
33919  *             return result
33920  */
33921       __pyx_t_4 = __pyx_v_step;
33922       for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
33923
33924         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":955
33925  *                 c = c + 1
33926  *                 for i from 0 <= i < step:
33927  *                     c_node = next_element(c_node)             # <<<<<<<<<<<<<<
33928  *             return result
33929  *         else:
33930  */
33931         __pyx_v_c_node = __pyx_v_next_element(__pyx_v_c_node);
33932       }
33933     }
33934
33935     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":956
33936  *                 for i from 0 <= i < step:
33937  *                     c_node = next_element(c_node)
33938  *             return result             # <<<<<<<<<<<<<<
33939  *         else:
33940  *             # indexing
33941  */
33942     __Pyx_XDECREF(__pyx_r);
33943     __Pyx_INCREF(((PyObject *)__pyx_v_result));
33944     __pyx_r = ((PyObject *)__pyx_v_result);
33945     goto __pyx_L0;
33946     goto __pyx_L5;
33947   }
33948   /*else*/ {
33949
33950     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":959
33951  *         else:
33952  *             # indexing
33953  *             c_node = _findChild(self._c_node, x)             # <<<<<<<<<<<<<<
33954  *             if c_node is NULL:
33955  *                 raise IndexError, u"list index out of range"
33956  */
33957     __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_v_x); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33958     __pyx_v_c_node = __pyx_f_4lxml_5etree__findChild(((struct LxmlElement *)__pyx_v_self)->_c_node, __pyx_t_4);
33959
33960     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":960
33961  *             # indexing
33962  *             c_node = _findChild(self._c_node, x)
33963  *             if c_node is NULL:             # <<<<<<<<<<<<<<
33964  *                 raise IndexError, u"list index out of range"
33965  *             return _elementFactory(self._doc, c_node)
33966  */
33967     __pyx_t_1 = (__pyx_v_c_node == NULL);
33968     if (__pyx_t_1) {
33969
33970       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":961
33971  *             c_node = _findChild(self._c_node, x)
33972  *             if c_node is NULL:
33973  *                 raise IndexError, u"list index out of range"             # <<<<<<<<<<<<<<
33974  *             return _elementFactory(self._doc, c_node)
33975  * 
33976  */
33977       __Pyx_Raise(__pyx_builtin_IndexError, ((PyObject *)__pyx_kp_324), 0);
33978       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33979       goto __pyx_L13;
33980     }
33981     __pyx_L13:;
33982
33983     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":962
33984  *             if c_node is NULL:
33985  *                 raise IndexError, u"list index out of range"
33986  *             return _elementFactory(self._doc, c_node)             # <<<<<<<<<<<<<<
33987  * 
33988  *     def __len__(self):
33989  */
33990     __Pyx_XDECREF(__pyx_r);
33991     __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlElement *)__pyx_v_self)->_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33992     __Pyx_GOTREF(__pyx_t_2);
33993     __pyx_r = __pyx_t_2;
33994     __pyx_t_2 = 0;
33995     goto __pyx_L0;
33996   }
33997   __pyx_L5:;
33998
33999   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
34000   goto __pyx_L0;
34001   __pyx_L1_error:;
34002   __Pyx_XDECREF(__pyx_t_2);
34003   __Pyx_AddTraceback("lxml.etree._Element.__getitem__");
34004   __pyx_r = NULL;
34005   __pyx_L0:;
34006   __Pyx_DECREF(__pyx_v_result);
34007   __Pyx_XGIVEREF(__pyx_r);
34008   __Pyx_FinishRefcountContext();
34009   return __pyx_r;
34010 }
34011
34012 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":964
34013  *             return _elementFactory(self._doc, c_node)
34014  * 
34015  *     def __len__(self):             # <<<<<<<<<<<<<<
34016  *         u"""__len__(self)
34017  * 
34018  */
34019
34020 static Py_ssize_t __pyx_pf_4lxml_5etree_8_Element___len__(PyObject *__pyx_v_self); /*proto*/
34021 static char __pyx_doc_4lxml_5etree_8_Element___len__[] = "__len__(self)\n\n        Returns the number of subelements.\n        ";
34022 static Py_ssize_t __pyx_pf_4lxml_5etree_8_Element___len__(PyObject *__pyx_v_self) {
34023   Py_ssize_t __pyx_r;
34024   __Pyx_SetupRefcountContext("__len__");
34025
34026   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":969
34027  *         Returns the number of subelements.
34028  *         """
34029  *         return _countElements(self._c_node.children)             # <<<<<<<<<<<<<<
34030  * 
34031  *     def __nonzero__(self):
34032  */
34033   __pyx_r = __pyx_f_4lxml_5etree__countElements(((struct LxmlElement *)__pyx_v_self)->_c_node->children);
34034   goto __pyx_L0;
34035
34036   __pyx_r = 0;
34037   __pyx_L0:;
34038   __Pyx_FinishRefcountContext();
34039   return __pyx_r;
34040 }
34041
34042 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":971
34043  *         return _countElements(self._c_node.children)
34044  * 
34045  *     def __nonzero__(self):             # <<<<<<<<<<<<<<
34046  *         u"__nonzero__(self)"
34047  *         import warnings
34048  */
34049
34050 static int __pyx_pf_4lxml_5etree_8_Element___nonzero__(PyObject *__pyx_v_self); /*proto*/
34051 static char __pyx_doc_4lxml_5etree_8_Element___nonzero__[] = "__nonzero__(self)";
34052 static int __pyx_pf_4lxml_5etree_8_Element___nonzero__(PyObject *__pyx_v_self) {
34053   PyObject *__pyx_v_warnings;
34054   int __pyx_r;
34055   PyObject *__pyx_1 = 0;
34056   PyObject *__pyx_t_1 = NULL;
34057   PyObject *__pyx_t_2 = NULL;
34058   PyObject *__pyx_t_3 = NULL;
34059   __Pyx_SetupRefcountContext("__nonzero__");
34060   __pyx_v_warnings = Py_None; __Pyx_INCREF(Py_None);
34061
34062   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":973
34063  *     def __nonzero__(self):
34064  *         u"__nonzero__(self)"
34065  *         import warnings             # <<<<<<<<<<<<<<
34066  *         warnings.warn(
34067  *             u"The behavior of this method will change in future versions. "
34068  */
34069   __pyx_1 = __Pyx_Import(__pyx_kp_warnings, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
34070   __Pyx_GOTREF(__pyx_1);
34071   __Pyx_DECREF(__pyx_v_warnings);
34072   __pyx_v_warnings = __pyx_1;
34073   __pyx_1 = 0;
34074
34075   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":974
34076  *         u"__nonzero__(self)"
34077  *         import warnings
34078  *         warnings.warn(             # <<<<<<<<<<<<<<
34079  *             u"The behavior of this method will change in future versions. "
34080  *             u"Use specific 'len(elem)' or 'elem is not None' test instead.",
34081  */
34082   __pyx_t_1 = PyObject_GetAttr(__pyx_v_warnings, __pyx_kp_warn); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
34083   __Pyx_GOTREF(__pyx_t_1);
34084
34085   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":978
34086  *             u"Use specific 'len(elem)' or 'elem is not None' test instead.",
34087  *             FutureWarning
34088  *             )             # <<<<<<<<<<<<<<
34089  *         # emulate old behaviour
34090  *         return _hasChild(self._c_node)
34091  */
34092   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
34093   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
34094   __Pyx_INCREF(((PyObject *)__pyx_kp_325));
34095   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_325));
34096   __Pyx_GIVEREF(((PyObject *)__pyx_kp_325));
34097   __Pyx_INCREF(__pyx_builtin_FutureWarning);
34098   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_builtin_FutureWarning);
34099   __Pyx_GIVEREF(__pyx_builtin_FutureWarning);
34100   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
34101   __Pyx_GOTREF(__pyx_t_3);
34102   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
34103   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
34104   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34105
34106   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":980
34107  *             )
34108  *         # emulate old behaviour
34109  *         return _hasChild(self._c_node)             # <<<<<<<<<<<<<<
34110  * 
34111  *     def __contains__(self, element):
34112  */
34113   __pyx_r = __pyx_f_4lxml_5etree__hasChild(((struct LxmlElement *)__pyx_v_self)->_c_node);
34114   goto __pyx_L0;
34115
34116   __pyx_r = 0;
34117   goto __pyx_L0;
34118   __pyx_L1_error:;
34119   __Pyx_XDECREF(__pyx_1);
34120   __Pyx_XDECREF(__pyx_t_1);
34121   __Pyx_XDECREF(__pyx_t_2);
34122   __Pyx_XDECREF(__pyx_t_3);
34123   __Pyx_AddTraceback("lxml.etree._Element.__nonzero__");
34124   __pyx_r = -1;
34125   __pyx_L0:;
34126   __Pyx_DECREF(__pyx_v_warnings);
34127   __Pyx_FinishRefcountContext();
34128   return __pyx_r;
34129 }
34130
34131 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":982
34132  *         return _hasChild(self._c_node)
34133  * 
34134  *     def __contains__(self, element):             # <<<<<<<<<<<<<<
34135  *         u"__contains__(self, element)"
34136  *         cdef xmlNode* c_node
34137  */
34138
34139 static int __pyx_pf_4lxml_5etree_8_Element___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_element); /*proto*/
34140 static char __pyx_doc_4lxml_5etree_8_Element___contains__[] = "__contains__(self, element)";
34141 static int __pyx_pf_4lxml_5etree_8_Element___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_element) {
34142   xmlNode *__pyx_v_c_node;
34143   int __pyx_r;
34144   int __pyx_t_1;
34145   int __pyx_t_2;
34146   __Pyx_SetupRefcountContext("__contains__");
34147
34148   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":985
34149  *         u"__contains__(self, element)"
34150  *         cdef xmlNode* c_node
34151  *         if not isinstance(element, _Element):             # <<<<<<<<<<<<<<
34152  *             return 0
34153  *         c_node = (<_Element>element)._c_node
34154  */
34155   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_element, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Element))); 
34156   __pyx_t_2 = (!__pyx_t_1);
34157   if (__pyx_t_2) {
34158
34159     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":986
34160  *         cdef xmlNode* c_node
34161  *         if not isinstance(element, _Element):
34162  *             return 0             # <<<<<<<<<<<<<<
34163  *         c_node = (<_Element>element)._c_node
34164  *         return c_node is not NULL and c_node.parent is self._c_node
34165  */
34166     __pyx_r = 0;
34167     goto __pyx_L0;
34168     goto __pyx_L5;
34169   }
34170   __pyx_L5:;
34171
34172   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":987
34173  *         if not isinstance(element, _Element):
34174  *             return 0
34175  *         c_node = (<_Element>element)._c_node             # <<<<<<<<<<<<<<
34176  *         return c_node is not NULL and c_node.parent is self._c_node
34177  * 
34178  */
34179   __pyx_v_c_node = ((struct LxmlElement *)__pyx_v_element)->_c_node;
34180
34181   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":988
34182  *             return 0
34183  *         c_node = (<_Element>element)._c_node
34184  *         return c_node is not NULL and c_node.parent is self._c_node             # <<<<<<<<<<<<<<
34185  * 
34186  *     def __iter__(self):
34187  */
34188   if ((__pyx_v_c_node != NULL)) {
34189     __pyx_t_2 = (__pyx_v_c_node->parent == ((struct LxmlElement *)__pyx_v_self)->_c_node);
34190   } else {
34191     __pyx_t_2 = (__pyx_v_c_node != NULL);
34192   }
34193   __pyx_r = __pyx_t_2;
34194   goto __pyx_L0;
34195
34196   __pyx_r = 0;
34197   __pyx_L0:;
34198   __Pyx_FinishRefcountContext();
34199   return __pyx_r;
34200 }
34201
34202 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":990
34203  *         return c_node is not NULL and c_node.parent is self._c_node
34204  * 
34205  *     def __iter__(self):             # <<<<<<<<<<<<<<
34206  *         u"__iter__(self)"
34207  *         return ElementChildIterator(self)
34208  */
34209
34210 static PyObject *__pyx_pf_4lxml_5etree_8_Element___iter__(PyObject *__pyx_v_self); /*proto*/
34211 static char __pyx_doc_4lxml_5etree_8_Element___iter__[] = "__iter__(self)";
34212 static PyObject *__pyx_pf_4lxml_5etree_8_Element___iter__(PyObject *__pyx_v_self) {
34213   PyObject *__pyx_r = NULL;
34214   PyObject *__pyx_t_1 = NULL;
34215   PyObject *__pyx_t_2 = NULL;
34216   __Pyx_SetupRefcountContext("__iter__");
34217
34218   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":992
34219  *     def __iter__(self):
34220  *         u"__iter__(self)"
34221  *         return ElementChildIterator(self)             # <<<<<<<<<<<<<<
34222  * 
34223  *     def __reversed__(self):
34224  */
34225   __Pyx_XDECREF(__pyx_r);
34226   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
34227   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
34228   __Pyx_INCREF(__pyx_v_self);
34229   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
34230   __Pyx_GIVEREF(__pyx_v_self);
34231   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_ElementChildIterator)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
34232   __Pyx_GOTREF(__pyx_t_2);
34233   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
34234   __pyx_r = __pyx_t_2;
34235   __pyx_t_2 = 0;
34236   goto __pyx_L0;
34237
34238   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
34239   goto __pyx_L0;
34240   __pyx_L1_error:;
34241   __Pyx_XDECREF(__pyx_t_1);
34242   __Pyx_XDECREF(__pyx_t_2);
34243   __Pyx_AddTraceback("lxml.etree._Element.__iter__");
34244   __pyx_r = NULL;
34245   __pyx_L0:;
34246   __Pyx_XGIVEREF(__pyx_r);
34247   __Pyx_FinishRefcountContext();
34248   return __pyx_r;
34249 }
34250
34251 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":994
34252  *         return ElementChildIterator(self)
34253  * 
34254  *     def __reversed__(self):             # <<<<<<<<<<<<<<
34255  *         u"__reversed__(self)"
34256  *         return ElementChildIterator(self, reversed=True)
34257  */
34258
34259 static PyObject *__pyx_pf_4lxml_5etree_8_Element___reversed__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
34260 static char __pyx_doc_4lxml_5etree_8_Element___reversed__[] = "__reversed__(self)";
34261 static PyObject *__pyx_pf_4lxml_5etree_8_Element___reversed__(PyObject *__pyx_v_self, PyObject *unused) {
34262   PyObject *__pyx_r = NULL;
34263   PyObject *__pyx_1 = 0;
34264   PyObject *__pyx_t_1 = NULL;
34265   PyObject *__pyx_t_2 = NULL;
34266   __Pyx_SetupRefcountContext("__reversed__");
34267
34268   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":996
34269  *     def __reversed__(self):
34270  *         u"__reversed__(self)"
34271  *         return ElementChildIterator(self, reversed=True)             # <<<<<<<<<<<<<<
34272  * 
34273  *     def index(self, _Element child not None, start=None, stop=None):
34274  */
34275   __Pyx_XDECREF(__pyx_r);
34276   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
34277   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
34278   __Pyx_INCREF(__pyx_v_self);
34279   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
34280   __Pyx_GIVEREF(__pyx_v_self);
34281   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
34282   __Pyx_GOTREF(((PyObject *)__pyx_1));
34283   __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
34284   __Pyx_GOTREF(__pyx_t_2);
34285   if (PyDict_SetItem(__pyx_1, __pyx_kp_reversed, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
34286   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
34287   __pyx_t_2 = PyEval_CallObjectWithKeywords(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_ElementChildIterator)), ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
34288   __Pyx_GOTREF(__pyx_t_2);
34289   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
34290   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
34291   __pyx_r = __pyx_t_2;
34292   __pyx_t_2 = 0;
34293   goto __pyx_L0;
34294
34295   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
34296   goto __pyx_L0;
34297   __pyx_L1_error:;
34298   __Pyx_XDECREF(__pyx_1);
34299   __Pyx_XDECREF(__pyx_t_1);
34300   __Pyx_XDECREF(__pyx_t_2);
34301   __Pyx_AddTraceback("lxml.etree._Element.__reversed__");
34302   __pyx_r = NULL;
34303   __pyx_L0:;
34304   __Pyx_XGIVEREF(__pyx_r);
34305   __Pyx_FinishRefcountContext();
34306   return __pyx_r;
34307 }
34308
34309 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":998
34310  *         return ElementChildIterator(self, reversed=True)
34311  * 
34312  *     def index(self, _Element child not None, start=None, stop=None):             # <<<<<<<<<<<<<<
34313  *         u"""index(self, child, start=None, stop=None)
34314  * 
34315  */
34316
34317 static PyObject *__pyx_pf_4lxml_5etree_8_Element_index(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
34318 static char __pyx_doc_4lxml_5etree_8_Element_index[] = "index(self, child, start=None, stop=None)\n\n        Find the position of the child within the parent.\n\n        This method is not part of the original ElementTree API.\n        ";
34319 static PyObject *__pyx_pf_4lxml_5etree_8_Element_index(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
34320   struct LxmlElement *__pyx_v_child = 0;
34321   PyObject *__pyx_v_start = 0;
34322   PyObject *__pyx_v_stop = 0;
34323   Py_ssize_t __pyx_v_k;
34324   Py_ssize_t __pyx_v_l;
34325   Py_ssize_t __pyx_v_c_start;
34326   Py_ssize_t __pyx_v_c_stop;
34327   xmlNode *__pyx_v_c_child;
34328   xmlNode *__pyx_v_c_start_node;
34329   PyObject *__pyx_r = NULL;
34330   int __pyx_t_1;
34331   int __pyx_t_2;
34332   PyObject *__pyx_t_3 = NULL;
34333   int __pyx_t_4;
34334   int __pyx_t_5;
34335   Py_ssize_t __pyx_t_6;
34336   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_child,&__pyx_kp_start,&__pyx_kp_stop,0};
34337   __Pyx_SetupRefcountContext("index");
34338   if (unlikely(__pyx_kwds)) {
34339     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
34340     PyObject* values[3] = {0,0,0};
34341     values[1] = Py_None;
34342     values[2] = Py_None;
34343     switch (PyTuple_GET_SIZE(__pyx_args)) {
34344       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
34345       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
34346       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
34347       case  0: break;
34348       default: goto __pyx_L5_argtuple_error;
34349     }
34350     switch (PyTuple_GET_SIZE(__pyx_args)) {
34351       case  0:
34352       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_child);
34353       if (likely(values[0])) kw_args--;
34354       else goto __pyx_L5_argtuple_error;
34355       case  1:
34356       if (kw_args > 1) {
34357         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_start);
34358         if (unlikely(value)) { values[1] = value; kw_args--; }
34359       }
34360       case  2:
34361       if (kw_args > 1) {
34362         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_stop);
34363         if (unlikely(value)) { values[2] = value; kw_args--; }
34364       }
34365     }
34366     if (unlikely(kw_args > 0)) {
34367       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "index") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
34368     }
34369     __pyx_v_child = ((struct LxmlElement *)values[0]);
34370     __pyx_v_start = values[1];
34371     __pyx_v_stop = values[2];
34372   } else {
34373     __pyx_v_start = Py_None;
34374     __pyx_v_stop = Py_None;
34375     switch (PyTuple_GET_SIZE(__pyx_args)) {
34376       case  3: __pyx_v_stop = PyTuple_GET_ITEM(__pyx_args, 2);
34377       case  2: __pyx_v_start = PyTuple_GET_ITEM(__pyx_args, 1);
34378       case  1: __pyx_v_child = ((struct LxmlElement *)PyTuple_GET_ITEM(__pyx_args, 0));
34379       break;
34380       default: goto __pyx_L5_argtuple_error;
34381     }
34382   }
34383   goto __pyx_L4_argument_unpacking_done;
34384   __pyx_L5_argtuple_error:;
34385   __Pyx_RaiseArgtupleInvalid("index", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
34386   __pyx_L3_error:;
34387   __Pyx_AddTraceback("lxml.etree._Element.index");
34388   return NULL;
34389   __pyx_L4_argument_unpacking_done:;
34390   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_child), __pyx_ptype_4lxml_5etree__Element, 0, "child", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
34391
34392   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1009
34393  *         cdef xmlNode* c_child
34394  *         cdef xmlNode* c_start_node
34395  *         c_child = child._c_node             # <<<<<<<<<<<<<<
34396  *         if c_child.parent is not self._c_node:
34397  *             raise ValueError, u"Element is not a child of this node."
34398  */
34399   __pyx_v_c_child = __pyx_v_child->_c_node;
34400
34401   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1010
34402  *         cdef xmlNode* c_start_node
34403  *         c_child = child._c_node
34404  *         if c_child.parent is not self._c_node:             # <<<<<<<<<<<<<<
34405  *             raise ValueError, u"Element is not a child of this node."
34406  * 
34407  */
34408   __pyx_t_1 = (__pyx_v_c_child->parent != ((struct LxmlElement *)__pyx_v_self)->_c_node);
34409   if (__pyx_t_1) {
34410
34411     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1011
34412  *         c_child = child._c_node
34413  *         if c_child.parent is not self._c_node:
34414  *             raise ValueError, u"Element is not a child of this node."             # <<<<<<<<<<<<<<
34415  * 
34416  *         # handle the unbounded search straight away (normal case)
34417  */
34418     __Pyx_Raise(__pyx_builtin_ValueError, ((PyObject *)__pyx_kp_326), 0);
34419     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
34420     goto __pyx_L6;
34421   }
34422   __pyx_L6:;
34423
34424   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1014
34425  * 
34426  *         # handle the unbounded search straight away (normal case)
34427  *         if stop is None and (start is None or start == 0):             # <<<<<<<<<<<<<<
34428  *             k = 0
34429  *             c_child = c_child.prev
34430  */
34431   __pyx_t_1 = (__pyx_v_stop == Py_None);
34432   if (__pyx_t_1) {
34433     __pyx_t_2 = (__pyx_v_start == Py_None);
34434     if (!__pyx_t_2) {
34435       __pyx_t_3 = PyObject_RichCompare(__pyx_v_start, __pyx_int_0, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
34436       __Pyx_GOTREF(__pyx_t_3);
34437       __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
34438       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
34439       __pyx_t_5 = __pyx_t_4;
34440     } else {
34441       __pyx_t_5 = __pyx_t_2;
34442     }
34443     __pyx_t_2 = __pyx_t_5;
34444   } else {
34445     __pyx_t_2 = __pyx_t_1;
34446   }
34447   if (__pyx_t_2) {
34448
34449     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1015
34450  *         # handle the unbounded search straight away (normal case)
34451  *         if stop is None and (start is None or start == 0):
34452  *             k = 0             # <<<<<<<<<<<<<<
34453  *             c_child = c_child.prev
34454  *             while c_child is not NULL:
34455  */
34456     __pyx_v_k = 0;
34457
34458     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1016
34459  *         if stop is None and (start is None or start == 0):
34460  *             k = 0
34461  *             c_child = c_child.prev             # <<<<<<<<<<<<<<
34462  *             while c_child is not NULL:
34463  *                 if _isElement(c_child):
34464  */
34465     __pyx_v_c_child = __pyx_v_c_child->prev;
34466
34467     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1017
34468  *             k = 0
34469  *             c_child = c_child.prev
34470  *             while c_child is not NULL:             # <<<<<<<<<<<<<<
34471  *                 if _isElement(c_child):
34472  *                     k = k + 1
34473  */
34474     while (1) {
34475       __pyx_t_2 = (__pyx_v_c_child != NULL);
34476       if (!__pyx_t_2) break;
34477
34478       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1018
34479  *             c_child = c_child.prev
34480  *             while c_child is not NULL:
34481  *                 if _isElement(c_child):             # <<<<<<<<<<<<<<
34482  *                     k = k + 1
34483  *                 c_child = c_child.prev
34484  */
34485       __pyx_t_2 = _isElement(__pyx_v_c_child);
34486       if (__pyx_t_2) {
34487
34488         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1019
34489  *             while c_child is not NULL:
34490  *                 if _isElement(c_child):
34491  *                     k = k + 1             # <<<<<<<<<<<<<<
34492  *                 c_child = c_child.prev
34493  *             return k
34494  */
34495         __pyx_v_k = (__pyx_v_k + 1);
34496         goto __pyx_L10;
34497       }
34498       __pyx_L10:;
34499
34500       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1020
34501  *                 if _isElement(c_child):
34502  *                     k = k + 1
34503  *                 c_child = c_child.prev             # <<<<<<<<<<<<<<
34504  *             return k
34505  * 
34506  */
34507       __pyx_v_c_child = __pyx_v_c_child->prev;
34508     }
34509
34510     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1021
34511  *                     k = k + 1
34512  *                 c_child = c_child.prev
34513  *             return k             # <<<<<<<<<<<<<<
34514  * 
34515  *         # check indices
34516  */
34517     __Pyx_XDECREF(__pyx_r);
34518     __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
34519     __Pyx_GOTREF(__pyx_t_3);
34520     __pyx_r = __pyx_t_3;
34521     __pyx_t_3 = 0;
34522     goto __pyx_L0;
34523     goto __pyx_L7;
34524   }
34525   __pyx_L7:;
34526
34527   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1024
34528  * 
34529  *         # check indices
34530  *         if start is None:             # <<<<<<<<<<<<<<
34531  *             c_start = 0
34532  *         else:
34533  */
34534   __pyx_t_2 = (__pyx_v_start == Py_None);
34535   if (__pyx_t_2) {
34536
34537     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1025
34538  *         # check indices
34539  *         if start is None:
34540  *             c_start = 0             # <<<<<<<<<<<<<<
34541  *         else:
34542  *             c_start = start
34543  */
34544     __pyx_v_c_start = 0;
34545     goto __pyx_L11;
34546   }
34547   /*else*/ {
34548
34549     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1027
34550  *             c_start = 0
34551  *         else:
34552  *             c_start = start             # <<<<<<<<<<<<<<
34553  *         if stop is None:
34554  *             c_stop = 0
34555  */
34556     __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_start); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
34557     __pyx_v_c_start = __pyx_t_6;
34558   }
34559   __pyx_L11:;
34560
34561   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1028
34562  *         else:
34563  *             c_start = start
34564  *         if stop is None:             # <<<<<<<<<<<<<<
34565  *             c_stop = 0
34566  *         else:
34567  */
34568   __pyx_t_2 = (__pyx_v_stop == Py_None);
34569   if (__pyx_t_2) {
34570
34571     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1029
34572  *             c_start = start
34573  *         if stop is None:
34574  *             c_stop = 0             # <<<<<<<<<<<<<<
34575  *         else:
34576  *             c_stop = stop
34577  */
34578     __pyx_v_c_stop = 0;
34579     goto __pyx_L12;
34580   }
34581   /*else*/ {
34582
34583     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1031
34584  *             c_stop = 0
34585  *         else:
34586  *             c_stop = stop             # <<<<<<<<<<<<<<
34587  *             if c_stop == 0 or \
34588  *                    c_start >= c_stop and (c_stop > 0 or c_start < 0):
34589  */
34590     __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_stop); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
34591     __pyx_v_c_stop = __pyx_t_6;
34592
34593     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1032
34594  *         else:
34595  *             c_stop = stop
34596  *             if c_stop == 0 or \             # <<<<<<<<<<<<<<
34597  *                    c_start >= c_stop and (c_stop > 0 or c_start < 0):
34598  *                 raise ValueError, u"list.index(x): x not in slice"
34599  */
34600     if (!(__pyx_v_c_stop == 0)) {
34601
34602       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1033
34603  *             c_stop = stop
34604  *             if c_stop == 0 or \
34605  *                    c_start >= c_stop and (c_stop > 0 or c_start < 0):             # <<<<<<<<<<<<<<
34606  *                 raise ValueError, u"list.index(x): x not in slice"
34607  * 
34608  */
34609       if ((__pyx_v_c_start >= __pyx_v_c_stop)) {
34610         if (!(__pyx_v_c_stop > 0)) {
34611           __pyx_t_2 = (__pyx_v_c_start < 0);
34612         } else {
34613           __pyx_t_2 = (__pyx_v_c_stop > 0);
34614         }
34615         __pyx_t_1 = __pyx_t_2;
34616       } else {
34617         __pyx_t_1 = (__pyx_v_c_start >= __pyx_v_c_stop);
34618       }
34619       __pyx_t_2 = __pyx_t_1;
34620     } else {
34621       __pyx_t_2 = (__pyx_v_c_stop == 0);
34622     }
34623     if (__pyx_t_2) {
34624
34625       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1034
34626  *             if c_stop == 0 or \
34627  *                    c_start >= c_stop and (c_stop > 0 or c_start < 0):
34628  *                 raise ValueError, u"list.index(x): x not in slice"             # <<<<<<<<<<<<<<
34629  * 
34630  *         # for negative slice indices, check slice before searching index
34631  */
34632       __Pyx_Raise(__pyx_builtin_ValueError, ((PyObject *)__pyx_kp_327), 0);
34633       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
34634       goto __pyx_L13;
34635     }
34636     __pyx_L13:;
34637   }
34638   __pyx_L12:;
34639
34640   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1037
34641  * 
34642  *         # for negative slice indices, check slice before searching index
34643  *         if c_start < 0 or c_stop < 0:             # <<<<<<<<<<<<<<
34644  *             # start from right, at most up to leftmost(c_start, c_stop)
34645  *             if c_start < c_stop:
34646  */
34647   if (!(__pyx_v_c_start < 0)) {
34648     __pyx_t_2 = (__pyx_v_c_stop < 0);
34649   } else {
34650     __pyx_t_2 = (__pyx_v_c_start < 0);
34651   }
34652   if (__pyx_t_2) {
34653
34654     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1039
34655  *         if c_start < 0 or c_stop < 0:
34656  *             # start from right, at most up to leftmost(c_start, c_stop)
34657  *             if c_start < c_stop:             # <<<<<<<<<<<<<<
34658  *                 k = -c_start
34659  *             else:
34660  */
34661     __pyx_t_2 = (__pyx_v_c_start < __pyx_v_c_stop);
34662     if (__pyx_t_2) {
34663
34664       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1040
34665  *             # start from right, at most up to leftmost(c_start, c_stop)
34666  *             if c_start < c_stop:
34667  *                 k = -c_start             # <<<<<<<<<<<<<<
34668  *             else:
34669  *                 k = -c_stop
34670  */
34671       __pyx_v_k = (-__pyx_v_c_start);
34672       goto __pyx_L15;
34673     }
34674     /*else*/ {
34675
34676       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1042
34677  *                 k = -c_start
34678  *             else:
34679  *                 k = -c_stop             # <<<<<<<<<<<<<<
34680  *             c_start_node = self._c_node.last
34681  *             l = 1
34682  */
34683       __pyx_v_k = (-__pyx_v_c_stop);
34684     }
34685     __pyx_L15:;
34686
34687     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1043
34688  *             else:
34689  *                 k = -c_stop
34690  *             c_start_node = self._c_node.last             # <<<<<<<<<<<<<<
34691  *             l = 1
34692  *             while c_start_node != c_child and l < k:
34693  */
34694     __pyx_v_c_start_node = ((struct LxmlElement *)__pyx_v_self)->_c_node->last;
34695
34696     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1044
34697  *                 k = -c_stop
34698  *             c_start_node = self._c_node.last
34699  *             l = 1             # <<<<<<<<<<<<<<
34700  *             while c_start_node != c_child and l < k:
34701  *                 if _isElement(c_start_node):
34702  */
34703     __pyx_v_l = 1;
34704
34705     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1045
34706  *             c_start_node = self._c_node.last
34707  *             l = 1
34708  *             while c_start_node != c_child and l < k:             # <<<<<<<<<<<<<<
34709  *                 if _isElement(c_start_node):
34710  *                     l = l + 1
34711  */
34712     while (1) {
34713       if ((__pyx_v_c_start_node != __pyx_v_c_child)) {
34714         __pyx_t_2 = (__pyx_v_l < __pyx_v_k);
34715       } else {
34716         __pyx_t_2 = (__pyx_v_c_start_node != __pyx_v_c_child);
34717       }
34718       if (!__pyx_t_2) break;
34719
34720       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1046
34721  *             l = 1
34722  *             while c_start_node != c_child and l < k:
34723  *                 if _isElement(c_start_node):             # <<<<<<<<<<<<<<
34724  *                     l = l + 1
34725  *                 c_start_node = c_start_node.prev
34726  */
34727       __pyx_t_2 = _isElement(__pyx_v_c_start_node);
34728       if (__pyx_t_2) {
34729
34730         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1047
34731  *             while c_start_node != c_child and l < k:
34732  *                 if _isElement(c_start_node):
34733  *                     l = l + 1             # <<<<<<<<<<<<<<
34734  *                 c_start_node = c_start_node.prev
34735  *             if c_start_node == c_child:
34736  */
34737         __pyx_v_l = (__pyx_v_l + 1);
34738         goto __pyx_L18;
34739       }
34740       __pyx_L18:;
34741
34742       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1048
34743  *                 if _isElement(c_start_node):
34744  *                     l = l + 1
34745  *                 c_start_node = c_start_node.prev             # <<<<<<<<<<<<<<
34746  *             if c_start_node == c_child:
34747  *                 # found! before slice end?
34748  */
34749       __pyx_v_c_start_node = __pyx_v_c_start_node->prev;
34750     }
34751
34752     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1049
34753  *                     l = l + 1
34754  *                 c_start_node = c_start_node.prev
34755  *             if c_start_node == c_child:             # <<<<<<<<<<<<<<
34756  *                 # found! before slice end?
34757  *                 if c_stop < 0 and l <= -c_stop:
34758  */
34759     __pyx_t_2 = (__pyx_v_c_start_node == __pyx_v_c_child);
34760     if (__pyx_t_2) {
34761
34762       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1051
34763  *             if c_start_node == c_child:
34764  *                 # found! before slice end?
34765  *                 if c_stop < 0 and l <= -c_stop:             # <<<<<<<<<<<<<<
34766  *                     raise ValueError, u"list.index(x): x not in slice"
34767  *             elif c_start < 0:
34768  */
34769       if ((__pyx_v_c_stop < 0)) {
34770         __pyx_t_2 = (__pyx_v_l <= (-__pyx_v_c_stop));
34771       } else {
34772         __pyx_t_2 = (__pyx_v_c_stop < 0);
34773       }
34774       if (__pyx_t_2) {
34775
34776         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1052
34777  *                 # found! before slice end?
34778  *                 if c_stop < 0 and l <= -c_stop:
34779  *                     raise ValueError, u"list.index(x): x not in slice"             # <<<<<<<<<<<<<<
34780  *             elif c_start < 0:
34781  *                 raise ValueError, u"list.index(x): x not in slice"
34782  */
34783         __Pyx_Raise(__pyx_builtin_ValueError, ((PyObject *)__pyx_kp_328), 0);
34784         {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
34785         goto __pyx_L20;
34786       }
34787       __pyx_L20:;
34788       goto __pyx_L19;
34789     }
34790
34791     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1053
34792  *                 if c_stop < 0 and l <= -c_stop:
34793  *                     raise ValueError, u"list.index(x): x not in slice"
34794  *             elif c_start < 0:             # <<<<<<<<<<<<<<
34795  *                 raise ValueError, u"list.index(x): x not in slice"
34796  * 
34797  */
34798     __pyx_t_2 = (__pyx_v_c_start < 0);
34799     if (__pyx_t_2) {
34800
34801       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1054
34802  *                     raise ValueError, u"list.index(x): x not in slice"
34803  *             elif c_start < 0:
34804  *                 raise ValueError, u"list.index(x): x not in slice"             # <<<<<<<<<<<<<<
34805  * 
34806  *         # now determine the index backwards from child
34807  */
34808       __Pyx_Raise(__pyx_builtin_ValueError, ((PyObject *)__pyx_kp_329), 0);
34809       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
34810       goto __pyx_L19;
34811     }
34812     __pyx_L19:;
34813     goto __pyx_L14;
34814   }
34815   __pyx_L14:;
34816
34817   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1057
34818  * 
34819  *         # now determine the index backwards from child
34820  *         c_child = c_child.prev             # <<<<<<<<<<<<<<
34821  *         k = 0
34822  *         if c_stop > 0:
34823  */
34824   __pyx_v_c_child = __pyx_v_c_child->prev;
34825
34826   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1058
34827  *         # now determine the index backwards from child
34828  *         c_child = c_child.prev
34829  *         k = 0             # <<<<<<<<<<<<<<
34830  *         if c_stop > 0:
34831  *             # we can optimize: stop after c_stop elements if not found
34832  */
34833   __pyx_v_k = 0;
34834
34835   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1059
34836  *         c_child = c_child.prev
34837  *         k = 0
34838  *         if c_stop > 0:             # <<<<<<<<<<<<<<
34839  *             # we can optimize: stop after c_stop elements if not found
34840  *             while c_child != NULL and k < c_stop:
34841  */
34842   __pyx_t_2 = (__pyx_v_c_stop > 0);
34843   if (__pyx_t_2) {
34844
34845     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1061
34846  *         if c_stop > 0:
34847  *             # we can optimize: stop after c_stop elements if not found
34848  *             while c_child != NULL and k < c_stop:             # <<<<<<<<<<<<<<
34849  *                 if _isElement(c_child):
34850  *                     k = k + 1
34851  */
34852     while (1) {
34853       if ((__pyx_v_c_child != NULL)) {
34854         __pyx_t_2 = (__pyx_v_k < __pyx_v_c_stop);
34855       } else {
34856         __pyx_t_2 = (__pyx_v_c_child != NULL);
34857       }
34858       if (!__pyx_t_2) break;
34859
34860       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1062
34861  *             # we can optimize: stop after c_stop elements if not found
34862  *             while c_child != NULL and k < c_stop:
34863  *                 if _isElement(c_child):             # <<<<<<<<<<<<<<
34864  *                     k = k + 1
34865  *                 c_child = c_child.prev
34866  */
34867       __pyx_t_2 = _isElement(__pyx_v_c_child);
34868       if (__pyx_t_2) {
34869
34870         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1063
34871  *             while c_child != NULL and k < c_stop:
34872  *                 if _isElement(c_child):
34873  *                     k = k + 1             # <<<<<<<<<<<<<<
34874  *                 c_child = c_child.prev
34875  *             if k < c_stop:
34876  */
34877         __pyx_v_k = (__pyx_v_k + 1);
34878         goto __pyx_L24;
34879       }
34880       __pyx_L24:;
34881
34882       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1064
34883  *                 if _isElement(c_child):
34884  *                     k = k + 1
34885  *                 c_child = c_child.prev             # <<<<<<<<<<<<<<
34886  *             if k < c_stop:
34887  *                 return k
34888  */
34889       __pyx_v_c_child = __pyx_v_c_child->prev;
34890     }
34891
34892     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1065
34893  *                     k = k + 1
34894  *                 c_child = c_child.prev
34895  *             if k < c_stop:             # <<<<<<<<<<<<<<
34896  *                 return k
34897  *         else:
34898  */
34899     __pyx_t_2 = (__pyx_v_k < __pyx_v_c_stop);
34900     if (__pyx_t_2) {
34901
34902       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1066
34903  *                 c_child = c_child.prev
34904  *             if k < c_stop:
34905  *                 return k             # <<<<<<<<<<<<<<
34906  *         else:
34907  *             # traverse all
34908  */
34909       __Pyx_XDECREF(__pyx_r);
34910       __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
34911       __Pyx_GOTREF(__pyx_t_3);
34912       __pyx_r = __pyx_t_3;
34913       __pyx_t_3 = 0;
34914       goto __pyx_L0;
34915       goto __pyx_L25;
34916     }
34917     __pyx_L25:;
34918     goto __pyx_L21;
34919   }
34920   /*else*/ {
34921
34922     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1069
34923  *         else:
34924  *             # traverse all
34925  *             while c_child != NULL:             # <<<<<<<<<<<<<<
34926  *                 if _isElement(c_child):
34927  *                     k = k + 1
34928  */
34929     while (1) {
34930       __pyx_t_2 = (__pyx_v_c_child != NULL);
34931       if (!__pyx_t_2) break;
34932
34933       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1070
34934  *             # traverse all
34935  *             while c_child != NULL:
34936  *                 if _isElement(c_child):             # <<<<<<<<<<<<<<
34937  *                     k = k + 1
34938  *                 c_child = c_child.prev
34939  */
34940       __pyx_t_2 = _isElement(__pyx_v_c_child);
34941       if (__pyx_t_2) {
34942
34943         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1071
34944  *             while c_child != NULL:
34945  *                 if _isElement(c_child):
34946  *                     k = k + 1             # <<<<<<<<<<<<<<
34947  *                 c_child = c_child.prev
34948  *             if c_start > 0:
34949  */
34950         __pyx_v_k = (__pyx_v_k + 1);
34951         goto __pyx_L28;
34952       }
34953       __pyx_L28:;
34954
34955       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1072
34956  *                 if _isElement(c_child):
34957  *                     k = k + 1
34958  *                 c_child = c_child.prev             # <<<<<<<<<<<<<<
34959  *             if c_start > 0:
34960  *                 if k >= c_start:
34961  */
34962       __pyx_v_c_child = __pyx_v_c_child->prev;
34963     }
34964
34965     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1073
34966  *                     k = k + 1
34967  *                 c_child = c_child.prev
34968  *             if c_start > 0:             # <<<<<<<<<<<<<<
34969  *                 if k >= c_start:
34970  *                     return k
34971  */
34972     __pyx_t_2 = (__pyx_v_c_start > 0);
34973     if (__pyx_t_2) {
34974
34975       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1074
34976  *                 c_child = c_child.prev
34977  *             if c_start > 0:
34978  *                 if k >= c_start:             # <<<<<<<<<<<<<<
34979  *                     return k
34980  *             else:
34981  */
34982       __pyx_t_2 = (__pyx_v_k >= __pyx_v_c_start);
34983       if (__pyx_t_2) {
34984
34985         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1075
34986  *             if c_start > 0:
34987  *                 if k >= c_start:
34988  *                     return k             # <<<<<<<<<<<<<<
34989  *             else:
34990  *                 return k
34991  */
34992         __Pyx_XDECREF(__pyx_r);
34993         __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
34994         __Pyx_GOTREF(__pyx_t_3);
34995         __pyx_r = __pyx_t_3;
34996         __pyx_t_3 = 0;
34997         goto __pyx_L0;
34998         goto __pyx_L30;
34999       }
35000       __pyx_L30:;
35001       goto __pyx_L29;
35002     }
35003     /*else*/ {
35004
35005       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1077
35006  *                     return k
35007  *             else:
35008  *                 return k             # <<<<<<<<<<<<<<
35009  *         if c_start != 0 or c_stop != 0:
35010  *             raise ValueError, u"list.index(x): x not in slice"
35011  */
35012       __Pyx_XDECREF(__pyx_r);
35013       __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
35014       __Pyx_GOTREF(__pyx_t_3);
35015       __pyx_r = __pyx_t_3;
35016       __pyx_t_3 = 0;
35017       goto __pyx_L0;
35018     }
35019     __pyx_L29:;
35020   }
35021   __pyx_L21:;
35022
35023   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1078
35024  *             else:
35025  *                 return k
35026  *         if c_start != 0 or c_stop != 0:             # <<<<<<<<<<<<<<
35027  *             raise ValueError, u"list.index(x): x not in slice"
35028  *         else:
35029  */
35030   if (!(__pyx_v_c_start != 0)) {
35031     __pyx_t_2 = (__pyx_v_c_stop != 0);
35032   } else {
35033     __pyx_t_2 = (__pyx_v_c_start != 0);
35034   }
35035   if (__pyx_t_2) {
35036
35037     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1079
35038  *                 return k
35039  *         if c_start != 0 or c_stop != 0:
35040  *             raise ValueError, u"list.index(x): x not in slice"             # <<<<<<<<<<<<<<
35041  *         else:
35042  *             raise ValueError, u"list.index(x): x not in list"
35043  */
35044     __Pyx_Raise(__pyx_builtin_ValueError, ((PyObject *)__pyx_kp_330), 0);
35045     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
35046     goto __pyx_L31;
35047   }
35048   /*else*/ {
35049
35050     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1081
35051  *             raise ValueError, u"list.index(x): x not in slice"
35052  *         else:
35053  *             raise ValueError, u"list.index(x): x not in list"             # <<<<<<<<<<<<<<
35054  * 
35055  *     def get(self, key, default=None):
35056  */
35057     __Pyx_Raise(__pyx_builtin_ValueError, ((PyObject *)__pyx_kp_331), 0);
35058     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
35059   }
35060   __pyx_L31:;
35061
35062   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
35063   goto __pyx_L0;
35064   __pyx_L1_error:;
35065   __Pyx_XDECREF(__pyx_t_3);
35066   __Pyx_AddTraceback("lxml.etree._Element.index");
35067   __pyx_r = NULL;
35068   __pyx_L0:;
35069   __Pyx_XGIVEREF(__pyx_r);
35070   __Pyx_FinishRefcountContext();
35071   return __pyx_r;
35072 }
35073
35074 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1083
35075  *             raise ValueError, u"list.index(x): x not in list"
35076  * 
35077  *     def get(self, key, default=None):             # <<<<<<<<<<<<<<
35078  *         u"""get(self, key, default=None)
35079  * 
35080  */
35081
35082 static PyObject *__pyx_pf_4lxml_5etree_8_Element_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
35083 static char __pyx_doc_4lxml_5etree_8_Element_get[] = "get(self, key, default=None)\n\n        Gets an element attribute.\n        ";
35084 static PyObject *__pyx_pf_4lxml_5etree_8_Element_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
35085   PyObject *__pyx_v_key = 0;
35086   PyObject *__pyx_v_default = 0;
35087   PyObject *__pyx_r = NULL;
35088   PyObject *__pyx_t_1 = NULL;
35089   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_key,&__pyx_kp_default,0};
35090   __Pyx_SetupRefcountContext("get");
35091   if (unlikely(__pyx_kwds)) {
35092     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
35093     PyObject* values[2] = {0,0};
35094     values[1] = Py_None;
35095     switch (PyTuple_GET_SIZE(__pyx_args)) {
35096       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
35097       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
35098       case  0: break;
35099       default: goto __pyx_L5_argtuple_error;
35100     }
35101     switch (PyTuple_GET_SIZE(__pyx_args)) {
35102       case  0:
35103       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_key);
35104       if (likely(values[0])) kw_args--;
35105       else goto __pyx_L5_argtuple_error;
35106       case  1:
35107       if (kw_args > 1) {
35108         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_default);
35109         if (unlikely(value)) { values[1] = value; kw_args--; }
35110       }
35111     }
35112     if (unlikely(kw_args > 0)) {
35113       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
35114     }
35115     __pyx_v_key = values[0];
35116     __pyx_v_default = values[1];
35117   } else {
35118     __pyx_v_default = Py_None;
35119     switch (PyTuple_GET_SIZE(__pyx_args)) {
35120       case  2: __pyx_v_default = PyTuple_GET_ITEM(__pyx_args, 1);
35121       case  1: __pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 0);
35122       break;
35123       default: goto __pyx_L5_argtuple_error;
35124     }
35125   }
35126   goto __pyx_L4_argument_unpacking_done;
35127   __pyx_L5_argtuple_error:;
35128   __Pyx_RaiseArgtupleInvalid("get", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
35129   __pyx_L3_error:;
35130   __Pyx_AddTraceback("lxml.etree._Element.get");
35131   return NULL;
35132   __pyx_L4_argument_unpacking_done:;
35133
35134   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1088
35135  *         Gets an element attribute.
35136  *         """
35137  *         return _getAttributeValue(self, key, default)             # <<<<<<<<<<<<<<
35138  * 
35139  *     def keys(self):
35140  */
35141   __Pyx_XDECREF(__pyx_r);
35142   __pyx_t_1 = __pyx_f_4lxml_5etree__getAttributeValue(((struct LxmlElement *)__pyx_v_self), __pyx_v_key, __pyx_v_default); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
35143   __Pyx_GOTREF(__pyx_t_1);
35144   __pyx_r = __pyx_t_1;
35145   __pyx_t_1 = 0;
35146   goto __pyx_L0;
35147
35148   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
35149   goto __pyx_L0;
35150   __pyx_L1_error:;
35151   __Pyx_XDECREF(__pyx_t_1);
35152   __Pyx_AddTraceback("lxml.etree._Element.get");
35153   __pyx_r = NULL;
35154   __pyx_L0:;
35155   __Pyx_XGIVEREF(__pyx_r);
35156   __Pyx_FinishRefcountContext();
35157   return __pyx_r;
35158 }
35159
35160 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1090
35161  *         return _getAttributeValue(self, key, default)
35162  * 
35163  *     def keys(self):             # <<<<<<<<<<<<<<
35164  *         u"""keys(self)
35165  * 
35166  */
35167
35168 static PyObject *__pyx_pf_4lxml_5etree_8_Element_keys(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
35169 static char __pyx_doc_4lxml_5etree_8_Element_keys[] = "keys(self)\n\n        Gets a list of attribute names.  The names are returned in an\n        arbitrary order (just like for an ordinary Python dictionary).\n        ";
35170 static PyObject *__pyx_pf_4lxml_5etree_8_Element_keys(PyObject *__pyx_v_self, PyObject *unused) {
35171   PyObject *__pyx_r = NULL;
35172   PyObject *__pyx_t_1 = NULL;
35173   __Pyx_SetupRefcountContext("keys");
35174
35175   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1096
35176  *         arbitrary order (just like for an ordinary Python dictionary).
35177  *         """
35178  *         return _collectAttributes(self._c_node, 1)             # <<<<<<<<<<<<<<
35179  * 
35180  *     def values(self):
35181  */
35182   __Pyx_XDECREF(__pyx_r);
35183   __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(((struct LxmlElement *)__pyx_v_self)->_c_node, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
35184   __Pyx_GOTREF(__pyx_t_1);
35185   __pyx_r = __pyx_t_1;
35186   __pyx_t_1 = 0;
35187   goto __pyx_L0;
35188
35189   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
35190   goto __pyx_L0;
35191   __pyx_L1_error:;
35192   __Pyx_XDECREF(__pyx_t_1);
35193   __Pyx_AddTraceback("lxml.etree._Element.keys");
35194   __pyx_r = NULL;
35195   __pyx_L0:;
35196   __Pyx_XGIVEREF(__pyx_r);
35197   __Pyx_FinishRefcountContext();
35198   return __pyx_r;
35199 }
35200
35201 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1098
35202  *         return _collectAttributes(self._c_node, 1)
35203  * 
35204  *     def values(self):             # <<<<<<<<<<<<<<
35205  *         u"""values(self)
35206  * 
35207  */
35208
35209 static PyObject *__pyx_pf_4lxml_5etree_8_Element_values(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
35210 static char __pyx_doc_4lxml_5etree_8_Element_values[] = "values(self)\n\n        Gets element attribute values as a sequence of strings.  The\n        attributes are returned in an arbitrary order.\n        ";
35211 static PyObject *__pyx_pf_4lxml_5etree_8_Element_values(PyObject *__pyx_v_self, PyObject *unused) {
35212   PyObject *__pyx_r = NULL;
35213   PyObject *__pyx_t_1 = NULL;
35214   __Pyx_SetupRefcountContext("values");
35215
35216   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1104
35217  *         attributes are returned in an arbitrary order.
35218  *         """
35219  *         return _collectAttributes(self._c_node, 2)             # <<<<<<<<<<<<<<
35220  * 
35221  *     def items(self):
35222  */
35223   __Pyx_XDECREF(__pyx_r);
35224   __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(((struct LxmlElement *)__pyx_v_self)->_c_node, 2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
35225   __Pyx_GOTREF(__pyx_t_1);
35226   __pyx_r = __pyx_t_1;
35227   __pyx_t_1 = 0;
35228   goto __pyx_L0;
35229
35230   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
35231   goto __pyx_L0;
35232   __pyx_L1_error:;
35233   __Pyx_XDECREF(__pyx_t_1);
35234   __Pyx_AddTraceback("lxml.etree._Element.values");
35235   __pyx_r = NULL;
35236   __pyx_L0:;
35237   __Pyx_XGIVEREF(__pyx_r);
35238   __Pyx_FinishRefcountContext();
35239   return __pyx_r;
35240 }
35241
35242 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1106
35243  *         return _collectAttributes(self._c_node, 2)
35244  * 
35245  *     def items(self):             # <<<<<<<<<<<<<<
35246  *         u"""items(self)
35247  * 
35248  */
35249
35250 static PyObject *__pyx_pf_4lxml_5etree_8_Element_items(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
35251 static char __pyx_doc_4lxml_5etree_8_Element_items[] = "items(self)\n\n        Gets element attributes, as a sequence. The attributes are returned in\n        an arbitrary order.\n        ";
35252 static PyObject *__pyx_pf_4lxml_5etree_8_Element_items(PyObject *__pyx_v_self, PyObject *unused) {
35253   PyObject *__pyx_r = NULL;
35254   PyObject *__pyx_t_1 = NULL;
35255   __Pyx_SetupRefcountContext("items");
35256
35257   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1112
35258  *         an arbitrary order.
35259  *         """
35260  *         return _collectAttributes(self._c_node, 3)             # <<<<<<<<<<<<<<
35261  * 
35262  *     def getchildren(self):
35263  */
35264   __Pyx_XDECREF(__pyx_r);
35265   __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(((struct LxmlElement *)__pyx_v_self)->_c_node, 3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
35266   __Pyx_GOTREF(__pyx_t_1);
35267   __pyx_r = __pyx_t_1;
35268   __pyx_t_1 = 0;
35269   goto __pyx_L0;
35270
35271   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
35272   goto __pyx_L0;
35273   __pyx_L1_error:;
35274   __Pyx_XDECREF(__pyx_t_1);
35275   __Pyx_AddTraceback("lxml.etree._Element.items");
35276   __pyx_r = NULL;
35277   __pyx_L0:;
35278   __Pyx_XGIVEREF(__pyx_r);
35279   __Pyx_FinishRefcountContext();
35280   return __pyx_r;
35281 }
35282
35283 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1114
35284  *         return _collectAttributes(self._c_node, 3)
35285  * 
35286  *     def getchildren(self):             # <<<<<<<<<<<<<<
35287  *         u"""getchildren(self)
35288  * 
35289  */
35290
35291 static PyObject *__pyx_pf_4lxml_5etree_8_Element_getchildren(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
35292 static char __pyx_doc_4lxml_5etree_8_Element_getchildren[] = "getchildren(self)\n\n        Returns all direct children.  The elements are returned in document\n        order.\n\n        :deprecated: Note that this method has been deprecated as of\n          ElementTree 1.3 and lxml 2.0.  New code should use\n          ``list(element)`` or simply iterate over elements.\n        ";
35293 static PyObject *__pyx_pf_4lxml_5etree_8_Element_getchildren(PyObject *__pyx_v_self, PyObject *unused) {
35294   PyObject *__pyx_r = NULL;
35295   PyObject *__pyx_t_1 = NULL;
35296   __Pyx_SetupRefcountContext("getchildren");
35297
35298   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1124
35299  *           ``list(element)`` or simply iterate over elements.
35300  *         """
35301  *         return _collectChildren(self)             # <<<<<<<<<<<<<<
35302  * 
35303  *     def getparent(self):
35304  */
35305   __Pyx_XDECREF(__pyx_r);
35306   __pyx_t_1 = __pyx_f_4lxml_5etree__collectChildren(((struct LxmlElement *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
35307   __Pyx_GOTREF(__pyx_t_1);
35308   __pyx_r = __pyx_t_1;
35309   __pyx_t_1 = 0;
35310   goto __pyx_L0;
35311
35312   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
35313   goto __pyx_L0;
35314   __pyx_L1_error:;
35315   __Pyx_XDECREF(__pyx_t_1);
35316   __Pyx_AddTraceback("lxml.etree._Element.getchildren");
35317   __pyx_r = NULL;
35318   __pyx_L0:;
35319   __Pyx_XGIVEREF(__pyx_r);
35320   __Pyx_FinishRefcountContext();
35321   return __pyx_r;
35322 }
35323
35324 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1126
35325  *         return _collectChildren(self)
35326  * 
35327  *     def getparent(self):             # <<<<<<<<<<<<<<
35328  *         u"""getparent(self)
35329  * 
35330  */
35331
35332 static PyObject *__pyx_pf_4lxml_5etree_8_Element_getparent(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
35333 static char __pyx_doc_4lxml_5etree_8_Element_getparent[] = "getparent(self)\n\n        Returns the parent of this element or None for the root element.\n        ";
35334 static PyObject *__pyx_pf_4lxml_5etree_8_Element_getparent(PyObject *__pyx_v_self, PyObject *unused) {
35335   xmlNode *__pyx_v_c_node;
35336   PyObject *__pyx_r = NULL;
35337   int __pyx_t_1;
35338   PyObject *__pyx_t_2 = NULL;
35339   __Pyx_SetupRefcountContext("getparent");
35340
35341   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1132
35342  *         """
35343  *         cdef xmlNode* c_node
35344  *         c_node = _parentElement(self._c_node)             # <<<<<<<<<<<<<<
35345  *         if c_node is NULL:
35346  *             return None
35347  */
35348   __pyx_v_c_node = __pyx_f_4lxml_5etree__parentElement(((struct LxmlElement *)__pyx_v_self)->_c_node);
35349
35350   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1133
35351  *         cdef xmlNode* c_node
35352  *         c_node = _parentElement(self._c_node)
35353  *         if c_node is NULL:             # <<<<<<<<<<<<<<
35354  *             return None
35355  *         return _elementFactory(self._doc, c_node)
35356  */
35357   __pyx_t_1 = (__pyx_v_c_node == NULL);
35358   if (__pyx_t_1) {
35359
35360     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1134
35361  *         c_node = _parentElement(self._c_node)
35362  *         if c_node is NULL:
35363  *             return None             # <<<<<<<<<<<<<<
35364  *         return _elementFactory(self._doc, c_node)
35365  * 
35366  */
35367     __Pyx_XDECREF(__pyx_r);
35368     __Pyx_INCREF(Py_None);
35369     __pyx_r = Py_None;
35370     goto __pyx_L0;
35371     goto __pyx_L5;
35372   }
35373   __pyx_L5:;
35374
35375   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1135
35376  *         if c_node is NULL:
35377  *             return None
35378  *         return _elementFactory(self._doc, c_node)             # <<<<<<<<<<<<<<
35379  * 
35380  *     def getnext(self):
35381  */
35382   __Pyx_XDECREF(__pyx_r);
35383   __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlElement *)__pyx_v_self)->_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
35384   __Pyx_GOTREF(__pyx_t_2);
35385   __pyx_r = __pyx_t_2;
35386   __pyx_t_2 = 0;
35387   goto __pyx_L0;
35388
35389   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
35390   goto __pyx_L0;
35391   __pyx_L1_error:;
35392   __Pyx_XDECREF(__pyx_t_2);
35393   __Pyx_AddTraceback("lxml.etree._Element.getparent");
35394   __pyx_r = NULL;
35395   __pyx_L0:;
35396   __Pyx_XGIVEREF(__pyx_r);
35397   __Pyx_FinishRefcountContext();
35398   return __pyx_r;
35399 }
35400
35401 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1137
35402  *         return _elementFactory(self._doc, c_node)
35403  * 
35404  *     def getnext(self):             # <<<<<<<<<<<<<<
35405  *         u"""getnext(self)
35406  * 
35407  */
35408
35409 static PyObject *__pyx_pf_4lxml_5etree_8_Element_getnext(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
35410 static char __pyx_doc_4lxml_5etree_8_Element_getnext[] = "getnext(self)\n\n        Returns the following sibling of this element or None.\n        ";
35411 static PyObject *__pyx_pf_4lxml_5etree_8_Element_getnext(PyObject *__pyx_v_self, PyObject *unused) {
35412   xmlNode *__pyx_v_c_node;
35413   PyObject *__pyx_r = NULL;
35414   int __pyx_t_1;
35415   PyObject *__pyx_t_2 = NULL;
35416   __Pyx_SetupRefcountContext("getnext");
35417
35418   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1143
35419  *         """
35420  *         cdef xmlNode* c_node
35421  *         c_node = _nextElement(self._c_node)             # <<<<<<<<<<<<<<
35422  *         if c_node is NULL:
35423  *             return None
35424  */
35425   __pyx_v_c_node = __pyx_f_4lxml_5etree__nextElement(((struct LxmlElement *)__pyx_v_self)->_c_node);
35426
35427   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1144
35428  *         cdef xmlNode* c_node
35429  *         c_node = _nextElement(self._c_node)
35430  *         if c_node is NULL:             # <<<<<<<<<<<<<<
35431  *             return None
35432  *         return _elementFactory(self._doc, c_node)
35433  */
35434   __pyx_t_1 = (__pyx_v_c_node == NULL);
35435   if (__pyx_t_1) {
35436
35437     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1145
35438  *         c_node = _nextElement(self._c_node)
35439  *         if c_node is NULL:
35440  *             return None             # <<<<<<<<<<<<<<
35441  *         return _elementFactory(self._doc, c_node)
35442  * 
35443  */
35444     __Pyx_XDECREF(__pyx_r);
35445     __Pyx_INCREF(Py_None);
35446     __pyx_r = Py_None;
35447     goto __pyx_L0;
35448     goto __pyx_L5;
35449   }
35450   __pyx_L5:;
35451
35452   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1146
35453  *         if c_node is NULL:
35454  *             return None
35455  *         return _elementFactory(self._doc, c_node)             # <<<<<<<<<<<<<<
35456  * 
35457  *     def getprevious(self):
35458  */
35459   __Pyx_XDECREF(__pyx_r);
35460   __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlElement *)__pyx_v_self)->_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
35461   __Pyx_GOTREF(__pyx_t_2);
35462   __pyx_r = __pyx_t_2;
35463   __pyx_t_2 = 0;
35464   goto __pyx_L0;
35465
35466   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
35467   goto __pyx_L0;
35468   __pyx_L1_error:;
35469   __Pyx_XDECREF(__pyx_t_2);
35470   __Pyx_AddTraceback("lxml.etree._Element.getnext");
35471   __pyx_r = NULL;
35472   __pyx_L0:;
35473   __Pyx_XGIVEREF(__pyx_r);
35474   __Pyx_FinishRefcountContext();
35475   return __pyx_r;
35476 }
35477
35478 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1148
35479  *         return _elementFactory(self._doc, c_node)
35480  * 
35481  *     def getprevious(self):             # <<<<<<<<<<<<<<
35482  *         u"""getprevious(self)
35483  * 
35484  */
35485
35486 static PyObject *__pyx_pf_4lxml_5etree_8_Element_getprevious(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
35487 static char __pyx_doc_4lxml_5etree_8_Element_getprevious[] = "getprevious(self)\n\n        Returns the preceding sibling of this element or None.\n        ";
35488 static PyObject *__pyx_pf_4lxml_5etree_8_Element_getprevious(PyObject *__pyx_v_self, PyObject *unused) {
35489   xmlNode *__pyx_v_c_node;
35490   PyObject *__pyx_r = NULL;
35491   int __pyx_t_1;
35492   PyObject *__pyx_t_2 = NULL;
35493   __Pyx_SetupRefcountContext("getprevious");
35494
35495   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1154
35496  *         """
35497  *         cdef xmlNode* c_node
35498  *         c_node = _previousElement(self._c_node)             # <<<<<<<<<<<<<<
35499  *         if c_node is NULL:
35500  *             return None
35501  */
35502   __pyx_v_c_node = __pyx_f_4lxml_5etree__previousElement(((struct LxmlElement *)__pyx_v_self)->_c_node);
35503
35504   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1155
35505  *         cdef xmlNode* c_node
35506  *         c_node = _previousElement(self._c_node)
35507  *         if c_node is NULL:             # <<<<<<<<<<<<<<
35508  *             return None
35509  *         return _elementFactory(self._doc, c_node)
35510  */
35511   __pyx_t_1 = (__pyx_v_c_node == NULL);
35512   if (__pyx_t_1) {
35513
35514     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1156
35515  *         c_node = _previousElement(self._c_node)
35516  *         if c_node is NULL:
35517  *             return None             # <<<<<<<<<<<<<<
35518  *         return _elementFactory(self._doc, c_node)
35519  * 
35520  */
35521     __Pyx_XDECREF(__pyx_r);
35522     __Pyx_INCREF(Py_None);
35523     __pyx_r = Py_None;
35524     goto __pyx_L0;
35525     goto __pyx_L5;
35526   }
35527   __pyx_L5:;
35528
35529   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1157
35530  *         if c_node is NULL:
35531  *             return None
35532  *         return _elementFactory(self._doc, c_node)             # <<<<<<<<<<<<<<
35533  * 
35534  *     def itersiblings(self, tag=None, *, preceding=False):
35535  */
35536   __Pyx_XDECREF(__pyx_r);
35537   __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlElement *)__pyx_v_self)->_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
35538   __Pyx_GOTREF(__pyx_t_2);
35539   __pyx_r = __pyx_t_2;
35540   __pyx_t_2 = 0;
35541   goto __pyx_L0;
35542
35543   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
35544   goto __pyx_L0;
35545   __pyx_L1_error:;
35546   __Pyx_XDECREF(__pyx_t_2);
35547   __Pyx_AddTraceback("lxml.etree._Element.getprevious");
35548   __pyx_r = NULL;
35549   __pyx_L0:;
35550   __Pyx_XGIVEREF(__pyx_r);
35551   __Pyx_FinishRefcountContext();
35552   return __pyx_r;
35553 }
35554
35555 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1159
35556  *         return _elementFactory(self._doc, c_node)
35557  * 
35558  *     def itersiblings(self, tag=None, *, preceding=False):             # <<<<<<<<<<<<<<
35559  *         u"""itersiblings(self, tag=None, preceding=False)
35560  * 
35561  */
35562
35563 static PyObject *__pyx_pf_4lxml_5etree_8_Element_itersiblings(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
35564 static char __pyx_doc_4lxml_5etree_8_Element_itersiblings[] = "itersiblings(self, tag=None, preceding=False)\n\n        Iterate over the following or preceding siblings of this element.\n\n        The direction is determined by the 'preceding' keyword which defaults\n        to False, i.e. forward iteration over the following siblings.  The\n        generated elements can be restricted to a specific tag name with the\n        'tag' keyword.\n        ";
35565 static PyObject *__pyx_pf_4lxml_5etree_8_Element_itersiblings(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
35566   PyObject *__pyx_v_tag = 0;
35567   PyObject *__pyx_v_preceding = 0;
35568   PyObject *__pyx_r = NULL;
35569   PyObject *__pyx_1 = 0;
35570   PyObject *__pyx_t_1 = NULL;
35571   PyObject *__pyx_t_2 = NULL;
35572   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_tag,&__pyx_kp_preceding,0};
35573   __Pyx_SetupRefcountContext("itersiblings");
35574   if (unlikely(__pyx_kwds)) {
35575     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
35576     PyObject* values[2] = {0,0};
35577     values[0] = Py_None;
35578     values[1] = __pyx_k_87;
35579     switch (PyTuple_GET_SIZE(__pyx_args)) {
35580       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
35581       case  0: break;
35582       default: goto __pyx_L5_argtuple_error;
35583     }
35584     switch (PyTuple_GET_SIZE(__pyx_args)) {
35585       case  0:
35586       if (kw_args > 1) {
35587         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_tag);
35588         if (unlikely(value)) { values[0] = value; kw_args--; }
35589       }
35590     }
35591     while (kw_args > 0) {
35592       PyObject* value;
35593       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_preceding);
35594       if (value) { values[1] = value; if (!(--kw_args)) break; }
35595       break;
35596     }
35597     if (unlikely(kw_args > 0)) {
35598       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "itersiblings") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
35599     }
35600     __pyx_v_tag = values[0];
35601     __pyx_v_preceding = values[1];
35602   } else {
35603     __pyx_v_tag = Py_None;
35604     __pyx_v_preceding = __pyx_k_87;
35605     switch (PyTuple_GET_SIZE(__pyx_args)) {
35606       case  1: __pyx_v_tag = PyTuple_GET_ITEM(__pyx_args, 0);
35607       case  0: break;
35608       default: goto __pyx_L5_argtuple_error;
35609     }
35610   }
35611   goto __pyx_L4_argument_unpacking_done;
35612   __pyx_L5_argtuple_error:;
35613   __Pyx_RaiseArgtupleInvalid("itersiblings", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
35614   __pyx_L3_error:;
35615   __Pyx_AddTraceback("lxml.etree._Element.itersiblings");
35616   return NULL;
35617   __pyx_L4_argument_unpacking_done:;
35618
35619   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1169
35620  *         'tag' keyword.
35621  *         """
35622  *         return SiblingsIterator(self, tag, preceding=preceding)             # <<<<<<<<<<<<<<
35623  * 
35624  *     def iterancestors(self, tag=None):
35625  */
35626   __Pyx_XDECREF(__pyx_r);
35627   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
35628   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
35629   __Pyx_INCREF(__pyx_v_self);
35630   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
35631   __Pyx_GIVEREF(__pyx_v_self);
35632   __Pyx_INCREF(__pyx_v_tag);
35633   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_tag);
35634   __Pyx_GIVEREF(__pyx_v_tag);
35635   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
35636   __Pyx_GOTREF(((PyObject *)__pyx_1));
35637   if (PyDict_SetItem(__pyx_1, __pyx_kp_preceding, __pyx_v_preceding) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
35638   __pyx_t_2 = PyEval_CallObjectWithKeywords(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_SiblingsIterator)), ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
35639   __Pyx_GOTREF(__pyx_t_2);
35640   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
35641   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
35642   __pyx_r = __pyx_t_2;
35643   __pyx_t_2 = 0;
35644   goto __pyx_L0;
35645
35646   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
35647   goto __pyx_L0;
35648   __pyx_L1_error:;
35649   __Pyx_XDECREF(__pyx_1);
35650   __Pyx_XDECREF(__pyx_t_1);
35651   __Pyx_XDECREF(__pyx_t_2);
35652   __Pyx_AddTraceback("lxml.etree._Element.itersiblings");
35653   __pyx_r = NULL;
35654   __pyx_L0:;
35655   __Pyx_XGIVEREF(__pyx_r);
35656   __Pyx_FinishRefcountContext();
35657   return __pyx_r;
35658 }
35659
35660 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1171
35661  *         return SiblingsIterator(self, tag, preceding=preceding)
35662  * 
35663  *     def iterancestors(self, tag=None):             # <<<<<<<<<<<<<<
35664  *         u"""iterancestors(self, tag=None)
35665  * 
35666  */
35667
35668 static PyObject *__pyx_pf_4lxml_5etree_8_Element_iterancestors(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
35669 static char __pyx_doc_4lxml_5etree_8_Element_iterancestors[] = "iterancestors(self, tag=None)\n\n        Iterate over the ancestors of this element (from parent to parent).\n\n        The generated elements can be restricted to a specific tag name with\n        the 'tag' keyword.\n        ";
35670 static PyObject *__pyx_pf_4lxml_5etree_8_Element_iterancestors(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
35671   PyObject *__pyx_v_tag = 0;
35672   PyObject *__pyx_r = NULL;
35673   PyObject *__pyx_t_1 = NULL;
35674   PyObject *__pyx_t_2 = NULL;
35675   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_tag,0};
35676   __Pyx_SetupRefcountContext("iterancestors");
35677   if (unlikely(__pyx_kwds)) {
35678     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
35679     PyObject* values[1] = {0};
35680     values[0] = Py_None;
35681     switch (PyTuple_GET_SIZE(__pyx_args)) {
35682       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
35683       case  0: break;
35684       default: goto __pyx_L5_argtuple_error;
35685     }
35686     switch (PyTuple_GET_SIZE(__pyx_args)) {
35687       case  0:
35688       if (kw_args > 1) {
35689         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_tag);
35690         if (unlikely(value)) { values[0] = value; kw_args--; }
35691       }
35692     }
35693     if (unlikely(kw_args > 0)) {
35694       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "iterancestors") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
35695     }
35696     __pyx_v_tag = values[0];
35697   } else {
35698     __pyx_v_tag = Py_None;
35699     switch (PyTuple_GET_SIZE(__pyx_args)) {
35700       case  1: __pyx_v_tag = PyTuple_GET_ITEM(__pyx_args, 0);
35701       case  0: break;
35702       default: goto __pyx_L5_argtuple_error;
35703     }
35704   }
35705   goto __pyx_L4_argument_unpacking_done;
35706   __pyx_L5_argtuple_error:;
35707   __Pyx_RaiseArgtupleInvalid("iterancestors", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
35708   __pyx_L3_error:;
35709   __Pyx_AddTraceback("lxml.etree._Element.iterancestors");
35710   return NULL;
35711   __pyx_L4_argument_unpacking_done:;
35712
35713   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1179
35714  *         the 'tag' keyword.
35715  *         """
35716  *         return AncestorsIterator(self, tag)             # <<<<<<<<<<<<<<
35717  * 
35718  *     def iterdescendants(self, tag=None):
35719  */
35720   __Pyx_XDECREF(__pyx_r);
35721   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
35722   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
35723   __Pyx_INCREF(__pyx_v_self);
35724   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
35725   __Pyx_GIVEREF(__pyx_v_self);
35726   __Pyx_INCREF(__pyx_v_tag);
35727   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_tag);
35728   __Pyx_GIVEREF(__pyx_v_tag);
35729   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_AncestorsIterator)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
35730   __Pyx_GOTREF(__pyx_t_2);
35731   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
35732   __pyx_r = __pyx_t_2;
35733   __pyx_t_2 = 0;
35734   goto __pyx_L0;
35735
35736   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
35737   goto __pyx_L0;
35738   __pyx_L1_error:;
35739   __Pyx_XDECREF(__pyx_t_1);
35740   __Pyx_XDECREF(__pyx_t_2);
35741   __Pyx_AddTraceback("lxml.etree._Element.iterancestors");
35742   __pyx_r = NULL;
35743   __pyx_L0:;
35744   __Pyx_XGIVEREF(__pyx_r);
35745   __Pyx_FinishRefcountContext();
35746   return __pyx_r;
35747 }
35748
35749 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1181
35750  *         return AncestorsIterator(self, tag)
35751  * 
35752  *     def iterdescendants(self, tag=None):             # <<<<<<<<<<<<<<
35753  *         u"""iterdescendants(self, tag=None)
35754  * 
35755  */
35756
35757 static PyObject *__pyx_pf_4lxml_5etree_8_Element_iterdescendants(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
35758 static char __pyx_doc_4lxml_5etree_8_Element_iterdescendants[] = "iterdescendants(self, tag=None)\n\n        Iterate over the descendants of this element in document order.\n\n        As opposed to ``el.iter()``, this iterator does not yield the element\n        itself.  The generated elements can be restricted to a specific tag\n        name with the 'tag' keyword.\n        ";
35759 static PyObject *__pyx_pf_4lxml_5etree_8_Element_iterdescendants(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
35760   PyObject *__pyx_v_tag = 0;
35761   PyObject *__pyx_r = NULL;
35762   PyObject *__pyx_1 = 0;
35763   PyObject *__pyx_t_1 = NULL;
35764   PyObject *__pyx_t_2 = NULL;
35765   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_tag,0};
35766   __Pyx_SetupRefcountContext("iterdescendants");
35767   if (unlikely(__pyx_kwds)) {
35768     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
35769     PyObject* values[1] = {0};
35770     values[0] = Py_None;
35771     switch (PyTuple_GET_SIZE(__pyx_args)) {
35772       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
35773       case  0: break;
35774       default: goto __pyx_L5_argtuple_error;
35775     }
35776     switch (PyTuple_GET_SIZE(__pyx_args)) {
35777       case  0:
35778       if (kw_args > 1) {
35779         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_tag);
35780         if (unlikely(value)) { values[0] = value; kw_args--; }
35781       }
35782     }
35783     if (unlikely(kw_args > 0)) {
35784       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "iterdescendants") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
35785     }
35786     __pyx_v_tag = values[0];
35787   } else {
35788     __pyx_v_tag = Py_None;
35789     switch (PyTuple_GET_SIZE(__pyx_args)) {
35790       case  1: __pyx_v_tag = PyTuple_GET_ITEM(__pyx_args, 0);
35791       case  0: break;
35792       default: goto __pyx_L5_argtuple_error;
35793     }
35794   }
35795   goto __pyx_L4_argument_unpacking_done;
35796   __pyx_L5_argtuple_error:;
35797   __Pyx_RaiseArgtupleInvalid("iterdescendants", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
35798   __pyx_L3_error:;
35799   __Pyx_AddTraceback("lxml.etree._Element.iterdescendants");
35800   return NULL;
35801   __pyx_L4_argument_unpacking_done:;
35802
35803   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1190
35804  *         name with the 'tag' keyword.
35805  *         """
35806  *         return ElementDepthFirstIterator(self, tag, inclusive=False)             # <<<<<<<<<<<<<<
35807  * 
35808  *     def iterchildren(self, tag=None, *, reversed=False):
35809  */
35810   __Pyx_XDECREF(__pyx_r);
35811   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
35812   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
35813   __Pyx_INCREF(__pyx_v_self);
35814   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
35815   __Pyx_GIVEREF(__pyx_v_self);
35816   __Pyx_INCREF(__pyx_v_tag);
35817   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_tag);
35818   __Pyx_GIVEREF(__pyx_v_tag);
35819   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
35820   __Pyx_GOTREF(((PyObject *)__pyx_1));
35821   __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
35822   __Pyx_GOTREF(__pyx_t_2);
35823   if (PyDict_SetItem(__pyx_1, __pyx_kp_inclusive, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
35824   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
35825   __pyx_t_2 = PyEval_CallObjectWithKeywords(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_ElementDepthFirstIterator)), ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
35826   __Pyx_GOTREF(__pyx_t_2);
35827   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
35828   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
35829   __pyx_r = __pyx_t_2;
35830   __pyx_t_2 = 0;
35831   goto __pyx_L0;
35832
35833   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
35834   goto __pyx_L0;
35835   __pyx_L1_error:;
35836   __Pyx_XDECREF(__pyx_1);
35837   __Pyx_XDECREF(__pyx_t_1);
35838   __Pyx_XDECREF(__pyx_t_2);
35839   __Pyx_AddTraceback("lxml.etree._Element.iterdescendants");
35840   __pyx_r = NULL;
35841   __pyx_L0:;
35842   __Pyx_XGIVEREF(__pyx_r);
35843   __Pyx_FinishRefcountContext();
35844   return __pyx_r;
35845 }
35846
35847 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1192
35848  *         return ElementDepthFirstIterator(self, tag, inclusive=False)
35849  * 
35850  *     def iterchildren(self, tag=None, *, reversed=False):             # <<<<<<<<<<<<<<
35851  *         u"""iterchildren(self, tag=None, reversed=False)
35852  * 
35853  */
35854
35855 static PyObject *__pyx_pf_4lxml_5etree_8_Element_iterchildren(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
35856 static char __pyx_doc_4lxml_5etree_8_Element_iterchildren[] = "iterchildren(self, tag=None, reversed=False)\n\n        Iterate over the children of this element.\n\n        As opposed to using normal iteration on this element, the generated\n        elements can be restricted to a specific tag name with the 'tag'\n        keyword and reversed with the 'reversed' keyword.\n        ";
35857 static PyObject *__pyx_pf_4lxml_5etree_8_Element_iterchildren(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
35858   PyObject *__pyx_v_tag = 0;
35859   PyObject *__pyx_v_reversed = 0;
35860   PyObject *__pyx_r = NULL;
35861   PyObject *__pyx_1 = 0;
35862   PyObject *__pyx_t_1 = NULL;
35863   PyObject *__pyx_t_2 = NULL;
35864   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_tag,&__pyx_kp_reversed,0};
35865   __Pyx_SetupRefcountContext("iterchildren");
35866   if (unlikely(__pyx_kwds)) {
35867     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
35868     PyObject* values[2] = {0,0};
35869     values[0] = Py_None;
35870     values[1] = __pyx_k_88;
35871     switch (PyTuple_GET_SIZE(__pyx_args)) {
35872       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
35873       case  0: break;
35874       default: goto __pyx_L5_argtuple_error;
35875     }
35876     switch (PyTuple_GET_SIZE(__pyx_args)) {
35877       case  0:
35878       if (kw_args > 1) {
35879         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_tag);
35880         if (unlikely(value)) { values[0] = value; kw_args--; }
35881       }
35882     }
35883     while (kw_args > 0) {
35884       PyObject* value;
35885       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_reversed);
35886       if (value) { values[1] = value; if (!(--kw_args)) break; }
35887       break;
35888     }
35889     if (unlikely(kw_args > 0)) {
35890       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "iterchildren") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
35891     }
35892     __pyx_v_tag = values[0];
35893     __pyx_v_reversed = values[1];
35894   } else {
35895     __pyx_v_tag = Py_None;
35896     __pyx_v_reversed = __pyx_k_88;
35897     switch (PyTuple_GET_SIZE(__pyx_args)) {
35898       case  1: __pyx_v_tag = PyTuple_GET_ITEM(__pyx_args, 0);
35899       case  0: break;
35900       default: goto __pyx_L5_argtuple_error;
35901     }
35902   }
35903   goto __pyx_L4_argument_unpacking_done;
35904   __pyx_L5_argtuple_error:;
35905   __Pyx_RaiseArgtupleInvalid("iterchildren", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
35906   __pyx_L3_error:;
35907   __Pyx_AddTraceback("lxml.etree._Element.iterchildren");
35908   return NULL;
35909   __pyx_L4_argument_unpacking_done:;
35910
35911   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1201
35912  *         keyword and reversed with the 'reversed' keyword.
35913  *         """
35914  *         return ElementChildIterator(self, tag, reversed=reversed)             # <<<<<<<<<<<<<<
35915  * 
35916  *     def getroottree(self):
35917  */
35918   __Pyx_XDECREF(__pyx_r);
35919   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
35920   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
35921   __Pyx_INCREF(__pyx_v_self);
35922   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
35923   __Pyx_GIVEREF(__pyx_v_self);
35924   __Pyx_INCREF(__pyx_v_tag);
35925   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_tag);
35926   __Pyx_GIVEREF(__pyx_v_tag);
35927   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
35928   __Pyx_GOTREF(((PyObject *)__pyx_1));
35929   if (PyDict_SetItem(__pyx_1, __pyx_kp_reversed, __pyx_v_reversed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
35930   __pyx_t_2 = PyEval_CallObjectWithKeywords(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_ElementChildIterator)), ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
35931   __Pyx_GOTREF(__pyx_t_2);
35932   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
35933   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
35934   __pyx_r = __pyx_t_2;
35935   __pyx_t_2 = 0;
35936   goto __pyx_L0;
35937
35938   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
35939   goto __pyx_L0;
35940   __pyx_L1_error:;
35941   __Pyx_XDECREF(__pyx_1);
35942   __Pyx_XDECREF(__pyx_t_1);
35943   __Pyx_XDECREF(__pyx_t_2);
35944   __Pyx_AddTraceback("lxml.etree._Element.iterchildren");
35945   __pyx_r = NULL;
35946   __pyx_L0:;
35947   __Pyx_XGIVEREF(__pyx_r);
35948   __Pyx_FinishRefcountContext();
35949   return __pyx_r;
35950 }
35951
35952 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1203
35953  *         return ElementChildIterator(self, tag, reversed=reversed)
35954  * 
35955  *     def getroottree(self):             # <<<<<<<<<<<<<<
35956  *         u"""getroottree(self)
35957  * 
35958  */
35959
35960 static PyObject *__pyx_pf_4lxml_5etree_8_Element_getroottree(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
35961 static char __pyx_doc_4lxml_5etree_8_Element_getroottree[] = "getroottree(self)\n\n        Return an ElementTree for the root node of the document that\n        contains this element.\n\n        This is the same as following element.getparent() up the tree until it\n        returns None (for the root element) and then build an ElementTree for\n        the last parent that was returned.";
35962 static PyObject *__pyx_pf_4lxml_5etree_8_Element_getroottree(PyObject *__pyx_v_self, PyObject *unused) {
35963   PyObject *__pyx_r = NULL;
35964   PyObject *__pyx_t_1 = NULL;
35965   __Pyx_SetupRefcountContext("getroottree");
35966
35967   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1212
35968  *         returns None (for the root element) and then build an ElementTree for
35969  *         the last parent that was returned."""
35970  *         return _elementTreeFactory(self._doc, None)             # <<<<<<<<<<<<<<
35971  * 
35972  *     def getiterator(self, tag=None):
35973  */
35974   __Pyx_XDECREF(__pyx_r);
35975   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(((struct LxmlElement *)__pyx_v_self)->_doc, ((struct LxmlElement *)Py_None))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
35976   __Pyx_GOTREF(__pyx_t_1);
35977   __pyx_r = __pyx_t_1;
35978   __pyx_t_1 = 0;
35979   goto __pyx_L0;
35980
35981   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
35982   goto __pyx_L0;
35983   __pyx_L1_error:;
35984   __Pyx_XDECREF(__pyx_t_1);
35985   __Pyx_AddTraceback("lxml.etree._Element.getroottree");
35986   __pyx_r = NULL;
35987   __pyx_L0:;
35988   __Pyx_XGIVEREF(__pyx_r);
35989   __Pyx_FinishRefcountContext();
35990   return __pyx_r;
35991 }
35992
35993 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1214
35994  *         return _elementTreeFactory(self._doc, None)
35995  * 
35996  *     def getiterator(self, tag=None):             # <<<<<<<<<<<<<<
35997  *         u"""getiterator(self, tag=None)
35998  * 
35999  */
36000
36001 static PyObject *__pyx_pf_4lxml_5etree_8_Element_getiterator(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
36002 static char __pyx_doc_4lxml_5etree_8_Element_getiterator[] = "getiterator(self, tag=None)\n\n        Returns a sequence or iterator of all elements in the subtree in\n        document order (depth first pre-order), starting with this\n        element.\n\n        Can be restricted to find only elements with a specific tag\n        (pass ``tag=\"xyz\"``) or from a namespace (pass ``tag=\"{ns}*\"``).\n\n        You can also pass the Element, Comment, ProcessingInstruction and\n        Entity factory functions to look only for the specific element type.\n\n        :deprecated: Note that this method is deprecated as of\n          ElementTree 1.3 and lxml 2.0.  It returns an iterator in\n          lxml, which diverges from the original ElementTree\n          behaviour.  If you want an efficient iterator, use the\n          ``element.iter()`` method instead.  You should only use this\n          method in new code if you require backwards compatibility\n          with older versions of lxml or ElementTree.\n        ";
36003 static PyObject *__pyx_pf_4lxml_5etree_8_Element_getiterator(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
36004   PyObject *__pyx_v_tag = 0;
36005   PyObject *__pyx_r = NULL;
36006   PyObject *__pyx_t_1 = NULL;
36007   PyObject *__pyx_t_2 = NULL;
36008   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_tag,0};
36009   __Pyx_SetupRefcountContext("getiterator");
36010   if (unlikely(__pyx_kwds)) {
36011     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
36012     PyObject* values[1] = {0};
36013     values[0] = Py_None;
36014     switch (PyTuple_GET_SIZE(__pyx_args)) {
36015       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
36016       case  0: break;
36017       default: goto __pyx_L5_argtuple_error;
36018     }
36019     switch (PyTuple_GET_SIZE(__pyx_args)) {
36020       case  0:
36021       if (kw_args > 1) {
36022         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_tag);
36023         if (unlikely(value)) { values[0] = value; kw_args--; }
36024       }
36025     }
36026     if (unlikely(kw_args > 0)) {
36027       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "getiterator") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
36028     }
36029     __pyx_v_tag = values[0];
36030   } else {
36031     __pyx_v_tag = Py_None;
36032     switch (PyTuple_GET_SIZE(__pyx_args)) {
36033       case  1: __pyx_v_tag = PyTuple_GET_ITEM(__pyx_args, 0);
36034       case  0: break;
36035       default: goto __pyx_L5_argtuple_error;
36036     }
36037   }
36038   goto __pyx_L4_argument_unpacking_done;
36039   __pyx_L5_argtuple_error:;
36040   __Pyx_RaiseArgtupleInvalid("getiterator", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
36041   __pyx_L3_error:;
36042   __Pyx_AddTraceback("lxml.etree._Element.getiterator");
36043   return NULL;
36044   __pyx_L4_argument_unpacking_done:;
36045
36046   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1235
36047  *           with older versions of lxml or ElementTree.
36048  *         """
36049  *         return ElementDepthFirstIterator(self, tag)             # <<<<<<<<<<<<<<
36050  * 
36051  *     def iter(self, tag=None):
36052  */
36053   __Pyx_XDECREF(__pyx_r);
36054   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36055   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
36056   __Pyx_INCREF(__pyx_v_self);
36057   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
36058   __Pyx_GIVEREF(__pyx_v_self);
36059   __Pyx_INCREF(__pyx_v_tag);
36060   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_tag);
36061   __Pyx_GIVEREF(__pyx_v_tag);
36062   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_ElementDepthFirstIterator)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36063   __Pyx_GOTREF(__pyx_t_2);
36064   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
36065   __pyx_r = __pyx_t_2;
36066   __pyx_t_2 = 0;
36067   goto __pyx_L0;
36068
36069   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
36070   goto __pyx_L0;
36071   __pyx_L1_error:;
36072   __Pyx_XDECREF(__pyx_t_1);
36073   __Pyx_XDECREF(__pyx_t_2);
36074   __Pyx_AddTraceback("lxml.etree._Element.getiterator");
36075   __pyx_r = NULL;
36076   __pyx_L0:;
36077   __Pyx_XGIVEREF(__pyx_r);
36078   __Pyx_FinishRefcountContext();
36079   return __pyx_r;
36080 }
36081
36082 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1237
36083  *         return ElementDepthFirstIterator(self, tag)
36084  * 
36085  *     def iter(self, tag=None):             # <<<<<<<<<<<<<<
36086  *         u"""iter(self, tag=None)
36087  * 
36088  */
36089
36090 static PyObject *__pyx_pf_4lxml_5etree_8_Element_iter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
36091 static char __pyx_doc_4lxml_5etree_8_Element_iter[] = "iter(self, tag=None)\n\n        Iterate over all elements in the subtree in document order (depth\n        first pre-order), starting with this element.\n\n        Can be restricted to find only elements with a specific tag\n        (pass ``tag=\"xyz\"``) or from a namespace (pass ``tag=\"{ns}*\"``).\n\n        You can also pass the Element, Comment, ProcessingInstruction and\n        Entity factory functions to look only for the specific element type.\n        ";
36092 static PyObject *__pyx_pf_4lxml_5etree_8_Element_iter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
36093   PyObject *__pyx_v_tag = 0;
36094   PyObject *__pyx_r = NULL;
36095   PyObject *__pyx_t_1 = NULL;
36096   PyObject *__pyx_t_2 = NULL;
36097   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_tag,0};
36098   __Pyx_SetupRefcountContext("iter");
36099   if (unlikely(__pyx_kwds)) {
36100     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
36101     PyObject* values[1] = {0};
36102     values[0] = Py_None;
36103     switch (PyTuple_GET_SIZE(__pyx_args)) {
36104       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
36105       case  0: break;
36106       default: goto __pyx_L5_argtuple_error;
36107     }
36108     switch (PyTuple_GET_SIZE(__pyx_args)) {
36109       case  0:
36110       if (kw_args > 1) {
36111         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_tag);
36112         if (unlikely(value)) { values[0] = value; kw_args--; }
36113       }
36114     }
36115     if (unlikely(kw_args > 0)) {
36116       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "iter") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
36117     }
36118     __pyx_v_tag = values[0];
36119   } else {
36120     __pyx_v_tag = Py_None;
36121     switch (PyTuple_GET_SIZE(__pyx_args)) {
36122       case  1: __pyx_v_tag = PyTuple_GET_ITEM(__pyx_args, 0);
36123       case  0: break;
36124       default: goto __pyx_L5_argtuple_error;
36125     }
36126   }
36127   goto __pyx_L4_argument_unpacking_done;
36128   __pyx_L5_argtuple_error:;
36129   __Pyx_RaiseArgtupleInvalid("iter", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
36130   __pyx_L3_error:;
36131   __Pyx_AddTraceback("lxml.etree._Element.iter");
36132   return NULL;
36133   __pyx_L4_argument_unpacking_done:;
36134
36135   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1249
36136  *         Entity factory functions to look only for the specific element type.
36137  *         """
36138  *         return ElementDepthFirstIterator(self, tag)             # <<<<<<<<<<<<<<
36139  * 
36140  *     def itertext(self, tag=None, *, with_tail=True):
36141  */
36142   __Pyx_XDECREF(__pyx_r);
36143   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36144   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
36145   __Pyx_INCREF(__pyx_v_self);
36146   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
36147   __Pyx_GIVEREF(__pyx_v_self);
36148   __Pyx_INCREF(__pyx_v_tag);
36149   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_tag);
36150   __Pyx_GIVEREF(__pyx_v_tag);
36151   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_ElementDepthFirstIterator)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36152   __Pyx_GOTREF(__pyx_t_2);
36153   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
36154   __pyx_r = __pyx_t_2;
36155   __pyx_t_2 = 0;
36156   goto __pyx_L0;
36157
36158   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
36159   goto __pyx_L0;
36160   __pyx_L1_error:;
36161   __Pyx_XDECREF(__pyx_t_1);
36162   __Pyx_XDECREF(__pyx_t_2);
36163   __Pyx_AddTraceback("lxml.etree._Element.iter");
36164   __pyx_r = NULL;
36165   __pyx_L0:;
36166   __Pyx_XGIVEREF(__pyx_r);
36167   __Pyx_FinishRefcountContext();
36168   return __pyx_r;
36169 }
36170
36171 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1251
36172  *         return ElementDepthFirstIterator(self, tag)
36173  * 
36174  *     def itertext(self, tag=None, *, with_tail=True):             # <<<<<<<<<<<<<<
36175  *         u"""itertext(self, tag=None, with_tail=True)
36176  * 
36177  */
36178
36179 static PyObject *__pyx_pf_4lxml_5etree_8_Element_itertext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
36180 static char __pyx_doc_4lxml_5etree_8_Element_itertext[] = "itertext(self, tag=None, with_tail=True)\n\n        Iterates over the text content of a subtree.\n\n        You can pass the ``tag`` keyword argument to restrict text content to\n        a specific tag name.\n\n        You can set the ``with_tail`` keyword argument to ``False`` to skip\n        over tail text.\n        ";
36181 static PyObject *__pyx_pf_4lxml_5etree_8_Element_itertext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
36182   PyObject *__pyx_v_tag = 0;
36183   PyObject *__pyx_v_with_tail = 0;
36184   PyObject *__pyx_r = NULL;
36185   PyObject *__pyx_1 = 0;
36186   PyObject *__pyx_t_1 = NULL;
36187   PyObject *__pyx_t_2 = NULL;
36188   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_tag,&__pyx_kp_with_tail,0};
36189   __Pyx_SetupRefcountContext("itertext");
36190   if (unlikely(__pyx_kwds)) {
36191     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
36192     PyObject* values[2] = {0,0};
36193     values[0] = Py_None;
36194     values[1] = __pyx_k_89;
36195     switch (PyTuple_GET_SIZE(__pyx_args)) {
36196       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
36197       case  0: break;
36198       default: goto __pyx_L5_argtuple_error;
36199     }
36200     switch (PyTuple_GET_SIZE(__pyx_args)) {
36201       case  0:
36202       if (kw_args > 1) {
36203         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_tag);
36204         if (unlikely(value)) { values[0] = value; kw_args--; }
36205       }
36206     }
36207     while (kw_args > 0) {
36208       PyObject* value;
36209       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_with_tail);
36210       if (value) { values[1] = value; if (!(--kw_args)) break; }
36211       break;
36212     }
36213     if (unlikely(kw_args > 0)) {
36214       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "itertext") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
36215     }
36216     __pyx_v_tag = values[0];
36217     __pyx_v_with_tail = values[1];
36218   } else {
36219     __pyx_v_tag = Py_None;
36220     __pyx_v_with_tail = __pyx_k_89;
36221     switch (PyTuple_GET_SIZE(__pyx_args)) {
36222       case  1: __pyx_v_tag = PyTuple_GET_ITEM(__pyx_args, 0);
36223       case  0: break;
36224       default: goto __pyx_L5_argtuple_error;
36225     }
36226   }
36227   goto __pyx_L4_argument_unpacking_done;
36228   __pyx_L5_argtuple_error:;
36229   __Pyx_RaiseArgtupleInvalid("itertext", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
36230   __pyx_L3_error:;
36231   __Pyx_AddTraceback("lxml.etree._Element.itertext");
36232   return NULL;
36233   __pyx_L4_argument_unpacking_done:;
36234
36235   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1262
36236  *         over tail text.
36237  *         """
36238  *         return ElementTextIterator(self, tag, with_tail=with_tail)             # <<<<<<<<<<<<<<
36239  * 
36240  *     def makeelement(self, _tag, attrib=None, nsmap=None, **_extra):
36241  */
36242   __Pyx_XDECREF(__pyx_r);
36243   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36244   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
36245   __Pyx_INCREF(__pyx_v_self);
36246   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
36247   __Pyx_GIVEREF(__pyx_v_self);
36248   __Pyx_INCREF(__pyx_v_tag);
36249   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_tag);
36250   __Pyx_GIVEREF(__pyx_v_tag);
36251   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36252   __Pyx_GOTREF(((PyObject *)__pyx_1));
36253   if (PyDict_SetItem(__pyx_1, __pyx_kp_with_tail, __pyx_v_with_tail) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36254   __pyx_t_2 = PyEval_CallObjectWithKeywords(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_ElementTextIterator)), ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36255   __Pyx_GOTREF(__pyx_t_2);
36256   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
36257   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
36258   __pyx_r = __pyx_t_2;
36259   __pyx_t_2 = 0;
36260   goto __pyx_L0;
36261
36262   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
36263   goto __pyx_L0;
36264   __pyx_L1_error:;
36265   __Pyx_XDECREF(__pyx_1);
36266   __Pyx_XDECREF(__pyx_t_1);
36267   __Pyx_XDECREF(__pyx_t_2);
36268   __Pyx_AddTraceback("lxml.etree._Element.itertext");
36269   __pyx_r = NULL;
36270   __pyx_L0:;
36271   __Pyx_XGIVEREF(__pyx_r);
36272   __Pyx_FinishRefcountContext();
36273   return __pyx_r;
36274 }
36275
36276 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1264
36277  *         return ElementTextIterator(self, tag, with_tail=with_tail)
36278  * 
36279  *     def makeelement(self, _tag, attrib=None, nsmap=None, **_extra):             # <<<<<<<<<<<<<<
36280  *         u"""makeelement(self, _tag, attrib=None, nsmap=None, **_extra)
36281  * 
36282  */
36283
36284 static PyObject *__pyx_pf_4lxml_5etree_8_Element_makeelement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
36285 static char __pyx_doc_4lxml_5etree_8_Element_makeelement[] = "makeelement(self, _tag, attrib=None, nsmap=None, **_extra)\n\n        Creates a new element associated with the same document.\n        ";
36286 static PyObject *__pyx_pf_4lxml_5etree_8_Element_makeelement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
36287   PyObject *__pyx_v__tag = 0;
36288   PyObject *__pyx_v_attrib = 0;
36289   PyObject *__pyx_v_nsmap = 0;
36290   PyObject *__pyx_v__extra = 0;
36291   PyObject *__pyx_r = NULL;
36292   PyObject *__pyx_t_1 = NULL;
36293   static PyObject **__pyx_pyargnames[] = {&__pyx_kp__tag,&__pyx_kp_attrib,&__pyx_kp_nsmap,0};
36294   __Pyx_SetupRefcountContext("makeelement");
36295   __pyx_v__extra = PyDict_New(); if (unlikely(!__pyx_v__extra)) return NULL;
36296   __Pyx_GOTREF(__pyx_v__extra);
36297   if (unlikely(__pyx_kwds)) {
36298     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
36299     PyObject* values[3] = {0,0,0};
36300     values[1] = Py_None;
36301     values[2] = Py_None;
36302     switch (PyTuple_GET_SIZE(__pyx_args)) {
36303       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
36304       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
36305       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
36306       case  0: break;
36307       default: goto __pyx_L5_argtuple_error;
36308     }
36309     switch (PyTuple_GET_SIZE(__pyx_args)) {
36310       case  0:
36311       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp__tag);
36312       if (likely(values[0])) kw_args--;
36313       else goto __pyx_L5_argtuple_error;
36314       case  1:
36315       if (kw_args > 1) {
36316         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_attrib);
36317         if (unlikely(value)) { values[1] = value; kw_args--; }
36318       }
36319       case  2:
36320       if (kw_args > 1) {
36321         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_nsmap);
36322         if (unlikely(value)) { values[2] = value; kw_args--; }
36323       }
36324     }
36325     if (unlikely(kw_args > 0)) {
36326       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__extra, values, PyTuple_GET_SIZE(__pyx_args), "makeelement") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
36327     }
36328     __pyx_v__tag = values[0];
36329     __pyx_v_attrib = values[1];
36330     __pyx_v_nsmap = values[2];
36331   } else {
36332     __pyx_v_attrib = Py_None;
36333     __pyx_v_nsmap = Py_None;
36334     switch (PyTuple_GET_SIZE(__pyx_args)) {
36335       case  3: __pyx_v_nsmap = PyTuple_GET_ITEM(__pyx_args, 2);
36336       case  2: __pyx_v_attrib = PyTuple_GET_ITEM(__pyx_args, 1);
36337       case  1: __pyx_v__tag = PyTuple_GET_ITEM(__pyx_args, 0);
36338       break;
36339       default: goto __pyx_L5_argtuple_error;
36340     }
36341   }
36342   goto __pyx_L4_argument_unpacking_done;
36343   __pyx_L5_argtuple_error:;
36344   __Pyx_RaiseArgtupleInvalid("makeelement", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
36345   __pyx_L3_error:;
36346   __Pyx_DECREF(__pyx_v__extra);
36347   __Pyx_AddTraceback("lxml.etree._Element.makeelement");
36348   return NULL;
36349   __pyx_L4_argument_unpacking_done:;
36350
36351   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1269
36352  *         Creates a new element associated with the same document.
36353  *         """
36354  *         return _makeElement(_tag, NULL, self._doc, None, None, None,             # <<<<<<<<<<<<<<
36355  *                             attrib, nsmap, _extra)
36356  * 
36357  */
36358   __Pyx_XDECREF(__pyx_r);
36359
36360   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1270
36361  *         """
36362  *         return _makeElement(_tag, NULL, self._doc, None, None, None,
36363  *                             attrib, nsmap, _extra)             # <<<<<<<<<<<<<<
36364  * 
36365  *     def find(self, path):
36366  */
36367   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__makeElement(__pyx_v__tag, NULL, ((struct LxmlElement *)__pyx_v_self)->_doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None), Py_None, Py_None, __pyx_v_attrib, __pyx_v_nsmap, __pyx_v__extra)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36368   __Pyx_GOTREF(__pyx_t_1);
36369   __pyx_r = __pyx_t_1;
36370   __pyx_t_1 = 0;
36371   goto __pyx_L0;
36372
36373   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
36374   goto __pyx_L0;
36375   __pyx_L1_error:;
36376   __Pyx_XDECREF(__pyx_t_1);
36377   __Pyx_AddTraceback("lxml.etree._Element.makeelement");
36378   __pyx_r = NULL;
36379   __pyx_L0:;
36380   __Pyx_DECREF(__pyx_v__extra);
36381   __Pyx_XGIVEREF(__pyx_r);
36382   __Pyx_FinishRefcountContext();
36383   return __pyx_r;
36384 }
36385
36386 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1272
36387  *                             attrib, nsmap, _extra)
36388  * 
36389  *     def find(self, path):             # <<<<<<<<<<<<<<
36390  *         u"""find(self, path)
36391  * 
36392  */
36393
36394 static PyObject *__pyx_pf_4lxml_5etree_8_Element_find(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
36395 static char __pyx_doc_4lxml_5etree_8_Element_find[] = "find(self, path)\n\n        Finds the first matching subelement, by tag name or path.\n        ";
36396 static PyObject *__pyx_pf_4lxml_5etree_8_Element_find(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
36397   PyObject *__pyx_r = NULL;
36398   int __pyx_t_1;
36399   PyObject *__pyx_t_2 = NULL;
36400   PyObject *__pyx_t_3 = NULL;
36401   PyObject *__pyx_t_4 = NULL;
36402   __Pyx_SetupRefcountContext("find");
36403   __Pyx_INCREF(__pyx_v_path);
36404
36405   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1277
36406  *         Finds the first matching subelement, by tag name or path.
36407  *         """
36408  *         if isinstance(path, QName):             # <<<<<<<<<<<<<<
36409  *             path = (<QName>path).text
36410  *         return _elementpath.find(self, path)
36411  */
36412   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_path, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree_QName))); 
36413   if (__pyx_t_1) {
36414
36415     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1278
36416  *         """
36417  *         if isinstance(path, QName):
36418  *             path = (<QName>path).text             # <<<<<<<<<<<<<<
36419  *         return _elementpath.find(self, path)
36420  * 
36421  */
36422     __Pyx_INCREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_path)->text);
36423     __Pyx_DECREF(__pyx_v_path);
36424     __pyx_v_path = ((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_path)->text;
36425     goto __pyx_L5;
36426   }
36427   __pyx_L5:;
36428
36429   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1279
36430  *         if isinstance(path, QName):
36431  *             path = (<QName>path).text
36432  *         return _elementpath.find(self, path)             # <<<<<<<<<<<<<<
36433  * 
36434  *     def findtext(self, path, default=None):
36435  */
36436   __Pyx_XDECREF(__pyx_r);
36437   __pyx_t_2 = PyObject_GetAttr(__pyx_v_4lxml_5etree__elementpath, __pyx_kp_find); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36438   __Pyx_GOTREF(__pyx_t_2);
36439   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36440   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
36441   __Pyx_INCREF(__pyx_v_self);
36442   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self);
36443   __Pyx_GIVEREF(__pyx_v_self);
36444   __Pyx_INCREF(__pyx_v_path);
36445   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_path);
36446   __Pyx_GIVEREF(__pyx_v_path);
36447   __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36448   __Pyx_GOTREF(__pyx_t_4);
36449   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36450   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
36451   __pyx_r = __pyx_t_4;
36452   __pyx_t_4 = 0;
36453   goto __pyx_L0;
36454
36455   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
36456   goto __pyx_L0;
36457   __pyx_L1_error:;
36458   __Pyx_XDECREF(__pyx_t_2);
36459   __Pyx_XDECREF(__pyx_t_3);
36460   __Pyx_XDECREF(__pyx_t_4);
36461   __Pyx_AddTraceback("lxml.etree._Element.find");
36462   __pyx_r = NULL;
36463   __pyx_L0:;
36464   __Pyx_DECREF(__pyx_v_path);
36465   __Pyx_XGIVEREF(__pyx_r);
36466   __Pyx_FinishRefcountContext();
36467   return __pyx_r;
36468 }
36469
36470 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1281
36471  *         return _elementpath.find(self, path)
36472  * 
36473  *     def findtext(self, path, default=None):             # <<<<<<<<<<<<<<
36474  *         u"""findtext(self, path, default=None)
36475  * 
36476  */
36477
36478 static PyObject *__pyx_pf_4lxml_5etree_8_Element_findtext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
36479 static char __pyx_doc_4lxml_5etree_8_Element_findtext[] = "findtext(self, path, default=None)\n\n        Finds text for the first matching subelement, by tag name or path.\n        ";
36480 static PyObject *__pyx_pf_4lxml_5etree_8_Element_findtext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
36481   PyObject *__pyx_v_path = 0;
36482   PyObject *__pyx_v_default = 0;
36483   PyObject *__pyx_r = NULL;
36484   int __pyx_t_1;
36485   PyObject *__pyx_t_2 = NULL;
36486   PyObject *__pyx_t_3 = NULL;
36487   PyObject *__pyx_t_4 = NULL;
36488   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_path,&__pyx_kp_default,0};
36489   __Pyx_SetupRefcountContext("findtext");
36490   if (unlikely(__pyx_kwds)) {
36491     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
36492     PyObject* values[2] = {0,0};
36493     values[1] = Py_None;
36494     switch (PyTuple_GET_SIZE(__pyx_args)) {
36495       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
36496       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
36497       case  0: break;
36498       default: goto __pyx_L5_argtuple_error;
36499     }
36500     switch (PyTuple_GET_SIZE(__pyx_args)) {
36501       case  0:
36502       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_path);
36503       if (likely(values[0])) kw_args--;
36504       else goto __pyx_L5_argtuple_error;
36505       case  1:
36506       if (kw_args > 1) {
36507         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_default);
36508         if (unlikely(value)) { values[1] = value; kw_args--; }
36509       }
36510     }
36511     if (unlikely(kw_args > 0)) {
36512       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "findtext") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
36513     }
36514     __pyx_v_path = values[0];
36515     __pyx_v_default = values[1];
36516   } else {
36517     __pyx_v_default = Py_None;
36518     switch (PyTuple_GET_SIZE(__pyx_args)) {
36519       case  2: __pyx_v_default = PyTuple_GET_ITEM(__pyx_args, 1);
36520       case  1: __pyx_v_path = PyTuple_GET_ITEM(__pyx_args, 0);
36521       break;
36522       default: goto __pyx_L5_argtuple_error;
36523     }
36524   }
36525   goto __pyx_L4_argument_unpacking_done;
36526   __pyx_L5_argtuple_error:;
36527   __Pyx_RaiseArgtupleInvalid("findtext", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
36528   __pyx_L3_error:;
36529   __Pyx_AddTraceback("lxml.etree._Element.findtext");
36530   return NULL;
36531   __pyx_L4_argument_unpacking_done:;
36532   __Pyx_INCREF(__pyx_v_path);
36533
36534   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1286
36535  *         Finds text for the first matching subelement, by tag name or path.
36536  *         """
36537  *         if isinstance(path, QName):             # <<<<<<<<<<<<<<
36538  *             path = (<QName>path).text
36539  *         return _elementpath.findtext(self, path, default)
36540  */
36541   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_path, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree_QName))); 
36542   if (__pyx_t_1) {
36543
36544     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1287
36545  *         """
36546  *         if isinstance(path, QName):
36547  *             path = (<QName>path).text             # <<<<<<<<<<<<<<
36548  *         return _elementpath.findtext(self, path, default)
36549  * 
36550  */
36551     __Pyx_INCREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_path)->text);
36552     __Pyx_DECREF(__pyx_v_path);
36553     __pyx_v_path = ((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_path)->text;
36554     goto __pyx_L6;
36555   }
36556   __pyx_L6:;
36557
36558   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1288
36559  *         if isinstance(path, QName):
36560  *             path = (<QName>path).text
36561  *         return _elementpath.findtext(self, path, default)             # <<<<<<<<<<<<<<
36562  * 
36563  *     def findall(self, path):
36564  */
36565   __Pyx_XDECREF(__pyx_r);
36566   __pyx_t_2 = PyObject_GetAttr(__pyx_v_4lxml_5etree__elementpath, __pyx_kp_findtext); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36567   __Pyx_GOTREF(__pyx_t_2);
36568   __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36569   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
36570   __Pyx_INCREF(__pyx_v_self);
36571   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self);
36572   __Pyx_GIVEREF(__pyx_v_self);
36573   __Pyx_INCREF(__pyx_v_path);
36574   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_path);
36575   __Pyx_GIVEREF(__pyx_v_path);
36576   __Pyx_INCREF(__pyx_v_default);
36577   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_default);
36578   __Pyx_GIVEREF(__pyx_v_default);
36579   __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36580   __Pyx_GOTREF(__pyx_t_4);
36581   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36582   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
36583   __pyx_r = __pyx_t_4;
36584   __pyx_t_4 = 0;
36585   goto __pyx_L0;
36586
36587   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
36588   goto __pyx_L0;
36589   __pyx_L1_error:;
36590   __Pyx_XDECREF(__pyx_t_2);
36591   __Pyx_XDECREF(__pyx_t_3);
36592   __Pyx_XDECREF(__pyx_t_4);
36593   __Pyx_AddTraceback("lxml.etree._Element.findtext");
36594   __pyx_r = NULL;
36595   __pyx_L0:;
36596   __Pyx_DECREF(__pyx_v_path);
36597   __Pyx_XGIVEREF(__pyx_r);
36598   __Pyx_FinishRefcountContext();
36599   return __pyx_r;
36600 }
36601
36602 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1290
36603  *         return _elementpath.findtext(self, path, default)
36604  * 
36605  *     def findall(self, path):             # <<<<<<<<<<<<<<
36606  *         u"""findall(self, path)
36607  * 
36608  */
36609
36610 static PyObject *__pyx_pf_4lxml_5etree_8_Element_findall(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
36611 static char __pyx_doc_4lxml_5etree_8_Element_findall[] = "findall(self, path)\n\n        Finds all matching subelements, by tag name or path.\n        ";
36612 static PyObject *__pyx_pf_4lxml_5etree_8_Element_findall(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
36613   PyObject *__pyx_r = NULL;
36614   int __pyx_t_1;
36615   PyObject *__pyx_t_2 = NULL;
36616   PyObject *__pyx_t_3 = NULL;
36617   PyObject *__pyx_t_4 = NULL;
36618   __Pyx_SetupRefcountContext("findall");
36619   __Pyx_INCREF(__pyx_v_path);
36620
36621   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1295
36622  *         Finds all matching subelements, by tag name or path.
36623  *         """
36624  *         if isinstance(path, QName):             # <<<<<<<<<<<<<<
36625  *             path = (<QName>path).text
36626  *         return _elementpath.findall(self, path)
36627  */
36628   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_path, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree_QName))); 
36629   if (__pyx_t_1) {
36630
36631     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1296
36632  *         """
36633  *         if isinstance(path, QName):
36634  *             path = (<QName>path).text             # <<<<<<<<<<<<<<
36635  *         return _elementpath.findall(self, path)
36636  * 
36637  */
36638     __Pyx_INCREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_path)->text);
36639     __Pyx_DECREF(__pyx_v_path);
36640     __pyx_v_path = ((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_path)->text;
36641     goto __pyx_L5;
36642   }
36643   __pyx_L5:;
36644
36645   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1297
36646  *         if isinstance(path, QName):
36647  *             path = (<QName>path).text
36648  *         return _elementpath.findall(self, path)             # <<<<<<<<<<<<<<
36649  * 
36650  *     def iterfind(self, path):
36651  */
36652   __Pyx_XDECREF(__pyx_r);
36653   __pyx_t_2 = PyObject_GetAttr(__pyx_v_4lxml_5etree__elementpath, __pyx_kp_findall); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36654   __Pyx_GOTREF(__pyx_t_2);
36655   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36656   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
36657   __Pyx_INCREF(__pyx_v_self);
36658   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self);
36659   __Pyx_GIVEREF(__pyx_v_self);
36660   __Pyx_INCREF(__pyx_v_path);
36661   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_path);
36662   __Pyx_GIVEREF(__pyx_v_path);
36663   __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36664   __Pyx_GOTREF(__pyx_t_4);
36665   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36666   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
36667   __pyx_r = __pyx_t_4;
36668   __pyx_t_4 = 0;
36669   goto __pyx_L0;
36670
36671   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
36672   goto __pyx_L0;
36673   __pyx_L1_error:;
36674   __Pyx_XDECREF(__pyx_t_2);
36675   __Pyx_XDECREF(__pyx_t_3);
36676   __Pyx_XDECREF(__pyx_t_4);
36677   __Pyx_AddTraceback("lxml.etree._Element.findall");
36678   __pyx_r = NULL;
36679   __pyx_L0:;
36680   __Pyx_DECREF(__pyx_v_path);
36681   __Pyx_XGIVEREF(__pyx_r);
36682   __Pyx_FinishRefcountContext();
36683   return __pyx_r;
36684 }
36685
36686 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1299
36687  *         return _elementpath.findall(self, path)
36688  * 
36689  *     def iterfind(self, path):             # <<<<<<<<<<<<<<
36690  *         u"""iterfind(self, path)
36691  * 
36692  */
36693
36694 static PyObject *__pyx_pf_4lxml_5etree_8_Element_iterfind(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
36695 static char __pyx_doc_4lxml_5etree_8_Element_iterfind[] = "iterfind(self, path)\n\n        Iterates over all matching subelements, by tag name or path.\n        ";
36696 static PyObject *__pyx_pf_4lxml_5etree_8_Element_iterfind(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
36697   PyObject *__pyx_r = NULL;
36698   int __pyx_t_1;
36699   PyObject *__pyx_t_2 = NULL;
36700   PyObject *__pyx_t_3 = NULL;
36701   PyObject *__pyx_t_4 = NULL;
36702   __Pyx_SetupRefcountContext("iterfind");
36703   __Pyx_INCREF(__pyx_v_path);
36704
36705   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1304
36706  *         Iterates over all matching subelements, by tag name or path.
36707  *         """
36708  *         if isinstance(path, QName):             # <<<<<<<<<<<<<<
36709  *             path = (<QName>path).text
36710  *         return _elementpath.iterfind(self, path)
36711  */
36712   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_path, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree_QName))); 
36713   if (__pyx_t_1) {
36714
36715     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1305
36716  *         """
36717  *         if isinstance(path, QName):
36718  *             path = (<QName>path).text             # <<<<<<<<<<<<<<
36719  *         return _elementpath.iterfind(self, path)
36720  * 
36721  */
36722     __Pyx_INCREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_path)->text);
36723     __Pyx_DECREF(__pyx_v_path);
36724     __pyx_v_path = ((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_path)->text;
36725     goto __pyx_L5;
36726   }
36727   __pyx_L5:;
36728
36729   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1306
36730  *         if isinstance(path, QName):
36731  *             path = (<QName>path).text
36732  *         return _elementpath.iterfind(self, path)             # <<<<<<<<<<<<<<
36733  * 
36734  *     def xpath(self, _path, *, namespaces=None, extensions=None,
36735  */
36736   __Pyx_XDECREF(__pyx_r);
36737   __pyx_t_2 = PyObject_GetAttr(__pyx_v_4lxml_5etree__elementpath, __pyx_kp_iterfind); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36738   __Pyx_GOTREF(__pyx_t_2);
36739   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36740   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
36741   __Pyx_INCREF(__pyx_v_self);
36742   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self);
36743   __Pyx_GIVEREF(__pyx_v_self);
36744   __Pyx_INCREF(__pyx_v_path);
36745   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_path);
36746   __Pyx_GIVEREF(__pyx_v_path);
36747   __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36748   __Pyx_GOTREF(__pyx_t_4);
36749   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
36750   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
36751   __pyx_r = __pyx_t_4;
36752   __pyx_t_4 = 0;
36753   goto __pyx_L0;
36754
36755   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
36756   goto __pyx_L0;
36757   __pyx_L1_error:;
36758   __Pyx_XDECREF(__pyx_t_2);
36759   __Pyx_XDECREF(__pyx_t_3);
36760   __Pyx_XDECREF(__pyx_t_4);
36761   __Pyx_AddTraceback("lxml.etree._Element.iterfind");
36762   __pyx_r = NULL;
36763   __pyx_L0:;
36764   __Pyx_DECREF(__pyx_v_path);
36765   __Pyx_XGIVEREF(__pyx_r);
36766   __Pyx_FinishRefcountContext();
36767   return __pyx_r;
36768 }
36769
36770 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1308
36771  *         return _elementpath.iterfind(self, path)
36772  * 
36773  *     def xpath(self, _path, *, namespaces=None, extensions=None,             # <<<<<<<<<<<<<<
36774  *               smart_strings=True, **_variables):
36775  *         u"""xpath(self, _path, namespaces=None, extensions=None, smart_strings=True, **_variables)
36776  */
36777
36778 static PyObject *__pyx_pf_4lxml_5etree_8_Element_xpath(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
36779 static char __pyx_doc_4lxml_5etree_8_Element_xpath[] = "xpath(self, _path, namespaces=None, extensions=None, smart_strings=True, **_variables)\n\n        Evaluate an xpath expression using the element as context node.\n        ";
36780 static PyObject *__pyx_pf_4lxml_5etree_8_Element_xpath(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
36781   PyObject *__pyx_v__path = 0;
36782   PyObject *__pyx_v_namespaces = 0;
36783   PyObject *__pyx_v_extensions = 0;
36784   PyObject *__pyx_v_smart_strings = 0;
36785   PyObject *__pyx_v__variables = 0;
36786   PyObject *__pyx_v_evaluator;
36787   PyObject *__pyx_r = NULL;
36788   PyObject *__pyx_1 = 0;
36789   PyObject *__pyx_t_1 = NULL;
36790   PyObject *__pyx_t_2 = NULL;
36791   static PyObject **__pyx_pyargnames[] = {&__pyx_kp__path,&__pyx_kp_namespaces,&__pyx_kp_extensions,&__pyx_kp_smart_strings,0};
36792   __Pyx_SetupRefcountContext("xpath");
36793   __pyx_v__variables = PyDict_New(); if (unlikely(!__pyx_v__variables)) return NULL;
36794   __Pyx_GOTREF(__pyx_v__variables);
36795   if (unlikely(__pyx_kwds)) {
36796     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
36797     PyObject* values[4] = {0,0,0,0};
36798     values[1] = Py_None;
36799     values[2] = Py_None;
36800     values[3] = __pyx_k_90;
36801     switch (PyTuple_GET_SIZE(__pyx_args)) {
36802       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
36803       case  0: break;
36804       default: goto __pyx_L5_argtuple_error;
36805     }
36806     switch (PyTuple_GET_SIZE(__pyx_args)) {
36807       case  0:
36808       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp__path);
36809       if (likely(values[0])) kw_args--;
36810       else goto __pyx_L5_argtuple_error;
36811     }
36812     if (unlikely(kw_args > 0)) {
36813       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__variables, values, PyTuple_GET_SIZE(__pyx_args), "xpath") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
36814     }
36815     __pyx_v__path = values[0];
36816     __pyx_v_namespaces = values[1];
36817     __pyx_v_extensions = values[2];
36818     __pyx_v_smart_strings = values[3];
36819   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
36820     goto __pyx_L5_argtuple_error;
36821   } else {
36822     __pyx_v__path = PyTuple_GET_ITEM(__pyx_args, 0);
36823     __pyx_v_namespaces = Py_None;
36824     __pyx_v_extensions = Py_None;
36825     __pyx_v_smart_strings = __pyx_k_90;
36826   }
36827   goto __pyx_L4_argument_unpacking_done;
36828   __pyx_L5_argtuple_error:;
36829   __Pyx_RaiseArgtupleInvalid("xpath", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
36830   __pyx_L3_error:;
36831   __Pyx_DECREF(__pyx_v__variables);
36832   __Pyx_AddTraceback("lxml.etree._Element.xpath");
36833   return NULL;
36834   __pyx_L4_argument_unpacking_done:;
36835   __pyx_v_evaluator = Py_None; __Pyx_INCREF(Py_None);
36836
36837   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1314
36838  *         Evaluate an xpath expression using the element as context node.
36839  *         """
36840  *         evaluator = XPathElementEvaluator(self, namespaces=namespaces,             # <<<<<<<<<<<<<<
36841  *                                           extensions=extensions,
36842  *                                           smart_strings=smart_strings)
36843  */
36844   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36845   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
36846   __Pyx_INCREF(__pyx_v_self);
36847   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
36848   __Pyx_GIVEREF(__pyx_v_self);
36849   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36850   __Pyx_GOTREF(((PyObject *)__pyx_1));
36851   if (PyDict_SetItem(__pyx_1, __pyx_kp_namespaces, __pyx_v_namespaces) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36852
36853   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1315
36854  *         """
36855  *         evaluator = XPathElementEvaluator(self, namespaces=namespaces,
36856  *                                           extensions=extensions,             # <<<<<<<<<<<<<<
36857  *                                           smart_strings=smart_strings)
36858  *         return evaluator(_path, **_variables)
36859  */
36860   if (PyDict_SetItem(__pyx_1, __pyx_kp_extensions, __pyx_v_extensions) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36861
36862   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1316
36863  *         evaluator = XPathElementEvaluator(self, namespaces=namespaces,
36864  *                                           extensions=extensions,
36865  *                                           smart_strings=smart_strings)             # <<<<<<<<<<<<<<
36866  *         return evaluator(_path, **_variables)
36867  * 
36868  */
36869   if (PyDict_SetItem(__pyx_1, __pyx_kp_smart_strings, __pyx_v_smart_strings) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36870   __pyx_t_2 = PyEval_CallObjectWithKeywords(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_XPathElementEvaluator)), ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36871   __Pyx_GOTREF(__pyx_t_2);
36872   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
36873   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
36874   __Pyx_DECREF(__pyx_v_evaluator);
36875   __pyx_v_evaluator = __pyx_t_2;
36876   __pyx_t_2 = 0;
36877
36878   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1317
36879  *                                           extensions=extensions,
36880  *                                           smart_strings=smart_strings)
36881  *         return evaluator(_path, **_variables)             # <<<<<<<<<<<<<<
36882  * 
36883  * 
36884  */
36885   __Pyx_XDECREF(__pyx_r);
36886   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36887   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
36888   __Pyx_INCREF(__pyx_v__path);
36889   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v__path);
36890   __Pyx_GIVEREF(__pyx_v__path);
36891   __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_v_evaluator, ((PyObject *)__pyx_t_2), __pyx_v__variables); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36892   __Pyx_GOTREF(__pyx_t_1);
36893   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
36894   __pyx_r = __pyx_t_1;
36895   __pyx_t_1 = 0;
36896   goto __pyx_L0;
36897
36898   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
36899   goto __pyx_L0;
36900   __pyx_L1_error:;
36901   __Pyx_XDECREF(__pyx_1);
36902   __Pyx_XDECREF(__pyx_t_1);
36903   __Pyx_XDECREF(__pyx_t_2);
36904   __Pyx_AddTraceback("lxml.etree._Element.xpath");
36905   __pyx_r = NULL;
36906   __pyx_L0:;
36907   __Pyx_DECREF(__pyx_v__variables);
36908   __Pyx_DECREF(__pyx_v_evaluator);
36909   __Pyx_XGIVEREF(__pyx_r);
36910   __Pyx_FinishRefcountContext();
36911   return __pyx_r;
36912 }
36913
36914 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1324
36915  *     cdef _Element NEW_ELEMENT "PY_NEW" (object t)
36916  * 
36917  * cdef _Element _elementFactory(_Document doc, xmlNode* c_node):             # <<<<<<<<<<<<<<
36918  *     cdef _Element result
36919  *     result = getProxy(c_node)
36920  */
36921
36922 static  struct LxmlElement *__pyx_f_4lxml_5etree__elementFactory(struct LxmlDocument *__pyx_v_doc, xmlNode *__pyx_v_c_node) {
36923   struct LxmlElement *__pyx_v_result;
36924   PyObject *__pyx_v_element_class;
36925   struct LxmlElement *__pyx_r = NULL;
36926   PyObject *__pyx_t_1 = NULL;
36927   int __pyx_t_2;
36928   int __pyx_t_3;
36929   PyObject *__pyx_t_4 = NULL;
36930   __Pyx_SetupRefcountContext("_elementFactory");
36931   __pyx_v_result = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
36932   __pyx_v_element_class = Py_None; __Pyx_INCREF(Py_None);
36933
36934   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1326
36935  * cdef _Element _elementFactory(_Document doc, xmlNode* c_node):
36936  *     cdef _Element result
36937  *     result = getProxy(c_node)             # <<<<<<<<<<<<<<
36938  *     if result is not None:
36939  *         return result
36940  */
36941   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_getProxy(__pyx_v_c_node)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36942   __Pyx_GOTREF(__pyx_t_1);
36943   __Pyx_DECREF(((PyObject *)__pyx_v_result));
36944   __pyx_v_result = ((struct LxmlElement *)__pyx_t_1);
36945   __pyx_t_1 = 0;
36946
36947   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1327
36948  *     cdef _Element result
36949  *     result = getProxy(c_node)
36950  *     if result is not None:             # <<<<<<<<<<<<<<
36951  *         return result
36952  *     if c_node is NULL:
36953  */
36954   __pyx_t_2 = (((PyObject *)__pyx_v_result) != Py_None);
36955   if (__pyx_t_2) {
36956
36957     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1328
36958  *     result = getProxy(c_node)
36959  *     if result is not None:
36960  *         return result             # <<<<<<<<<<<<<<
36961  *     if c_node is NULL:
36962  *         return None
36963  */
36964     __Pyx_XDECREF(((PyObject *)__pyx_r));
36965     __Pyx_INCREF(((PyObject *)__pyx_v_result));
36966     __pyx_r = __pyx_v_result;
36967     goto __pyx_L0;
36968     goto __pyx_L3;
36969   }
36970   __pyx_L3:;
36971
36972   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1329
36973  *     if result is not None:
36974  *         return result
36975  *     if c_node is NULL:             # <<<<<<<<<<<<<<
36976  *         return None
36977  * 
36978  */
36979   __pyx_t_2 = (__pyx_v_c_node == NULL);
36980   if (__pyx_t_2) {
36981
36982     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1330
36983  *         return result
36984  *     if c_node is NULL:
36985  *         return None             # <<<<<<<<<<<<<<
36986  * 
36987  *     element_class = LOOKUP_ELEMENT_CLASS(
36988  */
36989     __Pyx_XDECREF(((PyObject *)__pyx_r));
36990     __Pyx_INCREF(Py_None);
36991     __pyx_r = ((struct LxmlElement *)Py_None);
36992     goto __pyx_L0;
36993     goto __pyx_L4;
36994   }
36995   __pyx_L4:;
36996
36997   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1333
36998  * 
36999  *     element_class = LOOKUP_ELEMENT_CLASS(
37000  *         ELEMENT_CLASS_LOOKUP_STATE, doc, c_node)             # <<<<<<<<<<<<<<
37001  *     if hasProxy(c_node):
37002  *         # prevent re-entry race condition - we just called into Python
37003  */
37004   __pyx_t_1 = __pyx_v_4lxml_5etree_LOOKUP_ELEMENT_CLASS(__pyx_v_4lxml_5etree_ELEMENT_CLASS_LOOKUP_STATE, __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37005   __Pyx_GOTREF(__pyx_t_1);
37006   __Pyx_DECREF(__pyx_v_element_class);
37007   __pyx_v_element_class = __pyx_t_1;
37008   __pyx_t_1 = 0;
37009
37010   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1334
37011  *     element_class = LOOKUP_ELEMENT_CLASS(
37012  *         ELEMENT_CLASS_LOOKUP_STATE, doc, c_node)
37013  *     if hasProxy(c_node):             # <<<<<<<<<<<<<<
37014  *         # prevent re-entry race condition - we just called into Python
37015  *         return getProxy(c_node)
37016  */
37017   __pyx_t_3 = __pyx_f_4lxml_5etree_hasProxy(__pyx_v_c_node);
37018   if (__pyx_t_3) {
37019
37020     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1336
37021  *     if hasProxy(c_node):
37022  *         # prevent re-entry race condition - we just called into Python
37023  *         return getProxy(c_node)             # <<<<<<<<<<<<<<
37024  *     result = NEW_ELEMENT(element_class)
37025  *     if hasProxy(c_node):
37026  */
37027     __Pyx_XDECREF(((PyObject *)__pyx_r));
37028     __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_getProxy(__pyx_v_c_node)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37029     __Pyx_GOTREF(__pyx_t_1);
37030     __pyx_r = ((struct LxmlElement *)__pyx_t_1);
37031     __pyx_t_1 = 0;
37032     goto __pyx_L0;
37033     goto __pyx_L5;
37034   }
37035   __pyx_L5:;
37036
37037   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1337
37038  *         # prevent re-entry race condition - we just called into Python
37039  *         return getProxy(c_node)
37040  *     result = NEW_ELEMENT(element_class)             # <<<<<<<<<<<<<<
37041  *     if hasProxy(c_node):
37042  *         # prevent re-entry race condition - we just called into Python
37043  */
37044   __pyx_t_1 = ((PyObject *)PY_NEW(__pyx_v_element_class)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37045   __Pyx_GOTREF(__pyx_t_1);
37046   __Pyx_DECREF(((PyObject *)__pyx_v_result));
37047   __pyx_v_result = ((struct LxmlElement *)__pyx_t_1);
37048   __pyx_t_1 = 0;
37049
37050   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1338
37051  *         return getProxy(c_node)
37052  *     result = NEW_ELEMENT(element_class)
37053  *     if hasProxy(c_node):             # <<<<<<<<<<<<<<
37054  *         # prevent re-entry race condition - we just called into Python
37055  *         result._c_node = NULL
37056  */
37057   __pyx_t_3 = __pyx_f_4lxml_5etree_hasProxy(__pyx_v_c_node);
37058   if (__pyx_t_3) {
37059
37060     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1340
37061  *     if hasProxy(c_node):
37062  *         # prevent re-entry race condition - we just called into Python
37063  *         result._c_node = NULL             # <<<<<<<<<<<<<<
37064  *         return getProxy(c_node)
37065  * 
37066  */
37067     __pyx_v_result->_c_node = NULL;
37068
37069     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1341
37070  *         # prevent re-entry race condition - we just called into Python
37071  *         result._c_node = NULL
37072  *         return getProxy(c_node)             # <<<<<<<<<<<<<<
37073  * 
37074  *     _registerProxy(result, doc, c_node)
37075  */
37076     __Pyx_XDECREF(((PyObject *)__pyx_r));
37077     __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_getProxy(__pyx_v_c_node)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37078     __Pyx_GOTREF(__pyx_t_1);
37079     __pyx_r = ((struct LxmlElement *)__pyx_t_1);
37080     __pyx_t_1 = 0;
37081     goto __pyx_L0;
37082     goto __pyx_L6;
37083   }
37084   __pyx_L6:;
37085
37086   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1343
37087  *         return getProxy(c_node)
37088  * 
37089  *     _registerProxy(result, doc, c_node)             # <<<<<<<<<<<<<<
37090  *     if element_class is not _Element:
37091  *         result._init()
37092  */
37093   __pyx_t_3 = __pyx_f_4lxml_5etree__registerProxy(__pyx_v_result, __pyx_v_doc, __pyx_v_c_node); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37094
37095   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1344
37096  * 
37097  *     _registerProxy(result, doc, c_node)
37098  *     if element_class is not _Element:             # <<<<<<<<<<<<<<
37099  *         result._init()
37100  *     return result
37101  */
37102   __pyx_t_2 = (__pyx_v_element_class != ((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Element)));
37103   if (__pyx_t_2) {
37104
37105     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1345
37106  *     _registerProxy(result, doc, c_node)
37107  *     if element_class is not _Element:
37108  *         result._init()             # <<<<<<<<<<<<<<
37109  *     return result
37110  * 
37111  */
37112     __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_result), __pyx_kp__init); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37113     __Pyx_GOTREF(__pyx_t_1);
37114     __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37115     __Pyx_GOTREF(__pyx_t_4);
37116     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37117     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
37118     goto __pyx_L7;
37119   }
37120   __pyx_L7:;
37121
37122   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1346
37123  *     if element_class is not _Element:
37124  *         result._init()
37125  *     return result             # <<<<<<<<<<<<<<
37126  * 
37127  * 
37128  */
37129   __Pyx_XDECREF(((PyObject *)__pyx_r));
37130   __Pyx_INCREF(((PyObject *)__pyx_v_result));
37131   __pyx_r = __pyx_v_result;
37132   goto __pyx_L0;
37133
37134   __pyx_r = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
37135   goto __pyx_L0;
37136   __pyx_L1_error:;
37137   __Pyx_XDECREF(__pyx_t_1);
37138   __Pyx_XDECREF(__pyx_t_4);
37139   __Pyx_AddTraceback("lxml.etree._elementFactory");
37140   __pyx_r = 0;
37141   __pyx_L0:;
37142   __Pyx_DECREF((PyObject *)__pyx_v_result);
37143   __Pyx_DECREF(__pyx_v_element_class);
37144   __Pyx_XGIVEREF((PyObject *)__pyx_r);
37145   __Pyx_FinishRefcountContext();
37146   return __pyx_r;
37147 }
37148
37149 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1350
37150  * 
37151  * cdef class __ContentOnlyElement(_Element):
37152  *     cdef int _raiseImmutable(self) except -1:             # <<<<<<<<<<<<<<
37153  *         raise TypeError, u"this element does not have children or attributes"
37154  * 
37155  */
37156
37157 static  int __pyx_f_4lxml_5etree_20__ContentOnlyElement__raiseImmutable(struct __pyx_obj_4lxml_5etree___ContentOnlyElement *__pyx_v_self) {
37158   int __pyx_r;
37159   __Pyx_SetupRefcountContext("_raiseImmutable");
37160
37161   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1351
37162  * cdef class __ContentOnlyElement(_Element):
37163  *     cdef int _raiseImmutable(self) except -1:
37164  *         raise TypeError, u"this element does not have children or attributes"             # <<<<<<<<<<<<<<
37165  * 
37166  *     def set(self, key, value):
37167  */
37168   __Pyx_Raise(__pyx_builtin_TypeError, ((PyObject *)__pyx_kp_332), 0);
37169   {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37170
37171   __pyx_r = 0;
37172   goto __pyx_L0;
37173   __pyx_L1_error:;
37174   __Pyx_AddTraceback("lxml.etree.__ContentOnlyElement._raiseImmutable");
37175   __pyx_r = -1;
37176   __pyx_L0:;
37177   __Pyx_FinishRefcountContext();
37178   return __pyx_r;
37179 }
37180
37181 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1353
37182  *         raise TypeError, u"this element does not have children or attributes"
37183  * 
37184  *     def set(self, key, value):             # <<<<<<<<<<<<<<
37185  *         u"set(self, key, value)"
37186  *         self._raiseImmutable()
37187  */
37188
37189 static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
37190 static char __pyx_doc_4lxml_5etree_20__ContentOnlyElement_set[] = "set(self, key, value)";
37191 static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
37192   PyObject *__pyx_v_key = 0;
37193   PyObject *__pyx_v_value = 0;
37194   PyObject *__pyx_r = NULL;
37195   int __pyx_t_1;
37196   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_key,&__pyx_kp_value,0};
37197   __Pyx_SetupRefcountContext("set");
37198   if (unlikely(__pyx_kwds)) {
37199     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
37200     PyObject* values[2] = {0,0};
37201     switch (PyTuple_GET_SIZE(__pyx_args)) {
37202       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
37203       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
37204       case  0: break;
37205       default: goto __pyx_L5_argtuple_error;
37206     }
37207     switch (PyTuple_GET_SIZE(__pyx_args)) {
37208       case  0:
37209       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_key);
37210       if (likely(values[0])) kw_args--;
37211       else goto __pyx_L5_argtuple_error;
37212       case  1:
37213       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_value);
37214       if (likely(values[1])) kw_args--;
37215       else {
37216         __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
37217       }
37218     }
37219     if (unlikely(kw_args > 0)) {
37220       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "set") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
37221     }
37222     __pyx_v_key = values[0];
37223     __pyx_v_value = values[1];
37224   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
37225     goto __pyx_L5_argtuple_error;
37226   } else {
37227     __pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 0);
37228     __pyx_v_value = PyTuple_GET_ITEM(__pyx_args, 1);
37229   }
37230   goto __pyx_L4_argument_unpacking_done;
37231   __pyx_L5_argtuple_error:;
37232   __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
37233   __pyx_L3_error:;
37234   __Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.set");
37235   return NULL;
37236   __pyx_L4_argument_unpacking_done:;
37237
37238   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1355
37239  *     def set(self, key, value):
37240  *         u"set(self, key, value)"
37241  *         self._raiseImmutable()             # <<<<<<<<<<<<<<
37242  * 
37243  *     def append(self, value):
37244  */
37245   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement *)((struct __pyx_obj_4lxml_5etree___ContentOnlyElement *)__pyx_v_self)->__pyx_vtab)->_raiseImmutable(((struct __pyx_obj_4lxml_5etree___ContentOnlyElement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37246
37247   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
37248   goto __pyx_L0;
37249   __pyx_L1_error:;
37250   __Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.set");
37251   __pyx_r = NULL;
37252   __pyx_L0:;
37253   __Pyx_XGIVEREF(__pyx_r);
37254   __Pyx_FinishRefcountContext();
37255   return __pyx_r;
37256 }
37257
37258 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1357
37259  *         self._raiseImmutable()
37260  * 
37261  *     def append(self, value):             # <<<<<<<<<<<<<<
37262  *         u"append(self, value)"
37263  *         self._raiseImmutable()
37264  */
37265
37266 static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_append(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
37267 static char __pyx_doc_4lxml_5etree_20__ContentOnlyElement_append[] = "append(self, value)";
37268 static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_append(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
37269   PyObject *__pyx_r = NULL;
37270   int __pyx_t_1;
37271   __Pyx_SetupRefcountContext("append");
37272
37273   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1359
37274  *     def append(self, value):
37275  *         u"append(self, value)"
37276  *         self._raiseImmutable()             # <<<<<<<<<<<<<<
37277  * 
37278  *     def insert(self, index, value):
37279  */
37280   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement *)((struct __pyx_obj_4lxml_5etree___ContentOnlyElement *)__pyx_v_self)->__pyx_vtab)->_raiseImmutable(((struct __pyx_obj_4lxml_5etree___ContentOnlyElement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37281
37282   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
37283   goto __pyx_L0;
37284   __pyx_L1_error:;
37285   __Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.append");
37286   __pyx_r = NULL;
37287   __pyx_L0:;
37288   __Pyx_XGIVEREF(__pyx_r);
37289   __Pyx_FinishRefcountContext();
37290   return __pyx_r;
37291 }
37292
37293 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1361
37294  *         self._raiseImmutable()
37295  * 
37296  *     def insert(self, index, value):             # <<<<<<<<<<<<<<
37297  *         u"insert(self, index, value)"
37298  *         self._raiseImmutable()
37299  */
37300
37301 static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
37302 static char __pyx_doc_4lxml_5etree_20__ContentOnlyElement_insert[] = "insert(self, index, value)";
37303 static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
37304   PyObject *__pyx_v_index = 0;
37305   PyObject *__pyx_v_value = 0;
37306   PyObject *__pyx_r = NULL;
37307   int __pyx_t_1;
37308   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_index,&__pyx_kp_value,0};
37309   __Pyx_SetupRefcountContext("insert");
37310   if (unlikely(__pyx_kwds)) {
37311     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
37312     PyObject* values[2] = {0,0};
37313     switch (PyTuple_GET_SIZE(__pyx_args)) {
37314       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
37315       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
37316       case  0: break;
37317       default: goto __pyx_L5_argtuple_error;
37318     }
37319     switch (PyTuple_GET_SIZE(__pyx_args)) {
37320       case  0:
37321       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_index);
37322       if (likely(values[0])) kw_args--;
37323       else goto __pyx_L5_argtuple_error;
37324       case  1:
37325       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_value);
37326       if (likely(values[1])) kw_args--;
37327       else {
37328         __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
37329       }
37330     }
37331     if (unlikely(kw_args > 0)) {
37332       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "insert") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
37333     }
37334     __pyx_v_index = values[0];
37335     __pyx_v_value = values[1];
37336   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
37337     goto __pyx_L5_argtuple_error;
37338   } else {
37339     __pyx_v_index = PyTuple_GET_ITEM(__pyx_args, 0);
37340     __pyx_v_value = PyTuple_GET_ITEM(__pyx_args, 1);
37341   }
37342   goto __pyx_L4_argument_unpacking_done;
37343   __pyx_L5_argtuple_error:;
37344   __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
37345   __pyx_L3_error:;
37346   __Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.insert");
37347   return NULL;
37348   __pyx_L4_argument_unpacking_done:;
37349
37350   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1363
37351  *     def insert(self, index, value):
37352  *         u"insert(self, index, value)"
37353  *         self._raiseImmutable()             # <<<<<<<<<<<<<<
37354  * 
37355  *     def __setitem__(self, index, value):
37356  */
37357   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement *)((struct __pyx_obj_4lxml_5etree___ContentOnlyElement *)__pyx_v_self)->__pyx_vtab)->_raiseImmutable(((struct __pyx_obj_4lxml_5etree___ContentOnlyElement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37358
37359   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
37360   goto __pyx_L0;
37361   __pyx_L1_error:;
37362   __Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.insert");
37363   __pyx_r = NULL;
37364   __pyx_L0:;
37365   __Pyx_XGIVEREF(__pyx_r);
37366   __Pyx_FinishRefcountContext();
37367   return __pyx_r;
37368 }
37369
37370 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1365
37371  *         self._raiseImmutable()
37372  * 
37373  *     def __setitem__(self, index, value):             # <<<<<<<<<<<<<<
37374  *         u"__setitem__(self, index, value)"
37375  *         self._raiseImmutable()
37376  */
37377
37378 static int __pyx_pf_4lxml_5etree_20__ContentOnlyElement___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
37379 static char __pyx_doc_4lxml_5etree_20__ContentOnlyElement___setitem__[] = "__setitem__(self, index, value)";
37380 static int __pyx_pf_4lxml_5etree_20__ContentOnlyElement___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
37381   int __pyx_r;
37382   int __pyx_t_1;
37383   __Pyx_SetupRefcountContext("__setitem__");
37384
37385   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1367
37386  *     def __setitem__(self, index, value):
37387  *         u"__setitem__(self, index, value)"
37388  *         self._raiseImmutable()             # <<<<<<<<<<<<<<
37389  * 
37390  *     property attrib:
37391  */
37392   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement *)((struct __pyx_obj_4lxml_5etree___ContentOnlyElement *)__pyx_v_self)->__pyx_vtab)->_raiseImmutable(((struct __pyx_obj_4lxml_5etree___ContentOnlyElement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37393
37394   __pyx_r = 0;
37395   goto __pyx_L0;
37396   __pyx_L1_error:;
37397   __Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.__setitem__");
37398   __pyx_r = -1;
37399   __pyx_L0:;
37400   __Pyx_FinishRefcountContext();
37401   return __pyx_r;
37402 }
37403
37404 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1370
37405  * 
37406  *     property attrib:
37407  *         def __get__(self):             # <<<<<<<<<<<<<<
37408  *             return {}
37409  * 
37410  */
37411
37412 static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_6attrib___get__(PyObject *__pyx_v_self); /*proto*/
37413 static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_6attrib___get__(PyObject *__pyx_v_self) {
37414   PyObject *__pyx_r = NULL;
37415   PyObject *__pyx_1 = 0;
37416   __Pyx_SetupRefcountContext("__get__");
37417
37418   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1371
37419  *     property attrib:
37420  *         def __get__(self):
37421  *             return {}             # <<<<<<<<<<<<<<
37422  * 
37423  *     property text:
37424  */
37425   __Pyx_XDECREF(__pyx_r);
37426   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37427   __Pyx_GOTREF(((PyObject *)__pyx_1));
37428   __pyx_r = ((PyObject *)__pyx_1);
37429   __pyx_1 = 0;
37430   goto __pyx_L0;
37431
37432   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
37433   goto __pyx_L0;
37434   __pyx_L1_error:;
37435   __Pyx_XDECREF(__pyx_1);
37436   __Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.attrib.__get__");
37437   __pyx_r = NULL;
37438   __pyx_L0:;
37439   __Pyx_XGIVEREF(__pyx_r);
37440   __Pyx_FinishRefcountContext();
37441   return __pyx_r;
37442 }
37443
37444 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1374
37445  * 
37446  *     property text:
37447  *         def __get__(self):             # <<<<<<<<<<<<<<
37448  *             if self._c_node.content is NULL:
37449  *                 return ''
37450  */
37451
37452 static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_4text___get__(PyObject *__pyx_v_self); /*proto*/
37453 static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_4text___get__(PyObject *__pyx_v_self) {
37454   PyObject *__pyx_r = NULL;
37455   int __pyx_t_1;
37456   PyObject *__pyx_t_2 = NULL;
37457   __Pyx_SetupRefcountContext("__get__");
37458
37459   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1375
37460  *     property text:
37461  *         def __get__(self):
37462  *             if self._c_node.content is NULL:             # <<<<<<<<<<<<<<
37463  *                 return ''
37464  *             else:
37465  */
37466   __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree___ContentOnlyElement *)__pyx_v_self)->__pyx_base._c_node->content == NULL);
37467   if (__pyx_t_1) {
37468
37469     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1376
37470  *         def __get__(self):
37471  *             if self._c_node.content is NULL:
37472  *                 return ''             # <<<<<<<<<<<<<<
37473  *             else:
37474  *                 return funicode(self._c_node.content)
37475  */
37476     __Pyx_XDECREF(__pyx_r);
37477     __Pyx_INCREF(__pyx_kp_333);
37478     __pyx_r = __pyx_kp_333;
37479     goto __pyx_L0;
37480     goto __pyx_L5;
37481   }
37482   /*else*/ {
37483
37484     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1378
37485  *                 return ''
37486  *             else:
37487  *                 return funicode(self._c_node.content)             # <<<<<<<<<<<<<<
37488  * 
37489  *         def __set__(self, value):
37490  */
37491     __Pyx_XDECREF(__pyx_r);
37492     __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(((struct __pyx_obj_4lxml_5etree___ContentOnlyElement *)__pyx_v_self)->__pyx_base._c_node->content); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37493     __Pyx_GOTREF(__pyx_t_2);
37494     __pyx_r = __pyx_t_2;
37495     __pyx_t_2 = 0;
37496     goto __pyx_L0;
37497   }
37498   __pyx_L5:;
37499
37500   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
37501   goto __pyx_L0;
37502   __pyx_L1_error:;
37503   __Pyx_XDECREF(__pyx_t_2);
37504   __Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.text.__get__");
37505   __pyx_r = NULL;
37506   __pyx_L0:;
37507   __Pyx_XGIVEREF(__pyx_r);
37508   __Pyx_FinishRefcountContext();
37509   return __pyx_r;
37510 }
37511
37512 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1380
37513  *                 return funicode(self._c_node.content)
37514  * 
37515  *         def __set__(self, value):             # <<<<<<<<<<<<<<
37516  *             cdef tree.xmlDict* c_dict
37517  *             cdef char* c_text
37518  */
37519
37520 static int __pyx_pf_4lxml_5etree_20__ContentOnlyElement_4text___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
37521 static int __pyx_pf_4lxml_5etree_20__ContentOnlyElement_4text___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
37522   char *__pyx_v_c_text;
37523   int __pyx_r;
37524   int __pyx_t_1;
37525   PyObject *__pyx_t_2 = NULL;
37526   __Pyx_SetupRefcountContext("__set__");
37527   __Pyx_INCREF(__pyx_v_value);
37528
37529   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1383
37530  *             cdef tree.xmlDict* c_dict
37531  *             cdef char* c_text
37532  *             if value is None:             # <<<<<<<<<<<<<<
37533  *                 c_text = NULL
37534  *             else:
37535  */
37536   __pyx_t_1 = (__pyx_v_value == Py_None);
37537   if (__pyx_t_1) {
37538
37539     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1384
37540  *             cdef char* c_text
37541  *             if value is None:
37542  *                 c_text = NULL             # <<<<<<<<<<<<<<
37543  *             else:
37544  *                 value = _utf8(value)
37545  */
37546     __pyx_v_c_text = NULL;
37547     goto __pyx_L5;
37548   }
37549   /*else*/ {
37550
37551     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1386
37552  *                 c_text = NULL
37553  *             else:
37554  *                 value = _utf8(value)             # <<<<<<<<<<<<<<
37555  *                 c_text = _cstr(value)
37556  *             tree.xmlNodeSetContent(self._c_node, c_text)
37557  */
37558     __pyx_t_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37559     __Pyx_GOTREF(__pyx_t_2);
37560     __Pyx_DECREF(__pyx_v_value);
37561     __pyx_v_value = __pyx_t_2;
37562     __pyx_t_2 = 0;
37563
37564     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1387
37565  *             else:
37566  *                 value = _utf8(value)
37567  *                 c_text = _cstr(value)             # <<<<<<<<<<<<<<
37568  *             tree.xmlNodeSetContent(self._c_node, c_text)
37569  * 
37570  */
37571     __pyx_v_c_text = PyString_AS_STRING(__pyx_v_value);
37572   }
37573   __pyx_L5:;
37574
37575   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1388
37576  *                 value = _utf8(value)
37577  *                 c_text = _cstr(value)
37578  *             tree.xmlNodeSetContent(self._c_node, c_text)             # <<<<<<<<<<<<<<
37579  * 
37580  *     # ACCESSORS
37581  */
37582   xmlNodeSetContent(((struct __pyx_obj_4lxml_5etree___ContentOnlyElement *)__pyx_v_self)->__pyx_base._c_node, __pyx_v_c_text);
37583
37584   __pyx_r = 0;
37585   goto __pyx_L0;
37586   __pyx_L1_error:;
37587   __Pyx_XDECREF(__pyx_t_2);
37588   __Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.text.__set__");
37589   __pyx_r = -1;
37590   __pyx_L0:;
37591   __Pyx_DECREF(__pyx_v_value);
37592   __Pyx_FinishRefcountContext();
37593   return __pyx_r;
37594 }
37595
37596 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1391
37597  * 
37598  *     # ACCESSORS
37599  *     def __getitem__(self, x):             # <<<<<<<<<<<<<<
37600  *         u"__getitem__(self, x)"
37601  *         if python.PySlice_Check(x):
37602  */
37603
37604 static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
37605 static char __pyx_doc_4lxml_5etree_20__ContentOnlyElement___getitem__[] = "__getitem__(self, x)";
37606 static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
37607   PyObject *__pyx_r = NULL;
37608   int __pyx_t_1;
37609   PyObject *__pyx_t_2 = NULL;
37610   __Pyx_SetupRefcountContext("__getitem__");
37611
37612   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1393
37613  *     def __getitem__(self, x):
37614  *         u"__getitem__(self, x)"
37615  *         if python.PySlice_Check(x):             # <<<<<<<<<<<<<<
37616  *             return []
37617  *         else:
37618  */
37619   __pyx_t_1 = PySlice_Check(__pyx_v_x);
37620   if (__pyx_t_1) {
37621
37622     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1394
37623  *         u"__getitem__(self, x)"
37624  *         if python.PySlice_Check(x):
37625  *             return []             # <<<<<<<<<<<<<<
37626  *         else:
37627  *             raise IndexError, u"list index out of range"
37628  */
37629     __Pyx_XDECREF(__pyx_r);
37630     __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37631     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
37632     __pyx_r = ((PyObject *)__pyx_t_2);
37633     __pyx_t_2 = 0;
37634     goto __pyx_L0;
37635     goto __pyx_L5;
37636   }
37637   /*else*/ {
37638
37639     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1396
37640  *             return []
37641  *         else:
37642  *             raise IndexError, u"list index out of range"             # <<<<<<<<<<<<<<
37643  * 
37644  *     def __len__(self):
37645  */
37646     __Pyx_Raise(__pyx_builtin_IndexError, ((PyObject *)__pyx_kp_334), 0);
37647     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37648   }
37649   __pyx_L5:;
37650
37651   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
37652   goto __pyx_L0;
37653   __pyx_L1_error:;
37654   __Pyx_XDECREF(__pyx_t_2);
37655   __Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.__getitem__");
37656   __pyx_r = NULL;
37657   __pyx_L0:;
37658   __Pyx_XGIVEREF(__pyx_r);
37659   __Pyx_FinishRefcountContext();
37660   return __pyx_r;
37661 }
37662
37663 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1398
37664  *             raise IndexError, u"list index out of range"
37665  * 
37666  *     def __len__(self):             # <<<<<<<<<<<<<<
37667  *         u"__len__(self)"
37668  *         return 0
37669  */
37670
37671 static Py_ssize_t __pyx_pf_4lxml_5etree_20__ContentOnlyElement___len__(PyObject *__pyx_v_self); /*proto*/
37672 static char __pyx_doc_4lxml_5etree_20__ContentOnlyElement___len__[] = "__len__(self)";
37673 static Py_ssize_t __pyx_pf_4lxml_5etree_20__ContentOnlyElement___len__(PyObject *__pyx_v_self) {
37674   Py_ssize_t __pyx_r;
37675   __Pyx_SetupRefcountContext("__len__");
37676
37677   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1400
37678  *     def __len__(self):
37679  *         u"__len__(self)"
37680  *         return 0             # <<<<<<<<<<<<<<
37681  * 
37682  *     def get(self, key, default=None):
37683  */
37684   __pyx_r = 0;
37685   goto __pyx_L0;
37686
37687   __pyx_r = 0;
37688   __pyx_L0:;
37689   __Pyx_FinishRefcountContext();
37690   return __pyx_r;
37691 }
37692
37693 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1402
37694  *         return 0
37695  * 
37696  *     def get(self, key, default=None):             # <<<<<<<<<<<<<<
37697  *         u"get(self, key, default=None)"
37698  *         return None
37699  */
37700
37701 static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
37702 static char __pyx_doc_4lxml_5etree_20__ContentOnlyElement_get[] = "get(self, key, default=None)";
37703 static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
37704   PyObject *__pyx_v_key = 0;
37705   PyObject *__pyx_v_default = 0;
37706   PyObject *__pyx_r = NULL;
37707   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_key,&__pyx_kp_default,0};
37708   __Pyx_SetupRefcountContext("get");
37709   if (unlikely(__pyx_kwds)) {
37710     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
37711     PyObject* values[2] = {0,0};
37712     values[1] = Py_None;
37713     switch (PyTuple_GET_SIZE(__pyx_args)) {
37714       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
37715       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
37716       case  0: break;
37717       default: goto __pyx_L5_argtuple_error;
37718     }
37719     switch (PyTuple_GET_SIZE(__pyx_args)) {
37720       case  0:
37721       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_key);
37722       if (likely(values[0])) kw_args--;
37723       else goto __pyx_L5_argtuple_error;
37724       case  1:
37725       if (kw_args > 1) {
37726         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_default);
37727         if (unlikely(value)) { values[1] = value; kw_args--; }
37728       }
37729     }
37730     if (unlikely(kw_args > 0)) {
37731       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
37732     }
37733     __pyx_v_key = values[0];
37734     __pyx_v_default = values[1];
37735   } else {
37736     __pyx_v_default = Py_None;
37737     switch (PyTuple_GET_SIZE(__pyx_args)) {
37738       case  2: __pyx_v_default = PyTuple_GET_ITEM(__pyx_args, 1);
37739       case  1: __pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 0);
37740       break;
37741       default: goto __pyx_L5_argtuple_error;
37742     }
37743   }
37744   goto __pyx_L4_argument_unpacking_done;
37745   __pyx_L5_argtuple_error:;
37746   __Pyx_RaiseArgtupleInvalid("get", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
37747   __pyx_L3_error:;
37748   __Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.get");
37749   return NULL;
37750   __pyx_L4_argument_unpacking_done:;
37751
37752   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1404
37753  *     def get(self, key, default=None):
37754  *         u"get(self, key, default=None)"
37755  *         return None             # <<<<<<<<<<<<<<
37756  * 
37757  *     def keys(self):
37758  */
37759   __Pyx_XDECREF(__pyx_r);
37760   __Pyx_INCREF(Py_None);
37761   __pyx_r = Py_None;
37762   goto __pyx_L0;
37763
37764   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
37765   __pyx_L0:;
37766   __Pyx_XGIVEREF(__pyx_r);
37767   __Pyx_FinishRefcountContext();
37768   return __pyx_r;
37769 }
37770
37771 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1406
37772  *         return None
37773  * 
37774  *     def keys(self):             # <<<<<<<<<<<<<<
37775  *         u"keys(self)"
37776  *         return []
37777  */
37778
37779 static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_keys(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
37780 static char __pyx_doc_4lxml_5etree_20__ContentOnlyElement_keys[] = "keys(self)";
37781 static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_keys(PyObject *__pyx_v_self, PyObject *unused) {
37782   PyObject *__pyx_r = NULL;
37783   PyObject *__pyx_t_1 = NULL;
37784   __Pyx_SetupRefcountContext("keys");
37785
37786   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1408
37787  *     def keys(self):
37788  *         u"keys(self)"
37789  *         return []             # <<<<<<<<<<<<<<
37790  * 
37791  *     def items(self):
37792  */
37793   __Pyx_XDECREF(__pyx_r);
37794   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37795   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
37796   __pyx_r = ((PyObject *)__pyx_t_1);
37797   __pyx_t_1 = 0;
37798   goto __pyx_L0;
37799
37800   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
37801   goto __pyx_L0;
37802   __pyx_L1_error:;
37803   __Pyx_XDECREF(__pyx_t_1);
37804   __Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.keys");
37805   __pyx_r = NULL;
37806   __pyx_L0:;
37807   __Pyx_XGIVEREF(__pyx_r);
37808   __Pyx_FinishRefcountContext();
37809   return __pyx_r;
37810 }
37811
37812 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1410
37813  *         return []
37814  * 
37815  *     def items(self):             # <<<<<<<<<<<<<<
37816  *         u"items(self)"
37817  *         return []
37818  */
37819
37820 static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_items(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
37821 static char __pyx_doc_4lxml_5etree_20__ContentOnlyElement_items[] = "items(self)";
37822 static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_items(PyObject *__pyx_v_self, PyObject *unused) {
37823   PyObject *__pyx_r = NULL;
37824   PyObject *__pyx_t_1 = NULL;
37825   __Pyx_SetupRefcountContext("items");
37826
37827   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1412
37828  *     def items(self):
37829  *         u"items(self)"
37830  *         return []             # <<<<<<<<<<<<<<
37831  * 
37832  *     def values(self):
37833  */
37834   __Pyx_XDECREF(__pyx_r);
37835   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37836   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
37837   __pyx_r = ((PyObject *)__pyx_t_1);
37838   __pyx_t_1 = 0;
37839   goto __pyx_L0;
37840
37841   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
37842   goto __pyx_L0;
37843   __pyx_L1_error:;
37844   __Pyx_XDECREF(__pyx_t_1);
37845   __Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.items");
37846   __pyx_r = NULL;
37847   __pyx_L0:;
37848   __Pyx_XGIVEREF(__pyx_r);
37849   __Pyx_FinishRefcountContext();
37850   return __pyx_r;
37851 }
37852
37853 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1414
37854  *         return []
37855  * 
37856  *     def values(self):             # <<<<<<<<<<<<<<
37857  *         u"values(self)"
37858  *         return []
37859  */
37860
37861 static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_values(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
37862 static char __pyx_doc_4lxml_5etree_20__ContentOnlyElement_values[] = "values(self)";
37863 static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_values(PyObject *__pyx_v_self, PyObject *unused) {
37864   PyObject *__pyx_r = NULL;
37865   PyObject *__pyx_t_1 = NULL;
37866   __Pyx_SetupRefcountContext("values");
37867
37868   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1416
37869  *     def values(self):
37870  *         u"values(self)"
37871  *         return []             # <<<<<<<<<<<<<<
37872  * 
37873  * cdef class _Comment(__ContentOnlyElement):
37874  */
37875   __Pyx_XDECREF(__pyx_r);
37876   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37877   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
37878   __pyx_r = ((PyObject *)__pyx_t_1);
37879   __pyx_t_1 = 0;
37880   goto __pyx_L0;
37881
37882   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
37883   goto __pyx_L0;
37884   __pyx_L1_error:;
37885   __Pyx_XDECREF(__pyx_t_1);
37886   __Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.values");
37887   __pyx_r = NULL;
37888   __pyx_L0:;
37889   __Pyx_XGIVEREF(__pyx_r);
37890   __Pyx_FinishRefcountContext();
37891   return __pyx_r;
37892 }
37893
37894 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1420
37895  * cdef class _Comment(__ContentOnlyElement):
37896  *     property tag:
37897  *         def __get__(self):             # <<<<<<<<<<<<<<
37898  *             return Comment
37899  * 
37900  */
37901
37902 static PyObject *__pyx_pf_4lxml_5etree_8_Comment_3tag___get__(PyObject *__pyx_v_self); /*proto*/
37903 static PyObject *__pyx_pf_4lxml_5etree_8_Comment_3tag___get__(PyObject *__pyx_v_self) {
37904   PyObject *__pyx_r = NULL;
37905   PyObject *__pyx_1 = 0;
37906   __Pyx_SetupRefcountContext("__get__");
37907
37908   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1421
37909  *     property tag:
37910  *         def __get__(self):
37911  *             return Comment             # <<<<<<<<<<<<<<
37912  * 
37913  *     def __repr__(self):
37914  */
37915   __Pyx_XDECREF(__pyx_r);
37916   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_Comment); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37917   __Pyx_GOTREF(__pyx_1);
37918   __pyx_r = __pyx_1;
37919   __pyx_1 = 0;
37920   goto __pyx_L0;
37921
37922   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
37923   goto __pyx_L0;
37924   __pyx_L1_error:;
37925   __Pyx_XDECREF(__pyx_1);
37926   __Pyx_AddTraceback("lxml.etree._Comment.tag.__get__");
37927   __pyx_r = NULL;
37928   __pyx_L0:;
37929   __Pyx_XGIVEREF(__pyx_r);
37930   __Pyx_FinishRefcountContext();
37931   return __pyx_r;
37932 }
37933
37934 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1423
37935  *             return Comment
37936  * 
37937  *     def __repr__(self):             # <<<<<<<<<<<<<<
37938  *         return u"<!--%s-->" % self.text
37939  * 
37940  */
37941
37942 static PyObject *__pyx_pf_4lxml_5etree_8_Comment___repr__(PyObject *__pyx_v_self); /*proto*/
37943 static PyObject *__pyx_pf_4lxml_5etree_8_Comment___repr__(PyObject *__pyx_v_self) {
37944   PyObject *__pyx_r = NULL;
37945   PyObject *__pyx_t_1 = NULL;
37946   PyObject *__pyx_t_2 = NULL;
37947   __Pyx_SetupRefcountContext("__repr__");
37948
37949   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1424
37950  * 
37951  *     def __repr__(self):
37952  *         return u"<!--%s-->" % self.text             # <<<<<<<<<<<<<<
37953  * 
37954  * cdef class _ProcessingInstruction(__ContentOnlyElement):
37955  */
37956   __Pyx_XDECREF(__pyx_r);
37957   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37958   __Pyx_GOTREF(__pyx_t_1);
37959   __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_335), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37960   __Pyx_GOTREF(__pyx_t_2);
37961   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
37962   __pyx_r = __pyx_t_2;
37963   __pyx_t_2 = 0;
37964   goto __pyx_L0;
37965
37966   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
37967   goto __pyx_L0;
37968   __pyx_L1_error:;
37969   __Pyx_XDECREF(__pyx_t_1);
37970   __Pyx_XDECREF(__pyx_t_2);
37971   __Pyx_AddTraceback("lxml.etree._Comment.__repr__");
37972   __pyx_r = NULL;
37973   __pyx_L0:;
37974   __Pyx_XGIVEREF(__pyx_r);
37975   __Pyx_FinishRefcountContext();
37976   return __pyx_r;
37977 }
37978
37979 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1428
37980  * cdef class _ProcessingInstruction(__ContentOnlyElement):
37981  *     property tag:
37982  *         def __get__(self):             # <<<<<<<<<<<<<<
37983  *             return ProcessingInstruction
37984  * 
37985  */
37986
37987 static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_3tag___get__(PyObject *__pyx_v_self); /*proto*/
37988 static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_3tag___get__(PyObject *__pyx_v_self) {
37989   PyObject *__pyx_r = NULL;
37990   PyObject *__pyx_1 = 0;
37991   __Pyx_SetupRefcountContext("__get__");
37992
37993   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1429
37994  *     property tag:
37995  *         def __get__(self):
37996  *             return ProcessingInstruction             # <<<<<<<<<<<<<<
37997  * 
37998  *     property target:
37999  */
38000   __Pyx_XDECREF(__pyx_r);
38001   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_101); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38002   __Pyx_GOTREF(__pyx_1);
38003   __pyx_r = __pyx_1;
38004   __pyx_1 = 0;
38005   goto __pyx_L0;
38006
38007   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
38008   goto __pyx_L0;
38009   __pyx_L1_error:;
38010   __Pyx_XDECREF(__pyx_1);
38011   __Pyx_AddTraceback("lxml.etree._ProcessingInstruction.tag.__get__");
38012   __pyx_r = NULL;
38013   __pyx_L0:;
38014   __Pyx_XGIVEREF(__pyx_r);
38015   __Pyx_FinishRefcountContext();
38016   return __pyx_r;
38017 }
38018
38019 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1433
38020  *     property target:
38021  *         # not in ElementTree
38022  *         def __get__(self):             # <<<<<<<<<<<<<<
38023  *             return funicode(self._c_node.name)
38024  * 
38025  */
38026
38027 static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_6target___get__(PyObject *__pyx_v_self); /*proto*/
38028 static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_6target___get__(PyObject *__pyx_v_self) {
38029   PyObject *__pyx_r = NULL;
38030   PyObject *__pyx_t_1 = NULL;
38031   __Pyx_SetupRefcountContext("__get__");
38032
38033   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1434
38034  *         # not in ElementTree
38035  *         def __get__(self):
38036  *             return funicode(self._c_node.name)             # <<<<<<<<<<<<<<
38037  * 
38038  *         def __set__(self, value):
38039  */
38040   __Pyx_XDECREF(__pyx_r);
38041   __pyx_t_1 = __pyx_f_4lxml_5etree_funicode(((struct __pyx_obj_4lxml_5etree__ProcessingInstruction *)__pyx_v_self)->__pyx_base.__pyx_base._c_node->name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38042   __Pyx_GOTREF(__pyx_t_1);
38043   __pyx_r = __pyx_t_1;
38044   __pyx_t_1 = 0;
38045   goto __pyx_L0;
38046
38047   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
38048   goto __pyx_L0;
38049   __pyx_L1_error:;
38050   __Pyx_XDECREF(__pyx_t_1);
38051   __Pyx_AddTraceback("lxml.etree._ProcessingInstruction.target.__get__");
38052   __pyx_r = NULL;
38053   __pyx_L0:;
38054   __Pyx_XGIVEREF(__pyx_r);
38055   __Pyx_FinishRefcountContext();
38056   return __pyx_r;
38057 }
38058
38059 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1436
38060  *             return funicode(self._c_node.name)
38061  * 
38062  *         def __set__(self, value):             # <<<<<<<<<<<<<<
38063  *             value = _utf8(value)
38064  *             c_text = _cstr(value)
38065  */
38066
38067 static int __pyx_pf_4lxml_5etree_22_ProcessingInstruction_6target___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
38068 static int __pyx_pf_4lxml_5etree_22_ProcessingInstruction_6target___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
38069   PyObject *__pyx_v_c_text;
38070   int __pyx_r;
38071   PyObject *__pyx_t_1 = NULL;
38072   char *__pyx_t_2;
38073   __Pyx_SetupRefcountContext("__set__");
38074   __Pyx_INCREF(__pyx_v_value);
38075   __pyx_v_c_text = Py_None; __Pyx_INCREF(Py_None);
38076
38077   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1437
38078  * 
38079  *         def __set__(self, value):
38080  *             value = _utf8(value)             # <<<<<<<<<<<<<<
38081  *             c_text = _cstr(value)
38082  *             tree.xmlNodeSetName(self._c_node, c_text)
38083  */
38084   __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38085   __Pyx_GOTREF(__pyx_t_1);
38086   __Pyx_DECREF(__pyx_v_value);
38087   __pyx_v_value = __pyx_t_1;
38088   __pyx_t_1 = 0;
38089
38090   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1438
38091  *         def __set__(self, value):
38092  *             value = _utf8(value)
38093  *             c_text = _cstr(value)             # <<<<<<<<<<<<<<
38094  *             tree.xmlNodeSetName(self._c_node, c_text)
38095  * 
38096  */
38097   __pyx_t_1 = __Pyx_PyBytes_FromString(PyString_AS_STRING(__pyx_v_value)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38098   __Pyx_GOTREF(__pyx_t_1);
38099   __Pyx_DECREF(__pyx_v_c_text);
38100   __pyx_v_c_text = __pyx_t_1;
38101   __pyx_t_1 = 0;
38102
38103   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1439
38104  *             value = _utf8(value)
38105  *             c_text = _cstr(value)
38106  *             tree.xmlNodeSetName(self._c_node, c_text)             # <<<<<<<<<<<<<<
38107  * 
38108  *     def __repr__(self):
38109  */
38110   __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_c_text); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38111   xmlNodeSetName(((struct __pyx_obj_4lxml_5etree__ProcessingInstruction *)__pyx_v_self)->__pyx_base.__pyx_base._c_node, __pyx_t_2);
38112
38113   __pyx_r = 0;
38114   goto __pyx_L0;
38115   __pyx_L1_error:;
38116   __Pyx_XDECREF(__pyx_t_1);
38117   __Pyx_AddTraceback("lxml.etree._ProcessingInstruction.target.__set__");
38118   __pyx_r = -1;
38119   __pyx_L0:;
38120   __Pyx_DECREF(__pyx_v_c_text);
38121   __Pyx_DECREF(__pyx_v_value);
38122   __Pyx_FinishRefcountContext();
38123   return __pyx_r;
38124 }
38125
38126 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1441
38127  *             tree.xmlNodeSetName(self._c_node, c_text)
38128  * 
38129  *     def __repr__(self):             # <<<<<<<<<<<<<<
38130  *         text = self.text
38131  *         if text:
38132  */
38133
38134 static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction___repr__(PyObject *__pyx_v_self); /*proto*/
38135 static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction___repr__(PyObject *__pyx_v_self) {
38136   PyObject *__pyx_v_text;
38137   PyObject *__pyx_r = NULL;
38138   PyObject *__pyx_t_1 = NULL;
38139   int __pyx_t_2;
38140   PyObject *__pyx_t_3 = NULL;
38141   __Pyx_SetupRefcountContext("__repr__");
38142   __pyx_v_text = Py_None; __Pyx_INCREF(Py_None);
38143
38144   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1442
38145  * 
38146  *     def __repr__(self):
38147  *         text = self.text             # <<<<<<<<<<<<<<
38148  *         if text:
38149  *             return u"<?%s %s?>" % (self.target, text)
38150  */
38151   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38152   __Pyx_GOTREF(__pyx_t_1);
38153   __Pyx_DECREF(__pyx_v_text);
38154   __pyx_v_text = __pyx_t_1;
38155   __pyx_t_1 = 0;
38156
38157   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1443
38158  *     def __repr__(self):
38159  *         text = self.text
38160  *         if text:             # <<<<<<<<<<<<<<
38161  *             return u"<?%s %s?>" % (self.target, text)
38162  *         else:
38163  */
38164   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_text); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38165   if (__pyx_t_2) {
38166
38167     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1444
38168  *         text = self.text
38169  *         if text:
38170  *             return u"<?%s %s?>" % (self.target, text)             # <<<<<<<<<<<<<<
38171  *         else:
38172  *             return u"<?%s?>" % self.target
38173  */
38174     __Pyx_XDECREF(__pyx_r);
38175     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_target); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38176     __Pyx_GOTREF(__pyx_t_1);
38177     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38178     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
38179     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
38180     __Pyx_GIVEREF(__pyx_t_1);
38181     __Pyx_INCREF(__pyx_v_text);
38182     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_text);
38183     __Pyx_GIVEREF(__pyx_v_text);
38184     __pyx_t_1 = 0;
38185     __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_336), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38186     __Pyx_GOTREF(__pyx_t_1);
38187     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
38188     __pyx_r = __pyx_t_1;
38189     __pyx_t_1 = 0;
38190     goto __pyx_L0;
38191     goto __pyx_L5;
38192   }
38193   /*else*/ {
38194
38195     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1446
38196  *             return u"<?%s %s?>" % (self.target, text)
38197  *         else:
38198  *             return u"<?%s?>" % self.target             # <<<<<<<<<<<<<<
38199  * 
38200  * cdef class _Entity(__ContentOnlyElement):
38201  */
38202     __Pyx_XDECREF(__pyx_r);
38203     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_target); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38204     __Pyx_GOTREF(__pyx_t_1);
38205     __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_337), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38206     __Pyx_GOTREF(__pyx_t_3);
38207     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
38208     __pyx_r = __pyx_t_3;
38209     __pyx_t_3 = 0;
38210     goto __pyx_L0;
38211   }
38212   __pyx_L5:;
38213
38214   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
38215   goto __pyx_L0;
38216   __pyx_L1_error:;
38217   __Pyx_XDECREF(__pyx_t_1);
38218   __Pyx_XDECREF(__pyx_t_3);
38219   __Pyx_AddTraceback("lxml.etree._ProcessingInstruction.__repr__");
38220   __pyx_r = NULL;
38221   __pyx_L0:;
38222   __Pyx_DECREF(__pyx_v_text);
38223   __Pyx_XGIVEREF(__pyx_r);
38224   __Pyx_FinishRefcountContext();
38225   return __pyx_r;
38226 }
38227
38228 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1450
38229  * cdef class _Entity(__ContentOnlyElement):
38230  *     property tag:
38231  *         def __get__(self):             # <<<<<<<<<<<<<<
38232  *             return Entity
38233  * 
38234  */
38235
38236 static PyObject *__pyx_pf_4lxml_5etree_7_Entity_3tag___get__(PyObject *__pyx_v_self); /*proto*/
38237 static PyObject *__pyx_pf_4lxml_5etree_7_Entity_3tag___get__(PyObject *__pyx_v_self) {
38238   PyObject *__pyx_r = NULL;
38239   PyObject *__pyx_1 = 0;
38240   __Pyx_SetupRefcountContext("__get__");
38241
38242   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1451
38243  *     property tag:
38244  *         def __get__(self):
38245  *             return Entity             # <<<<<<<<<<<<<<
38246  * 
38247  *     property name:
38248  */
38249   __Pyx_XDECREF(__pyx_r);
38250   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_Entity); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38251   __Pyx_GOTREF(__pyx_1);
38252   __pyx_r = __pyx_1;
38253   __pyx_1 = 0;
38254   goto __pyx_L0;
38255
38256   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
38257   goto __pyx_L0;
38258   __pyx_L1_error:;
38259   __Pyx_XDECREF(__pyx_1);
38260   __Pyx_AddTraceback("lxml.etree._Entity.tag.__get__");
38261   __pyx_r = NULL;
38262   __pyx_L0:;
38263   __Pyx_XGIVEREF(__pyx_r);
38264   __Pyx_FinishRefcountContext();
38265   return __pyx_r;
38266 }
38267
38268 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1455
38269  *     property name:
38270  *         # not in ElementTree
38271  *         def __get__(self):             # <<<<<<<<<<<<<<
38272  *             return funicode(self._c_node.name)
38273  * 
38274  */
38275
38276 static PyObject *__pyx_pf_4lxml_5etree_7_Entity_4name___get__(PyObject *__pyx_v_self); /*proto*/
38277 static PyObject *__pyx_pf_4lxml_5etree_7_Entity_4name___get__(PyObject *__pyx_v_self) {
38278   PyObject *__pyx_r = NULL;
38279   PyObject *__pyx_t_1 = NULL;
38280   __Pyx_SetupRefcountContext("__get__");
38281
38282   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1456
38283  *         # not in ElementTree
38284  *         def __get__(self):
38285  *             return funicode(self._c_node.name)             # <<<<<<<<<<<<<<
38286  * 
38287  *         def __set__(self, value):
38288  */
38289   __Pyx_XDECREF(__pyx_r);
38290   __pyx_t_1 = __pyx_f_4lxml_5etree_funicode(((struct __pyx_obj_4lxml_5etree__Entity *)__pyx_v_self)->__pyx_base.__pyx_base._c_node->name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38291   __Pyx_GOTREF(__pyx_t_1);
38292   __pyx_r = __pyx_t_1;
38293   __pyx_t_1 = 0;
38294   goto __pyx_L0;
38295
38296   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
38297   goto __pyx_L0;
38298   __pyx_L1_error:;
38299   __Pyx_XDECREF(__pyx_t_1);
38300   __Pyx_AddTraceback("lxml.etree._Entity.name.__get__");
38301   __pyx_r = NULL;
38302   __pyx_L0:;
38303   __Pyx_XGIVEREF(__pyx_r);
38304   __Pyx_FinishRefcountContext();
38305   return __pyx_r;
38306 }
38307
38308 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1458
38309  *             return funicode(self._c_node.name)
38310  * 
38311  *         def __set__(self, value):             # <<<<<<<<<<<<<<
38312  *             value = _utf8(value)
38313  *             assert u'&' not in value and u';' not in value, \
38314  */
38315
38316 static int __pyx_pf_4lxml_5etree_7_Entity_4name___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
38317 static int __pyx_pf_4lxml_5etree_7_Entity_4name___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
38318   PyObject *__pyx_v_c_text;
38319   int __pyx_r;
38320   PyObject *__pyx_t_1 = NULL;
38321   int __pyx_t_2;
38322   int __pyx_t_3;
38323   int __pyx_t_4;
38324   char *__pyx_t_5;
38325   __Pyx_SetupRefcountContext("__set__");
38326   __Pyx_INCREF(__pyx_v_value);
38327   __pyx_v_c_text = Py_None; __Pyx_INCREF(Py_None);
38328
38329   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1459
38330  * 
38331  *         def __set__(self, value):
38332  *             value = _utf8(value)             # <<<<<<<<<<<<<<
38333  *             assert u'&' not in value and u';' not in value, \
38334  *                 u"Invalid entity name '%s'" % value
38335  */
38336   __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38337   __Pyx_GOTREF(__pyx_t_1);
38338   __Pyx_DECREF(__pyx_v_value);
38339   __pyx_v_value = __pyx_t_1;
38340   __pyx_t_1 = 0;
38341
38342   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1460
38343  *         def __set__(self, value):
38344  *             value = _utf8(value)
38345  *             assert u'&' not in value and u';' not in value, \             # <<<<<<<<<<<<<<
38346  *                 u"Invalid entity name '%s'" % value
38347  *             c_text = _cstr(value)
38348  */
38349   #ifndef PYREX_WITHOUT_ASSERTIONS
38350   __pyx_t_2 = (!PySequence_Contains(__pyx_v_value, ((PyObject *)__pyx_kp_338))); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38351   if (__pyx_t_2) {
38352     __pyx_t_3 = (!PySequence_Contains(__pyx_v_value, ((PyObject *)__pyx_kp_339))); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38353     __pyx_t_4 = __pyx_t_3;
38354   } else {
38355     __pyx_t_4 = __pyx_t_2;
38356   }
38357   if (unlikely(!__pyx_t_4)) {
38358
38359     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1461
38360  *             value = _utf8(value)
38361  *             assert u'&' not in value and u';' not in value, \
38362  *                 u"Invalid entity name '%s'" % value             # <<<<<<<<<<<<<<
38363  *             c_text = _cstr(value)
38364  *             tree.xmlNodeSetName(self._c_node, c_text)
38365  */
38366     __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_340), __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38367     __Pyx_GOTREF(__pyx_t_1);
38368     PyErr_SetObject(PyExc_AssertionError, __pyx_t_1);
38369     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
38370     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38371   }
38372   #endif
38373
38374   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1462
38375  *             assert u'&' not in value and u';' not in value, \
38376  *                 u"Invalid entity name '%s'" % value
38377  *             c_text = _cstr(value)             # <<<<<<<<<<<<<<
38378  *             tree.xmlNodeSetName(self._c_node, c_text)
38379  * 
38380  */
38381   __pyx_t_1 = __Pyx_PyBytes_FromString(PyString_AS_STRING(__pyx_v_value)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38382   __Pyx_GOTREF(__pyx_t_1);
38383   __Pyx_DECREF(__pyx_v_c_text);
38384   __pyx_v_c_text = __pyx_t_1;
38385   __pyx_t_1 = 0;
38386
38387   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1463
38388  *                 u"Invalid entity name '%s'" % value
38389  *             c_text = _cstr(value)
38390  *             tree.xmlNodeSetName(self._c_node, c_text)             # <<<<<<<<<<<<<<
38391  * 
38392  *     property text:
38393  */
38394   __pyx_t_5 = __Pyx_PyBytes_AsString(__pyx_v_c_text); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38395   xmlNodeSetName(((struct __pyx_obj_4lxml_5etree__Entity *)__pyx_v_self)->__pyx_base.__pyx_base._c_node, __pyx_t_5);
38396
38397   __pyx_r = 0;
38398   goto __pyx_L0;
38399   __pyx_L1_error:;
38400   __Pyx_XDECREF(__pyx_t_1);
38401   __Pyx_AddTraceback("lxml.etree._Entity.name.__set__");
38402   __pyx_r = -1;
38403   __pyx_L0:;
38404   __Pyx_DECREF(__pyx_v_c_text);
38405   __Pyx_DECREF(__pyx_v_value);
38406   __Pyx_FinishRefcountContext();
38407   return __pyx_r;
38408 }
38409
38410 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1468
38411  *         # FIXME: should this be None or '&[VALUE];' or the resolved
38412  *         # entity value ?
38413  *         def __get__(self):             # <<<<<<<<<<<<<<
38414  *             return u'&%s;' % funicode(self._c_node.name)
38415  * 
38416  */
38417
38418 static PyObject *__pyx_pf_4lxml_5etree_7_Entity_4text___get__(PyObject *__pyx_v_self); /*proto*/
38419 static PyObject *__pyx_pf_4lxml_5etree_7_Entity_4text___get__(PyObject *__pyx_v_self) {
38420   PyObject *__pyx_r = NULL;
38421   PyObject *__pyx_t_1 = NULL;
38422   PyObject *__pyx_t_2 = NULL;
38423   __Pyx_SetupRefcountContext("__get__");
38424
38425   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1469
38426  *         # entity value ?
38427  *         def __get__(self):
38428  *             return u'&%s;' % funicode(self._c_node.name)             # <<<<<<<<<<<<<<
38429  * 
38430  *     def __repr__(self):
38431  */
38432   __Pyx_XDECREF(__pyx_r);
38433   __pyx_t_1 = __pyx_f_4lxml_5etree_funicode(((struct __pyx_obj_4lxml_5etree__Entity *)__pyx_v_self)->__pyx_base.__pyx_base._c_node->name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38434   __Pyx_GOTREF(__pyx_t_1);
38435   __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_341), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38436   __Pyx_GOTREF(__pyx_t_2);
38437   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
38438   __pyx_r = __pyx_t_2;
38439   __pyx_t_2 = 0;
38440   goto __pyx_L0;
38441
38442   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
38443   goto __pyx_L0;
38444   __pyx_L1_error:;
38445   __Pyx_XDECREF(__pyx_t_1);
38446   __Pyx_XDECREF(__pyx_t_2);
38447   __Pyx_AddTraceback("lxml.etree._Entity.text.__get__");
38448   __pyx_r = NULL;
38449   __pyx_L0:;
38450   __Pyx_XGIVEREF(__pyx_r);
38451   __Pyx_FinishRefcountContext();
38452   return __pyx_r;
38453 }
38454
38455 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1471
38456  *             return u'&%s;' % funicode(self._c_node.name)
38457  * 
38458  *     def __repr__(self):             # <<<<<<<<<<<<<<
38459  *         return u"&%s;" % self.name
38460  * 
38461  */
38462
38463 static PyObject *__pyx_pf_4lxml_5etree_7_Entity___repr__(PyObject *__pyx_v_self); /*proto*/
38464 static PyObject *__pyx_pf_4lxml_5etree_7_Entity___repr__(PyObject *__pyx_v_self) {
38465   PyObject *__pyx_r = NULL;
38466   PyObject *__pyx_t_1 = NULL;
38467   PyObject *__pyx_t_2 = NULL;
38468   __Pyx_SetupRefcountContext("__repr__");
38469
38470   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1472
38471  * 
38472  *     def __repr__(self):
38473  *         return u"&%s;" % self.name             # <<<<<<<<<<<<<<
38474  * 
38475  * 
38476  */
38477   __Pyx_XDECREF(__pyx_r);
38478   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38479   __Pyx_GOTREF(__pyx_t_1);
38480   __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_342), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38481   __Pyx_GOTREF(__pyx_t_2);
38482   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
38483   __pyx_r = __pyx_t_2;
38484   __pyx_t_2 = 0;
38485   goto __pyx_L0;
38486
38487   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
38488   goto __pyx_L0;
38489   __pyx_L1_error:;
38490   __Pyx_XDECREF(__pyx_t_1);
38491   __Pyx_XDECREF(__pyx_t_2);
38492   __Pyx_AddTraceback("lxml.etree._Entity.__repr__");
38493   __pyx_r = NULL;
38494   __pyx_L0:;
38495   __Pyx_XGIVEREF(__pyx_r);
38496   __Pyx_FinishRefcountContext();
38497   return __pyx_r;
38498 }
38499
38500 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1495
38501  *     cdef readonly object localname
38502  *     cdef readonly object namespace
38503  *     def __init__(self, text_or_uri_or_element, tag=None):             # <<<<<<<<<<<<<<
38504  *         if not _isString(text_or_uri_or_element):
38505  *             if isinstance(text_or_uri_or_element, _Element):
38506  */
38507
38508 static int __pyx_pf_4lxml_5etree_5QName___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
38509 static int __pyx_pf_4lxml_5etree_5QName___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
38510   PyObject *__pyx_v_text_or_uri_or_element = 0;
38511   PyObject *__pyx_v_tag = 0;
38512   PyObject *__pyx_v_ns_utf;
38513   PyObject *__pyx_v_tag_utf;
38514   int __pyx_r;
38515   PyObject *__pyx_1 = 0;
38516   PyObject *__pyx_2 = 0;
38517   PyObject *__pyx_3 = 0;
38518   int __pyx_t_1;
38519   PyObject *__pyx_t_2 = NULL;
38520   PyObject *__pyx_t_3 = NULL;
38521   int __pyx_t_4;
38522   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_36,&__pyx_kp_tag,0};
38523   __Pyx_SetupRefcountContext("__init__");
38524   if (unlikely(__pyx_kwds)) {
38525     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
38526     PyObject* values[2] = {0,0};
38527     values[1] = Py_None;
38528     switch (PyTuple_GET_SIZE(__pyx_args)) {
38529       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
38530       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
38531       case  0: break;
38532       default: goto __pyx_L5_argtuple_error;
38533     }
38534     switch (PyTuple_GET_SIZE(__pyx_args)) {
38535       case  0:
38536       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_36);
38537       if (likely(values[0])) kw_args--;
38538       else goto __pyx_L5_argtuple_error;
38539       case  1:
38540       if (kw_args > 1) {
38541         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_tag);
38542         if (unlikely(value)) { values[1] = value; kw_args--; }
38543       }
38544     }
38545     if (unlikely(kw_args > 0)) {
38546       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1495; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
38547     }
38548     __pyx_v_text_or_uri_or_element = values[0];
38549     __pyx_v_tag = values[1];
38550   } else {
38551     __pyx_v_tag = Py_None;
38552     switch (PyTuple_GET_SIZE(__pyx_args)) {
38553       case  2: __pyx_v_tag = PyTuple_GET_ITEM(__pyx_args, 1);
38554       case  1: __pyx_v_text_or_uri_or_element = PyTuple_GET_ITEM(__pyx_args, 0);
38555       break;
38556       default: goto __pyx_L5_argtuple_error;
38557     }
38558   }
38559   goto __pyx_L4_argument_unpacking_done;
38560   __pyx_L5_argtuple_error:;
38561   __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1495; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
38562   __pyx_L3_error:;
38563   __Pyx_AddTraceback("lxml.etree.QName.__init__");
38564   return -1;
38565   __pyx_L4_argument_unpacking_done:;
38566   __Pyx_INCREF(__pyx_v_text_or_uri_or_element);
38567   __pyx_v_ns_utf = Py_None; __Pyx_INCREF(Py_None);
38568   __pyx_v_tag_utf = Py_None; __Pyx_INCREF(Py_None);
38569
38570   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1496
38571  *     cdef readonly object namespace
38572  *     def __init__(self, text_or_uri_or_element, tag=None):
38573  *         if not _isString(text_or_uri_or_element):             # <<<<<<<<<<<<<<
38574  *             if isinstance(text_or_uri_or_element, _Element):
38575  *                 text_or_uri_or_element = (<_Element>text_or_uri_or_element).tag
38576  */
38577   __pyx_t_1 = (!_isString(__pyx_v_text_or_uri_or_element));
38578   if (__pyx_t_1) {
38579
38580     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1497
38581  *     def __init__(self, text_or_uri_or_element, tag=None):
38582  *         if not _isString(text_or_uri_or_element):
38583  *             if isinstance(text_or_uri_or_element, _Element):             # <<<<<<<<<<<<<<
38584  *                 text_or_uri_or_element = (<_Element>text_or_uri_or_element).tag
38585  *                 if not _isString(text_or_uri_or_element):
38586  */
38587     __pyx_t_1 = PyObject_TypeCheck(__pyx_v_text_or_uri_or_element, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Element))); 
38588     if (__pyx_t_1) {
38589
38590       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1498
38591  *         if not _isString(text_or_uri_or_element):
38592  *             if isinstance(text_or_uri_or_element, _Element):
38593  *                 text_or_uri_or_element = (<_Element>text_or_uri_or_element).tag             # <<<<<<<<<<<<<<
38594  *                 if not _isString(text_or_uri_or_element):
38595  *                     raise ValueError, ("Invalid input tag of type %r" %
38596  */
38597       __pyx_t_2 = PyObject_GetAttr(__pyx_v_text_or_uri_or_element, __pyx_kp_tag); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38598       __Pyx_GOTREF(__pyx_t_2);
38599       __Pyx_DECREF(__pyx_v_text_or_uri_or_element);
38600       __pyx_v_text_or_uri_or_element = __pyx_t_2;
38601       __pyx_t_2 = 0;
38602
38603       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1499
38604  *             if isinstance(text_or_uri_or_element, _Element):
38605  *                 text_or_uri_or_element = (<_Element>text_or_uri_or_element).tag
38606  *                 if not _isString(text_or_uri_or_element):             # <<<<<<<<<<<<<<
38607  *                     raise ValueError, ("Invalid input tag of type %r" %
38608  *                                        type(text_or_uri_or_element))
38609  */
38610       __pyx_t_1 = (!_isString(__pyx_v_text_or_uri_or_element));
38611       if (__pyx_t_1) {
38612
38613         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1501
38614  *                 if not _isString(text_or_uri_or_element):
38615  *                     raise ValueError, ("Invalid input tag of type %r" %
38616  *                                        type(text_or_uri_or_element))             # <<<<<<<<<<<<<<
38617  *             elif isinstance(text_or_uri_or_element, QName):
38618  *                 text_or_uri_or_element = (<QName>text_or_uri_or_element).text
38619  */
38620         __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38621         __Pyx_GOTREF(((PyObject *)__pyx_t_2));
38622         __Pyx_INCREF(__pyx_v_text_or_uri_or_element);
38623         PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_text_or_uri_or_element);
38624         __Pyx_GIVEREF(__pyx_v_text_or_uri_or_element);
38625         __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyType_Type)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38626         __Pyx_GOTREF(__pyx_t_3);
38627         __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
38628         __pyx_t_2 = PyNumber_Remainder(__pyx_kp_343, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38629         __Pyx_GOTREF(__pyx_t_2);
38630         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
38631         __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_2, 0);
38632         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
38633         {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38634         goto __pyx_L8;
38635       }
38636       __pyx_L8:;
38637       goto __pyx_L7;
38638     }
38639
38640     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1502
38641  *                     raise ValueError, ("Invalid input tag of type %r" %
38642  *                                        type(text_or_uri_or_element))
38643  *             elif isinstance(text_or_uri_or_element, QName):             # <<<<<<<<<<<<<<
38644  *                 text_or_uri_or_element = (<QName>text_or_uri_or_element).text
38645  *             else:
38646  */
38647     __pyx_t_1 = PyObject_TypeCheck(__pyx_v_text_or_uri_or_element, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree_QName))); 
38648     if (__pyx_t_1) {
38649
38650       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1503
38651  *                                        type(text_or_uri_or_element))
38652  *             elif isinstance(text_or_uri_or_element, QName):
38653  *                 text_or_uri_or_element = (<QName>text_or_uri_or_element).text             # <<<<<<<<<<<<<<
38654  *             else:
38655  *                 text_or_uri_or_element = unicode(text_or_uri_or_element)
38656  */
38657       __Pyx_INCREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_text_or_uri_or_element)->text);
38658       __Pyx_DECREF(__pyx_v_text_or_uri_or_element);
38659       __pyx_v_text_or_uri_or_element = ((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_text_or_uri_or_element)->text;
38660       goto __pyx_L7;
38661     }
38662     /*else*/ {
38663
38664       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1505
38665  *                 text_or_uri_or_element = (<QName>text_or_uri_or_element).text
38666  *             else:
38667  *                 text_or_uri_or_element = unicode(text_or_uri_or_element)             # <<<<<<<<<<<<<<
38668  * 
38669  *         ns_utf, tag_utf = _getNsTag(text_or_uri_or_element)
38670  */
38671       __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38672       __Pyx_GOTREF(((PyObject *)__pyx_t_2));
38673       __Pyx_INCREF(__pyx_v_text_or_uri_or_element);
38674       PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_text_or_uri_or_element);
38675       __Pyx_GIVEREF(__pyx_v_text_or_uri_or_element);
38676       __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyUnicode_Type)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38677       __Pyx_GOTREF(__pyx_t_3);
38678       __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
38679       __Pyx_DECREF(__pyx_v_text_or_uri_or_element);
38680       __pyx_v_text_or_uri_or_element = __pyx_t_3;
38681       __pyx_t_3 = 0;
38682     }
38683     __pyx_L7:;
38684     goto __pyx_L6;
38685   }
38686   __pyx_L6:;
38687
38688   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1507
38689  *                 text_or_uri_or_element = unicode(text_or_uri_or_element)
38690  * 
38691  *         ns_utf, tag_utf = _getNsTag(text_or_uri_or_element)             # <<<<<<<<<<<<<<
38692  *         if tag is not None:
38693  *             # either ('ns', 'tag') or ('{ns}oldtag', 'newtag')
38694  */
38695   __pyx_t_3 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_text_or_uri_or_element); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38696   __Pyx_GOTREF(__pyx_t_3);
38697   if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) {
38698     PyObject* tuple = __pyx_t_3;
38699     __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
38700     __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
38701     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
38702     __Pyx_DECREF(__pyx_v_ns_utf);
38703     __pyx_v_ns_utf = __pyx_2;
38704     __pyx_2 = 0;
38705     __Pyx_DECREF(__pyx_v_tag_utf);
38706     __pyx_v_tag_utf = __pyx_3;
38707     __pyx_3 = 0;
38708   } else {
38709     __pyx_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38710     __Pyx_GOTREF(__pyx_1);
38711     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
38712     __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38713     __Pyx_GOTREF(__pyx_2);
38714     __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38715     __Pyx_GOTREF(__pyx_3);
38716     if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38717     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
38718     __Pyx_DECREF(__pyx_v_ns_utf);
38719     __pyx_v_ns_utf = __pyx_2;
38720     __pyx_2 = 0;
38721     __Pyx_DECREF(__pyx_v_tag_utf);
38722     __pyx_v_tag_utf = __pyx_3;
38723     __pyx_3 = 0;
38724   }
38725
38726   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1508
38727  * 
38728  *         ns_utf, tag_utf = _getNsTag(text_or_uri_or_element)
38729  *         if tag is not None:             # <<<<<<<<<<<<<<
38730  *             # either ('ns', 'tag') or ('{ns}oldtag', 'newtag')
38731  *             if ns_utf is None:
38732  */
38733   __pyx_t_1 = (__pyx_v_tag != Py_None);
38734   if (__pyx_t_1) {
38735
38736     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1510
38737  *         if tag is not None:
38738  *             # either ('ns', 'tag') or ('{ns}oldtag', 'newtag')
38739  *             if ns_utf is None:             # <<<<<<<<<<<<<<
38740  *                 ns_utf = tag_utf # case 1: namespace ended up as tag name
38741  *             tag_utf = _utf8(tag)
38742  */
38743     __pyx_t_1 = (__pyx_v_ns_utf == Py_None);
38744     if (__pyx_t_1) {
38745
38746       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1511
38747  *             # either ('ns', 'tag') or ('{ns}oldtag', 'newtag')
38748  *             if ns_utf is None:
38749  *                 ns_utf = tag_utf # case 1: namespace ended up as tag name             # <<<<<<<<<<<<<<
38750  *             tag_utf = _utf8(tag)
38751  *         _tagValidOrRaise(tag_utf)
38752  */
38753       __Pyx_INCREF(__pyx_v_tag_utf);
38754       __Pyx_DECREF(__pyx_v_ns_utf);
38755       __pyx_v_ns_utf = __pyx_v_tag_utf;
38756       goto __pyx_L10;
38757     }
38758     __pyx_L10:;
38759
38760     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1512
38761  *             if ns_utf is None:
38762  *                 ns_utf = tag_utf # case 1: namespace ended up as tag name
38763  *             tag_utf = _utf8(tag)             # <<<<<<<<<<<<<<
38764  *         _tagValidOrRaise(tag_utf)
38765  *         self.localname = python.PyUnicode_FromEncodedObject(
38766  */
38767     __pyx_t_3 = __pyx_f_4lxml_5etree__utf8(__pyx_v_tag); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38768     __Pyx_GOTREF(__pyx_t_3);
38769     __Pyx_DECREF(__pyx_v_tag_utf);
38770     __pyx_v_tag_utf = __pyx_t_3;
38771     __pyx_t_3 = 0;
38772     goto __pyx_L9;
38773   }
38774   __pyx_L9:;
38775
38776   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1513
38777  *                 ns_utf = tag_utf # case 1: namespace ended up as tag name
38778  *             tag_utf = _utf8(tag)
38779  *         _tagValidOrRaise(tag_utf)             # <<<<<<<<<<<<<<
38780  *         self.localname = python.PyUnicode_FromEncodedObject(
38781  *             tag_utf, 'UTF-8', NULL)
38782  */
38783   __pyx_t_4 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_tag_utf); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38784
38785   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1515
38786  *         _tagValidOrRaise(tag_utf)
38787  *         self.localname = python.PyUnicode_FromEncodedObject(
38788  *             tag_utf, 'UTF-8', NULL)             # <<<<<<<<<<<<<<
38789  *         if ns_utf is None:
38790  *             self.namespace = None
38791  */
38792   __pyx_t_3 = PyUnicode_FromEncodedObject(__pyx_v_tag_utf, __pyx_k_344, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38793   __Pyx_GOTREF(__pyx_t_3);
38794
38795   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1514
38796  *             tag_utf = _utf8(tag)
38797  *         _tagValidOrRaise(tag_utf)
38798  *         self.localname = python.PyUnicode_FromEncodedObject(             # <<<<<<<<<<<<<<
38799  *             tag_utf, 'UTF-8', NULL)
38800  *         if ns_utf is None:
38801  */
38802   __Pyx_GIVEREF(__pyx_t_3);
38803   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->localname);
38804   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->localname);
38805   ((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->localname = __pyx_t_3;
38806   __pyx_t_3 = 0;
38807
38808   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1516
38809  *         self.localname = python.PyUnicode_FromEncodedObject(
38810  *             tag_utf, 'UTF-8', NULL)
38811  *         if ns_utf is None:             # <<<<<<<<<<<<<<
38812  *             self.namespace = None
38813  *             self.text = self.localname
38814  */
38815   __pyx_t_1 = (__pyx_v_ns_utf == Py_None);
38816   if (__pyx_t_1) {
38817
38818     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1517
38819  *             tag_utf, 'UTF-8', NULL)
38820  *         if ns_utf is None:
38821  *             self.namespace = None             # <<<<<<<<<<<<<<
38822  *             self.text = self.localname
38823  *         else:
38824  */
38825     __Pyx_INCREF(Py_None);
38826     __Pyx_GIVEREF(Py_None);
38827     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->namespace);
38828     __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->namespace);
38829     ((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->namespace = Py_None;
38830
38831     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1518
38832  *         if ns_utf is None:
38833  *             self.namespace = None
38834  *             self.text = self.localname             # <<<<<<<<<<<<<<
38835  *         else:
38836  *             self.namespace = python.PyUnicode_FromEncodedObject(
38837  */
38838     __Pyx_INCREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->localname);
38839     __Pyx_GIVEREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->localname);
38840     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->text);
38841     __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->text);
38842     ((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->text = ((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->localname;
38843     goto __pyx_L11;
38844   }
38845   /*else*/ {
38846
38847     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1521
38848  *         else:
38849  *             self.namespace = python.PyUnicode_FromEncodedObject(
38850  *                 ns_utf, 'UTF-8', NULL)             # <<<<<<<<<<<<<<
38851  *             self.text = u"{%s}%s" % (self.namespace, self.localname)
38852  *     def __str__(self):
38853  */
38854     __pyx_t_3 = PyUnicode_FromEncodedObject(__pyx_v_ns_utf, __pyx_k_345, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38855     __Pyx_GOTREF(__pyx_t_3);
38856
38857     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1520
38858  *             self.text = self.localname
38859  *         else:
38860  *             self.namespace = python.PyUnicode_FromEncodedObject(             # <<<<<<<<<<<<<<
38861  *                 ns_utf, 'UTF-8', NULL)
38862  *             self.text = u"{%s}%s" % (self.namespace, self.localname)
38863  */
38864     __Pyx_GIVEREF(__pyx_t_3);
38865     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->namespace);
38866     __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->namespace);
38867     ((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->namespace = __pyx_t_3;
38868     __pyx_t_3 = 0;
38869
38870     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1522
38871  *             self.namespace = python.PyUnicode_FromEncodedObject(
38872  *                 ns_utf, 'UTF-8', NULL)
38873  *             self.text = u"{%s}%s" % (self.namespace, self.localname)             # <<<<<<<<<<<<<<
38874  *     def __str__(self):
38875  *         return self.text
38876  */
38877     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38878     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
38879     __Pyx_INCREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->namespace);
38880     PyTuple_SET_ITEM(__pyx_t_3, 0, ((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->namespace);
38881     __Pyx_GIVEREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->namespace);
38882     __Pyx_INCREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->localname);
38883     PyTuple_SET_ITEM(__pyx_t_3, 1, ((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->localname);
38884     __Pyx_GIVEREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->localname);
38885     __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_346), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38886     __Pyx_GOTREF(__pyx_t_2);
38887     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
38888     __Pyx_GIVEREF(__pyx_t_2);
38889     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->text);
38890     __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->text);
38891     ((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->text = __pyx_t_2;
38892     __pyx_t_2 = 0;
38893   }
38894   __pyx_L11:;
38895
38896   __pyx_r = 0;
38897   goto __pyx_L0;
38898   __pyx_L1_error:;
38899   __Pyx_XDECREF(__pyx_1);
38900   __Pyx_XDECREF(__pyx_2);
38901   __Pyx_XDECREF(__pyx_3);
38902   __Pyx_XDECREF(__pyx_t_2);
38903   __Pyx_XDECREF(__pyx_t_3);
38904   __Pyx_AddTraceback("lxml.etree.QName.__init__");
38905   __pyx_r = -1;
38906   __pyx_L0:;
38907   __Pyx_DECREF(__pyx_v_ns_utf);
38908   __Pyx_DECREF(__pyx_v_tag_utf);
38909   __Pyx_DECREF(__pyx_v_text_or_uri_or_element);
38910   __Pyx_FinishRefcountContext();
38911   return __pyx_r;
38912 }
38913
38914 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1523
38915  *                 ns_utf, 'UTF-8', NULL)
38916  *             self.text = u"{%s}%s" % (self.namespace, self.localname)
38917  *     def __str__(self):             # <<<<<<<<<<<<<<
38918  *         return self.text
38919  *     def __hash__(self):
38920  */
38921
38922 static PyObject *__pyx_pf_4lxml_5etree_5QName___str__(PyObject *__pyx_v_self); /*proto*/
38923 static PyObject *__pyx_pf_4lxml_5etree_5QName___str__(PyObject *__pyx_v_self) {
38924   PyObject *__pyx_r = NULL;
38925   __Pyx_SetupRefcountContext("__str__");
38926
38927   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1524
38928  *             self.text = u"{%s}%s" % (self.namespace, self.localname)
38929  *     def __str__(self):
38930  *         return self.text             # <<<<<<<<<<<<<<
38931  *     def __hash__(self):
38932  *         return self.text.__hash__()
38933  */
38934   __Pyx_XDECREF(__pyx_r);
38935   __Pyx_INCREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->text);
38936   __pyx_r = ((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->text;
38937   goto __pyx_L0;
38938
38939   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
38940   __pyx_L0:;
38941   __Pyx_XGIVEREF(__pyx_r);
38942   __Pyx_FinishRefcountContext();
38943   return __pyx_r;
38944 }
38945
38946 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1525
38947  *     def __str__(self):
38948  *         return self.text
38949  *     def __hash__(self):             # <<<<<<<<<<<<<<
38950  *         return self.text.__hash__()
38951  *     def __richcmp__(one, other, int op):
38952  */
38953
38954 static long __pyx_pf_4lxml_5etree_5QName___hash__(PyObject *__pyx_v_self); /*proto*/
38955 static long __pyx_pf_4lxml_5etree_5QName___hash__(PyObject *__pyx_v_self) {
38956   long __pyx_r;
38957   PyObject *__pyx_t_1 = NULL;
38958   PyObject *__pyx_t_2 = NULL;
38959   long __pyx_t_3;
38960   __Pyx_SetupRefcountContext("__hash__");
38961
38962   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1526
38963  *         return self.text
38964  *     def __hash__(self):
38965  *         return self.text.__hash__()             # <<<<<<<<<<<<<<
38966  *     def __richcmp__(one, other, int op):
38967  *         if not _isString(one):
38968  */
38969   __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->text, __pyx_kp___hash__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38970   __Pyx_GOTREF(__pyx_t_1);
38971   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38972   __Pyx_GOTREF(__pyx_t_2);
38973   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
38974   __pyx_t_3 = __Pyx_PyInt_AsLong(__pyx_t_2); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
38975   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
38976   __pyx_r = __pyx_t_3;
38977   goto __pyx_L0;
38978
38979   __pyx_r = 0;
38980   goto __pyx_L0;
38981   __pyx_L1_error:;
38982   __Pyx_XDECREF(__pyx_t_1);
38983   __Pyx_XDECREF(__pyx_t_2);
38984   __Pyx_AddTraceback("lxml.etree.QName.__hash__");
38985   __pyx_r = -1;
38986   __pyx_L0:;
38987   __Pyx_FinishRefcountContext();
38988   if (unlikely(__pyx_r == -1) && !PyErr_Occurred()) __pyx_r = -2;
38989   return __pyx_r;
38990 }
38991
38992 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1527
38993  *     def __hash__(self):
38994  *         return self.text.__hash__()
38995  *     def __richcmp__(one, other, int op):             # <<<<<<<<<<<<<<
38996  *         if not _isString(one):
38997  *             one = unicode(one)
38998  */
38999
39000 static PyObject *__pyx_pf_4lxml_5etree_5QName___richcmp__(PyObject *__pyx_v_one, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
39001 static PyObject *__pyx_pf_4lxml_5etree_5QName___richcmp__(PyObject *__pyx_v_one, PyObject *__pyx_v_other, int __pyx_v_op) {
39002   PyObject *__pyx_r = NULL;
39003   int __pyx_t_1;
39004   PyObject *__pyx_t_2 = NULL;
39005   PyObject *__pyx_t_3 = NULL;
39006   __Pyx_SetupRefcountContext("__richcmp__");
39007   __Pyx_INCREF(__pyx_v_one);
39008   __Pyx_INCREF(__pyx_v_other);
39009
39010   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1528
39011  *         return self.text.__hash__()
39012  *     def __richcmp__(one, other, int op):
39013  *         if not _isString(one):             # <<<<<<<<<<<<<<
39014  *             one = unicode(one)
39015  *         if not _isString(other):
39016  */
39017   __pyx_t_1 = (!_isString(__pyx_v_one));
39018   if (__pyx_t_1) {
39019
39020     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1529
39021  *     def __richcmp__(one, other, int op):
39022  *         if not _isString(one):
39023  *             one = unicode(one)             # <<<<<<<<<<<<<<
39024  *         if not _isString(other):
39025  *             other = unicode(other)
39026  */
39027     __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
39028     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
39029     __Pyx_INCREF(__pyx_v_one);
39030     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_one);
39031     __Pyx_GIVEREF(__pyx_v_one);
39032     __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyUnicode_Type)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
39033     __Pyx_GOTREF(__pyx_t_3);
39034     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
39035     __Pyx_DECREF(__pyx_v_one);
39036     __pyx_v_one = __pyx_t_3;
39037     __pyx_t_3 = 0;
39038     goto __pyx_L5;
39039   }
39040   __pyx_L5:;
39041
39042   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1530
39043  *         if not _isString(one):
39044  *             one = unicode(one)
39045  *         if not _isString(other):             # <<<<<<<<<<<<<<
39046  *             other = unicode(other)
39047  *         return python.PyObject_RichCompare(one, other, op)
39048  */
39049   __pyx_t_1 = (!_isString(__pyx_v_other));
39050   if (__pyx_t_1) {
39051
39052     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1531
39053  *             one = unicode(one)
39054  *         if not _isString(other):
39055  *             other = unicode(other)             # <<<<<<<<<<<<<<
39056  *         return python.PyObject_RichCompare(one, other, op)
39057  * 
39058  */
39059     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
39060     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
39061     __Pyx_INCREF(__pyx_v_other);
39062     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_other);
39063     __Pyx_GIVEREF(__pyx_v_other);
39064     __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyUnicode_Type)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
39065     __Pyx_GOTREF(__pyx_t_2);
39066     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
39067     __Pyx_DECREF(__pyx_v_other);
39068     __pyx_v_other = __pyx_t_2;
39069     __pyx_t_2 = 0;
39070     goto __pyx_L6;
39071   }
39072   __pyx_L6:;
39073
39074   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1532
39075  *         if not _isString(other):
39076  *             other = unicode(other)
39077  *         return python.PyObject_RichCompare(one, other, op)             # <<<<<<<<<<<<<<
39078  * 
39079  * 
39080  */
39081   __Pyx_XDECREF(__pyx_r);
39082   __pyx_t_2 = PyObject_RichCompare(__pyx_v_one, __pyx_v_other, __pyx_v_op); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
39083   __Pyx_GOTREF(__pyx_t_2);
39084   __pyx_r = __pyx_t_2;
39085   __pyx_t_2 = 0;
39086   goto __pyx_L0;
39087
39088   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
39089   goto __pyx_L0;
39090   __pyx_L1_error:;
39091   __Pyx_XDECREF(__pyx_t_2);
39092   __Pyx_XDECREF(__pyx_t_3);
39093   __Pyx_AddTraceback("lxml.etree.QName.__richcmp__");
39094   __pyx_r = NULL;
39095   __pyx_L0:;
39096   __Pyx_DECREF(__pyx_v_one);
39097   __Pyx_DECREF(__pyx_v_other);
39098   __Pyx_XGIVEREF(__pyx_r);
39099   __Pyx_FinishRefcountContext();
39100   return __pyx_r;
39101 }
39102
39103 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1544
39104  *     # to honour tree restructuring.  _doc can happily be None!
39105  * 
39106  *     cdef _assertHasRoot(self):             # <<<<<<<<<<<<<<
39107  *         u"""We have to take care here: the document may not have a root node!
39108  *         This can happen if ElementTree() is called without any argument and
39109  */
39110
39111 static  PyObject *__pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(struct LxmlElementTree *__pyx_v_self) {
39112   PyObject *__pyx_r = NULL;
39113   int __pyx_t_1;
39114   __Pyx_SetupRefcountContext("_assertHasRoot");
39115
39116   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1550
39117  *         the caller program.
39118  *         """
39119  *         assert self._context_node is not None, \             # <<<<<<<<<<<<<<
39120  *                u"ElementTree not initialized, missing root"
39121  * 
39122  */
39123   #ifndef PYREX_WITHOUT_ASSERTIONS
39124   __pyx_t_1 = (((PyObject *)__pyx_v_self->_context_node) != Py_None);
39125   if (unlikely(!__pyx_t_1)) {
39126
39127     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1551
39128  *         """
39129  *         assert self._context_node is not None, \
39130  *                u"ElementTree not initialized, missing root"             # <<<<<<<<<<<<<<
39131  * 
39132  *     def parse(self, source, _BaseParser parser=None, *, base_url=None):
39133  */
39134     PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_347));
39135     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
39136   }
39137   #endif
39138
39139   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
39140   goto __pyx_L0;
39141   __pyx_L1_error:;
39142   __Pyx_AddTraceback("lxml.etree._ElementTree._assertHasRoot");
39143   __pyx_r = 0;
39144   __pyx_L0:;
39145   __Pyx_XGIVEREF(__pyx_r);
39146   __Pyx_FinishRefcountContext();
39147   return __pyx_r;
39148 }
39149
39150 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1553
39151  *                u"ElementTree not initialized, missing root"
39152  * 
39153  *     def parse(self, source, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<<
39154  *         u"""parse(self, source, parser=None, base_url=None)
39155  * 
39156  */
39157
39158 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_parse(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
39159 static char __pyx_doc_4lxml_5etree_12_ElementTree_parse[] = "parse(self, source, parser=None, base_url=None)\n\n        Updates self with the content of source and returns its root\n        ";
39160 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_parse(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
39161   PyObject *__pyx_v_source = 0;
39162   struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser = 0;
39163   PyObject *__pyx_v_base_url = 0;
39164   struct LxmlDocument *__pyx_v_doc = 0;
39165   PyObject *__pyx_v_result_container;
39166   PyObject *__pyx_r = NULL;
39167   PyObject *__pyx_1 = 0;
39168   int __pyx_2;
39169   PyObject *__pyx_3 = 0;
39170   PyObject *__pyx_4 = 0;
39171   PyObject *__pyx_t_1 = NULL;
39172   int __pyx_t_2;
39173   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_source,&__pyx_kp_parser,&__pyx_kp_base_url,0};
39174   __Pyx_SetupRefcountContext("parse");
39175   if (unlikely(__pyx_kwds)) {
39176     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
39177     PyObject* values[3] = {0,0,0};
39178     values[1] = (PyObject*)((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None);
39179     values[2] = Py_None;
39180     switch (PyTuple_GET_SIZE(__pyx_args)) {
39181       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
39182       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
39183       case  0: break;
39184       default: goto __pyx_L5_argtuple_error;
39185     }
39186     switch (PyTuple_GET_SIZE(__pyx_args)) {
39187       case  0:
39188       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_source);
39189       if (likely(values[0])) kw_args--;
39190       else goto __pyx_L5_argtuple_error;
39191       case  1:
39192       if (kw_args > 1) {
39193         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_parser);
39194         if (unlikely(value)) { values[1] = value; kw_args--; }
39195       }
39196     }
39197     while (kw_args > 0) {
39198       PyObject* value;
39199       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_base_url);
39200       if (value) { values[2] = value; if (!(--kw_args)) break; }
39201       break;
39202     }
39203     if (unlikely(kw_args > 0)) {
39204       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "parse") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
39205     }
39206     __pyx_v_source = values[0];
39207     __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)values[1]);
39208     __pyx_v_base_url = values[2];
39209   } else {
39210     __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None);
39211     __pyx_v_base_url = Py_None;
39212     switch (PyTuple_GET_SIZE(__pyx_args)) {
39213       case  2: __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)PyTuple_GET_ITEM(__pyx_args, 1));
39214       case  1: __pyx_v_source = PyTuple_GET_ITEM(__pyx_args, 0);
39215       break;
39216       default: goto __pyx_L5_argtuple_error;
39217     }
39218   }
39219   goto __pyx_L4_argument_unpacking_done;
39220   __pyx_L5_argtuple_error:;
39221   __Pyx_RaiseArgtupleInvalid("parse", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
39222   __pyx_L3_error:;
39223   __Pyx_AddTraceback("lxml.etree._ElementTree.parse");
39224   return NULL;
39225   __pyx_L4_argument_unpacking_done:;
39226   __pyx_v_result_container = Py_None; __Pyx_INCREF(Py_None);
39227   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
39228
39229   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1558
39230  *         Updates self with the content of source and returns its root
39231  *         """
39232  *         cdef _Document doc = None             # <<<<<<<<<<<<<<
39233  *         try:
39234  *             doc = _parseDocument(source, parser, base_url)
39235  */
39236   __Pyx_INCREF(Py_None);
39237   __pyx_v_doc = ((struct LxmlDocument *)Py_None);
39238
39239   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1559
39240  *         """
39241  *         cdef _Document doc = None
39242  *         try:             # <<<<<<<<<<<<<<
39243  *             doc = _parseDocument(source, parser, base_url)
39244  *             self._context_node = doc.getroot()
39245  */
39246   {
39247     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
39248     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
39249     __Pyx_XGOTREF(__pyx_save_exc_type);
39250     __Pyx_XGOTREF(__pyx_save_exc_value);
39251     __Pyx_XGOTREF(__pyx_save_exc_tb);
39252     /*try:*/ {
39253
39254       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1560
39255  *         cdef _Document doc = None
39256  *         try:
39257  *             doc = _parseDocument(source, parser, base_url)             # <<<<<<<<<<<<<<
39258  *             self._context_node = doc.getroot()
39259  *             if self._context_node is None:
39260  */
39261       __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__parseDocument(__pyx_v_source, __pyx_v_parser, __pyx_v_base_url)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1560; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
39262       __Pyx_GOTREF(__pyx_t_1);
39263       __Pyx_DECREF(((PyObject *)__pyx_v_doc));
39264       __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_1);
39265       __pyx_t_1 = 0;
39266
39267       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1561
39268  *         try:
39269  *             doc = _parseDocument(source, parser, base_url)
39270  *             self._context_node = doc.getroot()             # <<<<<<<<<<<<<<
39271  *             if self._context_node is None:
39272  *                 self._doc = doc
39273  */
39274       __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_doc->__pyx_vtab)->getroot(__pyx_v_doc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
39275       __Pyx_GOTREF(__pyx_t_1);
39276       if (!(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
39277       __Pyx_GIVEREF(__pyx_t_1);
39278       __Pyx_GOTREF(((struct LxmlElementTree *)__pyx_v_self)->_context_node);
39279       __Pyx_DECREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node));
39280       ((struct LxmlElementTree *)__pyx_v_self)->_context_node = ((struct LxmlElement *)__pyx_t_1);
39281       __pyx_t_1 = 0;
39282
39283       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1562
39284  *             doc = _parseDocument(source, parser, base_url)
39285  *             self._context_node = doc.getroot()
39286  *             if self._context_node is None:             # <<<<<<<<<<<<<<
39287  *                 self._doc = doc
39288  *         except _TargetParserResult, result_container:
39289  */
39290       __pyx_t_2 = (((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node) == Py_None);
39291       if (__pyx_t_2) {
39292
39293         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1563
39294  *             self._context_node = doc.getroot()
39295  *             if self._context_node is None:
39296  *                 self._doc = doc             # <<<<<<<<<<<<<<
39297  *         except _TargetParserResult, result_container:
39298  *             # raises a TypeError if we don't get an _Element
39299  */
39300         __Pyx_INCREF(((PyObject *)__pyx_v_doc));
39301         __Pyx_GIVEREF(((PyObject *)__pyx_v_doc));
39302         __Pyx_GOTREF(((struct LxmlElementTree *)__pyx_v_self)->_doc);
39303         __Pyx_DECREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_doc));
39304         ((struct LxmlElementTree *)__pyx_v_self)->_doc = __pyx_v_doc;
39305         goto __pyx_L14;
39306       }
39307       __pyx_L14:;
39308     }
39309     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
39310     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
39311     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
39312     goto __pyx_L13_try_end;
39313     __pyx_L6_error:;
39314     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
39315
39316     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1564
39317  *             if self._context_node is None:
39318  *                 self._doc = doc
39319  *         except _TargetParserResult, result_container:             # <<<<<<<<<<<<<<
39320  *             # raises a TypeError if we don't get an _Element
39321  *             self._context_node = result_container.result
39322  */
39323     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__TargetParserResult); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1564; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
39324     __Pyx_GOTREF(__pyx_1);
39325     __pyx_2 = PyErr_ExceptionMatches(__pyx_1);
39326     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
39327     if (__pyx_2) {
39328       __Pyx_AddTraceback("lxml.etree.parse");
39329       if (__Pyx_GetException(&__pyx_1, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1564; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
39330       __Pyx_GOTREF(__pyx_1);
39331       __Pyx_GOTREF(__pyx_3);
39332       __Pyx_GOTREF(__pyx_4);
39333       __Pyx_INCREF(__pyx_3);
39334       __Pyx_DECREF(__pyx_v_result_container);
39335       __pyx_v_result_container = __pyx_3;
39336
39337       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1566
39338  *         except _TargetParserResult, result_container:
39339  *             # raises a TypeError if we don't get an _Element
39340  *             self._context_node = result_container.result             # <<<<<<<<<<<<<<
39341  *         return self._context_node
39342  * 
39343  */
39344       __pyx_t_1 = PyObject_GetAttr(__pyx_v_result_container, __pyx_kp_result); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
39345       __Pyx_GOTREF(__pyx_t_1);
39346       if (!(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
39347       __Pyx_GIVEREF(__pyx_t_1);
39348       __Pyx_GOTREF(((struct LxmlElementTree *)__pyx_v_self)->_context_node);
39349       __Pyx_DECREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node));
39350       ((struct LxmlElementTree *)__pyx_v_self)->_context_node = ((struct LxmlElement *)__pyx_t_1);
39351       __pyx_t_1 = 0;
39352       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
39353       __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
39354       __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
39355       goto __pyx_L7_exception_handled;
39356     }
39357     __pyx_L8_except_error:;
39358     __Pyx_XDECREF(__pyx_save_exc_type);
39359     __Pyx_XDECREF(__pyx_save_exc_value);
39360     __Pyx_XDECREF(__pyx_save_exc_tb);
39361     goto __pyx_L1_error;
39362     __pyx_L7_exception_handled:;
39363     __Pyx_XGIVEREF(__pyx_save_exc_type);
39364     __Pyx_XGIVEREF(__pyx_save_exc_value);
39365     __Pyx_XGIVEREF(__pyx_save_exc_tb);
39366     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
39367     __pyx_L13_try_end:;
39368   }
39369
39370   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1567
39371  *             # raises a TypeError if we don't get an _Element
39372  *             self._context_node = result_container.result
39373  *         return self._context_node             # <<<<<<<<<<<<<<
39374  * 
39375  *     def _setroot(self, _Element root not None):
39376  */
39377   __Pyx_XDECREF(__pyx_r);
39378   __Pyx_INCREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node));
39379   __pyx_r = ((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node);
39380   goto __pyx_L0;
39381
39382   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
39383   goto __pyx_L0;
39384   __pyx_L1_error:;
39385   __Pyx_XDECREF(__pyx_1);
39386   __Pyx_XDECREF(__pyx_3);
39387   __Pyx_XDECREF(__pyx_4);
39388   __Pyx_XDECREF(__pyx_t_1);
39389   __Pyx_AddTraceback("lxml.etree._ElementTree.parse");
39390   __pyx_r = NULL;
39391   __pyx_L0:;
39392   __Pyx_XDECREF((PyObject *)__pyx_v_doc);
39393   __Pyx_DECREF(__pyx_v_result_container);
39394   __Pyx_XGIVEREF(__pyx_r);
39395   __Pyx_FinishRefcountContext();
39396   return __pyx_r;
39397 }
39398
39399 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1569
39400  *         return self._context_node
39401  * 
39402  *     def _setroot(self, _Element root not None):             # <<<<<<<<<<<<<<
39403  *         u"""_setroot(self, root)
39404  * 
39405  */
39406
39407 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree__setroot(PyObject *__pyx_v_self, PyObject *__pyx_v_root); /*proto*/
39408 static char __pyx_doc_4lxml_5etree_12_ElementTree__setroot[] = "_setroot(self, root)\n\n        Relocate the ElementTree to a new root node.\n        ";
39409 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree__setroot(PyObject *__pyx_v_self, PyObject *__pyx_v_root) {
39410   PyObject *__pyx_r = NULL;
39411   int __pyx_t_1;
39412   __Pyx_SetupRefcountContext("_setroot");
39413   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_root), __pyx_ptype_4lxml_5etree__Element, 0, "root", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
39414
39415   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1574
39416  *         Relocate the ElementTree to a new root node.
39417  *         """
39418  *         if root._c_node.type != tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
39419  *             raise TypeError, u"Only elements can be the root of an ElementTree"
39420  *         self._context_node = root
39421  */
39422   __pyx_t_1 = (((struct LxmlElement *)__pyx_v_root)->_c_node->type != XML_ELEMENT_NODE);
39423   if (__pyx_t_1) {
39424
39425     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1575
39426  *         """
39427  *         if root._c_node.type != tree.XML_ELEMENT_NODE:
39428  *             raise TypeError, u"Only elements can be the root of an ElementTree"             # <<<<<<<<<<<<<<
39429  *         self._context_node = root
39430  *         self._doc = None
39431  */
39432     __Pyx_Raise(__pyx_builtin_TypeError, ((PyObject *)__pyx_kp_348), 0);
39433     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
39434     goto __pyx_L5;
39435   }
39436   __pyx_L5:;
39437
39438   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1576
39439  *         if root._c_node.type != tree.XML_ELEMENT_NODE:
39440  *             raise TypeError, u"Only elements can be the root of an ElementTree"
39441  *         self._context_node = root             # <<<<<<<<<<<<<<
39442  *         self._doc = None
39443  * 
39444  */
39445   __Pyx_INCREF(__pyx_v_root);
39446   __Pyx_GIVEREF(__pyx_v_root);
39447   __Pyx_GOTREF(((struct LxmlElementTree *)__pyx_v_self)->_context_node);
39448   __Pyx_DECREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node));
39449   ((struct LxmlElementTree *)__pyx_v_self)->_context_node = ((struct LxmlElement *)__pyx_v_root);
39450
39451   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1577
39452  *             raise TypeError, u"Only elements can be the root of an ElementTree"
39453  *         self._context_node = root
39454  *         self._doc = None             # <<<<<<<<<<<<<<
39455  * 
39456  *     def getroot(self):
39457  */
39458   __Pyx_INCREF(Py_None);
39459   __Pyx_GIVEREF(Py_None);
39460   __Pyx_GOTREF(((struct LxmlElementTree *)__pyx_v_self)->_doc);
39461   __Pyx_DECREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_doc));
39462   ((struct LxmlElementTree *)__pyx_v_self)->_doc = ((struct LxmlDocument *)Py_None);
39463
39464   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
39465   goto __pyx_L0;
39466   __pyx_L1_error:;
39467   __Pyx_AddTraceback("lxml.etree._ElementTree._setroot");
39468   __pyx_r = NULL;
39469   __pyx_L0:;
39470   __Pyx_XGIVEREF(__pyx_r);
39471   __Pyx_FinishRefcountContext();
39472   return __pyx_r;
39473 }
39474
39475 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1579
39476  *         self._doc = None
39477  * 
39478  *     def getroot(self):             # <<<<<<<<<<<<<<
39479  *         u"""getroot(self)
39480  * 
39481  */
39482
39483 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_getroot(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
39484 static char __pyx_doc_4lxml_5etree_12_ElementTree_getroot[] = "getroot(self)\n\n        Gets the root element for this tree.\n        ";
39485 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_getroot(PyObject *__pyx_v_self, PyObject *unused) {
39486   PyObject *__pyx_r = NULL;
39487   __Pyx_SetupRefcountContext("getroot");
39488
39489   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1584
39490  *         Gets the root element for this tree.
39491  *         """
39492  *         return self._context_node             # <<<<<<<<<<<<<<
39493  * 
39494  *     def __copy__(self):
39495  */
39496   __Pyx_XDECREF(__pyx_r);
39497   __Pyx_INCREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node));
39498   __pyx_r = ((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node);
39499   goto __pyx_L0;
39500
39501   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
39502   __pyx_L0:;
39503   __Pyx_XGIVEREF(__pyx_r);
39504   __Pyx_FinishRefcountContext();
39505   return __pyx_r;
39506 }
39507
39508 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1586
39509  *         return self._context_node
39510  * 
39511  *     def __copy__(self):             # <<<<<<<<<<<<<<
39512  *         return _elementTreeFactory(self._doc, self._context_node)
39513  * 
39514  */
39515
39516 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree___copy__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
39517 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree___copy__(PyObject *__pyx_v_self, PyObject *unused) {
39518   PyObject *__pyx_r = NULL;
39519   PyObject *__pyx_t_1 = NULL;
39520   __Pyx_SetupRefcountContext("__copy__");
39521
39522   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1587
39523  * 
39524  *     def __copy__(self):
39525  *         return _elementTreeFactory(self._doc, self._context_node)             # <<<<<<<<<<<<<<
39526  * 
39527  *     def __deepcopy__(self, memo):
39528  */
39529   __Pyx_XDECREF(__pyx_r);
39530   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(((struct LxmlElementTree *)__pyx_v_self)->_doc, ((struct LxmlElementTree *)__pyx_v_self)->_context_node)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
39531   __Pyx_GOTREF(__pyx_t_1);
39532   __pyx_r = __pyx_t_1;
39533   __pyx_t_1 = 0;
39534   goto __pyx_L0;
39535
39536   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
39537   goto __pyx_L0;
39538   __pyx_L1_error:;
39539   __Pyx_XDECREF(__pyx_t_1);
39540   __Pyx_AddTraceback("lxml.etree._ElementTree.__copy__");
39541   __pyx_r = NULL;
39542   __pyx_L0:;
39543   __Pyx_XGIVEREF(__pyx_r);
39544   __Pyx_FinishRefcountContext();
39545   return __pyx_r;
39546 }
39547
39548 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1589
39549  *         return _elementTreeFactory(self._doc, self._context_node)
39550  * 
39551  *     def __deepcopy__(self, memo):             # <<<<<<<<<<<<<<
39552  *         cdef _Element root
39553  *         cdef _Document doc
39554  */
39555
39556 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree___deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo); /*proto*/
39557 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree___deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo) {
39558   struct LxmlElement *__pyx_v_root;
39559   struct LxmlDocument *__pyx_v_doc;
39560   xmlDoc *__pyx_v_c_doc;
39561   PyObject *__pyx_r = NULL;
39562   int __pyx_t_1;
39563   PyObject *__pyx_t_2 = NULL;
39564   PyObject *__pyx_t_3 = NULL;
39565   int __pyx_t_4;
39566   __Pyx_SetupRefcountContext("__deepcopy__");
39567   __pyx_v_root = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
39568   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
39569
39570   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1593
39571  *         cdef _Document doc
39572  *         cdef xmlDoc* c_doc
39573  *         if self._context_node is not None:             # <<<<<<<<<<<<<<
39574  *             root = self._context_node.__copy__()
39575  *             _copyNonElementSiblings(self._context_node._c_node, root._c_node)
39576  */
39577   __pyx_t_1 = (((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node) != Py_None);
39578   if (__pyx_t_1) {
39579
39580     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1594
39581  *         cdef xmlDoc* c_doc
39582  *         if self._context_node is not None:
39583  *             root = self._context_node.__copy__()             # <<<<<<<<<<<<<<
39584  *             _copyNonElementSiblings(self._context_node._c_node, root._c_node)
39585  *             doc = root._doc
39586  */
39587     __pyx_t_2 = PyObject_GetAttr(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node), __pyx_kp___copy__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
39588     __Pyx_GOTREF(__pyx_t_2);
39589     __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
39590     __Pyx_GOTREF(__pyx_t_3);
39591     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
39592     if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
39593     __Pyx_DECREF(((PyObject *)__pyx_v_root));
39594     __pyx_v_root = ((struct LxmlElement *)__pyx_t_3);
39595     __pyx_t_3 = 0;
39596
39597     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1595
39598  *         if self._context_node is not None:
39599  *             root = self._context_node.__copy__()
39600  *             _copyNonElementSiblings(self._context_node._c_node, root._c_node)             # <<<<<<<<<<<<<<
39601  *             doc = root._doc
39602  *             c_doc = self._context_node._doc._c_doc
39603  */
39604     __pyx_t_4 = __pyx_f_4lxml_5etree__copyNonElementSiblings(((struct LxmlElementTree *)__pyx_v_self)->_context_node->_c_node, __pyx_v_root->_c_node); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
39605
39606     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1596
39607  *             root = self._context_node.__copy__()
39608  *             _copyNonElementSiblings(self._context_node._c_node, root._c_node)
39609  *             doc = root._doc             # <<<<<<<<<<<<<<
39610  *             c_doc = self._context_node._doc._c_doc
39611  *             if c_doc.intSubset and not doc._c_doc.intSubset:
39612  */
39613     __Pyx_INCREF(((PyObject *)__pyx_v_root->_doc));
39614     __Pyx_DECREF(((PyObject *)__pyx_v_doc));
39615     __pyx_v_doc = __pyx_v_root->_doc;
39616
39617     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1597
39618  *             _copyNonElementSiblings(self._context_node._c_node, root._c_node)
39619  *             doc = root._doc
39620  *             c_doc = self._context_node._doc._c_doc             # <<<<<<<<<<<<<<
39621  *             if c_doc.intSubset and not doc._c_doc.intSubset:
39622  *                 doc._c_doc.intSubset = tree.xmlCopyDtd(c_doc.intSubset)
39623  */
39624     __pyx_v_c_doc = ((struct LxmlElementTree *)__pyx_v_self)->_context_node->_doc->_c_doc;
39625
39626     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1598
39627  *             doc = root._doc
39628  *             c_doc = self._context_node._doc._c_doc
39629  *             if c_doc.intSubset and not doc._c_doc.intSubset:             # <<<<<<<<<<<<<<
39630  *                 doc._c_doc.intSubset = tree.xmlCopyDtd(c_doc.intSubset)
39631  *                 if doc._c_doc.intSubset is NULL:
39632  */
39633     if ((__pyx_v_c_doc->intSubset != 0)) {
39634       __pyx_t_1 = (!(__pyx_v_doc->_c_doc->intSubset != 0));
39635     } else {
39636       __pyx_t_1 = (__pyx_v_c_doc->intSubset != 0);
39637     }
39638     if (__pyx_t_1) {
39639
39640       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1599
39641  *             c_doc = self._context_node._doc._c_doc
39642  *             if c_doc.intSubset and not doc._c_doc.intSubset:
39643  *                 doc._c_doc.intSubset = tree.xmlCopyDtd(c_doc.intSubset)             # <<<<<<<<<<<<<<
39644  *                 if doc._c_doc.intSubset is NULL:
39645  *                     python.PyErr_NoMemory()
39646  */
39647       __pyx_v_doc->_c_doc->intSubset = xmlCopyDtd(__pyx_v_c_doc->intSubset);
39648
39649       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1600
39650  *             if c_doc.intSubset and not doc._c_doc.intSubset:
39651  *                 doc._c_doc.intSubset = tree.xmlCopyDtd(c_doc.intSubset)
39652  *                 if doc._c_doc.intSubset is NULL:             # <<<<<<<<<<<<<<
39653  *                     python.PyErr_NoMemory()
39654  *             if c_doc.extSubset and not doc._c_doc.extSubset:
39655  */
39656       __pyx_t_1 = (__pyx_v_doc->_c_doc->intSubset == NULL);
39657       if (__pyx_t_1) {
39658
39659         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1601
39660  *                 doc._c_doc.intSubset = tree.xmlCopyDtd(c_doc.intSubset)
39661  *                 if doc._c_doc.intSubset is NULL:
39662  *                     python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
39663  *             if c_doc.extSubset and not doc._c_doc.extSubset:
39664  *                 doc._c_doc.extSubset = tree.xmlCopyDtd(c_doc.extSubset)
39665  */
39666         __pyx_t_3 = PyErr_NoMemory(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
39667         __Pyx_GOTREF(__pyx_t_3);
39668         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
39669         goto __pyx_L7;
39670       }
39671       __pyx_L7:;
39672       goto __pyx_L6;
39673     }
39674     __pyx_L6:;
39675
39676     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1602
39677  *                 if doc._c_doc.intSubset is NULL:
39678  *                     python.PyErr_NoMemory()
39679  *             if c_doc.extSubset and not doc._c_doc.extSubset:             # <<<<<<<<<<<<<<
39680  *                 doc._c_doc.extSubset = tree.xmlCopyDtd(c_doc.extSubset)
39681  *                 if doc._c_doc.extSubset is NULL:
39682  */
39683     if ((__pyx_v_c_doc->extSubset != 0)) {
39684       __pyx_t_1 = (!(__pyx_v_doc->_c_doc->extSubset != 0));
39685     } else {
39686       __pyx_t_1 = (__pyx_v_c_doc->extSubset != 0);
39687     }
39688     if (__pyx_t_1) {
39689
39690       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1603
39691  *                     python.PyErr_NoMemory()
39692  *             if c_doc.extSubset and not doc._c_doc.extSubset:
39693  *                 doc._c_doc.extSubset = tree.xmlCopyDtd(c_doc.extSubset)             # <<<<<<<<<<<<<<
39694  *                 if doc._c_doc.extSubset is NULL:
39695  *                     python.PyErr_NoMemory()
39696  */
39697       __pyx_v_doc->_c_doc->extSubset = xmlCopyDtd(__pyx_v_c_doc->extSubset);
39698
39699       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1604
39700  *             if c_doc.extSubset and not doc._c_doc.extSubset:
39701  *                 doc._c_doc.extSubset = tree.xmlCopyDtd(c_doc.extSubset)
39702  *                 if doc._c_doc.extSubset is NULL:             # <<<<<<<<<<<<<<
39703  *                     python.PyErr_NoMemory()
39704  *             return _elementTreeFactory(None, root)
39705  */
39706       __pyx_t_1 = (__pyx_v_doc->_c_doc->extSubset == NULL);
39707       if (__pyx_t_1) {
39708
39709         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1605
39710  *                 doc._c_doc.extSubset = tree.xmlCopyDtd(c_doc.extSubset)
39711  *                 if doc._c_doc.extSubset is NULL:
39712  *                     python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
39713  *             return _elementTreeFactory(None, root)
39714  *         elif self._doc is not None:
39715  */
39716         __pyx_t_3 = PyErr_NoMemory(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
39717         __Pyx_GOTREF(__pyx_t_3);
39718         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
39719         goto __pyx_L9;
39720       }
39721       __pyx_L9:;
39722       goto __pyx_L8;
39723     }
39724     __pyx_L8:;
39725
39726     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1606
39727  *                 if doc._c_doc.extSubset is NULL:
39728  *                     python.PyErr_NoMemory()
39729  *             return _elementTreeFactory(None, root)             # <<<<<<<<<<<<<<
39730  *         elif self._doc is not None:
39731  *             c_doc = tree.xmlCopyDoc(self._doc._c_doc, 1)
39732  */
39733     __Pyx_XDECREF(__pyx_r);
39734     __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(((struct LxmlDocument *)Py_None), __pyx_v_root)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
39735     __Pyx_GOTREF(__pyx_t_3);
39736     __pyx_r = __pyx_t_3;
39737     __pyx_t_3 = 0;
39738     goto __pyx_L0;
39739     goto __pyx_L5;
39740   }
39741
39742   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1607
39743  *                     python.PyErr_NoMemory()
39744  *             return _elementTreeFactory(None, root)
39745  *         elif self._doc is not None:             # <<<<<<<<<<<<<<
39746  *             c_doc = tree.xmlCopyDoc(self._doc._c_doc, 1)
39747  *             if c_doc is NULL:
39748  */
39749   __pyx_t_1 = (((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_doc) != Py_None);
39750   if (__pyx_t_1) {
39751
39752     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1608
39753  *             return _elementTreeFactory(None, root)
39754  *         elif self._doc is not None:
39755  *             c_doc = tree.xmlCopyDoc(self._doc._c_doc, 1)             # <<<<<<<<<<<<<<
39756  *             if c_doc is NULL:
39757  *                 python.PyErr_NoMemory()
39758  */
39759     __pyx_v_c_doc = xmlCopyDoc(((struct LxmlElementTree *)__pyx_v_self)->_doc->_c_doc, 1);
39760
39761     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1609
39762  *         elif self._doc is not None:
39763  *             c_doc = tree.xmlCopyDoc(self._doc._c_doc, 1)
39764  *             if c_doc is NULL:             # <<<<<<<<<<<<<<
39765  *                 python.PyErr_NoMemory()
39766  *             doc = _documentFactory(c_doc, self._doc._parser)
39767  */
39768     __pyx_t_1 = (__pyx_v_c_doc == NULL);
39769     if (__pyx_t_1) {
39770
39771       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1610
39772  *             c_doc = tree.xmlCopyDoc(self._doc._c_doc, 1)
39773  *             if c_doc is NULL:
39774  *                 python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
39775  *             doc = _documentFactory(c_doc, self._doc._parser)
39776  *             return _elementTreeFactory(doc, None)
39777  */
39778       __pyx_t_3 = PyErr_NoMemory(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
39779       __Pyx_GOTREF(__pyx_t_3);
39780       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
39781       goto __pyx_L10;
39782     }
39783     __pyx_L10:;
39784
39785     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1611
39786  *             if c_doc is NULL:
39787  *                 python.PyErr_NoMemory()
39788  *             doc = _documentFactory(c_doc, self._doc._parser)             # <<<<<<<<<<<<<<
39789  *             return _elementTreeFactory(doc, None)
39790  *         else:
39791  */
39792     __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, ((struct LxmlElementTree *)__pyx_v_self)->_doc->_parser)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
39793     __Pyx_GOTREF(__pyx_t_3);
39794     __Pyx_DECREF(((PyObject *)__pyx_v_doc));
39795     __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_3);
39796     __pyx_t_3 = 0;
39797
39798     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1612
39799  *                 python.PyErr_NoMemory()
39800  *             doc = _documentFactory(c_doc, self._doc._parser)
39801  *             return _elementTreeFactory(doc, None)             # <<<<<<<<<<<<<<
39802  *         else:
39803  *             # so what ...
39804  */
39805     __Pyx_XDECREF(__pyx_r);
39806     __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(__pyx_v_doc, ((struct LxmlElement *)Py_None))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
39807     __Pyx_GOTREF(__pyx_t_3);
39808     __pyx_r = __pyx_t_3;
39809     __pyx_t_3 = 0;
39810     goto __pyx_L0;
39811     goto __pyx_L5;
39812   }
39813   /*else*/ {
39814
39815     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1615
39816  *         else:
39817  *             # so what ...
39818  *             return self             # <<<<<<<<<<<<<<
39819  * 
39820  *     # not in ElementTree, read-only
39821  */
39822     __Pyx_XDECREF(__pyx_r);
39823     __Pyx_INCREF(__pyx_v_self);
39824     __pyx_r = __pyx_v_self;
39825     goto __pyx_L0;
39826   }
39827   __pyx_L5:;
39828
39829   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
39830   goto __pyx_L0;
39831   __pyx_L1_error:;
39832   __Pyx_XDECREF(__pyx_t_2);
39833   __Pyx_XDECREF(__pyx_t_3);
39834   __Pyx_AddTraceback("lxml.etree._ElementTree.__deepcopy__");
39835   __pyx_r = NULL;
39836   __pyx_L0:;
39837   __Pyx_DECREF((PyObject *)__pyx_v_root);
39838   __Pyx_DECREF((PyObject *)__pyx_v_doc);
39839   __Pyx_XGIVEREF(__pyx_r);
39840   __Pyx_FinishRefcountContext();
39841   return __pyx_r;
39842 }
39843
39844 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1624
39845  *         not for trees that were built manually.
39846  *         """
39847  *         def __get__(self):             # <<<<<<<<<<<<<<
39848  *             self._assertHasRoot()
39849  *             return DocInfo(self._context_node._doc)
39850  */
39851
39852 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_7docinfo___get__(PyObject *__pyx_v_self); /*proto*/
39853 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_7docinfo___get__(PyObject *__pyx_v_self) {
39854   PyObject *__pyx_r = NULL;
39855   PyObject *__pyx_t_1 = NULL;
39856   PyObject *__pyx_t_2 = NULL;
39857   __Pyx_SetupRefcountContext("__get__");
39858
39859   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1625
39860  *         """
39861  *         def __get__(self):
39862  *             self._assertHasRoot()             # <<<<<<<<<<<<<<
39863  *             return DocInfo(self._context_node._doc)
39864  * 
39865  */
39866   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
39867   __Pyx_GOTREF(__pyx_t_1);
39868   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
39869
39870   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1626
39871  *         def __get__(self):
39872  *             self._assertHasRoot()
39873  *             return DocInfo(self._context_node._doc)             # <<<<<<<<<<<<<<
39874  * 
39875  *     # not in ElementTree, read-only
39876  */
39877   __Pyx_XDECREF(__pyx_r);
39878   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
39879   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
39880   __Pyx_INCREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node->_doc));
39881   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node->_doc));
39882   __Pyx_GIVEREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node->_doc));
39883   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_DocInfo)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
39884   __Pyx_GOTREF(__pyx_t_2);
39885   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
39886   __pyx_r = __pyx_t_2;
39887   __pyx_t_2 = 0;
39888   goto __pyx_L0;
39889
39890   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
39891   goto __pyx_L0;
39892   __pyx_L1_error:;
39893   __Pyx_XDECREF(__pyx_t_1);
39894   __Pyx_XDECREF(__pyx_t_2);
39895   __Pyx_AddTraceback("lxml.etree._ElementTree.docinfo.__get__");
39896   __pyx_r = NULL;
39897   __pyx_L0:;
39898   __Pyx_XGIVEREF(__pyx_r);
39899   __Pyx_FinishRefcountContext();
39900   return __pyx_r;
39901 }
39902
39903 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1632
39904  *         u"""The parser that was used to parse the document in this ElementTree.
39905  *         """
39906  *         def __get__(self):             # <<<<<<<<<<<<<<
39907  *             if self._context_node is not None and \
39908  *                    self._context_node._doc is not None:
39909  */
39910
39911 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_6parser___get__(PyObject *__pyx_v_self); /*proto*/
39912 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_6parser___get__(PyObject *__pyx_v_self) {
39913   PyObject *__pyx_r = NULL;
39914   int __pyx_t_1;
39915   int __pyx_t_2;
39916   int __pyx_t_3;
39917   __Pyx_SetupRefcountContext("__get__");
39918
39919   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1633
39920  *         """
39921  *         def __get__(self):
39922  *             if self._context_node is not None and \             # <<<<<<<<<<<<<<
39923  *                    self._context_node._doc is not None:
39924  *                 return self._context_node._doc._parser
39925  */
39926   __pyx_t_1 = (((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node) != Py_None);
39927   if (__pyx_t_1) {
39928
39929     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1634
39930  *         def __get__(self):
39931  *             if self._context_node is not None and \
39932  *                    self._context_node._doc is not None:             # <<<<<<<<<<<<<<
39933  *                 return self._context_node._doc._parser
39934  *             if self._doc is not None:
39935  */
39936     __pyx_t_2 = (((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node->_doc) != Py_None);
39937     __pyx_t_3 = __pyx_t_2;
39938   } else {
39939     __pyx_t_3 = __pyx_t_1;
39940   }
39941   if (__pyx_t_3) {
39942
39943     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1635
39944  *             if self._context_node is not None and \
39945  *                    self._context_node._doc is not None:
39946  *                 return self._context_node._doc._parser             # <<<<<<<<<<<<<<
39947  *             if self._doc is not None:
39948  *                 return self._doc._parser
39949  */
39950     __Pyx_XDECREF(__pyx_r);
39951     __Pyx_INCREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node->_doc->_parser));
39952     __pyx_r = ((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node->_doc->_parser);
39953     goto __pyx_L0;
39954     goto __pyx_L5;
39955   }
39956   __pyx_L5:;
39957
39958   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1636
39959  *                    self._context_node._doc is not None:
39960  *                 return self._context_node._doc._parser
39961  *             if self._doc is not None:             # <<<<<<<<<<<<<<
39962  *                 return self._doc._parser
39963  *             return None
39964  */
39965   __pyx_t_3 = (((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_doc) != Py_None);
39966   if (__pyx_t_3) {
39967
39968     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1637
39969  *                 return self._context_node._doc._parser
39970  *             if self._doc is not None:
39971  *                 return self._doc._parser             # <<<<<<<<<<<<<<
39972  *             return None
39973  * 
39974  */
39975     __Pyx_XDECREF(__pyx_r);
39976     __Pyx_INCREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_doc->_parser));
39977     __pyx_r = ((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_doc->_parser);
39978     goto __pyx_L0;
39979     goto __pyx_L6;
39980   }
39981   __pyx_L6:;
39982
39983   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1638
39984  *             if self._doc is not None:
39985  *                 return self._doc._parser
39986  *             return None             # <<<<<<<<<<<<<<
39987  * 
39988  *     def write(self, file, *, encoding=None, method=u"xml",
39989  */
39990   __Pyx_XDECREF(__pyx_r);
39991   __Pyx_INCREF(Py_None);
39992   __pyx_r = Py_None;
39993   goto __pyx_L0;
39994
39995   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
39996   __pyx_L0:;
39997   __Pyx_XGIVEREF(__pyx_r);
39998   __Pyx_FinishRefcountContext();
39999   return __pyx_r;
40000 }
40001
40002 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1640
40003  *             return None
40004  * 
40005  *     def write(self, file, *, encoding=None, method=u"xml",             # <<<<<<<<<<<<<<
40006  *               pretty_print=False, xml_declaration=None, with_tail=True,
40007  *               standalone=None, compression=0):
40008  */
40009
40010 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_write(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
40011 static char __pyx_doc_4lxml_5etree_12_ElementTree_write[] = "write(self, file, encoding=None, method=\"xml\",\n                  pretty_print=False, xml_declaration=None, with_tail=True,\n                  standalone=None, compression=0)\n\n        Write the tree to a filename, file or file-like object.\n\n        Defaults to ASCII encoding and writing a declaration as needed.\n\n        The keyword argument 'method' selects the output method: 'xml' or\n        'html'.\n\n        Passing a boolean value to the ``standalone`` option will\n        output an XML declaration with the corresponding\n        ``standalone`` flag.\n\n        The ``compression`` option enables GZip compression level 1-9.\n        ";
40012 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_write(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
40013   PyObject *__pyx_v_file = 0;
40014   PyObject *__pyx_v_encoding = 0;
40015   PyObject *__pyx_v_method = 0;
40016   PyObject *__pyx_v_pretty_print = 0;
40017   PyObject *__pyx_v_xml_declaration = 0;
40018   PyObject *__pyx_v_with_tail = 0;
40019   PyObject *__pyx_v_standalone = 0;
40020   PyObject *__pyx_v_compression = 0;
40021   int __pyx_v_write_declaration;
40022   int __pyx_v_is_standalone;
40023   PyObject *__pyx_r = NULL;
40024   PyObject *__pyx_t_1 = NULL;
40025   int __pyx_t_2;
40026   PyObject *__pyx_t_3 = NULL;
40027   int __pyx_t_4;
40028   int __pyx_t_5;
40029   int __pyx_t_6;
40030   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_file,&__pyx_kp_encoding,&__pyx_kp_method,&__pyx_kp_pretty_print,&__pyx_kp_xml_declaration,&__pyx_kp_with_tail,&__pyx_kp_standalone,&__pyx_kp_compression,0};
40031   __Pyx_SetupRefcountContext("write");
40032   if (unlikely(__pyx_kwds)) {
40033     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
40034     PyObject* values[8] = {0,0,0,0,0,0,0,0};
40035     values[1] = Py_None;
40036     values[2] = ((PyObject *)__pyx_kp_91);
40037     values[3] = __pyx_k_92;
40038     values[4] = Py_None;
40039     values[5] = __pyx_k_93;
40040     values[6] = Py_None;
40041     values[7] = __pyx_int_0;
40042     switch (PyTuple_GET_SIZE(__pyx_args)) {
40043       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
40044       case  0: break;
40045       default: goto __pyx_L5_argtuple_error;
40046     }
40047     switch (PyTuple_GET_SIZE(__pyx_args)) {
40048       case  0:
40049       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_file);
40050       if (likely(values[0])) kw_args--;
40051       else goto __pyx_L5_argtuple_error;
40052     }
40053     while (kw_args > 0) {
40054       PyObject* value;
40055       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_encoding);
40056       if (value) { values[1] = value; if (!(--kw_args)) break; }
40057       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_method);
40058       if (value) { values[2] = value; if (!(--kw_args)) break; }
40059       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_pretty_print);
40060       if (value) { values[3] = value; if (!(--kw_args)) break; }
40061       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_xml_declaration);
40062       if (value) { values[4] = value; if (!(--kw_args)) break; }
40063       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_with_tail);
40064       if (value) { values[5] = value; if (!(--kw_args)) break; }
40065       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_standalone);
40066       if (value) { values[6] = value; if (!(--kw_args)) break; }
40067       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_compression);
40068       if (value) { values[7] = value; if (!(--kw_args)) break; }
40069       break;
40070     }
40071     if (unlikely(kw_args > 0)) {
40072       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "write") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1640; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
40073     }
40074     __pyx_v_file = values[0];
40075     __pyx_v_encoding = values[1];
40076     __pyx_v_method = values[2];
40077     __pyx_v_pretty_print = values[3];
40078     __pyx_v_xml_declaration = values[4];
40079     __pyx_v_with_tail = values[5];
40080     __pyx_v_standalone = values[6];
40081     __pyx_v_compression = values[7];
40082   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
40083     goto __pyx_L5_argtuple_error;
40084   } else {
40085     __pyx_v_file = PyTuple_GET_ITEM(__pyx_args, 0);
40086     __pyx_v_encoding = Py_None;
40087     __pyx_v_method = ((PyObject *)__pyx_kp_91);
40088     __pyx_v_pretty_print = __pyx_k_92;
40089     __pyx_v_xml_declaration = Py_None;
40090     __pyx_v_with_tail = __pyx_k_93;
40091     __pyx_v_standalone = Py_None;
40092     __pyx_v_compression = __pyx_int_0;
40093   }
40094   goto __pyx_L4_argument_unpacking_done;
40095   __pyx_L5_argtuple_error:;
40096   __Pyx_RaiseArgtupleInvalid("write", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1640; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
40097   __pyx_L3_error:;
40098   __Pyx_AddTraceback("lxml.etree._ElementTree.write");
40099   return NULL;
40100   __pyx_L4_argument_unpacking_done:;
40101   __Pyx_INCREF(__pyx_v_encoding);
40102   __Pyx_INCREF(__pyx_v_compression);
40103
40104   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1662
40105  *         cdef bint write_declaration
40106  *         cdef int is_standalone
40107  *         self._assertHasRoot()             # <<<<<<<<<<<<<<
40108  *         # suppress decl. in default case (purely for ElementTree compatibility)
40109  *         if xml_declaration is not None:
40110  */
40111   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40112   __Pyx_GOTREF(__pyx_t_1);
40113   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
40114
40115   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1664
40116  *         self._assertHasRoot()
40117  *         # suppress decl. in default case (purely for ElementTree compatibility)
40118  *         if xml_declaration is not None:             # <<<<<<<<<<<<<<
40119  *             write_declaration = xml_declaration
40120  *             if encoding is None:
40121  */
40122   __pyx_t_2 = (__pyx_v_xml_declaration != Py_None);
40123   if (__pyx_t_2) {
40124
40125     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1665
40126  *         # suppress decl. in default case (purely for ElementTree compatibility)
40127  *         if xml_declaration is not None:
40128  *             write_declaration = xml_declaration             # <<<<<<<<<<<<<<
40129  *             if encoding is None:
40130  *                 encoding = u'ASCII'
40131  */
40132     __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_xml_declaration); if (unlikely((__pyx_t_2 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40133     __pyx_v_write_declaration = __pyx_t_2;
40134
40135     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1666
40136  *         if xml_declaration is not None:
40137  *             write_declaration = xml_declaration
40138  *             if encoding is None:             # <<<<<<<<<<<<<<
40139  *                 encoding = u'ASCII'
40140  *         elif encoding is None:
40141  */
40142     __pyx_t_2 = (__pyx_v_encoding == Py_None);
40143     if (__pyx_t_2) {
40144
40145       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1667
40146  *             write_declaration = xml_declaration
40147  *             if encoding is None:
40148  *                 encoding = u'ASCII'             # <<<<<<<<<<<<<<
40149  *         elif encoding is None:
40150  *             encoding = u'ASCII'
40151  */
40152       __Pyx_INCREF(((PyObject *)__pyx_kp_349));
40153       __Pyx_DECREF(__pyx_v_encoding);
40154       __pyx_v_encoding = ((PyObject *)__pyx_kp_349);
40155       goto __pyx_L7;
40156     }
40157     __pyx_L7:;
40158     goto __pyx_L6;
40159   }
40160
40161   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1668
40162  *             if encoding is None:
40163  *                 encoding = u'ASCII'
40164  *         elif encoding is None:             # <<<<<<<<<<<<<<
40165  *             encoding = u'ASCII'
40166  *             write_declaration = 0
40167  */
40168   __pyx_t_2 = (__pyx_v_encoding == Py_None);
40169   if (__pyx_t_2) {
40170
40171     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1669
40172  *                 encoding = u'ASCII'
40173  *         elif encoding is None:
40174  *             encoding = u'ASCII'             # <<<<<<<<<<<<<<
40175  *             write_declaration = 0
40176  *         else:
40177  */
40178     __Pyx_INCREF(((PyObject *)__pyx_kp_350));
40179     __Pyx_DECREF(__pyx_v_encoding);
40180     __pyx_v_encoding = ((PyObject *)__pyx_kp_350);
40181
40182     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1670
40183  *         elif encoding is None:
40184  *             encoding = u'ASCII'
40185  *             write_declaration = 0             # <<<<<<<<<<<<<<
40186  *         else:
40187  *             encoding = encoding.upper()
40188  */
40189     __pyx_v_write_declaration = 0;
40190     goto __pyx_L6;
40191   }
40192   /*else*/ {
40193
40194     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1672
40195  *             write_declaration = 0
40196  *         else:
40197  *             encoding = encoding.upper()             # <<<<<<<<<<<<<<
40198  *             write_declaration = encoding not in \
40199  *                                   (u'US-ASCII', u'ASCII', u'UTF8', u'UTF-8')
40200  */
40201     __pyx_t_1 = PyObject_GetAttr(__pyx_v_encoding, __pyx_kp_upper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40202     __Pyx_GOTREF(__pyx_t_1);
40203     __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40204     __Pyx_GOTREF(__pyx_t_3);
40205     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
40206     __Pyx_DECREF(__pyx_v_encoding);
40207     __pyx_v_encoding = __pyx_t_3;
40208     __pyx_t_3 = 0;
40209
40210     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1673
40211  *         else:
40212  *             encoding = encoding.upper()
40213  *             write_declaration = encoding not in \             # <<<<<<<<<<<<<<
40214  *                                   (u'US-ASCII', u'ASCII', u'UTF8', u'UTF-8')
40215  *         if standalone is None:
40216  */
40217     __Pyx_INCREF(__pyx_v_encoding);
40218     __pyx_t_3 = __pyx_v_encoding;
40219
40220     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1674
40221  *             encoding = encoding.upper()
40222  *             write_declaration = encoding not in \
40223  *                                   (u'US-ASCII', u'ASCII', u'UTF8', u'UTF-8')             # <<<<<<<<<<<<<<
40224  *         if standalone is None:
40225  *             is_standalone = -1
40226  */
40227     __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_kp_351), Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40228     __Pyx_GOTREF(__pyx_t_1);
40229     __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40230     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
40231     if (((int)__pyx_t_2)) {
40232
40233       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1673
40234  *         else:
40235  *             encoding = encoding.upper()
40236  *             write_declaration = encoding not in \             # <<<<<<<<<<<<<<
40237  *                                   (u'US-ASCII', u'ASCII', u'UTF8', u'UTF-8')
40238  *         if standalone is None:
40239  */
40240       __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_kp_352), Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40241       __Pyx_GOTREF(__pyx_t_1);
40242       __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40243       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
40244       __pyx_t_5 = ((int)__pyx_t_4);
40245     } else {
40246       __pyx_t_5 = ((int)__pyx_t_2);
40247     }
40248     if (__pyx_t_5) {
40249
40250       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1674
40251  *             encoding = encoding.upper()
40252  *             write_declaration = encoding not in \
40253  *                                   (u'US-ASCII', u'ASCII', u'UTF8', u'UTF-8')             # <<<<<<<<<<<<<<
40254  *         if standalone is None:
40255  *             is_standalone = -1
40256  */
40257       __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_kp_353), Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40258       __Pyx_GOTREF(__pyx_t_1);
40259       __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40260       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
40261       __pyx_t_4 = ((int)__pyx_t_2);
40262     } else {
40263       __pyx_t_4 = __pyx_t_5;
40264     }
40265     if (__pyx_t_4) {
40266
40267       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1673
40268  *         else:
40269  *             encoding = encoding.upper()
40270  *             write_declaration = encoding not in \             # <<<<<<<<<<<<<<
40271  *                                   (u'US-ASCII', u'ASCII', u'UTF8', u'UTF-8')
40272  *         if standalone is None:
40273  */
40274       __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_kp_354), Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40275       __Pyx_GOTREF(__pyx_t_1);
40276       __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40277       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
40278       __pyx_t_2 = ((int)__pyx_t_5);
40279     } else {
40280       __pyx_t_2 = __pyx_t_4;
40281     }
40282     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
40283     __pyx_v_write_declaration = __pyx_t_2;
40284   }
40285   __pyx_L6:;
40286
40287   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1675
40288  *             write_declaration = encoding not in \
40289  *                                   (u'US-ASCII', u'ASCII', u'UTF8', u'UTF-8')
40290  *         if standalone is None:             # <<<<<<<<<<<<<<
40291  *             is_standalone = -1
40292  *         elif standalone:
40293  */
40294   __pyx_t_2 = (__pyx_v_standalone == Py_None);
40295   if (__pyx_t_2) {
40296
40297     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1676
40298  *                                   (u'US-ASCII', u'ASCII', u'UTF8', u'UTF-8')
40299  *         if standalone is None:
40300  *             is_standalone = -1             # <<<<<<<<<<<<<<
40301  *         elif standalone:
40302  *             write_declaration = 1
40303  */
40304     __pyx_v_is_standalone = -1;
40305     goto __pyx_L8;
40306   }
40307
40308   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1677
40309  *         if standalone is None:
40310  *             is_standalone = -1
40311  *         elif standalone:             # <<<<<<<<<<<<<<
40312  *             write_declaration = 1
40313  *             is_standalone = 1
40314  */
40315   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_standalone); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40316   if (__pyx_t_2) {
40317
40318     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1678
40319  *             is_standalone = -1
40320  *         elif standalone:
40321  *             write_declaration = 1             # <<<<<<<<<<<<<<
40322  *             is_standalone = 1
40323  *         else:
40324  */
40325     __pyx_v_write_declaration = 1;
40326
40327     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1679
40328  *         elif standalone:
40329  *             write_declaration = 1
40330  *             is_standalone = 1             # <<<<<<<<<<<<<<
40331  *         else:
40332  *             write_declaration = 1
40333  */
40334     __pyx_v_is_standalone = 1;
40335     goto __pyx_L8;
40336   }
40337   /*else*/ {
40338
40339     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1681
40340  *             is_standalone = 1
40341  *         else:
40342  *             write_declaration = 1             # <<<<<<<<<<<<<<
40343  *             is_standalone = 0
40344  *         if compression is None or compression < 0:
40345  */
40346     __pyx_v_write_declaration = 1;
40347
40348     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1682
40349  *         else:
40350  *             write_declaration = 1
40351  *             is_standalone = 0             # <<<<<<<<<<<<<<
40352  *         if compression is None or compression < 0:
40353  *             compression = 0
40354  */
40355     __pyx_v_is_standalone = 0;
40356   }
40357   __pyx_L8:;
40358
40359   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1683
40360  *             write_declaration = 1
40361  *             is_standalone = 0
40362  *         if compression is None or compression < 0:             # <<<<<<<<<<<<<<
40363  *             compression = 0
40364  *         _tofilelike(file, self._context_node, encoding, method,
40365  */
40366   __pyx_t_2 = (__pyx_v_compression == Py_None);
40367   if (!__pyx_t_2) {
40368     __pyx_t_3 = PyObject_RichCompare(__pyx_v_compression, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40369     __Pyx_GOTREF(__pyx_t_3);
40370     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40371     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
40372     __pyx_t_5 = __pyx_t_4;
40373   } else {
40374     __pyx_t_5 = __pyx_t_2;
40375   }
40376   if (__pyx_t_5) {
40377
40378     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1684
40379  *             is_standalone = 0
40380  *         if compression is None or compression < 0:
40381  *             compression = 0             # <<<<<<<<<<<<<<
40382  *         _tofilelike(file, self._context_node, encoding, method,
40383  *                     write_declaration, 1, pretty_print, with_tail,
40384  */
40385     __Pyx_INCREF(__pyx_int_0);
40386     __Pyx_DECREF(__pyx_v_compression);
40387     __pyx_v_compression = __pyx_int_0;
40388     goto __pyx_L9;
40389   }
40390   __pyx_L9:;
40391
40392   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1686
40393  *             compression = 0
40394  *         _tofilelike(file, self._context_node, encoding, method,
40395  *                     write_declaration, 1, pretty_print, with_tail,             # <<<<<<<<<<<<<<
40396  *                     is_standalone, compression)
40397  * 
40398  */
40399   __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_pretty_print); if (unlikely((__pyx_t_5 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40400   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_with_tail); if (unlikely((__pyx_t_2 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40401
40402   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1687
40403  *         _tofilelike(file, self._context_node, encoding, method,
40404  *                     write_declaration, 1, pretty_print, with_tail,
40405  *                     is_standalone, compression)             # <<<<<<<<<<<<<<
40406  * 
40407  *     def getpath(self, _Element element not None):
40408  */
40409   __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_compression); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40410   __pyx_t_3 = __pyx_f_4lxml_5etree__tofilelike(__pyx_v_file, ((struct LxmlElementTree *)__pyx_v_self)->_context_node, __pyx_v_encoding, __pyx_v_method, __pyx_v_write_declaration, 1, __pyx_t_5, __pyx_t_2, __pyx_v_is_standalone, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40411   __Pyx_GOTREF(__pyx_t_3);
40412   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
40413
40414   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
40415   goto __pyx_L0;
40416   __pyx_L1_error:;
40417   __Pyx_XDECREF(__pyx_t_1);
40418   __Pyx_XDECREF(__pyx_t_3);
40419   __Pyx_AddTraceback("lxml.etree._ElementTree.write");
40420   __pyx_r = NULL;
40421   __pyx_L0:;
40422   __Pyx_DECREF(__pyx_v_encoding);
40423   __Pyx_DECREF(__pyx_v_compression);
40424   __Pyx_XGIVEREF(__pyx_r);
40425   __Pyx_FinishRefcountContext();
40426   return __pyx_r;
40427 }
40428
40429 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1689
40430  *                     is_standalone, compression)
40431  * 
40432  *     def getpath(self, _Element element not None):             # <<<<<<<<<<<<<<
40433  *         u"""getpath(self, element)
40434  * 
40435  */
40436
40437 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_getpath(PyObject *__pyx_v_self, PyObject *__pyx_v_element); /*proto*/
40438 static char __pyx_doc_4lxml_5etree_12_ElementTree_getpath[] = "getpath(self, element)\n\n        Returns a structural, absolute XPath expression to find that element.\n        ";
40439 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_getpath(PyObject *__pyx_v_self, PyObject *__pyx_v_element) {
40440   struct LxmlDocument *__pyx_v_doc;
40441   xmlDoc *__pyx_v_c_doc;
40442   char *__pyx_v_c_path;
40443   PyObject *__pyx_v_path;
40444   PyObject *__pyx_r = NULL;
40445   int __pyx_t_1;
40446   xmlDoc *__pyx_t_2;
40447   PyObject *__pyx_t_3 = NULL;
40448   __Pyx_SetupRefcountContext("getpath");
40449   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
40450   __pyx_v_path = Py_None; __Pyx_INCREF(Py_None);
40451   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40452
40453   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1697
40454  *         cdef xmlDoc* c_doc
40455  *         cdef char* c_path
40456  *         doc = self._context_node._doc             # <<<<<<<<<<<<<<
40457  *         if element._doc is not doc:
40458  *             raise ValueError, u"Element is not in this tree."
40459  */
40460   __Pyx_INCREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node->_doc));
40461   __Pyx_DECREF(((PyObject *)__pyx_v_doc));
40462   __pyx_v_doc = ((struct LxmlElementTree *)__pyx_v_self)->_context_node->_doc;
40463
40464   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1698
40465  *         cdef char* c_path
40466  *         doc = self._context_node._doc
40467  *         if element._doc is not doc:             # <<<<<<<<<<<<<<
40468  *             raise ValueError, u"Element is not in this tree."
40469  *         c_doc = _fakeRootDoc(doc._c_doc, self._context_node._c_node)
40470  */
40471   __pyx_t_1 = (((struct LxmlElement *)__pyx_v_element)->_doc != __pyx_v_doc);
40472   if (__pyx_t_1) {
40473
40474     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1699
40475  *         doc = self._context_node._doc
40476  *         if element._doc is not doc:
40477  *             raise ValueError, u"Element is not in this tree."             # <<<<<<<<<<<<<<
40478  *         c_doc = _fakeRootDoc(doc._c_doc, self._context_node._c_node)
40479  *         c_path = tree.xmlGetNodePath(element._c_node)
40480  */
40481     __Pyx_Raise(__pyx_builtin_ValueError, ((PyObject *)__pyx_kp_355), 0);
40482     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40483     goto __pyx_L5;
40484   }
40485   __pyx_L5:;
40486
40487   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1700
40488  *         if element._doc is not doc:
40489  *             raise ValueError, u"Element is not in this tree."
40490  *         c_doc = _fakeRootDoc(doc._c_doc, self._context_node._c_node)             # <<<<<<<<<<<<<<
40491  *         c_path = tree.xmlGetNodePath(element._c_node)
40492  *         _destroyFakeDoc(doc._c_doc, c_doc)
40493  */
40494   __pyx_t_2 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc, ((struct LxmlElementTree *)__pyx_v_self)->_context_node->_c_node); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40495   __pyx_v_c_doc = __pyx_t_2;
40496
40497   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1701
40498  *             raise ValueError, u"Element is not in this tree."
40499  *         c_doc = _fakeRootDoc(doc._c_doc, self._context_node._c_node)
40500  *         c_path = tree.xmlGetNodePath(element._c_node)             # <<<<<<<<<<<<<<
40501  *         _destroyFakeDoc(doc._c_doc, c_doc)
40502  *         if c_path is NULL:
40503  */
40504   __pyx_v_c_path = xmlGetNodePath(((struct LxmlElement *)__pyx_v_element)->_c_node);
40505
40506   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1702
40507  *         c_doc = _fakeRootDoc(doc._c_doc, self._context_node._c_node)
40508  *         c_path = tree.xmlGetNodePath(element._c_node)
40509  *         _destroyFakeDoc(doc._c_doc, c_doc)             # <<<<<<<<<<<<<<
40510  *         if c_path is NULL:
40511  *             python.PyErr_NoMemory()
40512  */
40513   __pyx_f_4lxml_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc, __pyx_v_c_doc);
40514
40515   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1703
40516  *         c_path = tree.xmlGetNodePath(element._c_node)
40517  *         _destroyFakeDoc(doc._c_doc, c_doc)
40518  *         if c_path is NULL:             # <<<<<<<<<<<<<<
40519  *             python.PyErr_NoMemory()
40520  *         path = funicode(c_path)
40521  */
40522   __pyx_t_1 = (__pyx_v_c_path == NULL);
40523   if (__pyx_t_1) {
40524
40525     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1704
40526  *         _destroyFakeDoc(doc._c_doc, c_doc)
40527  *         if c_path is NULL:
40528  *             python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
40529  *         path = funicode(c_path)
40530  *         tree.xmlFree(c_path)
40531  */
40532     __pyx_t_3 = PyErr_NoMemory(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40533     __Pyx_GOTREF(__pyx_t_3);
40534     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
40535     goto __pyx_L6;
40536   }
40537   __pyx_L6:;
40538
40539   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1705
40540  *         if c_path is NULL:
40541  *             python.PyErr_NoMemory()
40542  *         path = funicode(c_path)             # <<<<<<<<<<<<<<
40543  *         tree.xmlFree(c_path)
40544  *         return path
40545  */
40546   __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_path); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40547   __Pyx_GOTREF(__pyx_t_3);
40548   __Pyx_DECREF(__pyx_v_path);
40549   __pyx_v_path = __pyx_t_3;
40550   __pyx_t_3 = 0;
40551
40552   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1706
40553  *             python.PyErr_NoMemory()
40554  *         path = funicode(c_path)
40555  *         tree.xmlFree(c_path)             # <<<<<<<<<<<<<<
40556  *         return path
40557  * 
40558  */
40559   xmlFree(__pyx_v_c_path);
40560
40561   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1707
40562  *         path = funicode(c_path)
40563  *         tree.xmlFree(c_path)
40564  *         return path             # <<<<<<<<<<<<<<
40565  * 
40566  *     def getiterator(self, tag=None):
40567  */
40568   __Pyx_XDECREF(__pyx_r);
40569   __Pyx_INCREF(__pyx_v_path);
40570   __pyx_r = __pyx_v_path;
40571   goto __pyx_L0;
40572
40573   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
40574   goto __pyx_L0;
40575   __pyx_L1_error:;
40576   __Pyx_XDECREF(__pyx_t_3);
40577   __Pyx_AddTraceback("lxml.etree._ElementTree.getpath");
40578   __pyx_r = NULL;
40579   __pyx_L0:;
40580   __Pyx_DECREF((PyObject *)__pyx_v_doc);
40581   __Pyx_DECREF(__pyx_v_path);
40582   __Pyx_XGIVEREF(__pyx_r);
40583   __Pyx_FinishRefcountContext();
40584   return __pyx_r;
40585 }
40586
40587 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1709
40588  *         return path
40589  * 
40590  *     def getiterator(self, tag=None):             # <<<<<<<<<<<<<<
40591  *         u"""getiterator(self, tag=None)
40592  * 
40593  */
40594
40595 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_getiterator(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
40596 static char __pyx_doc_4lxml_5etree_12_ElementTree_getiterator[] = "getiterator(self, tag=None)\n\n        Returns a sequence or iterator of all elements in document order\n        (depth first pre-order), starting with the root element.\n\n        Can be restricted to find only elements with a specific tag\n        (pass ``tag=\"xyz\"`` or ``tag=\"{ns}xyz\"``) or from a namespace\n        (pass ``tag=\"{ns}*\"``).\n\n        You can also pass the Element, Comment, ProcessingInstruction and\n        Entity factory functions to look only for the specific element type.\n\n        :deprecated: Note that this method is deprecated as of\n          ElementTree 1.3 and lxml 2.0.  It returns an iterator in\n          lxml, which diverges from the original ElementTree\n          behaviour.  If you want an efficient iterator, use the\n          ``tree.iter()`` method instead.  You should only use this\n          method in new code if you require backwards compatibility\n          with older versions of lxml or ElementTree.\n        ";
40597 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_getiterator(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
40598   PyObject *__pyx_v_tag = 0;
40599   PyObject *__pyx_v_root;
40600   PyObject *__pyx_r = NULL;
40601   PyObject *__pyx_t_1 = NULL;
40602   PyObject *__pyx_t_2 = NULL;
40603   int __pyx_t_3;
40604   PyObject *__pyx_t_4 = NULL;
40605   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_tag,0};
40606   __Pyx_SetupRefcountContext("getiterator");
40607   if (unlikely(__pyx_kwds)) {
40608     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
40609     PyObject* values[1] = {0};
40610     values[0] = Py_None;
40611     switch (PyTuple_GET_SIZE(__pyx_args)) {
40612       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
40613       case  0: break;
40614       default: goto __pyx_L5_argtuple_error;
40615     }
40616     switch (PyTuple_GET_SIZE(__pyx_args)) {
40617       case  0:
40618       if (kw_args > 1) {
40619         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_tag);
40620         if (unlikely(value)) { values[0] = value; kw_args--; }
40621       }
40622     }
40623     if (unlikely(kw_args > 0)) {
40624       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "getiterator") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
40625     }
40626     __pyx_v_tag = values[0];
40627   } else {
40628     __pyx_v_tag = Py_None;
40629     switch (PyTuple_GET_SIZE(__pyx_args)) {
40630       case  1: __pyx_v_tag = PyTuple_GET_ITEM(__pyx_args, 0);
40631       case  0: break;
40632       default: goto __pyx_L5_argtuple_error;
40633     }
40634   }
40635   goto __pyx_L4_argument_unpacking_done;
40636   __pyx_L5_argtuple_error:;
40637   __Pyx_RaiseArgtupleInvalid("getiterator", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
40638   __pyx_L3_error:;
40639   __Pyx_AddTraceback("lxml.etree._ElementTree.getiterator");
40640   return NULL;
40641   __pyx_L4_argument_unpacking_done:;
40642   __pyx_v_root = Py_None; __Pyx_INCREF(Py_None);
40643
40644   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1730
40645  *           with older versions of lxml or ElementTree.
40646  *         """
40647  *         root = self.getroot()             # <<<<<<<<<<<<<<
40648  *         if root is None:
40649  *             return ()
40650  */
40651   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_getroot); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40652   __Pyx_GOTREF(__pyx_t_1);
40653   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40654   __Pyx_GOTREF(__pyx_t_2);
40655   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
40656   __Pyx_DECREF(__pyx_v_root);
40657   __pyx_v_root = __pyx_t_2;
40658   __pyx_t_2 = 0;
40659
40660   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1731
40661  *         """
40662  *         root = self.getroot()
40663  *         if root is None:             # <<<<<<<<<<<<<<
40664  *             return ()
40665  *         return root.getiterator(tag)
40666  */
40667   __pyx_t_3 = (__pyx_v_root == Py_None);
40668   if (__pyx_t_3) {
40669
40670     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1732
40671  *         root = self.getroot()
40672  *         if root is None:
40673  *             return ()             # <<<<<<<<<<<<<<
40674  *         return root.getiterator(tag)
40675  * 
40676  */
40677     __Pyx_XDECREF(__pyx_r);
40678     __Pyx_INCREF(((PyObject *)__pyx_empty_tuple));
40679     __pyx_r = ((PyObject *)__pyx_empty_tuple);
40680     goto __pyx_L0;
40681     goto __pyx_L6;
40682   }
40683   __pyx_L6:;
40684
40685   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1733
40686  *         if root is None:
40687  *             return ()
40688  *         return root.getiterator(tag)             # <<<<<<<<<<<<<<
40689  * 
40690  *     def iter(self, tag=None):
40691  */
40692   __Pyx_XDECREF(__pyx_r);
40693   __pyx_t_2 = PyObject_GetAttr(__pyx_v_root, __pyx_kp_getiterator); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40694   __Pyx_GOTREF(__pyx_t_2);
40695   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40696   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
40697   __Pyx_INCREF(__pyx_v_tag);
40698   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_tag);
40699   __Pyx_GIVEREF(__pyx_v_tag);
40700   __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40701   __Pyx_GOTREF(__pyx_t_4);
40702   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
40703   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
40704   __pyx_r = __pyx_t_4;
40705   __pyx_t_4 = 0;
40706   goto __pyx_L0;
40707
40708   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
40709   goto __pyx_L0;
40710   __pyx_L1_error:;
40711   __Pyx_XDECREF(__pyx_t_1);
40712   __Pyx_XDECREF(__pyx_t_2);
40713   __Pyx_XDECREF(__pyx_t_4);
40714   __Pyx_AddTraceback("lxml.etree._ElementTree.getiterator");
40715   __pyx_r = NULL;
40716   __pyx_L0:;
40717   __Pyx_DECREF(__pyx_v_root);
40718   __Pyx_XGIVEREF(__pyx_r);
40719   __Pyx_FinishRefcountContext();
40720   return __pyx_r;
40721 }
40722
40723 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1735
40724  *         return root.getiterator(tag)
40725  * 
40726  *     def iter(self, tag=None):             # <<<<<<<<<<<<<<
40727  *         u"""iter(self, tag=None)
40728  * 
40729  */
40730
40731 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_iter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
40732 static char __pyx_doc_4lxml_5etree_12_ElementTree_iter[] = "iter(self, tag=None)\n\n        Creates an iterator for the root element.  The iterator loops over\n        all elements in this tree, in document order.\n        ";
40733 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_iter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
40734   PyObject *__pyx_v_tag = 0;
40735   PyObject *__pyx_v_root;
40736   PyObject *__pyx_r = NULL;
40737   PyObject *__pyx_t_1 = NULL;
40738   PyObject *__pyx_t_2 = NULL;
40739   int __pyx_t_3;
40740   PyObject *__pyx_t_4 = NULL;
40741   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_tag,0};
40742   __Pyx_SetupRefcountContext("iter");
40743   if (unlikely(__pyx_kwds)) {
40744     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
40745     PyObject* values[1] = {0};
40746     values[0] = Py_None;
40747     switch (PyTuple_GET_SIZE(__pyx_args)) {
40748       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
40749       case  0: break;
40750       default: goto __pyx_L5_argtuple_error;
40751     }
40752     switch (PyTuple_GET_SIZE(__pyx_args)) {
40753       case  0:
40754       if (kw_args > 1) {
40755         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_tag);
40756         if (unlikely(value)) { values[0] = value; kw_args--; }
40757       }
40758     }
40759     if (unlikely(kw_args > 0)) {
40760       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "iter") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
40761     }
40762     __pyx_v_tag = values[0];
40763   } else {
40764     __pyx_v_tag = Py_None;
40765     switch (PyTuple_GET_SIZE(__pyx_args)) {
40766       case  1: __pyx_v_tag = PyTuple_GET_ITEM(__pyx_args, 0);
40767       case  0: break;
40768       default: goto __pyx_L5_argtuple_error;
40769     }
40770   }
40771   goto __pyx_L4_argument_unpacking_done;
40772   __pyx_L5_argtuple_error:;
40773   __Pyx_RaiseArgtupleInvalid("iter", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
40774   __pyx_L3_error:;
40775   __Pyx_AddTraceback("lxml.etree._ElementTree.iter");
40776   return NULL;
40777   __pyx_L4_argument_unpacking_done:;
40778   __pyx_v_root = Py_None; __Pyx_INCREF(Py_None);
40779
40780   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1741
40781  *         all elements in this tree, in document order.
40782  *         """
40783  *         root = self.getroot()             # <<<<<<<<<<<<<<
40784  *         if root is None:
40785  *             return ()
40786  */
40787   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_getroot); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40788   __Pyx_GOTREF(__pyx_t_1);
40789   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40790   __Pyx_GOTREF(__pyx_t_2);
40791   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
40792   __Pyx_DECREF(__pyx_v_root);
40793   __pyx_v_root = __pyx_t_2;
40794   __pyx_t_2 = 0;
40795
40796   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1742
40797  *         """
40798  *         root = self.getroot()
40799  *         if root is None:             # <<<<<<<<<<<<<<
40800  *             return ()
40801  *         return root.iter(tag)
40802  */
40803   __pyx_t_3 = (__pyx_v_root == Py_None);
40804   if (__pyx_t_3) {
40805
40806     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1743
40807  *         root = self.getroot()
40808  *         if root is None:
40809  *             return ()             # <<<<<<<<<<<<<<
40810  *         return root.iter(tag)
40811  * 
40812  */
40813     __Pyx_XDECREF(__pyx_r);
40814     __Pyx_INCREF(((PyObject *)__pyx_empty_tuple));
40815     __pyx_r = ((PyObject *)__pyx_empty_tuple);
40816     goto __pyx_L0;
40817     goto __pyx_L6;
40818   }
40819   __pyx_L6:;
40820
40821   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1744
40822  *         if root is None:
40823  *             return ()
40824  *         return root.iter(tag)             # <<<<<<<<<<<<<<
40825  * 
40826  *     def find(self, path):
40827  */
40828   __Pyx_XDECREF(__pyx_r);
40829   __pyx_t_2 = PyObject_GetAttr(__pyx_v_root, __pyx_kp_iter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40830   __Pyx_GOTREF(__pyx_t_2);
40831   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40832   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
40833   __Pyx_INCREF(__pyx_v_tag);
40834   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_tag);
40835   __Pyx_GIVEREF(__pyx_v_tag);
40836   __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40837   __Pyx_GOTREF(__pyx_t_4);
40838   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
40839   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
40840   __pyx_r = __pyx_t_4;
40841   __pyx_t_4 = 0;
40842   goto __pyx_L0;
40843
40844   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
40845   goto __pyx_L0;
40846   __pyx_L1_error:;
40847   __Pyx_XDECREF(__pyx_t_1);
40848   __Pyx_XDECREF(__pyx_t_2);
40849   __Pyx_XDECREF(__pyx_t_4);
40850   __Pyx_AddTraceback("lxml.etree._ElementTree.iter");
40851   __pyx_r = NULL;
40852   __pyx_L0:;
40853   __Pyx_DECREF(__pyx_v_root);
40854   __Pyx_XGIVEREF(__pyx_r);
40855   __Pyx_FinishRefcountContext();
40856   return __pyx_r;
40857 }
40858
40859 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1746
40860  *         return root.iter(tag)
40861  * 
40862  *     def find(self, path):             # <<<<<<<<<<<<<<
40863  *         u"""find(self, path)
40864  * 
40865  */
40866
40867 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_find(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
40868 static char __pyx_doc_4lxml_5etree_12_ElementTree_find[] = "find(self, path)\n\n        Finds the first toplevel element with given tag.  Same as\n        ``tree.getroot().find(path)``.\n        ";
40869 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_find(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
40870   PyObject *__pyx_v_root;
40871   PyObject *__pyx_v_start;
40872   PyObject *__pyx_r = NULL;
40873   PyObject *__pyx_1 = 0;
40874   PyObject *__pyx_t_1 = NULL;
40875   PyObject *__pyx_t_2 = NULL;
40876   int __pyx_t_3;
40877   PyObject *__pyx_t_4 = NULL;
40878   __Pyx_SetupRefcountContext("find");
40879   __Pyx_INCREF(__pyx_v_path);
40880   __pyx_v_root = Py_None; __Pyx_INCREF(Py_None);
40881   __pyx_v_start = Py_None; __Pyx_INCREF(Py_None);
40882
40883   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1752
40884  *         ``tree.getroot().find(path)``.
40885  *         """
40886  *         self._assertHasRoot()             # <<<<<<<<<<<<<<
40887  *         root = self.getroot()
40888  *         if _isString(path):
40889  */
40890   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40891   __Pyx_GOTREF(__pyx_t_1);
40892   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
40893
40894   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1753
40895  *         """
40896  *         self._assertHasRoot()
40897  *         root = self.getroot()             # <<<<<<<<<<<<<<
40898  *         if _isString(path):
40899  *             start = path[:1]
40900  */
40901   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_getroot); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40902   __Pyx_GOTREF(__pyx_t_1);
40903   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40904   __Pyx_GOTREF(__pyx_t_2);
40905   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
40906   __Pyx_DECREF(__pyx_v_root);
40907   __pyx_v_root = __pyx_t_2;
40908   __pyx_t_2 = 0;
40909
40910   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1754
40911  *         self._assertHasRoot()
40912  *         root = self.getroot()
40913  *         if _isString(path):             # <<<<<<<<<<<<<<
40914  *             start = path[:1]
40915  *             if start == u"/":
40916  */
40917   __pyx_t_3 = _isString(__pyx_v_path);
40918   if (__pyx_t_3) {
40919
40920     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1755
40921  *         root = self.getroot()
40922  *         if _isString(path):
40923  *             start = path[:1]             # <<<<<<<<<<<<<<
40924  *             if start == u"/":
40925  *                 path = u"." + path
40926  */
40927     __pyx_1 = PySequence_GetSlice(__pyx_v_path, 0, 1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40928     __Pyx_GOTREF(__pyx_1);
40929     __Pyx_DECREF(__pyx_v_start);
40930     __pyx_v_start = __pyx_1;
40931     __pyx_1 = 0;
40932
40933     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1756
40934  *         if _isString(path):
40935  *             start = path[:1]
40936  *             if start == u"/":             # <<<<<<<<<<<<<<
40937  *                 path = u"." + path
40938  *             elif start == "/":
40939  */
40940     __pyx_t_2 = PyObject_RichCompare(__pyx_v_start, ((PyObject *)__pyx_kp_356), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40941     __Pyx_GOTREF(__pyx_t_2);
40942     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40943     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
40944     if (__pyx_t_3) {
40945
40946       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1757
40947  *             start = path[:1]
40948  *             if start == u"/":
40949  *                 path = u"." + path             # <<<<<<<<<<<<<<
40950  *             elif start == "/":
40951  *                 path = "." + path
40952  */
40953       __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_kp_357), __pyx_v_path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40954       __Pyx_GOTREF(__pyx_t_2);
40955       __Pyx_DECREF(__pyx_v_path);
40956       __pyx_v_path = __pyx_t_2;
40957       __pyx_t_2 = 0;
40958       goto __pyx_L6;
40959     }
40960
40961     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1758
40962  *             if start == u"/":
40963  *                 path = u"." + path
40964  *             elif start == "/":             # <<<<<<<<<<<<<<
40965  *                 path = "." + path
40966  *         return root.find(path)
40967  */
40968     __pyx_t_2 = PyObject_RichCompare(__pyx_v_start, __pyx_kp_358, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40969     __Pyx_GOTREF(__pyx_t_2);
40970     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40971     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
40972     if (__pyx_t_3) {
40973
40974       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1759
40975  *                 path = u"." + path
40976  *             elif start == "/":
40977  *                 path = "." + path             # <<<<<<<<<<<<<<
40978  *         return root.find(path)
40979  * 
40980  */
40981       __pyx_t_2 = PyNumber_Add(__pyx_kp_359, __pyx_v_path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
40982       __Pyx_GOTREF(__pyx_t_2);
40983       __Pyx_DECREF(__pyx_v_path);
40984       __pyx_v_path = __pyx_t_2;
40985       __pyx_t_2 = 0;
40986       goto __pyx_L6;
40987     }
40988     __pyx_L6:;
40989     goto __pyx_L5;
40990   }
40991   __pyx_L5:;
40992
40993   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1760
40994  *             elif start == "/":
40995  *                 path = "." + path
40996  *         return root.find(path)             # <<<<<<<<<<<<<<
40997  * 
40998  *     def findtext(self, path, default=None):
40999  */
41000   __Pyx_XDECREF(__pyx_r);
41001   __pyx_t_2 = PyObject_GetAttr(__pyx_v_root, __pyx_kp_find); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41002   __Pyx_GOTREF(__pyx_t_2);
41003   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41004   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
41005   __Pyx_INCREF(__pyx_v_path);
41006   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_path);
41007   __Pyx_GIVEREF(__pyx_v_path);
41008   __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41009   __Pyx_GOTREF(__pyx_t_4);
41010   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41011   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
41012   __pyx_r = __pyx_t_4;
41013   __pyx_t_4 = 0;
41014   goto __pyx_L0;
41015
41016   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
41017   goto __pyx_L0;
41018   __pyx_L1_error:;
41019   __Pyx_XDECREF(__pyx_1);
41020   __Pyx_XDECREF(__pyx_t_1);
41021   __Pyx_XDECREF(__pyx_t_2);
41022   __Pyx_XDECREF(__pyx_t_4);
41023   __Pyx_AddTraceback("lxml.etree._ElementTree.find");
41024   __pyx_r = NULL;
41025   __pyx_L0:;
41026   __Pyx_DECREF(__pyx_v_root);
41027   __Pyx_DECREF(__pyx_v_start);
41028   __Pyx_DECREF(__pyx_v_path);
41029   __Pyx_XGIVEREF(__pyx_r);
41030   __Pyx_FinishRefcountContext();
41031   return __pyx_r;
41032 }
41033
41034 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1762
41035  *         return root.find(path)
41036  * 
41037  *     def findtext(self, path, default=None):             # <<<<<<<<<<<<<<
41038  *         u"""findtext(self, path, default=None)
41039  * 
41040  */
41041
41042 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_findtext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
41043 static char __pyx_doc_4lxml_5etree_12_ElementTree_findtext[] = "findtext(self, path, default=None)\n\n        Finds the text for the first element matching the ElementPath\n        expression.  Same as getroot().findtext(path)\n        ";
41044 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_findtext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
41045   PyObject *__pyx_v_path = 0;
41046   PyObject *__pyx_v_default = 0;
41047   PyObject *__pyx_v_root;
41048   PyObject *__pyx_v_start;
41049   PyObject *__pyx_r = NULL;
41050   PyObject *__pyx_1 = 0;
41051   PyObject *__pyx_t_1 = NULL;
41052   PyObject *__pyx_t_2 = NULL;
41053   int __pyx_t_3;
41054   PyObject *__pyx_t_4 = NULL;
41055   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_path,&__pyx_kp_default,0};
41056   __Pyx_SetupRefcountContext("findtext");
41057   if (unlikely(__pyx_kwds)) {
41058     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
41059     PyObject* values[2] = {0,0};
41060     values[1] = Py_None;
41061     switch (PyTuple_GET_SIZE(__pyx_args)) {
41062       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
41063       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
41064       case  0: break;
41065       default: goto __pyx_L5_argtuple_error;
41066     }
41067     switch (PyTuple_GET_SIZE(__pyx_args)) {
41068       case  0:
41069       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_path);
41070       if (likely(values[0])) kw_args--;
41071       else goto __pyx_L5_argtuple_error;
41072       case  1:
41073       if (kw_args > 1) {
41074         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_default);
41075         if (unlikely(value)) { values[1] = value; kw_args--; }
41076       }
41077     }
41078     if (unlikely(kw_args > 0)) {
41079       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "findtext") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
41080     }
41081     __pyx_v_path = values[0];
41082     __pyx_v_default = values[1];
41083   } else {
41084     __pyx_v_default = Py_None;
41085     switch (PyTuple_GET_SIZE(__pyx_args)) {
41086       case  2: __pyx_v_default = PyTuple_GET_ITEM(__pyx_args, 1);
41087       case  1: __pyx_v_path = PyTuple_GET_ITEM(__pyx_args, 0);
41088       break;
41089       default: goto __pyx_L5_argtuple_error;
41090     }
41091   }
41092   goto __pyx_L4_argument_unpacking_done;
41093   __pyx_L5_argtuple_error:;
41094   __Pyx_RaiseArgtupleInvalid("findtext", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
41095   __pyx_L3_error:;
41096   __Pyx_AddTraceback("lxml.etree._ElementTree.findtext");
41097   return NULL;
41098   __pyx_L4_argument_unpacking_done:;
41099   __Pyx_INCREF(__pyx_v_path);
41100   __pyx_v_root = Py_None; __Pyx_INCREF(Py_None);
41101   __pyx_v_start = Py_None; __Pyx_INCREF(Py_None);
41102
41103   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1768
41104  *         expression.  Same as getroot().findtext(path)
41105  *         """
41106  *         self._assertHasRoot()             # <<<<<<<<<<<<<<
41107  *         root = self.getroot()
41108  *         if _isString(path):
41109  */
41110   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41111   __Pyx_GOTREF(__pyx_t_1);
41112   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
41113
41114   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1769
41115  *         """
41116  *         self._assertHasRoot()
41117  *         root = self.getroot()             # <<<<<<<<<<<<<<
41118  *         if _isString(path):
41119  *             start = path[:1]
41120  */
41121   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_getroot); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41122   __Pyx_GOTREF(__pyx_t_1);
41123   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41124   __Pyx_GOTREF(__pyx_t_2);
41125   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
41126   __Pyx_DECREF(__pyx_v_root);
41127   __pyx_v_root = __pyx_t_2;
41128   __pyx_t_2 = 0;
41129
41130   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1770
41131  *         self._assertHasRoot()
41132  *         root = self.getroot()
41133  *         if _isString(path):             # <<<<<<<<<<<<<<
41134  *             start = path[:1]
41135  *             if start == u"/":
41136  */
41137   __pyx_t_3 = _isString(__pyx_v_path);
41138   if (__pyx_t_3) {
41139
41140     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1771
41141  *         root = self.getroot()
41142  *         if _isString(path):
41143  *             start = path[:1]             # <<<<<<<<<<<<<<
41144  *             if start == u"/":
41145  *                 path = u"." + path
41146  */
41147     __pyx_1 = PySequence_GetSlice(__pyx_v_path, 0, 1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41148     __Pyx_GOTREF(__pyx_1);
41149     __Pyx_DECREF(__pyx_v_start);
41150     __pyx_v_start = __pyx_1;
41151     __pyx_1 = 0;
41152
41153     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1772
41154  *         if _isString(path):
41155  *             start = path[:1]
41156  *             if start == u"/":             # <<<<<<<<<<<<<<
41157  *                 path = u"." + path
41158  *             elif start == "/":
41159  */
41160     __pyx_t_2 = PyObject_RichCompare(__pyx_v_start, ((PyObject *)__pyx_kp_360), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41161     __Pyx_GOTREF(__pyx_t_2);
41162     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41163     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41164     if (__pyx_t_3) {
41165
41166       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1773
41167  *             start = path[:1]
41168  *             if start == u"/":
41169  *                 path = u"." + path             # <<<<<<<<<<<<<<
41170  *             elif start == "/":
41171  *                 path = "." + path
41172  */
41173       __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_kp_361), __pyx_v_path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41174       __Pyx_GOTREF(__pyx_t_2);
41175       __Pyx_DECREF(__pyx_v_path);
41176       __pyx_v_path = __pyx_t_2;
41177       __pyx_t_2 = 0;
41178       goto __pyx_L7;
41179     }
41180
41181     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1774
41182  *             if start == u"/":
41183  *                 path = u"." + path
41184  *             elif start == "/":             # <<<<<<<<<<<<<<
41185  *                 path = "." + path
41186  *         return root.findtext(path, default)
41187  */
41188     __pyx_t_2 = PyObject_RichCompare(__pyx_v_start, __pyx_kp_362, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41189     __Pyx_GOTREF(__pyx_t_2);
41190     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41191     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41192     if (__pyx_t_3) {
41193
41194       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1775
41195  *                 path = u"." + path
41196  *             elif start == "/":
41197  *                 path = "." + path             # <<<<<<<<<<<<<<
41198  *         return root.findtext(path, default)
41199  * 
41200  */
41201       __pyx_t_2 = PyNumber_Add(__pyx_kp_363, __pyx_v_path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41202       __Pyx_GOTREF(__pyx_t_2);
41203       __Pyx_DECREF(__pyx_v_path);
41204       __pyx_v_path = __pyx_t_2;
41205       __pyx_t_2 = 0;
41206       goto __pyx_L7;
41207     }
41208     __pyx_L7:;
41209     goto __pyx_L6;
41210   }
41211   __pyx_L6:;
41212
41213   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1776
41214  *             elif start == "/":
41215  *                 path = "." + path
41216  *         return root.findtext(path, default)             # <<<<<<<<<<<<<<
41217  * 
41218  *     def findall(self, path):
41219  */
41220   __Pyx_XDECREF(__pyx_r);
41221   __pyx_t_2 = PyObject_GetAttr(__pyx_v_root, __pyx_kp_findtext); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41222   __Pyx_GOTREF(__pyx_t_2);
41223   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41224   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
41225   __Pyx_INCREF(__pyx_v_path);
41226   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_path);
41227   __Pyx_GIVEREF(__pyx_v_path);
41228   __Pyx_INCREF(__pyx_v_default);
41229   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_default);
41230   __Pyx_GIVEREF(__pyx_v_default);
41231   __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41232   __Pyx_GOTREF(__pyx_t_4);
41233   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41234   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
41235   __pyx_r = __pyx_t_4;
41236   __pyx_t_4 = 0;
41237   goto __pyx_L0;
41238
41239   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
41240   goto __pyx_L0;
41241   __pyx_L1_error:;
41242   __Pyx_XDECREF(__pyx_1);
41243   __Pyx_XDECREF(__pyx_t_1);
41244   __Pyx_XDECREF(__pyx_t_2);
41245   __Pyx_XDECREF(__pyx_t_4);
41246   __Pyx_AddTraceback("lxml.etree._ElementTree.findtext");
41247   __pyx_r = NULL;
41248   __pyx_L0:;
41249   __Pyx_DECREF(__pyx_v_root);
41250   __Pyx_DECREF(__pyx_v_start);
41251   __Pyx_DECREF(__pyx_v_path);
41252   __Pyx_XGIVEREF(__pyx_r);
41253   __Pyx_FinishRefcountContext();
41254   return __pyx_r;
41255 }
41256
41257 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1778
41258  *         return root.findtext(path, default)
41259  * 
41260  *     def findall(self, path):             # <<<<<<<<<<<<<<
41261  *         u"""findall(self, path)
41262  * 
41263  */
41264
41265 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_findall(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
41266 static char __pyx_doc_4lxml_5etree_12_ElementTree_findall[] = "findall(self, path)\n\n        Finds all elements matching the ElementPath expression.  Same as\n        getroot().findall(path).\n        ";
41267 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_findall(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
41268   PyObject *__pyx_v_root;
41269   PyObject *__pyx_v_start;
41270   PyObject *__pyx_r = NULL;
41271   PyObject *__pyx_1 = 0;
41272   PyObject *__pyx_t_1 = NULL;
41273   PyObject *__pyx_t_2 = NULL;
41274   int __pyx_t_3;
41275   PyObject *__pyx_t_4 = NULL;
41276   __Pyx_SetupRefcountContext("findall");
41277   __Pyx_INCREF(__pyx_v_path);
41278   __pyx_v_root = Py_None; __Pyx_INCREF(Py_None);
41279   __pyx_v_start = Py_None; __Pyx_INCREF(Py_None);
41280
41281   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1784
41282  *         getroot().findall(path).
41283  *         """
41284  *         self._assertHasRoot()             # <<<<<<<<<<<<<<
41285  *         root = self.getroot()
41286  *         if _isString(path):
41287  */
41288   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41289   __Pyx_GOTREF(__pyx_t_1);
41290   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
41291
41292   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1785
41293  *         """
41294  *         self._assertHasRoot()
41295  *         root = self.getroot()             # <<<<<<<<<<<<<<
41296  *         if _isString(path):
41297  *             start = path[:1]
41298  */
41299   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_getroot); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41300   __Pyx_GOTREF(__pyx_t_1);
41301   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41302   __Pyx_GOTREF(__pyx_t_2);
41303   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
41304   __Pyx_DECREF(__pyx_v_root);
41305   __pyx_v_root = __pyx_t_2;
41306   __pyx_t_2 = 0;
41307
41308   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1786
41309  *         self._assertHasRoot()
41310  *         root = self.getroot()
41311  *         if _isString(path):             # <<<<<<<<<<<<<<
41312  *             start = path[:1]
41313  *             if start == u"/":
41314  */
41315   __pyx_t_3 = _isString(__pyx_v_path);
41316   if (__pyx_t_3) {
41317
41318     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1787
41319  *         root = self.getroot()
41320  *         if _isString(path):
41321  *             start = path[:1]             # <<<<<<<<<<<<<<
41322  *             if start == u"/":
41323  *                 path = u"." + path
41324  */
41325     __pyx_1 = PySequence_GetSlice(__pyx_v_path, 0, 1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41326     __Pyx_GOTREF(__pyx_1);
41327     __Pyx_DECREF(__pyx_v_start);
41328     __pyx_v_start = __pyx_1;
41329     __pyx_1 = 0;
41330
41331     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1788
41332  *         if _isString(path):
41333  *             start = path[:1]
41334  *             if start == u"/":             # <<<<<<<<<<<<<<
41335  *                 path = u"." + path
41336  *             elif start == "/":
41337  */
41338     __pyx_t_2 = PyObject_RichCompare(__pyx_v_start, ((PyObject *)__pyx_kp_364), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41339     __Pyx_GOTREF(__pyx_t_2);
41340     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41341     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41342     if (__pyx_t_3) {
41343
41344       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1789
41345  *             start = path[:1]
41346  *             if start == u"/":
41347  *                 path = u"." + path             # <<<<<<<<<<<<<<
41348  *             elif start == "/":
41349  *                 path = "." + path
41350  */
41351       __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_kp_365), __pyx_v_path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41352       __Pyx_GOTREF(__pyx_t_2);
41353       __Pyx_DECREF(__pyx_v_path);
41354       __pyx_v_path = __pyx_t_2;
41355       __pyx_t_2 = 0;
41356       goto __pyx_L6;
41357     }
41358
41359     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1790
41360  *             if start == u"/":
41361  *                 path = u"." + path
41362  *             elif start == "/":             # <<<<<<<<<<<<<<
41363  *                 path = "." + path
41364  *         return root.findall(path)
41365  */
41366     __pyx_t_2 = PyObject_RichCompare(__pyx_v_start, __pyx_kp_366, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41367     __Pyx_GOTREF(__pyx_t_2);
41368     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41369     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41370     if (__pyx_t_3) {
41371
41372       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1791
41373  *                 path = u"." + path
41374  *             elif start == "/":
41375  *                 path = "." + path             # <<<<<<<<<<<<<<
41376  *         return root.findall(path)
41377  * 
41378  */
41379       __pyx_t_2 = PyNumber_Add(__pyx_kp_367, __pyx_v_path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41380       __Pyx_GOTREF(__pyx_t_2);
41381       __Pyx_DECREF(__pyx_v_path);
41382       __pyx_v_path = __pyx_t_2;
41383       __pyx_t_2 = 0;
41384       goto __pyx_L6;
41385     }
41386     __pyx_L6:;
41387     goto __pyx_L5;
41388   }
41389   __pyx_L5:;
41390
41391   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1792
41392  *             elif start == "/":
41393  *                 path = "." + path
41394  *         return root.findall(path)             # <<<<<<<<<<<<<<
41395  * 
41396  *     def iterfind(self, path):
41397  */
41398   __Pyx_XDECREF(__pyx_r);
41399   __pyx_t_2 = PyObject_GetAttr(__pyx_v_root, __pyx_kp_findall); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41400   __Pyx_GOTREF(__pyx_t_2);
41401   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41402   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
41403   __Pyx_INCREF(__pyx_v_path);
41404   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_path);
41405   __Pyx_GIVEREF(__pyx_v_path);
41406   __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41407   __Pyx_GOTREF(__pyx_t_4);
41408   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41409   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
41410   __pyx_r = __pyx_t_4;
41411   __pyx_t_4 = 0;
41412   goto __pyx_L0;
41413
41414   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
41415   goto __pyx_L0;
41416   __pyx_L1_error:;
41417   __Pyx_XDECREF(__pyx_1);
41418   __Pyx_XDECREF(__pyx_t_1);
41419   __Pyx_XDECREF(__pyx_t_2);
41420   __Pyx_XDECREF(__pyx_t_4);
41421   __Pyx_AddTraceback("lxml.etree._ElementTree.findall");
41422   __pyx_r = NULL;
41423   __pyx_L0:;
41424   __Pyx_DECREF(__pyx_v_root);
41425   __Pyx_DECREF(__pyx_v_start);
41426   __Pyx_DECREF(__pyx_v_path);
41427   __Pyx_XGIVEREF(__pyx_r);
41428   __Pyx_FinishRefcountContext();
41429   return __pyx_r;
41430 }
41431
41432 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1794
41433  *         return root.findall(path)
41434  * 
41435  *     def iterfind(self, path):             # <<<<<<<<<<<<<<
41436  *         u"""iterfind(self, path)
41437  * 
41438  */
41439
41440 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_iterfind(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
41441 static char __pyx_doc_4lxml_5etree_12_ElementTree_iterfind[] = "iterfind(self, path)\n\n        Iterates over all elements matching the ElementPath expression.\n        Same as getroot().finditer(path).\n        ";
41442 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_iterfind(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
41443   PyObject *__pyx_v_root;
41444   PyObject *__pyx_v_start;
41445   PyObject *__pyx_r = NULL;
41446   PyObject *__pyx_1 = 0;
41447   PyObject *__pyx_t_1 = NULL;
41448   PyObject *__pyx_t_2 = NULL;
41449   int __pyx_t_3;
41450   PyObject *__pyx_t_4 = NULL;
41451   __Pyx_SetupRefcountContext("iterfind");
41452   __Pyx_INCREF(__pyx_v_path);
41453   __pyx_v_root = Py_None; __Pyx_INCREF(Py_None);
41454   __pyx_v_start = Py_None; __Pyx_INCREF(Py_None);
41455
41456   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1800
41457  *         Same as getroot().finditer(path).
41458  *         """
41459  *         self._assertHasRoot()             # <<<<<<<<<<<<<<
41460  *         root = self.getroot()
41461  *         if _isString(path):
41462  */
41463   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41464   __Pyx_GOTREF(__pyx_t_1);
41465   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
41466
41467   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1801
41468  *         """
41469  *         self._assertHasRoot()
41470  *         root = self.getroot()             # <<<<<<<<<<<<<<
41471  *         if _isString(path):
41472  *             start = path[:1]
41473  */
41474   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_getroot); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41475   __Pyx_GOTREF(__pyx_t_1);
41476   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41477   __Pyx_GOTREF(__pyx_t_2);
41478   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
41479   __Pyx_DECREF(__pyx_v_root);
41480   __pyx_v_root = __pyx_t_2;
41481   __pyx_t_2 = 0;
41482
41483   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1802
41484  *         self._assertHasRoot()
41485  *         root = self.getroot()
41486  *         if _isString(path):             # <<<<<<<<<<<<<<
41487  *             start = path[:1]
41488  *             if start == u"/":
41489  */
41490   __pyx_t_3 = _isString(__pyx_v_path);
41491   if (__pyx_t_3) {
41492
41493     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1803
41494  *         root = self.getroot()
41495  *         if _isString(path):
41496  *             start = path[:1]             # <<<<<<<<<<<<<<
41497  *             if start == u"/":
41498  *                 path = u"." + path
41499  */
41500     __pyx_1 = PySequence_GetSlice(__pyx_v_path, 0, 1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41501     __Pyx_GOTREF(__pyx_1);
41502     __Pyx_DECREF(__pyx_v_start);
41503     __pyx_v_start = __pyx_1;
41504     __pyx_1 = 0;
41505
41506     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1804
41507  *         if _isString(path):
41508  *             start = path[:1]
41509  *             if start == u"/":             # <<<<<<<<<<<<<<
41510  *                 path = u"." + path
41511  *             elif start == "/":
41512  */
41513     __pyx_t_2 = PyObject_RichCompare(__pyx_v_start, ((PyObject *)__pyx_kp_368), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41514     __Pyx_GOTREF(__pyx_t_2);
41515     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41516     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41517     if (__pyx_t_3) {
41518
41519       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1805
41520  *             start = path[:1]
41521  *             if start == u"/":
41522  *                 path = u"." + path             # <<<<<<<<<<<<<<
41523  *             elif start == "/":
41524  *                 path = "." + path
41525  */
41526       __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_kp_369), __pyx_v_path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41527       __Pyx_GOTREF(__pyx_t_2);
41528       __Pyx_DECREF(__pyx_v_path);
41529       __pyx_v_path = __pyx_t_2;
41530       __pyx_t_2 = 0;
41531       goto __pyx_L6;
41532     }
41533
41534     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1806
41535  *             if start == u"/":
41536  *                 path = u"." + path
41537  *             elif start == "/":             # <<<<<<<<<<<<<<
41538  *                 path = "." + path
41539  *         return root.iterfind(path)
41540  */
41541     __pyx_t_2 = PyObject_RichCompare(__pyx_v_start, __pyx_kp_370, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41542     __Pyx_GOTREF(__pyx_t_2);
41543     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41544     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41545     if (__pyx_t_3) {
41546
41547       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1807
41548  *                 path = u"." + path
41549  *             elif start == "/":
41550  *                 path = "." + path             # <<<<<<<<<<<<<<
41551  *         return root.iterfind(path)
41552  * 
41553  */
41554       __pyx_t_2 = PyNumber_Add(__pyx_kp_371, __pyx_v_path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41555       __Pyx_GOTREF(__pyx_t_2);
41556       __Pyx_DECREF(__pyx_v_path);
41557       __pyx_v_path = __pyx_t_2;
41558       __pyx_t_2 = 0;
41559       goto __pyx_L6;
41560     }
41561     __pyx_L6:;
41562     goto __pyx_L5;
41563   }
41564   __pyx_L5:;
41565
41566   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1808
41567  *             elif start == "/":
41568  *                 path = "." + path
41569  *         return root.iterfind(path)             # <<<<<<<<<<<<<<
41570  * 
41571  *     def xpath(self, _path, *, namespaces=None, extensions=None,
41572  */
41573   __Pyx_XDECREF(__pyx_r);
41574   __pyx_t_2 = PyObject_GetAttr(__pyx_v_root, __pyx_kp_iterfind); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41575   __Pyx_GOTREF(__pyx_t_2);
41576   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41577   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
41578   __Pyx_INCREF(__pyx_v_path);
41579   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_path);
41580   __Pyx_GIVEREF(__pyx_v_path);
41581   __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1808; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41582   __Pyx_GOTREF(__pyx_t_4);
41583   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41584   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
41585   __pyx_r = __pyx_t_4;
41586   __pyx_t_4 = 0;
41587   goto __pyx_L0;
41588
41589   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
41590   goto __pyx_L0;
41591   __pyx_L1_error:;
41592   __Pyx_XDECREF(__pyx_1);
41593   __Pyx_XDECREF(__pyx_t_1);
41594   __Pyx_XDECREF(__pyx_t_2);
41595   __Pyx_XDECREF(__pyx_t_4);
41596   __Pyx_AddTraceback("lxml.etree._ElementTree.iterfind");
41597   __pyx_r = NULL;
41598   __pyx_L0:;
41599   __Pyx_DECREF(__pyx_v_root);
41600   __Pyx_DECREF(__pyx_v_start);
41601   __Pyx_DECREF(__pyx_v_path);
41602   __Pyx_XGIVEREF(__pyx_r);
41603   __Pyx_FinishRefcountContext();
41604   return __pyx_r;
41605 }
41606
41607 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1810
41608  *         return root.iterfind(path)
41609  * 
41610  *     def xpath(self, _path, *, namespaces=None, extensions=None,             # <<<<<<<<<<<<<<
41611  *               smart_strings=True, **_variables):
41612  *         u"""xpath(self, _path, namespaces=None, extensions=None, smart_strings=True, **_variables)
41613  */
41614
41615 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_xpath(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
41616 static char __pyx_doc_4lxml_5etree_12_ElementTree_xpath[] = "xpath(self, _path, namespaces=None, extensions=None, smart_strings=True, **_variables)\n\n        XPath evaluate in context of document.\n\n        ``namespaces`` is an optional dictionary with prefix to namespace URI\n        mappings, used by XPath.  ``extensions`` defines additional extension\n        functions.\n        \n        Returns a list (nodeset), or bool, float or string.\n\n        In case of a list result, return Element for element nodes,\n        string for text and attribute values.\n\n        Note: if you are going to apply multiple XPath expressions\n        against the same document, it is more efficient to use\n        XPathEvaluator directly.\n        ";
41617 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_xpath(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
41618   PyObject *__pyx_v__path = 0;
41619   PyObject *__pyx_v_namespaces = 0;
41620   PyObject *__pyx_v_extensions = 0;
41621   PyObject *__pyx_v_smart_strings = 0;
41622   PyObject *__pyx_v__variables = 0;
41623   PyObject *__pyx_v_evaluator;
41624   PyObject *__pyx_r = NULL;
41625   PyObject *__pyx_1 = 0;
41626   PyObject *__pyx_t_1 = NULL;
41627   PyObject *__pyx_t_2 = NULL;
41628   static PyObject **__pyx_pyargnames[] = {&__pyx_kp__path,&__pyx_kp_namespaces,&__pyx_kp_extensions,&__pyx_kp_smart_strings,0};
41629   __Pyx_SetupRefcountContext("xpath");
41630   __pyx_v__variables = PyDict_New(); if (unlikely(!__pyx_v__variables)) return NULL;
41631   __Pyx_GOTREF(__pyx_v__variables);
41632   if (unlikely(__pyx_kwds)) {
41633     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
41634     PyObject* values[4] = {0,0,0,0};
41635     values[1] = Py_None;
41636     values[2] = Py_None;
41637     values[3] = __pyx_k_94;
41638     switch (PyTuple_GET_SIZE(__pyx_args)) {
41639       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
41640       case  0: break;
41641       default: goto __pyx_L5_argtuple_error;
41642     }
41643     switch (PyTuple_GET_SIZE(__pyx_args)) {
41644       case  0:
41645       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp__path);
41646       if (likely(values[0])) kw_args--;
41647       else goto __pyx_L5_argtuple_error;
41648     }
41649     if (unlikely(kw_args > 0)) {
41650       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__variables, values, PyTuple_GET_SIZE(__pyx_args), "xpath") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
41651     }
41652     __pyx_v__path = values[0];
41653     __pyx_v_namespaces = values[1];
41654     __pyx_v_extensions = values[2];
41655     __pyx_v_smart_strings = values[3];
41656   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
41657     goto __pyx_L5_argtuple_error;
41658   } else {
41659     __pyx_v__path = PyTuple_GET_ITEM(__pyx_args, 0);
41660     __pyx_v_namespaces = Py_None;
41661     __pyx_v_extensions = Py_None;
41662     __pyx_v_smart_strings = __pyx_k_94;
41663   }
41664   goto __pyx_L4_argument_unpacking_done;
41665   __pyx_L5_argtuple_error:;
41666   __Pyx_RaiseArgtupleInvalid("xpath", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
41667   __pyx_L3_error:;
41668   __Pyx_DECREF(__pyx_v__variables);
41669   __Pyx_AddTraceback("lxml.etree._ElementTree.xpath");
41670   return NULL;
41671   __pyx_L4_argument_unpacking_done:;
41672   __pyx_v_evaluator = Py_None; __Pyx_INCREF(Py_None);
41673
41674   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1829
41675  *         XPathEvaluator directly.
41676  *         """
41677  *         self._assertHasRoot()             # <<<<<<<<<<<<<<
41678  *         evaluator = XPathDocumentEvaluator(self, namespaces=namespaces,
41679  *                                            extensions=extensions,
41680  */
41681   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41682   __Pyx_GOTREF(__pyx_t_1);
41683   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
41684
41685   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1830
41686  *         """
41687  *         self._assertHasRoot()
41688  *         evaluator = XPathDocumentEvaluator(self, namespaces=namespaces,             # <<<<<<<<<<<<<<
41689  *                                            extensions=extensions,
41690  *                                            smart_strings=smart_strings)
41691  */
41692   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41693   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
41694   __Pyx_INCREF(__pyx_v_self);
41695   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
41696   __Pyx_GIVEREF(__pyx_v_self);
41697   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41698   __Pyx_GOTREF(((PyObject *)__pyx_1));
41699   if (PyDict_SetItem(__pyx_1, __pyx_kp_namespaces, __pyx_v_namespaces) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41700
41701   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1831
41702  *         self._assertHasRoot()
41703  *         evaluator = XPathDocumentEvaluator(self, namespaces=namespaces,
41704  *                                            extensions=extensions,             # <<<<<<<<<<<<<<
41705  *                                            smart_strings=smart_strings)
41706  *         return evaluator(_path, **_variables)
41707  */
41708   if (PyDict_SetItem(__pyx_1, __pyx_kp_extensions, __pyx_v_extensions) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41709
41710   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1832
41711  *         evaluator = XPathDocumentEvaluator(self, namespaces=namespaces,
41712  *                                            extensions=extensions,
41713  *                                            smart_strings=smart_strings)             # <<<<<<<<<<<<<<
41714  *         return evaluator(_path, **_variables)
41715  * 
41716  */
41717   if (PyDict_SetItem(__pyx_1, __pyx_kp_smart_strings, __pyx_v_smart_strings) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41718   __pyx_t_2 = PyEval_CallObjectWithKeywords(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_XPathDocumentEvaluator)), ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41719   __Pyx_GOTREF(__pyx_t_2);
41720   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
41721   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
41722   __Pyx_DECREF(__pyx_v_evaluator);
41723   __pyx_v_evaluator = __pyx_t_2;
41724   __pyx_t_2 = 0;
41725
41726   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1833
41727  *                                            extensions=extensions,
41728  *                                            smart_strings=smart_strings)
41729  *         return evaluator(_path, **_variables)             # <<<<<<<<<<<<<<
41730  * 
41731  *     def xslt(self, _xslt, extensions=None, access_control=None, **_kw):
41732  */
41733   __Pyx_XDECREF(__pyx_r);
41734   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41735   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
41736   __Pyx_INCREF(__pyx_v__path);
41737   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v__path);
41738   __Pyx_GIVEREF(__pyx_v__path);
41739   __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_v_evaluator, ((PyObject *)__pyx_t_2), __pyx_v__variables); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41740   __Pyx_GOTREF(__pyx_t_1);
41741   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
41742   __pyx_r = __pyx_t_1;
41743   __pyx_t_1 = 0;
41744   goto __pyx_L0;
41745
41746   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
41747   goto __pyx_L0;
41748   __pyx_L1_error:;
41749   __Pyx_XDECREF(__pyx_1);
41750   __Pyx_XDECREF(__pyx_t_1);
41751   __Pyx_XDECREF(__pyx_t_2);
41752   __Pyx_AddTraceback("lxml.etree._ElementTree.xpath");
41753   __pyx_r = NULL;
41754   __pyx_L0:;
41755   __Pyx_DECREF(__pyx_v__variables);
41756   __Pyx_DECREF(__pyx_v_evaluator);
41757   __Pyx_XGIVEREF(__pyx_r);
41758   __Pyx_FinishRefcountContext();
41759   return __pyx_r;
41760 }
41761
41762 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1835
41763  *         return evaluator(_path, **_variables)
41764  * 
41765  *     def xslt(self, _xslt, extensions=None, access_control=None, **_kw):             # <<<<<<<<<<<<<<
41766  *         u"""xslt(self, _xslt, extensions=None, access_control=None, **_kw)
41767  * 
41768  */
41769
41770 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_xslt(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
41771 static char __pyx_doc_4lxml_5etree_12_ElementTree_xslt[] = "xslt(self, _xslt, extensions=None, access_control=None, **_kw)\n\n        Transform this document using other document.\n\n        xslt is a tree that should be XSLT\n        keyword parameters are XSLT transformation parameters.\n\n        Returns the transformed tree.\n\n        Note: if you are going to apply the same XSLT stylesheet against\n        multiple documents, it is more efficient to use the XSLT\n        class directly.\n        ";
41772 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_xslt(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
41773   PyObject *__pyx_v__xslt = 0;
41774   PyObject *__pyx_v_extensions = 0;
41775   PyObject *__pyx_v_access_control = 0;
41776   PyObject *__pyx_v__kw = 0;
41777   PyObject *__pyx_v_style;
41778   PyObject *__pyx_r = NULL;
41779   PyObject *__pyx_1 = 0;
41780   PyObject *__pyx_t_1 = NULL;
41781   PyObject *__pyx_t_2 = NULL;
41782   static PyObject **__pyx_pyargnames[] = {&__pyx_kp__xslt,&__pyx_kp_extensions,&__pyx_kp_access_control,0};
41783   __Pyx_SetupRefcountContext("xslt");
41784   __pyx_v__kw = PyDict_New(); if (unlikely(!__pyx_v__kw)) return NULL;
41785   __Pyx_GOTREF(__pyx_v__kw);
41786   if (unlikely(__pyx_kwds)) {
41787     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
41788     PyObject* values[3] = {0,0,0};
41789     values[1] = Py_None;
41790     values[2] = Py_None;
41791     switch (PyTuple_GET_SIZE(__pyx_args)) {
41792       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
41793       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
41794       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
41795       case  0: break;
41796       default: goto __pyx_L5_argtuple_error;
41797     }
41798     switch (PyTuple_GET_SIZE(__pyx_args)) {
41799       case  0:
41800       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp__xslt);
41801       if (likely(values[0])) kw_args--;
41802       else goto __pyx_L5_argtuple_error;
41803       case  1:
41804       if (kw_args > 1) {
41805         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_extensions);
41806         if (unlikely(value)) { values[1] = value; kw_args--; }
41807       }
41808       case  2:
41809       if (kw_args > 1) {
41810         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_access_control);
41811         if (unlikely(value)) { values[2] = value; kw_args--; }
41812       }
41813     }
41814     if (unlikely(kw_args > 0)) {
41815       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__kw, values, PyTuple_GET_SIZE(__pyx_args), "xslt") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1835; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
41816     }
41817     __pyx_v__xslt = values[0];
41818     __pyx_v_extensions = values[1];
41819     __pyx_v_access_control = values[2];
41820   } else {
41821     __pyx_v_extensions = Py_None;
41822     __pyx_v_access_control = Py_None;
41823     switch (PyTuple_GET_SIZE(__pyx_args)) {
41824       case  3: __pyx_v_access_control = PyTuple_GET_ITEM(__pyx_args, 2);
41825       case  2: __pyx_v_extensions = PyTuple_GET_ITEM(__pyx_args, 1);
41826       case  1: __pyx_v__xslt = PyTuple_GET_ITEM(__pyx_args, 0);
41827       break;
41828       default: goto __pyx_L5_argtuple_error;
41829     }
41830   }
41831   goto __pyx_L4_argument_unpacking_done;
41832   __pyx_L5_argtuple_error:;
41833   __Pyx_RaiseArgtupleInvalid("xslt", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1835; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
41834   __pyx_L3_error:;
41835   __Pyx_DECREF(__pyx_v__kw);
41836   __Pyx_AddTraceback("lxml.etree._ElementTree.xslt");
41837   return NULL;
41838   __pyx_L4_argument_unpacking_done:;
41839   __pyx_v_style = Py_None; __Pyx_INCREF(Py_None);
41840
41841   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1849
41842  *         class directly.
41843  *         """
41844  *         self._assertHasRoot()             # <<<<<<<<<<<<<<
41845  *         style = XSLT(_xslt, extensions=extensions,
41846  *                      access_control=access_control)
41847  */
41848   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41849   __Pyx_GOTREF(__pyx_t_1);
41850   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
41851
41852   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1850
41853  *         """
41854  *         self._assertHasRoot()
41855  *         style = XSLT(_xslt, extensions=extensions,             # <<<<<<<<<<<<<<
41856  *                      access_control=access_control)
41857  *         return style(self, **_kw)
41858  */
41859   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41860   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
41861   __Pyx_INCREF(__pyx_v__xslt);
41862   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__xslt);
41863   __Pyx_GIVEREF(__pyx_v__xslt);
41864   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41865   __Pyx_GOTREF(((PyObject *)__pyx_1));
41866   if (PyDict_SetItem(__pyx_1, __pyx_kp_extensions, __pyx_v_extensions) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41867
41868   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1851
41869  *         self._assertHasRoot()
41870  *         style = XSLT(_xslt, extensions=extensions,
41871  *                      access_control=access_control)             # <<<<<<<<<<<<<<
41872  *         return style(self, **_kw)
41873  * 
41874  */
41875   if (PyDict_SetItem(__pyx_1, __pyx_kp_access_control, __pyx_v_access_control) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41876   __pyx_t_2 = PyEval_CallObjectWithKeywords(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_XSLT)), ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41877   __Pyx_GOTREF(__pyx_t_2);
41878   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
41879   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
41880   __Pyx_DECREF(__pyx_v_style);
41881   __pyx_v_style = __pyx_t_2;
41882   __pyx_t_2 = 0;
41883
41884   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1852
41885  *         style = XSLT(_xslt, extensions=extensions,
41886  *                      access_control=access_control)
41887  *         return style(self, **_kw)             # <<<<<<<<<<<<<<
41888  * 
41889  *     def relaxng(self, relaxng):
41890  */
41891   __Pyx_XDECREF(__pyx_r);
41892   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41893   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
41894   __Pyx_INCREF(__pyx_v_self);
41895   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
41896   __Pyx_GIVEREF(__pyx_v_self);
41897   __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_v_style, ((PyObject *)__pyx_t_2), __pyx_v__kw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41898   __Pyx_GOTREF(__pyx_t_1);
41899   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
41900   __pyx_r = __pyx_t_1;
41901   __pyx_t_1 = 0;
41902   goto __pyx_L0;
41903
41904   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
41905   goto __pyx_L0;
41906   __pyx_L1_error:;
41907   __Pyx_XDECREF(__pyx_1);
41908   __Pyx_XDECREF(__pyx_t_1);
41909   __Pyx_XDECREF(__pyx_t_2);
41910   __Pyx_AddTraceback("lxml.etree._ElementTree.xslt");
41911   __pyx_r = NULL;
41912   __pyx_L0:;
41913   __Pyx_DECREF(__pyx_v__kw);
41914   __Pyx_DECREF(__pyx_v_style);
41915   __Pyx_XGIVEREF(__pyx_r);
41916   __Pyx_FinishRefcountContext();
41917   return __pyx_r;
41918 }
41919
41920 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1854
41921  *         return style(self, **_kw)
41922  * 
41923  *     def relaxng(self, relaxng):             # <<<<<<<<<<<<<<
41924  *         u"""relaxng(self, relaxng)
41925  * 
41926  */
41927
41928 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_relaxng(PyObject *__pyx_v_self, PyObject *__pyx_v_relaxng); /*proto*/
41929 static char __pyx_doc_4lxml_5etree_12_ElementTree_relaxng[] = "relaxng(self, relaxng)\n\n        Validate this document using other document.\n\n        The relaxng argument is a tree that should contain a Relax NG schema.\n\n        Returns True or False, depending on whether validation\n        succeeded.\n\n        Note: if you are going to apply the same Relax NG schema against\n        multiple documents, it is more efficient to use the RelaxNG\n        class directly.\n        ";
41930 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_relaxng(PyObject *__pyx_v_self, PyObject *__pyx_v_relaxng) {
41931   PyObject *__pyx_v_schema;
41932   PyObject *__pyx_r = NULL;
41933   PyObject *__pyx_t_1 = NULL;
41934   PyObject *__pyx_t_2 = NULL;
41935   PyObject *__pyx_t_3 = NULL;
41936   __Pyx_SetupRefcountContext("relaxng");
41937   __pyx_v_schema = Py_None; __Pyx_INCREF(Py_None);
41938
41939   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1868
41940  *         class directly.
41941  *         """
41942  *         self._assertHasRoot()             # <<<<<<<<<<<<<<
41943  *         schema = RelaxNG(relaxng)
41944  *         return schema.validate(self)
41945  */
41946   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41947   __Pyx_GOTREF(__pyx_t_1);
41948   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
41949
41950   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1869
41951  *         """
41952  *         self._assertHasRoot()
41953  *         schema = RelaxNG(relaxng)             # <<<<<<<<<<<<<<
41954  *         return schema.validate(self)
41955  * 
41956  */
41957   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41958   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
41959   __Pyx_INCREF(__pyx_v_relaxng);
41960   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_relaxng);
41961   __Pyx_GIVEREF(__pyx_v_relaxng);
41962   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_RelaxNG)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41963   __Pyx_GOTREF(__pyx_t_2);
41964   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
41965   __Pyx_DECREF(__pyx_v_schema);
41966   __pyx_v_schema = __pyx_t_2;
41967   __pyx_t_2 = 0;
41968
41969   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1870
41970  *         self._assertHasRoot()
41971  *         schema = RelaxNG(relaxng)
41972  *         return schema.validate(self)             # <<<<<<<<<<<<<<
41973  * 
41974  *     def xmlschema(self, xmlschema):
41975  */
41976   __Pyx_XDECREF(__pyx_r);
41977   __pyx_t_2 = PyObject_GetAttr(__pyx_v_schema, __pyx_kp_validate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41978   __Pyx_GOTREF(__pyx_t_2);
41979   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41980   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
41981   __Pyx_INCREF(__pyx_v_self);
41982   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
41983   __Pyx_GIVEREF(__pyx_v_self);
41984   __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41985   __Pyx_GOTREF(__pyx_t_3);
41986   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
41987   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
41988   __pyx_r = __pyx_t_3;
41989   __pyx_t_3 = 0;
41990   goto __pyx_L0;
41991
41992   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
41993   goto __pyx_L0;
41994   __pyx_L1_error:;
41995   __Pyx_XDECREF(__pyx_t_1);
41996   __Pyx_XDECREF(__pyx_t_2);
41997   __Pyx_XDECREF(__pyx_t_3);
41998   __Pyx_AddTraceback("lxml.etree._ElementTree.relaxng");
41999   __pyx_r = NULL;
42000   __pyx_L0:;
42001   __Pyx_DECREF(__pyx_v_schema);
42002   __Pyx_XGIVEREF(__pyx_r);
42003   __Pyx_FinishRefcountContext();
42004   return __pyx_r;
42005 }
42006
42007 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1872
42008  *         return schema.validate(self)
42009  * 
42010  *     def xmlschema(self, xmlschema):             # <<<<<<<<<<<<<<
42011  *         u"""xmlschema(self, xmlschema)
42012  * 
42013  */
42014
42015 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_xmlschema(PyObject *__pyx_v_self, PyObject *__pyx_v_xmlschema); /*proto*/
42016 static char __pyx_doc_4lxml_5etree_12_ElementTree_xmlschema[] = "xmlschema(self, xmlschema)\n\n        Validate this document using other document.\n\n        The xmlschema argument is a tree that should contain an XML Schema.\n\n        Returns True or False, depending on whether validation\n        succeeded.\n\n        Note: If you are going to apply the same XML Schema against\n        multiple documents, it is more efficient to use the XMLSchema\n        class directly.\n        ";
42017 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_xmlschema(PyObject *__pyx_v_self, PyObject *__pyx_v_xmlschema) {
42018   PyObject *__pyx_v_schema;
42019   PyObject *__pyx_r = NULL;
42020   PyObject *__pyx_t_1 = NULL;
42021   PyObject *__pyx_t_2 = NULL;
42022   PyObject *__pyx_t_3 = NULL;
42023   __Pyx_SetupRefcountContext("xmlschema");
42024   __pyx_v_schema = Py_None; __Pyx_INCREF(Py_None);
42025
42026   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1886
42027  *         class directly.
42028  *         """
42029  *         self._assertHasRoot()             # <<<<<<<<<<<<<<
42030  *         schema = XMLSchema(xmlschema)
42031  *         return schema.validate(self)
42032  */
42033   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42034   __Pyx_GOTREF(__pyx_t_1);
42035   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
42036
42037   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1887
42038  *         """
42039  *         self._assertHasRoot()
42040  *         schema = XMLSchema(xmlschema)             # <<<<<<<<<<<<<<
42041  *         return schema.validate(self)
42042  * 
42043  */
42044   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42045   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
42046   __Pyx_INCREF(__pyx_v_xmlschema);
42047   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_xmlschema);
42048   __Pyx_GIVEREF(__pyx_v_xmlschema);
42049   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_XMLSchema)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42050   __Pyx_GOTREF(__pyx_t_2);
42051   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
42052   __Pyx_DECREF(__pyx_v_schema);
42053   __pyx_v_schema = __pyx_t_2;
42054   __pyx_t_2 = 0;
42055
42056   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1888
42057  *         self._assertHasRoot()
42058  *         schema = XMLSchema(xmlschema)
42059  *         return schema.validate(self)             # <<<<<<<<<<<<<<
42060  * 
42061  *     def xinclude(self):
42062  */
42063   __Pyx_XDECREF(__pyx_r);
42064   __pyx_t_2 = PyObject_GetAttr(__pyx_v_schema, __pyx_kp_validate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42065   __Pyx_GOTREF(__pyx_t_2);
42066   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42067   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
42068   __Pyx_INCREF(__pyx_v_self);
42069   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
42070   __Pyx_GIVEREF(__pyx_v_self);
42071   __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42072   __Pyx_GOTREF(__pyx_t_3);
42073   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
42074   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
42075   __pyx_r = __pyx_t_3;
42076   __pyx_t_3 = 0;
42077   goto __pyx_L0;
42078
42079   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
42080   goto __pyx_L0;
42081   __pyx_L1_error:;
42082   __Pyx_XDECREF(__pyx_t_1);
42083   __Pyx_XDECREF(__pyx_t_2);
42084   __Pyx_XDECREF(__pyx_t_3);
42085   __Pyx_AddTraceback("lxml.etree._ElementTree.xmlschema");
42086   __pyx_r = NULL;
42087   __pyx_L0:;
42088   __Pyx_DECREF(__pyx_v_schema);
42089   __Pyx_XGIVEREF(__pyx_r);
42090   __Pyx_FinishRefcountContext();
42091   return __pyx_r;
42092 }
42093
42094 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1890
42095  *         return schema.validate(self)
42096  * 
42097  *     def xinclude(self):             # <<<<<<<<<<<<<<
42098  *         u"""xinclude(self)
42099  * 
42100  */
42101
42102 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_xinclude(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
42103 static char __pyx_doc_4lxml_5etree_12_ElementTree_xinclude[] = "xinclude(self)\n\n        Process the XInclude nodes in this document and include the\n        referenced XML fragments.\n\n        There is support for loading files through the file system, HTTP and\n        FTP.\n\n        Note that XInclude does not support custom resolvers in Python space\n        due to restrictions of libxml2 <= 2.6.29.\n        ";
42104 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_xinclude(PyObject *__pyx_v_self, PyObject *unused) {
42105   PyObject *__pyx_r = NULL;
42106   PyObject *__pyx_t_1 = NULL;
42107   PyObject *__pyx_t_2 = NULL;
42108   PyObject *__pyx_t_3 = NULL;
42109   __Pyx_SetupRefcountContext("xinclude");
42110
42111   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1903
42112  *         """
42113  *         cdef int result
42114  *         self._assertHasRoot()             # <<<<<<<<<<<<<<
42115  *         XInclude()(self._context_node)
42116  * 
42117  */
42118   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42119   __Pyx_GOTREF(__pyx_t_1);
42120   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
42121
42122   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1904
42123  *         cdef int result
42124  *         self._assertHasRoot()
42125  *         XInclude()(self._context_node)             # <<<<<<<<<<<<<<
42126  * 
42127  *     def write_c14n(self, file, *, exclusive=False, with_comments=True,
42128  */
42129   __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_XInclude)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42130   __Pyx_GOTREF(__pyx_t_1);
42131   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42132   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
42133   __Pyx_INCREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node));
42134   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node));
42135   __Pyx_GIVEREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node));
42136   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42137   __Pyx_GOTREF(__pyx_t_3);
42138   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
42139   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
42140   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
42141
42142   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
42143   goto __pyx_L0;
42144   __pyx_L1_error:;
42145   __Pyx_XDECREF(__pyx_t_1);
42146   __Pyx_XDECREF(__pyx_t_2);
42147   __Pyx_XDECREF(__pyx_t_3);
42148   __Pyx_AddTraceback("lxml.etree._ElementTree.xinclude");
42149   __pyx_r = NULL;
42150   __pyx_L0:;
42151   __Pyx_XGIVEREF(__pyx_r);
42152   __Pyx_FinishRefcountContext();
42153   return __pyx_r;
42154 }
42155
42156 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1906
42157  *         XInclude()(self._context_node)
42158  * 
42159  *     def write_c14n(self, file, *, exclusive=False, with_comments=True,             # <<<<<<<<<<<<<<
42160  *                    compression=0):
42161  *         u"""write_c14n(self, file, exclusive=False, with_comments=True,
42162  */
42163
42164 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_write_c14n(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
42165 static char __pyx_doc_4lxml_5etree_12_ElementTree_write_c14n[] = "write_c14n(self, file, exclusive=False, with_comments=True,\n                       compression=0)\n\n        C14N write of document. Always writes UTF-8.\n\n        The ``compression`` option enables GZip compression level 1-9.\n        ";
42166 static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_write_c14n(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
42167   PyObject *__pyx_v_file = 0;
42168   PyObject *__pyx_v_exclusive = 0;
42169   PyObject *__pyx_v_with_comments = 0;
42170   PyObject *__pyx_v_compression = 0;
42171   PyObject *__pyx_r = NULL;
42172   PyObject *__pyx_t_1 = NULL;
42173   int __pyx_t_2;
42174   int __pyx_t_3;
42175   int __pyx_t_4;
42176   int __pyx_t_5;
42177   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_file,&__pyx_kp_exclusive,&__pyx_kp_with_comments,&__pyx_kp_compression,0};
42178   __Pyx_SetupRefcountContext("write_c14n");
42179   if (unlikely(__pyx_kwds)) {
42180     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
42181     PyObject* values[4] = {0,0,0,0};
42182     values[1] = __pyx_k_95;
42183     values[2] = __pyx_k_96;
42184     values[3] = __pyx_int_0;
42185     switch (PyTuple_GET_SIZE(__pyx_args)) {
42186       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
42187       case  0: break;
42188       default: goto __pyx_L5_argtuple_error;
42189     }
42190     switch (PyTuple_GET_SIZE(__pyx_args)) {
42191       case  0:
42192       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_file);
42193       if (likely(values[0])) kw_args--;
42194       else goto __pyx_L5_argtuple_error;
42195     }
42196     while (kw_args > 0) {
42197       PyObject* value;
42198       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_exclusive);
42199       if (value) { values[1] = value; if (!(--kw_args)) break; }
42200       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_with_comments);
42201       if (value) { values[2] = value; if (!(--kw_args)) break; }
42202       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_compression);
42203       if (value) { values[3] = value; if (!(--kw_args)) break; }
42204       break;
42205     }
42206     if (unlikely(kw_args > 0)) {
42207       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "write_c14n") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
42208     }
42209     __pyx_v_file = values[0];
42210     __pyx_v_exclusive = values[1];
42211     __pyx_v_with_comments = values[2];
42212     __pyx_v_compression = values[3];
42213   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
42214     goto __pyx_L5_argtuple_error;
42215   } else {
42216     __pyx_v_file = PyTuple_GET_ITEM(__pyx_args, 0);
42217     __pyx_v_exclusive = __pyx_k_95;
42218     __pyx_v_with_comments = __pyx_k_96;
42219     __pyx_v_compression = __pyx_int_0;
42220   }
42221   goto __pyx_L4_argument_unpacking_done;
42222   __pyx_L5_argtuple_error:;
42223   __Pyx_RaiseArgtupleInvalid("write_c14n", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
42224   __pyx_L3_error:;
42225   __Pyx_AddTraceback("lxml.etree._ElementTree.write_c14n");
42226   return NULL;
42227   __pyx_L4_argument_unpacking_done:;
42228   __Pyx_INCREF(__pyx_v_compression);
42229
42230   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1915
42231  *         The ``compression`` option enables GZip compression level 1-9.
42232  *         """
42233  *         self._assertHasRoot()             # <<<<<<<<<<<<<<
42234  *         if compression is None or compression < 0:
42235  *             compression = 0
42236  */
42237   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42238   __Pyx_GOTREF(__pyx_t_1);
42239   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
42240
42241   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1916
42242  *         """
42243  *         self._assertHasRoot()
42244  *         if compression is None or compression < 0:             # <<<<<<<<<<<<<<
42245  *             compression = 0
42246  *         _tofilelikeC14N(file, self._context_node, exclusive, with_comments,
42247  */
42248   __pyx_t_2 = (__pyx_v_compression == Py_None);
42249   if (!__pyx_t_2) {
42250     __pyx_t_1 = PyObject_RichCompare(__pyx_v_compression, __pyx_int_0, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42251     __Pyx_GOTREF(__pyx_t_1);
42252     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42253     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
42254     __pyx_t_4 = __pyx_t_3;
42255   } else {
42256     __pyx_t_4 = __pyx_t_2;
42257   }
42258   if (__pyx_t_4) {
42259
42260     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1917
42261  *         self._assertHasRoot()
42262  *         if compression is None or compression < 0:
42263  *             compression = 0             # <<<<<<<<<<<<<<
42264  *         _tofilelikeC14N(file, self._context_node, exclusive, with_comments,
42265  *                         compression)
42266  */
42267     __Pyx_INCREF(__pyx_int_0);
42268     __Pyx_DECREF(__pyx_v_compression);
42269     __pyx_v_compression = __pyx_int_0;
42270     goto __pyx_L6;
42271   }
42272   __pyx_L6:;
42273
42274   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1918
42275  *         if compression is None or compression < 0:
42276  *             compression = 0
42277  *         _tofilelikeC14N(file, self._context_node, exclusive, with_comments,             # <<<<<<<<<<<<<<
42278  *                         compression)
42279  * 
42280  */
42281   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_exclusive); if (unlikely((__pyx_t_4 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42282   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_with_comments); if (unlikely((__pyx_t_2 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42283
42284   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1919
42285  *             compression = 0
42286  *         _tofilelikeC14N(file, self._context_node, exclusive, with_comments,
42287  *                         compression)             # <<<<<<<<<<<<<<
42288  * 
42289  * cdef _ElementTree _elementTreeFactory(_Document doc, _Element context_node):
42290  */
42291   __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_compression); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42292   __pyx_t_1 = __pyx_f_4lxml_5etree__tofilelikeC14N(__pyx_v_file, ((struct LxmlElementTree *)__pyx_v_self)->_context_node, __pyx_t_4, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42293   __Pyx_GOTREF(__pyx_t_1);
42294   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
42295
42296   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
42297   goto __pyx_L0;
42298   __pyx_L1_error:;
42299   __Pyx_XDECREF(__pyx_t_1);
42300   __Pyx_AddTraceback("lxml.etree._ElementTree.write_c14n");
42301   __pyx_r = NULL;
42302   __pyx_L0:;
42303   __Pyx_DECREF(__pyx_v_compression);
42304   __Pyx_XGIVEREF(__pyx_r);
42305   __Pyx_FinishRefcountContext();
42306   return __pyx_r;
42307 }
42308
42309 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1921
42310  *                         compression)
42311  * 
42312  * cdef _ElementTree _elementTreeFactory(_Document doc, _Element context_node):             # <<<<<<<<<<<<<<
42313  *     return _newElementTree(doc, context_node, _ElementTree)
42314  * 
42315  */
42316
42317 static  struct LxmlElementTree *__pyx_f_4lxml_5etree__elementTreeFactory(struct LxmlDocument *__pyx_v_doc, struct LxmlElement *__pyx_v_context_node) {
42318   struct LxmlElementTree *__pyx_r = NULL;
42319   PyObject *__pyx_t_1 = NULL;
42320   __Pyx_SetupRefcountContext("_elementTreeFactory");
42321
42322   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1922
42323  * 
42324  * cdef _ElementTree _elementTreeFactory(_Document doc, _Element context_node):
42325  *     return _newElementTree(doc, context_node, _ElementTree)             # <<<<<<<<<<<<<<
42326  * 
42327  * cdef _ElementTree _newElementTree(_Document doc, _Element context_node,
42328  */
42329   __Pyx_XDECREF(((PyObject *)__pyx_r));
42330   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__newElementTree(__pyx_v_doc, __pyx_v_context_node, ((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ElementTree)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42331   __Pyx_GOTREF(__pyx_t_1);
42332   __pyx_r = ((struct LxmlElementTree *)__pyx_t_1);
42333   __pyx_t_1 = 0;
42334   goto __pyx_L0;
42335
42336   __pyx_r = ((struct LxmlElementTree *)Py_None); __Pyx_INCREF(Py_None);
42337   goto __pyx_L0;
42338   __pyx_L1_error:;
42339   __Pyx_XDECREF(__pyx_t_1);
42340   __Pyx_AddTraceback("lxml.etree._elementTreeFactory");
42341   __pyx_r = 0;
42342   __pyx_L0:;
42343   __Pyx_XGIVEREF((PyObject *)__pyx_r);
42344   __Pyx_FinishRefcountContext();
42345   return __pyx_r;
42346 }
42347
42348 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1924
42349  *     return _newElementTree(doc, context_node, _ElementTree)
42350  * 
42351  * cdef _ElementTree _newElementTree(_Document doc, _Element context_node,             # <<<<<<<<<<<<<<
42352  *                                   object baseclass):
42353  *     cdef _ElementTree result
42354  */
42355
42356 static  struct LxmlElementTree *__pyx_f_4lxml_5etree__newElementTree(struct LxmlDocument *__pyx_v_doc, struct LxmlElement *__pyx_v_context_node, PyObject *__pyx_v_baseclass) {
42357   struct LxmlElementTree *__pyx_v_result;
42358   struct LxmlElementTree *__pyx_r = NULL;
42359   PyObject *__pyx_t_1 = NULL;
42360   int __pyx_t_2;
42361   int __pyx_t_3;
42362   int __pyx_t_4;
42363   __Pyx_SetupRefcountContext("_newElementTree");
42364   __Pyx_INCREF((PyObject *)__pyx_v_context_node);
42365   __pyx_v_result = ((struct LxmlElementTree *)Py_None); __Pyx_INCREF(Py_None);
42366
42367   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1927
42368  *                                   object baseclass):
42369  *     cdef _ElementTree result
42370  *     result = baseclass()             # <<<<<<<<<<<<<<
42371  *     if context_node is None and doc is not None:
42372  *         context_node = doc.getroot()
42373  */
42374   __pyx_t_1 = PyObject_Call(__pyx_v_baseclass, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42375   __Pyx_GOTREF(__pyx_t_1);
42376   if (!(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__ElementTree))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42377   __Pyx_DECREF(((PyObject *)__pyx_v_result));
42378   __pyx_v_result = ((struct LxmlElementTree *)__pyx_t_1);
42379   __pyx_t_1 = 0;
42380
42381   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1928
42382  *     cdef _ElementTree result
42383  *     result = baseclass()
42384  *     if context_node is None and doc is not None:             # <<<<<<<<<<<<<<
42385  *         context_node = doc.getroot()
42386  *     if context_node is None:
42387  */
42388   __pyx_t_2 = (((PyObject *)__pyx_v_context_node) == Py_None);
42389   if (__pyx_t_2) {
42390     __pyx_t_3 = (((PyObject *)__pyx_v_doc) != Py_None);
42391     __pyx_t_4 = __pyx_t_3;
42392   } else {
42393     __pyx_t_4 = __pyx_t_2;
42394   }
42395   if (__pyx_t_4) {
42396
42397     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1929
42398  *     result = baseclass()
42399  *     if context_node is None and doc is not None:
42400  *         context_node = doc.getroot()             # <<<<<<<<<<<<<<
42401  *     if context_node is None:
42402  *         result._doc = doc
42403  */
42404     __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_doc->__pyx_vtab)->getroot(__pyx_v_doc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42405     __Pyx_GOTREF(__pyx_t_1);
42406     if (!(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42407     __Pyx_DECREF(((PyObject *)__pyx_v_context_node));
42408     __pyx_v_context_node = ((struct LxmlElement *)__pyx_t_1);
42409     __pyx_t_1 = 0;
42410     goto __pyx_L3;
42411   }
42412   __pyx_L3:;
42413
42414   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1930
42415  *     if context_node is None and doc is not None:
42416  *         context_node = doc.getroot()
42417  *     if context_node is None:             # <<<<<<<<<<<<<<
42418  *         result._doc = doc
42419  *     result._context_node = context_node
42420  */
42421   __pyx_t_4 = (((PyObject *)__pyx_v_context_node) == Py_None);
42422   if (__pyx_t_4) {
42423
42424     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1931
42425  *         context_node = doc.getroot()
42426  *     if context_node is None:
42427  *         result._doc = doc             # <<<<<<<<<<<<<<
42428  *     result._context_node = context_node
42429  *     return result
42430  */
42431     __Pyx_INCREF(((PyObject *)__pyx_v_doc));
42432     __Pyx_GIVEREF(((PyObject *)__pyx_v_doc));
42433     __Pyx_GOTREF(__pyx_v_result->_doc);
42434     __Pyx_DECREF(((PyObject *)__pyx_v_result->_doc));
42435     __pyx_v_result->_doc = __pyx_v_doc;
42436     goto __pyx_L4;
42437   }
42438   __pyx_L4:;
42439
42440   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1932
42441  *     if context_node is None:
42442  *         result._doc = doc
42443  *     result._context_node = context_node             # <<<<<<<<<<<<<<
42444  *     return result
42445  * 
42446  */
42447   __Pyx_INCREF(((PyObject *)__pyx_v_context_node));
42448   __Pyx_GIVEREF(((PyObject *)__pyx_v_context_node));
42449   __Pyx_GOTREF(__pyx_v_result->_context_node);
42450   __Pyx_DECREF(((PyObject *)__pyx_v_result->_context_node));
42451   __pyx_v_result->_context_node = __pyx_v_context_node;
42452
42453   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1933
42454  *         result._doc = doc
42455  *     result._context_node = context_node
42456  *     return result             # <<<<<<<<<<<<<<
42457  * 
42458  * 
42459  */
42460   __Pyx_XDECREF(((PyObject *)__pyx_r));
42461   __Pyx_INCREF(((PyObject *)__pyx_v_result));
42462   __pyx_r = __pyx_v_result;
42463   goto __pyx_L0;
42464
42465   __pyx_r = ((struct LxmlElementTree *)Py_None); __Pyx_INCREF(Py_None);
42466   goto __pyx_L0;
42467   __pyx_L1_error:;
42468   __Pyx_XDECREF(__pyx_t_1);
42469   __Pyx_AddTraceback("lxml.etree._newElementTree");
42470   __pyx_r = 0;
42471   __pyx_L0:;
42472   __Pyx_DECREF((PyObject *)__pyx_v_result);
42473   __Pyx_DECREF((PyObject *)__pyx_v_context_node);
42474   __Pyx_XGIVEREF((PyObject *)__pyx_r);
42475   __Pyx_FinishRefcountContext();
42476   return __pyx_r;
42477 }
42478
42479 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1940
42480  *     """
42481  *     cdef _Element _element
42482  *     def __init__(self, _Element element not None):             # <<<<<<<<<<<<<<
42483  *         self._element = element
42484  * 
42485  */
42486
42487 static int __pyx_pf_4lxml_5etree_7_Attrib___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
42488 static int __pyx_pf_4lxml_5etree_7_Attrib___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
42489   struct LxmlElement *__pyx_v_element = 0;
42490   int __pyx_r;
42491   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_element,0};
42492   __Pyx_SetupRefcountContext("__init__");
42493   if (unlikely(__pyx_kwds)) {
42494     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
42495     PyObject* values[1] = {0};
42496     switch (PyTuple_GET_SIZE(__pyx_args)) {
42497       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
42498       case  0: break;
42499       default: goto __pyx_L5_argtuple_error;
42500     }
42501     switch (PyTuple_GET_SIZE(__pyx_args)) {
42502       case  0:
42503       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_element);
42504       if (likely(values[0])) kw_args--;
42505       else goto __pyx_L5_argtuple_error;
42506     }
42507     if (unlikely(kw_args > 0)) {
42508       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
42509     }
42510     __pyx_v_element = ((struct LxmlElement *)values[0]);
42511   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
42512     goto __pyx_L5_argtuple_error;
42513   } else {
42514     __pyx_v_element = ((struct LxmlElement *)PyTuple_GET_ITEM(__pyx_args, 0));
42515   }
42516   goto __pyx_L4_argument_unpacking_done;
42517   __pyx_L5_argtuple_error:;
42518   __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
42519   __pyx_L3_error:;
42520   __Pyx_AddTraceback("lxml.etree._Attrib.__init__");
42521   return -1;
42522   __pyx_L4_argument_unpacking_done:;
42523   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42524
42525   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1941
42526  *     cdef _Element _element
42527  *     def __init__(self, _Element element not None):
42528  *         self._element = element             # <<<<<<<<<<<<<<
42529  * 
42530  *     # MANIPULATORS
42531  */
42532   __Pyx_INCREF(((PyObject *)__pyx_v_element));
42533   __Pyx_GIVEREF(((PyObject *)__pyx_v_element));
42534   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element);
42535   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element));
42536   ((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element = __pyx_v_element;
42537
42538   __pyx_r = 0;
42539   goto __pyx_L0;
42540   __pyx_L1_error:;
42541   __Pyx_AddTraceback("lxml.etree._Attrib.__init__");
42542   __pyx_r = -1;
42543   __pyx_L0:;
42544   __Pyx_FinishRefcountContext();
42545   return __pyx_r;
42546 }
42547
42548 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1944
42549  * 
42550  *     # MANIPULATORS
42551  *     def __setitem__(self, key, value):             # <<<<<<<<<<<<<<
42552  *         _setAttributeValue(self._element, key, value)
42553  * 
42554  */
42555
42556 static int __pyx_pf_4lxml_5etree_7_Attrib___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /*proto*/
42557 static int __pyx_pf_4lxml_5etree_7_Attrib___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
42558   int __pyx_r;
42559   int __pyx_t_1;
42560   __Pyx_SetupRefcountContext("__setitem__");
42561
42562   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1945
42563  *     # MANIPULATORS
42564  *     def __setitem__(self, key, value):
42565  *         _setAttributeValue(self._element, key, value)             # <<<<<<<<<<<<<<
42566  * 
42567  *     def __delitem__(self, key):
42568  */
42569   __pyx_t_1 = __pyx_f_4lxml_5etree__setAttributeValue(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element, __pyx_v_key, __pyx_v_value); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42570
42571   __pyx_r = 0;
42572   goto __pyx_L0;
42573   __pyx_L1_error:;
42574   __Pyx_AddTraceback("lxml.etree._Attrib.__setitem__");
42575   __pyx_r = -1;
42576   __pyx_L0:;
42577   __Pyx_FinishRefcountContext();
42578   return __pyx_r;
42579 }
42580
42581 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1947
42582  *         _setAttributeValue(self._element, key, value)
42583  * 
42584  *     def __delitem__(self, key):             # <<<<<<<<<<<<<<
42585  *         _delAttribute(self._element, key)
42586  * 
42587  */
42588
42589 static int __pyx_pf_4lxml_5etree_7_Attrib___delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
42590 static int __pyx_pf_4lxml_5etree_7_Attrib___delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
42591   int __pyx_r;
42592   int __pyx_t_1;
42593   __Pyx_SetupRefcountContext("__delitem__");
42594
42595   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1948
42596  * 
42597  *     def __delitem__(self, key):
42598  *         _delAttribute(self._element, key)             # <<<<<<<<<<<<<<
42599  * 
42600  *     def update(self, sequence_or_dict):
42601  */
42602   __pyx_t_1 = __pyx_f_4lxml_5etree__delAttribute(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element, __pyx_v_key); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42603
42604   __pyx_r = 0;
42605   goto __pyx_L0;
42606   __pyx_L1_error:;
42607   __Pyx_AddTraceback("lxml.etree._Attrib.__delitem__");
42608   __pyx_r = -1;
42609   __pyx_L0:;
42610   __Pyx_FinishRefcountContext();
42611   return __pyx_r;
42612 }
42613
42614 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1950
42615  *         _delAttribute(self._element, key)
42616  * 
42617  *     def update(self, sequence_or_dict):             # <<<<<<<<<<<<<<
42618  *         if isinstance(sequence_or_dict, dict):
42619  *             sequence_or_dict = sequence_or_dict.items()
42620  */
42621
42622 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_update(PyObject *__pyx_v_self, PyObject *__pyx_v_sequence_or_dict); /*proto*/
42623 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_update(PyObject *__pyx_v_self, PyObject *__pyx_v_sequence_or_dict) {
42624   PyObject *__pyx_v_key;
42625   PyObject *__pyx_v_value;
42626   PyObject *__pyx_r = NULL;
42627   PyObject *__pyx_1 = 0;
42628   PyObject *__pyx_2 = 0;
42629   PyObject *__pyx_3 = 0;
42630   int __pyx_t_1;
42631   PyObject *__pyx_t_2 = NULL;
42632   PyObject *__pyx_t_3 = NULL;
42633   Py_ssize_t __pyx_t_4;
42634   int __pyx_t_5;
42635   __Pyx_SetupRefcountContext("update");
42636   __Pyx_INCREF(__pyx_v_sequence_or_dict);
42637   __pyx_v_key = Py_None; __Pyx_INCREF(Py_None);
42638   __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);
42639
42640   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1951
42641  * 
42642  *     def update(self, sequence_or_dict):
42643  *         if isinstance(sequence_or_dict, dict):             # <<<<<<<<<<<<<<
42644  *             sequence_or_dict = sequence_or_dict.items()
42645  *         for key, value in sequence_or_dict:
42646  */
42647   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_sequence_or_dict, ((PyTypeObject *)((PyObject*)&PyDict_Type))); 
42648   if (__pyx_t_1) {
42649
42650     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1952
42651  *     def update(self, sequence_or_dict):
42652  *         if isinstance(sequence_or_dict, dict):
42653  *             sequence_or_dict = sequence_or_dict.items()             # <<<<<<<<<<<<<<
42654  *         for key, value in sequence_or_dict:
42655  *             _setAttributeValue(self._element, key, value)
42656  */
42657     __pyx_t_2 = PyObject_GetAttr(__pyx_v_sequence_or_dict, __pyx_kp_items); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42658     __Pyx_GOTREF(__pyx_t_2);
42659     __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42660     __Pyx_GOTREF(__pyx_t_3);
42661     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
42662     __Pyx_DECREF(__pyx_v_sequence_or_dict);
42663     __pyx_v_sequence_or_dict = __pyx_t_3;
42664     __pyx_t_3 = 0;
42665     goto __pyx_L5;
42666   }
42667   __pyx_L5:;
42668
42669   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1953
42670  *         if isinstance(sequence_or_dict, dict):
42671  *             sequence_or_dict = sequence_or_dict.items()
42672  *         for key, value in sequence_or_dict:             # <<<<<<<<<<<<<<
42673  *             _setAttributeValue(self._element, key, value)
42674  * 
42675  */
42676   if (PyList_CheckExact(__pyx_v_sequence_or_dict) || PyTuple_CheckExact(__pyx_v_sequence_or_dict)) {
42677     __pyx_t_4 = 0; __pyx_t_3 = __pyx_v_sequence_or_dict; __Pyx_INCREF(__pyx_t_3);
42678   } else {
42679     __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_sequence_or_dict); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42680     __Pyx_GOTREF(__pyx_t_3);
42681   }
42682   for (;;) {
42683     if (likely(PyList_CheckExact(__pyx_t_3))) {
42684       if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
42685       __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
42686     } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
42687       if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
42688       __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
42689     } else {
42690       __pyx_t_2 = PyIter_Next(__pyx_t_3);
42691       if (!__pyx_t_2) {
42692         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42693         break;
42694       }
42695       __Pyx_GOTREF(__pyx_t_2);
42696     }
42697     if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 2)) {
42698       PyObject* tuple = __pyx_t_2;
42699       __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
42700       __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
42701       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
42702       __Pyx_DECREF(__pyx_v_key);
42703       __pyx_v_key = __pyx_2;
42704       __pyx_2 = 0;
42705       __Pyx_DECREF(__pyx_v_value);
42706       __pyx_v_value = __pyx_3;
42707       __pyx_3 = 0;
42708     } else {
42709       __pyx_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42710       __Pyx_GOTREF(__pyx_1);
42711       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
42712       __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42713       __Pyx_GOTREF(__pyx_2);
42714       __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42715       __Pyx_GOTREF(__pyx_3);
42716       if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42717       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
42718       __Pyx_DECREF(__pyx_v_key);
42719       __pyx_v_key = __pyx_2;
42720       __pyx_2 = 0;
42721       __Pyx_DECREF(__pyx_v_value);
42722       __pyx_v_value = __pyx_3;
42723       __pyx_3 = 0;
42724     }
42725
42726     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1954
42727  *             sequence_or_dict = sequence_or_dict.items()
42728  *         for key, value in sequence_or_dict:
42729  *             _setAttributeValue(self._element, key, value)             # <<<<<<<<<<<<<<
42730  * 
42731  *     def pop(self, key, *default):
42732  */
42733     __pyx_t_5 = __pyx_f_4lxml_5etree__setAttributeValue(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element, __pyx_v_key, __pyx_v_value); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42734   }
42735   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
42736
42737   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
42738   goto __pyx_L0;
42739   __pyx_L1_error:;
42740   __Pyx_XDECREF(__pyx_1);
42741   __Pyx_XDECREF(__pyx_2);
42742   __Pyx_XDECREF(__pyx_3);
42743   __Pyx_XDECREF(__pyx_t_2);
42744   __Pyx_XDECREF(__pyx_t_3);
42745   __Pyx_AddTraceback("lxml.etree._Attrib.update");
42746   __pyx_r = NULL;
42747   __pyx_L0:;
42748   __Pyx_DECREF(__pyx_v_key);
42749   __Pyx_DECREF(__pyx_v_value);
42750   __Pyx_DECREF(__pyx_v_sequence_or_dict);
42751   __Pyx_XGIVEREF(__pyx_r);
42752   __Pyx_FinishRefcountContext();
42753   return __pyx_r;
42754 }
42755
42756 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1956
42757  *             _setAttributeValue(self._element, key, value)
42758  * 
42759  *     def pop(self, key, *default):             # <<<<<<<<<<<<<<
42760  *         if python.PyTuple_GET_SIZE(default) > 1:
42761  *             raise TypeError, u"pop expected at most 2 arguments, got %d" % (
42762  */
42763
42764 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_pop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
42765 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_pop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
42766   PyObject *__pyx_v_key = 0;
42767   PyObject *__pyx_v_default = 0;
42768   PyObject *__pyx_v_result;
42769   PyObject *__pyx_r = NULL;
42770   int __pyx_t_1;
42771   PyObject *__pyx_t_2 = NULL;
42772   PyObject *__pyx_t_3 = NULL;
42773   int __pyx_t_4;
42774   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_key,0};
42775   __Pyx_SetupRefcountContext("pop");
42776   if (PyTuple_GET_SIZE(__pyx_args) > 1) {
42777     __pyx_v_default = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); __Pyx_GOTREF(__pyx_v_default);
42778     if (unlikely(!__pyx_v_default)) return NULL;
42779   } else {
42780     __pyx_v_default = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
42781   }
42782   if (unlikely(__pyx_kwds)) {
42783     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
42784     PyObject* values[1] = {0};
42785     switch (PyTuple_GET_SIZE(__pyx_args)) {
42786       default:
42787       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
42788       case  0: break;
42789     }
42790     switch (PyTuple_GET_SIZE(__pyx_args)) {
42791       case  0:
42792       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_key);
42793       if (likely(values[0])) kw_args--;
42794       else goto __pyx_L5_argtuple_error;
42795     }
42796     if (unlikely(kw_args > 0)) {
42797       const Py_ssize_t used_pos_args = (PyTuple_GET_SIZE(__pyx_args) < 1) ? PyTuple_GET_SIZE(__pyx_args) : 1;
42798       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "pop") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
42799     }
42800     __pyx_v_key = values[0];
42801   } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
42802     goto __pyx_L5_argtuple_error;
42803   } else {
42804     __pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 0);
42805   }
42806   goto __pyx_L4_argument_unpacking_done;
42807   __pyx_L5_argtuple_error:;
42808   __Pyx_RaiseArgtupleInvalid("pop", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
42809   __pyx_L3_error:;
42810   __Pyx_DECREF(__pyx_v_default);
42811   __Pyx_AddTraceback("lxml.etree._Attrib.pop");
42812   return NULL;
42813   __pyx_L4_argument_unpacking_done:;
42814   __pyx_v_result = Py_None; __Pyx_INCREF(Py_None);
42815
42816   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1957
42817  * 
42818  *     def pop(self, key, *default):
42819  *         if python.PyTuple_GET_SIZE(default) > 1:             # <<<<<<<<<<<<<<
42820  *             raise TypeError, u"pop expected at most 2 arguments, got %d" % (
42821  *                 python.PyTuple_GET_SIZE(default)+1)
42822  */
42823   __pyx_t_1 = (PyTuple_GET_SIZE(__pyx_v_default) > 1);
42824   if (__pyx_t_1) {
42825
42826     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1959
42827  *         if python.PyTuple_GET_SIZE(default) > 1:
42828  *             raise TypeError, u"pop expected at most 2 arguments, got %d" % (
42829  *                 python.PyTuple_GET_SIZE(default)+1)             # <<<<<<<<<<<<<<
42830  *         result = _getAttributeValue(self._element, key, None)
42831  *         if result is None:
42832  */
42833     __pyx_t_2 = PyInt_FromSsize_t((PyTuple_GET_SIZE(__pyx_v_default) + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42834     __Pyx_GOTREF(__pyx_t_2);
42835     __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_372), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42836     __Pyx_GOTREF(__pyx_t_3);
42837     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
42838     __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_3, 0);
42839     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
42840     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42841     goto __pyx_L6;
42842   }
42843   __pyx_L6:;
42844
42845   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1960
42846  *             raise TypeError, u"pop expected at most 2 arguments, got %d" % (
42847  *                 python.PyTuple_GET_SIZE(default)+1)
42848  *         result = _getAttributeValue(self._element, key, None)             # <<<<<<<<<<<<<<
42849  *         if result is None:
42850  *             if python.PyTuple_GET_SIZE(default) == 0:
42851  */
42852   __pyx_t_3 = __pyx_f_4lxml_5etree__getAttributeValue(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element, __pyx_v_key, Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42853   __Pyx_GOTREF(__pyx_t_3);
42854   __Pyx_DECREF(__pyx_v_result);
42855   __pyx_v_result = __pyx_t_3;
42856   __pyx_t_3 = 0;
42857
42858   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1961
42859  *                 python.PyTuple_GET_SIZE(default)+1)
42860  *         result = _getAttributeValue(self._element, key, None)
42861  *         if result is None:             # <<<<<<<<<<<<<<
42862  *             if python.PyTuple_GET_SIZE(default) == 0:
42863  *                 raise KeyError, key
42864  */
42865   __pyx_t_1 = (__pyx_v_result == Py_None);
42866   if (__pyx_t_1) {
42867
42868     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1962
42869  *         result = _getAttributeValue(self._element, key, None)
42870  *         if result is None:
42871  *             if python.PyTuple_GET_SIZE(default) == 0:             # <<<<<<<<<<<<<<
42872  *                 raise KeyError, key
42873  *             else:
42874  */
42875     __pyx_t_1 = (PyTuple_GET_SIZE(__pyx_v_default) == 0);
42876     if (__pyx_t_1) {
42877
42878       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1963
42879  *         if result is None:
42880  *             if python.PyTuple_GET_SIZE(default) == 0:
42881  *                 raise KeyError, key             # <<<<<<<<<<<<<<
42882  *             else:
42883  *                 result = python.PyTuple_GET_ITEM(default, 0)
42884  */
42885       __Pyx_Raise(__pyx_builtin_KeyError, __pyx_v_key, 0);
42886       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42887       goto __pyx_L8;
42888     }
42889     /*else*/ {
42890
42891       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1965
42892  *                 raise KeyError, key
42893  *             else:
42894  *                 result = python.PyTuple_GET_ITEM(default, 0)             # <<<<<<<<<<<<<<
42895  *                 python.Py_INCREF(result)
42896  *         else:
42897  */
42898       __pyx_t_3 = PyTuple_GET_ITEM(__pyx_v_default, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42899       __Pyx_GOTREF(__pyx_t_3);
42900       __Pyx_DECREF(__pyx_v_result);
42901       __pyx_v_result = __pyx_t_3;
42902       __pyx_t_3 = 0;
42903
42904       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1966
42905  *             else:
42906  *                 result = python.PyTuple_GET_ITEM(default, 0)
42907  *                 python.Py_INCREF(result)             # <<<<<<<<<<<<<<
42908  *         else:
42909  *             _delAttribute(self._element, key)
42910  */
42911       Py_INCREF(__pyx_v_result);
42912     }
42913     __pyx_L8:;
42914     goto __pyx_L7;
42915   }
42916   /*else*/ {
42917
42918     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1968
42919  *                 python.Py_INCREF(result)
42920  *         else:
42921  *             _delAttribute(self._element, key)             # <<<<<<<<<<<<<<
42922  *         return result
42923  * 
42924  */
42925     __pyx_t_4 = __pyx_f_4lxml_5etree__delAttribute(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element, __pyx_v_key); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42926   }
42927   __pyx_L7:;
42928
42929   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1969
42930  *         else:
42931  *             _delAttribute(self._element, key)
42932  *         return result             # <<<<<<<<<<<<<<
42933  * 
42934  *     def clear(self):
42935  */
42936   __Pyx_XDECREF(__pyx_r);
42937   __Pyx_INCREF(__pyx_v_result);
42938   __pyx_r = __pyx_v_result;
42939   goto __pyx_L0;
42940
42941   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
42942   goto __pyx_L0;
42943   __pyx_L1_error:;
42944   __Pyx_XDECREF(__pyx_t_2);
42945   __Pyx_XDECREF(__pyx_t_3);
42946   __Pyx_AddTraceback("lxml.etree._Attrib.pop");
42947   __pyx_r = NULL;
42948   __pyx_L0:;
42949   __Pyx_DECREF(__pyx_v_default);
42950   __Pyx_DECREF(__pyx_v_result);
42951   __Pyx_XGIVEREF(__pyx_r);
42952   __Pyx_FinishRefcountContext();
42953   return __pyx_r;
42954 }
42955
42956 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1971
42957  *         return result
42958  * 
42959  *     def clear(self):             # <<<<<<<<<<<<<<
42960  *         cdef xmlNode* c_node
42961  *         c_node = self._element._c_node
42962  */
42963
42964 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_clear(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
42965 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_clear(PyObject *__pyx_v_self, PyObject *unused) {
42966   xmlNode *__pyx_v_c_node;
42967   PyObject *__pyx_r = NULL;
42968   int __pyx_t_1;
42969   __Pyx_SetupRefcountContext("clear");
42970
42971   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1973
42972  *     def clear(self):
42973  *         cdef xmlNode* c_node
42974  *         c_node = self._element._c_node             # <<<<<<<<<<<<<<
42975  *         while c_node.properties is not NULL:
42976  *             tree.xmlRemoveProp(c_node.properties)
42977  */
42978   __pyx_v_c_node = ((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element->_c_node;
42979
42980   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1974
42981  *         cdef xmlNode* c_node
42982  *         c_node = self._element._c_node
42983  *         while c_node.properties is not NULL:             # <<<<<<<<<<<<<<
42984  *             tree.xmlRemoveProp(c_node.properties)
42985  * 
42986  */
42987   while (1) {
42988     __pyx_t_1 = (__pyx_v_c_node->properties != NULL);
42989     if (!__pyx_t_1) break;
42990
42991     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1975
42992  *         c_node = self._element._c_node
42993  *         while c_node.properties is not NULL:
42994  *             tree.xmlRemoveProp(c_node.properties)             # <<<<<<<<<<<<<<
42995  * 
42996  *     # ACCESSORS
42997  */
42998     xmlRemoveProp(__pyx_v_c_node->properties);
42999   }
43000
43001   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
43002   __Pyx_XGIVEREF(__pyx_r);
43003   __Pyx_FinishRefcountContext();
43004   return __pyx_r;
43005 }
43006
43007 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1978
43008  * 
43009  *     # ACCESSORS
43010  *     def __repr__(self):             # <<<<<<<<<<<<<<
43011  *         return repr(dict( _attributeIteratorFactory(self._element, 3) ))
43012  * 
43013  */
43014
43015 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib___repr__(PyObject *__pyx_v_self); /*proto*/
43016 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib___repr__(PyObject *__pyx_v_self) {
43017   PyObject *__pyx_r = NULL;
43018   PyObject *__pyx_t_1 = NULL;
43019   PyObject *__pyx_t_2 = NULL;
43020   __Pyx_SetupRefcountContext("__repr__");
43021
43022   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1979
43023  *     # ACCESSORS
43024  *     def __repr__(self):
43025  *         return repr(dict( _attributeIteratorFactory(self._element, 3) ))             # <<<<<<<<<<<<<<
43026  * 
43027  *     def __getitem__(self, key):
43028  */
43029   __Pyx_XDECREF(__pyx_r);
43030   __pyx_t_1 = __pyx_f_4lxml_5etree__attributeIteratorFactory(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element, 3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43031   __Pyx_GOTREF(__pyx_t_1);
43032   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43033   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
43034   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
43035   __Pyx_GIVEREF(__pyx_t_1);
43036   __pyx_t_1 = 0;
43037   __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)&PyDict_Type)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43038   __Pyx_GOTREF(__pyx_t_1);
43039   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
43040   __pyx_t_2 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43041   __Pyx_GOTREF(__pyx_t_2);
43042   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
43043   __pyx_r = __pyx_t_2;
43044   __pyx_t_2 = 0;
43045   goto __pyx_L0;
43046
43047   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
43048   goto __pyx_L0;
43049   __pyx_L1_error:;
43050   __Pyx_XDECREF(__pyx_t_1);
43051   __Pyx_XDECREF(__pyx_t_2);
43052   __Pyx_AddTraceback("lxml.etree._Attrib.__repr__");
43053   __pyx_r = NULL;
43054   __pyx_L0:;
43055   __Pyx_XGIVEREF(__pyx_r);
43056   __Pyx_FinishRefcountContext();
43057   return __pyx_r;
43058 }
43059
43060 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1981
43061  *         return repr(dict( _attributeIteratorFactory(self._element, 3) ))
43062  * 
43063  *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
43064  *         result = _getAttributeValue(self._element, key, None)
43065  *         if result is None:
43066  */
43067
43068 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
43069 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
43070   PyObject *__pyx_v_result;
43071   PyObject *__pyx_r = NULL;
43072   PyObject *__pyx_t_1 = NULL;
43073   int __pyx_t_2;
43074   __Pyx_SetupRefcountContext("__getitem__");
43075   __pyx_v_result = Py_None; __Pyx_INCREF(Py_None);
43076
43077   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1982
43078  * 
43079  *     def __getitem__(self, key):
43080  *         result = _getAttributeValue(self._element, key, None)             # <<<<<<<<<<<<<<
43081  *         if result is None:
43082  *             raise KeyError, key
43083  */
43084   __pyx_t_1 = __pyx_f_4lxml_5etree__getAttributeValue(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element, __pyx_v_key, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43085   __Pyx_GOTREF(__pyx_t_1);
43086   __Pyx_DECREF(__pyx_v_result);
43087   __pyx_v_result = __pyx_t_1;
43088   __pyx_t_1 = 0;
43089
43090   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1983
43091  *     def __getitem__(self, key):
43092  *         result = _getAttributeValue(self._element, key, None)
43093  *         if result is None:             # <<<<<<<<<<<<<<
43094  *             raise KeyError, key
43095  *         else:
43096  */
43097   __pyx_t_2 = (__pyx_v_result == Py_None);
43098   if (__pyx_t_2) {
43099
43100     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1984
43101  *         result = _getAttributeValue(self._element, key, None)
43102  *         if result is None:
43103  *             raise KeyError, key             # <<<<<<<<<<<<<<
43104  *         else:
43105  *             return result
43106  */
43107     __Pyx_Raise(__pyx_builtin_KeyError, __pyx_v_key, 0);
43108     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43109     goto __pyx_L5;
43110   }
43111   /*else*/ {
43112
43113     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1986
43114  *             raise KeyError, key
43115  *         else:
43116  *             return result             # <<<<<<<<<<<<<<
43117  * 
43118  *     def __nonzero__(self):
43119  */
43120     __Pyx_XDECREF(__pyx_r);
43121     __Pyx_INCREF(__pyx_v_result);
43122     __pyx_r = __pyx_v_result;
43123     goto __pyx_L0;
43124   }
43125   __pyx_L5:;
43126
43127   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
43128   goto __pyx_L0;
43129   __pyx_L1_error:;
43130   __Pyx_XDECREF(__pyx_t_1);
43131   __Pyx_AddTraceback("lxml.etree._Attrib.__getitem__");
43132   __pyx_r = NULL;
43133   __pyx_L0:;
43134   __Pyx_DECREF(__pyx_v_result);
43135   __Pyx_XGIVEREF(__pyx_r);
43136   __Pyx_FinishRefcountContext();
43137   return __pyx_r;
43138 }
43139
43140 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1988
43141  *             return result
43142  * 
43143  *     def __nonzero__(self):             # <<<<<<<<<<<<<<
43144  *         cdef xmlAttr* c_attr
43145  *         c_attr = self._element._c_node.properties
43146  */
43147
43148 static int __pyx_pf_4lxml_5etree_7_Attrib___nonzero__(PyObject *__pyx_v_self); /*proto*/
43149 static int __pyx_pf_4lxml_5etree_7_Attrib___nonzero__(PyObject *__pyx_v_self) {
43150   xmlAttr *__pyx_v_c_attr;
43151   int __pyx_r;
43152   int __pyx_t_1;
43153   __Pyx_SetupRefcountContext("__nonzero__");
43154
43155   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1990
43156  *     def __nonzero__(self):
43157  *         cdef xmlAttr* c_attr
43158  *         c_attr = self._element._c_node.properties             # <<<<<<<<<<<<<<
43159  *         while c_attr is not NULL:
43160  *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:
43161  */
43162   __pyx_v_c_attr = ((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element->_c_node->properties;
43163
43164   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1991
43165  *         cdef xmlAttr* c_attr
43166  *         c_attr = self._element._c_node.properties
43167  *         while c_attr is not NULL:             # <<<<<<<<<<<<<<
43168  *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:
43169  *                 return 1
43170  */
43171   while (1) {
43172     __pyx_t_1 = (__pyx_v_c_attr != NULL);
43173     if (!__pyx_t_1) break;
43174
43175     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1992
43176  *         c_attr = self._element._c_node.properties
43177  *         while c_attr is not NULL:
43178  *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:             # <<<<<<<<<<<<<<
43179  *                 return 1
43180  *             c_attr = c_attr.next
43181  */
43182     __pyx_t_1 = (__pyx_v_c_attr->type == XML_ATTRIBUTE_NODE);
43183     if (__pyx_t_1) {
43184
43185       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1993
43186  *         while c_attr is not NULL:
43187  *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:
43188  *                 return 1             # <<<<<<<<<<<<<<
43189  *             c_attr = c_attr.next
43190  *         return 0
43191  */
43192       __pyx_r = 1;
43193       goto __pyx_L0;
43194       goto __pyx_L7;
43195     }
43196     __pyx_L7:;
43197
43198     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1994
43199  *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:
43200  *                 return 1
43201  *             c_attr = c_attr.next             # <<<<<<<<<<<<<<
43202  *         return 0
43203  * 
43204  */
43205     __pyx_v_c_attr = __pyx_v_c_attr->next;
43206   }
43207
43208   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1995
43209  *                 return 1
43210  *             c_attr = c_attr.next
43211  *         return 0             # <<<<<<<<<<<<<<
43212  * 
43213  *     def __len__(self):
43214  */
43215   __pyx_r = 0;
43216   goto __pyx_L0;
43217
43218   __pyx_r = 0;
43219   __pyx_L0:;
43220   __Pyx_FinishRefcountContext();
43221   return __pyx_r;
43222 }
43223
43224 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1997
43225  *         return 0
43226  * 
43227  *     def __len__(self):             # <<<<<<<<<<<<<<
43228  *         cdef xmlAttr* c_attr
43229  *         cdef Py_ssize_t c
43230  */
43231
43232 static Py_ssize_t __pyx_pf_4lxml_5etree_7_Attrib___len__(PyObject *__pyx_v_self); /*proto*/
43233 static Py_ssize_t __pyx_pf_4lxml_5etree_7_Attrib___len__(PyObject *__pyx_v_self) {
43234   xmlAttr *__pyx_v_c_attr;
43235   Py_ssize_t __pyx_v_c;
43236   Py_ssize_t __pyx_r;
43237   int __pyx_t_1;
43238   __Pyx_SetupRefcountContext("__len__");
43239
43240   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2000
43241  *         cdef xmlAttr* c_attr
43242  *         cdef Py_ssize_t c
43243  *         c = 0             # <<<<<<<<<<<<<<
43244  *         c_attr = self._element._c_node.properties
43245  *         while c_attr is not NULL:
43246  */
43247   __pyx_v_c = 0;
43248
43249   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2001
43250  *         cdef Py_ssize_t c
43251  *         c = 0
43252  *         c_attr = self._element._c_node.properties             # <<<<<<<<<<<<<<
43253  *         while c_attr is not NULL:
43254  *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:
43255  */
43256   __pyx_v_c_attr = ((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element->_c_node->properties;
43257
43258   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2002
43259  *         c = 0
43260  *         c_attr = self._element._c_node.properties
43261  *         while c_attr is not NULL:             # <<<<<<<<<<<<<<
43262  *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:
43263  *                 c = c + 1
43264  */
43265   while (1) {
43266     __pyx_t_1 = (__pyx_v_c_attr != NULL);
43267     if (!__pyx_t_1) break;
43268
43269     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2003
43270  *         c_attr = self._element._c_node.properties
43271  *         while c_attr is not NULL:
43272  *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:             # <<<<<<<<<<<<<<
43273  *                 c = c + 1
43274  *             c_attr = c_attr.next
43275  */
43276     __pyx_t_1 = (__pyx_v_c_attr->type == XML_ATTRIBUTE_NODE);
43277     if (__pyx_t_1) {
43278
43279       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2004
43280  *         while c_attr is not NULL:
43281  *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:
43282  *                 c = c + 1             # <<<<<<<<<<<<<<
43283  *             c_attr = c_attr.next
43284  *         return c
43285  */
43286       __pyx_v_c = (__pyx_v_c + 1);
43287       goto __pyx_L7;
43288     }
43289     __pyx_L7:;
43290
43291     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2005
43292  *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:
43293  *                 c = c + 1
43294  *             c_attr = c_attr.next             # <<<<<<<<<<<<<<
43295  *         return c
43296  * 
43297  */
43298     __pyx_v_c_attr = __pyx_v_c_attr->next;
43299   }
43300
43301   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2006
43302  *                 c = c + 1
43303  *             c_attr = c_attr.next
43304  *         return c             # <<<<<<<<<<<<<<
43305  * 
43306  *     def get(self, key, default=None):
43307  */
43308   __pyx_r = __pyx_v_c;
43309   goto __pyx_L0;
43310
43311   __pyx_r = 0;
43312   __pyx_L0:;
43313   __Pyx_FinishRefcountContext();
43314   return __pyx_r;
43315 }
43316
43317 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2008
43318  *         return c
43319  * 
43320  *     def get(self, key, default=None):             # <<<<<<<<<<<<<<
43321  *         return _getAttributeValue(self._element, key, default)
43322  * 
43323  */
43324
43325 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
43326 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
43327   PyObject *__pyx_v_key = 0;
43328   PyObject *__pyx_v_default = 0;
43329   PyObject *__pyx_r = NULL;
43330   PyObject *__pyx_t_1 = NULL;
43331   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_key,&__pyx_kp_default,0};
43332   __Pyx_SetupRefcountContext("get");
43333   if (unlikely(__pyx_kwds)) {
43334     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
43335     PyObject* values[2] = {0,0};
43336     values[1] = Py_None;
43337     switch (PyTuple_GET_SIZE(__pyx_args)) {
43338       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
43339       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
43340       case  0: break;
43341       default: goto __pyx_L5_argtuple_error;
43342     }
43343     switch (PyTuple_GET_SIZE(__pyx_args)) {
43344       case  0:
43345       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_key);
43346       if (likely(values[0])) kw_args--;
43347       else goto __pyx_L5_argtuple_error;
43348       case  1:
43349       if (kw_args > 1) {
43350         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_default);
43351         if (unlikely(value)) { values[1] = value; kw_args--; }
43352       }
43353     }
43354     if (unlikely(kw_args > 0)) {
43355       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
43356     }
43357     __pyx_v_key = values[0];
43358     __pyx_v_default = values[1];
43359   } else {
43360     __pyx_v_default = Py_None;
43361     switch (PyTuple_GET_SIZE(__pyx_args)) {
43362       case  2: __pyx_v_default = PyTuple_GET_ITEM(__pyx_args, 1);
43363       case  1: __pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 0);
43364       break;
43365       default: goto __pyx_L5_argtuple_error;
43366     }
43367   }
43368   goto __pyx_L4_argument_unpacking_done;
43369   __pyx_L5_argtuple_error:;
43370   __Pyx_RaiseArgtupleInvalid("get", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
43371   __pyx_L3_error:;
43372   __Pyx_AddTraceback("lxml.etree._Attrib.get");
43373   return NULL;
43374   __pyx_L4_argument_unpacking_done:;
43375
43376   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2009
43377  * 
43378  *     def get(self, key, default=None):
43379  *         return _getAttributeValue(self._element, key, default)             # <<<<<<<<<<<<<<
43380  * 
43381  *     def keys(self):
43382  */
43383   __Pyx_XDECREF(__pyx_r);
43384   __pyx_t_1 = __pyx_f_4lxml_5etree__getAttributeValue(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element, __pyx_v_key, __pyx_v_default); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43385   __Pyx_GOTREF(__pyx_t_1);
43386   __pyx_r = __pyx_t_1;
43387   __pyx_t_1 = 0;
43388   goto __pyx_L0;
43389
43390   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
43391   goto __pyx_L0;
43392   __pyx_L1_error:;
43393   __Pyx_XDECREF(__pyx_t_1);
43394   __Pyx_AddTraceback("lxml.etree._Attrib.get");
43395   __pyx_r = NULL;
43396   __pyx_L0:;
43397   __Pyx_XGIVEREF(__pyx_r);
43398   __Pyx_FinishRefcountContext();
43399   return __pyx_r;
43400 }
43401
43402 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2011
43403  *         return _getAttributeValue(self._element, key, default)
43404  * 
43405  *     def keys(self):             # <<<<<<<<<<<<<<
43406  *         return _collectAttributes(self._element._c_node, 1)
43407  * 
43408  */
43409
43410 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_keys(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
43411 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_keys(PyObject *__pyx_v_self, PyObject *unused) {
43412   PyObject *__pyx_r = NULL;
43413   PyObject *__pyx_t_1 = NULL;
43414   __Pyx_SetupRefcountContext("keys");
43415
43416   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2012
43417  * 
43418  *     def keys(self):
43419  *         return _collectAttributes(self._element._c_node, 1)             # <<<<<<<<<<<<<<
43420  * 
43421  *     def __iter__(self):
43422  */
43423   __Pyx_XDECREF(__pyx_r);
43424   __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element->_c_node, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43425   __Pyx_GOTREF(__pyx_t_1);
43426   __pyx_r = __pyx_t_1;
43427   __pyx_t_1 = 0;
43428   goto __pyx_L0;
43429
43430   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
43431   goto __pyx_L0;
43432   __pyx_L1_error:;
43433   __Pyx_XDECREF(__pyx_t_1);
43434   __Pyx_AddTraceback("lxml.etree._Attrib.keys");
43435   __pyx_r = NULL;
43436   __pyx_L0:;
43437   __Pyx_XGIVEREF(__pyx_r);
43438   __Pyx_FinishRefcountContext();
43439   return __pyx_r;
43440 }
43441
43442 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2014
43443  *         return _collectAttributes(self._element._c_node, 1)
43444  * 
43445  *     def __iter__(self):             # <<<<<<<<<<<<<<
43446  *         return iter(_collectAttributes(self._element._c_node, 1))
43447  * 
43448  */
43449
43450 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib___iter__(PyObject *__pyx_v_self); /*proto*/
43451 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib___iter__(PyObject *__pyx_v_self) {
43452   PyObject *__pyx_r = NULL;
43453   PyObject *__pyx_t_1 = NULL;
43454   PyObject *__pyx_t_2 = NULL;
43455   __Pyx_SetupRefcountContext("__iter__");
43456
43457   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2015
43458  * 
43459  *     def __iter__(self):
43460  *         return iter(_collectAttributes(self._element._c_node, 1))             # <<<<<<<<<<<<<<
43461  * 
43462  *     def iterkeys(self):
43463  */
43464   __Pyx_XDECREF(__pyx_r);
43465   __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element->_c_node, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43466   __Pyx_GOTREF(__pyx_t_1);
43467   __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43468   __Pyx_GOTREF(__pyx_t_2);
43469   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
43470   __pyx_r = __pyx_t_2;
43471   __pyx_t_2 = 0;
43472   goto __pyx_L0;
43473
43474   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
43475   goto __pyx_L0;
43476   __pyx_L1_error:;
43477   __Pyx_XDECREF(__pyx_t_1);
43478   __Pyx_XDECREF(__pyx_t_2);
43479   __Pyx_AddTraceback("lxml.etree._Attrib.__iter__");
43480   __pyx_r = NULL;
43481   __pyx_L0:;
43482   __Pyx_XGIVEREF(__pyx_r);
43483   __Pyx_FinishRefcountContext();
43484   return __pyx_r;
43485 }
43486
43487 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2017
43488  *         return iter(_collectAttributes(self._element._c_node, 1))
43489  * 
43490  *     def iterkeys(self):             # <<<<<<<<<<<<<<
43491  *         return iter(_collectAttributes(self._element._c_node, 1))
43492  * 
43493  */
43494
43495 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_iterkeys(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
43496 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_iterkeys(PyObject *__pyx_v_self, PyObject *unused) {
43497   PyObject *__pyx_r = NULL;
43498   PyObject *__pyx_t_1 = NULL;
43499   PyObject *__pyx_t_2 = NULL;
43500   __Pyx_SetupRefcountContext("iterkeys");
43501
43502   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2018
43503  * 
43504  *     def iterkeys(self):
43505  *         return iter(_collectAttributes(self._element._c_node, 1))             # <<<<<<<<<<<<<<
43506  * 
43507  *     def values(self):
43508  */
43509   __Pyx_XDECREF(__pyx_r);
43510   __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element->_c_node, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43511   __Pyx_GOTREF(__pyx_t_1);
43512   __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43513   __Pyx_GOTREF(__pyx_t_2);
43514   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
43515   __pyx_r = __pyx_t_2;
43516   __pyx_t_2 = 0;
43517   goto __pyx_L0;
43518
43519   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
43520   goto __pyx_L0;
43521   __pyx_L1_error:;
43522   __Pyx_XDECREF(__pyx_t_1);
43523   __Pyx_XDECREF(__pyx_t_2);
43524   __Pyx_AddTraceback("lxml.etree._Attrib.iterkeys");
43525   __pyx_r = NULL;
43526   __pyx_L0:;
43527   __Pyx_XGIVEREF(__pyx_r);
43528   __Pyx_FinishRefcountContext();
43529   return __pyx_r;
43530 }
43531
43532 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2020
43533  *         return iter(_collectAttributes(self._element._c_node, 1))
43534  * 
43535  *     def values(self):             # <<<<<<<<<<<<<<
43536  *         return _collectAttributes(self._element._c_node, 2)
43537  * 
43538  */
43539
43540 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_values(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
43541 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_values(PyObject *__pyx_v_self, PyObject *unused) {
43542   PyObject *__pyx_r = NULL;
43543   PyObject *__pyx_t_1 = NULL;
43544   __Pyx_SetupRefcountContext("values");
43545
43546   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2021
43547  * 
43548  *     def values(self):
43549  *         return _collectAttributes(self._element._c_node, 2)             # <<<<<<<<<<<<<<
43550  * 
43551  *     def itervalues(self):
43552  */
43553   __Pyx_XDECREF(__pyx_r);
43554   __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element->_c_node, 2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43555   __Pyx_GOTREF(__pyx_t_1);
43556   __pyx_r = __pyx_t_1;
43557   __pyx_t_1 = 0;
43558   goto __pyx_L0;
43559
43560   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
43561   goto __pyx_L0;
43562   __pyx_L1_error:;
43563   __Pyx_XDECREF(__pyx_t_1);
43564   __Pyx_AddTraceback("lxml.etree._Attrib.values");
43565   __pyx_r = NULL;
43566   __pyx_L0:;
43567   __Pyx_XGIVEREF(__pyx_r);
43568   __Pyx_FinishRefcountContext();
43569   return __pyx_r;
43570 }
43571
43572 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2023
43573  *         return _collectAttributes(self._element._c_node, 2)
43574  * 
43575  *     def itervalues(self):             # <<<<<<<<<<<<<<
43576  *         return iter(_collectAttributes(self._element._c_node, 2))
43577  * 
43578  */
43579
43580 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_itervalues(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
43581 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_itervalues(PyObject *__pyx_v_self, PyObject *unused) {
43582   PyObject *__pyx_r = NULL;
43583   PyObject *__pyx_t_1 = NULL;
43584   PyObject *__pyx_t_2 = NULL;
43585   __Pyx_SetupRefcountContext("itervalues");
43586
43587   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2024
43588  * 
43589  *     def itervalues(self):
43590  *         return iter(_collectAttributes(self._element._c_node, 2))             # <<<<<<<<<<<<<<
43591  * 
43592  *     def items(self):
43593  */
43594   __Pyx_XDECREF(__pyx_r);
43595   __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element->_c_node, 2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43596   __Pyx_GOTREF(__pyx_t_1);
43597   __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43598   __Pyx_GOTREF(__pyx_t_2);
43599   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
43600   __pyx_r = __pyx_t_2;
43601   __pyx_t_2 = 0;
43602   goto __pyx_L0;
43603
43604   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
43605   goto __pyx_L0;
43606   __pyx_L1_error:;
43607   __Pyx_XDECREF(__pyx_t_1);
43608   __Pyx_XDECREF(__pyx_t_2);
43609   __Pyx_AddTraceback("lxml.etree._Attrib.itervalues");
43610   __pyx_r = NULL;
43611   __pyx_L0:;
43612   __Pyx_XGIVEREF(__pyx_r);
43613   __Pyx_FinishRefcountContext();
43614   return __pyx_r;
43615 }
43616
43617 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2026
43618  *         return iter(_collectAttributes(self._element._c_node, 2))
43619  * 
43620  *     def items(self):             # <<<<<<<<<<<<<<
43621  *         return _collectAttributes(self._element._c_node, 3)
43622  * 
43623  */
43624
43625 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_items(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
43626 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_items(PyObject *__pyx_v_self, PyObject *unused) {
43627   PyObject *__pyx_r = NULL;
43628   PyObject *__pyx_t_1 = NULL;
43629   __Pyx_SetupRefcountContext("items");
43630
43631   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2027
43632  * 
43633  *     def items(self):
43634  *         return _collectAttributes(self._element._c_node, 3)             # <<<<<<<<<<<<<<
43635  * 
43636  *     def iteritems(self):
43637  */
43638   __Pyx_XDECREF(__pyx_r);
43639   __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element->_c_node, 3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43640   __Pyx_GOTREF(__pyx_t_1);
43641   __pyx_r = __pyx_t_1;
43642   __pyx_t_1 = 0;
43643   goto __pyx_L0;
43644
43645   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
43646   goto __pyx_L0;
43647   __pyx_L1_error:;
43648   __Pyx_XDECREF(__pyx_t_1);
43649   __Pyx_AddTraceback("lxml.etree._Attrib.items");
43650   __pyx_r = NULL;
43651   __pyx_L0:;
43652   __Pyx_XGIVEREF(__pyx_r);
43653   __Pyx_FinishRefcountContext();
43654   return __pyx_r;
43655 }
43656
43657 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2029
43658  *         return _collectAttributes(self._element._c_node, 3)
43659  * 
43660  *     def iteritems(self):             # <<<<<<<<<<<<<<
43661  *         return iter(_collectAttributes(self._element._c_node, 3))
43662  * 
43663  */
43664
43665 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_iteritems(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
43666 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_iteritems(PyObject *__pyx_v_self, PyObject *unused) {
43667   PyObject *__pyx_r = NULL;
43668   PyObject *__pyx_t_1 = NULL;
43669   PyObject *__pyx_t_2 = NULL;
43670   __Pyx_SetupRefcountContext("iteritems");
43671
43672   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2030
43673  * 
43674  *     def iteritems(self):
43675  *         return iter(_collectAttributes(self._element._c_node, 3))             # <<<<<<<<<<<<<<
43676  * 
43677  *     def has_key(self, key):
43678  */
43679   __Pyx_XDECREF(__pyx_r);
43680   __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element->_c_node, 3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43681   __Pyx_GOTREF(__pyx_t_1);
43682   __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43683   __Pyx_GOTREF(__pyx_t_2);
43684   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
43685   __pyx_r = __pyx_t_2;
43686   __pyx_t_2 = 0;
43687   goto __pyx_L0;
43688
43689   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
43690   goto __pyx_L0;
43691   __pyx_L1_error:;
43692   __Pyx_XDECREF(__pyx_t_1);
43693   __Pyx_XDECREF(__pyx_t_2);
43694   __Pyx_AddTraceback("lxml.etree._Attrib.iteritems");
43695   __pyx_r = NULL;
43696   __pyx_L0:;
43697   __Pyx_XGIVEREF(__pyx_r);
43698   __Pyx_FinishRefcountContext();
43699   return __pyx_r;
43700 }
43701
43702 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2032
43703  *         return iter(_collectAttributes(self._element._c_node, 3))
43704  * 
43705  *     def has_key(self, key):             # <<<<<<<<<<<<<<
43706  *         if key in self:
43707  *             return True
43708  */
43709
43710 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_has_key(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
43711 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_has_key(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
43712   PyObject *__pyx_r = NULL;
43713   int __pyx_t_1;
43714   PyObject *__pyx_t_2 = NULL;
43715   __Pyx_SetupRefcountContext("has_key");
43716
43717   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2033
43718  * 
43719  *     def has_key(self, key):
43720  *         if key in self:             # <<<<<<<<<<<<<<
43721  *             return True
43722  *         else:
43723  */
43724   __pyx_t_1 = (PySequence_Contains(__pyx_v_self, __pyx_v_key)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43725   if (__pyx_t_1) {
43726
43727     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2034
43728  *     def has_key(self, key):
43729  *         if key in self:
43730  *             return True             # <<<<<<<<<<<<<<
43731  *         else:
43732  *             return False
43733  */
43734     __Pyx_XDECREF(__pyx_r);
43735     __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43736     __Pyx_GOTREF(__pyx_t_2);
43737     __pyx_r = __pyx_t_2;
43738     __pyx_t_2 = 0;
43739     goto __pyx_L0;
43740     goto __pyx_L5;
43741   }
43742   /*else*/ {
43743
43744     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2036
43745  *             return True
43746  *         else:
43747  *             return False             # <<<<<<<<<<<<<<
43748  * 
43749  *     def __contains__(self, key):
43750  */
43751     __Pyx_XDECREF(__pyx_r);
43752     __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43753     __Pyx_GOTREF(__pyx_t_2);
43754     __pyx_r = __pyx_t_2;
43755     __pyx_t_2 = 0;
43756     goto __pyx_L0;
43757   }
43758   __pyx_L5:;
43759
43760   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
43761   goto __pyx_L0;
43762   __pyx_L1_error:;
43763   __Pyx_XDECREF(__pyx_t_2);
43764   __Pyx_AddTraceback("lxml.etree._Attrib.has_key");
43765   __pyx_r = NULL;
43766   __pyx_L0:;
43767   __Pyx_XGIVEREF(__pyx_r);
43768   __Pyx_FinishRefcountContext();
43769   return __pyx_r;
43770 }
43771
43772 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2038
43773  *             return False
43774  * 
43775  *     def __contains__(self, key):             # <<<<<<<<<<<<<<
43776  *         cdef xmlNode* c_node
43777  *         cdef char* c_href
43778  */
43779
43780 static int __pyx_pf_4lxml_5etree_7_Attrib___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
43781 static int __pyx_pf_4lxml_5etree_7_Attrib___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
43782   xmlNode *__pyx_v_c_node;
43783   char *__pyx_v_c_href;
43784   PyObject *__pyx_v_ns;
43785   PyObject *__pyx_v_tag;
43786   int __pyx_r;
43787   PyObject *__pyx_1 = 0;
43788   PyObject *__pyx_2 = 0;
43789   PyObject *__pyx_3 = 0;
43790   void *__pyx_4;
43791   PyObject *__pyx_t_1 = NULL;
43792   int __pyx_t_2;
43793   __Pyx_SetupRefcountContext("__contains__");
43794   __pyx_v_ns = Py_None; __Pyx_INCREF(Py_None);
43795   __pyx_v_tag = Py_None; __Pyx_INCREF(Py_None);
43796
43797   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2041
43798  *         cdef xmlNode* c_node
43799  *         cdef char* c_href
43800  *         ns, tag = _getNsTag(key)             # <<<<<<<<<<<<<<
43801  *         c_node = self._element._c_node
43802  *         c_href = NULL if ns is None else _cstr(ns)
43803  */
43804   __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43805   __Pyx_GOTREF(__pyx_t_1);
43806   if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 2)) {
43807     PyObject* tuple = __pyx_t_1;
43808     __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
43809     __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
43810     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
43811     __Pyx_DECREF(__pyx_v_ns);
43812     __pyx_v_ns = __pyx_2;
43813     __pyx_2 = 0;
43814     __Pyx_DECREF(__pyx_v_tag);
43815     __pyx_v_tag = __pyx_3;
43816     __pyx_3 = 0;
43817   } else {
43818     __pyx_1 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43819     __Pyx_GOTREF(__pyx_1);
43820     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
43821     __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43822     __Pyx_GOTREF(__pyx_2);
43823     __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43824     __Pyx_GOTREF(__pyx_3);
43825     if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43826     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
43827     __Pyx_DECREF(__pyx_v_ns);
43828     __pyx_v_ns = __pyx_2;
43829     __pyx_2 = 0;
43830     __Pyx_DECREF(__pyx_v_tag);
43831     __pyx_v_tag = __pyx_3;
43832     __pyx_3 = 0;
43833   }
43834
43835   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2042
43836  *         cdef char* c_href
43837  *         ns, tag = _getNsTag(key)
43838  *         c_node = self._element._c_node             # <<<<<<<<<<<<<<
43839  *         c_href = NULL if ns is None else _cstr(ns)
43840  *         if tree.xmlHasNsProp(c_node, _cstr(tag), c_href):
43841  */
43842   __pyx_v_c_node = ((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element->_c_node;
43843
43844   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2043
43845  *         ns, tag = _getNsTag(key)
43846  *         c_node = self._element._c_node
43847  *         c_href = NULL if ns is None else _cstr(ns)             # <<<<<<<<<<<<<<
43848  *         if tree.xmlHasNsProp(c_node, _cstr(tag), c_href):
43849  *             return 1
43850  */
43851   __pyx_t_2 = (__pyx_v_ns == Py_None);
43852   if (__pyx_t_2) {
43853     __pyx_4 = NULL;
43854   } else {
43855     __pyx_4 = PyString_AS_STRING(__pyx_v_ns);
43856   }
43857   __pyx_v_c_href = __pyx_4;
43858
43859   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2044
43860  *         c_node = self._element._c_node
43861  *         c_href = NULL if ns is None else _cstr(ns)
43862  *         if tree.xmlHasNsProp(c_node, _cstr(tag), c_href):             # <<<<<<<<<<<<<<
43863  *             return 1
43864  *         else:
43865  */
43866   __pyx_t_2 = (xmlHasNsProp(__pyx_v_c_node, PyString_AS_STRING(__pyx_v_tag), __pyx_v_c_href) != 0);
43867   if (__pyx_t_2) {
43868
43869     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2045
43870  *         c_href = NULL if ns is None else _cstr(ns)
43871  *         if tree.xmlHasNsProp(c_node, _cstr(tag), c_href):
43872  *             return 1             # <<<<<<<<<<<<<<
43873  *         else:
43874  *             return 0
43875  */
43876     __pyx_r = 1;
43877     goto __pyx_L0;
43878     goto __pyx_L5;
43879   }
43880   /*else*/ {
43881
43882     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2047
43883  *             return 1
43884  *         else:
43885  *             return 0             # <<<<<<<<<<<<<<
43886  * 
43887  *     def __richcmp__(one, other, int op):
43888  */
43889     __pyx_r = 0;
43890     goto __pyx_L0;
43891   }
43892   __pyx_L5:;
43893
43894   __pyx_r = 0;
43895   goto __pyx_L0;
43896   __pyx_L1_error:;
43897   __Pyx_XDECREF(__pyx_1);
43898   __Pyx_XDECREF(__pyx_2);
43899   __Pyx_XDECREF(__pyx_3);
43900   __Pyx_XDECREF(__pyx_t_1);
43901   __Pyx_AddTraceback("lxml.etree._Attrib.__contains__");
43902   __pyx_r = -1;
43903   __pyx_L0:;
43904   __Pyx_DECREF(__pyx_v_ns);
43905   __Pyx_DECREF(__pyx_v_tag);
43906   __Pyx_FinishRefcountContext();
43907   return __pyx_r;
43908 }
43909
43910 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2049
43911  *             return 0
43912  * 
43913  *     def __richcmp__(one, other, int op):             # <<<<<<<<<<<<<<
43914  *         if not python.PyDict_Check(one):
43915  *             one = dict(one)
43916  */
43917
43918 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib___richcmp__(PyObject *__pyx_v_one, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
43919 static PyObject *__pyx_pf_4lxml_5etree_7_Attrib___richcmp__(PyObject *__pyx_v_one, PyObject *__pyx_v_other, int __pyx_v_op) {
43920   PyObject *__pyx_r = NULL;
43921   int __pyx_t_1;
43922   PyObject *__pyx_t_2 = NULL;
43923   PyObject *__pyx_t_3 = NULL;
43924   __Pyx_SetupRefcountContext("__richcmp__");
43925   __Pyx_INCREF(__pyx_v_one);
43926   __Pyx_INCREF(__pyx_v_other);
43927
43928   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2050
43929  * 
43930  *     def __richcmp__(one, other, int op):
43931  *         if not python.PyDict_Check(one):             # <<<<<<<<<<<<<<
43932  *             one = dict(one)
43933  *         if not python.PyDict_Check(other):
43934  */
43935   __pyx_t_1 = (!PyDict_Check(__pyx_v_one));
43936   if (__pyx_t_1) {
43937
43938     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2051
43939  *     def __richcmp__(one, other, int op):
43940  *         if not python.PyDict_Check(one):
43941  *             one = dict(one)             # <<<<<<<<<<<<<<
43942  *         if not python.PyDict_Check(other):
43943  *             other = dict(other)
43944  */
43945     __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43946     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
43947     __Pyx_INCREF(__pyx_v_one);
43948     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_one);
43949     __Pyx_GIVEREF(__pyx_v_one);
43950     __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyDict_Type)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43951     __Pyx_GOTREF(__pyx_t_3);
43952     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
43953     __Pyx_DECREF(__pyx_v_one);
43954     __pyx_v_one = __pyx_t_3;
43955     __pyx_t_3 = 0;
43956     goto __pyx_L5;
43957   }
43958   __pyx_L5:;
43959
43960   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2052
43961  *         if not python.PyDict_Check(one):
43962  *             one = dict(one)
43963  *         if not python.PyDict_Check(other):             # <<<<<<<<<<<<<<
43964  *             other = dict(other)
43965  *         return python.PyObject_RichCompare(one, other, op)
43966  */
43967   __pyx_t_1 = (!PyDict_Check(__pyx_v_other));
43968   if (__pyx_t_1) {
43969
43970     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2053
43971  *             one = dict(one)
43972  *         if not python.PyDict_Check(other):
43973  *             other = dict(other)             # <<<<<<<<<<<<<<
43974  *         return python.PyObject_RichCompare(one, other, op)
43975  * 
43976  */
43977     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43978     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
43979     __Pyx_INCREF(__pyx_v_other);
43980     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_other);
43981     __Pyx_GIVEREF(__pyx_v_other);
43982     __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyDict_Type)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43983     __Pyx_GOTREF(__pyx_t_2);
43984     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
43985     __Pyx_DECREF(__pyx_v_other);
43986     __pyx_v_other = __pyx_t_2;
43987     __pyx_t_2 = 0;
43988     goto __pyx_L6;
43989   }
43990   __pyx_L6:;
43991
43992   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2054
43993  *         if not python.PyDict_Check(other):
43994  *             other = dict(other)
43995  *         return python.PyObject_RichCompare(one, other, op)             # <<<<<<<<<<<<<<
43996  * 
43997  * cdef class _AttribIterator:
43998  */
43999   __Pyx_XDECREF(__pyx_r);
44000   __pyx_t_2 = PyObject_RichCompare(__pyx_v_one, __pyx_v_other, __pyx_v_op); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
44001   __Pyx_GOTREF(__pyx_t_2);
44002   __pyx_r = __pyx_t_2;
44003   __pyx_t_2 = 0;
44004   goto __pyx_L0;
44005
44006   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
44007   goto __pyx_L0;
44008   __pyx_L1_error:;
44009   __Pyx_XDECREF(__pyx_t_2);
44010   __Pyx_XDECREF(__pyx_t_3);
44011   __Pyx_AddTraceback("lxml.etree._Attrib.__richcmp__");
44012   __pyx_r = NULL;
44013   __pyx_L0:;
44014   __Pyx_DECREF(__pyx_v_one);
44015   __Pyx_DECREF(__pyx_v_other);
44016   __Pyx_XGIVEREF(__pyx_r);
44017   __Pyx_FinishRefcountContext();
44018   return __pyx_r;
44019 }
44020
44021 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2063
44022  *     cdef xmlAttr* _c_attr
44023  *     cdef int _keysvalues # 1 - keys, 2 - values, 3 - items (key, value)
44024  *     def __iter__(self):             # <<<<<<<<<<<<<<
44025  *         return self
44026  * 
44027  */
44028
44029 static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator___iter__(PyObject *__pyx_v_self); /*proto*/
44030 static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator___iter__(PyObject *__pyx_v_self) {
44031   PyObject *__pyx_r = NULL;
44032   __Pyx_SetupRefcountContext("__iter__");
44033
44034   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2064
44035  *     cdef int _keysvalues # 1 - keys, 2 - values, 3 - items (key, value)
44036  *     def __iter__(self):
44037  *         return self             # <<<<<<<<<<<<<<
44038  * 
44039  *     def __next__(self):
44040  */
44041   __Pyx_XDECREF(__pyx_r);
44042   __Pyx_INCREF(__pyx_v_self);
44043   __pyx_r = __pyx_v_self;
44044   goto __pyx_L0;
44045
44046   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
44047   __pyx_L0:;
44048   __Pyx_XGIVEREF(__pyx_r);
44049   __Pyx_FinishRefcountContext();
44050   return __pyx_r;
44051 }
44052
44053 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2066
44054  *         return self
44055  * 
44056  *     def __next__(self):             # <<<<<<<<<<<<<<
44057  *         cdef xmlAttr* c_attr
44058  *         if self._node is None:
44059  */
44060
44061 static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator___next__(PyObject *__pyx_v_self); /*proto*/
44062 static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator___next__(PyObject *__pyx_v_self) {
44063   xmlAttr *__pyx_v_c_attr;
44064   PyObject *__pyx_r = NULL;
44065   int __pyx_t_1;
44066   PyObject *__pyx_t_2 = NULL;
44067   PyObject *__pyx_t_3 = NULL;
44068   PyObject *__pyx_t_4 = NULL;
44069   __Pyx_SetupRefcountContext("__next__");
44070
44071   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2068
44072  *     def __next__(self):
44073  *         cdef xmlAttr* c_attr
44074  *         if self._node is None:             # <<<<<<<<<<<<<<
44075  *             raise StopIteration
44076  *         c_attr = self._c_attr
44077  */
44078   __pyx_t_1 = (((PyObject *)((struct __pyx_obj_4lxml_5etree__AttribIterator *)__pyx_v_self)->_node) == Py_None);
44079   if (__pyx_t_1) {
44080
44081     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2069
44082  *         cdef xmlAttr* c_attr
44083  *         if self._node is None:
44084  *             raise StopIteration             # <<<<<<<<<<<<<<
44085  *         c_attr = self._c_attr
44086  *         while c_attr is not NULL and c_attr.type != tree.XML_ATTRIBUTE_NODE:
44087  */
44088     __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
44089     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
44090     goto __pyx_L5;
44091   }
44092   __pyx_L5:;
44093
44094   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2070
44095  *         if self._node is None:
44096  *             raise StopIteration
44097  *         c_attr = self._c_attr             # <<<<<<<<<<<<<<
44098  *         while c_attr is not NULL and c_attr.type != tree.XML_ATTRIBUTE_NODE:
44099  *             c_attr = c_attr.next
44100  */
44101   __pyx_v_c_attr = ((struct __pyx_obj_4lxml_5etree__AttribIterator *)__pyx_v_self)->_c_attr;
44102
44103   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2071
44104  *             raise StopIteration
44105  *         c_attr = self._c_attr
44106  *         while c_attr is not NULL and c_attr.type != tree.XML_ATTRIBUTE_NODE:             # <<<<<<<<<<<<<<
44107  *             c_attr = c_attr.next
44108  *         if c_attr is NULL:
44109  */
44110   while (1) {
44111     if ((__pyx_v_c_attr != NULL)) {
44112       __pyx_t_1 = (__pyx_v_c_attr->type != XML_ATTRIBUTE_NODE);
44113     } else {
44114       __pyx_t_1 = (__pyx_v_c_attr != NULL);
44115     }
44116     if (!__pyx_t_1) break;
44117
44118     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2072
44119  *         c_attr = self._c_attr
44120  *         while c_attr is not NULL and c_attr.type != tree.XML_ATTRIBUTE_NODE:
44121  *             c_attr = c_attr.next             # <<<<<<<<<<<<<<
44122  *         if c_attr is NULL:
44123  *             self._node = None
44124  */
44125     __pyx_v_c_attr = __pyx_v_c_attr->next;
44126   }
44127
44128   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2073
44129  *         while c_attr is not NULL and c_attr.type != tree.XML_ATTRIBUTE_NODE:
44130  *             c_attr = c_attr.next
44131  *         if c_attr is NULL:             # <<<<<<<<<<<<<<
44132  *             self._node = None
44133  *             raise StopIteration
44134  */
44135   __pyx_t_1 = (__pyx_v_c_attr == NULL);
44136   if (__pyx_t_1) {
44137
44138     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2074
44139  *             c_attr = c_attr.next
44140  *         if c_attr is NULL:
44141  *             self._node = None             # <<<<<<<<<<<<<<
44142  *             raise StopIteration
44143  * 
44144  */
44145     __Pyx_INCREF(Py_None);
44146     __Pyx_GIVEREF(Py_None);
44147     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__AttribIterator *)__pyx_v_self)->_node);
44148     __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__AttribIterator *)__pyx_v_self)->_node));
44149     ((struct __pyx_obj_4lxml_5etree__AttribIterator *)__pyx_v_self)->_node = ((struct LxmlElement *)Py_None);
44150
44151     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2075
44152  *         if c_attr is NULL:
44153  *             self._node = None
44154  *             raise StopIteration             # <<<<<<<<<<<<<<
44155  * 
44156  *         self._c_attr = c_attr.next
44157  */
44158     __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
44159     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
44160     goto __pyx_L8;
44161   }
44162   __pyx_L8:;
44163
44164   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2077
44165  *             raise StopIteration
44166  * 
44167  *         self._c_attr = c_attr.next             # <<<<<<<<<<<<<<
44168  *         if self._keysvalues == 1:
44169  *             return _namespacedName(<xmlNode*>c_attr)
44170  */
44171   ((struct __pyx_obj_4lxml_5etree__AttribIterator *)__pyx_v_self)->_c_attr = __pyx_v_c_attr->next;
44172
44173   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2078
44174  * 
44175  *         self._c_attr = c_attr.next
44176  *         if self._keysvalues == 1:             # <<<<<<<<<<<<<<
44177  *             return _namespacedName(<xmlNode*>c_attr)
44178  *         elif self._keysvalues == 2:
44179  */
44180   switch (((struct __pyx_obj_4lxml_5etree__AttribIterator *)__pyx_v_self)->_keysvalues) {
44181     case 1:
44182
44183     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2079
44184  *         self._c_attr = c_attr.next
44185  *         if self._keysvalues == 1:
44186  *             return _namespacedName(<xmlNode*>c_attr)             # <<<<<<<<<<<<<<
44187  *         elif self._keysvalues == 2:
44188  *             return _attributeValue(self._node._c_node, c_attr)
44189  */
44190     __Pyx_XDECREF(__pyx_r);
44191     __pyx_t_2 = __pyx_f_4lxml_5etree__namespacedName(((xmlNode *)__pyx_v_c_attr)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
44192     __Pyx_GOTREF(__pyx_t_2);
44193     __pyx_r = __pyx_t_2;
44194     __pyx_t_2 = 0;
44195     goto __pyx_L0;
44196     break;
44197
44198     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2080
44199  *         if self._keysvalues == 1:
44200  *             return _namespacedName(<xmlNode*>c_attr)
44201  *         elif self._keysvalues == 2:             # <<<<<<<<<<<<<<
44202  *             return _attributeValue(self._node._c_node, c_attr)
44203  *         else:
44204  */
44205     case 2:
44206
44207     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2081
44208  *             return _namespacedName(<xmlNode*>c_attr)
44209  *         elif self._keysvalues == 2:
44210  *             return _attributeValue(self._node._c_node, c_attr)             # <<<<<<<<<<<<<<
44211  *         else:
44212  *             return (_namespacedName(<xmlNode*>c_attr),
44213  */
44214     __Pyx_XDECREF(__pyx_r);
44215     __pyx_t_2 = __pyx_f_4lxml_5etree__attributeValue(((struct __pyx_obj_4lxml_5etree__AttribIterator *)__pyx_v_self)->_node->_c_node, __pyx_v_c_attr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
44216     __Pyx_GOTREF(__pyx_t_2);
44217     __pyx_r = __pyx_t_2;
44218     __pyx_t_2 = 0;
44219     goto __pyx_L0;
44220     break;
44221     default:
44222
44223     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2083
44224  *             return _attributeValue(self._node._c_node, c_attr)
44225  *         else:
44226  *             return (_namespacedName(<xmlNode*>c_attr),             # <<<<<<<<<<<<<<
44227  *                     _attributeValue(self._node._c_node, c_attr))
44228  * 
44229  */
44230     __Pyx_XDECREF(__pyx_r);
44231     __pyx_t_2 = __pyx_f_4lxml_5etree__namespacedName(((xmlNode *)__pyx_v_c_attr)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
44232     __Pyx_GOTREF(__pyx_t_2);
44233
44234     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2084
44235  *         else:
44236  *             return (_namespacedName(<xmlNode*>c_attr),
44237  *                     _attributeValue(self._node._c_node, c_attr))             # <<<<<<<<<<<<<<
44238  * 
44239  * cdef object _attributeIteratorFactory(_Element element, int keysvalues):
44240  */
44241     __pyx_t_3 = __pyx_f_4lxml_5etree__attributeValue(((struct __pyx_obj_4lxml_5etree__AttribIterator *)__pyx_v_self)->_node->_c_node, __pyx_v_c_attr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
44242     __Pyx_GOTREF(__pyx_t_3);
44243     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
44244     __Pyx_GOTREF(((PyObject *)__pyx_t_4));
44245     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
44246     __Pyx_GIVEREF(__pyx_t_2);
44247     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
44248     __Pyx_GIVEREF(__pyx_t_3);
44249     __pyx_t_2 = 0;
44250     __pyx_t_3 = 0;
44251     __pyx_r = ((PyObject *)__pyx_t_4);
44252     __pyx_t_4 = 0;
44253     goto __pyx_L0;
44254     break;
44255   }
44256
44257   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
44258   goto __pyx_L0;
44259   __pyx_L1_error:;
44260   __Pyx_XDECREF(__pyx_t_2);
44261   __Pyx_XDECREF(__pyx_t_3);
44262   __Pyx_XDECREF(__pyx_t_4);
44263   __Pyx_AddTraceback("lxml.etree._AttribIterator.__next__");
44264   __pyx_r = NULL;
44265   __pyx_L0:;
44266   __Pyx_XGIVEREF(__pyx_r);
44267   __Pyx_FinishRefcountContext();
44268   return __pyx_r;
44269 }
44270
44271 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2086
44272  *                     _attributeValue(self._node._c_node, c_attr))
44273  * 
44274  * cdef object _attributeIteratorFactory(_Element element, int keysvalues):             # <<<<<<<<<<<<<<
44275  *     cdef _AttribIterator attribs
44276  *     if element._c_node.properties is NULL:
44277  */
44278
44279 static  PyObject *__pyx_f_4lxml_5etree__attributeIteratorFactory(struct LxmlElement *__pyx_v_element, int __pyx_v_keysvalues) {
44280   struct __pyx_obj_4lxml_5etree__AttribIterator *__pyx_v_attribs;
44281   PyObject *__pyx_r = NULL;
44282   int __pyx_t_1;
44283   PyObject *__pyx_t_2 = NULL;
44284   __Pyx_SetupRefcountContext("_attributeIteratorFactory");
44285   __pyx_v_attribs = ((struct __pyx_obj_4lxml_5etree__AttribIterator *)Py_None); __Pyx_INCREF(Py_None);
44286
44287   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2088
44288  * cdef object _attributeIteratorFactory(_Element element, int keysvalues):
44289  *     cdef _AttribIterator attribs
44290  *     if element._c_node.properties is NULL:             # <<<<<<<<<<<<<<
44291  *         return ITER_EMPTY
44292  *     attribs = _AttribIterator()
44293  */
44294   __pyx_t_1 = (__pyx_v_element->_c_node->properties == NULL);
44295   if (__pyx_t_1) {
44296
44297     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2089
44298  *     cdef _AttribIterator attribs
44299  *     if element._c_node.properties is NULL:
44300  *         return ITER_EMPTY             # <<<<<<<<<<<<<<
44301  *     attribs = _AttribIterator()
44302  *     attribs._node = element
44303  */
44304     __Pyx_XDECREF(__pyx_r);
44305     __Pyx_INCREF(__pyx_v_4lxml_5etree_ITER_EMPTY);
44306     __pyx_r = __pyx_v_4lxml_5etree_ITER_EMPTY;
44307     goto __pyx_L0;
44308     goto __pyx_L3;
44309   }
44310   __pyx_L3:;
44311
44312   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2090
44313  *     if element._c_node.properties is NULL:
44314  *         return ITER_EMPTY
44315  *     attribs = _AttribIterator()             # <<<<<<<<<<<<<<
44316  *     attribs._node = element
44317  *     attribs._c_attr = element._c_node.properties
44318  */
44319   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__AttribIterator)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
44320   __Pyx_GOTREF(__pyx_t_2);
44321   if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__AttribIterator))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
44322   __Pyx_DECREF(((PyObject *)__pyx_v_attribs));
44323   __pyx_v_attribs = ((struct __pyx_obj_4lxml_5etree__AttribIterator *)__pyx_t_2);
44324   __pyx_t_2 = 0;
44325
44326   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2091
44327  *         return ITER_EMPTY
44328  *     attribs = _AttribIterator()
44329  *     attribs._node = element             # <<<<<<<<<<<<<<
44330  *     attribs._c_attr = element._c_node.properties
44331  *     attribs._keysvalues = keysvalues
44332  */
44333   __Pyx_INCREF(((PyObject *)__pyx_v_element));
44334   __Pyx_GIVEREF(((PyObject *)__pyx_v_element));
44335   __Pyx_GOTREF(__pyx_v_attribs->_node);
44336   __Pyx_DECREF(((PyObject *)__pyx_v_attribs->_node));
44337   __pyx_v_attribs->_node = __pyx_v_element;
44338
44339   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2092
44340  *     attribs = _AttribIterator()
44341  *     attribs._node = element
44342  *     attribs._c_attr = element._c_node.properties             # <<<<<<<<<<<<<<
44343  *     attribs._keysvalues = keysvalues
44344  *     return attribs
44345  */
44346   __pyx_v_attribs->_c_attr = __pyx_v_element->_c_node->properties;
44347
44348   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2093
44349  *     attribs._node = element
44350  *     attribs._c_attr = element._c_node.properties
44351  *     attribs._keysvalues = keysvalues             # <<<<<<<<<<<<<<
44352  *     return attribs
44353  * 
44354  */
44355   __pyx_v_attribs->_keysvalues = __pyx_v_keysvalues;
44356
44357   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2094
44358  *     attribs._c_attr = element._c_node.properties
44359  *     attribs._keysvalues = keysvalues
44360  *     return attribs             # <<<<<<<<<<<<<<
44361  * 
44362  * 
44363  */
44364   __Pyx_XDECREF(__pyx_r);
44365   __Pyx_INCREF(((PyObject *)__pyx_v_attribs));
44366   __pyx_r = ((PyObject *)__pyx_v_attribs);
44367   goto __pyx_L0;
44368
44369   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
44370   goto __pyx_L0;
44371   __pyx_L1_error:;
44372   __Pyx_XDECREF(__pyx_t_2);
44373   __Pyx_AddTraceback("lxml.etree._attributeIteratorFactory");
44374   __pyx_r = 0;
44375   __pyx_L0:;
44376   __Pyx_DECREF((PyObject *)__pyx_v_attribs);
44377   __Pyx_XGIVEREF(__pyx_r);
44378   __Pyx_FinishRefcountContext();
44379   return __pyx_r;
44380 }
44381
44382 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2103
44383  *     cdef char* _href
44384  *     cdef char* _name
44385  *     cdef _initTagMatch(self, tag):             # <<<<<<<<<<<<<<
44386  *         self._href = NULL
44387  *         self._name = NULL
44388  */
44389
44390 static  PyObject *__pyx_f_4lxml_5etree_18_ElementTagMatcher__initTagMatch(struct LxmlElementTagMatcher *__pyx_v_self, PyObject *__pyx_v_tag) {
44391   PyObject *__pyx_r = NULL;
44392   PyObject *__pyx_1 = 0;
44393   int __pyx_t_1;
44394   PyObject *__pyx_t_2 = NULL;
44395   __Pyx_SetupRefcountContext("_initTagMatch");
44396
44397   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2104
44398  *     cdef char* _name
44399  *     cdef _initTagMatch(self, tag):
44400  *         self._href = NULL             # <<<<<<<<<<<<<<
44401  *         self._name = NULL
44402  *         if tag is None:
44403  */
44404   __pyx_v_self->_href = NULL;
44405
44406   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2105
44407  *     cdef _initTagMatch(self, tag):
44408  *         self._href = NULL
44409  *         self._name = NULL             # <<<<<<<<<<<<<<
44410  *         if tag is None:
44411  *             self._node_type = 0
44412  */
44413   __pyx_v_self->_name = NULL;
44414
44415   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2106
44416  *         self._href = NULL
44417  *         self._name = NULL
44418  *         if tag is None:             # <<<<<<<<<<<<<<
44419  *             self._node_type = 0
44420  *         elif tag is Comment:
44421  */
44422   __pyx_t_1 = (__pyx_v_tag == Py_None);
44423   if (__pyx_t_1) {
44424
44425     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2107
44426  *         self._name = NULL
44427  *         if tag is None:
44428  *             self._node_type = 0             # <<<<<<<<<<<<<<
44429  *         elif tag is Comment:
44430  *             self._node_type = tree.XML_COMMENT_NODE
44431  */
44432     __pyx_v_self->_node_type = 0;
44433     goto __pyx_L3;
44434   }
44435
44436   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2108
44437  *         if tag is None:
44438  *             self._node_type = 0
44439  *         elif tag is Comment:             # <<<<<<<<<<<<<<
44440  *             self._node_type = tree.XML_COMMENT_NODE
44441  *         elif tag is ProcessingInstruction:
44442  */
44443   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_Comment); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
44444   __Pyx_GOTREF(__pyx_1);
44445   __pyx_t_1 = (__pyx_v_tag == __pyx_1);
44446   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
44447   if (__pyx_t_1) {
44448
44449     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2109
44450  *             self._node_type = 0
44451  *         elif tag is Comment:
44452  *             self._node_type = tree.XML_COMMENT_NODE             # <<<<<<<<<<<<<<
44453  *         elif tag is ProcessingInstruction:
44454  *             self._node_type = tree.XML_PI_NODE
44455  */
44456     __pyx_v_self->_node_type = XML_COMMENT_NODE;
44457     goto __pyx_L3;
44458   }
44459
44460   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2110
44461  *         elif tag is Comment:
44462  *             self._node_type = tree.XML_COMMENT_NODE
44463  *         elif tag is ProcessingInstruction:             # <<<<<<<<<<<<<<
44464  *             self._node_type = tree.XML_PI_NODE
44465  *         elif tag is Entity:
44466  */
44467   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_101); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
44468   __Pyx_GOTREF(__pyx_1);
44469   __pyx_t_1 = (__pyx_v_tag == __pyx_1);
44470   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
44471   if (__pyx_t_1) {
44472
44473     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2111
44474  *             self._node_type = tree.XML_COMMENT_NODE
44475  *         elif tag is ProcessingInstruction:
44476  *             self._node_type = tree.XML_PI_NODE             # <<<<<<<<<<<<<<
44477  *         elif tag is Entity:
44478  *             self._node_type = tree.XML_ENTITY_REF_NODE
44479  */
44480     __pyx_v_self->_node_type = XML_PI_NODE;
44481     goto __pyx_L3;
44482   }
44483
44484   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2112
44485  *         elif tag is ProcessingInstruction:
44486  *             self._node_type = tree.XML_PI_NODE
44487  *         elif tag is Entity:             # <<<<<<<<<<<<<<
44488  *             self._node_type = tree.XML_ENTITY_REF_NODE
44489  *         elif tag is Element:
44490  */
44491   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_Entity); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
44492   __Pyx_GOTREF(__pyx_1);
44493   __pyx_t_1 = (__pyx_v_tag == __pyx_1);
44494   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
44495   if (__pyx_t_1) {
44496
44497     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2113
44498  *             self._node_type = tree.XML_PI_NODE
44499  *         elif tag is Entity:
44500  *             self._node_type = tree.XML_ENTITY_REF_NODE             # <<<<<<<<<<<<<<
44501  *         elif tag is Element:
44502  *             self._node_type = tree.XML_ELEMENT_NODE
44503  */
44504     __pyx_v_self->_node_type = XML_ENTITY_REF_NODE;
44505     goto __pyx_L3;
44506   }
44507
44508   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2114
44509  *         elif tag is Entity:
44510  *             self._node_type = tree.XML_ENTITY_REF_NODE
44511  *         elif tag is Element:             # <<<<<<<<<<<<<<
44512  *             self._node_type = tree.XML_ELEMENT_NODE
44513  *         else:
44514  */
44515   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_Element); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
44516   __Pyx_GOTREF(__pyx_1);
44517   __pyx_t_1 = (__pyx_v_tag == __pyx_1);
44518   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
44519   if (__pyx_t_1) {
44520
44521     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2115
44522  *             self._node_type = tree.XML_ENTITY_REF_NODE
44523  *         elif tag is Element:
44524  *             self._node_type = tree.XML_ELEMENT_NODE             # <<<<<<<<<<<<<<
44525  *         else:
44526  *             self._node_type = tree.XML_ELEMENT_NODE
44527  */
44528     __pyx_v_self->_node_type = XML_ELEMENT_NODE;
44529     goto __pyx_L3;
44530   }
44531   /*else*/ {
44532
44533     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2117
44534  *             self._node_type = tree.XML_ELEMENT_NODE
44535  *         else:
44536  *             self._node_type = tree.XML_ELEMENT_NODE             # <<<<<<<<<<<<<<
44537  *             self._pystrings = _getNsTag(tag)
44538  *             if self._pystrings[0] is not None:
44539  */
44540     __pyx_v_self->_node_type = XML_ELEMENT_NODE;
44541
44542     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2118
44543  *         else:
44544  *             self._node_type = tree.XML_ELEMENT_NODE
44545  *             self._pystrings = _getNsTag(tag)             # <<<<<<<<<<<<<<
44546  *             if self._pystrings[0] is not None:
44547  *                 self._href = _cstr(self._pystrings[0])
44548  */
44549     __pyx_t_2 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_tag); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
44550     __Pyx_GOTREF(__pyx_t_2);
44551     __Pyx_GIVEREF(__pyx_t_2);
44552     __Pyx_GOTREF(__pyx_v_self->_pystrings);
44553     __Pyx_DECREF(__pyx_v_self->_pystrings);
44554     __pyx_v_self->_pystrings = __pyx_t_2;
44555     __pyx_t_2 = 0;
44556
44557     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2119
44558  *             self._node_type = tree.XML_ELEMENT_NODE
44559  *             self._pystrings = _getNsTag(tag)
44560  *             if self._pystrings[0] is not None:             # <<<<<<<<<<<<<<
44561  *                 self._href = _cstr(self._pystrings[0])
44562  *             self._name = _cstr(self._pystrings[1])
44563  */
44564     __pyx_1 = __Pyx_GetItemInt(__pyx_v_self->_pystrings, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
44565     __Pyx_GOTREF(__pyx_1);
44566     __pyx_t_1 = (__pyx_1 != Py_None);
44567     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
44568     if (__pyx_t_1) {
44569
44570       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2120
44571  *             self._pystrings = _getNsTag(tag)
44572  *             if self._pystrings[0] is not None:
44573  *                 self._href = _cstr(self._pystrings[0])             # <<<<<<<<<<<<<<
44574  *             self._name = _cstr(self._pystrings[1])
44575  *             if self._name[0] == c'*' and self._name[1] == c'\0':
44576  */
44577       __pyx_1 = __Pyx_GetItemInt(__pyx_v_self->_pystrings, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
44578       __Pyx_GOTREF(__pyx_1);
44579       __pyx_v_self->_href = PyString_AS_STRING(__pyx_1);
44580       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
44581       goto __pyx_L4;
44582     }
44583     __pyx_L4:;
44584
44585     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2121
44586  *             if self._pystrings[0] is not None:
44587  *                 self._href = _cstr(self._pystrings[0])
44588  *             self._name = _cstr(self._pystrings[1])             # <<<<<<<<<<<<<<
44589  *             if self._name[0] == c'*' and self._name[1] == c'\0':
44590  *                 self._name = NULL
44591  */
44592     __pyx_1 = __Pyx_GetItemInt(__pyx_v_self->_pystrings, 1, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
44593     __Pyx_GOTREF(__pyx_1);
44594     __pyx_v_self->_name = PyString_AS_STRING(__pyx_1);
44595     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
44596
44597     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2122
44598  *                 self._href = _cstr(self._pystrings[0])
44599  *             self._name = _cstr(self._pystrings[1])
44600  *             if self._name[0] == c'*' and self._name[1] == c'\0':             # <<<<<<<<<<<<<<
44601  *                 self._name = NULL
44602  * 
44603  */
44604     if (((__pyx_v_self->_name[0]) == '*')) {
44605       __pyx_t_1 = ((__pyx_v_self->_name[1]) == '\x00');
44606     } else {
44607       __pyx_t_1 = ((__pyx_v_self->_name[0]) == '*');
44608     }
44609     if (__pyx_t_1) {
44610
44611       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2123
44612  *             self._name = _cstr(self._pystrings[1])
44613  *             if self._name[0] == c'*' and self._name[1] == c'\0':
44614  *                 self._name = NULL             # <<<<<<<<<<<<<<
44615  * 
44616  * cdef public class _ElementIterator(_ElementTagMatcher) [
44617  */
44618       __pyx_v_self->_name = NULL;
44619       goto __pyx_L5;
44620     }
44621     __pyx_L5:;
44622   }
44623   __pyx_L3:;
44624
44625   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
44626   goto __pyx_L0;
44627   __pyx_L1_error:;
44628   __Pyx_XDECREF(__pyx_1);
44629   __Pyx_XDECREF(__pyx_t_2);
44630   __Pyx_AddTraceback("lxml.etree._ElementTagMatcher._initTagMatch");
44631   __pyx_r = 0;
44632   __pyx_L0:;
44633   __Pyx_XGIVEREF(__pyx_r);
44634   __Pyx_FinishRefcountContext();
44635   return __pyx_r;
44636 }
44637
44638 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2130
44639  *     cdef _Element _node
44640  *     cdef _node_to_node_function _next_element
44641  *     def __iter__(self):             # <<<<<<<<<<<<<<
44642  *         return self
44643  * 
44644  */
44645
44646 static PyObject *__pyx_pf_4lxml_5etree_16_ElementIterator___iter__(PyObject *__pyx_v_self); /*proto*/
44647 static PyObject *__pyx_pf_4lxml_5etree_16_ElementIterator___iter__(PyObject *__pyx_v_self) {
44648   PyObject *__pyx_r = NULL;
44649   __Pyx_SetupRefcountContext("__iter__");
44650
44651   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2131
44652  *     cdef _node_to_node_function _next_element
44653  *     def __iter__(self):
44654  *         return self             # <<<<<<<<<<<<<<
44655  * 
44656  *     cdef void _storeNext(self, _Element node):
44657  */
44658   __Pyx_XDECREF(__pyx_r);
44659   __Pyx_INCREF(__pyx_v_self);
44660   __pyx_r = __pyx_v_self;
44661   goto __pyx_L0;
44662
44663   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
44664   __pyx_L0:;
44665   __Pyx_XGIVEREF(__pyx_r);
44666   __Pyx_FinishRefcountContext();
44667   return __pyx_r;
44668 }
44669
44670 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2133
44671  *         return self
44672  * 
44673  *     cdef void _storeNext(self, _Element node):             # <<<<<<<<<<<<<<
44674  *         cdef xmlNode* c_node
44675  *         c_node = self._next_element(node._c_node)
44676  */
44677
44678 static  void __pyx_f_4lxml_5etree_16_ElementIterator__storeNext(struct LxmlElementIterator *__pyx_v_self, struct LxmlElement *__pyx_v_node) {
44679   xmlNode *__pyx_v_c_node;
44680   int __pyx_t_1;
44681   int __pyx_t_2;
44682   PyObject *__pyx_t_3 = NULL;
44683   __Pyx_SetupRefcountContext("_storeNext");
44684
44685   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2135
44686  *     cdef void _storeNext(self, _Element node):
44687  *         cdef xmlNode* c_node
44688  *         c_node = self._next_element(node._c_node)             # <<<<<<<<<<<<<<
44689  *         while c_node is not NULL and \
44690  *                   self._node_type != 0 and \
44691  */
44692   __pyx_v_c_node = __pyx_v_self->_next_element(__pyx_v_node->_c_node);
44693
44694   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2136
44695  *         cdef xmlNode* c_node
44696  *         c_node = self._next_element(node._c_node)
44697  *         while c_node is not NULL and \             # <<<<<<<<<<<<<<
44698  *                   self._node_type != 0 and \
44699  *                   (self._node_type != c_node.type or
44700  */
44701   while (1) {
44702     if ((__pyx_v_c_node != NULL)) {
44703
44704       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2137
44705  *         c_node = self._next_element(node._c_node)
44706  *         while c_node is not NULL and \
44707  *                   self._node_type != 0 and \             # <<<<<<<<<<<<<<
44708  *                   (self._node_type != c_node.type or
44709  *                    not _tagMatches(c_node, self._href, self._name)):
44710  */
44711       if ((__pyx_v_self->__pyx_base._node_type != 0)) {
44712
44713         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2138
44714  *         while c_node is not NULL and \
44715  *                   self._node_type != 0 and \
44716  *                   (self._node_type != c_node.type or             # <<<<<<<<<<<<<<
44717  *                    not _tagMatches(c_node, self._href, self._name)):
44718  *             c_node = self._next_element(c_node)
44719  */
44720         if (!(__pyx_v_self->__pyx_base._node_type != __pyx_v_c_node->type)) {
44721
44722           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2139
44723  *                   self._node_type != 0 and \
44724  *                   (self._node_type != c_node.type or
44725  *                    not _tagMatches(c_node, self._href, self._name)):             # <<<<<<<<<<<<<<
44726  *             c_node = self._next_element(c_node)
44727  *         if c_node is NULL:
44728  */
44729           __pyx_t_1 = (!__pyx_f_4lxml_5etree__tagMatches(__pyx_v_c_node, __pyx_v_self->__pyx_base._href, __pyx_v_self->__pyx_base._name));
44730         } else {
44731           __pyx_t_1 = (__pyx_v_self->__pyx_base._node_type != __pyx_v_c_node->type);
44732         }
44733         __pyx_t_2 = __pyx_t_1;
44734       } else {
44735         __pyx_t_2 = (__pyx_v_self->__pyx_base._node_type != 0);
44736       }
44737       __pyx_t_1 = __pyx_t_2;
44738     } else {
44739       __pyx_t_1 = (__pyx_v_c_node != NULL);
44740     }
44741     if (!__pyx_t_1) break;
44742
44743     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2140
44744  *                   (self._node_type != c_node.type or
44745  *                    not _tagMatches(c_node, self._href, self._name)):
44746  *             c_node = self._next_element(c_node)             # <<<<<<<<<<<<<<
44747  *         if c_node is NULL:
44748  *             self._node = None
44749  */
44750     __pyx_v_c_node = __pyx_v_self->_next_element(__pyx_v_c_node);
44751   }
44752
44753   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2141
44754  *                    not _tagMatches(c_node, self._href, self._name)):
44755  *             c_node = self._next_element(c_node)
44756  *         if c_node is NULL:             # <<<<<<<<<<<<<<
44757  *             self._node = None
44758  *         else:
44759  */
44760   __pyx_t_1 = (__pyx_v_c_node == NULL);
44761   if (__pyx_t_1) {
44762
44763     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2142
44764  *             c_node = self._next_element(c_node)
44765  *         if c_node is NULL:
44766  *             self._node = None             # <<<<<<<<<<<<<<
44767  *         else:
44768  *             # Python ref:
44769  */
44770     __Pyx_INCREF(Py_None);
44771     __Pyx_GIVEREF(Py_None);
44772     __Pyx_GOTREF(__pyx_v_self->_node);
44773     __Pyx_DECREF(((PyObject *)__pyx_v_self->_node));
44774     __pyx_v_self->_node = ((struct LxmlElement *)Py_None);
44775     goto __pyx_L5;
44776   }
44777   /*else*/ {
44778
44779     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2145
44780  *         else:
44781  *             # Python ref:
44782  *             self._node = _elementFactory(node._doc, c_node)             # <<<<<<<<<<<<<<
44783  * 
44784  *     def __next__(self):
44785  */
44786     __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_node->_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
44787     __Pyx_GOTREF(__pyx_t_3);
44788     __Pyx_GIVEREF(__pyx_t_3);
44789     __Pyx_GOTREF(__pyx_v_self->_node);
44790     __Pyx_DECREF(((PyObject *)__pyx_v_self->_node));
44791     __pyx_v_self->_node = ((struct LxmlElement *)__pyx_t_3);
44792     __pyx_t_3 = 0;
44793   }
44794   __pyx_L5:;
44795
44796   goto __pyx_L0;
44797   __pyx_L1_error:;
44798   __Pyx_XDECREF(__pyx_t_3);
44799   __Pyx_WriteUnraisable("lxml.etree._ElementIterator._storeNext");
44800   __pyx_L0:;
44801   __Pyx_FinishRefcountContext();
44802 }
44803
44804 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2147
44805  *             self._node = _elementFactory(node._doc, c_node)
44806  * 
44807  *     def __next__(self):             # <<<<<<<<<<<<<<
44808  *         cdef xmlNode* c_node
44809  *         cdef _Element current_node
44810  */
44811
44812 static PyObject *__pyx_pf_4lxml_5etree_16_ElementIterator___next__(PyObject *__pyx_v_self); /*proto*/
44813 static PyObject *__pyx_pf_4lxml_5etree_16_ElementIterator___next__(PyObject *__pyx_v_self) {
44814   struct LxmlElement *__pyx_v_current_node;
44815   PyObject *__pyx_r = NULL;
44816   int __pyx_t_1;
44817   __Pyx_SetupRefcountContext("__next__");
44818   __pyx_v_current_node = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
44819
44820   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2150
44821  *         cdef xmlNode* c_node
44822  *         cdef _Element current_node
44823  *         if self._node is None:             # <<<<<<<<<<<<<<
44824  *             raise StopIteration
44825  *         # Python ref:
44826  */
44827   __pyx_t_1 = (((PyObject *)((struct LxmlElementIterator *)__pyx_v_self)->_node) == Py_None);
44828   if (__pyx_t_1) {
44829
44830     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2151
44831  *         cdef _Element current_node
44832  *         if self._node is None:
44833  *             raise StopIteration             # <<<<<<<<<<<<<<
44834  *         # Python ref:
44835  *         current_node = self._node
44836  */
44837     __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
44838     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
44839     goto __pyx_L5;
44840   }
44841   __pyx_L5:;
44842
44843   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2153
44844  *             raise StopIteration
44845  *         # Python ref:
44846  *         current_node = self._node             # <<<<<<<<<<<<<<
44847  *         self._storeNext(current_node)
44848  *         return current_node
44849  */
44850   __Pyx_INCREF(((PyObject *)((struct LxmlElementIterator *)__pyx_v_self)->_node));
44851   __Pyx_DECREF(((PyObject *)__pyx_v_current_node));
44852   __pyx_v_current_node = ((struct LxmlElementIterator *)__pyx_v_self)->_node;
44853
44854   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2154
44855  *         # Python ref:
44856  *         current_node = self._node
44857  *         self._storeNext(current_node)             # <<<<<<<<<<<<<<
44858  *         return current_node
44859  * 
44860  */
44861   ((struct __pyx_vtabstruct_4lxml_5etree__ElementIterator *)((struct LxmlElementIterator *)__pyx_v_self)->__pyx_base.__pyx_vtab)->_storeNext(((struct LxmlElementIterator *)__pyx_v_self), __pyx_v_current_node);
44862
44863   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2155
44864  *         current_node = self._node
44865  *         self._storeNext(current_node)
44866  *         return current_node             # <<<<<<<<<<<<<<
44867  * 
44868  * cdef class ElementChildIterator(_ElementIterator):
44869  */
44870   __Pyx_XDECREF(__pyx_r);
44871   __Pyx_INCREF(((PyObject *)__pyx_v_current_node));
44872   __pyx_r = ((PyObject *)__pyx_v_current_node);
44873   goto __pyx_L0;
44874
44875   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
44876   goto __pyx_L0;
44877   __pyx_L1_error:;
44878   __Pyx_AddTraceback("lxml.etree._ElementIterator.__next__");
44879   __pyx_r = NULL;
44880   __pyx_L0:;
44881   __Pyx_DECREF((PyObject *)__pyx_v_current_node);
44882   __Pyx_XGIVEREF(__pyx_r);
44883   __Pyx_FinishRefcountContext();
44884   return __pyx_r;
44885 }
44886
44887 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2161
44888  *     Iterates over the children of an element.
44889  *     """
44890  *     def __init__(self, _Element node not None, tag=None, *, reversed=False):             # <<<<<<<<<<<<<<
44891  *         cdef xmlNode* c_node
44892  *         self._initTagMatch(tag)
44893  */
44894
44895 static int __pyx_pf_4lxml_5etree_20ElementChildIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
44896 static int __pyx_pf_4lxml_5etree_20ElementChildIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
44897   struct LxmlElement *__pyx_v_node = 0;
44898   PyObject *__pyx_v_tag = 0;
44899   PyObject *__pyx_v_reversed = 0;
44900   xmlNode *__pyx_v_c_node;
44901   int __pyx_r;
44902   PyObject *__pyx_t_1 = NULL;
44903   int __pyx_t_2;
44904   int __pyx_t_3;
44905   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_node,&__pyx_kp_tag,&__pyx_kp_reversed,0};
44906   __Pyx_SetupRefcountContext("__init__");
44907   if (unlikely(__pyx_kwds)) {
44908     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
44909     PyObject* values[3] = {0,0,0};
44910     values[1] = Py_None;
44911     values[2] = __pyx_k_97;
44912     switch (PyTuple_GET_SIZE(__pyx_args)) {
44913       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
44914       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
44915       case  0: break;
44916       default: goto __pyx_L5_argtuple_error;
44917     }
44918     switch (PyTuple_GET_SIZE(__pyx_args)) {
44919       case  0:
44920       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_node);
44921       if (likely(values[0])) kw_args--;
44922       else goto __pyx_L5_argtuple_error;
44923       case  1:
44924       if (kw_args > 1) {
44925         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_tag);
44926         if (unlikely(value)) { values[1] = value; kw_args--; }
44927       }
44928     }
44929     while (kw_args > 0) {
44930       PyObject* value;
44931       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_reversed);
44932       if (value) { values[2] = value; if (!(--kw_args)) break; }
44933       break;
44934     }
44935     if (unlikely(kw_args > 0)) {
44936       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
44937     }
44938     __pyx_v_node = ((struct LxmlElement *)values[0]);
44939     __pyx_v_tag = values[1];
44940     __pyx_v_reversed = values[2];
44941   } else {
44942     __pyx_v_tag = Py_None;
44943     __pyx_v_reversed = __pyx_k_97;
44944     switch (PyTuple_GET_SIZE(__pyx_args)) {
44945       case  2: __pyx_v_tag = PyTuple_GET_ITEM(__pyx_args, 1);
44946       case  1: __pyx_v_node = ((struct LxmlElement *)PyTuple_GET_ITEM(__pyx_args, 0));
44947       break;
44948       default: goto __pyx_L5_argtuple_error;
44949     }
44950   }
44951   goto __pyx_L4_argument_unpacking_done;
44952   __pyx_L5_argtuple_error:;
44953   __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
44954   __pyx_L3_error:;
44955   __Pyx_AddTraceback("lxml.etree.ElementChildIterator.__init__");
44956   return -1;
44957   __pyx_L4_argument_unpacking_done:;
44958   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_node), __pyx_ptype_4lxml_5etree__Element, 0, "node", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
44959
44960   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2163
44961  *     def __init__(self, _Element node not None, tag=None, *, reversed=False):
44962  *         cdef xmlNode* c_node
44963  *         self._initTagMatch(tag)             # <<<<<<<<<<<<<<
44964  *         if reversed:
44965  *             c_node = _findChildBackwards(node._c_node, 0)
44966  */
44967   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree_ElementChildIterator *)((struct __pyx_obj_4lxml_5etree_ElementChildIterator *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._initTagMatch(((struct LxmlElementTagMatcher *)__pyx_v_self), __pyx_v_tag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
44968   __Pyx_GOTREF(__pyx_t_1);
44969   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
44970
44971   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2164
44972  *         cdef xmlNode* c_node
44973  *         self._initTagMatch(tag)
44974  *         if reversed:             # <<<<<<<<<<<<<<
44975  *             c_node = _findChildBackwards(node._c_node, 0)
44976  *             self._next_element = _previousElement
44977  */
44978   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_reversed); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
44979   if (__pyx_t_2) {
44980
44981     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2165
44982  *         self._initTagMatch(tag)
44983  *         if reversed:
44984  *             c_node = _findChildBackwards(node._c_node, 0)             # <<<<<<<<<<<<<<
44985  *             self._next_element = _previousElement
44986  *         else:
44987  */
44988     __pyx_v_c_node = __pyx_f_4lxml_5etree__findChildBackwards(__pyx_v_node->_c_node, 0);
44989
44990     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2166
44991  *         if reversed:
44992  *             c_node = _findChildBackwards(node._c_node, 0)
44993  *             self._next_element = _previousElement             # <<<<<<<<<<<<<<
44994  *         else:
44995  *             c_node = _findChildForwards(node._c_node, 0)
44996  */
44997     ((struct __pyx_obj_4lxml_5etree_ElementChildIterator *)__pyx_v_self)->__pyx_base._next_element = __pyx_f_4lxml_5etree__previousElement;
44998     goto __pyx_L6;
44999   }
45000   /*else*/ {
45001
45002     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2168
45003  *             self._next_element = _previousElement
45004  *         else:
45005  *             c_node = _findChildForwards(node._c_node, 0)             # <<<<<<<<<<<<<<
45006  *             self._next_element = _nextElement
45007  *         if tag is not None:
45008  */
45009     __pyx_v_c_node = __pyx_f_4lxml_5etree__findChildForwards(__pyx_v_node->_c_node, 0);
45010
45011     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2169
45012  *         else:
45013  *             c_node = _findChildForwards(node._c_node, 0)
45014  *             self._next_element = _nextElement             # <<<<<<<<<<<<<<
45015  *         if tag is not None:
45016  *             while c_node is not NULL and \
45017  */
45018     ((struct __pyx_obj_4lxml_5etree_ElementChildIterator *)__pyx_v_self)->__pyx_base._next_element = __pyx_f_4lxml_5etree__nextElement;
45019   }
45020   __pyx_L6:;
45021
45022   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2170
45023  *             c_node = _findChildForwards(node._c_node, 0)
45024  *             self._next_element = _nextElement
45025  *         if tag is not None:             # <<<<<<<<<<<<<<
45026  *             while c_node is not NULL and \
45027  *                       self._node_type != 0 and \
45028  */
45029   __pyx_t_2 = (__pyx_v_tag != Py_None);
45030   if (__pyx_t_2) {
45031
45032     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2171
45033  *             self._next_element = _nextElement
45034  *         if tag is not None:
45035  *             while c_node is not NULL and \             # <<<<<<<<<<<<<<
45036  *                       self._node_type != 0 and \
45037  *                       (self._node_type != c_node.type or
45038  */
45039     while (1) {
45040       if ((__pyx_v_c_node != NULL)) {
45041
45042         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2172
45043  *         if tag is not None:
45044  *             while c_node is not NULL and \
45045  *                       self._node_type != 0 and \             # <<<<<<<<<<<<<<
45046  *                       (self._node_type != c_node.type or
45047  *                        not _tagMatches(c_node, self._href, self._name)):
45048  */
45049         if ((((struct __pyx_obj_4lxml_5etree_ElementChildIterator *)__pyx_v_self)->__pyx_base.__pyx_base._node_type != 0)) {
45050
45051           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2173
45052  *             while c_node is not NULL and \
45053  *                       self._node_type != 0 and \
45054  *                       (self._node_type != c_node.type or             # <<<<<<<<<<<<<<
45055  *                        not _tagMatches(c_node, self._href, self._name)):
45056  *                 c_node = self._next_element(c_node)
45057  */
45058           if (!(((struct __pyx_obj_4lxml_5etree_ElementChildIterator *)__pyx_v_self)->__pyx_base.__pyx_base._node_type != __pyx_v_c_node->type)) {
45059
45060             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2174
45061  *                       self._node_type != 0 and \
45062  *                       (self._node_type != c_node.type or
45063  *                        not _tagMatches(c_node, self._href, self._name)):             # <<<<<<<<<<<<<<
45064  *                 c_node = self._next_element(c_node)
45065  *         if c_node is not NULL:
45066  */
45067             __pyx_t_2 = (!__pyx_f_4lxml_5etree__tagMatches(__pyx_v_c_node, ((struct __pyx_obj_4lxml_5etree_ElementChildIterator *)__pyx_v_self)->__pyx_base.__pyx_base._href, ((struct __pyx_obj_4lxml_5etree_ElementChildIterator *)__pyx_v_self)->__pyx_base.__pyx_base._name));
45068           } else {
45069             __pyx_t_2 = (((struct __pyx_obj_4lxml_5etree_ElementChildIterator *)__pyx_v_self)->__pyx_base.__pyx_base._node_type != __pyx_v_c_node->type);
45070           }
45071           __pyx_t_3 = __pyx_t_2;
45072         } else {
45073           __pyx_t_3 = (((struct __pyx_obj_4lxml_5etree_ElementChildIterator *)__pyx_v_self)->__pyx_base.__pyx_base._node_type != 0);
45074         }
45075         __pyx_t_2 = __pyx_t_3;
45076       } else {
45077         __pyx_t_2 = (__pyx_v_c_node != NULL);
45078       }
45079       if (!__pyx_t_2) break;
45080
45081       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2175
45082  *                       (self._node_type != c_node.type or
45083  *                        not _tagMatches(c_node, self._href, self._name)):
45084  *                 c_node = self._next_element(c_node)             # <<<<<<<<<<<<<<
45085  *         if c_node is not NULL:
45086  *             # store Python ref:
45087  */
45088       __pyx_v_c_node = ((struct __pyx_obj_4lxml_5etree_ElementChildIterator *)__pyx_v_self)->__pyx_base._next_element(__pyx_v_c_node);
45089     }
45090     goto __pyx_L7;
45091   }
45092   __pyx_L7:;
45093
45094   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2176
45095  *                        not _tagMatches(c_node, self._href, self._name)):
45096  *                 c_node = self._next_element(c_node)
45097  *         if c_node is not NULL:             # <<<<<<<<<<<<<<
45098  *             # store Python ref:
45099  *             self._node = _elementFactory(node._doc, c_node)
45100  */
45101   __pyx_t_2 = (__pyx_v_c_node != NULL);
45102   if (__pyx_t_2) {
45103
45104     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2178
45105  *         if c_node is not NULL:
45106  *             # store Python ref:
45107  *             self._node = _elementFactory(node._doc, c_node)             # <<<<<<<<<<<<<<
45108  * 
45109  * cdef class SiblingsIterator(_ElementIterator):
45110  */
45111     __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_node->_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
45112     __Pyx_GOTREF(__pyx_t_1);
45113     __Pyx_GIVEREF(__pyx_t_1);
45114     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_ElementChildIterator *)__pyx_v_self)->__pyx_base._node);
45115     __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_ElementChildIterator *)__pyx_v_self)->__pyx_base._node));
45116     ((struct __pyx_obj_4lxml_5etree_ElementChildIterator *)__pyx_v_self)->__pyx_base._node = ((struct LxmlElement *)__pyx_t_1);
45117     __pyx_t_1 = 0;
45118     goto __pyx_L10;
45119   }
45120   __pyx_L10:;
45121
45122   __pyx_r = 0;
45123   goto __pyx_L0;
45124   __pyx_L1_error:;
45125   __Pyx_XDECREF(__pyx_t_1);
45126   __Pyx_AddTraceback("lxml.etree.ElementChildIterator.__init__");
45127   __pyx_r = -1;
45128   __pyx_L0:;
45129   __Pyx_FinishRefcountContext();
45130   return __pyx_r;
45131 }
45132
45133 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2186
45134  *     You can pass the boolean keyword ``preceding`` to specify the direction.
45135  *     """
45136  *     def __init__(self, _Element node not None, tag=None, *, preceding=False):             # <<<<<<<<<<<<<<
45137  *         self._initTagMatch(tag)
45138  *         if preceding:
45139  */
45140
45141 static int __pyx_pf_4lxml_5etree_16SiblingsIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
45142 static int __pyx_pf_4lxml_5etree_16SiblingsIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
45143   struct LxmlElement *__pyx_v_node = 0;
45144   PyObject *__pyx_v_tag = 0;
45145   PyObject *__pyx_v_preceding = 0;
45146   int __pyx_r;
45147   PyObject *__pyx_t_1 = NULL;
45148   int __pyx_t_2;
45149   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_node,&__pyx_kp_tag,&__pyx_kp_preceding,0};
45150   __Pyx_SetupRefcountContext("__init__");
45151   if (unlikely(__pyx_kwds)) {
45152     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
45153     PyObject* values[3] = {0,0,0};
45154     values[1] = Py_None;
45155     values[2] = __pyx_k_98;
45156     switch (PyTuple_GET_SIZE(__pyx_args)) {
45157       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
45158       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
45159       case  0: break;
45160       default: goto __pyx_L5_argtuple_error;
45161     }
45162     switch (PyTuple_GET_SIZE(__pyx_args)) {
45163       case  0:
45164       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_node);
45165       if (likely(values[0])) kw_args--;
45166       else goto __pyx_L5_argtuple_error;
45167       case  1:
45168       if (kw_args > 1) {
45169         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_tag);
45170         if (unlikely(value)) { values[1] = value; kw_args--; }
45171       }
45172     }
45173     while (kw_args > 0) {
45174       PyObject* value;
45175       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_preceding);
45176       if (value) { values[2] = value; if (!(--kw_args)) break; }
45177       break;
45178     }
45179     if (unlikely(kw_args > 0)) {
45180       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2186; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
45181     }
45182     __pyx_v_node = ((struct LxmlElement *)values[0]);
45183     __pyx_v_tag = values[1];
45184     __pyx_v_preceding = values[2];
45185   } else {
45186     __pyx_v_tag = Py_None;
45187     __pyx_v_preceding = __pyx_k_98;
45188     switch (PyTuple_GET_SIZE(__pyx_args)) {
45189       case  2: __pyx_v_tag = PyTuple_GET_ITEM(__pyx_args, 1);
45190       case  1: __pyx_v_node = ((struct LxmlElement *)PyTuple_GET_ITEM(__pyx_args, 0));
45191       break;
45192       default: goto __pyx_L5_argtuple_error;
45193     }
45194   }
45195   goto __pyx_L4_argument_unpacking_done;
45196   __pyx_L5_argtuple_error:;
45197   __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2186; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
45198   __pyx_L3_error:;
45199   __Pyx_AddTraceback("lxml.etree.SiblingsIterator.__init__");
45200   return -1;
45201   __pyx_L4_argument_unpacking_done:;
45202   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_node), __pyx_ptype_4lxml_5etree__Element, 0, "node", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
45203
45204   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2187
45205  *     """
45206  *     def __init__(self, _Element node not None, tag=None, *, preceding=False):
45207  *         self._initTagMatch(tag)             # <<<<<<<<<<<<<<
45208  *         if preceding:
45209  *             self._next_element = _previousElement
45210  */
45211   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree_SiblingsIterator *)((struct __pyx_obj_4lxml_5etree_SiblingsIterator *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._initTagMatch(((struct LxmlElementTagMatcher *)__pyx_v_self), __pyx_v_tag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
45212   __Pyx_GOTREF(__pyx_t_1);
45213   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
45214
45215   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2188
45216  *     def __init__(self, _Element node not None, tag=None, *, preceding=False):
45217  *         self._initTagMatch(tag)
45218  *         if preceding:             # <<<<<<<<<<<<<<
45219  *             self._next_element = _previousElement
45220  *         else:
45221  */
45222   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_preceding); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
45223   if (__pyx_t_2) {
45224
45225     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2189
45226  *         self._initTagMatch(tag)
45227  *         if preceding:
45228  *             self._next_element = _previousElement             # <<<<<<<<<<<<<<
45229  *         else:
45230  *             self._next_element = _nextElement
45231  */
45232     ((struct __pyx_obj_4lxml_5etree_SiblingsIterator *)__pyx_v_self)->__pyx_base._next_element = __pyx_f_4lxml_5etree__previousElement;
45233     goto __pyx_L6;
45234   }
45235   /*else*/ {
45236
45237     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2191
45238  *             self._next_element = _previousElement
45239  *         else:
45240  *             self._next_element = _nextElement             # <<<<<<<<<<<<<<
45241  *         self._storeNext(node)
45242  * 
45243  */
45244     ((struct __pyx_obj_4lxml_5etree_SiblingsIterator *)__pyx_v_self)->__pyx_base._next_element = __pyx_f_4lxml_5etree__nextElement;
45245   }
45246   __pyx_L6:;
45247
45248   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2192
45249  *         else:
45250  *             self._next_element = _nextElement
45251  *         self._storeNext(node)             # <<<<<<<<<<<<<<
45252  * 
45253  * cdef class AncestorsIterator(_ElementIterator):
45254  */
45255   ((struct __pyx_vtabstruct_4lxml_5etree_SiblingsIterator *)((struct __pyx_obj_4lxml_5etree_SiblingsIterator *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base._storeNext(((struct LxmlElementIterator *)__pyx_v_self), __pyx_v_node);
45256
45257   __pyx_r = 0;
45258   goto __pyx_L0;
45259   __pyx_L1_error:;
45260   __Pyx_XDECREF(__pyx_t_1);
45261   __Pyx_AddTraceback("lxml.etree.SiblingsIterator.__init__");
45262   __pyx_r = -1;
45263   __pyx_L0:;
45264   __Pyx_FinishRefcountContext();
45265   return __pyx_r;
45266 }
45267
45268 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2198
45269  *     Iterates over the ancestors of an element (from parent to parent).
45270  *     """
45271  *     def __init__(self, _Element node not None, tag=None):             # <<<<<<<<<<<<<<
45272  *         self._initTagMatch(tag)
45273  *         self._next_element = _parentElement
45274  */
45275
45276 static int __pyx_pf_4lxml_5etree_17AncestorsIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
45277 static int __pyx_pf_4lxml_5etree_17AncestorsIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
45278   struct LxmlElement *__pyx_v_node = 0;
45279   PyObject *__pyx_v_tag = 0;
45280   int __pyx_r;
45281   PyObject *__pyx_t_1 = NULL;
45282   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_node,&__pyx_kp_tag,0};
45283   __Pyx_SetupRefcountContext("__init__");
45284   if (unlikely(__pyx_kwds)) {
45285     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
45286     PyObject* values[2] = {0,0};
45287     values[1] = Py_None;
45288     switch (PyTuple_GET_SIZE(__pyx_args)) {
45289       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
45290       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
45291       case  0: break;
45292       default: goto __pyx_L5_argtuple_error;
45293     }
45294     switch (PyTuple_GET_SIZE(__pyx_args)) {
45295       case  0:
45296       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_node);
45297       if (likely(values[0])) kw_args--;
45298       else goto __pyx_L5_argtuple_error;
45299       case  1:
45300       if (kw_args > 1) {
45301         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_tag);
45302         if (unlikely(value)) { values[1] = value; kw_args--; }
45303       }
45304     }
45305     if (unlikely(kw_args > 0)) {
45306       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2198; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
45307     }
45308     __pyx_v_node = ((struct LxmlElement *)values[0]);
45309     __pyx_v_tag = values[1];
45310   } else {
45311     __pyx_v_tag = Py_None;
45312     switch (PyTuple_GET_SIZE(__pyx_args)) {
45313       case  2: __pyx_v_tag = PyTuple_GET_ITEM(__pyx_args, 1);
45314       case  1: __pyx_v_node = ((struct LxmlElement *)PyTuple_GET_ITEM(__pyx_args, 0));
45315       break;
45316       default: goto __pyx_L5_argtuple_error;
45317     }
45318   }
45319   goto __pyx_L4_argument_unpacking_done;
45320   __pyx_L5_argtuple_error:;
45321   __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2198; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
45322   __pyx_L3_error:;
45323   __Pyx_AddTraceback("lxml.etree.AncestorsIterator.__init__");
45324   return -1;
45325   __pyx_L4_argument_unpacking_done:;
45326   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_node), __pyx_ptype_4lxml_5etree__Element, 0, "node", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
45327
45328   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2199
45329  *     """
45330  *     def __init__(self, _Element node not None, tag=None):
45331  *         self._initTagMatch(tag)             # <<<<<<<<<<<<<<
45332  *         self._next_element = _parentElement
45333  *         self._storeNext(node)
45334  */
45335   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree_AncestorsIterator *)((struct __pyx_obj_4lxml_5etree_AncestorsIterator *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._initTagMatch(((struct LxmlElementTagMatcher *)__pyx_v_self), __pyx_v_tag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
45336   __Pyx_GOTREF(__pyx_t_1);
45337   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
45338
45339   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2200
45340  *     def __init__(self, _Element node not None, tag=None):
45341  *         self._initTagMatch(tag)
45342  *         self._next_element = _parentElement             # <<<<<<<<<<<<<<
45343  *         self._storeNext(node)
45344  * 
45345  */
45346   ((struct __pyx_obj_4lxml_5etree_AncestorsIterator *)__pyx_v_self)->__pyx_base._next_element = __pyx_f_4lxml_5etree__parentElement;
45347
45348   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2201
45349  *         self._initTagMatch(tag)
45350  *         self._next_element = _parentElement
45351  *         self._storeNext(node)             # <<<<<<<<<<<<<<
45352  * 
45353  * cdef class ElementDepthFirstIterator(_ElementTagMatcher):
45354  */
45355   ((struct __pyx_vtabstruct_4lxml_5etree_AncestorsIterator *)((struct __pyx_obj_4lxml_5etree_AncestorsIterator *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base._storeNext(((struct LxmlElementIterator *)__pyx_v_self), __pyx_v_node);
45356
45357   __pyx_r = 0;
45358   goto __pyx_L0;
45359   __pyx_L1_error:;
45360   __Pyx_XDECREF(__pyx_t_1);
45361   __Pyx_AddTraceback("lxml.etree.AncestorsIterator.__init__");
45362   __pyx_r = -1;
45363   __pyx_L0:;
45364   __Pyx_FinishRefcountContext();
45365   return __pyx_r;
45366 }
45367
45368 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2227
45369  *     cdef _Element _next_node
45370  *     cdef _Element _top_node
45371  *     def __init__(self, _Element node not None, tag=None, *, inclusive=True):             # <<<<<<<<<<<<<<
45372  *         self._top_node  = node
45373  *         self._next_node = node
45374  */
45375
45376 static int __pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
45377 static int __pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
45378   struct LxmlElement *__pyx_v_node = 0;
45379   PyObject *__pyx_v_tag = 0;
45380   PyObject *__pyx_v_inclusive = 0;
45381   int __pyx_r;
45382   PyObject *__pyx_t_1 = NULL;
45383   int __pyx_t_2;
45384   int __pyx_t_3;
45385   int __pyx_t_4;
45386   int __pyx_t_5;
45387   PyObject *__pyx_t_6 = NULL;
45388   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_node,&__pyx_kp_tag,&__pyx_kp_inclusive,0};
45389   __Pyx_SetupRefcountContext("__init__");
45390   if (unlikely(__pyx_kwds)) {
45391     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
45392     PyObject* values[3] = {0,0,0};
45393     values[1] = Py_None;
45394     values[2] = __pyx_k_99;
45395     switch (PyTuple_GET_SIZE(__pyx_args)) {
45396       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
45397       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
45398       case  0: break;
45399       default: goto __pyx_L5_argtuple_error;
45400     }
45401     switch (PyTuple_GET_SIZE(__pyx_args)) {
45402       case  0:
45403       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_node);
45404       if (likely(values[0])) kw_args--;
45405       else goto __pyx_L5_argtuple_error;
45406       case  1:
45407       if (kw_args > 1) {
45408         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_tag);
45409         if (unlikely(value)) { values[1] = value; kw_args--; }
45410       }
45411     }
45412     while (kw_args > 0) {
45413       PyObject* value;
45414       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_inclusive);
45415       if (value) { values[2] = value; if (!(--kw_args)) break; }
45416       break;
45417     }
45418     if (unlikely(kw_args > 0)) {
45419       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
45420     }
45421     __pyx_v_node = ((struct LxmlElement *)values[0]);
45422     __pyx_v_tag = values[1];
45423     __pyx_v_inclusive = values[2];
45424   } else {
45425     __pyx_v_tag = Py_None;
45426     __pyx_v_inclusive = __pyx_k_99;
45427     switch (PyTuple_GET_SIZE(__pyx_args)) {
45428       case  2: __pyx_v_tag = PyTuple_GET_ITEM(__pyx_args, 1);
45429       case  1: __pyx_v_node = ((struct LxmlElement *)PyTuple_GET_ITEM(__pyx_args, 0));
45430       break;
45431       default: goto __pyx_L5_argtuple_error;
45432     }
45433   }
45434   goto __pyx_L4_argument_unpacking_done;
45435   __pyx_L5_argtuple_error:;
45436   __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
45437   __pyx_L3_error:;
45438   __Pyx_AddTraceback("lxml.etree.ElementDepthFirstIterator.__init__");
45439   return -1;
45440   __pyx_L4_argument_unpacking_done:;
45441   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_node), __pyx_ptype_4lxml_5etree__Element, 0, "node", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
45442
45443   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2228
45444  *     cdef _Element _top_node
45445  *     def __init__(self, _Element node not None, tag=None, *, inclusive=True):
45446  *         self._top_node  = node             # <<<<<<<<<<<<<<
45447  *         self._next_node = node
45448  *         self._initTagMatch(tag)
45449  */
45450   __Pyx_INCREF(((PyObject *)__pyx_v_node));
45451   __Pyx_GIVEREF(((PyObject *)__pyx_v_node));
45452   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_top_node);
45453   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_top_node));
45454   ((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_top_node = __pyx_v_node;
45455
45456   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2229
45457  *     def __init__(self, _Element node not None, tag=None, *, inclusive=True):
45458  *         self._top_node  = node
45459  *         self._next_node = node             # <<<<<<<<<<<<<<
45460  *         self._initTagMatch(tag)
45461  *         if not inclusive or \
45462  */
45463   __Pyx_INCREF(((PyObject *)__pyx_v_node));
45464   __Pyx_GIVEREF(((PyObject *)__pyx_v_node));
45465   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node);
45466   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node));
45467   ((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node = __pyx_v_node;
45468
45469   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2230
45470  *         self._top_node  = node
45471  *         self._next_node = node
45472  *         self._initTagMatch(tag)             # <<<<<<<<<<<<<<
45473  *         if not inclusive or \
45474  *                tag is not None and \
45475  */
45476   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree_ElementDepthFirstIterator *)((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._initTagMatch(((struct LxmlElementTagMatcher *)__pyx_v_self), __pyx_v_tag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
45477   __Pyx_GOTREF(__pyx_t_1);
45478   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
45479
45480   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2231
45481  *         self._next_node = node
45482  *         self._initTagMatch(tag)
45483  *         if not inclusive or \             # <<<<<<<<<<<<<<
45484  *                tag is not None and \
45485  *                self._node_type != 0 and \
45486  */
45487   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_inclusive); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
45488   if (!(!__pyx_t_2)) {
45489
45490     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2232
45491  *         self._initTagMatch(tag)
45492  *         if not inclusive or \
45493  *                tag is not None and \             # <<<<<<<<<<<<<<
45494  *                self._node_type != 0 and \
45495  *                (self._node_type != node._c_node.type or
45496  */
45497     __pyx_t_3 = (__pyx_v_tag != Py_None);
45498     if (__pyx_t_3) {
45499
45500       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2233
45501  *         if not inclusive or \
45502  *                tag is not None and \
45503  *                self._node_type != 0 and \             # <<<<<<<<<<<<<<
45504  *                (self._node_type != node._c_node.type or
45505  *                 not _tagMatches(node._c_node, self._href, self._name)):
45506  */
45507       if ((((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->__pyx_base._node_type != 0)) {
45508
45509         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2234
45510  *                tag is not None and \
45511  *                self._node_type != 0 and \
45512  *                (self._node_type != node._c_node.type or             # <<<<<<<<<<<<<<
45513  *                 not _tagMatches(node._c_node, self._href, self._name)):
45514  *             # this cannot raise StopIteration, self._next_node != None
45515  */
45516         if (!(((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->__pyx_base._node_type != __pyx_v_node->_c_node->type)) {
45517
45518           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2235
45519  *                self._node_type != 0 and \
45520  *                (self._node_type != node._c_node.type or
45521  *                 not _tagMatches(node._c_node, self._href, self._name)):             # <<<<<<<<<<<<<<
45522  *             # this cannot raise StopIteration, self._next_node != None
45523  *             self.__next__()
45524  */
45525           __pyx_t_4 = (!__pyx_f_4lxml_5etree__tagMatches(__pyx_v_node->_c_node, ((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->__pyx_base._href, ((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->__pyx_base._name));
45526         } else {
45527           __pyx_t_4 = (((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->__pyx_base._node_type != __pyx_v_node->_c_node->type);
45528         }
45529         __pyx_t_5 = __pyx_t_4;
45530       } else {
45531         __pyx_t_5 = (((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->__pyx_base._node_type != 0);
45532       }
45533       __pyx_t_4 = __pyx_t_5;
45534     } else {
45535       __pyx_t_4 = __pyx_t_3;
45536     }
45537     __pyx_t_3 = __pyx_t_4;
45538   } else {
45539     __pyx_t_3 = (!__pyx_t_2);
45540   }
45541   if (__pyx_t_3) {
45542
45543     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2237
45544  *                 not _tagMatches(node._c_node, self._href, self._name)):
45545  *             # this cannot raise StopIteration, self._next_node != None
45546  *             self.__next__()             # <<<<<<<<<<<<<<
45547  * 
45548  *     def __iter__(self):
45549  */
45550     __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp___next__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
45551     __Pyx_GOTREF(__pyx_t_1);
45552     __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
45553     __Pyx_GOTREF(__pyx_t_6);
45554     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
45555     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
45556     goto __pyx_L6;
45557   }
45558   __pyx_L6:;
45559
45560   __pyx_r = 0;
45561   goto __pyx_L0;
45562   __pyx_L1_error:;
45563   __Pyx_XDECREF(__pyx_t_1);
45564   __Pyx_XDECREF(__pyx_t_6);
45565   __Pyx_AddTraceback("lxml.etree.ElementDepthFirstIterator.__init__");
45566   __pyx_r = -1;
45567   __pyx_L0:;
45568   __Pyx_FinishRefcountContext();
45569   return __pyx_r;
45570 }
45571
45572 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2239
45573  *             self.__next__()
45574  * 
45575  *     def __iter__(self):             # <<<<<<<<<<<<<<
45576  *         return self
45577  * 
45578  */
45579
45580 static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___iter__(PyObject *__pyx_v_self); /*proto*/
45581 static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___iter__(PyObject *__pyx_v_self) {
45582   PyObject *__pyx_r = NULL;
45583   __Pyx_SetupRefcountContext("__iter__");
45584
45585   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2240
45586  * 
45587  *     def __iter__(self):
45588  *         return self             # <<<<<<<<<<<<<<
45589  * 
45590  *     def __next__(self):
45591  */
45592   __Pyx_XDECREF(__pyx_r);
45593   __Pyx_INCREF(__pyx_v_self);
45594   __pyx_r = __pyx_v_self;
45595   goto __pyx_L0;
45596
45597   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
45598   __pyx_L0:;
45599   __Pyx_XGIVEREF(__pyx_r);
45600   __Pyx_FinishRefcountContext();
45601   return __pyx_r;
45602 }
45603
45604 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2242
45605  *         return self
45606  * 
45607  *     def __next__(self):             # <<<<<<<<<<<<<<
45608  *         cdef xmlNode* c_node
45609  *         cdef _Element current_node
45610  */
45611
45612 static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___next__(PyObject *__pyx_v_self); /*proto*/
45613 static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___next__(PyObject *__pyx_v_self) {
45614   xmlNode *__pyx_v_c_node;
45615   struct LxmlElement *__pyx_v_current_node;
45616   PyObject *__pyx_r = NULL;
45617   int __pyx_t_1;
45618   PyObject *__pyx_t_2 = NULL;
45619   __Pyx_SetupRefcountContext("__next__");
45620   __pyx_v_current_node = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
45621
45622   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2245
45623  *         cdef xmlNode* c_node
45624  *         cdef _Element current_node
45625  *         if self._next_node is None:             # <<<<<<<<<<<<<<
45626  *             raise StopIteration
45627  *         current_node = self._next_node
45628  */
45629   __pyx_t_1 = (((PyObject *)((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node) == Py_None);
45630   if (__pyx_t_1) {
45631
45632     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2246
45633  *         cdef _Element current_node
45634  *         if self._next_node is None:
45635  *             raise StopIteration             # <<<<<<<<<<<<<<
45636  *         current_node = self._next_node
45637  *         c_node = self._next_node._c_node
45638  */
45639     __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
45640     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
45641     goto __pyx_L5;
45642   }
45643   __pyx_L5:;
45644
45645   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2247
45646  *         if self._next_node is None:
45647  *             raise StopIteration
45648  *         current_node = self._next_node             # <<<<<<<<<<<<<<
45649  *         c_node = self._next_node._c_node
45650  *         if self._name is NULL and self._href is NULL:
45651  */
45652   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node));
45653   __Pyx_DECREF(((PyObject *)__pyx_v_current_node));
45654   __pyx_v_current_node = ((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node;
45655
45656   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2248
45657  *             raise StopIteration
45658  *         current_node = self._next_node
45659  *         c_node = self._next_node._c_node             # <<<<<<<<<<<<<<
45660  *         if self._name is NULL and self._href is NULL:
45661  *             c_node = self._nextNodeAnyTag(c_node)
45662  */
45663   __pyx_v_c_node = ((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node->_c_node;
45664
45665   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2249
45666  *         current_node = self._next_node
45667  *         c_node = self._next_node._c_node
45668  *         if self._name is NULL and self._href is NULL:             # <<<<<<<<<<<<<<
45669  *             c_node = self._nextNodeAnyTag(c_node)
45670  *         else:
45671  */
45672   if ((((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->__pyx_base._name == NULL)) {
45673     __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->__pyx_base._href == NULL);
45674   } else {
45675     __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->__pyx_base._name == NULL);
45676   }
45677   if (__pyx_t_1) {
45678
45679     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2250
45680  *         c_node = self._next_node._c_node
45681  *         if self._name is NULL and self._href is NULL:
45682  *             c_node = self._nextNodeAnyTag(c_node)             # <<<<<<<<<<<<<<
45683  *         else:
45684  *             c_node = self._nextNodeMatchTag(c_node)
45685  */
45686     __pyx_v_c_node = ((struct __pyx_vtabstruct_4lxml_5etree_ElementDepthFirstIterator *)((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->__pyx_base.__pyx_vtab)->_nextNodeAnyTag(((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self), __pyx_v_c_node);
45687     goto __pyx_L6;
45688   }
45689   /*else*/ {
45690
45691     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2252
45692  *             c_node = self._nextNodeAnyTag(c_node)
45693  *         else:
45694  *             c_node = self._nextNodeMatchTag(c_node)             # <<<<<<<<<<<<<<
45695  *         if c_node is NULL:
45696  *             self._next_node = None
45697  */
45698     __pyx_v_c_node = ((struct __pyx_vtabstruct_4lxml_5etree_ElementDepthFirstIterator *)((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->__pyx_base.__pyx_vtab)->_nextNodeMatchTag(((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self), __pyx_v_c_node);
45699   }
45700   __pyx_L6:;
45701
45702   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2253
45703  *         else:
45704  *             c_node = self._nextNodeMatchTag(c_node)
45705  *         if c_node is NULL:             # <<<<<<<<<<<<<<
45706  *             self._next_node = None
45707  *         else:
45708  */
45709   __pyx_t_1 = (__pyx_v_c_node == NULL);
45710   if (__pyx_t_1) {
45711
45712     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2254
45713  *             c_node = self._nextNodeMatchTag(c_node)
45714  *         if c_node is NULL:
45715  *             self._next_node = None             # <<<<<<<<<<<<<<
45716  *         else:
45717  *             self._next_node = _elementFactory(current_node._doc, c_node)
45718  */
45719     __Pyx_INCREF(Py_None);
45720     __Pyx_GIVEREF(Py_None);
45721     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node);
45722     __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node));
45723     ((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node = ((struct LxmlElement *)Py_None);
45724     goto __pyx_L7;
45725   }
45726   /*else*/ {
45727
45728     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2256
45729  *             self._next_node = None
45730  *         else:
45731  *             self._next_node = _elementFactory(current_node._doc, c_node)             # <<<<<<<<<<<<<<
45732  *         return current_node
45733  * 
45734  */
45735     __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_current_node->_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
45736     __Pyx_GOTREF(__pyx_t_2);
45737     __Pyx_GIVEREF(__pyx_t_2);
45738     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node);
45739     __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node));
45740     ((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node = ((struct LxmlElement *)__pyx_t_2);
45741     __pyx_t_2 = 0;
45742   }
45743   __pyx_L7:;
45744
45745   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2257
45746  *         else:
45747  *             self._next_node = _elementFactory(current_node._doc, c_node)
45748  *         return current_node             # <<<<<<<<<<<<<<
45749  * 
45750  *     cdef xmlNode* _nextNodeAnyTag(self, xmlNode* c_node):
45751  */
45752   __Pyx_XDECREF(__pyx_r);
45753   __Pyx_INCREF(((PyObject *)__pyx_v_current_node));
45754   __pyx_r = ((PyObject *)__pyx_v_current_node);
45755   goto __pyx_L0;
45756
45757   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
45758   goto __pyx_L0;
45759   __pyx_L1_error:;
45760   __Pyx_XDECREF(__pyx_t_2);
45761   __Pyx_AddTraceback("lxml.etree.ElementDepthFirstIterator.__next__");
45762   __pyx_r = NULL;
45763   __pyx_L0:;
45764   __Pyx_DECREF((PyObject *)__pyx_v_current_node);
45765   __Pyx_XGIVEREF(__pyx_r);
45766   __Pyx_FinishRefcountContext();
45767   return __pyx_r;
45768 }
45769
45770 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2259
45771  *         return current_node
45772  * 
45773  *     cdef xmlNode* _nextNodeAnyTag(self, xmlNode* c_node):             # <<<<<<<<<<<<<<
45774  *         tree.BEGIN_FOR_EACH_ELEMENT_FROM(self._top_node._c_node, c_node, 0)
45775  *         if self._node_type == 0 or self._node_type == c_node.type:
45776  */
45777
45778 static  xmlNode *__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeAnyTag(struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *__pyx_v_self, xmlNode *__pyx_v_c_node) {
45779   xmlNode *__pyx_r;
45780   int __pyx_t_1;
45781   __Pyx_SetupRefcountContext("_nextNodeAnyTag");
45782
45783   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2260
45784  * 
45785  *     cdef xmlNode* _nextNodeAnyTag(self, xmlNode* c_node):
45786  *         tree.BEGIN_FOR_EACH_ELEMENT_FROM(self._top_node._c_node, c_node, 0)             # <<<<<<<<<<<<<<
45787  *         if self._node_type == 0 or self._node_type == c_node.type:
45788  *             return c_node
45789  */
45790   BEGIN_FOR_EACH_ELEMENT_FROM(__pyx_v_self->_top_node->_c_node, __pyx_v_c_node, 0);
45791
45792   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2261
45793  *     cdef xmlNode* _nextNodeAnyTag(self, xmlNode* c_node):
45794  *         tree.BEGIN_FOR_EACH_ELEMENT_FROM(self._top_node._c_node, c_node, 0)
45795  *         if self._node_type == 0 or self._node_type == c_node.type:             # <<<<<<<<<<<<<<
45796  *             return c_node
45797  *         tree.END_FOR_EACH_ELEMENT_FROM(c_node)
45798  */
45799   if (!(__pyx_v_self->__pyx_base._node_type == 0)) {
45800     __pyx_t_1 = (__pyx_v_self->__pyx_base._node_type == __pyx_v_c_node->type);
45801   } else {
45802     __pyx_t_1 = (__pyx_v_self->__pyx_base._node_type == 0);
45803   }
45804   if (__pyx_t_1) {
45805
45806     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2262
45807  *         tree.BEGIN_FOR_EACH_ELEMENT_FROM(self._top_node._c_node, c_node, 0)
45808  *         if self._node_type == 0 or self._node_type == c_node.type:
45809  *             return c_node             # <<<<<<<<<<<<<<
45810  *         tree.END_FOR_EACH_ELEMENT_FROM(c_node)
45811  *         return NULL
45812  */
45813     __pyx_r = __pyx_v_c_node;
45814     goto __pyx_L0;
45815     goto __pyx_L3;
45816   }
45817   __pyx_L3:;
45818
45819   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2263
45820  *         if self._node_type == 0 or self._node_type == c_node.type:
45821  *             return c_node
45822  *         tree.END_FOR_EACH_ELEMENT_FROM(c_node)             # <<<<<<<<<<<<<<
45823  *         return NULL
45824  * 
45825  */
45826   END_FOR_EACH_ELEMENT_FROM(__pyx_v_c_node);
45827
45828   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2264
45829  *             return c_node
45830  *         tree.END_FOR_EACH_ELEMENT_FROM(c_node)
45831  *         return NULL             # <<<<<<<<<<<<<<
45832  * 
45833  *     cdef xmlNode* _nextNodeMatchTag(self, xmlNode* c_node):
45834  */
45835   __pyx_r = NULL;
45836   goto __pyx_L0;
45837
45838   __pyx_r = 0;
45839   __pyx_L0:;
45840   __Pyx_FinishRefcountContext();
45841   return __pyx_r;
45842 }
45843
45844 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2266
45845  *         return NULL
45846  * 
45847  *     cdef xmlNode* _nextNodeMatchTag(self, xmlNode* c_node):             # <<<<<<<<<<<<<<
45848  *         cdef char* c_name = NULL
45849  *         if self._name is not NULL:
45850  */
45851
45852 static  xmlNode *__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeMatchTag(struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *__pyx_v_self, xmlNode *__pyx_v_c_node) {
45853   char *__pyx_v_c_name;
45854   xmlNode *__pyx_r;
45855   int __pyx_t_1;
45856   int __pyx_t_2;
45857   __Pyx_SetupRefcountContext("_nextNodeMatchTag");
45858
45859   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2267
45860  * 
45861  *     cdef xmlNode* _nextNodeMatchTag(self, xmlNode* c_node):
45862  *         cdef char* c_name = NULL             # <<<<<<<<<<<<<<
45863  *         if self._name is not NULL:
45864  *             c_name = tree.xmlDictExists(c_node.doc.dict, self._name, -1)
45865  */
45866   __pyx_v_c_name = NULL;
45867
45868   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2268
45869  *     cdef xmlNode* _nextNodeMatchTag(self, xmlNode* c_node):
45870  *         cdef char* c_name = NULL
45871  *         if self._name is not NULL:             # <<<<<<<<<<<<<<
45872  *             c_name = tree.xmlDictExists(c_node.doc.dict, self._name, -1)
45873  *             if c_name is NULL:
45874  */
45875   __pyx_t_1 = (__pyx_v_self->__pyx_base._name != NULL);
45876   if (__pyx_t_1) {
45877
45878     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2269
45879  *         cdef char* c_name = NULL
45880  *         if self._name is not NULL:
45881  *             c_name = tree.xmlDictExists(c_node.doc.dict, self._name, -1)             # <<<<<<<<<<<<<<
45882  *             if c_name is NULL:
45883  *                 # not found in dict => not in document at all
45884  */
45885     __pyx_v_c_name = xmlDictExists(__pyx_v_c_node->doc->dict, __pyx_v_self->__pyx_base._name, -1);
45886
45887     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2270
45888  *         if self._name is not NULL:
45889  *             c_name = tree.xmlDictExists(c_node.doc.dict, self._name, -1)
45890  *             if c_name is NULL:             # <<<<<<<<<<<<<<
45891  *                 # not found in dict => not in document at all
45892  *                 return NULL
45893  */
45894     __pyx_t_1 = (__pyx_v_c_name == NULL);
45895     if (__pyx_t_1) {
45896
45897       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2272
45898  *             if c_name is NULL:
45899  *                 # not found in dict => not in document at all
45900  *                 return NULL             # <<<<<<<<<<<<<<
45901  *         tree.BEGIN_FOR_EACH_ELEMENT_FROM(self._top_node._c_node, c_node, 0)
45902  *         if c_node.type == tree.XML_ELEMENT_NODE:
45903  */
45904       __pyx_r = NULL;
45905       goto __pyx_L0;
45906       goto __pyx_L4;
45907     }
45908     __pyx_L4:;
45909     goto __pyx_L3;
45910   }
45911   __pyx_L3:;
45912
45913   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2273
45914  *                 # not found in dict => not in document at all
45915  *                 return NULL
45916  *         tree.BEGIN_FOR_EACH_ELEMENT_FROM(self._top_node._c_node, c_node, 0)             # <<<<<<<<<<<<<<
45917  *         if c_node.type == tree.XML_ELEMENT_NODE:
45918  *             if (c_name is NULL or c_name is c_node.name) and \
45919  */
45920   BEGIN_FOR_EACH_ELEMENT_FROM(__pyx_v_self->_top_node->_c_node, __pyx_v_c_node, 0);
45921
45922   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2274
45923  *                 return NULL
45924  *         tree.BEGIN_FOR_EACH_ELEMENT_FROM(self._top_node._c_node, c_node, 0)
45925  *         if c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
45926  *             if (c_name is NULL or c_name is c_node.name) and \
45927  *                     _tagMatches(c_node, self._href, self._name):
45928  */
45929   __pyx_t_1 = (__pyx_v_c_node->type == XML_ELEMENT_NODE);
45930   if (__pyx_t_1) {
45931
45932     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2275
45933  *         tree.BEGIN_FOR_EACH_ELEMENT_FROM(self._top_node._c_node, c_node, 0)
45934  *         if c_node.type == tree.XML_ELEMENT_NODE:
45935  *             if (c_name is NULL or c_name is c_node.name) and \             # <<<<<<<<<<<<<<
45936  *                     _tagMatches(c_node, self._href, self._name):
45937  *                 return c_node
45938  */
45939     if (!(__pyx_v_c_name == NULL)) {
45940       __pyx_t_1 = (__pyx_v_c_name == __pyx_v_c_node->name);
45941     } else {
45942       __pyx_t_1 = (__pyx_v_c_name == NULL);
45943     }
45944     if (__pyx_t_1) {
45945
45946       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2276
45947  *         if c_node.type == tree.XML_ELEMENT_NODE:
45948  *             if (c_name is NULL or c_name is c_node.name) and \
45949  *                     _tagMatches(c_node, self._href, self._name):             # <<<<<<<<<<<<<<
45950  *                 return c_node
45951  *         tree.END_FOR_EACH_ELEMENT_FROM(c_node)
45952  */
45953       __pyx_t_2 = __pyx_f_4lxml_5etree__tagMatches(__pyx_v_c_node, __pyx_v_self->__pyx_base._href, __pyx_v_self->__pyx_base._name);
45954     } else {
45955       __pyx_t_2 = __pyx_t_1;
45956     }
45957     if (__pyx_t_2) {
45958
45959       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2277
45960  *             if (c_name is NULL or c_name is c_node.name) and \
45961  *                     _tagMatches(c_node, self._href, self._name):
45962  *                 return c_node             # <<<<<<<<<<<<<<
45963  *         tree.END_FOR_EACH_ELEMENT_FROM(c_node)
45964  *         return NULL
45965  */
45966       __pyx_r = __pyx_v_c_node;
45967       goto __pyx_L0;
45968       goto __pyx_L6;
45969     }
45970     __pyx_L6:;
45971     goto __pyx_L5;
45972   }
45973   __pyx_L5:;
45974
45975   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2278
45976  *                     _tagMatches(c_node, self._href, self._name):
45977  *                 return c_node
45978  *         tree.END_FOR_EACH_ELEMENT_FROM(c_node)             # <<<<<<<<<<<<<<
45979  *         return NULL
45980  * 
45981  */
45982   END_FOR_EACH_ELEMENT_FROM(__pyx_v_c_node);
45983
45984   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2279
45985  *                 return c_node
45986  *         tree.END_FOR_EACH_ELEMENT_FROM(c_node)
45987  *         return NULL             # <<<<<<<<<<<<<<
45988  * 
45989  * cdef class ElementTextIterator:
45990  */
45991   __pyx_r = NULL;
45992   goto __pyx_L0;
45993
45994   __pyx_r = 0;
45995   __pyx_L0:;
45996   __Pyx_FinishRefcountContext();
45997   return __pyx_r;
45998 }
45999
46000 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2293
46001  *     cdef object _nextEvent
46002  *     cdef _Element _start_element
46003  *     def __init__(self, _Element element not None, tag=None, *, with_tail=True):             # <<<<<<<<<<<<<<
46004  *         if with_tail:
46005  *             events = (u"start", u"end")
46006  */
46007
46008 static int __pyx_pf_4lxml_5etree_19ElementTextIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
46009 static int __pyx_pf_4lxml_5etree_19ElementTextIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
46010   struct LxmlElement *__pyx_v_element = 0;
46011   PyObject *__pyx_v_tag = 0;
46012   PyObject *__pyx_v_with_tail = 0;
46013   PyObject *__pyx_v_events;
46014   int __pyx_r;
46015   PyObject *__pyx_1 = 0;
46016   int __pyx_t_1;
46017   PyObject *__pyx_t_2 = NULL;
46018   PyObject *__pyx_t_3 = NULL;
46019   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_element,&__pyx_kp_tag,&__pyx_kp_with_tail,0};
46020   __Pyx_SetupRefcountContext("__init__");
46021   if (unlikely(__pyx_kwds)) {
46022     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
46023     PyObject* values[3] = {0,0,0};
46024     values[1] = Py_None;
46025     values[2] = __pyx_k_100;
46026     switch (PyTuple_GET_SIZE(__pyx_args)) {
46027       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
46028       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
46029       case  0: break;
46030       default: goto __pyx_L5_argtuple_error;
46031     }
46032     switch (PyTuple_GET_SIZE(__pyx_args)) {
46033       case  0:
46034       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_element);
46035       if (likely(values[0])) kw_args--;
46036       else goto __pyx_L5_argtuple_error;
46037       case  1:
46038       if (kw_args > 1) {
46039         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_tag);
46040         if (unlikely(value)) { values[1] = value; kw_args--; }
46041       }
46042     }
46043     while (kw_args > 0) {
46044       PyObject* value;
46045       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_with_tail);
46046       if (value) { values[2] = value; if (!(--kw_args)) break; }
46047       break;
46048     }
46049     if (unlikely(kw_args > 0)) {
46050       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2293; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
46051     }
46052     __pyx_v_element = ((struct LxmlElement *)values[0]);
46053     __pyx_v_tag = values[1];
46054     __pyx_v_with_tail = values[2];
46055   } else {
46056     __pyx_v_tag = Py_None;
46057     __pyx_v_with_tail = __pyx_k_100;
46058     switch (PyTuple_GET_SIZE(__pyx_args)) {
46059       case  2: __pyx_v_tag = PyTuple_GET_ITEM(__pyx_args, 1);
46060       case  1: __pyx_v_element = ((struct LxmlElement *)PyTuple_GET_ITEM(__pyx_args, 0));
46061       break;
46062       default: goto __pyx_L5_argtuple_error;
46063     }
46064   }
46065   goto __pyx_L4_argument_unpacking_done;
46066   __pyx_L5_argtuple_error:;
46067   __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2293; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
46068   __pyx_L3_error:;
46069   __Pyx_AddTraceback("lxml.etree.ElementTextIterator.__init__");
46070   return -1;
46071   __pyx_L4_argument_unpacking_done:;
46072   __pyx_v_events = Py_None; __Pyx_INCREF(Py_None);
46073   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46074
46075   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2294
46076  *     cdef _Element _start_element
46077  *     def __init__(self, _Element element not None, tag=None, *, with_tail=True):
46078  *         if with_tail:             # <<<<<<<<<<<<<<
46079  *             events = (u"start", u"end")
46080  *         else:
46081  */
46082   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_with_tail); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46083   if (__pyx_t_1) {
46084
46085     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2295
46086  *     def __init__(self, _Element element not None, tag=None, *, with_tail=True):
46087  *         if with_tail:
46088  *             events = (u"start", u"end")             # <<<<<<<<<<<<<<
46089  *         else:
46090  *             events = (u"start",)
46091  */
46092     __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46093     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
46094     __Pyx_INCREF(((PyObject *)__pyx_kp_373));
46095     PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_373));
46096     __Pyx_GIVEREF(((PyObject *)__pyx_kp_373));
46097     __Pyx_INCREF(((PyObject *)__pyx_kp_374));
46098     PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_kp_374));
46099     __Pyx_GIVEREF(((PyObject *)__pyx_kp_374));
46100     __Pyx_DECREF(__pyx_v_events);
46101     __pyx_v_events = ((PyObject *)__pyx_t_2);
46102     __pyx_t_2 = 0;
46103     goto __pyx_L6;
46104   }
46105   /*else*/ {
46106
46107     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2297
46108  *             events = (u"start", u"end")
46109  *         else:
46110  *             events = (u"start",)             # <<<<<<<<<<<<<<
46111  *         self._start_element = element
46112  *         self._nextEvent = iterwalk(element, events=events, tag=tag).__next__
46113  */
46114     __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46115     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
46116     __Pyx_INCREF(((PyObject *)__pyx_kp_375));
46117     PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_375));
46118     __Pyx_GIVEREF(((PyObject *)__pyx_kp_375));
46119     __Pyx_DECREF(__pyx_v_events);
46120     __pyx_v_events = ((PyObject *)__pyx_t_2);
46121     __pyx_t_2 = 0;
46122   }
46123   __pyx_L6:;
46124
46125   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2298
46126  *         else:
46127  *             events = (u"start",)
46128  *         self._start_element = element             # <<<<<<<<<<<<<<
46129  *         self._nextEvent = iterwalk(element, events=events, tag=tag).__next__
46130  * 
46131  */
46132   __Pyx_INCREF(((PyObject *)__pyx_v_element));
46133   __Pyx_GIVEREF(((PyObject *)__pyx_v_element));
46134   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_ElementTextIterator *)__pyx_v_self)->_start_element);
46135   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_ElementTextIterator *)__pyx_v_self)->_start_element));
46136   ((struct __pyx_obj_4lxml_5etree_ElementTextIterator *)__pyx_v_self)->_start_element = __pyx_v_element;
46137
46138   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2299
46139  *             events = (u"start",)
46140  *         self._start_element = element
46141  *         self._nextEvent = iterwalk(element, events=events, tag=tag).__next__             # <<<<<<<<<<<<<<
46142  * 
46143  *     def __iter__(self):
46144  */
46145   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46146   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
46147   __Pyx_INCREF(((PyObject *)__pyx_v_element));
46148   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_element));
46149   __Pyx_GIVEREF(((PyObject *)__pyx_v_element));
46150   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46151   __Pyx_GOTREF(((PyObject *)__pyx_1));
46152   if (PyDict_SetItem(__pyx_1, __pyx_kp_events, __pyx_v_events) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46153   if (PyDict_SetItem(__pyx_1, __pyx_kp_tag, __pyx_v_tag) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46154   __pyx_t_3 = PyEval_CallObjectWithKeywords(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_iterwalk)), ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46155   __Pyx_GOTREF(__pyx_t_3);
46156   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
46157   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
46158   __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_kp___next__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46159   __Pyx_GOTREF(__pyx_t_2);
46160   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
46161   __Pyx_GIVEREF(__pyx_t_2);
46162   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_ElementTextIterator *)__pyx_v_self)->_nextEvent);
46163   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_ElementTextIterator *)__pyx_v_self)->_nextEvent);
46164   ((struct __pyx_obj_4lxml_5etree_ElementTextIterator *)__pyx_v_self)->_nextEvent = __pyx_t_2;
46165   __pyx_t_2 = 0;
46166
46167   __pyx_r = 0;
46168   goto __pyx_L0;
46169   __pyx_L1_error:;
46170   __Pyx_XDECREF(__pyx_1);
46171   __Pyx_XDECREF(__pyx_t_2);
46172   __Pyx_XDECREF(__pyx_t_3);
46173   __Pyx_AddTraceback("lxml.etree.ElementTextIterator.__init__");
46174   __pyx_r = -1;
46175   __pyx_L0:;
46176   __Pyx_DECREF(__pyx_v_events);
46177   __Pyx_FinishRefcountContext();
46178   return __pyx_r;
46179 }
46180
46181 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2301
46182  *         self._nextEvent = iterwalk(element, events=events, tag=tag).__next__
46183  * 
46184  *     def __iter__(self):             # <<<<<<<<<<<<<<
46185  *         return self
46186  * 
46187  */
46188
46189 static PyObject *__pyx_pf_4lxml_5etree_19ElementTextIterator___iter__(PyObject *__pyx_v_self); /*proto*/
46190 static PyObject *__pyx_pf_4lxml_5etree_19ElementTextIterator___iter__(PyObject *__pyx_v_self) {
46191   PyObject *__pyx_r = NULL;
46192   __Pyx_SetupRefcountContext("__iter__");
46193
46194   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2302
46195  * 
46196  *     def __iter__(self):
46197  *         return self             # <<<<<<<<<<<<<<
46198  * 
46199  *     def __next__(self):
46200  */
46201   __Pyx_XDECREF(__pyx_r);
46202   __Pyx_INCREF(__pyx_v_self);
46203   __pyx_r = __pyx_v_self;
46204   goto __pyx_L0;
46205
46206   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
46207   __pyx_L0:;
46208   __Pyx_XGIVEREF(__pyx_r);
46209   __Pyx_FinishRefcountContext();
46210   return __pyx_r;
46211 }
46212
46213 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2304
46214  *         return self
46215  * 
46216  *     def __next__(self):             # <<<<<<<<<<<<<<
46217  *         cdef _Element element
46218  *         while result is None:
46219  */
46220
46221 static PyObject *__pyx_pf_4lxml_5etree_19ElementTextIterator___next__(PyObject *__pyx_v_self); /*proto*/
46222 static PyObject *__pyx_pf_4lxml_5etree_19ElementTextIterator___next__(PyObject *__pyx_v_self) {
46223   struct LxmlElement *__pyx_v_element;
46224   PyObject *__pyx_v_event;
46225   PyObject *__pyx_v_result;
46226   PyObject *__pyx_r = NULL;
46227   PyObject *__pyx_1 = 0;
46228   PyObject *__pyx_2 = 0;
46229   PyObject *__pyx_3 = 0;
46230   int __pyx_t_1;
46231   PyObject *__pyx_t_2 = NULL;
46232   __Pyx_SetupRefcountContext("__next__");
46233   __pyx_v_element = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
46234   __pyx_v_event = Py_None; __Pyx_INCREF(Py_None);
46235   __pyx_v_result = Py_None; __Pyx_INCREF(Py_None);
46236
46237   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2306
46238  *     def __next__(self):
46239  *         cdef _Element element
46240  *         while result is None:             # <<<<<<<<<<<<<<
46241  *             event, element = self._nextEvent() # raises StopIteration
46242  *             if event == u"start":
46243  */
46244   while (1) {
46245     __pyx_t_1 = (__pyx_v_result == Py_None);
46246     if (!__pyx_t_1) break;
46247
46248     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2307
46249  *         cdef _Element element
46250  *         while result is None:
46251  *             event, element = self._nextEvent() # raises StopIteration             # <<<<<<<<<<<<<<
46252  *             if event == u"start":
46253  *                 result = element.text
46254  */
46255     __pyx_t_2 = PyObject_Call(((struct __pyx_obj_4lxml_5etree_ElementTextIterator *)__pyx_v_self)->_nextEvent, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46256     __Pyx_GOTREF(__pyx_t_2);
46257     if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 2)) {
46258       PyObject* tuple = __pyx_t_2;
46259       __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
46260       __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
46261       if (!(__Pyx_TypeTest(__pyx_3, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46262       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
46263       __Pyx_DECREF(__pyx_v_event);
46264       __pyx_v_event = __pyx_2;
46265       __pyx_2 = 0;
46266       __Pyx_DECREF(((PyObject *)__pyx_v_element));
46267       __pyx_v_element = ((struct LxmlElement *)__pyx_3);
46268       __pyx_3 = 0;
46269     } else {
46270       __pyx_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46271       __Pyx_GOTREF(__pyx_1);
46272       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
46273       __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46274       __Pyx_GOTREF(__pyx_2);
46275       __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46276       __Pyx_GOTREF(__pyx_3);
46277       if (!(__Pyx_TypeTest(__pyx_3, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46278       if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46279       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
46280       __Pyx_DECREF(__pyx_v_event);
46281       __pyx_v_event = __pyx_2;
46282       __pyx_2 = 0;
46283       __Pyx_DECREF(((PyObject *)__pyx_v_element));
46284       __pyx_v_element = ((struct LxmlElement *)__pyx_3);
46285       __pyx_3 = 0;
46286     }
46287
46288     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2308
46289  *         while result is None:
46290  *             event, element = self._nextEvent() # raises StopIteration
46291  *             if event == u"start":             # <<<<<<<<<<<<<<
46292  *                 result = element.text
46293  *             elif element is not self._start_element:
46294  */
46295     __pyx_t_2 = PyObject_RichCompare(__pyx_v_event, ((PyObject *)__pyx_kp_376), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46296     __Pyx_GOTREF(__pyx_t_2);
46297     __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46298     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
46299     if (__pyx_t_1) {
46300
46301       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2309
46302  *             event, element = self._nextEvent() # raises StopIteration
46303  *             if event == u"start":
46304  *                 result = element.text             # <<<<<<<<<<<<<<
46305  *             elif element is not self._start_element:
46306  *                 result = element.tail
46307  */
46308       __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_element), __pyx_kp_text); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46309       __Pyx_GOTREF(__pyx_t_2);
46310       __Pyx_DECREF(__pyx_v_result);
46311       __pyx_v_result = __pyx_t_2;
46312       __pyx_t_2 = 0;
46313       goto __pyx_L7;
46314     }
46315
46316     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2310
46317  *             if event == u"start":
46318  *                 result = element.text
46319  *             elif element is not self._start_element:             # <<<<<<<<<<<<<<
46320  *                 result = element.tail
46321  *         return result
46322  */
46323     __pyx_t_1 = (__pyx_v_element != ((struct __pyx_obj_4lxml_5etree_ElementTextIterator *)__pyx_v_self)->_start_element);
46324     if (__pyx_t_1) {
46325
46326       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2311
46327  *                 result = element.text
46328  *             elif element is not self._start_element:
46329  *                 result = element.tail             # <<<<<<<<<<<<<<
46330  *         return result
46331  * 
46332  */
46333       __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_element), __pyx_kp_tail); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46334       __Pyx_GOTREF(__pyx_t_2);
46335       __Pyx_DECREF(__pyx_v_result);
46336       __pyx_v_result = __pyx_t_2;
46337       __pyx_t_2 = 0;
46338       goto __pyx_L7;
46339     }
46340     __pyx_L7:;
46341   }
46342
46343   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2312
46344  *             elif element is not self._start_element:
46345  *                 result = element.tail
46346  *         return result             # <<<<<<<<<<<<<<
46347  * 
46348  * cdef xmlNode* _createElement(xmlDoc* c_doc, object name_utf) except NULL:
46349  */
46350   __Pyx_XDECREF(__pyx_r);
46351   __Pyx_INCREF(__pyx_v_result);
46352   __pyx_r = __pyx_v_result;
46353   goto __pyx_L0;
46354
46355   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
46356   goto __pyx_L0;
46357   __pyx_L1_error:;
46358   __Pyx_XDECREF(__pyx_1);
46359   __Pyx_XDECREF(__pyx_2);
46360   __Pyx_XDECREF(__pyx_3);
46361   __Pyx_XDECREF(__pyx_t_2);
46362   __Pyx_AddTraceback("lxml.etree.ElementTextIterator.__next__");
46363   __pyx_r = NULL;
46364   __pyx_L0:;
46365   __Pyx_DECREF((PyObject *)__pyx_v_element);
46366   __Pyx_DECREF(__pyx_v_event);
46367   __Pyx_DECREF(__pyx_v_result);
46368   __Pyx_XGIVEREF(__pyx_r);
46369   __Pyx_FinishRefcountContext();
46370   return __pyx_r;
46371 }
46372
46373 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2314
46374  *         return result
46375  * 
46376  * cdef xmlNode* _createElement(xmlDoc* c_doc, object name_utf) except NULL:             # <<<<<<<<<<<<<<
46377  *     cdef xmlNode* c_node
46378  *     c_node = tree.xmlNewDocNode(c_doc, NULL, _cstr(name_utf), NULL)
46379  */
46380
46381 static  xmlNode *__pyx_f_4lxml_5etree__createElement(xmlDoc *__pyx_v_c_doc, PyObject *__pyx_v_name_utf) {
46382   xmlNode *__pyx_v_c_node;
46383   xmlNode *__pyx_r;
46384   __Pyx_SetupRefcountContext("_createElement");
46385
46386   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2316
46387  * cdef xmlNode* _createElement(xmlDoc* c_doc, object name_utf) except NULL:
46388  *     cdef xmlNode* c_node
46389  *     c_node = tree.xmlNewDocNode(c_doc, NULL, _cstr(name_utf), NULL)             # <<<<<<<<<<<<<<
46390  *     return c_node
46391  * 
46392  */
46393   __pyx_v_c_node = xmlNewDocNode(__pyx_v_c_doc, NULL, PyString_AS_STRING(__pyx_v_name_utf), NULL);
46394
46395   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2317
46396  *     cdef xmlNode* c_node
46397  *     c_node = tree.xmlNewDocNode(c_doc, NULL, _cstr(name_utf), NULL)
46398  *     return c_node             # <<<<<<<<<<<<<<
46399  * 
46400  * cdef xmlNode* _createComment(xmlDoc* c_doc, char* text):
46401  */
46402   __pyx_r = __pyx_v_c_node;
46403   goto __pyx_L0;
46404
46405   __pyx_r = 0;
46406   __pyx_L0:;
46407   __Pyx_FinishRefcountContext();
46408   return __pyx_r;
46409 }
46410
46411 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2319
46412  *     return c_node
46413  * 
46414  * cdef xmlNode* _createComment(xmlDoc* c_doc, char* text):             # <<<<<<<<<<<<<<
46415  *     cdef xmlNode* c_node
46416  *     c_node = tree.xmlNewDocComment(c_doc, text)
46417  */
46418
46419 static  xmlNode *__pyx_f_4lxml_5etree__createComment(xmlDoc *__pyx_v_c_doc, char *__pyx_v_text) {
46420   xmlNode *__pyx_v_c_node;
46421   xmlNode *__pyx_r;
46422   __Pyx_SetupRefcountContext("_createComment");
46423
46424   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2321
46425  * cdef xmlNode* _createComment(xmlDoc* c_doc, char* text):
46426  *     cdef xmlNode* c_node
46427  *     c_node = tree.xmlNewDocComment(c_doc, text)             # <<<<<<<<<<<<<<
46428  *     return c_node
46429  * 
46430  */
46431   __pyx_v_c_node = xmlNewDocComment(__pyx_v_c_doc, __pyx_v_text);
46432
46433   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2322
46434  *     cdef xmlNode* c_node
46435  *     c_node = tree.xmlNewDocComment(c_doc, text)
46436  *     return c_node             # <<<<<<<<<<<<<<
46437  * 
46438  * cdef xmlNode* _createPI(xmlDoc* c_doc, char* target, char* text):
46439  */
46440   __pyx_r = __pyx_v_c_node;
46441   goto __pyx_L0;
46442
46443   __pyx_r = 0;
46444   __pyx_L0:;
46445   __Pyx_FinishRefcountContext();
46446   return __pyx_r;
46447 }
46448
46449 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2324
46450  *     return c_node
46451  * 
46452  * cdef xmlNode* _createPI(xmlDoc* c_doc, char* target, char* text):             # <<<<<<<<<<<<<<
46453  *     cdef xmlNode* c_node
46454  *     c_node = tree.xmlNewDocPI(c_doc, target, text)
46455  */
46456
46457 static  xmlNode *__pyx_f_4lxml_5etree__createPI(xmlDoc *__pyx_v_c_doc, char *__pyx_v_target, char *__pyx_v_text) {
46458   xmlNode *__pyx_v_c_node;
46459   xmlNode *__pyx_r;
46460   __Pyx_SetupRefcountContext("_createPI");
46461
46462   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2326
46463  * cdef xmlNode* _createPI(xmlDoc* c_doc, char* target, char* text):
46464  *     cdef xmlNode* c_node
46465  *     c_node = tree.xmlNewDocPI(c_doc, target, text)             # <<<<<<<<<<<<<<
46466  *     return c_node
46467  * 
46468  */
46469   __pyx_v_c_node = xmlNewDocPI(__pyx_v_c_doc, __pyx_v_target, __pyx_v_text);
46470
46471   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2327
46472  *     cdef xmlNode* c_node
46473  *     c_node = tree.xmlNewDocPI(c_doc, target, text)
46474  *     return c_node             # <<<<<<<<<<<<<<
46475  * 
46476  * cdef xmlNode* _createEntity(xmlDoc* c_doc, char* name):
46477  */
46478   __pyx_r = __pyx_v_c_node;
46479   goto __pyx_L0;
46480
46481   __pyx_r = 0;
46482   __pyx_L0:;
46483   __Pyx_FinishRefcountContext();
46484   return __pyx_r;
46485 }
46486
46487 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2329
46488  *     return c_node
46489  * 
46490  * cdef xmlNode* _createEntity(xmlDoc* c_doc, char* name):             # <<<<<<<<<<<<<<
46491  *     cdef xmlNode* c_node
46492  *     c_node = tree.xmlNewReference(c_doc, name)
46493  */
46494
46495 static  xmlNode *__pyx_f_4lxml_5etree__createEntity(xmlDoc *__pyx_v_c_doc, char *__pyx_v_name) {
46496   xmlNode *__pyx_v_c_node;
46497   xmlNode *__pyx_r;
46498   __Pyx_SetupRefcountContext("_createEntity");
46499
46500   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2331
46501  * cdef xmlNode* _createEntity(xmlDoc* c_doc, char* name):
46502  *     cdef xmlNode* c_node
46503  *     c_node = tree.xmlNewReference(c_doc, name)             # <<<<<<<<<<<<<<
46504  *     return c_node
46505  * 
46506  */
46507   __pyx_v_c_node = xmlNewReference(__pyx_v_c_doc, __pyx_v_name);
46508
46509   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2332
46510  *     cdef xmlNode* c_node
46511  *     c_node = tree.xmlNewReference(c_doc, name)
46512  *     return c_node             # <<<<<<<<<<<<<<
46513  * 
46514  * # module-level API for ElementTree
46515  */
46516   __pyx_r = __pyx_v_c_node;
46517   goto __pyx_L0;
46518
46519   __pyx_r = 0;
46520   __pyx_L0:;
46521   __Pyx_FinishRefcountContext();
46522   return __pyx_r;
46523 }
46524
46525 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2336
46526  * # module-level API for ElementTree
46527  * 
46528  * def Element(_tag, attrib=None, nsmap=None, **_extra):             # <<<<<<<<<<<<<<
46529  *     u"""Element(_tag, attrib=None, nsmap=None, **_extra)
46530  * 
46531  */
46532
46533 static PyObject *__pyx_pf_4lxml_5etree_Element(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
46534 static char __pyx_doc_4lxml_5etree_Element[] = "Element(_tag, attrib=None, nsmap=None, **_extra)\n\n    Element factory.  This function returns an object implementing the\n    Element interface.\n\n    Also look at the `_Element.makeelement()` and\n    `_BaseParser.makeelement()` methods, which provide a faster way to\n    create an Element within a specific document or parser context.\n    ";
46535 static PyObject *__pyx_pf_4lxml_5etree_Element(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
46536   PyObject *__pyx_v__tag = 0;
46537   PyObject *__pyx_v_attrib = 0;
46538   PyObject *__pyx_v_nsmap = 0;
46539   PyObject *__pyx_v__extra = 0;
46540   PyObject *__pyx_r = NULL;
46541   PyObject *__pyx_t_1 = NULL;
46542   static PyObject **__pyx_pyargnames[] = {&__pyx_kp__tag,&__pyx_kp_attrib,&__pyx_kp_nsmap,0};
46543   __Pyx_SetupRefcountContext("Element");
46544   __pyx_self = __pyx_self;
46545   __pyx_v__extra = PyDict_New(); if (unlikely(!__pyx_v__extra)) return NULL;
46546   __Pyx_GOTREF(__pyx_v__extra);
46547   if (unlikely(__pyx_kwds)) {
46548     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
46549     PyObject* values[3] = {0,0,0};
46550     values[1] = Py_None;
46551     values[2] = Py_None;
46552     switch (PyTuple_GET_SIZE(__pyx_args)) {
46553       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
46554       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
46555       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
46556       case  0: break;
46557       default: goto __pyx_L5_argtuple_error;
46558     }
46559     switch (PyTuple_GET_SIZE(__pyx_args)) {
46560       case  0:
46561       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp__tag);
46562       if (likely(values[0])) kw_args--;
46563       else goto __pyx_L5_argtuple_error;
46564       case  1:
46565       if (kw_args > 0) {
46566         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_attrib);
46567         if (unlikely(value)) { values[1] = value; kw_args--; }
46568       }
46569       case  2:
46570       if (kw_args > 0) {
46571         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_nsmap);
46572         if (unlikely(value)) { values[2] = value; kw_args--; }
46573       }
46574     }
46575     if (unlikely(kw_args > 0)) {
46576       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__extra, values, PyTuple_GET_SIZE(__pyx_args), "Element") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2336; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
46577     }
46578     __pyx_v__tag = values[0];
46579     __pyx_v_attrib = values[1];
46580     __pyx_v_nsmap = values[2];
46581   } else {
46582     __pyx_v_attrib = Py_None;
46583     __pyx_v_nsmap = Py_None;
46584     switch (PyTuple_GET_SIZE(__pyx_args)) {
46585       case  3: __pyx_v_nsmap = PyTuple_GET_ITEM(__pyx_args, 2);
46586       case  2: __pyx_v_attrib = PyTuple_GET_ITEM(__pyx_args, 1);
46587       case  1: __pyx_v__tag = PyTuple_GET_ITEM(__pyx_args, 0);
46588       break;
46589       default: goto __pyx_L5_argtuple_error;
46590     }
46591   }
46592   goto __pyx_L4_argument_unpacking_done;
46593   __pyx_L5_argtuple_error:;
46594   __Pyx_RaiseArgtupleInvalid("Element", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2336; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
46595   __pyx_L3_error:;
46596   __Pyx_DECREF(__pyx_v__extra);
46597   __Pyx_AddTraceback("lxml.etree.Element");
46598   return NULL;
46599   __pyx_L4_argument_unpacking_done:;
46600
46601   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2346
46602  *     create an Element within a specific document or parser context.
46603  *     """
46604  *     return _makeElement(_tag, NULL, None, None, None, None,             # <<<<<<<<<<<<<<
46605  *                         attrib, nsmap, _extra)
46606  * 
46607  */
46608   __Pyx_XDECREF(__pyx_r);
46609
46610   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2347
46611  *     """
46612  *     return _makeElement(_tag, NULL, None, None, None, None,
46613  *                         attrib, nsmap, _extra)             # <<<<<<<<<<<<<<
46614  * 
46615  * def Comment(text=None):
46616  */
46617   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__makeElement(__pyx_v__tag, NULL, ((struct LxmlDocument *)Py_None), ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None), Py_None, Py_None, __pyx_v_attrib, __pyx_v_nsmap, __pyx_v__extra)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46618   __Pyx_GOTREF(__pyx_t_1);
46619   __pyx_r = __pyx_t_1;
46620   __pyx_t_1 = 0;
46621   goto __pyx_L0;
46622
46623   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
46624   goto __pyx_L0;
46625   __pyx_L1_error:;
46626   __Pyx_XDECREF(__pyx_t_1);
46627   __Pyx_AddTraceback("lxml.etree.Element");
46628   __pyx_r = NULL;
46629   __pyx_L0:;
46630   __Pyx_DECREF(__pyx_v__extra);
46631   __Pyx_XGIVEREF(__pyx_r);
46632   __Pyx_FinishRefcountContext();
46633   return __pyx_r;
46634 }
46635
46636 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2349
46637  *                         attrib, nsmap, _extra)
46638  * 
46639  * def Comment(text=None):             # <<<<<<<<<<<<<<
46640  *     u"""Comment(text=None)
46641  * 
46642  */
46643
46644 static PyObject *__pyx_pf_4lxml_5etree_Comment(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
46645 static char __pyx_doc_4lxml_5etree_Comment[] = "Comment(text=None)\n\n    Comment element factory. This factory function creates a special element that will\n    be serialized as an XML comment.\n    ";
46646 static PyObject *__pyx_pf_4lxml_5etree_Comment(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
46647   PyObject *__pyx_v_text = 0;
46648   struct LxmlDocument *__pyx_v_doc;
46649   xmlNode *__pyx_v_c_node;
46650   xmlDoc *__pyx_v_c_doc;
46651   PyObject *__pyx_r = NULL;
46652   int __pyx_t_1;
46653   PyObject *__pyx_t_2 = NULL;
46654   xmlDoc *__pyx_t_3;
46655   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_text,0};
46656   __Pyx_SetupRefcountContext("Comment");
46657   __pyx_self = __pyx_self;
46658   if (unlikely(__pyx_kwds)) {
46659     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
46660     PyObject* values[1] = {0};
46661     values[0] = Py_None;
46662     switch (PyTuple_GET_SIZE(__pyx_args)) {
46663       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
46664       case  0: break;
46665       default: goto __pyx_L5_argtuple_error;
46666     }
46667     switch (PyTuple_GET_SIZE(__pyx_args)) {
46668       case  0:
46669       if (kw_args > 0) {
46670         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_text);
46671         if (unlikely(value)) { values[0] = value; kw_args--; }
46672       }
46673     }
46674     if (unlikely(kw_args > 0)) {
46675       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "Comment") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2349; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
46676     }
46677     __pyx_v_text = values[0];
46678   } else {
46679     __pyx_v_text = Py_None;
46680     switch (PyTuple_GET_SIZE(__pyx_args)) {
46681       case  1: __pyx_v_text = PyTuple_GET_ITEM(__pyx_args, 0);
46682       case  0: break;
46683       default: goto __pyx_L5_argtuple_error;
46684     }
46685   }
46686   goto __pyx_L4_argument_unpacking_done;
46687   __pyx_L5_argtuple_error:;
46688   __Pyx_RaiseArgtupleInvalid("Comment", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2349; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
46689   __pyx_L3_error:;
46690   __Pyx_AddTraceback("lxml.etree.Comment");
46691   return NULL;
46692   __pyx_L4_argument_unpacking_done:;
46693   __Pyx_INCREF(__pyx_v_text);
46694   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
46695
46696   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2358
46697  *     cdef xmlNode*  c_node
46698  *     cdef xmlDoc*   c_doc
46699  *     if text is None:             # <<<<<<<<<<<<<<
46700  *         text = ''
46701  *     else:
46702  */
46703   __pyx_t_1 = (__pyx_v_text == Py_None);
46704   if (__pyx_t_1) {
46705
46706     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2359
46707  *     cdef xmlDoc*   c_doc
46708  *     if text is None:
46709  *         text = ''             # <<<<<<<<<<<<<<
46710  *     else:
46711  *         text = _utf8(text)
46712  */
46713     __Pyx_INCREF(__pyx_kp_377);
46714     __Pyx_DECREF(__pyx_v_text);
46715     __pyx_v_text = __pyx_kp_377;
46716     goto __pyx_L6;
46717   }
46718   /*else*/ {
46719
46720     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2361
46721  *         text = ''
46722  *     else:
46723  *         text = _utf8(text)             # <<<<<<<<<<<<<<
46724  *     c_doc = _newXMLDoc()
46725  *     doc = _documentFactory(c_doc, None)
46726  */
46727     __pyx_t_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_text); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46728     __Pyx_GOTREF(__pyx_t_2);
46729     __Pyx_DECREF(__pyx_v_text);
46730     __pyx_v_text = __pyx_t_2;
46731     __pyx_t_2 = 0;
46732   }
46733   __pyx_L6:;
46734
46735   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2362
46736  *     else:
46737  *         text = _utf8(text)
46738  *     c_doc = _newXMLDoc()             # <<<<<<<<<<<<<<
46739  *     doc = _documentFactory(c_doc, None)
46740  *     c_node = _createComment(c_doc, _cstr(text))
46741  */
46742   __pyx_t_3 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46743   __pyx_v_c_doc = __pyx_t_3;
46744
46745   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2363
46746  *         text = _utf8(text)
46747  *     c_doc = _newXMLDoc()
46748  *     doc = _documentFactory(c_doc, None)             # <<<<<<<<<<<<<<
46749  *     c_node = _createComment(c_doc, _cstr(text))
46750  *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)
46751  */
46752   __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46753   __Pyx_GOTREF(__pyx_t_2);
46754   __Pyx_DECREF(((PyObject *)__pyx_v_doc));
46755   __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_2);
46756   __pyx_t_2 = 0;
46757
46758   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2364
46759  *     c_doc = _newXMLDoc()
46760  *     doc = _documentFactory(c_doc, None)
46761  *     c_node = _createComment(c_doc, _cstr(text))             # <<<<<<<<<<<<<<
46762  *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)
46763  *     return _elementFactory(doc, c_node)
46764  */
46765   __pyx_v_c_node = __pyx_f_4lxml_5etree__createComment(__pyx_v_c_doc, PyString_AS_STRING(__pyx_v_text));
46766
46767   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2365
46768  *     doc = _documentFactory(c_doc, None)
46769  *     c_node = _createComment(c_doc, _cstr(text))
46770  *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)             # <<<<<<<<<<<<<<
46771  *     return _elementFactory(doc, c_node)
46772  * 
46773  */
46774   xmlAddChild(((xmlNode *)__pyx_v_c_doc), __pyx_v_c_node);
46775
46776   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2366
46777  *     c_node = _createComment(c_doc, _cstr(text))
46778  *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)
46779  *     return _elementFactory(doc, c_node)             # <<<<<<<<<<<<<<
46780  * 
46781  * def ProcessingInstruction(target, text=None):
46782  */
46783   __Pyx_XDECREF(__pyx_r);
46784   __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46785   __Pyx_GOTREF(__pyx_t_2);
46786   __pyx_r = __pyx_t_2;
46787   __pyx_t_2 = 0;
46788   goto __pyx_L0;
46789
46790   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
46791   goto __pyx_L0;
46792   __pyx_L1_error:;
46793   __Pyx_XDECREF(__pyx_t_2);
46794   __Pyx_AddTraceback("lxml.etree.Comment");
46795   __pyx_r = NULL;
46796   __pyx_L0:;
46797   __Pyx_DECREF((PyObject *)__pyx_v_doc);
46798   __Pyx_DECREF(__pyx_v_text);
46799   __Pyx_XGIVEREF(__pyx_r);
46800   __Pyx_FinishRefcountContext();
46801   return __pyx_r;
46802 }
46803
46804 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2368
46805  *     return _elementFactory(doc, c_node)
46806  * 
46807  * def ProcessingInstruction(target, text=None):             # <<<<<<<<<<<<<<
46808  *     u"""ProcessingInstruction(target, text=None)
46809  * 
46810  */
46811
46812 static PyObject *__pyx_pf_4lxml_5etree_ProcessingInstruction(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
46813 static char __pyx_doc_4lxml_5etree_ProcessingInstruction[] = "ProcessingInstruction(target, text=None)\n\n    ProcessingInstruction element factory. This factory function creates a\n    special element that will be serialized as an XML processing instruction.\n    ";
46814 static PyObject *__pyx_pf_4lxml_5etree_ProcessingInstruction(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
46815   PyObject *__pyx_v_target = 0;
46816   PyObject *__pyx_v_text = 0;
46817   struct LxmlDocument *__pyx_v_doc;
46818   xmlNode *__pyx_v_c_node;
46819   xmlDoc *__pyx_v_c_doc;
46820   PyObject *__pyx_r = NULL;
46821   PyObject *__pyx_t_1 = NULL;
46822   int __pyx_t_2;
46823   xmlDoc *__pyx_t_3;
46824   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_target,&__pyx_kp_text,0};
46825   __Pyx_SetupRefcountContext("ProcessingInstruction");
46826   __pyx_self = __pyx_self;
46827   if (unlikely(__pyx_kwds)) {
46828     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
46829     PyObject* values[2] = {0,0};
46830     values[1] = Py_None;
46831     switch (PyTuple_GET_SIZE(__pyx_args)) {
46832       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
46833       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
46834       case  0: break;
46835       default: goto __pyx_L5_argtuple_error;
46836     }
46837     switch (PyTuple_GET_SIZE(__pyx_args)) {
46838       case  0:
46839       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_target);
46840       if (likely(values[0])) kw_args--;
46841       else goto __pyx_L5_argtuple_error;
46842       case  1:
46843       if (kw_args > 0) {
46844         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_text);
46845         if (unlikely(value)) { values[1] = value; kw_args--; }
46846       }
46847     }
46848     if (unlikely(kw_args > 0)) {
46849       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "ProcessingInstruction") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
46850     }
46851     __pyx_v_target = values[0];
46852     __pyx_v_text = values[1];
46853   } else {
46854     __pyx_v_text = Py_None;
46855     switch (PyTuple_GET_SIZE(__pyx_args)) {
46856       case  2: __pyx_v_text = PyTuple_GET_ITEM(__pyx_args, 1);
46857       case  1: __pyx_v_target = PyTuple_GET_ITEM(__pyx_args, 0);
46858       break;
46859       default: goto __pyx_L5_argtuple_error;
46860     }
46861   }
46862   goto __pyx_L4_argument_unpacking_done;
46863   __pyx_L5_argtuple_error:;
46864   __Pyx_RaiseArgtupleInvalid("ProcessingInstruction", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
46865   __pyx_L3_error:;
46866   __Pyx_AddTraceback("lxml.etree.ProcessingInstruction");
46867   return NULL;
46868   __pyx_L4_argument_unpacking_done:;
46869   __Pyx_INCREF(__pyx_v_target);
46870   __Pyx_INCREF(__pyx_v_text);
46871   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
46872
46873   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2377
46874  *     cdef xmlNode*  c_node
46875  *     cdef xmlDoc*   c_doc
46876  *     target = _utf8(target)             # <<<<<<<<<<<<<<
46877  *     if text is None:
46878  *         text = ''
46879  */
46880   __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_target); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46881   __Pyx_GOTREF(__pyx_t_1);
46882   __Pyx_DECREF(__pyx_v_target);
46883   __pyx_v_target = __pyx_t_1;
46884   __pyx_t_1 = 0;
46885
46886   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2378
46887  *     cdef xmlDoc*   c_doc
46888  *     target = _utf8(target)
46889  *     if text is None:             # <<<<<<<<<<<<<<
46890  *         text = ''
46891  *     else:
46892  */
46893   __pyx_t_2 = (__pyx_v_text == Py_None);
46894   if (__pyx_t_2) {
46895
46896     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2379
46897  *     target = _utf8(target)
46898  *     if text is None:
46899  *         text = ''             # <<<<<<<<<<<<<<
46900  *     else:
46901  *         text = _utf8(text)
46902  */
46903     __Pyx_INCREF(__pyx_kp_378);
46904     __Pyx_DECREF(__pyx_v_text);
46905     __pyx_v_text = __pyx_kp_378;
46906     goto __pyx_L6;
46907   }
46908   /*else*/ {
46909
46910     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2381
46911  *         text = ''
46912  *     else:
46913  *         text = _utf8(text)             # <<<<<<<<<<<<<<
46914  *     c_doc = _newXMLDoc()
46915  *     doc = _documentFactory(c_doc, None)
46916  */
46917     __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46918     __Pyx_GOTREF(__pyx_t_1);
46919     __Pyx_DECREF(__pyx_v_text);
46920     __pyx_v_text = __pyx_t_1;
46921     __pyx_t_1 = 0;
46922   }
46923   __pyx_L6:;
46924
46925   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2382
46926  *     else:
46927  *         text = _utf8(text)
46928  *     c_doc = _newXMLDoc()             # <<<<<<<<<<<<<<
46929  *     doc = _documentFactory(c_doc, None)
46930  *     c_node = _createPI(c_doc, _cstr(target), _cstr(text))
46931  */
46932   __pyx_t_3 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46933   __pyx_v_c_doc = __pyx_t_3;
46934
46935   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2383
46936  *         text = _utf8(text)
46937  *     c_doc = _newXMLDoc()
46938  *     doc = _documentFactory(c_doc, None)             # <<<<<<<<<<<<<<
46939  *     c_node = _createPI(c_doc, _cstr(target), _cstr(text))
46940  *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)
46941  */
46942   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46943   __Pyx_GOTREF(__pyx_t_1);
46944   __Pyx_DECREF(((PyObject *)__pyx_v_doc));
46945   __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_1);
46946   __pyx_t_1 = 0;
46947
46948   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2384
46949  *     c_doc = _newXMLDoc()
46950  *     doc = _documentFactory(c_doc, None)
46951  *     c_node = _createPI(c_doc, _cstr(target), _cstr(text))             # <<<<<<<<<<<<<<
46952  *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)
46953  *     return _elementFactory(doc, c_node)
46954  */
46955   __pyx_v_c_node = __pyx_f_4lxml_5etree__createPI(__pyx_v_c_doc, PyString_AS_STRING(__pyx_v_target), PyString_AS_STRING(__pyx_v_text));
46956
46957   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2385
46958  *     doc = _documentFactory(c_doc, None)
46959  *     c_node = _createPI(c_doc, _cstr(target), _cstr(text))
46960  *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)             # <<<<<<<<<<<<<<
46961  *     return _elementFactory(doc, c_node)
46962  * 
46963  */
46964   xmlAddChild(((xmlNode *)__pyx_v_c_doc), __pyx_v_c_node);
46965
46966   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2386
46967  *     c_node = _createPI(c_doc, _cstr(target), _cstr(text))
46968  *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)
46969  *     return _elementFactory(doc, c_node)             # <<<<<<<<<<<<<<
46970  * 
46971  * PI = ProcessingInstruction
46972  */
46973   __Pyx_XDECREF(__pyx_r);
46974   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
46975   __Pyx_GOTREF(__pyx_t_1);
46976   __pyx_r = __pyx_t_1;
46977   __pyx_t_1 = 0;
46978   goto __pyx_L0;
46979
46980   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
46981   goto __pyx_L0;
46982   __pyx_L1_error:;
46983   __Pyx_XDECREF(__pyx_t_1);
46984   __Pyx_AddTraceback("lxml.etree.ProcessingInstruction");
46985   __pyx_r = NULL;
46986   __pyx_L0:;
46987   __Pyx_DECREF((PyObject *)__pyx_v_doc);
46988   __Pyx_DECREF(__pyx_v_target);
46989   __Pyx_DECREF(__pyx_v_text);
46990   __Pyx_XGIVEREF(__pyx_r);
46991   __Pyx_FinishRefcountContext();
46992   return __pyx_r;
46993 }
46994
46995 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2401
46996  *     """
46997  *     cdef object _utf8_data
46998  *     def __init__(self, data):             # <<<<<<<<<<<<<<
46999  *         self._utf8_data = _utf8(data)
47000  * 
47001  */
47002
47003 static int __pyx_pf_4lxml_5etree_5CDATA___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
47004 static int __pyx_pf_4lxml_5etree_5CDATA___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
47005   PyObject *__pyx_v_data = 0;
47006   int __pyx_r;
47007   PyObject *__pyx_t_1 = NULL;
47008   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_data,0};
47009   __Pyx_SetupRefcountContext("__init__");
47010   if (unlikely(__pyx_kwds)) {
47011     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
47012     PyObject* values[1] = {0};
47013     switch (PyTuple_GET_SIZE(__pyx_args)) {
47014       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
47015       case  0: break;
47016       default: goto __pyx_L5_argtuple_error;
47017     }
47018     switch (PyTuple_GET_SIZE(__pyx_args)) {
47019       case  0:
47020       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_data);
47021       if (likely(values[0])) kw_args--;
47022       else goto __pyx_L5_argtuple_error;
47023     }
47024     if (unlikely(kw_args > 0)) {
47025       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2401; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
47026     }
47027     __pyx_v_data = values[0];
47028   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
47029     goto __pyx_L5_argtuple_error;
47030   } else {
47031     __pyx_v_data = PyTuple_GET_ITEM(__pyx_args, 0);
47032   }
47033   goto __pyx_L4_argument_unpacking_done;
47034   __pyx_L5_argtuple_error:;
47035   __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2401; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
47036   __pyx_L3_error:;
47037   __Pyx_AddTraceback("lxml.etree.CDATA.__init__");
47038   return -1;
47039   __pyx_L4_argument_unpacking_done:;
47040
47041   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2402
47042  *     cdef object _utf8_data
47043  *     def __init__(self, data):
47044  *         self._utf8_data = _utf8(data)             # <<<<<<<<<<<<<<
47045  * 
47046  * def Entity(name):
47047  */
47048   __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
47049   __Pyx_GOTREF(__pyx_t_1);
47050   __Pyx_GIVEREF(__pyx_t_1);
47051   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_CDATA *)__pyx_v_self)->_utf8_data);
47052   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_CDATA *)__pyx_v_self)->_utf8_data);
47053   ((struct __pyx_obj_4lxml_5etree_CDATA *)__pyx_v_self)->_utf8_data = __pyx_t_1;
47054   __pyx_t_1 = 0;
47055
47056   __pyx_r = 0;
47057   goto __pyx_L0;
47058   __pyx_L1_error:;
47059   __Pyx_XDECREF(__pyx_t_1);
47060   __Pyx_AddTraceback("lxml.etree.CDATA.__init__");
47061   __pyx_r = -1;
47062   __pyx_L0:;
47063   __Pyx_FinishRefcountContext();
47064   return __pyx_r;
47065 }
47066
47067 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2404
47068  *         self._utf8_data = _utf8(data)
47069  * 
47070  * def Entity(name):             # <<<<<<<<<<<<<<
47071  *     u"""Entity(name)
47072  * 
47073  */
47074
47075 static PyObject *__pyx_pf_4lxml_5etree_Entity(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/
47076 static char __pyx_doc_4lxml_5etree_Entity[] = "Entity(name)\n\n    Entity factory.  This factory function creates a special element\n    that will be serialized as an XML entity reference or character\n    reference.  Note, however, that entities will not be automatically\n    declared in the document.  A document that uses entity references\n    requires a DTD to define the entities.\n    ";
47077 static PyObject *__pyx_pf_4lxml_5etree_Entity(PyObject *__pyx_self, PyObject *__pyx_v_name) {
47078   struct LxmlDocument *__pyx_v_doc;
47079   xmlNode *__pyx_v_c_node;
47080   xmlDoc *__pyx_v_c_doc;
47081   char *__pyx_v_c_name;
47082   PyObject *__pyx_v_name_utf;
47083   PyObject *__pyx_r = NULL;
47084   PyObject *__pyx_t_1 = NULL;
47085   int __pyx_t_2;
47086   xmlDoc *__pyx_t_3;
47087   __Pyx_SetupRefcountContext("Entity");
47088   __pyx_self = __pyx_self;
47089   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
47090   __pyx_v_name_utf = Py_None; __Pyx_INCREF(Py_None);
47091
47092   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2417
47093  *     cdef xmlDoc*   c_doc
47094  *     cdef char* c_name
47095  *     name_utf = _utf8(name)             # <<<<<<<<<<<<<<
47096  *     c_name = _cstr(name_utf)
47097  *     if c_name[0] == c'#':
47098  */
47099   __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
47100   __Pyx_GOTREF(__pyx_t_1);
47101   __Pyx_DECREF(__pyx_v_name_utf);
47102   __pyx_v_name_utf = __pyx_t_1;
47103   __pyx_t_1 = 0;
47104
47105   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2418
47106  *     cdef char* c_name
47107  *     name_utf = _utf8(name)
47108  *     c_name = _cstr(name_utf)             # <<<<<<<<<<<<<<
47109  *     if c_name[0] == c'#':
47110  *         if not _characterReferenceIsValid(c_name + 1):
47111  */
47112   __pyx_v_c_name = PyString_AS_STRING(__pyx_v_name_utf);
47113
47114   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2419
47115  *     name_utf = _utf8(name)
47116  *     c_name = _cstr(name_utf)
47117  *     if c_name[0] == c'#':             # <<<<<<<<<<<<<<
47118  *         if not _characterReferenceIsValid(c_name + 1):
47119  *             raise ValueError, u"Invalid character reference: '%s'" % name
47120  */
47121   __pyx_t_2 = ((__pyx_v_c_name[0]) == '#');
47122   if (__pyx_t_2) {
47123
47124     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2420
47125  *     c_name = _cstr(name_utf)
47126  *     if c_name[0] == c'#':
47127  *         if not _characterReferenceIsValid(c_name + 1):             # <<<<<<<<<<<<<<
47128  *             raise ValueError, u"Invalid character reference: '%s'" % name
47129  *     elif not _xmlNameIsValid(c_name):
47130  */
47131     __pyx_t_2 = (!__pyx_f_4lxml_5etree__characterReferenceIsValid((__pyx_v_c_name + 1)));
47132     if (__pyx_t_2) {
47133
47134       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2421
47135  *     if c_name[0] == c'#':
47136  *         if not _characterReferenceIsValid(c_name + 1):
47137  *             raise ValueError, u"Invalid character reference: '%s'" % name             # <<<<<<<<<<<<<<
47138  *     elif not _xmlNameIsValid(c_name):
47139  *         raise ValueError, u"Invalid entity reference: '%s'" % name
47140  */
47141       __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_379), __pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
47142       __Pyx_GOTREF(__pyx_t_1);
47143       __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_1, 0);
47144       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
47145       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
47146       goto __pyx_L6;
47147     }
47148     __pyx_L6:;
47149     goto __pyx_L5;
47150   }
47151
47152   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2422
47153  *         if not _characterReferenceIsValid(c_name + 1):
47154  *             raise ValueError, u"Invalid character reference: '%s'" % name
47155  *     elif not _xmlNameIsValid(c_name):             # <<<<<<<<<<<<<<
47156  *         raise ValueError, u"Invalid entity reference: '%s'" % name
47157  *     c_doc = _newXMLDoc()
47158  */
47159   __pyx_t_2 = (!__pyx_f_4lxml_5etree__xmlNameIsValid(__pyx_v_c_name));
47160   if (__pyx_t_2) {
47161
47162     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2423
47163  *             raise ValueError, u"Invalid character reference: '%s'" % name
47164  *     elif not _xmlNameIsValid(c_name):
47165  *         raise ValueError, u"Invalid entity reference: '%s'" % name             # <<<<<<<<<<<<<<
47166  *     c_doc = _newXMLDoc()
47167  *     doc = _documentFactory(c_doc, None)
47168  */
47169     __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_380), __pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
47170     __Pyx_GOTREF(__pyx_t_1);
47171     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_1, 0);
47172     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
47173     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
47174     goto __pyx_L5;
47175   }
47176   __pyx_L5:;
47177
47178   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2424
47179  *     elif not _xmlNameIsValid(c_name):
47180  *         raise ValueError, u"Invalid entity reference: '%s'" % name
47181  *     c_doc = _newXMLDoc()             # <<<<<<<<<<<<<<
47182  *     doc = _documentFactory(c_doc, None)
47183  *     c_node = _createEntity(c_doc, c_name)
47184  */
47185   __pyx_t_3 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
47186   __pyx_v_c_doc = __pyx_t_3;
47187
47188   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2425
47189  *         raise ValueError, u"Invalid entity reference: '%s'" % name
47190  *     c_doc = _newXMLDoc()
47191  *     doc = _documentFactory(c_doc, None)             # <<<<<<<<<<<<<<
47192  *     c_node = _createEntity(c_doc, c_name)
47193  *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)
47194  */
47195   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
47196   __Pyx_GOTREF(__pyx_t_1);
47197   __Pyx_DECREF(((PyObject *)__pyx_v_doc));
47198   __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_1);
47199   __pyx_t_1 = 0;
47200
47201   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2426
47202  *     c_doc = _newXMLDoc()
47203  *     doc = _documentFactory(c_doc, None)
47204  *     c_node = _createEntity(c_doc, c_name)             # <<<<<<<<<<<<<<
47205  *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)
47206  *     return _elementFactory(doc, c_node)
47207  */
47208   __pyx_v_c_node = __pyx_f_4lxml_5etree__createEntity(__pyx_v_c_doc, __pyx_v_c_name);
47209
47210   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2427
47211  *     doc = _documentFactory(c_doc, None)
47212  *     c_node = _createEntity(c_doc, c_name)
47213  *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)             # <<<<<<<<<<<<<<
47214  *     return _elementFactory(doc, c_node)
47215  * 
47216  */
47217   xmlAddChild(((xmlNode *)__pyx_v_c_doc), __pyx_v_c_node);
47218
47219   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2428
47220  *     c_node = _createEntity(c_doc, c_name)
47221  *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)
47222  *     return _elementFactory(doc, c_node)             # <<<<<<<<<<<<<<
47223  * 
47224  * def SubElement(_Element _parent not None, _tag,
47225  */
47226   __Pyx_XDECREF(__pyx_r);
47227   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
47228   __Pyx_GOTREF(__pyx_t_1);
47229   __pyx_r = __pyx_t_1;
47230   __pyx_t_1 = 0;
47231   goto __pyx_L0;
47232
47233   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
47234   goto __pyx_L0;
47235   __pyx_L1_error:;
47236   __Pyx_XDECREF(__pyx_t_1);
47237   __Pyx_AddTraceback("lxml.etree.Entity");
47238   __pyx_r = NULL;
47239   __pyx_L0:;
47240   __Pyx_DECREF((PyObject *)__pyx_v_doc);
47241   __Pyx_DECREF(__pyx_v_name_utf);
47242   __Pyx_XGIVEREF(__pyx_r);
47243   __Pyx_FinishRefcountContext();
47244   return __pyx_r;
47245 }
47246
47247 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2430
47248  *     return _elementFactory(doc, c_node)
47249  * 
47250  * def SubElement(_Element _parent not None, _tag,             # <<<<<<<<<<<<<<
47251  *                attrib=None, nsmap=None, **_extra):
47252  *     u"""SubElement(_parent, _tag, attrib=None, nsmap=None, **_extra)
47253  */
47254
47255 static PyObject *__pyx_pf_4lxml_5etree_SubElement(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
47256 static char __pyx_doc_4lxml_5etree_SubElement[] = "SubElement(_parent, _tag, attrib=None, nsmap=None, **_extra)\n\n    Subelement factory.  This function creates an element instance, and\n    appends it to an existing element.\n    ";
47257 static PyObject *__pyx_pf_4lxml_5etree_SubElement(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
47258   struct LxmlElement *__pyx_v__parent = 0;
47259   PyObject *__pyx_v__tag = 0;
47260   PyObject *__pyx_v_attrib = 0;
47261   PyObject *__pyx_v_nsmap = 0;
47262   PyObject *__pyx_v__extra = 0;
47263   PyObject *__pyx_r = NULL;
47264   PyObject *__pyx_t_1 = NULL;
47265   static PyObject **__pyx_pyargnames[] = {&__pyx_kp__parent,&__pyx_kp__tag,&__pyx_kp_attrib,&__pyx_kp_nsmap,0};
47266   __Pyx_SetupRefcountContext("SubElement");
47267   __pyx_self = __pyx_self;
47268   __pyx_v__extra = PyDict_New(); if (unlikely(!__pyx_v__extra)) return NULL;
47269   __Pyx_GOTREF(__pyx_v__extra);
47270   if (unlikely(__pyx_kwds)) {
47271     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
47272     PyObject* values[4] = {0,0,0,0};
47273     values[2] = Py_None;
47274     values[3] = Py_None;
47275     switch (PyTuple_GET_SIZE(__pyx_args)) {
47276       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
47277       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
47278       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
47279       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
47280       case  0: break;
47281       default: goto __pyx_L5_argtuple_error;
47282     }
47283     switch (PyTuple_GET_SIZE(__pyx_args)) {
47284       case  0:
47285       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp__parent);
47286       if (likely(values[0])) kw_args--;
47287       else goto __pyx_L5_argtuple_error;
47288       case  1:
47289       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp__tag);
47290       if (likely(values[1])) kw_args--;
47291       else {
47292         __Pyx_RaiseArgtupleInvalid("SubElement", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2430; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
47293       }
47294       case  2:
47295       if (kw_args > 0) {
47296         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_attrib);
47297         if (unlikely(value)) { values[2] = value; kw_args--; }
47298       }
47299       case  3:
47300       if (kw_args > 0) {
47301         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_nsmap);
47302         if (unlikely(value)) { values[3] = value; kw_args--; }
47303       }
47304     }
47305     if (unlikely(kw_args > 0)) {
47306       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__extra, values, PyTuple_GET_SIZE(__pyx_args), "SubElement") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2430; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
47307     }
47308     __pyx_v__parent = ((struct LxmlElement *)values[0]);
47309     __pyx_v__tag = values[1];
47310     __pyx_v_attrib = values[2];
47311     __pyx_v_nsmap = values[3];
47312   } else {
47313     __pyx_v_attrib = Py_None;
47314     __pyx_v_nsmap = Py_None;
47315     switch (PyTuple_GET_SIZE(__pyx_args)) {
47316       case  4:
47317       __pyx_v_nsmap = PyTuple_GET_ITEM(__pyx_args, 3);
47318       case  3:
47319       __pyx_v_attrib = PyTuple_GET_ITEM(__pyx_args, 2);
47320       case  2:
47321       __pyx_v__tag = PyTuple_GET_ITEM(__pyx_args, 1);
47322       __pyx_v__parent = ((struct LxmlElement *)PyTuple_GET_ITEM(__pyx_args, 0));
47323       break;
47324       default: goto __pyx_L5_argtuple_error;
47325     }
47326   }
47327   goto __pyx_L4_argument_unpacking_done;
47328   __pyx_L5_argtuple_error:;
47329   __Pyx_RaiseArgtupleInvalid("SubElement", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2430; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
47330   __pyx_L3_error:;
47331   __Pyx_DECREF(__pyx_v__extra);
47332   __Pyx_AddTraceback("lxml.etree.SubElement");
47333   return NULL;
47334   __pyx_L4_argument_unpacking_done:;
47335   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v__parent), __pyx_ptype_4lxml_5etree__Element, 0, "_parent", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
47336
47337   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2437
47338  *     appends it to an existing element.
47339  *     """
47340  *     return _makeSubElement(_parent, _tag, None, None, attrib, nsmap, _extra)             # <<<<<<<<<<<<<<
47341  * 
47342  * def ElementTree(_Element element=None, *, file=None, _BaseParser parser=None):
47343  */
47344   __Pyx_XDECREF(__pyx_r);
47345   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__makeSubElement(__pyx_v__parent, __pyx_v__tag, Py_None, Py_None, __pyx_v_attrib, __pyx_v_nsmap, __pyx_v__extra)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
47346   __Pyx_GOTREF(__pyx_t_1);
47347   __pyx_r = __pyx_t_1;
47348   __pyx_t_1 = 0;
47349   goto __pyx_L0;
47350
47351   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
47352   goto __pyx_L0;
47353   __pyx_L1_error:;
47354   __Pyx_XDECREF(__pyx_t_1);
47355   __Pyx_AddTraceback("lxml.etree.SubElement");
47356   __pyx_r = NULL;
47357   __pyx_L0:;
47358   __Pyx_DECREF(__pyx_v__extra);
47359   __Pyx_XGIVEREF(__pyx_r);
47360   __Pyx_FinishRefcountContext();
47361   return __pyx_r;
47362 }
47363
47364 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2439
47365  *     return _makeSubElement(_parent, _tag, None, None, attrib, nsmap, _extra)
47366  * 
47367  * def ElementTree(_Element element=None, *, file=None, _BaseParser parser=None):             # <<<<<<<<<<<<<<
47368  *     u"""ElementTree(element=None, file=None, parser=None)
47369  * 
47370  */
47371
47372 static PyObject *__pyx_pf_4lxml_5etree_ElementTree(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
47373 static char __pyx_doc_4lxml_5etree_ElementTree[] = "ElementTree(element=None, file=None, parser=None)\n\n    ElementTree wrapper class.\n    ";
47374 static PyObject *__pyx_pf_4lxml_5etree_ElementTree(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
47375   struct LxmlElement *__pyx_v_element = 0;
47376   PyObject *__pyx_v_file = 0;
47377   struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser = 0;
47378   xmlDoc *__pyx_v_c_doc;
47379   struct LxmlDocument *__pyx_v_doc;
47380   PyObject *__pyx_v_result_container;
47381   PyObject *__pyx_r = NULL;
47382   PyObject *__pyx_1 = 0;
47383   int __pyx_2;
47384   PyObject *__pyx_3 = 0;
47385   PyObject *__pyx_4 = 0;
47386   int __pyx_t_1;
47387   PyObject *__pyx_t_2 = NULL;
47388   xmlDoc *__pyx_t_3;
47389   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_element,&__pyx_kp_file,&__pyx_kp_parser,0};
47390   __Pyx_SetupRefcountContext("ElementTree");
47391   __pyx_self = __pyx_self;
47392   if (unlikely(__pyx_kwds)) {
47393     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
47394     PyObject* values[3] = {0,0,0};
47395     values[0] = (PyObject*)((struct LxmlElement *)Py_None);
47396     values[1] = Py_None;
47397     values[2] = (PyObject*)((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None);
47398     switch (PyTuple_GET_SIZE(__pyx_args)) {
47399       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
47400       case  0: break;
47401       default: goto __pyx_L5_argtuple_error;
47402     }
47403     switch (PyTuple_GET_SIZE(__pyx_args)) {
47404       case  0:
47405       if (kw_args > 0) {
47406         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_element);
47407         if (unlikely(value)) { values[0] = value; kw_args--; }
47408       }
47409     }
47410     while (kw_args > 0) {
47411       PyObject* value;
47412       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_file);
47413       if (value) { values[1] = value; if (!(--kw_args)) break; }
47414       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_parser);
47415       if (value) { values[2] = value; if (!(--kw_args)) break; }
47416       break;
47417     }
47418     if (unlikely(kw_args > 0)) {
47419       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "ElementTree") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2439; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
47420     }
47421     __pyx_v_element = ((struct LxmlElement *)values[0]);
47422     __pyx_v_file = values[1];
47423     __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)values[2]);
47424   } else {
47425     __pyx_v_element = ((struct LxmlElement *)Py_None);
47426     __pyx_v_file = Py_None;
47427     __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None);
47428     switch (PyTuple_GET_SIZE(__pyx_args)) {
47429       case  1: __pyx_v_element = ((struct LxmlElement *)PyTuple_GET_ITEM(__pyx_args, 0));
47430       case  0: break;
47431       default: goto __pyx_L5_argtuple_error;
47432     }
47433   }
47434   goto __pyx_L4_argument_unpacking_done;
47435   __pyx_L5_argtuple_error:;
47436   __Pyx_RaiseArgtupleInvalid("ElementTree", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2439; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
47437   __pyx_L3_error:;
47438   __Pyx_AddTraceback("lxml.etree.ElementTree");
47439   return NULL;
47440   __pyx_L4_argument_unpacking_done:;
47441   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
47442   __pyx_v_result_container = Py_None; __Pyx_INCREF(Py_None);
47443   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 1, "element", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
47444   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
47445
47446   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2451
47447  *     cdef _Document doc
47448  * 
47449  *     if element is not None:             # <<<<<<<<<<<<<<
47450  *         doc  = element._doc
47451  *     elif file is not None:
47452  */
47453   __pyx_t_1 = (((PyObject *)__pyx_v_element) != Py_None);
47454   if (__pyx_t_1) {
47455
47456     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2452
47457  * 
47458  *     if element is not None:
47459  *         doc  = element._doc             # <<<<<<<<<<<<<<
47460  *     elif file is not None:
47461  *         try:
47462  */
47463     __Pyx_INCREF(((PyObject *)__pyx_v_element->_doc));
47464     __Pyx_DECREF(((PyObject *)__pyx_v_doc));
47465     __pyx_v_doc = __pyx_v_element->_doc;
47466     goto __pyx_L6;
47467   }
47468
47469   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2453
47470  *     if element is not None:
47471  *         doc  = element._doc
47472  *     elif file is not None:             # <<<<<<<<<<<<<<
47473  *         try:
47474  *             doc = _parseDocument(file, parser, None)
47475  */
47476   __pyx_t_1 = (__pyx_v_file != Py_None);
47477   if (__pyx_t_1) {
47478
47479     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2454
47480  *         doc  = element._doc
47481  *     elif file is not None:
47482  *         try:             # <<<<<<<<<<<<<<
47483  *             doc = _parseDocument(file, parser, None)
47484  *         except _TargetParserResult, result_container:
47485  */
47486     {
47487       PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
47488       __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
47489       __Pyx_XGOTREF(__pyx_save_exc_type);
47490       __Pyx_XGOTREF(__pyx_save_exc_value);
47491       __Pyx_XGOTREF(__pyx_save_exc_tb);
47492       /*try:*/ {
47493
47494         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2455
47495  *     elif file is not None:
47496  *         try:
47497  *             doc = _parseDocument(file, parser, None)             # <<<<<<<<<<<<<<
47498  *         except _TargetParserResult, result_container:
47499  *             return result_container.result
47500  */
47501         __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__parseDocument(__pyx_v_file, __pyx_v_parser, Py_None)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2455; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
47502         __Pyx_GOTREF(__pyx_t_2);
47503         __Pyx_DECREF(((PyObject *)__pyx_v_doc));
47504         __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_2);
47505         __pyx_t_2 = 0;
47506       }
47507       __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
47508       __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
47509       __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
47510       goto __pyx_L14_try_end;
47511       __pyx_L7_error:;
47512       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
47513
47514       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2456
47515  *         try:
47516  *             doc = _parseDocument(file, parser, None)
47517  *         except _TargetParserResult, result_container:             # <<<<<<<<<<<<<<
47518  *             return result_container.result
47519  *     else:
47520  */
47521       __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__TargetParserResult); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2456; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
47522       __Pyx_GOTREF(__pyx_1);
47523       __pyx_2 = PyErr_ExceptionMatches(__pyx_1);
47524       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
47525       if (__pyx_2) {
47526         __Pyx_AddTraceback("lxml.etree.ElementTree");
47527         if (__Pyx_GetException(&__pyx_1, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2456; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
47528         __Pyx_GOTREF(__pyx_1);
47529         __Pyx_GOTREF(__pyx_3);
47530         __Pyx_GOTREF(__pyx_4);
47531         __Pyx_INCREF(__pyx_3);
47532         __Pyx_DECREF(__pyx_v_result_container);
47533         __pyx_v_result_container = __pyx_3;
47534
47535         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2457
47536  *             doc = _parseDocument(file, parser, None)
47537  *         except _TargetParserResult, result_container:
47538  *             return result_container.result             # <<<<<<<<<<<<<<
47539  *     else:
47540  *         c_doc = _newXMLDoc()
47541  */
47542         __Pyx_XDECREF(__pyx_r);
47543         __pyx_t_2 = PyObject_GetAttr(__pyx_v_result_container, __pyx_kp_result); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2457; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
47544         __Pyx_GOTREF(__pyx_t_2);
47545         __pyx_r = __pyx_t_2;
47546         __pyx_t_2 = 0;
47547         __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
47548         __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
47549         __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
47550         goto __pyx_L10_except_return;
47551         __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
47552         __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
47553         __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
47554         goto __pyx_L8_exception_handled;
47555       }
47556       __pyx_L9_except_error:;
47557       __Pyx_XDECREF(__pyx_save_exc_type);
47558       __Pyx_XDECREF(__pyx_save_exc_value);
47559       __Pyx_XDECREF(__pyx_save_exc_tb);
47560       goto __pyx_L1_error;
47561       __pyx_L10_except_return:;
47562       __Pyx_XGIVEREF(__pyx_save_exc_type);
47563       __Pyx_XGIVEREF(__pyx_save_exc_value);
47564       __Pyx_XGIVEREF(__pyx_save_exc_tb);
47565       __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
47566       goto __pyx_L0;
47567       __pyx_L8_exception_handled:;
47568       __Pyx_XGIVEREF(__pyx_save_exc_type);
47569       __Pyx_XGIVEREF(__pyx_save_exc_value);
47570       __Pyx_XGIVEREF(__pyx_save_exc_tb);
47571       __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
47572       __pyx_L14_try_end:;
47573     }
47574     goto __pyx_L6;
47575   }
47576   /*else*/ {
47577
47578     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2459
47579  *             return result_container.result
47580  *     else:
47581  *         c_doc = _newXMLDoc()             # <<<<<<<<<<<<<<
47582  *         doc = _documentFactory(c_doc, parser)
47583  * 
47584  */
47585     __pyx_t_3 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
47586     __pyx_v_c_doc = __pyx_t_3;
47587
47588     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2460
47589  *     else:
47590  *         c_doc = _newXMLDoc()
47591  *         doc = _documentFactory(c_doc, parser)             # <<<<<<<<<<<<<<
47592  * 
47593  *     return _elementTreeFactory(doc, element)
47594  */
47595     __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, __pyx_v_parser)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
47596     __Pyx_GOTREF(__pyx_t_2);
47597     __Pyx_DECREF(((PyObject *)__pyx_v_doc));
47598     __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_2);
47599     __pyx_t_2 = 0;
47600   }
47601   __pyx_L6:;
47602
47603   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2462
47604  *         doc = _documentFactory(c_doc, parser)
47605  * 
47606  *     return _elementTreeFactory(doc, element)             # <<<<<<<<<<<<<<
47607  * 
47608  * def HTML(text, _BaseParser parser=None, *, base_url=None):
47609  */
47610   __Pyx_XDECREF(__pyx_r);
47611   __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(__pyx_v_doc, __pyx_v_element)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
47612   __Pyx_GOTREF(__pyx_t_2);
47613   __pyx_r = __pyx_t_2;
47614   __pyx_t_2 = 0;
47615   goto __pyx_L0;
47616
47617   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
47618   goto __pyx_L0;
47619   __pyx_L1_error:;
47620   __Pyx_XDECREF(__pyx_1);
47621   __Pyx_XDECREF(__pyx_3);
47622   __Pyx_XDECREF(__pyx_4);
47623   __Pyx_XDECREF(__pyx_t_2);
47624   __Pyx_AddTraceback("lxml.etree.ElementTree");
47625   __pyx_r = NULL;
47626   __pyx_L0:;
47627   __Pyx_DECREF((PyObject *)__pyx_v_doc);
47628   __Pyx_DECREF(__pyx_v_result_container);
47629   __Pyx_XGIVEREF(__pyx_r);
47630   __Pyx_FinishRefcountContext();
47631   return __pyx_r;
47632 }
47633
47634 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2464
47635  *     return _elementTreeFactory(doc, element)
47636  * 
47637  * def HTML(text, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<<
47638  *     u"""HTML(text, parser=None, base_url=None)
47639  * 
47640  */
47641
47642 static PyObject *__pyx_pf_4lxml_5etree_HTML(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
47643 static char __pyx_doc_4lxml_5etree_HTML[] = "HTML(text, parser=None, base_url=None)\n\n    Parses an HTML document from a string constant.  Returns the root\n    node (or the result returned by a parser target).  This function\n    can be used to embed \"HTML literals\" in Python code.\n\n    To override the parser with a different ``HTMLParser`` you can pass it to\n    the ``parser`` keyword argument.\n\n    The ``base_url`` keyword argument allows to set the original base URL of\n    the document to support relative Paths when looking up external entities\n    (DTD, XInclude, ...).\n    ";
47644 static PyObject *__pyx_pf_4lxml_5etree_HTML(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
47645   PyObject *__pyx_v_text = 0;
47646   struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser = 0;
47647   PyObject *__pyx_v_base_url = 0;
47648   struct LxmlDocument *__pyx_v_doc;
47649   PyObject *__pyx_v_result_container;
47650   PyObject *__pyx_r = NULL;
47651   PyObject *__pyx_1 = 0;
47652   int __pyx_2;
47653   PyObject *__pyx_3 = 0;
47654   PyObject *__pyx_4 = 0;
47655   int __pyx_t_1;
47656   PyObject *__pyx_t_2 = NULL;
47657   int __pyx_t_3;
47658   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_text,&__pyx_kp_parser,&__pyx_kp_base_url,0};
47659   __Pyx_SetupRefcountContext("HTML");
47660   __pyx_self = __pyx_self;
47661   if (unlikely(__pyx_kwds)) {
47662     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
47663     PyObject* values[3] = {0,0,0};
47664     values[1] = (PyObject*)((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None);
47665     values[2] = Py_None;
47666     switch (PyTuple_GET_SIZE(__pyx_args)) {
47667       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
47668       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
47669       case  0: break;
47670       default: goto __pyx_L5_argtuple_error;
47671     }
47672     switch (PyTuple_GET_SIZE(__pyx_args)) {
47673       case  0:
47674       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_text);
47675       if (likely(values[0])) kw_args--;
47676       else goto __pyx_L5_argtuple_error;
47677       case  1:
47678       if (kw_args > 0) {
47679         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_parser);
47680         if (unlikely(value)) { values[1] = value; kw_args--; }
47681       }
47682     }
47683     while (kw_args > 0) {
47684       PyObject* value;
47685       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_base_url);
47686       if (value) { values[2] = value; if (!(--kw_args)) break; }
47687       break;
47688     }
47689     if (unlikely(kw_args > 0)) {
47690       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "HTML") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2464; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
47691     }
47692     __pyx_v_text = values[0];
47693     __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)values[1]);
47694     __pyx_v_base_url = values[2];
47695   } else {
47696     __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None);
47697     __pyx_v_base_url = Py_None;
47698     switch (PyTuple_GET_SIZE(__pyx_args)) {
47699       case  2: __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)PyTuple_GET_ITEM(__pyx_args, 1));
47700       case  1: __pyx_v_text = PyTuple_GET_ITEM(__pyx_args, 0);
47701       break;
47702       default: goto __pyx_L5_argtuple_error;
47703     }
47704   }
47705   goto __pyx_L4_argument_unpacking_done;
47706   __pyx_L5_argtuple_error:;
47707   __Pyx_RaiseArgtupleInvalid("HTML", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2464; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
47708   __pyx_L3_error:;
47709   __Pyx_AddTraceback("lxml.etree.HTML");
47710   return NULL;
47711   __pyx_L4_argument_unpacking_done:;
47712   __Pyx_INCREF((PyObject *)__pyx_v_parser);
47713   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
47714   __pyx_v_result_container = Py_None; __Pyx_INCREF(Py_None);
47715   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
47716
47717   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2479
47718  *     """
47719  *     cdef _Document doc
47720  *     if parser is None:             # <<<<<<<<<<<<<<
47721  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
47722  *         if not isinstance(parser, HTMLParser):
47723  */
47724   __pyx_t_1 = (((PyObject *)__pyx_v_parser) == Py_None);
47725   if (__pyx_t_1) {
47726
47727     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2480
47728  *     cdef _Document doc
47729  *     if parser is None:
47730  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()             # <<<<<<<<<<<<<<
47731  *         if not isinstance(parser, HTMLParser):
47732  *             parser = __DEFAULT_HTML_PARSER
47733  */
47734     __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->getDefaultParser(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
47735     __Pyx_GOTREF(__pyx_t_2);
47736     __Pyx_DECREF(((PyObject *)__pyx_v_parser));
47737     __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_2);
47738     __pyx_t_2 = 0;
47739
47740     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2481
47741  *     if parser is None:
47742  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
47743  *         if not isinstance(parser, HTMLParser):             # <<<<<<<<<<<<<<
47744  *             parser = __DEFAULT_HTML_PARSER
47745  *     try:
47746  */
47747     __pyx_t_1 = PyObject_TypeCheck(((PyObject *)__pyx_v_parser), ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree_HTMLParser))); 
47748     __pyx_t_3 = (!__pyx_t_1);
47749     if (__pyx_t_3) {
47750
47751       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2482
47752  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
47753  *         if not isinstance(parser, HTMLParser):
47754  *             parser = __DEFAULT_HTML_PARSER             # <<<<<<<<<<<<<<
47755  *     try:
47756  *         doc = _parseMemoryDocument(text, base_url, parser)
47757  */
47758       __Pyx_INCREF(((PyObject *)__pyx_v_4lxml_5etree___DEFAULT_HTML_PARSER));
47759       __Pyx_DECREF(((PyObject *)__pyx_v_parser));
47760       __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_4lxml_5etree___DEFAULT_HTML_PARSER);
47761       goto __pyx_L7;
47762     }
47763     __pyx_L7:;
47764     goto __pyx_L6;
47765   }
47766   __pyx_L6:;
47767
47768   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2483
47769  *         if not isinstance(parser, HTMLParser):
47770  *             parser = __DEFAULT_HTML_PARSER
47771  *     try:             # <<<<<<<<<<<<<<
47772  *         doc = _parseMemoryDocument(text, base_url, parser)
47773  *         return doc.getroot()
47774  */
47775   {
47776     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
47777     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
47778     __Pyx_XGOTREF(__pyx_save_exc_type);
47779     __Pyx_XGOTREF(__pyx_save_exc_value);
47780     __Pyx_XGOTREF(__pyx_save_exc_tb);
47781     /*try:*/ {
47782
47783       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2484
47784  *             parser = __DEFAULT_HTML_PARSER
47785  *     try:
47786  *         doc = _parseMemoryDocument(text, base_url, parser)             # <<<<<<<<<<<<<<
47787  *         return doc.getroot()
47788  *     except _TargetParserResult, result_container:
47789  */
47790       __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__parseMemoryDocument(__pyx_v_text, __pyx_v_base_url, __pyx_v_parser)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2484; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
47791       __Pyx_GOTREF(__pyx_t_2);
47792       __Pyx_DECREF(((PyObject *)__pyx_v_doc));
47793       __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_2);
47794       __pyx_t_2 = 0;
47795
47796       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2485
47797  *     try:
47798  *         doc = _parseMemoryDocument(text, base_url, parser)
47799  *         return doc.getroot()             # <<<<<<<<<<<<<<
47800  *     except _TargetParserResult, result_container:
47801  *         return result_container.result
47802  */
47803       __Pyx_XDECREF(__pyx_r);
47804       __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_doc->__pyx_vtab)->getroot(__pyx_v_doc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2485; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
47805       __Pyx_GOTREF(__pyx_t_2);
47806       __pyx_r = __pyx_t_2;
47807       __pyx_t_2 = 0;
47808       goto __pyx_L12_try_return;
47809     }
47810     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
47811     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
47812     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
47813     goto __pyx_L15_try_end;
47814     __pyx_L12_try_return:;
47815     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
47816     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
47817     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
47818     goto __pyx_L0;
47819     __pyx_L8_error:;
47820     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
47821
47822     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2486
47823  *         doc = _parseMemoryDocument(text, base_url, parser)
47824  *         return doc.getroot()
47825  *     except _TargetParserResult, result_container:             # <<<<<<<<<<<<<<
47826  *         return result_container.result
47827  * 
47828  */
47829     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__TargetParserResult); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2486; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
47830     __Pyx_GOTREF(__pyx_1);
47831     __pyx_2 = PyErr_ExceptionMatches(__pyx_1);
47832     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
47833     if (__pyx_2) {
47834       __Pyx_AddTraceback("lxml.etree.HTML");
47835       if (__Pyx_GetException(&__pyx_1, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2486; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
47836       __Pyx_GOTREF(__pyx_1);
47837       __Pyx_GOTREF(__pyx_3);
47838       __Pyx_GOTREF(__pyx_4);
47839       __Pyx_INCREF(__pyx_3);
47840       __Pyx_DECREF(__pyx_v_result_container);
47841       __pyx_v_result_container = __pyx_3;
47842
47843       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2487
47844  *         return doc.getroot()
47845  *     except _TargetParserResult, result_container:
47846  *         return result_container.result             # <<<<<<<<<<<<<<
47847  * 
47848  * def XML(text, _BaseParser parser=None, *, base_url=None):
47849  */
47850       __Pyx_XDECREF(__pyx_r);
47851       __pyx_t_2 = PyObject_GetAttr(__pyx_v_result_container, __pyx_kp_result); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2487; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
47852       __Pyx_GOTREF(__pyx_t_2);
47853       __pyx_r = __pyx_t_2;
47854       __pyx_t_2 = 0;
47855       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
47856       __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
47857       __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
47858       goto __pyx_L11_except_return;
47859       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
47860       __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
47861       __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
47862       goto __pyx_L9_exception_handled;
47863     }
47864     __pyx_L10_except_error:;
47865     __Pyx_XDECREF(__pyx_save_exc_type);
47866     __Pyx_XDECREF(__pyx_save_exc_value);
47867     __Pyx_XDECREF(__pyx_save_exc_tb);
47868     goto __pyx_L1_error;
47869     __pyx_L11_except_return:;
47870     __Pyx_XGIVEREF(__pyx_save_exc_type);
47871     __Pyx_XGIVEREF(__pyx_save_exc_value);
47872     __Pyx_XGIVEREF(__pyx_save_exc_tb);
47873     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
47874     goto __pyx_L0;
47875     __pyx_L9_exception_handled:;
47876     __Pyx_XGIVEREF(__pyx_save_exc_type);
47877     __Pyx_XGIVEREF(__pyx_save_exc_value);
47878     __Pyx_XGIVEREF(__pyx_save_exc_tb);
47879     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
47880     __pyx_L15_try_end:;
47881   }
47882
47883   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
47884   goto __pyx_L0;
47885   __pyx_L1_error:;
47886   __Pyx_XDECREF(__pyx_1);
47887   __Pyx_XDECREF(__pyx_3);
47888   __Pyx_XDECREF(__pyx_4);
47889   __Pyx_XDECREF(__pyx_t_2);
47890   __Pyx_AddTraceback("lxml.etree.HTML");
47891   __pyx_r = NULL;
47892   __pyx_L0:;
47893   __Pyx_DECREF((PyObject *)__pyx_v_doc);
47894   __Pyx_DECREF(__pyx_v_result_container);
47895   __Pyx_DECREF((PyObject *)__pyx_v_parser);
47896   __Pyx_XGIVEREF(__pyx_r);
47897   __Pyx_FinishRefcountContext();
47898   return __pyx_r;
47899 }
47900
47901 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2489
47902  *         return result_container.result
47903  * 
47904  * def XML(text, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<<
47905  *     u"""XML(text, parser=None, base_url=None)
47906  * 
47907  */
47908
47909 static PyObject *__pyx_pf_4lxml_5etree_XML(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
47910 static char __pyx_doc_4lxml_5etree_XML[] = "XML(text, parser=None, base_url=None)\n\n    Parses an XML document or fragment from a string constant.\n    Returns the root node (or the result returned by a parser target).\n    This function can be used to embed \"XML literals\" in Python code,\n    like in\n\n       >>> root = etree.XML(\"<root><test/></root>\")\n\n    To override the parser with a different ``XMLParser`` you can pass it to\n    the ``parser`` keyword argument.\n\n    The ``base_url`` keyword argument allows to set the original base URL of\n    the document to support relative Paths when looking up external entities\n    (DTD, XInclude, ...).\n    ";
47911 static PyObject *__pyx_pf_4lxml_5etree_XML(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
47912   PyObject *__pyx_v_text = 0;
47913   struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser = 0;
47914   PyObject *__pyx_v_base_url = 0;
47915   struct LxmlDocument *__pyx_v_doc;
47916   PyObject *__pyx_v_result_container;
47917   PyObject *__pyx_r = NULL;
47918   PyObject *__pyx_1 = 0;
47919   int __pyx_2;
47920   PyObject *__pyx_3 = 0;
47921   PyObject *__pyx_4 = 0;
47922   int __pyx_t_1;
47923   PyObject *__pyx_t_2 = NULL;
47924   int __pyx_t_3;
47925   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_text,&__pyx_kp_parser,&__pyx_kp_base_url,0};
47926   __Pyx_SetupRefcountContext("XML");
47927   __pyx_self = __pyx_self;
47928   if (unlikely(__pyx_kwds)) {
47929     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
47930     PyObject* values[3] = {0,0,0};
47931     values[1] = (PyObject*)((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None);
47932     values[2] = Py_None;
47933     switch (PyTuple_GET_SIZE(__pyx_args)) {
47934       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
47935       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
47936       case  0: break;
47937       default: goto __pyx_L5_argtuple_error;
47938     }
47939     switch (PyTuple_GET_SIZE(__pyx_args)) {
47940       case  0:
47941       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_text);
47942       if (likely(values[0])) kw_args--;
47943       else goto __pyx_L5_argtuple_error;
47944       case  1:
47945       if (kw_args > 0) {
47946         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_parser);
47947         if (unlikely(value)) { values[1] = value; kw_args--; }
47948       }
47949     }
47950     while (kw_args > 0) {
47951       PyObject* value;
47952       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_base_url);
47953       if (value) { values[2] = value; if (!(--kw_args)) break; }
47954       break;
47955     }
47956     if (unlikely(kw_args > 0)) {
47957       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "XML") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
47958     }
47959     __pyx_v_text = values[0];
47960     __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)values[1]);
47961     __pyx_v_base_url = values[2];
47962   } else {
47963     __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None);
47964     __pyx_v_base_url = Py_None;
47965     switch (PyTuple_GET_SIZE(__pyx_args)) {
47966       case  2: __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)PyTuple_GET_ITEM(__pyx_args, 1));
47967       case  1: __pyx_v_text = PyTuple_GET_ITEM(__pyx_args, 0);
47968       break;
47969       default: goto __pyx_L5_argtuple_error;
47970     }
47971   }
47972   goto __pyx_L4_argument_unpacking_done;
47973   __pyx_L5_argtuple_error:;
47974   __Pyx_RaiseArgtupleInvalid("XML", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
47975   __pyx_L3_error:;
47976   __Pyx_AddTraceback("lxml.etree.XML");
47977   return NULL;
47978   __pyx_L4_argument_unpacking_done:;
47979   __Pyx_INCREF((PyObject *)__pyx_v_parser);
47980   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
47981   __pyx_v_result_container = Py_None; __Pyx_INCREF(Py_None);
47982   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
47983
47984   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2507
47985  *     """
47986  *     cdef _Document doc
47987  *     if parser is None:             # <<<<<<<<<<<<<<
47988  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
47989  *         if not isinstance(parser, XMLParser):
47990  */
47991   __pyx_t_1 = (((PyObject *)__pyx_v_parser) == Py_None);
47992   if (__pyx_t_1) {
47993
47994     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2508
47995  *     cdef _Document doc
47996  *     if parser is None:
47997  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()             # <<<<<<<<<<<<<<
47998  *         if not isinstance(parser, XMLParser):
47999  *             parser = __DEFAULT_XML_PARSER
48000  */
48001     __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->getDefaultParser(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48002     __Pyx_GOTREF(__pyx_t_2);
48003     __Pyx_DECREF(((PyObject *)__pyx_v_parser));
48004     __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_2);
48005     __pyx_t_2 = 0;
48006
48007     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2509
48008  *     if parser is None:
48009  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
48010  *         if not isinstance(parser, XMLParser):             # <<<<<<<<<<<<<<
48011  *             parser = __DEFAULT_XML_PARSER
48012  *     try:
48013  */
48014     __pyx_t_1 = PyObject_TypeCheck(((PyObject *)__pyx_v_parser), ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree_XMLParser))); 
48015     __pyx_t_3 = (!__pyx_t_1);
48016     if (__pyx_t_3) {
48017
48018       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2510
48019  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
48020  *         if not isinstance(parser, XMLParser):
48021  *             parser = __DEFAULT_XML_PARSER             # <<<<<<<<<<<<<<
48022  *     try:
48023  *         doc = _parseMemoryDocument(text, base_url, parser)
48024  */
48025       __Pyx_INCREF(((PyObject *)__pyx_v_4lxml_5etree___DEFAULT_XML_PARSER));
48026       __Pyx_DECREF(((PyObject *)__pyx_v_parser));
48027       __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_4lxml_5etree___DEFAULT_XML_PARSER);
48028       goto __pyx_L7;
48029     }
48030     __pyx_L7:;
48031     goto __pyx_L6;
48032   }
48033   __pyx_L6:;
48034
48035   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2511
48036  *         if not isinstance(parser, XMLParser):
48037  *             parser = __DEFAULT_XML_PARSER
48038  *     try:             # <<<<<<<<<<<<<<
48039  *         doc = _parseMemoryDocument(text, base_url, parser)
48040  *         return doc.getroot()
48041  */
48042   {
48043     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
48044     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
48045     __Pyx_XGOTREF(__pyx_save_exc_type);
48046     __Pyx_XGOTREF(__pyx_save_exc_value);
48047     __Pyx_XGOTREF(__pyx_save_exc_tb);
48048     /*try:*/ {
48049
48050       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2512
48051  *             parser = __DEFAULT_XML_PARSER
48052  *     try:
48053  *         doc = _parseMemoryDocument(text, base_url, parser)             # <<<<<<<<<<<<<<
48054  *         return doc.getroot()
48055  *     except _TargetParserResult, result_container:
48056  */
48057       __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__parseMemoryDocument(__pyx_v_text, __pyx_v_base_url, __pyx_v_parser)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2512; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
48058       __Pyx_GOTREF(__pyx_t_2);
48059       __Pyx_DECREF(((PyObject *)__pyx_v_doc));
48060       __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_2);
48061       __pyx_t_2 = 0;
48062
48063       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2513
48064  *     try:
48065  *         doc = _parseMemoryDocument(text, base_url, parser)
48066  *         return doc.getroot()             # <<<<<<<<<<<<<<
48067  *     except _TargetParserResult, result_container:
48068  *         return result_container.result
48069  */
48070       __Pyx_XDECREF(__pyx_r);
48071       __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_doc->__pyx_vtab)->getroot(__pyx_v_doc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2513; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
48072       __Pyx_GOTREF(__pyx_t_2);
48073       __pyx_r = __pyx_t_2;
48074       __pyx_t_2 = 0;
48075       goto __pyx_L12_try_return;
48076     }
48077     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
48078     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
48079     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
48080     goto __pyx_L15_try_end;
48081     __pyx_L12_try_return:;
48082     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
48083     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
48084     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
48085     goto __pyx_L0;
48086     __pyx_L8_error:;
48087     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
48088
48089     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2514
48090  *         doc = _parseMemoryDocument(text, base_url, parser)
48091  *         return doc.getroot()
48092  *     except _TargetParserResult, result_container:             # <<<<<<<<<<<<<<
48093  *         return result_container.result
48094  * 
48095  */
48096     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__TargetParserResult); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2514; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
48097     __Pyx_GOTREF(__pyx_1);
48098     __pyx_2 = PyErr_ExceptionMatches(__pyx_1);
48099     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
48100     if (__pyx_2) {
48101       __Pyx_AddTraceback("lxml.etree.XML");
48102       if (__Pyx_GetException(&__pyx_1, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2514; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
48103       __Pyx_GOTREF(__pyx_1);
48104       __Pyx_GOTREF(__pyx_3);
48105       __Pyx_GOTREF(__pyx_4);
48106       __Pyx_INCREF(__pyx_3);
48107       __Pyx_DECREF(__pyx_v_result_container);
48108       __pyx_v_result_container = __pyx_3;
48109
48110       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2515
48111  *         return doc.getroot()
48112  *     except _TargetParserResult, result_container:
48113  *         return result_container.result             # <<<<<<<<<<<<<<
48114  * 
48115  * def fromstring(text, _BaseParser parser=None, *, base_url=None):
48116  */
48117       __Pyx_XDECREF(__pyx_r);
48118       __pyx_t_2 = PyObject_GetAttr(__pyx_v_result_container, __pyx_kp_result); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2515; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
48119       __Pyx_GOTREF(__pyx_t_2);
48120       __pyx_r = __pyx_t_2;
48121       __pyx_t_2 = 0;
48122       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
48123       __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
48124       __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
48125       goto __pyx_L11_except_return;
48126       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
48127       __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
48128       __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
48129       goto __pyx_L9_exception_handled;
48130     }
48131     __pyx_L10_except_error:;
48132     __Pyx_XDECREF(__pyx_save_exc_type);
48133     __Pyx_XDECREF(__pyx_save_exc_value);
48134     __Pyx_XDECREF(__pyx_save_exc_tb);
48135     goto __pyx_L1_error;
48136     __pyx_L11_except_return:;
48137     __Pyx_XGIVEREF(__pyx_save_exc_type);
48138     __Pyx_XGIVEREF(__pyx_save_exc_value);
48139     __Pyx_XGIVEREF(__pyx_save_exc_tb);
48140     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
48141     goto __pyx_L0;
48142     __pyx_L9_exception_handled:;
48143     __Pyx_XGIVEREF(__pyx_save_exc_type);
48144     __Pyx_XGIVEREF(__pyx_save_exc_value);
48145     __Pyx_XGIVEREF(__pyx_save_exc_tb);
48146     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
48147     __pyx_L15_try_end:;
48148   }
48149
48150   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
48151   goto __pyx_L0;
48152   __pyx_L1_error:;
48153   __Pyx_XDECREF(__pyx_1);
48154   __Pyx_XDECREF(__pyx_3);
48155   __Pyx_XDECREF(__pyx_4);
48156   __Pyx_XDECREF(__pyx_t_2);
48157   __Pyx_AddTraceback("lxml.etree.XML");
48158   __pyx_r = NULL;
48159   __pyx_L0:;
48160   __Pyx_DECREF((PyObject *)__pyx_v_doc);
48161   __Pyx_DECREF(__pyx_v_result_container);
48162   __Pyx_DECREF((PyObject *)__pyx_v_parser);
48163   __Pyx_XGIVEREF(__pyx_r);
48164   __Pyx_FinishRefcountContext();
48165   return __pyx_r;
48166 }
48167
48168 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2517
48169  *         return result_container.result
48170  * 
48171  * def fromstring(text, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<<
48172  *     u"""fromstring(text, parser=None, base_url=None)
48173  * 
48174  */
48175
48176 static PyObject *__pyx_pf_4lxml_5etree_fromstring(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
48177 static char __pyx_doc_4lxml_5etree_fromstring[] = "fromstring(text, parser=None, base_url=None)\n\n    Parses an XML document or fragment from a string.  Returns the\n    root node (or the result returned by a parser target).\n\n    To override the default parser with a different parser you can pass it to\n    the ``parser`` keyword argument.\n\n    The ``base_url`` keyword argument allows to set the original base URL of\n    the document to support relative Paths when looking up external entities\n    (DTD, XInclude, ...).\n    ";
48178 static PyObject *__pyx_pf_4lxml_5etree_fromstring(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
48179   PyObject *__pyx_v_text = 0;
48180   struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser = 0;
48181   PyObject *__pyx_v_base_url = 0;
48182   struct LxmlDocument *__pyx_v_doc;
48183   PyObject *__pyx_v_result_container;
48184   PyObject *__pyx_r = NULL;
48185   PyObject *__pyx_1 = 0;
48186   int __pyx_2;
48187   PyObject *__pyx_3 = 0;
48188   PyObject *__pyx_4 = 0;
48189   PyObject *__pyx_t_1 = NULL;
48190   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_text,&__pyx_kp_parser,&__pyx_kp_base_url,0};
48191   __Pyx_SetupRefcountContext("fromstring");
48192   __pyx_self = __pyx_self;
48193   if (unlikely(__pyx_kwds)) {
48194     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
48195     PyObject* values[3] = {0,0,0};
48196     values[1] = (PyObject*)((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None);
48197     values[2] = Py_None;
48198     switch (PyTuple_GET_SIZE(__pyx_args)) {
48199       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
48200       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
48201       case  0: break;
48202       default: goto __pyx_L5_argtuple_error;
48203     }
48204     switch (PyTuple_GET_SIZE(__pyx_args)) {
48205       case  0:
48206       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_text);
48207       if (likely(values[0])) kw_args--;
48208       else goto __pyx_L5_argtuple_error;
48209       case  1:
48210       if (kw_args > 0) {
48211         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_parser);
48212         if (unlikely(value)) { values[1] = value; kw_args--; }
48213       }
48214     }
48215     while (kw_args > 0) {
48216       PyObject* value;
48217       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_base_url);
48218       if (value) { values[2] = value; if (!(--kw_args)) break; }
48219       break;
48220     }
48221     if (unlikely(kw_args > 0)) {
48222       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "fromstring") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2517; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
48223     }
48224     __pyx_v_text = values[0];
48225     __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)values[1]);
48226     __pyx_v_base_url = values[2];
48227   } else {
48228     __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None);
48229     __pyx_v_base_url = Py_None;
48230     switch (PyTuple_GET_SIZE(__pyx_args)) {
48231       case  2: __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)PyTuple_GET_ITEM(__pyx_args, 1));
48232       case  1: __pyx_v_text = PyTuple_GET_ITEM(__pyx_args, 0);
48233       break;
48234       default: goto __pyx_L5_argtuple_error;
48235     }
48236   }
48237   goto __pyx_L4_argument_unpacking_done;
48238   __pyx_L5_argtuple_error:;
48239   __Pyx_RaiseArgtupleInvalid("fromstring", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2517; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
48240   __pyx_L3_error:;
48241   __Pyx_AddTraceback("lxml.etree.fromstring");
48242   return NULL;
48243   __pyx_L4_argument_unpacking_done:;
48244   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
48245   __pyx_v_result_container = Py_None; __Pyx_INCREF(Py_None);
48246   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48247
48248   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2531
48249  *     """
48250  *     cdef _Document doc
48251  *     try:             # <<<<<<<<<<<<<<
48252  *         doc = _parseMemoryDocument(text, base_url, parser)
48253  *         return doc.getroot()
48254  */
48255   {
48256     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
48257     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
48258     __Pyx_XGOTREF(__pyx_save_exc_type);
48259     __Pyx_XGOTREF(__pyx_save_exc_value);
48260     __Pyx_XGOTREF(__pyx_save_exc_tb);
48261     /*try:*/ {
48262
48263       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2532
48264  *     cdef _Document doc
48265  *     try:
48266  *         doc = _parseMemoryDocument(text, base_url, parser)             # <<<<<<<<<<<<<<
48267  *         return doc.getroot()
48268  *     except _TargetParserResult, result_container:
48269  */
48270       __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__parseMemoryDocument(__pyx_v_text, __pyx_v_base_url, __pyx_v_parser)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2532; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
48271       __Pyx_GOTREF(__pyx_t_1);
48272       __Pyx_DECREF(((PyObject *)__pyx_v_doc));
48273       __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_1);
48274       __pyx_t_1 = 0;
48275
48276       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2533
48277  *     try:
48278  *         doc = _parseMemoryDocument(text, base_url, parser)
48279  *         return doc.getroot()             # <<<<<<<<<<<<<<
48280  *     except _TargetParserResult, result_container:
48281  *         return result_container.result
48282  */
48283       __Pyx_XDECREF(__pyx_r);
48284       __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_doc->__pyx_vtab)->getroot(__pyx_v_doc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2533; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
48285       __Pyx_GOTREF(__pyx_t_1);
48286       __pyx_r = __pyx_t_1;
48287       __pyx_t_1 = 0;
48288       goto __pyx_L10_try_return;
48289     }
48290     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
48291     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
48292     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
48293     goto __pyx_L13_try_end;
48294     __pyx_L10_try_return:;
48295     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
48296     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
48297     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
48298     goto __pyx_L0;
48299     __pyx_L6_error:;
48300     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
48301
48302     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2534
48303  *         doc = _parseMemoryDocument(text, base_url, parser)
48304  *         return doc.getroot()
48305  *     except _TargetParserResult, result_container:             # <<<<<<<<<<<<<<
48306  *         return result_container.result
48307  * 
48308  */
48309     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__TargetParserResult); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2534; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
48310     __Pyx_GOTREF(__pyx_1);
48311     __pyx_2 = PyErr_ExceptionMatches(__pyx_1);
48312     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
48313     if (__pyx_2) {
48314       __Pyx_AddTraceback("lxml.etree.fromstring");
48315       if (__Pyx_GetException(&__pyx_1, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2534; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
48316       __Pyx_GOTREF(__pyx_1);
48317       __Pyx_GOTREF(__pyx_3);
48318       __Pyx_GOTREF(__pyx_4);
48319       __Pyx_INCREF(__pyx_3);
48320       __Pyx_DECREF(__pyx_v_result_container);
48321       __pyx_v_result_container = __pyx_3;
48322
48323       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2535
48324  *         return doc.getroot()
48325  *     except _TargetParserResult, result_container:
48326  *         return result_container.result             # <<<<<<<<<<<<<<
48327  * 
48328  * def fromstringlist(strings, _BaseParser parser=None):
48329  */
48330       __Pyx_XDECREF(__pyx_r);
48331       __pyx_t_1 = PyObject_GetAttr(__pyx_v_result_container, __pyx_kp_result); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2535; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
48332       __Pyx_GOTREF(__pyx_t_1);
48333       __pyx_r = __pyx_t_1;
48334       __pyx_t_1 = 0;
48335       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
48336       __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
48337       __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
48338       goto __pyx_L9_except_return;
48339       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
48340       __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
48341       __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
48342       goto __pyx_L7_exception_handled;
48343     }
48344     __pyx_L8_except_error:;
48345     __Pyx_XDECREF(__pyx_save_exc_type);
48346     __Pyx_XDECREF(__pyx_save_exc_value);
48347     __Pyx_XDECREF(__pyx_save_exc_tb);
48348     goto __pyx_L1_error;
48349     __pyx_L9_except_return:;
48350     __Pyx_XGIVEREF(__pyx_save_exc_type);
48351     __Pyx_XGIVEREF(__pyx_save_exc_value);
48352     __Pyx_XGIVEREF(__pyx_save_exc_tb);
48353     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
48354     goto __pyx_L0;
48355     __pyx_L7_exception_handled:;
48356     __Pyx_XGIVEREF(__pyx_save_exc_type);
48357     __Pyx_XGIVEREF(__pyx_save_exc_value);
48358     __Pyx_XGIVEREF(__pyx_save_exc_tb);
48359     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
48360     __pyx_L13_try_end:;
48361   }
48362
48363   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
48364   goto __pyx_L0;
48365   __pyx_L1_error:;
48366   __Pyx_XDECREF(__pyx_1);
48367   __Pyx_XDECREF(__pyx_3);
48368   __Pyx_XDECREF(__pyx_4);
48369   __Pyx_XDECREF(__pyx_t_1);
48370   __Pyx_AddTraceback("lxml.etree.fromstring");
48371   __pyx_r = NULL;
48372   __pyx_L0:;
48373   __Pyx_DECREF((PyObject *)__pyx_v_doc);
48374   __Pyx_DECREF(__pyx_v_result_container);
48375   __Pyx_XGIVEREF(__pyx_r);
48376   __Pyx_FinishRefcountContext();
48377   return __pyx_r;
48378 }
48379
48380 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2537
48381  *         return result_container.result
48382  * 
48383  * def fromstringlist(strings, _BaseParser parser=None):             # <<<<<<<<<<<<<<
48384  *     u"""fromstringlist(strings, parser=None)
48385  * 
48386  */
48387
48388 static PyObject *__pyx_pf_4lxml_5etree_fromstringlist(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
48389 static char __pyx_doc_4lxml_5etree_fromstringlist[] = "fromstringlist(strings, parser=None)\n\n    Parses an XML document from a sequence of strings.  Returns the\n    root node (or the result returned by a parser target).\n\n    To override the default parser with a different parser you can pass it to\n    the ``parser`` keyword argument.\n    ";
48390 static PyObject *__pyx_pf_4lxml_5etree_fromstringlist(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
48391   PyObject *__pyx_v_strings = 0;
48392   struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser = 0;
48393   PyObject *__pyx_v_feed;
48394   PyObject *__pyx_v_data;
48395   PyObject *__pyx_r = NULL;
48396   int __pyx_t_1;
48397   PyObject *__pyx_t_2 = NULL;
48398   Py_ssize_t __pyx_t_3;
48399   PyObject *__pyx_t_4 = NULL;
48400   PyObject *__pyx_t_5 = NULL;
48401   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_strings,&__pyx_kp_parser,0};
48402   __Pyx_SetupRefcountContext("fromstringlist");
48403   __pyx_self = __pyx_self;
48404   if (unlikely(__pyx_kwds)) {
48405     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
48406     PyObject* values[2] = {0,0};
48407     values[1] = (PyObject*)((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None);
48408     switch (PyTuple_GET_SIZE(__pyx_args)) {
48409       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
48410       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
48411       case  0: break;
48412       default: goto __pyx_L5_argtuple_error;
48413     }
48414     switch (PyTuple_GET_SIZE(__pyx_args)) {
48415       case  0:
48416       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_strings);
48417       if (likely(values[0])) kw_args--;
48418       else goto __pyx_L5_argtuple_error;
48419       case  1:
48420       if (kw_args > 0) {
48421         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_parser);
48422         if (unlikely(value)) { values[1] = value; kw_args--; }
48423       }
48424     }
48425     if (unlikely(kw_args > 0)) {
48426       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "fromstringlist") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2537; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
48427     }
48428     __pyx_v_strings = values[0];
48429     __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)values[1]);
48430   } else {
48431     __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None);
48432     switch (PyTuple_GET_SIZE(__pyx_args)) {
48433       case  2: __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)PyTuple_GET_ITEM(__pyx_args, 1));
48434       case  1: __pyx_v_strings = PyTuple_GET_ITEM(__pyx_args, 0);
48435       break;
48436       default: goto __pyx_L5_argtuple_error;
48437     }
48438   }
48439   goto __pyx_L4_argument_unpacking_done;
48440   __pyx_L5_argtuple_error:;
48441   __Pyx_RaiseArgtupleInvalid("fromstringlist", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2537; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
48442   __pyx_L3_error:;
48443   __Pyx_AddTraceback("lxml.etree.fromstringlist");
48444   return NULL;
48445   __pyx_L4_argument_unpacking_done:;
48446   __Pyx_INCREF((PyObject *)__pyx_v_parser);
48447   __pyx_v_feed = Py_None; __Pyx_INCREF(Py_None);
48448   __pyx_v_data = Py_None; __Pyx_INCREF(Py_None);
48449   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48450
48451   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2547
48452  *     """
48453  *     cdef _Document doc
48454  *     if parser is None:             # <<<<<<<<<<<<<<
48455  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
48456  *     feed = parser.feed
48457  */
48458   __pyx_t_1 = (((PyObject *)__pyx_v_parser) == Py_None);
48459   if (__pyx_t_1) {
48460
48461     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2548
48462  *     cdef _Document doc
48463  *     if parser is None:
48464  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()             # <<<<<<<<<<<<<<
48465  *     feed = parser.feed
48466  *     for data in strings:
48467  */
48468     __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->getDefaultParser(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48469     __Pyx_GOTREF(__pyx_t_2);
48470     __Pyx_DECREF(((PyObject *)__pyx_v_parser));
48471     __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_2);
48472     __pyx_t_2 = 0;
48473     goto __pyx_L6;
48474   }
48475   __pyx_L6:;
48476
48477   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2549
48478  *     if parser is None:
48479  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
48480  *     feed = parser.feed             # <<<<<<<<<<<<<<
48481  *     for data in strings:
48482  *         feed(data)
48483  */
48484   __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_parser), __pyx_kp_feed); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48485   __Pyx_GOTREF(__pyx_t_2);
48486   __Pyx_DECREF(__pyx_v_feed);
48487   __pyx_v_feed = __pyx_t_2;
48488   __pyx_t_2 = 0;
48489
48490   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2550
48491  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
48492  *     feed = parser.feed
48493  *     for data in strings:             # <<<<<<<<<<<<<<
48494  *         feed(data)
48495  *     return parser.close()
48496  */
48497   if (PyList_CheckExact(__pyx_v_strings) || PyTuple_CheckExact(__pyx_v_strings)) {
48498     __pyx_t_3 = 0; __pyx_t_2 = __pyx_v_strings; __Pyx_INCREF(__pyx_t_2);
48499   } else {
48500     __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_strings); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48501     __Pyx_GOTREF(__pyx_t_2);
48502   }
48503   for (;;) {
48504     if (likely(PyList_CheckExact(__pyx_t_2))) {
48505       if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
48506       __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++;
48507     } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
48508       if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
48509       __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++;
48510     } else {
48511       __pyx_t_4 = PyIter_Next(__pyx_t_2);
48512       if (!__pyx_t_4) {
48513         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48514         break;
48515       }
48516       __Pyx_GOTREF(__pyx_t_4);
48517     }
48518     __Pyx_DECREF(__pyx_v_data);
48519     __pyx_v_data = __pyx_t_4;
48520     __pyx_t_4 = 0;
48521
48522     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2551
48523  *     feed = parser.feed
48524  *     for data in strings:
48525  *         feed(data)             # <<<<<<<<<<<<<<
48526  *     return parser.close()
48527  * 
48528  */
48529     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48530     __Pyx_GOTREF(((PyObject *)__pyx_t_4));
48531     __Pyx_INCREF(__pyx_v_data);
48532     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_data);
48533     __Pyx_GIVEREF(__pyx_v_data);
48534     __pyx_t_5 = PyObject_Call(__pyx_v_feed, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48535     __Pyx_GOTREF(__pyx_t_5);
48536     __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
48537     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
48538   }
48539   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48540
48541   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2552
48542  *     for data in strings:
48543  *         feed(data)
48544  *     return parser.close()             # <<<<<<<<<<<<<<
48545  * 
48546  * def iselement(element):
48547  */
48548   __Pyx_XDECREF(__pyx_r);
48549   __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_parser), __pyx_kp_close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48550   __Pyx_GOTREF(__pyx_t_2);
48551   __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48552   __Pyx_GOTREF(__pyx_t_5);
48553   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48554   __pyx_r = __pyx_t_5;
48555   __pyx_t_5 = 0;
48556   goto __pyx_L0;
48557
48558   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
48559   goto __pyx_L0;
48560   __pyx_L1_error:;
48561   __Pyx_XDECREF(__pyx_t_2);
48562   __Pyx_XDECREF(__pyx_t_4);
48563   __Pyx_XDECREF(__pyx_t_5);
48564   __Pyx_AddTraceback("lxml.etree.fromstringlist");
48565   __pyx_r = NULL;
48566   __pyx_L0:;
48567   __Pyx_DECREF(__pyx_v_feed);
48568   __Pyx_DECREF(__pyx_v_data);
48569   __Pyx_DECREF((PyObject *)__pyx_v_parser);
48570   __Pyx_XGIVEREF(__pyx_r);
48571   __Pyx_FinishRefcountContext();
48572   return __pyx_r;
48573 }
48574
48575 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2554
48576  *     return parser.close()
48577  * 
48578  * def iselement(element):             # <<<<<<<<<<<<<<
48579  *     u"""iselement(element)
48580  * 
48581  */
48582
48583 static PyObject *__pyx_pf_4lxml_5etree_iselement(PyObject *__pyx_self, PyObject *__pyx_v_element); /*proto*/
48584 static char __pyx_doc_4lxml_5etree_iselement[] = "iselement(element)\n\n    Checks if an object appears to be a valid element object.\n    ";
48585 static PyObject *__pyx_pf_4lxml_5etree_iselement(PyObject *__pyx_self, PyObject *__pyx_v_element) {
48586   PyObject *__pyx_r = NULL;
48587   int __pyx_t_1;
48588   PyObject *__pyx_t_2 = NULL;
48589   __Pyx_SetupRefcountContext("iselement");
48590   __pyx_self = __pyx_self;
48591
48592   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2559
48593  *     Checks if an object appears to be a valid element object.
48594  *     """
48595  *     return isinstance(element, _Element)             # <<<<<<<<<<<<<<
48596  * 
48597  * def dump(_Element elem not None, *, pretty_print=True, with_tail=True):
48598  */
48599   __Pyx_XDECREF(__pyx_r);
48600   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_element, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Element))); 
48601   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48602   __Pyx_GOTREF(__pyx_t_2);
48603   __pyx_r = __pyx_t_2;
48604   __pyx_t_2 = 0;
48605   goto __pyx_L0;
48606
48607   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
48608   goto __pyx_L0;
48609   __pyx_L1_error:;
48610   __Pyx_XDECREF(__pyx_t_2);
48611   __Pyx_AddTraceback("lxml.etree.iselement");
48612   __pyx_r = NULL;
48613   __pyx_L0:;
48614   __Pyx_XGIVEREF(__pyx_r);
48615   __Pyx_FinishRefcountContext();
48616   return __pyx_r;
48617 }
48618
48619 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2561
48620  *     return isinstance(element, _Element)
48621  * 
48622  * def dump(_Element elem not None, *, pretty_print=True, with_tail=True):             # <<<<<<<<<<<<<<
48623  *     u"""dump(elem, pretty_print=True, with_tail=True)
48624  * 
48625  */
48626
48627 static PyObject *__pyx_pf_4lxml_5etree_dump(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
48628 static char __pyx_doc_4lxml_5etree_dump[] = "dump(elem, pretty_print=True, with_tail=True)\n\n    Writes an element tree or element structure to sys.stdout. This function\n    should be used for debugging only.\n    ";
48629 static PyObject *__pyx_pf_4lxml_5etree_dump(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
48630   struct LxmlElement *__pyx_v_elem = 0;
48631   PyObject *__pyx_v_pretty_print = 0;
48632   PyObject *__pyx_v_with_tail = 0;
48633   PyObject *__pyx_r = NULL;
48634   PyObject *__pyx_t_1 = NULL;
48635   int __pyx_t_2;
48636   int __pyx_t_3;
48637   PyObject *__pyx_t_4 = NULL;
48638   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_elem,&__pyx_kp_pretty_print,&__pyx_kp_with_tail,0};
48639   __Pyx_SetupRefcountContext("dump");
48640   __pyx_self = __pyx_self;
48641   if (unlikely(__pyx_kwds)) {
48642     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
48643     PyObject* values[3] = {0,0,0};
48644     values[1] = __pyx_k_102;
48645     values[2] = __pyx_k_103;
48646     switch (PyTuple_GET_SIZE(__pyx_args)) {
48647       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
48648       case  0: break;
48649       default: goto __pyx_L5_argtuple_error;
48650     }
48651     switch (PyTuple_GET_SIZE(__pyx_args)) {
48652       case  0:
48653       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_elem);
48654       if (likely(values[0])) kw_args--;
48655       else goto __pyx_L5_argtuple_error;
48656     }
48657     while (kw_args > 0) {
48658       PyObject* value;
48659       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_pretty_print);
48660       if (value) { values[1] = value; if (!(--kw_args)) break; }
48661       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_with_tail);
48662       if (value) { values[2] = value; if (!(--kw_args)) break; }
48663       break;
48664     }
48665     if (unlikely(kw_args > 0)) {
48666       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "dump") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2561; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
48667     }
48668     __pyx_v_elem = ((struct LxmlElement *)values[0]);
48669     __pyx_v_pretty_print = values[1];
48670     __pyx_v_with_tail = values[2];
48671   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
48672     goto __pyx_L5_argtuple_error;
48673   } else {
48674     __pyx_v_elem = ((struct LxmlElement *)PyTuple_GET_ITEM(__pyx_args, 0));
48675     __pyx_v_pretty_print = __pyx_k_102;
48676     __pyx_v_with_tail = __pyx_k_103;
48677   }
48678   goto __pyx_L4_argument_unpacking_done;
48679   __pyx_L5_argtuple_error:;
48680   __Pyx_RaiseArgtupleInvalid("dump", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2561; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
48681   __pyx_L3_error:;
48682   __Pyx_AddTraceback("lxml.etree.dump");
48683   return NULL;
48684   __pyx_L4_argument_unpacking_done:;
48685   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elem), __pyx_ptype_4lxml_5etree__Element, 0, "elem", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48686
48687   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2567
48688  *     should be used for debugging only.
48689  *     """
48690  *     _dumpToFile(sys.stdout, elem._c_node, pretty_print, with_tail)             # <<<<<<<<<<<<<<
48691  * 
48692  * def tostring(element_or_tree, *, encoding=None, method=u"xml",
48693  */
48694   __pyx_t_1 = PyObject_GetAttr(__pyx_v_4lxml_5etree_sys, __pyx_kp_stdout); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48695   __Pyx_GOTREF(__pyx_t_1);
48696   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_pretty_print); if (unlikely((__pyx_t_2 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48697   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_with_tail); if (unlikely((__pyx_t_3 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48698   __pyx_t_4 = __pyx_f_4lxml_5etree__dumpToFile(__pyx_t_1, __pyx_v_elem->_c_node, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48699   __Pyx_GOTREF(__pyx_t_4);
48700   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
48701   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
48702
48703   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
48704   goto __pyx_L0;
48705   __pyx_L1_error:;
48706   __Pyx_XDECREF(__pyx_t_1);
48707   __Pyx_XDECREF(__pyx_t_4);
48708   __Pyx_AddTraceback("lxml.etree.dump");
48709   __pyx_r = NULL;
48710   __pyx_L0:;
48711   __Pyx_XGIVEREF(__pyx_r);
48712   __Pyx_FinishRefcountContext();
48713   return __pyx_r;
48714 }
48715
48716 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2569
48717  *     _dumpToFile(sys.stdout, elem._c_node, pretty_print, with_tail)
48718  * 
48719  * def tostring(element_or_tree, *, encoding=None, method=u"xml",             # <<<<<<<<<<<<<<
48720  *              xml_declaration=None, pretty_print=False, with_tail=True,
48721  *              standalone=None):
48722  */
48723
48724 static PyObject *__pyx_pf_4lxml_5etree_tostring(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
48725 static char __pyx_doc_4lxml_5etree_tostring[] = "tostring(element_or_tree, encoding=None, method=\"xml\",\n                 xml_declaration=None, pretty_print=False, with_tail=True,\n                 standalone=None)\n\n    Serialize an element to an encoded string representation of its XML\n    tree.\n\n    Defaults to ASCII encoding without XML declaration.  This behaviour can be\n    configured with the keyword arguments 'encoding' (string) and\n    'xml_declaration' (bool).  Note that changing the encoding to a non UTF-8\n    compatible encoding will enable a declaration by default.\n\n    You can also serialise to a Unicode string without declaration by\n    passing the ``unicode`` function as encoding.\n\n    The keyword argument 'pretty_print' (bool) enables formatted XML.\n\n    The keyword argument 'method' selects the output method: 'xml',\n    'html' or plain 'text'.\n\n    Passing a boolean value to the ``standalone`` option will output\n    an XML declaration with the corresponding ``standalone`` flag.\n\n    You can prevent the tail text of the element from being serialised\n    by passing the boolean ``with_tail`` option.  This has no impact\n    on the tail text of children, which will always be serialised.\n    ";
48726 static PyObject *__pyx_pf_4lxml_5etree_tostring(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
48727   PyObject *__pyx_v_element_or_tree = 0;
48728   PyObject *__pyx_v_encoding = 0;
48729   PyObject *__pyx_v_method = 0;
48730   PyObject *__pyx_v_xml_declaration = 0;
48731   PyObject *__pyx_v_pretty_print = 0;
48732   PyObject *__pyx_v_with_tail = 0;
48733   PyObject *__pyx_v_standalone = 0;
48734   int __pyx_v_write_declaration;
48735   int __pyx_v_is_standalone;
48736   PyObject *__pyx_r = NULL;
48737   int __pyx_t_1;
48738   PyObject *__pyx_t_2 = NULL;
48739   PyObject *__pyx_t_3 = NULL;
48740   int __pyx_t_4;
48741   int __pyx_t_5;
48742   int __pyx_t_6;
48743   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_element_or_tree,&__pyx_kp_encoding,&__pyx_kp_method,&__pyx_kp_xml_declaration,&__pyx_kp_pretty_print,&__pyx_kp_with_tail,&__pyx_kp_standalone,0};
48744   __Pyx_SetupRefcountContext("tostring");
48745   __pyx_self = __pyx_self;
48746   if (unlikely(__pyx_kwds)) {
48747     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
48748     PyObject* values[7] = {0,0,0,0,0,0,0};
48749     values[1] = Py_None;
48750     values[2] = ((PyObject *)__pyx_kp_104);
48751     values[3] = Py_None;
48752     values[4] = __pyx_k_105;
48753     values[5] = __pyx_k_106;
48754     values[6] = Py_None;
48755     switch (PyTuple_GET_SIZE(__pyx_args)) {
48756       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
48757       case  0: break;
48758       default: goto __pyx_L5_argtuple_error;
48759     }
48760     switch (PyTuple_GET_SIZE(__pyx_args)) {
48761       case  0:
48762       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_element_or_tree);
48763       if (likely(values[0])) kw_args--;
48764       else goto __pyx_L5_argtuple_error;
48765     }
48766     while (kw_args > 0) {
48767       PyObject* value;
48768       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_encoding);
48769       if (value) { values[1] = value; if (!(--kw_args)) break; }
48770       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_method);
48771       if (value) { values[2] = value; if (!(--kw_args)) break; }
48772       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_xml_declaration);
48773       if (value) { values[3] = value; if (!(--kw_args)) break; }
48774       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_pretty_print);
48775       if (value) { values[4] = value; if (!(--kw_args)) break; }
48776       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_with_tail);
48777       if (value) { values[5] = value; if (!(--kw_args)) break; }
48778       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_standalone);
48779       if (value) { values[6] = value; if (!(--kw_args)) break; }
48780       break;
48781     }
48782     if (unlikely(kw_args > 0)) {
48783       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "tostring") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
48784     }
48785     __pyx_v_element_or_tree = values[0];
48786     __pyx_v_encoding = values[1];
48787     __pyx_v_method = values[2];
48788     __pyx_v_xml_declaration = values[3];
48789     __pyx_v_pretty_print = values[4];
48790     __pyx_v_with_tail = values[5];
48791     __pyx_v_standalone = values[6];
48792   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
48793     goto __pyx_L5_argtuple_error;
48794   } else {
48795     __pyx_v_element_or_tree = PyTuple_GET_ITEM(__pyx_args, 0);
48796     __pyx_v_encoding = Py_None;
48797     __pyx_v_method = ((PyObject *)__pyx_kp_104);
48798     __pyx_v_xml_declaration = Py_None;
48799     __pyx_v_pretty_print = __pyx_k_105;
48800     __pyx_v_with_tail = __pyx_k_106;
48801     __pyx_v_standalone = Py_None;
48802   }
48803   goto __pyx_L4_argument_unpacking_done;
48804   __pyx_L5_argtuple_error:;
48805   __Pyx_RaiseArgtupleInvalid("tostring", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2569; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
48806   __pyx_L3_error:;
48807   __Pyx_AddTraceback("lxml.etree.tostring");
48808   return NULL;
48809   __pyx_L4_argument_unpacking_done:;
48810   __Pyx_INCREF(__pyx_v_encoding);
48811
48812   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2601
48813  *     cdef bint write_declaration
48814  *     cdef int is_standalone
48815  *     if encoding is _unicode:             # <<<<<<<<<<<<<<
48816  *         if xml_declaration:
48817  *             raise ValueError, \
48818  */
48819   __pyx_t_1 = (__pyx_v_encoding == __pyx_v_4lxml_5etree__unicode);
48820   if (__pyx_t_1) {
48821
48822     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2602
48823  *     cdef int is_standalone
48824  *     if encoding is _unicode:
48825  *         if xml_declaration:             # <<<<<<<<<<<<<<
48826  *             raise ValueError, \
48827  *                 u"Serialisation to unicode must not request an XML declaration"
48828  */
48829     __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_xml_declaration); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48830     if (__pyx_t_1) {
48831
48832       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2604
48833  *         if xml_declaration:
48834  *             raise ValueError, \
48835  *                 u"Serialisation to unicode must not request an XML declaration"             # <<<<<<<<<<<<<<
48836  *         write_declaration = 0
48837  *     elif xml_declaration is None:
48838  */
48839       __Pyx_Raise(__pyx_builtin_ValueError, ((PyObject *)__pyx_kp_381), 0);
48840       {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48841       goto __pyx_L7;
48842     }
48843     __pyx_L7:;
48844
48845     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2605
48846  *             raise ValueError, \
48847  *                 u"Serialisation to unicode must not request an XML declaration"
48848  *         write_declaration = 0             # <<<<<<<<<<<<<<
48849  *     elif xml_declaration is None:
48850  *         # by default, write an XML declaration only for non-standard encodings
48851  */
48852     __pyx_v_write_declaration = 0;
48853     goto __pyx_L6;
48854   }
48855
48856   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2606
48857  *                 u"Serialisation to unicode must not request an XML declaration"
48858  *         write_declaration = 0
48859  *     elif xml_declaration is None:             # <<<<<<<<<<<<<<
48860  *         # by default, write an XML declaration only for non-standard encodings
48861  *         write_declaration = encoding is not None and encoding.upper() not in \
48862  */
48863   __pyx_t_1 = (__pyx_v_xml_declaration == Py_None);
48864   if (__pyx_t_1) {
48865
48866     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2608
48867  *     elif xml_declaration is None:
48868  *         # by default, write an XML declaration only for non-standard encodings
48869  *         write_declaration = encoding is not None and encoding.upper() not in \             # <<<<<<<<<<<<<<
48870  *                             (u'ASCII', u'UTF-8', u'UTF8', u'US-ASCII')
48871  *     else:
48872  */
48873     __pyx_t_1 = (__pyx_v_encoding != Py_None);
48874     if (__pyx_t_1) {
48875       __pyx_t_2 = PyObject_GetAttr(__pyx_v_encoding, __pyx_kp_upper); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48876       __Pyx_GOTREF(__pyx_t_2);
48877       __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48878       __Pyx_GOTREF(__pyx_t_3);
48879       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48880
48881       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2609
48882  *         # by default, write an XML declaration only for non-standard encodings
48883  *         write_declaration = encoding is not None and encoding.upper() not in \
48884  *                             (u'ASCII', u'UTF-8', u'UTF8', u'US-ASCII')             # <<<<<<<<<<<<<<
48885  *     else:
48886  *         write_declaration = xml_declaration
48887  */
48888       __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_kp_382), Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48889       __Pyx_GOTREF(__pyx_t_2);
48890       __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48891       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48892       if (((int)__pyx_t_4)) {
48893
48894         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2608
48895  *     elif xml_declaration is None:
48896  *         # by default, write an XML declaration only for non-standard encodings
48897  *         write_declaration = encoding is not None and encoding.upper() not in \             # <<<<<<<<<<<<<<
48898  *                             (u'ASCII', u'UTF-8', u'UTF8', u'US-ASCII')
48899  *     else:
48900  */
48901         __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_kp_383), Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48902         __Pyx_GOTREF(__pyx_t_2);
48903         __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48904         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48905         __pyx_t_6 = ((int)__pyx_t_5);
48906       } else {
48907         __pyx_t_6 = ((int)__pyx_t_4);
48908       }
48909       if (__pyx_t_6) {
48910
48911         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2609
48912  *         # by default, write an XML declaration only for non-standard encodings
48913  *         write_declaration = encoding is not None and encoding.upper() not in \
48914  *                             (u'ASCII', u'UTF-8', u'UTF8', u'US-ASCII')             # <<<<<<<<<<<<<<
48915  *     else:
48916  *         write_declaration = xml_declaration
48917  */
48918         __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_kp_384), Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48919         __Pyx_GOTREF(__pyx_t_2);
48920         __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48921         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48922         __pyx_t_5 = ((int)__pyx_t_4);
48923       } else {
48924         __pyx_t_5 = __pyx_t_6;
48925       }
48926       if (__pyx_t_5) {
48927
48928         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2608
48929  *     elif xml_declaration is None:
48930  *         # by default, write an XML declaration only for non-standard encodings
48931  *         write_declaration = encoding is not None and encoding.upper() not in \             # <<<<<<<<<<<<<<
48932  *                             (u'ASCII', u'UTF-8', u'UTF8', u'US-ASCII')
48933  *     else:
48934  */
48935         __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_kp_385), Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48936         __Pyx_GOTREF(__pyx_t_2);
48937         __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48938         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
48939         __pyx_t_4 = ((int)__pyx_t_6);
48940       } else {
48941         __pyx_t_4 = __pyx_t_5;
48942       }
48943       __pyx_t_5 = __pyx_t_4;
48944       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
48945     } else {
48946       __pyx_t_5 = __pyx_t_1;
48947     }
48948     __pyx_v_write_declaration = __pyx_t_5;
48949     goto __pyx_L6;
48950   }
48951   /*else*/ {
48952
48953     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2611
48954  *                             (u'ASCII', u'UTF-8', u'UTF8', u'US-ASCII')
48955  *     else:
48956  *         write_declaration = xml_declaration             # <<<<<<<<<<<<<<
48957  *     if encoding is None:
48958  *         encoding = u'ASCII'
48959  */
48960     __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_xml_declaration); if (unlikely((__pyx_t_5 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48961     __pyx_v_write_declaration = __pyx_t_5;
48962   }
48963   __pyx_L6:;
48964
48965   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2612
48966  *     else:
48967  *         write_declaration = xml_declaration
48968  *     if encoding is None:             # <<<<<<<<<<<<<<
48969  *         encoding = u'ASCII'
48970  *     if standalone is None:
48971  */
48972   __pyx_t_5 = (__pyx_v_encoding == Py_None);
48973   if (__pyx_t_5) {
48974
48975     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2613
48976  *         write_declaration = xml_declaration
48977  *     if encoding is None:
48978  *         encoding = u'ASCII'             # <<<<<<<<<<<<<<
48979  *     if standalone is None:
48980  *         is_standalone = -1
48981  */
48982     __Pyx_INCREF(((PyObject *)__pyx_kp_386));
48983     __Pyx_DECREF(__pyx_v_encoding);
48984     __pyx_v_encoding = ((PyObject *)__pyx_kp_386);
48985     goto __pyx_L8;
48986   }
48987   __pyx_L8:;
48988
48989   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2614
48990  *     if encoding is None:
48991  *         encoding = u'ASCII'
48992  *     if standalone is None:             # <<<<<<<<<<<<<<
48993  *         is_standalone = -1
48994  *     elif standalone:
48995  */
48996   __pyx_t_5 = (__pyx_v_standalone == Py_None);
48997   if (__pyx_t_5) {
48998
48999     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2615
49000  *         encoding = u'ASCII'
49001  *     if standalone is None:
49002  *         is_standalone = -1             # <<<<<<<<<<<<<<
49003  *     elif standalone:
49004  *         write_declaration = 1
49005  */
49006     __pyx_v_is_standalone = -1;
49007     goto __pyx_L9;
49008   }
49009
49010   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2616
49011  *     if standalone is None:
49012  *         is_standalone = -1
49013  *     elif standalone:             # <<<<<<<<<<<<<<
49014  *         write_declaration = 1
49015  *         is_standalone = 1
49016  */
49017   __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_standalone); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49018   if (__pyx_t_5) {
49019
49020     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2617
49021  *         is_standalone = -1
49022  *     elif standalone:
49023  *         write_declaration = 1             # <<<<<<<<<<<<<<
49024  *         is_standalone = 1
49025  *     else:
49026  */
49027     __pyx_v_write_declaration = 1;
49028
49029     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2618
49030  *     elif standalone:
49031  *         write_declaration = 1
49032  *         is_standalone = 1             # <<<<<<<<<<<<<<
49033  *     else:
49034  *         write_declaration = 1
49035  */
49036     __pyx_v_is_standalone = 1;
49037     goto __pyx_L9;
49038   }
49039   /*else*/ {
49040
49041     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2620
49042  *         is_standalone = 1
49043  *     else:
49044  *         write_declaration = 1             # <<<<<<<<<<<<<<
49045  *         is_standalone = 0
49046  * 
49047  */
49048     __pyx_v_write_declaration = 1;
49049
49050     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2621
49051  *     else:
49052  *         write_declaration = 1
49053  *         is_standalone = 0             # <<<<<<<<<<<<<<
49054  * 
49055  *     if isinstance(element_or_tree, _Element):
49056  */
49057     __pyx_v_is_standalone = 0;
49058   }
49059   __pyx_L9:;
49060
49061   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2623
49062  *         is_standalone = 0
49063  * 
49064  *     if isinstance(element_or_tree, _Element):             # <<<<<<<<<<<<<<
49065  *         return _tostring(<_Element>element_or_tree, encoding, method,
49066  *                          write_declaration, 0, pretty_print, with_tail,
49067  */
49068   __pyx_t_5 = PyObject_TypeCheck(__pyx_v_element_or_tree, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Element))); 
49069   if (__pyx_t_5) {
49070
49071     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2624
49072  * 
49073  *     if isinstance(element_or_tree, _Element):
49074  *         return _tostring(<_Element>element_or_tree, encoding, method,             # <<<<<<<<<<<<<<
49075  *                          write_declaration, 0, pretty_print, with_tail,
49076  *                          is_standalone)
49077  */
49078     __Pyx_XDECREF(__pyx_r);
49079
49080     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2625
49081  *     if isinstance(element_or_tree, _Element):
49082  *         return _tostring(<_Element>element_or_tree, encoding, method,
49083  *                          write_declaration, 0, pretty_print, with_tail,             # <<<<<<<<<<<<<<
49084  *                          is_standalone)
49085  *     elif isinstance(element_or_tree, _ElementTree):
49086  */
49087     __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_pretty_print); if (unlikely((__pyx_t_5 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49088     __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_with_tail); if (unlikely((__pyx_t_1 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49089
49090     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2626
49091  *         return _tostring(<_Element>element_or_tree, encoding, method,
49092  *                          write_declaration, 0, pretty_print, with_tail,
49093  *                          is_standalone)             # <<<<<<<<<<<<<<
49094  *     elif isinstance(element_or_tree, _ElementTree):
49095  *         return _tostring((<_ElementTree>element_or_tree)._context_node,
49096  */
49097     __pyx_t_3 = __pyx_f_4lxml_5etree__tostring(((struct LxmlElement *)__pyx_v_element_or_tree), __pyx_v_encoding, __pyx_v_method, __pyx_v_write_declaration, 0, __pyx_t_5, __pyx_t_1, __pyx_v_is_standalone); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49098     __Pyx_GOTREF(__pyx_t_3);
49099     __pyx_r = __pyx_t_3;
49100     __pyx_t_3 = 0;
49101     goto __pyx_L0;
49102     goto __pyx_L10;
49103   }
49104
49105   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2627
49106  *                          write_declaration, 0, pretty_print, with_tail,
49107  *                          is_standalone)
49108  *     elif isinstance(element_or_tree, _ElementTree):             # <<<<<<<<<<<<<<
49109  *         return _tostring((<_ElementTree>element_or_tree)._context_node,
49110  *                          encoding, method, write_declaration, 1, pretty_print,
49111  */
49112   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_element_or_tree, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ElementTree))); 
49113   if (__pyx_t_1) {
49114
49115     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2628
49116  *                          is_standalone)
49117  *     elif isinstance(element_or_tree, _ElementTree):
49118  *         return _tostring((<_ElementTree>element_or_tree)._context_node,             # <<<<<<<<<<<<<<
49119  *                          encoding, method, write_declaration, 1, pretty_print,
49120  *                          with_tail, is_standalone)
49121  */
49122     __Pyx_XDECREF(__pyx_r);
49123
49124     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2629
49125  *     elif isinstance(element_or_tree, _ElementTree):
49126  *         return _tostring((<_ElementTree>element_or_tree)._context_node,
49127  *                          encoding, method, write_declaration, 1, pretty_print,             # <<<<<<<<<<<<<<
49128  *                          with_tail, is_standalone)
49129  *     else:
49130  */
49131     __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_pretty_print); if (unlikely((__pyx_t_1 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49132
49133     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2630
49134  *         return _tostring((<_ElementTree>element_or_tree)._context_node,
49135  *                          encoding, method, write_declaration, 1, pretty_print,
49136  *                          with_tail, is_standalone)             # <<<<<<<<<<<<<<
49137  *     else:
49138  *         raise TypeError, u"Type '%s' cannot be serialized." % \
49139  */
49140     __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_with_tail); if (unlikely((__pyx_t_5 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49141     __pyx_t_3 = __pyx_f_4lxml_5etree__tostring(((struct LxmlElementTree *)__pyx_v_element_or_tree)->_context_node, __pyx_v_encoding, __pyx_v_method, __pyx_v_write_declaration, 1, __pyx_t_1, __pyx_t_5, __pyx_v_is_standalone); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49142     __Pyx_GOTREF(__pyx_t_3);
49143     __pyx_r = __pyx_t_3;
49144     __pyx_t_3 = 0;
49145     goto __pyx_L0;
49146     goto __pyx_L10;
49147   }
49148   /*else*/ {
49149
49150     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2633
49151  *     else:
49152  *         raise TypeError, u"Type '%s' cannot be serialized." % \
49153  *             python._fqtypename(element_or_tree)             # <<<<<<<<<<<<<<
49154  * 
49155  * def tostringlist(element_or_tree, *args, **kwargs):
49156  */
49157     __pyx_t_3 = __Pyx_PyBytes_FromString(_fqtypename(__pyx_v_element_or_tree)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49158     __Pyx_GOTREF(__pyx_t_3);
49159     __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_387), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49160     __Pyx_GOTREF(__pyx_t_2);
49161     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
49162     __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_2, 0);
49163     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49164     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49165   }
49166   __pyx_L10:;
49167
49168   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
49169   goto __pyx_L0;
49170   __pyx_L1_error:;
49171   __Pyx_XDECREF(__pyx_t_2);
49172   __Pyx_XDECREF(__pyx_t_3);
49173   __Pyx_AddTraceback("lxml.etree.tostring");
49174   __pyx_r = NULL;
49175   __pyx_L0:;
49176   __Pyx_DECREF(__pyx_v_encoding);
49177   __Pyx_XGIVEREF(__pyx_r);
49178   __Pyx_FinishRefcountContext();
49179   return __pyx_r;
49180 }
49181
49182 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2635
49183  *             python._fqtypename(element_or_tree)
49184  * 
49185  * def tostringlist(element_or_tree, *args, **kwargs):             # <<<<<<<<<<<<<<
49186  *     u"""tostringlist(element_or_tree, *args, **kwargs)
49187  * 
49188  */
49189
49190 static PyObject *__pyx_pf_4lxml_5etree_tostringlist(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
49191 static char __pyx_doc_4lxml_5etree_tostringlist[] = "tostringlist(element_or_tree, *args, **kwargs)\n\n    Serialize an element to an encoded string representation of its XML\n    tree, stored in a list of partial strings.\n\n    This is purely for ElementTree 1.3 compatibility.  The result is a\n    single string wrapped in a list.\n    ";
49192 static PyObject *__pyx_pf_4lxml_5etree_tostringlist(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
49193   PyObject *__pyx_v_element_or_tree = 0;
49194   PyObject *__pyx_v_args = 0;
49195   PyObject *__pyx_v_kwargs = 0;
49196   PyObject *__pyx_r = NULL;
49197   PyObject *__pyx_1 = 0;
49198   PyObject *__pyx_2 = 0;
49199   PyObject *__pyx_t_1 = NULL;
49200   PyObject *__pyx_t_2 = NULL;
49201   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_element_or_tree,0};
49202   __Pyx_SetupRefcountContext("tostringlist");
49203   __pyx_self = __pyx_self;
49204   __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
49205   __Pyx_GOTREF(__pyx_v_kwargs);
49206   if (PyTuple_GET_SIZE(__pyx_args) > 1) {
49207     __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); __Pyx_GOTREF(__pyx_v_args);
49208
49209     if (unlikely(!__pyx_v_args)) {
49210       __Pyx_DECREF(__pyx_v_kwargs);
49211       return NULL;
49212     }
49213   } else {
49214     __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
49215   }
49216   if (unlikely(__pyx_kwds)) {
49217     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
49218     PyObject* values[1] = {0};
49219     switch (PyTuple_GET_SIZE(__pyx_args)) {
49220       default:
49221       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
49222       case  0: break;
49223     }
49224     switch (PyTuple_GET_SIZE(__pyx_args)) {
49225       case  0:
49226       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_element_or_tree);
49227       if (likely(values[0])) kw_args--;
49228       else goto __pyx_L5_argtuple_error;
49229     }
49230     if (unlikely(kw_args > 0)) {
49231       const Py_ssize_t used_pos_args = (PyTuple_GET_SIZE(__pyx_args) < 1) ? PyTuple_GET_SIZE(__pyx_args) : 1;
49232       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "tostringlist") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2635; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
49233     }
49234     __pyx_v_element_or_tree = values[0];
49235   } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
49236     goto __pyx_L5_argtuple_error;
49237   } else {
49238     __pyx_v_element_or_tree = PyTuple_GET_ITEM(__pyx_args, 0);
49239   }
49240   goto __pyx_L4_argument_unpacking_done;
49241   __pyx_L5_argtuple_error:;
49242   __Pyx_RaiseArgtupleInvalid("tostringlist", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2635; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
49243   __pyx_L3_error:;
49244   __Pyx_DECREF(__pyx_v_args);
49245   __Pyx_DECREF(__pyx_v_kwargs);
49246   __Pyx_AddTraceback("lxml.etree.tostringlist");
49247   return NULL;
49248   __pyx_L4_argument_unpacking_done:;
49249
49250   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2644
49251  *     single string wrapped in a list.
49252  *     """
49253  *     return [tostring(element_or_tree, *args, **kwargs)]             # <<<<<<<<<<<<<<
49254  * 
49255  * def tounicode(element_or_tree, *, method=u"xml", pretty_print=False,
49256  */
49257   __Pyx_XDECREF(__pyx_r);
49258   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_tostring); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49259   __Pyx_GOTREF(__pyx_1);
49260   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49261   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
49262   __Pyx_INCREF(__pyx_v_element_or_tree);
49263   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_element_or_tree);
49264   __Pyx_GIVEREF(__pyx_v_element_or_tree);
49265   __pyx_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49266   __Pyx_GOTREF(((PyObject *)__pyx_2));
49267   __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_2)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49268   __Pyx_GOTREF(__pyx_t_2);
49269   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
49270   __Pyx_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
49271   __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_1, __pyx_t_2, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49272   __Pyx_GOTREF(__pyx_t_1);
49273   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
49274   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
49275   __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49276   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
49277   PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
49278   __Pyx_GIVEREF(__pyx_t_1);
49279   __pyx_t_1 = 0;
49280   __pyx_r = ((PyObject *)__pyx_t_2);
49281   __pyx_t_2 = 0;
49282   goto __pyx_L0;
49283
49284   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
49285   goto __pyx_L0;
49286   __pyx_L1_error:;
49287   __Pyx_XDECREF(__pyx_1);
49288   __Pyx_XDECREF(__pyx_2);
49289   __Pyx_XDECREF(__pyx_t_1);
49290   __Pyx_XDECREF(__pyx_t_2);
49291   __Pyx_AddTraceback("lxml.etree.tostringlist");
49292   __pyx_r = NULL;
49293   __pyx_L0:;
49294   __Pyx_DECREF(__pyx_v_args);
49295   __Pyx_DECREF(__pyx_v_kwargs);
49296   __Pyx_XGIVEREF(__pyx_r);
49297   __Pyx_FinishRefcountContext();
49298   return __pyx_r;
49299 }
49300
49301 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2646
49302  *     return [tostring(element_or_tree, *args, **kwargs)]
49303  * 
49304  * def tounicode(element_or_tree, *, method=u"xml", pretty_print=False,             # <<<<<<<<<<<<<<
49305  *               with_tail=True):
49306  *     u"""tounicode(element_or_tree, method="xml", pretty_print=False,
49307  */
49308
49309 static PyObject *__pyx_pf_4lxml_5etree_tounicode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
49310 static char __pyx_doc_4lxml_5etree_tounicode[] = "tounicode(element_or_tree, method=\"xml\", pretty_print=False,\n                  with_tail=True)\n\n    Serialize an element to the Python unicode representation of its XML\n    tree.\n\n    Note that the result does not carry an XML encoding declaration and is\n    therefore not necessarily suited for serialization to byte streams without\n    further treatment.\n\n    The boolean keyword argument 'pretty_print' enables formatted XML.\n\n    The keyword argument 'method' selects the output method: 'xml',\n    'html' or plain 'text'.\n\n    You can prevent the tail text of the element from being serialised\n    by passing the boolean ``with_tail`` option.  This has no impact\n    on the tail text of children, which will always be serialised.\n\n    :deprecated: use ``tostring(el, encoding=unicode)`` instead.\n    ";
49311 static PyObject *__pyx_pf_4lxml_5etree_tounicode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
49312   PyObject *__pyx_v_element_or_tree = 0;
49313   PyObject *__pyx_v_method = 0;
49314   PyObject *__pyx_v_pretty_print = 0;
49315   PyObject *__pyx_v_with_tail = 0;
49316   PyObject *__pyx_r = NULL;
49317   int __pyx_t_1;
49318   int __pyx_t_2;
49319   PyObject *__pyx_t_3 = NULL;
49320   PyObject *__pyx_t_4 = NULL;
49321   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_element_or_tree,&__pyx_kp_method,&__pyx_kp_pretty_print,&__pyx_kp_with_tail,0};
49322   __Pyx_SetupRefcountContext("tounicode");
49323   __pyx_self = __pyx_self;
49324   if (unlikely(__pyx_kwds)) {
49325     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
49326     PyObject* values[4] = {0,0,0,0};
49327     values[1] = ((PyObject *)__pyx_kp_107);
49328     values[2] = __pyx_k_108;
49329     values[3] = __pyx_k_109;
49330     switch (PyTuple_GET_SIZE(__pyx_args)) {
49331       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
49332       case  0: break;
49333       default: goto __pyx_L5_argtuple_error;
49334     }
49335     switch (PyTuple_GET_SIZE(__pyx_args)) {
49336       case  0:
49337       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_element_or_tree);
49338       if (likely(values[0])) kw_args--;
49339       else goto __pyx_L5_argtuple_error;
49340     }
49341     while (kw_args > 0) {
49342       PyObject* value;
49343       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_method);
49344       if (value) { values[1] = value; if (!(--kw_args)) break; }
49345       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_pretty_print);
49346       if (value) { values[2] = value; if (!(--kw_args)) break; }
49347       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_with_tail);
49348       if (value) { values[3] = value; if (!(--kw_args)) break; }
49349       break;
49350     }
49351     if (unlikely(kw_args > 0)) {
49352       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "tounicode") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2646; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
49353     }
49354     __pyx_v_element_or_tree = values[0];
49355     __pyx_v_method = values[1];
49356     __pyx_v_pretty_print = values[2];
49357     __pyx_v_with_tail = values[3];
49358   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
49359     goto __pyx_L5_argtuple_error;
49360   } else {
49361     __pyx_v_element_or_tree = PyTuple_GET_ITEM(__pyx_args, 0);
49362     __pyx_v_method = ((PyObject *)__pyx_kp_107);
49363     __pyx_v_pretty_print = __pyx_k_108;
49364     __pyx_v_with_tail = __pyx_k_109;
49365   }
49366   goto __pyx_L4_argument_unpacking_done;
49367   __pyx_L5_argtuple_error:;
49368   __Pyx_RaiseArgtupleInvalid("tounicode", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2646; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
49369   __pyx_L3_error:;
49370   __Pyx_AddTraceback("lxml.etree.tounicode");
49371   return NULL;
49372   __pyx_L4_argument_unpacking_done:;
49373
49374   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2669
49375  *     :deprecated: use ``tostring(el, encoding=unicode)`` instead.
49376  *     """
49377  *     if isinstance(element_or_tree, _Element):             # <<<<<<<<<<<<<<
49378  *         return _tostring(<_Element>element_or_tree, _unicode, method,
49379  *                           0, 0, pretty_print, with_tail, -1)
49380  */
49381   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_element_or_tree, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Element))); 
49382   if (__pyx_t_1) {
49383
49384     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2670
49385  *     """
49386  *     if isinstance(element_or_tree, _Element):
49387  *         return _tostring(<_Element>element_or_tree, _unicode, method,             # <<<<<<<<<<<<<<
49388  *                           0, 0, pretty_print, with_tail, -1)
49389  *     elif isinstance(element_or_tree, _ElementTree):
49390  */
49391     __Pyx_XDECREF(__pyx_r);
49392
49393     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2671
49394  *     if isinstance(element_or_tree, _Element):
49395  *         return _tostring(<_Element>element_or_tree, _unicode, method,
49396  *                           0, 0, pretty_print, with_tail, -1)             # <<<<<<<<<<<<<<
49397  *     elif isinstance(element_or_tree, _ElementTree):
49398  *         return _tostring((<_ElementTree>element_or_tree)._context_node,
49399  */
49400     __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_pretty_print); if (unlikely((__pyx_t_1 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49401     __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_with_tail); if (unlikely((__pyx_t_2 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49402     __pyx_t_3 = __pyx_f_4lxml_5etree__tostring(((struct LxmlElement *)__pyx_v_element_or_tree), __pyx_v_4lxml_5etree__unicode, __pyx_v_method, 0, 0, __pyx_t_1, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49403     __Pyx_GOTREF(__pyx_t_3);
49404     __pyx_r = __pyx_t_3;
49405     __pyx_t_3 = 0;
49406     goto __pyx_L0;
49407     goto __pyx_L6;
49408   }
49409
49410   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2672
49411  *         return _tostring(<_Element>element_or_tree, _unicode, method,
49412  *                           0, 0, pretty_print, with_tail, -1)
49413  *     elif isinstance(element_or_tree, _ElementTree):             # <<<<<<<<<<<<<<
49414  *         return _tostring((<_ElementTree>element_or_tree)._context_node,
49415  *                          _unicode, method, 0, 1, pretty_print, with_tail,
49416  */
49417   __pyx_t_2 = PyObject_TypeCheck(__pyx_v_element_or_tree, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ElementTree))); 
49418   if (__pyx_t_2) {
49419
49420     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2673
49421  *                           0, 0, pretty_print, with_tail, -1)
49422  *     elif isinstance(element_or_tree, _ElementTree):
49423  *         return _tostring((<_ElementTree>element_or_tree)._context_node,             # <<<<<<<<<<<<<<
49424  *                          _unicode, method, 0, 1, pretty_print, with_tail,
49425  *                          -1)
49426  */
49427     __Pyx_XDECREF(__pyx_r);
49428
49429     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2674
49430  *     elif isinstance(element_or_tree, _ElementTree):
49431  *         return _tostring((<_ElementTree>element_or_tree)._context_node,
49432  *                          _unicode, method, 0, 1, pretty_print, with_tail,             # <<<<<<<<<<<<<<
49433  *                          -1)
49434  *     else:
49435  */
49436     __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_pretty_print); if (unlikely((__pyx_t_2 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49437     __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_with_tail); if (unlikely((__pyx_t_1 == (int)-1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49438
49439     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2675
49440  *         return _tostring((<_ElementTree>element_or_tree)._context_node,
49441  *                          _unicode, method, 0, 1, pretty_print, with_tail,
49442  *                          -1)             # <<<<<<<<<<<<<<
49443  *     else:
49444  *         raise TypeError, u"Type '%s' cannot be serialized." % \
49445  */
49446     __pyx_t_3 = __pyx_f_4lxml_5etree__tostring(((struct LxmlElementTree *)__pyx_v_element_or_tree)->_context_node, __pyx_v_4lxml_5etree__unicode, __pyx_v_method, 0, 1, __pyx_t_2, __pyx_t_1, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49447     __Pyx_GOTREF(__pyx_t_3);
49448     __pyx_r = __pyx_t_3;
49449     __pyx_t_3 = 0;
49450     goto __pyx_L0;
49451     goto __pyx_L6;
49452   }
49453   /*else*/ {
49454
49455     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2678
49456  *     else:
49457  *         raise TypeError, u"Type '%s' cannot be serialized." % \
49458  *             type(element_or_tree)             # <<<<<<<<<<<<<<
49459  * 
49460  * def parse(source, _BaseParser parser=None, *, base_url=None):
49461  */
49462     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49463     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
49464     __Pyx_INCREF(__pyx_v_element_or_tree);
49465     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_element_or_tree);
49466     __Pyx_GIVEREF(__pyx_v_element_or_tree);
49467     __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)&PyType_Type)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49468     __Pyx_GOTREF(__pyx_t_4);
49469     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
49470     __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_388), __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49471     __Pyx_GOTREF(__pyx_t_3);
49472     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
49473     __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_3, 0);
49474     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
49475     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49476   }
49477   __pyx_L6:;
49478
49479   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
49480   goto __pyx_L0;
49481   __pyx_L1_error:;
49482   __Pyx_XDECREF(__pyx_t_3);
49483   __Pyx_XDECREF(__pyx_t_4);
49484   __Pyx_AddTraceback("lxml.etree.tounicode");
49485   __pyx_r = NULL;
49486   __pyx_L0:;
49487   __Pyx_XGIVEREF(__pyx_r);
49488   __Pyx_FinishRefcountContext();
49489   return __pyx_r;
49490 }
49491
49492 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2680
49493  *             type(element_or_tree)
49494  * 
49495  * def parse(source, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<<
49496  *     u"""parse(source, parser=None, base_url=None)
49497  * 
49498  */
49499
49500 static PyObject *__pyx_pf_4lxml_5etree_parse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
49501 static char __pyx_doc_4lxml_5etree_parse[] = "parse(source, parser=None, base_url=None)\n\n    Return an ElementTree object loaded with source elements.  If no parser\n    is provided as second argument, the default parser is used.\n\n    The ``base_url`` keyword allows setting a URL for the document\n    when parsing from a file-like object.  This is needed when looking\n    up external entities (DTD, XInclude, ...) with relative paths.\n    ";
49502 static PyObject *__pyx_pf_4lxml_5etree_parse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
49503   PyObject *__pyx_v_source = 0;
49504   struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser = 0;
49505   PyObject *__pyx_v_base_url = 0;
49506   struct LxmlDocument *__pyx_v_doc;
49507   PyObject *__pyx_v_result_container;
49508   PyObject *__pyx_r = NULL;
49509   PyObject *__pyx_1 = 0;
49510   int __pyx_2;
49511   PyObject *__pyx_3 = 0;
49512   PyObject *__pyx_4 = 0;
49513   PyObject *__pyx_t_1 = NULL;
49514   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_source,&__pyx_kp_parser,&__pyx_kp_base_url,0};
49515   __Pyx_SetupRefcountContext("parse");
49516   __pyx_self = __pyx_self;
49517   if (unlikely(__pyx_kwds)) {
49518     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
49519     PyObject* values[3] = {0,0,0};
49520     values[1] = (PyObject*)((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None);
49521     values[2] = Py_None;
49522     switch (PyTuple_GET_SIZE(__pyx_args)) {
49523       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
49524       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
49525       case  0: break;
49526       default: goto __pyx_L5_argtuple_error;
49527     }
49528     switch (PyTuple_GET_SIZE(__pyx_args)) {
49529       case  0:
49530       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_source);
49531       if (likely(values[0])) kw_args--;
49532       else goto __pyx_L5_argtuple_error;
49533       case  1:
49534       if (kw_args > 0) {
49535         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_parser);
49536         if (unlikely(value)) { values[1] = value; kw_args--; }
49537       }
49538     }
49539     while (kw_args > 0) {
49540       PyObject* value;
49541       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_base_url);
49542       if (value) { values[2] = value; if (!(--kw_args)) break; }
49543       break;
49544     }
49545     if (unlikely(kw_args > 0)) {
49546       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "parse") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2680; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
49547     }
49548     __pyx_v_source = values[0];
49549     __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)values[1]);
49550     __pyx_v_base_url = values[2];
49551   } else {
49552     __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None);
49553     __pyx_v_base_url = Py_None;
49554     switch (PyTuple_GET_SIZE(__pyx_args)) {
49555       case  2: __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)PyTuple_GET_ITEM(__pyx_args, 1));
49556       case  1: __pyx_v_source = PyTuple_GET_ITEM(__pyx_args, 0);
49557       break;
49558       default: goto __pyx_L5_argtuple_error;
49559     }
49560   }
49561   goto __pyx_L4_argument_unpacking_done;
49562   __pyx_L5_argtuple_error:;
49563   __Pyx_RaiseArgtupleInvalid("parse", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2680; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
49564   __pyx_L3_error:;
49565   __Pyx_AddTraceback("lxml.etree.parse");
49566   return NULL;
49567   __pyx_L4_argument_unpacking_done:;
49568   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
49569   __pyx_v_result_container = Py_None; __Pyx_INCREF(Py_None);
49570   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49571
49572   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2691
49573  *     """
49574  *     cdef _Document doc
49575  *     try:             # <<<<<<<<<<<<<<
49576  *         doc = _parseDocument(source, parser, base_url)
49577  *         return _elementTreeFactory(doc, None)
49578  */
49579   {
49580     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
49581     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
49582     __Pyx_XGOTREF(__pyx_save_exc_type);
49583     __Pyx_XGOTREF(__pyx_save_exc_value);
49584     __Pyx_XGOTREF(__pyx_save_exc_tb);
49585     /*try:*/ {
49586
49587       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2692
49588  *     cdef _Document doc
49589  *     try:
49590  *         doc = _parseDocument(source, parser, base_url)             # <<<<<<<<<<<<<<
49591  *         return _elementTreeFactory(doc, None)
49592  *     except _TargetParserResult, result_container:
49593  */
49594       __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__parseDocument(__pyx_v_source, __pyx_v_parser, __pyx_v_base_url)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2692; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
49595       __Pyx_GOTREF(__pyx_t_1);
49596       __Pyx_DECREF(((PyObject *)__pyx_v_doc));
49597       __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_1);
49598       __pyx_t_1 = 0;
49599
49600       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2693
49601  *     try:
49602  *         doc = _parseDocument(source, parser, base_url)
49603  *         return _elementTreeFactory(doc, None)             # <<<<<<<<<<<<<<
49604  *     except _TargetParserResult, result_container:
49605  *         return result_container.result
49606  */
49607       __Pyx_XDECREF(__pyx_r);
49608       __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(__pyx_v_doc, ((struct LxmlElement *)Py_None))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2693; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
49609       __Pyx_GOTREF(__pyx_t_1);
49610       __pyx_r = __pyx_t_1;
49611       __pyx_t_1 = 0;
49612       goto __pyx_L10_try_return;
49613     }
49614     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
49615     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
49616     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
49617     goto __pyx_L13_try_end;
49618     __pyx_L10_try_return:;
49619     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
49620     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
49621     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
49622     goto __pyx_L0;
49623     __pyx_L6_error:;
49624     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
49625
49626     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2694
49627  *         doc = _parseDocument(source, parser, base_url)
49628  *         return _elementTreeFactory(doc, None)
49629  *     except _TargetParserResult, result_container:             # <<<<<<<<<<<<<<
49630  *         return result_container.result
49631  * 
49632  */
49633     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__TargetParserResult); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2694; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
49634     __Pyx_GOTREF(__pyx_1);
49635     __pyx_2 = PyErr_ExceptionMatches(__pyx_1);
49636     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
49637     if (__pyx_2) {
49638       __Pyx_AddTraceback("lxml.etree.parse");
49639       if (__Pyx_GetException(&__pyx_1, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2694; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
49640       __Pyx_GOTREF(__pyx_1);
49641       __Pyx_GOTREF(__pyx_3);
49642       __Pyx_GOTREF(__pyx_4);
49643       __Pyx_INCREF(__pyx_3);
49644       __Pyx_DECREF(__pyx_v_result_container);
49645       __pyx_v_result_container = __pyx_3;
49646
49647       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2695
49648  *         return _elementTreeFactory(doc, None)
49649  *     except _TargetParserResult, result_container:
49650  *         return result_container.result             # <<<<<<<<<<<<<<
49651  * 
49652  * 
49653  */
49654       __Pyx_XDECREF(__pyx_r);
49655       __pyx_t_1 = PyObject_GetAttr(__pyx_v_result_container, __pyx_kp_result); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2695; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
49656       __Pyx_GOTREF(__pyx_t_1);
49657       __pyx_r = __pyx_t_1;
49658       __pyx_t_1 = 0;
49659       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
49660       __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
49661       __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
49662       goto __pyx_L9_except_return;
49663       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
49664       __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
49665       __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
49666       goto __pyx_L7_exception_handled;
49667     }
49668     __pyx_L8_except_error:;
49669     __Pyx_XDECREF(__pyx_save_exc_type);
49670     __Pyx_XDECREF(__pyx_save_exc_value);
49671     __Pyx_XDECREF(__pyx_save_exc_tb);
49672     goto __pyx_L1_error;
49673     __pyx_L9_except_return:;
49674     __Pyx_XGIVEREF(__pyx_save_exc_type);
49675     __Pyx_XGIVEREF(__pyx_save_exc_value);
49676     __Pyx_XGIVEREF(__pyx_save_exc_tb);
49677     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
49678     goto __pyx_L0;
49679     __pyx_L7_exception_handled:;
49680     __Pyx_XGIVEREF(__pyx_save_exc_type);
49681     __Pyx_XGIVEREF(__pyx_save_exc_value);
49682     __Pyx_XGIVEREF(__pyx_save_exc_tb);
49683     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
49684     __pyx_L13_try_end:;
49685   }
49686
49687   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
49688   goto __pyx_L0;
49689   __pyx_L1_error:;
49690   __Pyx_XDECREF(__pyx_1);
49691   __Pyx_XDECREF(__pyx_3);
49692   __Pyx_XDECREF(__pyx_4);
49693   __Pyx_XDECREF(__pyx_t_1);
49694   __Pyx_AddTraceback("lxml.etree.parse");
49695   __pyx_r = NULL;
49696   __pyx_L0:;
49697   __Pyx_DECREF((PyObject *)__pyx_v_doc);
49698   __Pyx_DECREF(__pyx_v_result_container);
49699   __Pyx_XGIVEREF(__pyx_r);
49700   __Pyx_FinishRefcountContext();
49701   return __pyx_r;
49702 }
49703
49704 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":10
49705  *     cdef list _dependent_proxies
49706  * 
49707  *     cdef int _assertNode(self) except -1:             # <<<<<<<<<<<<<<
49708  *         u"""This is our way of saying: this proxy is invalid!
49709  *         """
49710  */
49711
49712 static  int __pyx_f_4lxml_5etree_21_ReadOnlyElementProxy__assertNode(struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *__pyx_v_self) {
49713   int __pyx_r;
49714   __Pyx_SetupRefcountContext("_assertNode");
49715
49716   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":13
49717  *         u"""This is our way of saying: this proxy is invalid!
49718  *         """
49719  *         assert self._c_node is not NULL, u"Proxy invalidated!"             # <<<<<<<<<<<<<<
49720  *         return 0
49721  * 
49722  */
49723   #ifndef PYREX_WITHOUT_ASSERTIONS
49724   if (unlikely(!(__pyx_v_self->_c_node != NULL))) {
49725     PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_389));
49726     {__pyx_filename = __pyx_f[8]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49727   }
49728   #endif
49729
49730   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":14
49731  *         """
49732  *         assert self._c_node is not NULL, u"Proxy invalidated!"
49733  *         return 0             # <<<<<<<<<<<<<<
49734  * 
49735  *     cdef void free_after_use(self):
49736  */
49737   __pyx_r = 0;
49738   goto __pyx_L0;
49739
49740   __pyx_r = 0;
49741   goto __pyx_L0;
49742   __pyx_L1_error:;
49743   __Pyx_AddTraceback("lxml.etree._ReadOnlyElementProxy._assertNode");
49744   __pyx_r = -1;
49745   __pyx_L0:;
49746   __Pyx_FinishRefcountContext();
49747   return __pyx_r;
49748 }
49749
49750 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":16
49751  *         return 0
49752  * 
49753  *     cdef void free_after_use(self):             # <<<<<<<<<<<<<<
49754  *         u"""Should the xmlNode* be freed when releasing the proxy?
49755  *         """
49756  */
49757
49758 static  void __pyx_f_4lxml_5etree_21_ReadOnlyElementProxy_free_after_use(struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *__pyx_v_self) {
49759   __Pyx_SetupRefcountContext("free_after_use");
49760
49761   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":19
49762  *         u"""Should the xmlNode* be freed when releasing the proxy?
49763  *         """
49764  *         self._free_after_use = 1             # <<<<<<<<<<<<<<
49765  * 
49766  *     property tag:
49767  */
49768   __pyx_v_self->_free_after_use = 1;
49769
49770   __Pyx_FinishRefcountContext();
49771 }
49772
49773 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":24
49774  *         u"""Element tag
49775  *         """
49776  *         def __get__(self):             # <<<<<<<<<<<<<<
49777  *             self._assertNode()
49778  *             return _namespacedName(self._c_node)
49779  */
49780
49781 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_3tag___get__(PyObject *__pyx_v_self); /*proto*/
49782 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_3tag___get__(PyObject *__pyx_v_self) {
49783   PyObject *__pyx_r = NULL;
49784   int __pyx_t_1;
49785   PyObject *__pyx_t_2 = NULL;
49786   __Pyx_SetupRefcountContext("__get__");
49787
49788   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":25
49789  *         """
49790  *         def __get__(self):
49791  *             self._assertNode()             # <<<<<<<<<<<<<<
49792  *             return _namespacedName(self._c_node)
49793  * 
49794  */
49795   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->__pyx_vtab)->_assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49796
49797   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":26
49798  *         def __get__(self):
49799  *             self._assertNode()
49800  *             return _namespacedName(self._c_node)             # <<<<<<<<<<<<<<
49801  * 
49802  *     property text:
49803  */
49804   __Pyx_XDECREF(__pyx_r);
49805   __pyx_t_2 = __pyx_f_4lxml_5etree__namespacedName(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_c_node); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49806   __Pyx_GOTREF(__pyx_t_2);
49807   __pyx_r = __pyx_t_2;
49808   __pyx_t_2 = 0;
49809   goto __pyx_L0;
49810
49811   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
49812   goto __pyx_L0;
49813   __pyx_L1_error:;
49814   __Pyx_XDECREF(__pyx_t_2);
49815   __Pyx_AddTraceback("lxml.etree._ReadOnlyElementProxy.tag.__get__");
49816   __pyx_r = NULL;
49817   __pyx_L0:;
49818   __Pyx_XGIVEREF(__pyx_r);
49819   __Pyx_FinishRefcountContext();
49820   return __pyx_r;
49821 }
49822
49823 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":32
49824  *         the value None, if there was no text.
49825  *         """
49826  *         def __get__(self):             # <<<<<<<<<<<<<<
49827  *             self._assertNode()
49828  *             return _collectText(self._c_node.children)
49829  */
49830
49831 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_4text___get__(PyObject *__pyx_v_self); /*proto*/
49832 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_4text___get__(PyObject *__pyx_v_self) {
49833   PyObject *__pyx_r = NULL;
49834   int __pyx_t_1;
49835   PyObject *__pyx_t_2 = NULL;
49836   __Pyx_SetupRefcountContext("__get__");
49837
49838   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":33
49839  *         """
49840  *         def __get__(self):
49841  *             self._assertNode()             # <<<<<<<<<<<<<<
49842  *             return _collectText(self._c_node.children)
49843  * 
49844  */
49845   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->__pyx_vtab)->_assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49846
49847   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":34
49848  *         def __get__(self):
49849  *             self._assertNode()
49850  *             return _collectText(self._c_node.children)             # <<<<<<<<<<<<<<
49851  * 
49852  *     property tail:
49853  */
49854   __Pyx_XDECREF(__pyx_r);
49855   __pyx_t_2 = __pyx_f_4lxml_5etree__collectText(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_c_node->children); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49856   __Pyx_GOTREF(__pyx_t_2);
49857   __pyx_r = __pyx_t_2;
49858   __pyx_t_2 = 0;
49859   goto __pyx_L0;
49860
49861   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
49862   goto __pyx_L0;
49863   __pyx_L1_error:;
49864   __Pyx_XDECREF(__pyx_t_2);
49865   __Pyx_AddTraceback("lxml.etree._ReadOnlyElementProxy.text.__get__");
49866   __pyx_r = NULL;
49867   __pyx_L0:;
49868   __Pyx_XGIVEREF(__pyx_r);
49869   __Pyx_FinishRefcountContext();
49870   return __pyx_r;
49871 }
49872
49873 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":41
49874  *         there was no text.
49875  *         """
49876  *         def __get__(self):             # <<<<<<<<<<<<<<
49877  *             self._assertNode()
49878  *             return _collectText(self._c_node.next)
49879  */
49880
49881 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_4tail___get__(PyObject *__pyx_v_self); /*proto*/
49882 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_4tail___get__(PyObject *__pyx_v_self) {
49883   PyObject *__pyx_r = NULL;
49884   int __pyx_t_1;
49885   PyObject *__pyx_t_2 = NULL;
49886   __Pyx_SetupRefcountContext("__get__");
49887
49888   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":42
49889  *         """
49890  *         def __get__(self):
49891  *             self._assertNode()             # <<<<<<<<<<<<<<
49892  *             return _collectText(self._c_node.next)
49893  * 
49894  */
49895   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->__pyx_vtab)->_assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49896
49897   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":43
49898  *         def __get__(self):
49899  *             self._assertNode()
49900  *             return _collectText(self._c_node.next)             # <<<<<<<<<<<<<<
49901  * 
49902  *     property attrib:
49903  */
49904   __Pyx_XDECREF(__pyx_r);
49905   __pyx_t_2 = __pyx_f_4lxml_5etree__collectText(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_c_node->next); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49906   __Pyx_GOTREF(__pyx_t_2);
49907   __pyx_r = __pyx_t_2;
49908   __pyx_t_2 = 0;
49909   goto __pyx_L0;
49910
49911   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
49912   goto __pyx_L0;
49913   __pyx_L1_error:;
49914   __Pyx_XDECREF(__pyx_t_2);
49915   __Pyx_AddTraceback("lxml.etree._ReadOnlyElementProxy.tail.__get__");
49916   __pyx_r = NULL;
49917   __pyx_L0:;
49918   __Pyx_XGIVEREF(__pyx_r);
49919   __Pyx_FinishRefcountContext();
49920   return __pyx_r;
49921 }
49922
49923 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":46
49924  * 
49925  *     property attrib:
49926  *         def __get__(self):             # <<<<<<<<<<<<<<
49927  *             self._assertNode()
49928  *             return dict(_collectAttributes(self._c_node, 3))
49929  */
49930
49931 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_6attrib___get__(PyObject *__pyx_v_self); /*proto*/
49932 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_6attrib___get__(PyObject *__pyx_v_self) {
49933   PyObject *__pyx_r = NULL;
49934   int __pyx_t_1;
49935   PyObject *__pyx_t_2 = NULL;
49936   PyObject *__pyx_t_3 = NULL;
49937   __Pyx_SetupRefcountContext("__get__");
49938
49939   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":47
49940  *     property attrib:
49941  *         def __get__(self):
49942  *             self._assertNode()             # <<<<<<<<<<<<<<
49943  *             return dict(_collectAttributes(self._c_node, 3))
49944  * 
49945  */
49946   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->__pyx_vtab)->_assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49947
49948   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":48
49949  *         def __get__(self):
49950  *             self._assertNode()
49951  *             return dict(_collectAttributes(self._c_node, 3))             # <<<<<<<<<<<<<<
49952  * 
49953  *     property prefix:
49954  */
49955   __Pyx_XDECREF(__pyx_r);
49956   __pyx_t_2 = __pyx_f_4lxml_5etree__collectAttributes(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_c_node, 3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49957   __Pyx_GOTREF(__pyx_t_2);
49958   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49959   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
49960   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
49961   __Pyx_GIVEREF(__pyx_t_2);
49962   __pyx_t_2 = 0;
49963   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyDict_Type)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49964   __Pyx_GOTREF(__pyx_t_2);
49965   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
49966   __pyx_r = __pyx_t_2;
49967   __pyx_t_2 = 0;
49968   goto __pyx_L0;
49969
49970   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
49971   goto __pyx_L0;
49972   __pyx_L1_error:;
49973   __Pyx_XDECREF(__pyx_t_2);
49974   __Pyx_XDECREF(__pyx_t_3);
49975   __Pyx_AddTraceback("lxml.etree._ReadOnlyElementProxy.attrib.__get__");
49976   __pyx_r = NULL;
49977   __pyx_L0:;
49978   __Pyx_XGIVEREF(__pyx_r);
49979   __Pyx_FinishRefcountContext();
49980   return __pyx_r;
49981 }
49982
49983 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":53
49984  *         u"""Namespace prefix or None.
49985  *         """
49986  *         def __get__(self):             # <<<<<<<<<<<<<<
49987  *             self._assertNode()
49988  *             if self._c_node.ns is not NULL:
49989  */
49990
49991 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_6prefix___get__(PyObject *__pyx_v_self); /*proto*/
49992 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_6prefix___get__(PyObject *__pyx_v_self) {
49993   PyObject *__pyx_r = NULL;
49994   int __pyx_t_1;
49995   int __pyx_t_2;
49996   PyObject *__pyx_t_3 = NULL;
49997   __Pyx_SetupRefcountContext("__get__");
49998
49999   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":54
50000  *         """
50001  *         def __get__(self):
50002  *             self._assertNode()             # <<<<<<<<<<<<<<
50003  *             if self._c_node.ns is not NULL:
50004  *                 if self._c_node.ns.prefix is not NULL:
50005  */
50006   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->__pyx_vtab)->_assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50007
50008   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":55
50009  *         def __get__(self):
50010  *             self._assertNode()
50011  *             if self._c_node.ns is not NULL:             # <<<<<<<<<<<<<<
50012  *                 if self._c_node.ns.prefix is not NULL:
50013  *                     return funicode(self._c_node.ns.prefix)
50014  */
50015   __pyx_t_2 = (((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_c_node->ns != NULL);
50016   if (__pyx_t_2) {
50017
50018     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":56
50019  *             self._assertNode()
50020  *             if self._c_node.ns is not NULL:
50021  *                 if self._c_node.ns.prefix is not NULL:             # <<<<<<<<<<<<<<
50022  *                     return funicode(self._c_node.ns.prefix)
50023  *             return None
50024  */
50025     __pyx_t_2 = (((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_c_node->ns->prefix != NULL);
50026     if (__pyx_t_2) {
50027
50028       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":57
50029  *             if self._c_node.ns is not NULL:
50030  *                 if self._c_node.ns.prefix is not NULL:
50031  *                     return funicode(self._c_node.ns.prefix)             # <<<<<<<<<<<<<<
50032  *             return None
50033  * 
50034  */
50035       __Pyx_XDECREF(__pyx_r);
50036       __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_c_node->ns->prefix); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50037       __Pyx_GOTREF(__pyx_t_3);
50038       __pyx_r = __pyx_t_3;
50039       __pyx_t_3 = 0;
50040       goto __pyx_L0;
50041       goto __pyx_L6;
50042     }
50043     __pyx_L6:;
50044     goto __pyx_L5;
50045   }
50046   __pyx_L5:;
50047
50048   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":58
50049  *                 if self._c_node.ns.prefix is not NULL:
50050  *                     return funicode(self._c_node.ns.prefix)
50051  *             return None             # <<<<<<<<<<<<<<
50052  * 
50053  *     property sourceline:
50054  */
50055   __Pyx_XDECREF(__pyx_r);
50056   __Pyx_INCREF(Py_None);
50057   __pyx_r = Py_None;
50058   goto __pyx_L0;
50059
50060   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
50061   goto __pyx_L0;
50062   __pyx_L1_error:;
50063   __Pyx_XDECREF(__pyx_t_3);
50064   __Pyx_AddTraceback("lxml.etree._ReadOnlyElementProxy.prefix.__get__");
50065   __pyx_r = NULL;
50066   __pyx_L0:;
50067   __Pyx_XGIVEREF(__pyx_r);
50068   __Pyx_FinishRefcountContext();
50069   return __pyx_r;
50070 }
50071
50072 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":63
50073  *         u"""Original line number as found by the parser or None if unknown.
50074  *         """
50075  *         def __get__(self):             # <<<<<<<<<<<<<<
50076  *             cdef long line
50077  *             self._assertNode()
50078  */
50079
50080 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_10sourceline___get__(PyObject *__pyx_v_self); /*proto*/
50081 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_10sourceline___get__(PyObject *__pyx_v_self) {
50082   long __pyx_v_line;
50083   PyObject *__pyx_r = NULL;
50084   int __pyx_t_1;
50085   int __pyx_t_2;
50086   PyObject *__pyx_t_3 = NULL;
50087   __Pyx_SetupRefcountContext("__get__");
50088
50089   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":65
50090  *         def __get__(self):
50091  *             cdef long line
50092  *             self._assertNode()             # <<<<<<<<<<<<<<
50093  *             line = tree.xmlGetLineNo(self._c_node)
50094  *             if line > 0:
50095  */
50096   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->__pyx_vtab)->_assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50097
50098   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":66
50099  *             cdef long line
50100  *             self._assertNode()
50101  *             line = tree.xmlGetLineNo(self._c_node)             # <<<<<<<<<<<<<<
50102  *             if line > 0:
50103  *                 return line
50104  */
50105   __pyx_v_line = xmlGetLineNo(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_c_node);
50106
50107   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":67
50108  *             self._assertNode()
50109  *             line = tree.xmlGetLineNo(self._c_node)
50110  *             if line > 0:             # <<<<<<<<<<<<<<
50111  *                 return line
50112  *             else:
50113  */
50114   __pyx_t_2 = (__pyx_v_line > 0);
50115   if (__pyx_t_2) {
50116
50117     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":68
50118  *             line = tree.xmlGetLineNo(self._c_node)
50119  *             if line > 0:
50120  *                 return line             # <<<<<<<<<<<<<<
50121  *             else:
50122  *                 return None
50123  */
50124     __Pyx_XDECREF(__pyx_r);
50125     __pyx_t_3 = PyInt_FromLong(__pyx_v_line); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50126     __Pyx_GOTREF(__pyx_t_3);
50127     __pyx_r = __pyx_t_3;
50128     __pyx_t_3 = 0;
50129     goto __pyx_L0;
50130     goto __pyx_L5;
50131   }
50132   /*else*/ {
50133
50134     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":70
50135  *                 return line
50136  *             else:
50137  *                 return None             # <<<<<<<<<<<<<<
50138  * 
50139  *     def __repr__(self):
50140  */
50141     __Pyx_XDECREF(__pyx_r);
50142     __Pyx_INCREF(Py_None);
50143     __pyx_r = Py_None;
50144     goto __pyx_L0;
50145   }
50146   __pyx_L5:;
50147
50148   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
50149   goto __pyx_L0;
50150   __pyx_L1_error:;
50151   __Pyx_XDECREF(__pyx_t_3);
50152   __Pyx_AddTraceback("lxml.etree._ReadOnlyElementProxy.sourceline.__get__");
50153   __pyx_r = NULL;
50154   __pyx_L0:;
50155   __Pyx_XGIVEREF(__pyx_r);
50156   __Pyx_FinishRefcountContext();
50157   return __pyx_r;
50158 }
50159
50160 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":72
50161  *                 return None
50162  * 
50163  *     def __repr__(self):             # <<<<<<<<<<<<<<
50164  *         return u"<Element %s at %x>" % (self.tag, id(self))
50165  * 
50166  */
50167
50168 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy___repr__(PyObject *__pyx_v_self); /*proto*/
50169 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy___repr__(PyObject *__pyx_v_self) {
50170   PyObject *__pyx_r = NULL;
50171   PyObject *__pyx_t_1 = NULL;
50172   PyObject *__pyx_t_2 = NULL;
50173   PyObject *__pyx_t_3 = NULL;
50174   __Pyx_SetupRefcountContext("__repr__");
50175
50176   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":73
50177  * 
50178  *     def __repr__(self):
50179  *         return u"<Element %s at %x>" % (self.tag, id(self))             # <<<<<<<<<<<<<<
50180  * 
50181  *     def __getitem__(self, x):
50182  */
50183   __Pyx_XDECREF(__pyx_r);
50184   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_tag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50185   __Pyx_GOTREF(__pyx_t_1);
50186   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50187   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
50188   __Pyx_INCREF(__pyx_v_self);
50189   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
50190   __Pyx_GIVEREF(__pyx_v_self);
50191   __pyx_t_3 = PyObject_Call(__pyx_builtin_id, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50192   __Pyx_GOTREF(__pyx_t_3);
50193   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
50194   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50195   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
50196   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
50197   __Pyx_GIVEREF(__pyx_t_1);
50198   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
50199   __Pyx_GIVEREF(__pyx_t_3);
50200   __pyx_t_1 = 0;
50201   __pyx_t_3 = 0;
50202   __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_390), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50203   __Pyx_GOTREF(__pyx_t_3);
50204   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
50205   __pyx_r = __pyx_t_3;
50206   __pyx_t_3 = 0;
50207   goto __pyx_L0;
50208
50209   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
50210   goto __pyx_L0;
50211   __pyx_L1_error:;
50212   __Pyx_XDECREF(__pyx_t_1);
50213   __Pyx_XDECREF(__pyx_t_2);
50214   __Pyx_XDECREF(__pyx_t_3);
50215   __Pyx_AddTraceback("lxml.etree._ReadOnlyElementProxy.__repr__");
50216   __pyx_r = NULL;
50217   __pyx_L0:;
50218   __Pyx_XGIVEREF(__pyx_r);
50219   __Pyx_FinishRefcountContext();
50220   return __pyx_r;
50221 }
50222
50223 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":75
50224  *         return u"<Element %s at %x>" % (self.tag, id(self))
50225  * 
50226  *     def __getitem__(self, x):             # <<<<<<<<<<<<<<
50227  *         u"""Returns the subelement at the given position or the requested
50228  *         slice.
50229  */
50230
50231 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
50232 static char __pyx_doc_4lxml_5etree_21_ReadOnlyElementProxy___getitem__[] = "Returns the subelement at the given position or the requested\n        slice.\n        ";
50233 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
50234   xmlNode *__pyx_v_c_node;
50235   Py_ssize_t __pyx_v_step;
50236   Py_ssize_t __pyx_v_slicelength;
50237   Py_ssize_t __pyx_v_c;
50238   Py_ssize_t __pyx_v_i;
50239   _node_to_node_function __pyx_v_next_element;
50240   PyObject *__pyx_v_result;
50241   PyObject *__pyx_r = NULL;
50242   int __pyx_t_1;
50243   PyObject *__pyx_t_2 = NULL;
50244   int __pyx_t_3;
50245   PyObject *__pyx_t_4 = NULL;
50246   Py_ssize_t __pyx_t_5;
50247   __Pyx_SetupRefcountContext("__getitem__");
50248   __pyx_v_result = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
50249
50250   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":84
50251  *         cdef _node_to_node_function next_element
50252  *         cdef list result
50253  *         if python.PySlice_Check(x):             # <<<<<<<<<<<<<<
50254  *             # slicing
50255  *             if _isFullSlice(<python.slice>x):
50256  */
50257   __pyx_t_1 = PySlice_Check(__pyx_v_x);
50258   if (__pyx_t_1) {
50259
50260     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":86
50261  *         if python.PySlice_Check(x):
50262  *             # slicing
50263  *             if _isFullSlice(<python.slice>x):             # <<<<<<<<<<<<<<
50264  *                 return _collectChildren(self)
50265  *             _findChildSlice(x, self._c_node, &c_node, &step, &slicelength)
50266  */
50267     __pyx_t_1 = __pyx_f_4lxml_5etree__isFullSlice(((PySliceObject *)__pyx_v_x));
50268     if (__pyx_t_1) {
50269
50270       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":87
50271  *             # slicing
50272  *             if _isFullSlice(<python.slice>x):
50273  *                 return _collectChildren(self)             # <<<<<<<<<<<<<<
50274  *             _findChildSlice(x, self._c_node, &c_node, &step, &slicelength)
50275  *             if c_node is NULL:
50276  */
50277       __Pyx_XDECREF(__pyx_r);
50278       if (!(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50279       __pyx_t_2 = __pyx_f_4lxml_5etree__collectChildren(((struct LxmlElement *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50280       __Pyx_GOTREF(__pyx_t_2);
50281       __pyx_r = __pyx_t_2;
50282       __pyx_t_2 = 0;
50283       goto __pyx_L0;
50284       goto __pyx_L6;
50285     }
50286     __pyx_L6:;
50287
50288     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":88
50289  *             if _isFullSlice(<python.slice>x):
50290  *                 return _collectChildren(self)
50291  *             _findChildSlice(x, self._c_node, &c_node, &step, &slicelength)             # <<<<<<<<<<<<<<
50292  *             if c_node is NULL:
50293  *                 return []
50294  */
50295     if (!(__Pyx_TypeTest(__pyx_v_x, __pyx_ptype_4lxml_6python_slice))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50296     __pyx_t_3 = __pyx_f_4lxml_5etree__findChildSlice(((PySliceObject *)__pyx_v_x), ((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_c_node, (&__pyx_v_c_node), (&__pyx_v_step), (&__pyx_v_slicelength)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50297
50298     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":89
50299  *                 return _collectChildren(self)
50300  *             _findChildSlice(x, self._c_node, &c_node, &step, &slicelength)
50301  *             if c_node is NULL:             # <<<<<<<<<<<<<<
50302  *                 return []
50303  *             if step > 0:
50304  */
50305     __pyx_t_1 = (__pyx_v_c_node == NULL);
50306     if (__pyx_t_1) {
50307
50308       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":90
50309  *             _findChildSlice(x, self._c_node, &c_node, &step, &slicelength)
50310  *             if c_node is NULL:
50311  *                 return []             # <<<<<<<<<<<<<<
50312  *             if step > 0:
50313  *                 next_element = _nextElement
50314  */
50315       __Pyx_XDECREF(__pyx_r);
50316       __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50317       __Pyx_GOTREF(((PyObject *)__pyx_t_2));
50318       __pyx_r = ((PyObject *)__pyx_t_2);
50319       __pyx_t_2 = 0;
50320       goto __pyx_L0;
50321       goto __pyx_L7;
50322     }
50323     __pyx_L7:;
50324
50325     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":91
50326  *             if c_node is NULL:
50327  *                 return []
50328  *             if step > 0:             # <<<<<<<<<<<<<<
50329  *                 next_element = _nextElement
50330  *             else:
50331  */
50332     __pyx_t_1 = (__pyx_v_step > 0);
50333     if (__pyx_t_1) {
50334
50335       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":92
50336  *                 return []
50337  *             if step > 0:
50338  *                 next_element = _nextElement             # <<<<<<<<<<<<<<
50339  *             else:
50340  *                 step = -step
50341  */
50342       __pyx_v_next_element = __pyx_f_4lxml_5etree__nextElement;
50343       goto __pyx_L8;
50344     }
50345     /*else*/ {
50346
50347       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":94
50348  *                 next_element = _nextElement
50349  *             else:
50350  *                 step = -step             # <<<<<<<<<<<<<<
50351  *                 next_element = _previousElement
50352  *             result = []
50353  */
50354       __pyx_v_step = (-__pyx_v_step);
50355
50356       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":95
50357  *             else:
50358  *                 step = -step
50359  *                 next_element = _previousElement             # <<<<<<<<<<<<<<
50360  *             result = []
50361  *             c = 0
50362  */
50363       __pyx_v_next_element = __pyx_f_4lxml_5etree__previousElement;
50364     }
50365     __pyx_L8:;
50366
50367     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":96
50368  *                 step = -step
50369  *                 next_element = _previousElement
50370  *             result = []             # <<<<<<<<<<<<<<
50371  *             c = 0
50372  *             while c_node is not NULL and c < slicelength:
50373  */
50374     __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50375     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
50376     __Pyx_DECREF(((PyObject *)__pyx_v_result));
50377     __pyx_v_result = __pyx_t_2;
50378     __pyx_t_2 = 0;
50379
50380     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":97
50381  *                 next_element = _previousElement
50382  *             result = []
50383  *             c = 0             # <<<<<<<<<<<<<<
50384  *             while c_node is not NULL and c < slicelength:
50385  *                 result.append(_newReadOnlyProxy(self._source_proxy, c_node))
50386  */
50387     __pyx_v_c = 0;
50388
50389     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":98
50390  *             result = []
50391  *             c = 0
50392  *             while c_node is not NULL and c < slicelength:             # <<<<<<<<<<<<<<
50393  *                 result.append(_newReadOnlyProxy(self._source_proxy, c_node))
50394  *                 result.append(_elementFactory(self._doc, c_node))
50395  */
50396     while (1) {
50397       if ((__pyx_v_c_node != NULL)) {
50398         __pyx_t_1 = (__pyx_v_c < __pyx_v_slicelength);
50399       } else {
50400         __pyx_t_1 = (__pyx_v_c_node != NULL);
50401       }
50402       if (!__pyx_t_1) break;
50403
50404       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":99
50405  *             c = 0
50406  *             while c_node is not NULL and c < slicelength:
50407  *                 result.append(_newReadOnlyProxy(self._source_proxy, c_node))             # <<<<<<<<<<<<<<
50408  *                 result.append(_elementFactory(self._doc, c_node))
50409  *                 c = c + 1
50410  */
50411       if (!(__Pyx_TypeTest(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_source_proxy, __pyx_ptype_4lxml_5etree__ReadOnlyElementProxy))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50412       __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__newReadOnlyProxy(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_source_proxy), __pyx_v_c_node)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50413       __Pyx_GOTREF(__pyx_t_2);
50414       __pyx_t_3 = PyList_Append(((PyObject *)__pyx_v_result), __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50415       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
50416
50417       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":100
50418  *             while c_node is not NULL and c < slicelength:
50419  *                 result.append(_newReadOnlyProxy(self._source_proxy, c_node))
50420  *                 result.append(_elementFactory(self._doc, c_node))             # <<<<<<<<<<<<<<
50421  *                 c = c + 1
50422  *                 for i from 0 <= i < step:
50423  */
50424       __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp__doc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50425       __Pyx_GOTREF(__pyx_t_2);
50426       if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__Document))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50427       __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_2), __pyx_v_c_node)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50428       __Pyx_GOTREF(__pyx_t_4);
50429       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
50430       __pyx_t_3 = PyList_Append(((PyObject *)__pyx_v_result), __pyx_t_4); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50431       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
50432
50433       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":101
50434  *                 result.append(_newReadOnlyProxy(self._source_proxy, c_node))
50435  *                 result.append(_elementFactory(self._doc, c_node))
50436  *                 c = c + 1             # <<<<<<<<<<<<<<
50437  *                 for i from 0 <= i < step:
50438  *                     c_node = next_element(c_node)
50439  */
50440       __pyx_v_c = (__pyx_v_c + 1);
50441
50442       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":102
50443  *                 result.append(_elementFactory(self._doc, c_node))
50444  *                 c = c + 1
50445  *                 for i from 0 <= i < step:             # <<<<<<<<<<<<<<
50446  *                     c_node = next_element(c_node)
50447  *             return result
50448  */
50449       __pyx_t_5 = __pyx_v_step;
50450       for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {
50451
50452         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":103
50453  *                 c = c + 1
50454  *                 for i from 0 <= i < step:
50455  *                     c_node = next_element(c_node)             # <<<<<<<<<<<<<<
50456  *             return result
50457  *         else:
50458  */
50459         __pyx_v_c_node = __pyx_v_next_element(__pyx_v_c_node);
50460       }
50461     }
50462
50463     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":104
50464  *                 for i from 0 <= i < step:
50465  *                     c_node = next_element(c_node)
50466  *             return result             # <<<<<<<<<<<<<<
50467  *         else:
50468  *             # indexing
50469  */
50470     __Pyx_XDECREF(__pyx_r);
50471     __Pyx_INCREF(((PyObject *)__pyx_v_result));
50472     __pyx_r = ((PyObject *)__pyx_v_result);
50473     goto __pyx_L0;
50474     goto __pyx_L5;
50475   }
50476   /*else*/ {
50477
50478     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":107
50479  *         else:
50480  *             # indexing
50481  *             c_node = _findChild(self._c_node, x)             # <<<<<<<<<<<<<<
50482  *             if c_node is NULL:
50483  *                 raise IndexError, u"list index out of range"
50484  */
50485     __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_x); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50486     __pyx_v_c_node = __pyx_f_4lxml_5etree__findChild(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_c_node, __pyx_t_5);
50487
50488     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":108
50489  *             # indexing
50490  *             c_node = _findChild(self._c_node, x)
50491  *             if c_node is NULL:             # <<<<<<<<<<<<<<
50492  *                 raise IndexError, u"list index out of range"
50493  *             return _newReadOnlyProxy(self._source_proxy, c_node)
50494  */
50495     __pyx_t_1 = (__pyx_v_c_node == NULL);
50496     if (__pyx_t_1) {
50497
50498       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":109
50499  *             c_node = _findChild(self._c_node, x)
50500  *             if c_node is NULL:
50501  *                 raise IndexError, u"list index out of range"             # <<<<<<<<<<<<<<
50502  *             return _newReadOnlyProxy(self._source_proxy, c_node)
50503  * 
50504  */
50505       __Pyx_Raise(__pyx_builtin_IndexError, ((PyObject *)__pyx_kp_391), 0);
50506       {__pyx_filename = __pyx_f[8]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50507       goto __pyx_L13;
50508     }
50509     __pyx_L13:;
50510
50511     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":110
50512  *             if c_node is NULL:
50513  *                 raise IndexError, u"list index out of range"
50514  *             return _newReadOnlyProxy(self._source_proxy, c_node)             # <<<<<<<<<<<<<<
50515  * 
50516  *     def __len__(self):
50517  */
50518     __Pyx_XDECREF(__pyx_r);
50519     if (!(__Pyx_TypeTest(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_source_proxy, __pyx_ptype_4lxml_5etree__ReadOnlyElementProxy))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50520     __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__newReadOnlyProxy(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_source_proxy), __pyx_v_c_node)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50521     __Pyx_GOTREF(__pyx_t_4);
50522     __pyx_r = __pyx_t_4;
50523     __pyx_t_4 = 0;
50524     goto __pyx_L0;
50525   }
50526   __pyx_L5:;
50527
50528   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
50529   goto __pyx_L0;
50530   __pyx_L1_error:;
50531   __Pyx_XDECREF(__pyx_t_2);
50532   __Pyx_XDECREF(__pyx_t_4);
50533   __Pyx_AddTraceback("lxml.etree._ReadOnlyElementProxy.__getitem__");
50534   __pyx_r = NULL;
50535   __pyx_L0:;
50536   __Pyx_DECREF(__pyx_v_result);
50537   __Pyx_XGIVEREF(__pyx_r);
50538   __Pyx_FinishRefcountContext();
50539   return __pyx_r;
50540 }
50541
50542 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":112
50543  *             return _newReadOnlyProxy(self._source_proxy, c_node)
50544  * 
50545  *     def __len__(self):             # <<<<<<<<<<<<<<
50546  *         u"""Returns the number of subelements.
50547  *         """
50548  */
50549
50550 static Py_ssize_t __pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy___len__(PyObject *__pyx_v_self); /*proto*/
50551 static char __pyx_doc_4lxml_5etree_21_ReadOnlyElementProxy___len__[] = "Returns the number of subelements.\n        ";
50552 static Py_ssize_t __pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy___len__(PyObject *__pyx_v_self) {
50553   Py_ssize_t __pyx_v_c;
50554   xmlNode *__pyx_v_c_node;
50555   Py_ssize_t __pyx_r;
50556   int __pyx_t_1;
50557   int __pyx_t_2;
50558   __Pyx_SetupRefcountContext("__len__");
50559
50560   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":117
50561  *         cdef Py_ssize_t c
50562  *         cdef xmlNode* c_node
50563  *         self._assertNode()             # <<<<<<<<<<<<<<
50564  *         c = 0
50565  *         c_node = self._c_node.children
50566  */
50567   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->__pyx_vtab)->_assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50568
50569   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":118
50570  *         cdef xmlNode* c_node
50571  *         self._assertNode()
50572  *         c = 0             # <<<<<<<<<<<<<<
50573  *         c_node = self._c_node.children
50574  *         while c_node is not NULL:
50575  */
50576   __pyx_v_c = 0;
50577
50578   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":119
50579  *         self._assertNode()
50580  *         c = 0
50581  *         c_node = self._c_node.children             # <<<<<<<<<<<<<<
50582  *         while c_node is not NULL:
50583  *             if tree._isElement(c_node):
50584  */
50585   __pyx_v_c_node = ((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_c_node->children;
50586
50587   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":120
50588  *         c = 0
50589  *         c_node = self._c_node.children
50590  *         while c_node is not NULL:             # <<<<<<<<<<<<<<
50591  *             if tree._isElement(c_node):
50592  *                 c = c + 1
50593  */
50594   while (1) {
50595     __pyx_t_2 = (__pyx_v_c_node != NULL);
50596     if (!__pyx_t_2) break;
50597
50598     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":121
50599  *         c_node = self._c_node.children
50600  *         while c_node is not NULL:
50601  *             if tree._isElement(c_node):             # <<<<<<<<<<<<<<
50602  *                 c = c + 1
50603  *             c_node = c_node.next
50604  */
50605     __pyx_t_2 = _isElement(__pyx_v_c_node);
50606     if (__pyx_t_2) {
50607
50608       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":122
50609  *         while c_node is not NULL:
50610  *             if tree._isElement(c_node):
50611  *                 c = c + 1             # <<<<<<<<<<<<<<
50612  *             c_node = c_node.next
50613  *         return c
50614  */
50615       __pyx_v_c = (__pyx_v_c + 1);
50616       goto __pyx_L7;
50617     }
50618     __pyx_L7:;
50619
50620     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":123
50621  *             if tree._isElement(c_node):
50622  *                 c = c + 1
50623  *             c_node = c_node.next             # <<<<<<<<<<<<<<
50624  *         return c
50625  * 
50626  */
50627     __pyx_v_c_node = __pyx_v_c_node->next;
50628   }
50629
50630   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":124
50631  *                 c = c + 1
50632  *             c_node = c_node.next
50633  *         return c             # <<<<<<<<<<<<<<
50634  * 
50635  *     def __nonzero__(self):
50636  */
50637   __pyx_r = __pyx_v_c;
50638   goto __pyx_L0;
50639
50640   __pyx_r = 0;
50641   goto __pyx_L0;
50642   __pyx_L1_error:;
50643   __Pyx_AddTraceback("lxml.etree._ReadOnlyElementProxy.__len__");
50644   __pyx_r = -1;
50645   __pyx_L0:;
50646   __Pyx_FinishRefcountContext();
50647   return __pyx_r;
50648 }
50649
50650 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":126
50651  *         return c
50652  * 
50653  *     def __nonzero__(self):             # <<<<<<<<<<<<<<
50654  *         cdef xmlNode* c_node
50655  *         self._assertNode()
50656  */
50657
50658 static int __pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy___nonzero__(PyObject *__pyx_v_self); /*proto*/
50659 static int __pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy___nonzero__(PyObject *__pyx_v_self) {
50660   xmlNode *__pyx_v_c_node;
50661   int __pyx_r;
50662   int __pyx_t_1;
50663   __Pyx_SetupRefcountContext("__nonzero__");
50664
50665   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":128
50666  *     def __nonzero__(self):
50667  *         cdef xmlNode* c_node
50668  *         self._assertNode()             # <<<<<<<<<<<<<<
50669  *         c_node = _findChildBackwards(self._c_node, 0)
50670  *         return c_node != NULL
50671  */
50672   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->__pyx_vtab)->_assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50673
50674   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":129
50675  *         cdef xmlNode* c_node
50676  *         self._assertNode()
50677  *         c_node = _findChildBackwards(self._c_node, 0)             # <<<<<<<<<<<<<<
50678  *         return c_node != NULL
50679  * 
50680  */
50681   __pyx_v_c_node = __pyx_f_4lxml_5etree__findChildBackwards(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_c_node, 0);
50682
50683   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":130
50684  *         self._assertNode()
50685  *         c_node = _findChildBackwards(self._c_node, 0)
50686  *         return c_node != NULL             # <<<<<<<<<<<<<<
50687  * 
50688  *     def __deepcopy__(self, memo):
50689  */
50690   __pyx_r = (__pyx_v_c_node != NULL);
50691   goto __pyx_L0;
50692
50693   __pyx_r = 0;
50694   goto __pyx_L0;
50695   __pyx_L1_error:;
50696   __Pyx_AddTraceback("lxml.etree._ReadOnlyElementProxy.__nonzero__");
50697   __pyx_r = -1;
50698   __pyx_L0:;
50699   __Pyx_FinishRefcountContext();
50700   return __pyx_r;
50701 }
50702
50703 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":132
50704  *         return c_node != NULL
50705  * 
50706  *     def __deepcopy__(self, memo):             # <<<<<<<<<<<<<<
50707  *         u"__deepcopy__(self, memo)"
50708  *         return self.__copy__()
50709  */
50710
50711 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy___deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo); /*proto*/
50712 static char __pyx_doc_4lxml_5etree_21_ReadOnlyElementProxy___deepcopy__[] = "__deepcopy__(self, memo)";
50713 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy___deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo) {
50714   PyObject *__pyx_r = NULL;
50715   PyObject *__pyx_t_1 = NULL;
50716   PyObject *__pyx_t_2 = NULL;
50717   __Pyx_SetupRefcountContext("__deepcopy__");
50718
50719   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":134
50720  *     def __deepcopy__(self, memo):
50721  *         u"__deepcopy__(self, memo)"
50722  *         return self.__copy__()             # <<<<<<<<<<<<<<
50723  * 
50724  *     def __copy__(self):
50725  */
50726   __Pyx_XDECREF(__pyx_r);
50727   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp___copy__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50728   __Pyx_GOTREF(__pyx_t_1);
50729   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50730   __Pyx_GOTREF(__pyx_t_2);
50731   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
50732   __pyx_r = __pyx_t_2;
50733   __pyx_t_2 = 0;
50734   goto __pyx_L0;
50735
50736   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
50737   goto __pyx_L0;
50738   __pyx_L1_error:;
50739   __Pyx_XDECREF(__pyx_t_1);
50740   __Pyx_XDECREF(__pyx_t_2);
50741   __Pyx_AddTraceback("lxml.etree._ReadOnlyElementProxy.__deepcopy__");
50742   __pyx_r = NULL;
50743   __pyx_L0:;
50744   __Pyx_XGIVEREF(__pyx_r);
50745   __Pyx_FinishRefcountContext();
50746   return __pyx_r;
50747 }
50748
50749 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":136
50750  *         return self.__copy__()
50751  * 
50752  *     def __copy__(self):             # <<<<<<<<<<<<<<
50753  *         u"__copy__(self)"
50754  *         cdef xmlDoc* c_doc
50755  */
50756
50757 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy___copy__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
50758 static char __pyx_doc_4lxml_5etree_21_ReadOnlyElementProxy___copy__[] = "__copy__(self)";
50759 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy___copy__(PyObject *__pyx_v_self, PyObject *unused) {
50760   xmlDoc *__pyx_v_c_doc;
50761   xmlNode *__pyx_v_c_node;
50762   struct LxmlDocument *__pyx_v_new_doc;
50763   PyObject *__pyx_v_root;
50764   PyObject *__pyx_r = NULL;
50765   xmlDoc *__pyx_t_1;
50766   PyObject *__pyx_t_2 = NULL;
50767   int __pyx_t_3;
50768   __Pyx_SetupRefcountContext("__copy__");
50769   __pyx_v_new_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
50770   __pyx_v_root = Py_None; __Pyx_INCREF(Py_None);
50771
50772   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":141
50773  *         cdef xmlNode* c_node
50774  *         cdef _Document new_doc
50775  *         c_doc = _copyDocRoot(self._c_node.doc, self._c_node) # recursive             # <<<<<<<<<<<<<<
50776  *         new_doc = _documentFactory(c_doc, None)
50777  *         root = new_doc.getroot()
50778  */
50779   __pyx_t_1 = __pyx_f_4lxml_5etree__copyDocRoot(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_c_node->doc, ((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_c_node); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50780   __pyx_v_c_doc = __pyx_t_1;
50781
50782   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":142
50783  *         cdef _Document new_doc
50784  *         c_doc = _copyDocRoot(self._c_node.doc, self._c_node) # recursive
50785  *         new_doc = _documentFactory(c_doc, None)             # <<<<<<<<<<<<<<
50786  *         root = new_doc.getroot()
50787  *         if root is not None:
50788  */
50789   __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50790   __Pyx_GOTREF(__pyx_t_2);
50791   __Pyx_DECREF(((PyObject *)__pyx_v_new_doc));
50792   __pyx_v_new_doc = ((struct LxmlDocument *)__pyx_t_2);
50793   __pyx_t_2 = 0;
50794
50795   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":143
50796  *         c_doc = _copyDocRoot(self._c_node.doc, self._c_node) # recursive
50797  *         new_doc = _documentFactory(c_doc, None)
50798  *         root = new_doc.getroot()             # <<<<<<<<<<<<<<
50799  *         if root is not None:
50800  *             return root
50801  */
50802   __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_new_doc->__pyx_vtab)->getroot(__pyx_v_new_doc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50803   __Pyx_GOTREF(__pyx_t_2);
50804   __Pyx_DECREF(__pyx_v_root);
50805   __pyx_v_root = __pyx_t_2;
50806   __pyx_t_2 = 0;
50807
50808   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":144
50809  *         new_doc = _documentFactory(c_doc, None)
50810  *         root = new_doc.getroot()
50811  *         if root is not None:             # <<<<<<<<<<<<<<
50812  *             return root
50813  *         # Comment/PI
50814  */
50815   __pyx_t_3 = (__pyx_v_root != Py_None);
50816   if (__pyx_t_3) {
50817
50818     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":145
50819  *         root = new_doc.getroot()
50820  *         if root is not None:
50821  *             return root             # <<<<<<<<<<<<<<
50822  *         # Comment/PI
50823  *         c_node = c_doc.children
50824  */
50825     __Pyx_XDECREF(__pyx_r);
50826     __Pyx_INCREF(__pyx_v_root);
50827     __pyx_r = __pyx_v_root;
50828     goto __pyx_L0;
50829     goto __pyx_L5;
50830   }
50831   __pyx_L5:;
50832
50833   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":147
50834  *             return root
50835  *         # Comment/PI
50836  *         c_node = c_doc.children             # <<<<<<<<<<<<<<
50837  *         while c_node is not NULL and c_node.type != self._c_node.type:
50838  *             c_node = c_node.next
50839  */
50840   __pyx_v_c_node = __pyx_v_c_doc->children;
50841
50842   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":148
50843  *         # Comment/PI
50844  *         c_node = c_doc.children
50845  *         while c_node is not NULL and c_node.type != self._c_node.type:             # <<<<<<<<<<<<<<
50846  *             c_node = c_node.next
50847  *         if c_node is NULL:
50848  */
50849   while (1) {
50850     if ((__pyx_v_c_node != NULL)) {
50851       __pyx_t_3 = (__pyx_v_c_node->type != ((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_c_node->type);
50852     } else {
50853       __pyx_t_3 = (__pyx_v_c_node != NULL);
50854     }
50855     if (!__pyx_t_3) break;
50856
50857     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":149
50858  *         c_node = c_doc.children
50859  *         while c_node is not NULL and c_node.type != self._c_node.type:
50860  *             c_node = c_node.next             # <<<<<<<<<<<<<<
50861  *         if c_node is NULL:
50862  *             return None
50863  */
50864     __pyx_v_c_node = __pyx_v_c_node->next;
50865   }
50866
50867   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":150
50868  *         while c_node is not NULL and c_node.type != self._c_node.type:
50869  *             c_node = c_node.next
50870  *         if c_node is NULL:             # <<<<<<<<<<<<<<
50871  *             return None
50872  *         return _elementFactory(new_doc, c_node)
50873  */
50874   __pyx_t_3 = (__pyx_v_c_node == NULL);
50875   if (__pyx_t_3) {
50876
50877     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":151
50878  *             c_node = c_node.next
50879  *         if c_node is NULL:
50880  *             return None             # <<<<<<<<<<<<<<
50881  *         return _elementFactory(new_doc, c_node)
50882  * 
50883  */
50884     __Pyx_XDECREF(__pyx_r);
50885     __Pyx_INCREF(Py_None);
50886     __pyx_r = Py_None;
50887     goto __pyx_L0;
50888     goto __pyx_L8;
50889   }
50890   __pyx_L8:;
50891
50892   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":152
50893  *         if c_node is NULL:
50894  *             return None
50895  *         return _elementFactory(new_doc, c_node)             # <<<<<<<<<<<<<<
50896  * 
50897  *     def __iter__(self):
50898  */
50899   __Pyx_XDECREF(__pyx_r);
50900   __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_new_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50901   __Pyx_GOTREF(__pyx_t_2);
50902   __pyx_r = __pyx_t_2;
50903   __pyx_t_2 = 0;
50904   goto __pyx_L0;
50905
50906   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
50907   goto __pyx_L0;
50908   __pyx_L1_error:;
50909   __Pyx_XDECREF(__pyx_t_2);
50910   __Pyx_AddTraceback("lxml.etree._ReadOnlyElementProxy.__copy__");
50911   __pyx_r = NULL;
50912   __pyx_L0:;
50913   __Pyx_DECREF((PyObject *)__pyx_v_new_doc);
50914   __Pyx_DECREF(__pyx_v_root);
50915   __Pyx_XGIVEREF(__pyx_r);
50916   __Pyx_FinishRefcountContext();
50917   return __pyx_r;
50918 }
50919
50920 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":154
50921  *         return _elementFactory(new_doc, c_node)
50922  * 
50923  *     def __iter__(self):             # <<<<<<<<<<<<<<
50924  *         return iter(self.getchildren())
50925  * 
50926  */
50927
50928 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy___iter__(PyObject *__pyx_v_self); /*proto*/
50929 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy___iter__(PyObject *__pyx_v_self) {
50930   PyObject *__pyx_r = NULL;
50931   PyObject *__pyx_t_1 = NULL;
50932   PyObject *__pyx_t_2 = NULL;
50933   __Pyx_SetupRefcountContext("__iter__");
50934
50935   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":155
50936  * 
50937  *     def __iter__(self):
50938  *         return iter(self.getchildren())             # <<<<<<<<<<<<<<
50939  * 
50940  *     def iterchildren(self, tag=None, *, reversed=False):
50941  */
50942   __Pyx_XDECREF(__pyx_r);
50943   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->__pyx_vtab)->getchildren(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50944   __Pyx_GOTREF(__pyx_t_1);
50945   __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
50946   __Pyx_GOTREF(__pyx_t_2);
50947   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
50948   __pyx_r = __pyx_t_2;
50949   __pyx_t_2 = 0;
50950   goto __pyx_L0;
50951
50952   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
50953   goto __pyx_L0;
50954   __pyx_L1_error:;
50955   __Pyx_XDECREF(__pyx_t_1);
50956   __Pyx_XDECREF(__pyx_t_2);
50957   __Pyx_AddTraceback("lxml.etree._ReadOnlyElementProxy.__iter__");
50958   __pyx_r = NULL;
50959   __pyx_L0:;
50960   __Pyx_XGIVEREF(__pyx_r);
50961   __Pyx_FinishRefcountContext();
50962   return __pyx_r;
50963 }
50964
50965 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":157
50966  *         return iter(self.getchildren())
50967  * 
50968  *     def iterchildren(self, tag=None, *, reversed=False):             # <<<<<<<<<<<<<<
50969  *         u"""iterchildren(self, tag=None, reversed=False)
50970  * 
50971  */
50972
50973 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_iterchildren(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
50974 static char __pyx_doc_4lxml_5etree_21_ReadOnlyElementProxy_iterchildren[] = "iterchildren(self, tag=None, reversed=False)\n\n        Iterate over the children of this element.\n        ";
50975 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_iterchildren(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
50976   PyObject *__pyx_v_tag = 0;
50977   PyObject *__pyx_v_reversed = 0;
50978   PyObject *__pyx_v_children;
50979   PyObject *__pyx_v_el;
50980   PyObject *__pyx_r = NULL;
50981   PyObject *__pyx_1 = 0;
50982   PyObject *__pyx_2 = 0;
50983   PyObject *__pyx_t_1 = NULL;
50984   int __pyx_t_2;
50985   int __pyx_t_3;
50986   int __pyx_t_4;
50987   Py_ssize_t __pyx_t_5;
50988   PyObject *__pyx_t_6 = NULL;
50989   PyObject *__pyx_t_7 = NULL;
50990   PyObject *__pyx_t_8 = NULL;
50991   int __pyx_t_9;
50992   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_tag,&__pyx_kp_reversed,0};
50993   __Pyx_SetupRefcountContext("iterchildren");
50994   if (unlikely(__pyx_kwds)) {
50995     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
50996     PyObject* values[2] = {0,0};
50997     values[0] = Py_None;
50998     values[1] = __pyx_k_110;
50999     switch (PyTuple_GET_SIZE(__pyx_args)) {
51000       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
51001       case  0: break;
51002       default: goto __pyx_L5_argtuple_error;
51003     }
51004     switch (PyTuple_GET_SIZE(__pyx_args)) {
51005       case  0:
51006       if (kw_args > 1) {
51007         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_tag);
51008         if (unlikely(value)) { values[0] = value; kw_args--; }
51009       }
51010     }
51011     while (kw_args > 0) {
51012       PyObject* value;
51013       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_reversed);
51014       if (value) { values[1] = value; if (!(--kw_args)) break; }
51015       break;
51016     }
51017     if (unlikely(kw_args > 0)) {
51018       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "iterchildren") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
51019     }
51020     __pyx_v_tag = values[0];
51021     __pyx_v_reversed = values[1];
51022   } else {
51023     __pyx_v_tag = Py_None;
51024     __pyx_v_reversed = __pyx_k_110;
51025     switch (PyTuple_GET_SIZE(__pyx_args)) {
51026       case  1: __pyx_v_tag = PyTuple_GET_ITEM(__pyx_args, 0);
51027       case  0: break;
51028       default: goto __pyx_L5_argtuple_error;
51029     }
51030   }
51031   goto __pyx_L4_argument_unpacking_done;
51032   __pyx_L5_argtuple_error:;
51033   __Pyx_RaiseArgtupleInvalid("iterchildren", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
51034   __pyx_L3_error:;
51035   __Pyx_AddTraceback("lxml.etree._ReadOnlyElementProxy.iterchildren");
51036   return NULL;
51037   __pyx_L4_argument_unpacking_done:;
51038   __pyx_v_children = Py_None; __Pyx_INCREF(Py_None);
51039   __pyx_v_el = Py_None; __Pyx_INCREF(Py_None);
51040
51041   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":162
51042  *         Iterate over the children of this element.
51043  *         """
51044  *         children = self.getchildren()             # <<<<<<<<<<<<<<
51045  *         if tag is not None and tag != '*':
51046  *             children = [ el for el in children if el.tag == tag ]
51047  */
51048   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->__pyx_vtab)->getchildren(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51049   __Pyx_GOTREF(__pyx_t_1);
51050   __Pyx_DECREF(__pyx_v_children);
51051   __pyx_v_children = __pyx_t_1;
51052   __pyx_t_1 = 0;
51053
51054   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":163
51055  *         """
51056  *         children = self.getchildren()
51057  *         if tag is not None and tag != '*':             # <<<<<<<<<<<<<<
51058  *             children = [ el for el in children if el.tag == tag ]
51059  *         if reversed:
51060  */
51061   __pyx_t_2 = (__pyx_v_tag != Py_None);
51062   if (__pyx_t_2) {
51063     __pyx_t_1 = PyObject_RichCompare(__pyx_v_tag, __pyx_kp_392, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51064     __Pyx_GOTREF(__pyx_t_1);
51065     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51066     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
51067     __pyx_t_4 = __pyx_t_3;
51068   } else {
51069     __pyx_t_4 = __pyx_t_2;
51070   }
51071   if (__pyx_t_4) {
51072
51073     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":164
51074  *         children = self.getchildren()
51075  *         if tag is not None and tag != '*':
51076  *             children = [ el for el in children if el.tag == tag ]             # <<<<<<<<<<<<<<
51077  *         if reversed:
51078  *             children = children[::-1]
51079  */
51080     __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51081     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
51082     if (PyList_CheckExact(__pyx_v_children) || PyTuple_CheckExact(__pyx_v_children)) {
51083       __pyx_t_5 = 0; __pyx_t_6 = __pyx_v_children; __Pyx_INCREF(__pyx_t_6);
51084     } else {
51085       __pyx_t_5 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_children); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51086       __Pyx_GOTREF(__pyx_t_6);
51087     }
51088     for (;;) {
51089       if (likely(PyList_CheckExact(__pyx_t_6))) {
51090         if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_6)) break;
51091         __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
51092       } else if (likely(PyTuple_CheckExact(__pyx_t_6))) {
51093         if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
51094         __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
51095       } else {
51096         __pyx_t_7 = PyIter_Next(__pyx_t_6);
51097         if (!__pyx_t_7) {
51098           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51099           break;
51100         }
51101         __Pyx_GOTREF(__pyx_t_7);
51102       }
51103       __Pyx_DECREF(__pyx_v_el);
51104       __pyx_v_el = __pyx_t_7;
51105       __pyx_t_7 = 0;
51106       __pyx_t_7 = PyObject_GetAttr(__pyx_v_el, __pyx_kp_tag); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51107       __Pyx_GOTREF(__pyx_t_7);
51108       __pyx_t_8 = PyObject_RichCompare(__pyx_t_7, __pyx_v_tag, Py_EQ); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51109       __Pyx_GOTREF(__pyx_t_8);
51110       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
51111       __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51112       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
51113       if (__pyx_t_4) {
51114         __pyx_t_9 = PyList_Append(__pyx_t_1, (PyObject*)__pyx_v_el); if (unlikely(__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51115         goto __pyx_L9;
51116       }
51117       __pyx_L9:;
51118     }
51119     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
51120     __Pyx_INCREF(((PyObject *)__pyx_t_1));
51121     __Pyx_DECREF(__pyx_v_children);
51122     __pyx_v_children = ((PyObject *)__pyx_t_1);
51123     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
51124     goto __pyx_L6;
51125   }
51126   __pyx_L6:;
51127
51128   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":165
51129  *         if tag is not None and tag != '*':
51130  *             children = [ el for el in children if el.tag == tag ]
51131  *         if reversed:             # <<<<<<<<<<<<<<
51132  *             children = children[::-1]
51133  *         return iter(children)
51134  */
51135   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_reversed); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51136   if (__pyx_t_4) {
51137
51138     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":166
51139  *             children = [ el for el in children if el.tag == tag ]
51140  *         if reversed:
51141  *             children = children[::-1]             # <<<<<<<<<<<<<<
51142  *         return iter(children)
51143  * 
51144  */
51145     __pyx_1 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51146     __Pyx_GOTREF(__pyx_1);
51147     __pyx_2 = PyObject_GetItem(__pyx_v_children, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51148     __Pyx_GOTREF(__pyx_2);
51149     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
51150     __Pyx_DECREF(__pyx_v_children);
51151     __pyx_v_children = __pyx_2;
51152     __pyx_2 = 0;
51153     goto __pyx_L10;
51154   }
51155   __pyx_L10:;
51156
51157   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":167
51158  *         if reversed:
51159  *             children = children[::-1]
51160  *         return iter(children)             # <<<<<<<<<<<<<<
51161  * 
51162  *     def get(self, key, default=None):
51163  */
51164   __Pyx_XDECREF(__pyx_r);
51165   __pyx_t_1 = PyObject_GetIter(__pyx_v_children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51166   __Pyx_GOTREF(__pyx_t_1);
51167   __pyx_r = __pyx_t_1;
51168   __pyx_t_1 = 0;
51169   goto __pyx_L0;
51170
51171   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
51172   goto __pyx_L0;
51173   __pyx_L1_error:;
51174   __Pyx_XDECREF(__pyx_1);
51175   __Pyx_XDECREF(__pyx_2);
51176   __Pyx_XDECREF(__pyx_t_1);
51177   __Pyx_XDECREF(__pyx_t_6);
51178   __Pyx_XDECREF(__pyx_t_7);
51179   __Pyx_XDECREF(__pyx_t_8);
51180   __Pyx_AddTraceback("lxml.etree._ReadOnlyElementProxy.iterchildren");
51181   __pyx_r = NULL;
51182   __pyx_L0:;
51183   __Pyx_DECREF(__pyx_v_children);
51184   __Pyx_DECREF(__pyx_v_el);
51185   __Pyx_XGIVEREF(__pyx_r);
51186   __Pyx_FinishRefcountContext();
51187   return __pyx_r;
51188 }
51189
51190 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":169
51191  *         return iter(children)
51192  * 
51193  *     def get(self, key, default=None):             # <<<<<<<<<<<<<<
51194  *         u"""Gets an element attribute.
51195  *         """
51196  */
51197
51198 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
51199 static char __pyx_doc_4lxml_5etree_21_ReadOnlyElementProxy_get[] = "Gets an element attribute.\n        ";
51200 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
51201   PyObject *__pyx_v_key = 0;
51202   PyObject *__pyx_v_default = 0;
51203   PyObject *__pyx_r = NULL;
51204   int __pyx_t_1;
51205   PyObject *__pyx_t_2 = NULL;
51206   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_key,&__pyx_kp_default,0};
51207   __Pyx_SetupRefcountContext("get");
51208   if (unlikely(__pyx_kwds)) {
51209     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
51210     PyObject* values[2] = {0,0};
51211     values[1] = Py_None;
51212     switch (PyTuple_GET_SIZE(__pyx_args)) {
51213       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
51214       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
51215       case  0: break;
51216       default: goto __pyx_L5_argtuple_error;
51217     }
51218     switch (PyTuple_GET_SIZE(__pyx_args)) {
51219       case  0:
51220       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_key);
51221       if (likely(values[0])) kw_args--;
51222       else goto __pyx_L5_argtuple_error;
51223       case  1:
51224       if (kw_args > 1) {
51225         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_default);
51226         if (unlikely(value)) { values[1] = value; kw_args--; }
51227       }
51228     }
51229     if (unlikely(kw_args > 0)) {
51230       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
51231     }
51232     __pyx_v_key = values[0];
51233     __pyx_v_default = values[1];
51234   } else {
51235     __pyx_v_default = Py_None;
51236     switch (PyTuple_GET_SIZE(__pyx_args)) {
51237       case  2: __pyx_v_default = PyTuple_GET_ITEM(__pyx_args, 1);
51238       case  1: __pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 0);
51239       break;
51240       default: goto __pyx_L5_argtuple_error;
51241     }
51242   }
51243   goto __pyx_L4_argument_unpacking_done;
51244   __pyx_L5_argtuple_error:;
51245   __Pyx_RaiseArgtupleInvalid("get", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
51246   __pyx_L3_error:;
51247   __Pyx_AddTraceback("lxml.etree._ReadOnlyElementProxy.get");
51248   return NULL;
51249   __pyx_L4_argument_unpacking_done:;
51250
51251   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":172
51252  *         u"""Gets an element attribute.
51253  *         """
51254  *         self._assertNode()             # <<<<<<<<<<<<<<
51255  *         return _getNodeAttributeValue(self._c_node, key, default)
51256  * 
51257  */
51258   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->__pyx_vtab)->_assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51259
51260   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":173
51261  *         """
51262  *         self._assertNode()
51263  *         return _getNodeAttributeValue(self._c_node, key, default)             # <<<<<<<<<<<<<<
51264  * 
51265  *     def keys(self):
51266  */
51267   __Pyx_XDECREF(__pyx_r);
51268   __pyx_t_2 = __pyx_f_4lxml_5etree__getNodeAttributeValue(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_c_node, __pyx_v_key, __pyx_v_default); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51269   __Pyx_GOTREF(__pyx_t_2);
51270   __pyx_r = __pyx_t_2;
51271   __pyx_t_2 = 0;
51272   goto __pyx_L0;
51273
51274   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
51275   goto __pyx_L0;
51276   __pyx_L1_error:;
51277   __Pyx_XDECREF(__pyx_t_2);
51278   __Pyx_AddTraceback("lxml.etree._ReadOnlyElementProxy.get");
51279   __pyx_r = NULL;
51280   __pyx_L0:;
51281   __Pyx_XGIVEREF(__pyx_r);
51282   __Pyx_FinishRefcountContext();
51283   return __pyx_r;
51284 }
51285
51286 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":175
51287  *         return _getNodeAttributeValue(self._c_node, key, default)
51288  * 
51289  *     def keys(self):             # <<<<<<<<<<<<<<
51290  *         u"""Gets a list of attribute names. The names are returned in an
51291  *         arbitrary order (just like for an ordinary Python dictionary).
51292  */
51293
51294 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_keys(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
51295 static char __pyx_doc_4lxml_5etree_21_ReadOnlyElementProxy_keys[] = "Gets a list of attribute names. The names are returned in an\n        arbitrary order (just like for an ordinary Python dictionary).\n        ";
51296 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_keys(PyObject *__pyx_v_self, PyObject *unused) {
51297   PyObject *__pyx_r = NULL;
51298   int __pyx_t_1;
51299   PyObject *__pyx_t_2 = NULL;
51300   __Pyx_SetupRefcountContext("keys");
51301
51302   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":179
51303  *         arbitrary order (just like for an ordinary Python dictionary).
51304  *         """
51305  *         self._assertNode()             # <<<<<<<<<<<<<<
51306  *         return _collectAttributes(self._c_node, 1)
51307  * 
51308  */
51309   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->__pyx_vtab)->_assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51310
51311   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":180
51312  *         """
51313  *         self._assertNode()
51314  *         return _collectAttributes(self._c_node, 1)             # <<<<<<<<<<<<<<
51315  * 
51316  *     def values(self):
51317  */
51318   __Pyx_XDECREF(__pyx_r);
51319   __pyx_t_2 = __pyx_f_4lxml_5etree__collectAttributes(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_c_node, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51320   __Pyx_GOTREF(__pyx_t_2);
51321   __pyx_r = __pyx_t_2;
51322   __pyx_t_2 = 0;
51323   goto __pyx_L0;
51324
51325   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
51326   goto __pyx_L0;
51327   __pyx_L1_error:;
51328   __Pyx_XDECREF(__pyx_t_2);
51329   __Pyx_AddTraceback("lxml.etree._ReadOnlyElementProxy.keys");
51330   __pyx_r = NULL;
51331   __pyx_L0:;
51332   __Pyx_XGIVEREF(__pyx_r);
51333   __Pyx_FinishRefcountContext();
51334   return __pyx_r;
51335 }
51336
51337 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":182
51338  *         return _collectAttributes(self._c_node, 1)
51339  * 
51340  *     def values(self):             # <<<<<<<<<<<<<<
51341  *         u"""Gets element attributes, as a sequence. The attributes are returned
51342  *         in an arbitrary order.
51343  */
51344
51345 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_values(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
51346 static char __pyx_doc_4lxml_5etree_21_ReadOnlyElementProxy_values[] = "Gets element attributes, as a sequence. The attributes are returned\n        in an arbitrary order.\n        ";
51347 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_values(PyObject *__pyx_v_self, PyObject *unused) {
51348   PyObject *__pyx_r = NULL;
51349   int __pyx_t_1;
51350   PyObject *__pyx_t_2 = NULL;
51351   __Pyx_SetupRefcountContext("values");
51352
51353   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":186
51354  *         in an arbitrary order.
51355  *         """
51356  *         self._assertNode()             # <<<<<<<<<<<<<<
51357  *         return _collectAttributes(self._c_node, 2)
51358  * 
51359  */
51360   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->__pyx_vtab)->_assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51361
51362   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":187
51363  *         """
51364  *         self._assertNode()
51365  *         return _collectAttributes(self._c_node, 2)             # <<<<<<<<<<<<<<
51366  * 
51367  *     def items(self):
51368  */
51369   __Pyx_XDECREF(__pyx_r);
51370   __pyx_t_2 = __pyx_f_4lxml_5etree__collectAttributes(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_c_node, 2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51371   __Pyx_GOTREF(__pyx_t_2);
51372   __pyx_r = __pyx_t_2;
51373   __pyx_t_2 = 0;
51374   goto __pyx_L0;
51375
51376   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
51377   goto __pyx_L0;
51378   __pyx_L1_error:;
51379   __Pyx_XDECREF(__pyx_t_2);
51380   __Pyx_AddTraceback("lxml.etree._ReadOnlyElementProxy.values");
51381   __pyx_r = NULL;
51382   __pyx_L0:;
51383   __Pyx_XGIVEREF(__pyx_r);
51384   __Pyx_FinishRefcountContext();
51385   return __pyx_r;
51386 }
51387
51388 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":189
51389  *         return _collectAttributes(self._c_node, 2)
51390  * 
51391  *     def items(self):             # <<<<<<<<<<<<<<
51392  *         u"""Gets element attributes, as a sequence. The attributes are returned
51393  *         in an arbitrary order.
51394  */
51395
51396 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_items(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
51397 static char __pyx_doc_4lxml_5etree_21_ReadOnlyElementProxy_items[] = "Gets element attributes, as a sequence. The attributes are returned\n        in an arbitrary order.\n        ";
51398 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_items(PyObject *__pyx_v_self, PyObject *unused) {
51399   PyObject *__pyx_r = NULL;
51400   int __pyx_t_1;
51401   PyObject *__pyx_t_2 = NULL;
51402   __Pyx_SetupRefcountContext("items");
51403
51404   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":193
51405  *         in an arbitrary order.
51406  *         """
51407  *         self._assertNode()             # <<<<<<<<<<<<<<
51408  *         return _collectAttributes(self._c_node, 3)
51409  * 
51410  */
51411   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->__pyx_vtab)->_assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51412
51413   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":194
51414  *         """
51415  *         self._assertNode()
51416  *         return _collectAttributes(self._c_node, 3)             # <<<<<<<<<<<<<<
51417  * 
51418  *     cpdef getchildren(self):
51419  */
51420   __Pyx_XDECREF(__pyx_r);
51421   __pyx_t_2 = __pyx_f_4lxml_5etree__collectAttributes(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_c_node, 3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51422   __Pyx_GOTREF(__pyx_t_2);
51423   __pyx_r = __pyx_t_2;
51424   __pyx_t_2 = 0;
51425   goto __pyx_L0;
51426
51427   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
51428   goto __pyx_L0;
51429   __pyx_L1_error:;
51430   __Pyx_XDECREF(__pyx_t_2);
51431   __Pyx_AddTraceback("lxml.etree._ReadOnlyElementProxy.items");
51432   __pyx_r = NULL;
51433   __pyx_L0:;
51434   __Pyx_XGIVEREF(__pyx_r);
51435   __Pyx_FinishRefcountContext();
51436   return __pyx_r;
51437 }
51438
51439 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":196
51440  *         return _collectAttributes(self._c_node, 3)
51441  * 
51442  *     cpdef getchildren(self):             # <<<<<<<<<<<<<<
51443  *         u"""Returns all subelements. The elements are returned in document
51444  *         order.
51445  */
51446
51447 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_getchildren(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
51448 static  PyObject *__pyx_f_4lxml_5etree_21_ReadOnlyElementProxy_getchildren(struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *__pyx_v_self, int __pyx_skip_dispatch) {
51449   xmlNode *__pyx_v_c_node;
51450   PyObject *__pyx_v_result;
51451   PyObject *__pyx_r = NULL;
51452   PyObject *__pyx_1 = 0;
51453   PyObject *__pyx_t_1 = NULL;
51454   int __pyx_t_2;
51455   int __pyx_t_3;
51456   __Pyx_SetupRefcountContext("getchildren");
51457   __pyx_v_result = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
51458   /* Check if called by wrapper */
51459   if (unlikely(__pyx_skip_dispatch)) ;
51460   /* Check if overriden in Python */
51461   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
51462     __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_kp_getchildren); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51463     __Pyx_GOTREF(__pyx_1);
51464     if (!PyCFunction_Check(__pyx_1) || (PyCFunction_GET_FUNCTION(__pyx_1) != (void *)&__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_getchildren)) {
51465       __Pyx_XDECREF(__pyx_r);
51466       __pyx_t_1 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51467       __Pyx_GOTREF(__pyx_t_1);
51468       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
51469       __pyx_r = __pyx_t_1;
51470       __pyx_t_1 = 0;
51471       goto __pyx_L0;
51472     }
51473     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
51474   }
51475
51476   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":202
51477  *         cdef xmlNode* c_node
51478  *         cdef list result
51479  *         self._assertNode()             # <<<<<<<<<<<<<<
51480  *         result = []
51481  *         c_node = self._c_node.children
51482  */
51483   __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51484
51485   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":203
51486  *         cdef list result
51487  *         self._assertNode()
51488  *         result = []             # <<<<<<<<<<<<<<
51489  *         c_node = self._c_node.children
51490  *         while c_node is not NULL:
51491  */
51492   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51493   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
51494   __Pyx_DECREF(((PyObject *)__pyx_v_result));
51495   __pyx_v_result = __pyx_t_1;
51496   __pyx_t_1 = 0;
51497
51498   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":204
51499  *         self._assertNode()
51500  *         result = []
51501  *         c_node = self._c_node.children             # <<<<<<<<<<<<<<
51502  *         while c_node is not NULL:
51503  *             if tree._isElement(c_node):
51504  */
51505   __pyx_v_c_node = __pyx_v_self->_c_node->children;
51506
51507   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":205
51508  *         result = []
51509  *         c_node = self._c_node.children
51510  *         while c_node is not NULL:             # <<<<<<<<<<<<<<
51511  *             if tree._isElement(c_node):
51512  *                 result.append(_newReadOnlyProxy(self._source_proxy, c_node))
51513  */
51514   while (1) {
51515     __pyx_t_3 = (__pyx_v_c_node != NULL);
51516     if (!__pyx_t_3) break;
51517
51518     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":206
51519  *         c_node = self._c_node.children
51520  *         while c_node is not NULL:
51521  *             if tree._isElement(c_node):             # <<<<<<<<<<<<<<
51522  *                 result.append(_newReadOnlyProxy(self._source_proxy, c_node))
51523  *             c_node = c_node.next
51524  */
51525     __pyx_t_3 = _isElement(__pyx_v_c_node);
51526     if (__pyx_t_3) {
51527
51528       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":207
51529  *         while c_node is not NULL:
51530  *             if tree._isElement(c_node):
51531  *                 result.append(_newReadOnlyProxy(self._source_proxy, c_node))             # <<<<<<<<<<<<<<
51532  *             c_node = c_node.next
51533  *         return result
51534  */
51535       if (!(__Pyx_TypeTest(__pyx_v_self->_source_proxy, __pyx_ptype_4lxml_5etree__ReadOnlyElementProxy))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51536       __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__newReadOnlyProxy(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self->_source_proxy), __pyx_v_c_node)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51537       __Pyx_GOTREF(__pyx_t_1);
51538       __pyx_t_2 = PyList_Append(((PyObject *)__pyx_v_result), __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51539       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
51540       goto __pyx_L5;
51541     }
51542     __pyx_L5:;
51543
51544     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":208
51545  *             if tree._isElement(c_node):
51546  *                 result.append(_newReadOnlyProxy(self._source_proxy, c_node))
51547  *             c_node = c_node.next             # <<<<<<<<<<<<<<
51548  *         return result
51549  * 
51550  */
51551     __pyx_v_c_node = __pyx_v_c_node->next;
51552   }
51553
51554   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":209
51555  *                 result.append(_newReadOnlyProxy(self._source_proxy, c_node))
51556  *             c_node = c_node.next
51557  *         return result             # <<<<<<<<<<<<<<
51558  * 
51559  *     def getparent(self):
51560  */
51561   __Pyx_XDECREF(__pyx_r);
51562   __Pyx_INCREF(((PyObject *)__pyx_v_result));
51563   __pyx_r = ((PyObject *)__pyx_v_result);
51564   goto __pyx_L0;
51565
51566   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
51567   goto __pyx_L0;
51568   __pyx_L1_error:;
51569   __Pyx_XDECREF(__pyx_1);
51570   __Pyx_XDECREF(__pyx_t_1);
51571   __Pyx_AddTraceback("lxml.etree._ReadOnlyElementProxy.getchildren");
51572   __pyx_r = 0;
51573   __pyx_L0:;
51574   __Pyx_DECREF(__pyx_v_result);
51575   __Pyx_XGIVEREF(__pyx_r);
51576   __Pyx_FinishRefcountContext();
51577   return __pyx_r;
51578 }
51579
51580 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":196
51581  *         return _collectAttributes(self._c_node, 3)
51582  * 
51583  *     cpdef getchildren(self):             # <<<<<<<<<<<<<<
51584  *         u"""Returns all subelements. The elements are returned in document
51585  *         order.
51586  */
51587
51588 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_getchildren(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
51589 static char __pyx_doc_4lxml_5etree_21_ReadOnlyElementProxy_getchildren[] = "Returns all subelements. The elements are returned in document\n        order.\n        ";
51590 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_getchildren(PyObject *__pyx_v_self, PyObject *unused) {
51591   PyObject *__pyx_r = NULL;
51592   PyObject *__pyx_t_1 = NULL;
51593   __Pyx_SetupRefcountContext("getchildren");
51594   __Pyx_XDECREF(__pyx_r);
51595   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->__pyx_vtab)->getchildren(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51596   __Pyx_GOTREF(__pyx_t_1);
51597   __pyx_r = __pyx_t_1;
51598   __pyx_t_1 = 0;
51599   goto __pyx_L0;
51600
51601   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
51602   goto __pyx_L0;
51603   __pyx_L1_error:;
51604   __Pyx_XDECREF(__pyx_t_1);
51605   __Pyx_AddTraceback("lxml.etree._ReadOnlyElementProxy.getchildren");
51606   __pyx_r = NULL;
51607   __pyx_L0:;
51608   __Pyx_XGIVEREF(__pyx_r);
51609   __Pyx_FinishRefcountContext();
51610   return __pyx_r;
51611 }
51612
51613 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":211
51614  *         return result
51615  * 
51616  *     def getparent(self):             # <<<<<<<<<<<<<<
51617  *         u"""Returns the parent of this element or None for the root element.
51618  *         """
51619  */
51620
51621 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_getparent(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
51622 static char __pyx_doc_4lxml_5etree_21_ReadOnlyElementProxy_getparent[] = "Returns the parent of this element or None for the root element.\n        ";
51623 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_getparent(PyObject *__pyx_v_self, PyObject *unused) {
51624   xmlNode *__pyx_v_c_parent;
51625   PyObject *__pyx_r = NULL;
51626   int __pyx_t_1;
51627   int __pyx_t_2;
51628   PyObject *__pyx_t_3 = NULL;
51629   __Pyx_SetupRefcountContext("getparent");
51630
51631   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":215
51632  *         """
51633  *         cdef xmlNode* c_parent
51634  *         self._assertNode()             # <<<<<<<<<<<<<<
51635  *         c_parent = self._c_node.parent
51636  *         if c_parent is NULL or not tree._isElement(c_parent):
51637  */
51638   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->__pyx_vtab)->_assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51639
51640   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":216
51641  *         cdef xmlNode* c_parent
51642  *         self._assertNode()
51643  *         c_parent = self._c_node.parent             # <<<<<<<<<<<<<<
51644  *         if c_parent is NULL or not tree._isElement(c_parent):
51645  *             return None
51646  */
51647   __pyx_v_c_parent = ((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_c_node->parent;
51648
51649   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":217
51650  *         self._assertNode()
51651  *         c_parent = self._c_node.parent
51652  *         if c_parent is NULL or not tree._isElement(c_parent):             # <<<<<<<<<<<<<<
51653  *             return None
51654  *         else:
51655  */
51656   if (!(__pyx_v_c_parent == NULL)) {
51657     __pyx_t_2 = (!_isElement(__pyx_v_c_parent));
51658   } else {
51659     __pyx_t_2 = (__pyx_v_c_parent == NULL);
51660   }
51661   if (__pyx_t_2) {
51662
51663     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":218
51664  *         c_parent = self._c_node.parent
51665  *         if c_parent is NULL or not tree._isElement(c_parent):
51666  *             return None             # <<<<<<<<<<<<<<
51667  *         else:
51668  *             return _newReadOnlyProxy(self._source_proxy, c_parent)
51669  */
51670     __Pyx_XDECREF(__pyx_r);
51671     __Pyx_INCREF(Py_None);
51672     __pyx_r = Py_None;
51673     goto __pyx_L0;
51674     goto __pyx_L5;
51675   }
51676   /*else*/ {
51677
51678     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":220
51679  *             return None
51680  *         else:
51681  *             return _newReadOnlyProxy(self._source_proxy, c_parent)             # <<<<<<<<<<<<<<
51682  * 
51683  *     def getnext(self):
51684  */
51685     __Pyx_XDECREF(__pyx_r);
51686     if (!(__Pyx_TypeTest(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_source_proxy, __pyx_ptype_4lxml_5etree__ReadOnlyElementProxy))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51687     __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__newReadOnlyProxy(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_source_proxy), __pyx_v_c_parent)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51688     __Pyx_GOTREF(__pyx_t_3);
51689     __pyx_r = __pyx_t_3;
51690     __pyx_t_3 = 0;
51691     goto __pyx_L0;
51692   }
51693   __pyx_L5:;
51694
51695   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
51696   goto __pyx_L0;
51697   __pyx_L1_error:;
51698   __Pyx_XDECREF(__pyx_t_3);
51699   __Pyx_AddTraceback("lxml.etree._ReadOnlyElementProxy.getparent");
51700   __pyx_r = NULL;
51701   __pyx_L0:;
51702   __Pyx_XGIVEREF(__pyx_r);
51703   __Pyx_FinishRefcountContext();
51704   return __pyx_r;
51705 }
51706
51707 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":222
51708  *             return _newReadOnlyProxy(self._source_proxy, c_parent)
51709  * 
51710  *     def getnext(self):             # <<<<<<<<<<<<<<
51711  *         u"""Returns the following sibling of this element or None.
51712  *         """
51713  */
51714
51715 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_getnext(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
51716 static char __pyx_doc_4lxml_5etree_21_ReadOnlyElementProxy_getnext[] = "Returns the following sibling of this element or None.\n        ";
51717 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_getnext(PyObject *__pyx_v_self, PyObject *unused) {
51718   xmlNode *__pyx_v_c_node;
51719   PyObject *__pyx_r = NULL;
51720   int __pyx_t_1;
51721   int __pyx_t_2;
51722   PyObject *__pyx_t_3 = NULL;
51723   __Pyx_SetupRefcountContext("getnext");
51724
51725   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":226
51726  *         """
51727  *         cdef xmlNode* c_node
51728  *         self._assertNode()             # <<<<<<<<<<<<<<
51729  *         c_node = _nextElement(self._c_node)
51730  *         if c_node is not NULL:
51731  */
51732   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->__pyx_vtab)->_assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51733
51734   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":227
51735  *         cdef xmlNode* c_node
51736  *         self._assertNode()
51737  *         c_node = _nextElement(self._c_node)             # <<<<<<<<<<<<<<
51738  *         if c_node is not NULL:
51739  *             return _newReadOnlyProxy(self._source_proxy, c_node)
51740  */
51741   __pyx_v_c_node = __pyx_f_4lxml_5etree__nextElement(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_c_node);
51742
51743   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":228
51744  *         self._assertNode()
51745  *         c_node = _nextElement(self._c_node)
51746  *         if c_node is not NULL:             # <<<<<<<<<<<<<<
51747  *             return _newReadOnlyProxy(self._source_proxy, c_node)
51748  *         return None
51749  */
51750   __pyx_t_2 = (__pyx_v_c_node != NULL);
51751   if (__pyx_t_2) {
51752
51753     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":229
51754  *         c_node = _nextElement(self._c_node)
51755  *         if c_node is not NULL:
51756  *             return _newReadOnlyProxy(self._source_proxy, c_node)             # <<<<<<<<<<<<<<
51757  *         return None
51758  * 
51759  */
51760     __Pyx_XDECREF(__pyx_r);
51761     if (!(__Pyx_TypeTest(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_source_proxy, __pyx_ptype_4lxml_5etree__ReadOnlyElementProxy))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51762     __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__newReadOnlyProxy(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_source_proxy), __pyx_v_c_node)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51763     __Pyx_GOTREF(__pyx_t_3);
51764     __pyx_r = __pyx_t_3;
51765     __pyx_t_3 = 0;
51766     goto __pyx_L0;
51767     goto __pyx_L5;
51768   }
51769   __pyx_L5:;
51770
51771   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":230
51772  *         if c_node is not NULL:
51773  *             return _newReadOnlyProxy(self._source_proxy, c_node)
51774  *         return None             # <<<<<<<<<<<<<<
51775  * 
51776  *     def getprevious(self):
51777  */
51778   __Pyx_XDECREF(__pyx_r);
51779   __Pyx_INCREF(Py_None);
51780   __pyx_r = Py_None;
51781   goto __pyx_L0;
51782
51783   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
51784   goto __pyx_L0;
51785   __pyx_L1_error:;
51786   __Pyx_XDECREF(__pyx_t_3);
51787   __Pyx_AddTraceback("lxml.etree._ReadOnlyElementProxy.getnext");
51788   __pyx_r = NULL;
51789   __pyx_L0:;
51790   __Pyx_XGIVEREF(__pyx_r);
51791   __Pyx_FinishRefcountContext();
51792   return __pyx_r;
51793 }
51794
51795 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":232
51796  *         return None
51797  * 
51798  *     def getprevious(self):             # <<<<<<<<<<<<<<
51799  *         u"""Returns the preceding sibling of this element or None.
51800  *         """
51801  */
51802
51803 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_getprevious(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
51804 static char __pyx_doc_4lxml_5etree_21_ReadOnlyElementProxy_getprevious[] = "Returns the preceding sibling of this element or None.\n        ";
51805 static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_getprevious(PyObject *__pyx_v_self, PyObject *unused) {
51806   xmlNode *__pyx_v_c_node;
51807   PyObject *__pyx_r = NULL;
51808   int __pyx_t_1;
51809   int __pyx_t_2;
51810   PyObject *__pyx_t_3 = NULL;
51811   __Pyx_SetupRefcountContext("getprevious");
51812
51813   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":236
51814  *         """
51815  *         cdef xmlNode* c_node
51816  *         self._assertNode()             # <<<<<<<<<<<<<<
51817  *         c_node = _previousElement(self._c_node)
51818  *         if c_node is not NULL:
51819  */
51820   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->__pyx_vtab)->_assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51821
51822   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":237
51823  *         cdef xmlNode* c_node
51824  *         self._assertNode()
51825  *         c_node = _previousElement(self._c_node)             # <<<<<<<<<<<<<<
51826  *         if c_node is not NULL:
51827  *             return _newReadOnlyProxy(self._source_proxy, c_node)
51828  */
51829   __pyx_v_c_node = __pyx_f_4lxml_5etree__previousElement(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_c_node);
51830
51831   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":238
51832  *         self._assertNode()
51833  *         c_node = _previousElement(self._c_node)
51834  *         if c_node is not NULL:             # <<<<<<<<<<<<<<
51835  *             return _newReadOnlyProxy(self._source_proxy, c_node)
51836  *         return None
51837  */
51838   __pyx_t_2 = (__pyx_v_c_node != NULL);
51839   if (__pyx_t_2) {
51840
51841     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":239
51842  *         c_node = _previousElement(self._c_node)
51843  *         if c_node is not NULL:
51844  *             return _newReadOnlyProxy(self._source_proxy, c_node)             # <<<<<<<<<<<<<<
51845  *         return None
51846  * 
51847  */
51848     __Pyx_XDECREF(__pyx_r);
51849     if (!(__Pyx_TypeTest(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_source_proxy, __pyx_ptype_4lxml_5etree__ReadOnlyElementProxy))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51850     __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__newReadOnlyProxy(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)->_source_proxy), __pyx_v_c_node)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51851     __Pyx_GOTREF(__pyx_t_3);
51852     __pyx_r = __pyx_t_3;
51853     __pyx_t_3 = 0;
51854     goto __pyx_L0;
51855     goto __pyx_L5;
51856   }
51857   __pyx_L5:;
51858
51859   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":240
51860  *         if c_node is not NULL:
51861  *             return _newReadOnlyProxy(self._source_proxy, c_node)
51862  *         return None             # <<<<<<<<<<<<<<
51863  * 
51864  * 
51865  */
51866   __Pyx_XDECREF(__pyx_r);
51867   __Pyx_INCREF(Py_None);
51868   __pyx_r = Py_None;
51869   goto __pyx_L0;
51870
51871   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
51872   goto __pyx_L0;
51873   __pyx_L1_error:;
51874   __Pyx_XDECREF(__pyx_t_3);
51875   __Pyx_AddTraceback("lxml.etree._ReadOnlyElementProxy.getprevious");
51876   __pyx_r = NULL;
51877   __pyx_L0:;
51878   __Pyx_XGIVEREF(__pyx_r);
51879   __Pyx_FinishRefcountContext();
51880   return __pyx_r;
51881 }
51882
51883 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":247
51884  *     cdef _ReadOnlyElementProxy NEW_RO_PROXY "PY_NEW" (object t)
51885  * 
51886  * cdef _ReadOnlyElementProxy _newReadOnlyProxy(             # <<<<<<<<<<<<<<
51887  *     _ReadOnlyElementProxy source_proxy, xmlNode* c_node):
51888  *     cdef _ReadOnlyElementProxy el
51889  */
51890
51891 static  struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *__pyx_f_4lxml_5etree__newReadOnlyProxy(struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *__pyx_v_source_proxy, xmlNode *__pyx_v_c_node) {
51892   struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *__pyx_v_el;
51893   struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *__pyx_r = NULL;
51894   PyObject *__pyx_t_1 = NULL;
51895   __Pyx_SetupRefcountContext("_newReadOnlyProxy");
51896   __pyx_v_el = ((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)Py_None); __Pyx_INCREF(Py_None);
51897
51898   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":250
51899  *     _ReadOnlyElementProxy source_proxy, xmlNode* c_node):
51900  *     cdef _ReadOnlyElementProxy el
51901  *     el = NEW_RO_PROXY(_ReadOnlyElementProxy)             # <<<<<<<<<<<<<<
51902  *     el._c_node = c_node
51903  *     _initReadOnlyProxy(el, source_proxy)
51904  */
51905   __pyx_t_1 = ((PyObject *)PY_NEW(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ReadOnlyElementProxy)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51906   __Pyx_GOTREF(__pyx_t_1);
51907   __Pyx_DECREF(((PyObject *)__pyx_v_el));
51908   __pyx_v_el = ((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_t_1);
51909   __pyx_t_1 = 0;
51910
51911   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":251
51912  *     cdef _ReadOnlyElementProxy el
51913  *     el = NEW_RO_PROXY(_ReadOnlyElementProxy)
51914  *     el._c_node = c_node             # <<<<<<<<<<<<<<
51915  *     _initReadOnlyProxy(el, source_proxy)
51916  *     return el
51917  */
51918   __pyx_v_el->_c_node = __pyx_v_c_node;
51919
51920   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":252
51921  *     el = NEW_RO_PROXY(_ReadOnlyElementProxy)
51922  *     el._c_node = c_node
51923  *     _initReadOnlyProxy(el, source_proxy)             # <<<<<<<<<<<<<<
51924  *     return el
51925  * 
51926  */
51927   __pyx_t_1 = __pyx_f_4lxml_5etree__initReadOnlyProxy(__pyx_v_el, __pyx_v_source_proxy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
51928   __Pyx_GOTREF(__pyx_t_1);
51929   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
51930
51931   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":253
51932  *     el._c_node = c_node
51933  *     _initReadOnlyProxy(el, source_proxy)
51934  *     return el             # <<<<<<<<<<<<<<
51935  * 
51936  * cdef inline _initReadOnlyProxy(_ReadOnlyElementProxy el,
51937  */
51938   __Pyx_XDECREF(((PyObject *)__pyx_r));
51939   __Pyx_INCREF(((PyObject *)__pyx_v_el));
51940   __pyx_r = __pyx_v_el;
51941   goto __pyx_L0;
51942
51943   __pyx_r = ((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)Py_None); __Pyx_INCREF(Py_None);
51944   goto __pyx_L0;
51945   __pyx_L1_error:;
51946   __Pyx_XDECREF(__pyx_t_1);
51947   __Pyx_AddTraceback("lxml.etree._newReadOnlyProxy");
51948   __pyx_r = 0;
51949   __pyx_L0:;
51950   __Pyx_DECREF((PyObject *)__pyx_v_el);
51951   __Pyx_XGIVEREF((PyObject *)__pyx_r);
51952   __Pyx_FinishRefcountContext();
51953   return __pyx_r;
51954 }
51955
51956 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":255
51957  *     return el
51958  * 
51959  * cdef inline _initReadOnlyProxy(_ReadOnlyElementProxy el,             # <<<<<<<<<<<<<<
51960  *                                _ReadOnlyElementProxy source_proxy):
51961  *     el._free_after_use = 0
51962  */
51963
51964 static INLINE PyObject *__pyx_f_4lxml_5etree__initReadOnlyProxy(struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *__pyx_v_el, struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *__pyx_v_source_proxy) {
51965   PyObject *__pyx_r = NULL;
51966   int __pyx_t_1;
51967   PyObject *__pyx_t_2 = NULL;
51968   int __pyx_t_3;
51969   __Pyx_SetupRefcountContext("_initReadOnlyProxy");
51970
51971   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":257
51972  * cdef inline _initReadOnlyProxy(_ReadOnlyElementProxy el,
51973  *                                _ReadOnlyElementProxy source_proxy):
51974  *     el._free_after_use = 0             # <<<<<<<<<<<<<<
51975  *     if source_proxy is None:
51976  *         el._source_proxy = el
51977  */
51978   __pyx_v_el->_free_after_use = 0;
51979
51980   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":258
51981  *                                _ReadOnlyElementProxy source_proxy):
51982  *     el._free_after_use = 0
51983  *     if source_proxy is None:             # <<<<<<<<<<<<<<
51984  *         el._source_proxy = el
51985  *         el._dependent_proxies = [el]
51986  */
51987   __pyx_t_1 = (((PyObject *)__pyx_v_source_proxy) == Py_None);
51988   if (__pyx_t_1) {
51989
51990     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":259
51991  *     el._free_after_use = 0
51992  *     if source_proxy is None:
51993  *         el._source_proxy = el             # <<<<<<<<<<<<<<
51994  *         el._dependent_proxies = [el]
51995  *     else:
51996  */
51997     __Pyx_INCREF(((PyObject *)__pyx_v_el));
51998     __Pyx_GIVEREF(((PyObject *)__pyx_v_el));
51999     __Pyx_GOTREF(__pyx_v_el->_source_proxy);
52000     __Pyx_DECREF(__pyx_v_el->_source_proxy);
52001     __pyx_v_el->_source_proxy = ((PyObject *)__pyx_v_el);
52002
52003     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":260
52004  *     if source_proxy is None:
52005  *         el._source_proxy = el
52006  *         el._dependent_proxies = [el]             # <<<<<<<<<<<<<<
52007  *     else:
52008  *         el._source_proxy = source_proxy
52009  */
52010     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
52011     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
52012     __Pyx_INCREF(((PyObject *)__pyx_v_el));
52013     PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_el));
52014     __Pyx_GIVEREF(((PyObject *)__pyx_v_el));
52015     __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
52016     __Pyx_GOTREF(__pyx_v_el->_dependent_proxies);
52017     __Pyx_DECREF(((PyObject *)__pyx_v_el->_dependent_proxies));
52018     __pyx_v_el->_dependent_proxies = __pyx_t_2;
52019     __pyx_t_2 = 0;
52020     goto __pyx_L3;
52021   }
52022   /*else*/ {
52023
52024     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":262
52025  *         el._dependent_proxies = [el]
52026  *     else:
52027  *         el._source_proxy = source_proxy             # <<<<<<<<<<<<<<
52028  *         source_proxy._dependent_proxies.append(el)
52029  * 
52030  */
52031     __Pyx_INCREF(((PyObject *)__pyx_v_source_proxy));
52032     __Pyx_GIVEREF(((PyObject *)__pyx_v_source_proxy));
52033     __Pyx_GOTREF(__pyx_v_el->_source_proxy);
52034     __Pyx_DECREF(__pyx_v_el->_source_proxy);
52035     __pyx_v_el->_source_proxy = ((PyObject *)__pyx_v_source_proxy);
52036
52037     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":263
52038  *     else:
52039  *         el._source_proxy = source_proxy
52040  *         source_proxy._dependent_proxies.append(el)             # <<<<<<<<<<<<<<
52041  * 
52042  * cdef _freeReadOnlyProxies(_ReadOnlyElementProxy sourceProxy):
52043  */
52044     __pyx_t_3 = PyList_Append(((PyObject *)__pyx_v_source_proxy->_dependent_proxies), ((PyObject *)__pyx_v_el)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
52045   }
52046   __pyx_L3:;
52047
52048   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
52049   goto __pyx_L0;
52050   __pyx_L1_error:;
52051   __Pyx_XDECREF(__pyx_t_2);
52052   __Pyx_AddTraceback("lxml.etree._initReadOnlyProxy");
52053   __pyx_r = 0;
52054   __pyx_L0:;
52055   __Pyx_XGIVEREF(__pyx_r);
52056   __Pyx_FinishRefcountContext();
52057   return __pyx_r;
52058 }
52059
52060 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":265
52061  *         source_proxy._dependent_proxies.append(el)
52062  * 
52063  * cdef _freeReadOnlyProxies(_ReadOnlyElementProxy sourceProxy):             # <<<<<<<<<<<<<<
52064  *     cdef xmlNode* c_node
52065  *     cdef _ReadOnlyElementProxy el
52066  */
52067
52068 static  PyObject *__pyx_f_4lxml_5etree__freeReadOnlyProxies(struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *__pyx_v_sourceProxy) {
52069   xmlNode *__pyx_v_c_node;
52070   struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *__pyx_v_el;
52071   PyObject *__pyx_r = NULL;
52072   int __pyx_t_1;
52073   Py_ssize_t __pyx_t_2;
52074   PyObject *__pyx_t_3 = NULL;
52075   PyObject *__pyx_t_4 = NULL;
52076   __Pyx_SetupRefcountContext("_freeReadOnlyProxies");
52077   __pyx_v_el = ((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)Py_None); __Pyx_INCREF(Py_None);
52078
52079   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":268
52080  *     cdef xmlNode* c_node
52081  *     cdef _ReadOnlyElementProxy el
52082  *     if sourceProxy is None:             # <<<<<<<<<<<<<<
52083  *         return
52084  *     if sourceProxy._dependent_proxies is None:
52085  */
52086   __pyx_t_1 = (((PyObject *)__pyx_v_sourceProxy) == Py_None);
52087   if (__pyx_t_1) {
52088
52089     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":269
52090  *     cdef _ReadOnlyElementProxy el
52091  *     if sourceProxy is None:
52092  *         return             # <<<<<<<<<<<<<<
52093  *     if sourceProxy._dependent_proxies is None:
52094  *         return
52095  */
52096     __Pyx_XDECREF(__pyx_r);
52097     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
52098     goto __pyx_L0;
52099     goto __pyx_L3;
52100   }
52101   __pyx_L3:;
52102
52103   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":270
52104  *     if sourceProxy is None:
52105  *         return
52106  *     if sourceProxy._dependent_proxies is None:             # <<<<<<<<<<<<<<
52107  *         return
52108  *     for el in sourceProxy._dependent_proxies:
52109  */
52110   __pyx_t_1 = (__pyx_v_sourceProxy->_dependent_proxies == ((PyObject *)Py_None));
52111   if (__pyx_t_1) {
52112
52113     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":271
52114  *         return
52115  *     if sourceProxy._dependent_proxies is None:
52116  *         return             # <<<<<<<<<<<<<<
52117  *     for el in sourceProxy._dependent_proxies:
52118  *         c_node = el._c_node
52119  */
52120     __Pyx_XDECREF(__pyx_r);
52121     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
52122     goto __pyx_L0;
52123     goto __pyx_L4;
52124   }
52125   __pyx_L4:;
52126
52127   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":272
52128  *     if sourceProxy._dependent_proxies is None:
52129  *         return
52130  *     for el in sourceProxy._dependent_proxies:             # <<<<<<<<<<<<<<
52131  *         c_node = el._c_node
52132  *         el._c_node = NULL
52133  */
52134   if (likely(((PyObject *)__pyx_v_sourceProxy->_dependent_proxies) != Py_None)) {
52135     __pyx_t_2 = 0; __pyx_t_3 = ((PyObject *)__pyx_v_sourceProxy->_dependent_proxies); __Pyx_INCREF(__pyx_t_3);
52136   } else {
52137     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
52138   }
52139   for (;;) {
52140     if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
52141     __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
52142     if (!(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__ReadOnlyElementProxy))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
52143     __Pyx_DECREF(((PyObject *)__pyx_v_el));
52144     __pyx_v_el = ((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_t_4);
52145     __pyx_t_4 = 0;
52146
52147     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":273
52148  *         return
52149  *     for el in sourceProxy._dependent_proxies:
52150  *         c_node = el._c_node             # <<<<<<<<<<<<<<
52151  *         el._c_node = NULL
52152  *         if el._free_after_use:
52153  */
52154     __pyx_v_c_node = __pyx_v_el->_c_node;
52155
52156     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":274
52157  *     for el in sourceProxy._dependent_proxies:
52158  *         c_node = el._c_node
52159  *         el._c_node = NULL             # <<<<<<<<<<<<<<
52160  *         if el._free_after_use:
52161  *             tree.xmlFreeNode(c_node)
52162  */
52163     __pyx_v_el->_c_node = NULL;
52164
52165     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":275
52166  *         c_node = el._c_node
52167  *         el._c_node = NULL
52168  *         if el._free_after_use:             # <<<<<<<<<<<<<<
52169  *             tree.xmlFreeNode(c_node)
52170  *     del sourceProxy._dependent_proxies[:]
52171  */
52172     __pyx_t_1 = __pyx_v_el->_free_after_use;
52173     if (__pyx_t_1) {
52174
52175       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":276
52176  *         el._c_node = NULL
52177  *         if el._free_after_use:
52178  *             tree.xmlFreeNode(c_node)             # <<<<<<<<<<<<<<
52179  *     del sourceProxy._dependent_proxies[:]
52180  * 
52181  */
52182       xmlFreeNode(__pyx_v_c_node);
52183       goto __pyx_L7;
52184     }
52185     __pyx_L7:;
52186   }
52187   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
52188
52189   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":277
52190  *         if el._free_after_use:
52191  *             tree.xmlFreeNode(c_node)
52192  *     del sourceProxy._dependent_proxies[:]             # <<<<<<<<<<<<<<
52193  * 
52194  * cdef class _AppendOnlyElementProxy(_ReadOnlyElementProxy):
52195  */
52196   if (PySequence_DelSlice(((PyObject *)__pyx_v_sourceProxy->_dependent_proxies), 0, PY_SSIZE_T_MAX) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
52197
52198   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
52199   goto __pyx_L0;
52200   __pyx_L1_error:;
52201   __Pyx_XDECREF(__pyx_t_3);
52202   __Pyx_XDECREF(__pyx_t_4);
52203   __Pyx_AddTraceback("lxml.etree._freeReadOnlyProxies");
52204   __pyx_r = 0;
52205   __pyx_L0:;
52206   __Pyx_DECREF((PyObject *)__pyx_v_el);
52207   __Pyx_XGIVEREF(__pyx_r);
52208   __Pyx_FinishRefcountContext();
52209   return __pyx_r;
52210 }
52211
52212 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":283
52213  *     text content (i.e. everything that adds to the subtree).
52214  *     """
52215  *     cpdef append(self, other_element):             # <<<<<<<<<<<<<<
52216  *         u"""Append a copy of an Element to the list of children.
52217  *         """
52218  */
52219
52220 static PyObject *__pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_append(PyObject *__pyx_v_self, PyObject *__pyx_v_other_element); /*proto*/
52221 static  PyObject *__pyx_f_4lxml_5etree_23_AppendOnlyElementProxy_append(struct __pyx_obj_4lxml_5etree__AppendOnlyElementProxy *__pyx_v_self, PyObject *__pyx_v_other_element, int __pyx_skip_dispatch) {
52222   xmlNode *__pyx_v_c_next;
52223   xmlNode *__pyx_v_c_node;
52224   PyObject *__pyx_r = NULL;
52225   PyObject *__pyx_1 = 0;
52226   PyObject *__pyx_t_1 = NULL;
52227   PyObject *__pyx_t_2 = NULL;
52228   int __pyx_t_3;
52229   xmlNode *__pyx_t_4;
52230   xmlNode *__pyx_t_5;
52231   __Pyx_SetupRefcountContext("append");
52232   /* Check if called by wrapper */
52233   if (unlikely(__pyx_skip_dispatch)) ;
52234   /* Check if overriden in Python */
52235   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
52236     __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_kp_append); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
52237     __Pyx_GOTREF(__pyx_1);
52238     if (!PyCFunction_Check(__pyx_1) || (PyCFunction_GET_FUNCTION(__pyx_1) != (void *)&__pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_append)) {
52239       __Pyx_XDECREF(__pyx_r);
52240       __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
52241       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
52242       __Pyx_INCREF(__pyx_v_other_element);
52243       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_other_element);
52244       __Pyx_GIVEREF(__pyx_v_other_element);
52245       __pyx_t_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
52246       __Pyx_GOTREF(__pyx_t_2);
52247       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
52248       __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
52249       __pyx_r = __pyx_t_2;
52250       __pyx_t_2 = 0;
52251       goto __pyx_L0;
52252     }
52253     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
52254   }
52255
52256   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":288
52257  *         cdef xmlNode* c_next
52258  *         cdef xmlNode* c_node
52259  *         self._assertNode()             # <<<<<<<<<<<<<<
52260  *         c_node = _roNodeOf(other_element)
52261  *         c_node = _copyNodeToDoc(c_node, self._c_node.doc)
52262  */
52263   __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__AppendOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
52264
52265   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":289
52266  *         cdef xmlNode* c_node
52267  *         self._assertNode()
52268  *         c_node = _roNodeOf(other_element)             # <<<<<<<<<<<<<<
52269  *         c_node = _copyNodeToDoc(c_node, self._c_node.doc)
52270  *         c_next = c_node.next
52271  */
52272   __pyx_t_4 = __pyx_f_4lxml_5etree__roNodeOf(__pyx_v_other_element); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
52273   __pyx_v_c_node = __pyx_t_4;
52274
52275   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":290
52276  *         self._assertNode()
52277  *         c_node = _roNodeOf(other_element)
52278  *         c_node = _copyNodeToDoc(c_node, self._c_node.doc)             # <<<<<<<<<<<<<<
52279  *         c_next = c_node.next
52280  *         tree.xmlAddChild(self._c_node, c_node)
52281  */
52282   __pyx_t_5 = __pyx_f_4lxml_5etree__copyNodeToDoc(__pyx_v_c_node, __pyx_v_self->__pyx_base._c_node->doc); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
52283   __pyx_v_c_node = __pyx_t_5;
52284
52285   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":291
52286  *         c_node = _roNodeOf(other_element)
52287  *         c_node = _copyNodeToDoc(c_node, self._c_node.doc)
52288  *         c_next = c_node.next             # <<<<<<<<<<<<<<
52289  *         tree.xmlAddChild(self._c_node, c_node)
52290  *         _moveTail(c_next, c_node)
52291  */
52292   __pyx_v_c_next = __pyx_v_c_node->next;
52293
52294   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":292
52295  *         c_node = _copyNodeToDoc(c_node, self._c_node.doc)
52296  *         c_next = c_node.next
52297  *         tree.xmlAddChild(self._c_node, c_node)             # <<<<<<<<<<<<<<
52298  *         _moveTail(c_next, c_node)
52299  * 
52300  */
52301   xmlAddChild(__pyx_v_self->__pyx_base._c_node, __pyx_v_c_node);
52302
52303   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":293
52304  *         c_next = c_node.next
52305  *         tree.xmlAddChild(self._c_node, c_node)
52306  *         _moveTail(c_next, c_node)             # <<<<<<<<<<<<<<
52307  * 
52308  *     def extend(self, elements):
52309  */
52310   __pyx_f_4lxml_5etree__moveTail(__pyx_v_c_next, __pyx_v_c_node);
52311
52312   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
52313   goto __pyx_L0;
52314   __pyx_L1_error:;
52315   __Pyx_XDECREF(__pyx_1);
52316   __Pyx_XDECREF(__pyx_t_1);
52317   __Pyx_XDECREF(__pyx_t_2);
52318   __Pyx_AddTraceback("lxml.etree._AppendOnlyElementProxy.append");
52319   __pyx_r = 0;
52320   __pyx_L0:;
52321   __Pyx_XGIVEREF(__pyx_r);
52322   __Pyx_FinishRefcountContext();
52323   return __pyx_r;
52324 }
52325
52326 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":283
52327  *     text content (i.e. everything that adds to the subtree).
52328  *     """
52329  *     cpdef append(self, other_element):             # <<<<<<<<<<<<<<
52330  *         u"""Append a copy of an Element to the list of children.
52331  *         """
52332  */
52333
52334 static PyObject *__pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_append(PyObject *__pyx_v_self, PyObject *__pyx_v_other_element); /*proto*/
52335 static char __pyx_doc_4lxml_5etree_23_AppendOnlyElementProxy_append[] = "Append a copy of an Element to the list of children.\n        ";
52336 static PyObject *__pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_append(PyObject *__pyx_v_self, PyObject *__pyx_v_other_element) {
52337   PyObject *__pyx_r = NULL;
52338   PyObject *__pyx_t_1 = NULL;
52339   __Pyx_SetupRefcountContext("append");
52340   __Pyx_XDECREF(__pyx_r);
52341   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__AppendOnlyElementProxy *)((struct __pyx_obj_4lxml_5etree__AppendOnlyElementProxy *)__pyx_v_self)->__pyx_base.__pyx_vtab)->append(((struct __pyx_obj_4lxml_5etree__AppendOnlyElementProxy *)__pyx_v_self), __pyx_v_other_element, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
52342   __Pyx_GOTREF(__pyx_t_1);
52343   __pyx_r = __pyx_t_1;
52344   __pyx_t_1 = 0;
52345   goto __pyx_L0;
52346
52347   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
52348   goto __pyx_L0;
52349   __pyx_L1_error:;
52350   __Pyx_XDECREF(__pyx_t_1);
52351   __Pyx_AddTraceback("lxml.etree._AppendOnlyElementProxy.append");
52352   __pyx_r = NULL;
52353   __pyx_L0:;
52354   __Pyx_XGIVEREF(__pyx_r);
52355   __Pyx_FinishRefcountContext();
52356   return __pyx_r;
52357 }
52358
52359 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":295
52360  *         _moveTail(c_next, c_node)
52361  * 
52362  *     def extend(self, elements):             # <<<<<<<<<<<<<<
52363  *         u"""Append a copy of all Elements from a sequence to the list of
52364  *         children.
52365  */
52366
52367 static PyObject *__pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_extend(PyObject *__pyx_v_self, PyObject *__pyx_v_elements); /*proto*/
52368 static char __pyx_doc_4lxml_5etree_23_AppendOnlyElementProxy_extend[] = "Append a copy of all Elements from a sequence to the list of\n        children.\n        ";
52369 static PyObject *__pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_extend(PyObject *__pyx_v_self, PyObject *__pyx_v_elements) {
52370   PyObject *__pyx_v_element;
52371   PyObject *__pyx_r = NULL;
52372   int __pyx_t_1;
52373   Py_ssize_t __pyx_t_2;
52374   PyObject *__pyx_t_3 = NULL;
52375   PyObject *__pyx_t_4 = NULL;
52376   __Pyx_SetupRefcountContext("extend");
52377   __pyx_v_element = Py_None; __Pyx_INCREF(Py_None);
52378
52379   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":299
52380  *         children.
52381  *         """
52382  *         self._assertNode()             # <<<<<<<<<<<<<<
52383  *         for element in elements:
52384  *             self.append(element)
52385  */
52386   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__AppendOnlyElementProxy *)((struct __pyx_obj_4lxml_5etree__AppendOnlyElementProxy *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
52387
52388   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":300
52389  *         """
52390  *         self._assertNode()
52391  *         for element in elements:             # <<<<<<<<<<<<<<
52392  *             self.append(element)
52393  * 
52394  */
52395   if (PyList_CheckExact(__pyx_v_elements) || PyTuple_CheckExact(__pyx_v_elements)) {
52396     __pyx_t_2 = 0; __pyx_t_3 = __pyx_v_elements; __Pyx_INCREF(__pyx_t_3);
52397   } else {
52398     __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
52399     __Pyx_GOTREF(__pyx_t_3);
52400   }
52401   for (;;) {
52402     if (likely(PyList_CheckExact(__pyx_t_3))) {
52403       if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
52404       __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
52405     } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
52406       if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
52407       __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
52408     } else {
52409       __pyx_t_4 = PyIter_Next(__pyx_t_3);
52410       if (!__pyx_t_4) {
52411         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
52412         break;
52413       }
52414       __Pyx_GOTREF(__pyx_t_4);
52415     }
52416     __Pyx_DECREF(__pyx_v_element);
52417     __pyx_v_element = __pyx_t_4;
52418     __pyx_t_4 = 0;
52419
52420     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":301
52421  *         self._assertNode()
52422  *         for element in elements:
52423  *             self.append(element)             # <<<<<<<<<<<<<<
52424  * 
52425  *     property text:
52426  */
52427     __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__AppendOnlyElementProxy *)((struct __pyx_obj_4lxml_5etree__AppendOnlyElementProxy *)__pyx_v_self)->__pyx_base.__pyx_vtab)->append(((struct __pyx_obj_4lxml_5etree__AppendOnlyElementProxy *)__pyx_v_self), __pyx_v_element, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
52428     __Pyx_GOTREF(__pyx_t_4);
52429     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
52430   }
52431   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
52432
52433   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
52434   goto __pyx_L0;
52435   __pyx_L1_error:;
52436   __Pyx_XDECREF(__pyx_t_3);
52437   __Pyx_XDECREF(__pyx_t_4);
52438   __Pyx_AddTraceback("lxml.etree._AppendOnlyElementProxy.extend");
52439   __pyx_r = NULL;
52440   __pyx_L0:;
52441   __Pyx_DECREF(__pyx_v_element);
52442   __Pyx_XGIVEREF(__pyx_r);
52443   __Pyx_FinishRefcountContext();
52444   return __pyx_r;
52445 }
52446
52447 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":307
52448  *         value None, if there was no text.
52449  *         """
52450  *         def __get__(self):             # <<<<<<<<<<<<<<
52451  *             self._assertNode()
52452  *             return _collectText(self._c_node.children)
52453  */
52454
52455 static PyObject *__pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_4text___get__(PyObject *__pyx_v_self); /*proto*/
52456 static PyObject *__pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_4text___get__(PyObject *__pyx_v_self) {
52457   PyObject *__pyx_r = NULL;
52458   int __pyx_t_1;
52459   PyObject *__pyx_t_2 = NULL;
52460   __Pyx_SetupRefcountContext("__get__");
52461
52462   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":308
52463  *         """
52464  *         def __get__(self):
52465  *             self._assertNode()             # <<<<<<<<<<<<<<
52466  *             return _collectText(self._c_node.children)
52467  * 
52468  */
52469   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__AppendOnlyElementProxy *)((struct __pyx_obj_4lxml_5etree__AppendOnlyElementProxy *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
52470
52471   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":309
52472  *         def __get__(self):
52473  *             self._assertNode()
52474  *             return _collectText(self._c_node.children)             # <<<<<<<<<<<<<<
52475  * 
52476  *         def __set__(self, value):
52477  */
52478   __Pyx_XDECREF(__pyx_r);
52479   __pyx_t_2 = __pyx_f_4lxml_5etree__collectText(((struct __pyx_obj_4lxml_5etree__AppendOnlyElementProxy *)__pyx_v_self)->__pyx_base._c_node->children); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
52480   __Pyx_GOTREF(__pyx_t_2);
52481   __pyx_r = __pyx_t_2;
52482   __pyx_t_2 = 0;
52483   goto __pyx_L0;
52484
52485   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
52486   goto __pyx_L0;
52487   __pyx_L1_error:;
52488   __Pyx_XDECREF(__pyx_t_2);
52489   __Pyx_AddTraceback("lxml.etree._AppendOnlyElementProxy.text.__get__");
52490   __pyx_r = NULL;
52491   __pyx_L0:;
52492   __Pyx_XGIVEREF(__pyx_r);
52493   __Pyx_FinishRefcountContext();
52494   return __pyx_r;
52495 }
52496
52497 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":311
52498  *             return _collectText(self._c_node.children)
52499  * 
52500  *         def __set__(self, value):             # <<<<<<<<<<<<<<
52501  *             self._assertNode()
52502  *             if isinstance(value, QName):
52503  */
52504
52505 static int __pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_4text___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
52506 static int __pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_4text___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
52507   int __pyx_r;
52508   int __pyx_t_1;
52509   int __pyx_t_2;
52510   PyObject *__pyx_t_3 = NULL;
52511   PyObject *__pyx_t_4 = NULL;
52512   __Pyx_SetupRefcountContext("__set__");
52513   __Pyx_INCREF(__pyx_v_value);
52514
52515   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":312
52516  * 
52517  *         def __set__(self, value):
52518  *             self._assertNode()             # <<<<<<<<<<<<<<
52519  *             if isinstance(value, QName):
52520  *                 value = python.PyUnicode_FromEncodedObject(
52521  */
52522   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__AppendOnlyElementProxy *)((struct __pyx_obj_4lxml_5etree__AppendOnlyElementProxy *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
52523
52524   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":313
52525  *         def __set__(self, value):
52526  *             self._assertNode()
52527  *             if isinstance(value, QName):             # <<<<<<<<<<<<<<
52528  *                 value = python.PyUnicode_FromEncodedObject(
52529  *                     _resolveQNameText(self, value), 'UTF-8', 'strict')
52530  */
52531   __pyx_t_2 = PyObject_TypeCheck(__pyx_v_value, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree_QName))); 
52532   if (__pyx_t_2) {
52533
52534     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":315
52535  *             if isinstance(value, QName):
52536  *                 value = python.PyUnicode_FromEncodedObject(
52537  *                     _resolveQNameText(self, value), 'UTF-8', 'strict')             # <<<<<<<<<<<<<<
52538  *             _setNodeText(self._c_node, value)
52539  * 
52540  */
52541     if (!(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
52542     __pyx_t_3 = __pyx_f_4lxml_5etree__resolveQNameText(((struct LxmlElement *)__pyx_v_self), __pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
52543     __Pyx_GOTREF(__pyx_t_3);
52544     __pyx_t_4 = PyUnicode_FromEncodedObject(__pyx_t_3, __pyx_k_393, __pyx_k_394); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
52545     __Pyx_GOTREF(__pyx_t_4);
52546     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
52547     __Pyx_DECREF(__pyx_v_value);
52548     __pyx_v_value = __pyx_t_4;
52549     __pyx_t_4 = 0;
52550     goto __pyx_L5;
52551   }
52552   __pyx_L5:;
52553
52554   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":316
52555  *                 value = python.PyUnicode_FromEncodedObject(
52556  *                     _resolveQNameText(self, value), 'UTF-8', 'strict')
52557  *             _setNodeText(self._c_node, value)             # <<<<<<<<<<<<<<
52558  * 
52559  * cdef _AppendOnlyElementProxy _newAppendOnlyProxy(
52560  */
52561   __pyx_t_1 = __pyx_f_4lxml_5etree__setNodeText(((struct __pyx_obj_4lxml_5etree__AppendOnlyElementProxy *)__pyx_v_self)->__pyx_base._c_node, __pyx_v_value); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
52562
52563   __pyx_r = 0;
52564   goto __pyx_L0;
52565   __pyx_L1_error:;
52566   __Pyx_XDECREF(__pyx_t_3);
52567   __Pyx_XDECREF(__pyx_t_4);
52568   __Pyx_AddTraceback("lxml.etree._AppendOnlyElementProxy.text.__set__");
52569   __pyx_r = -1;
52570   __pyx_L0:;
52571   __Pyx_DECREF(__pyx_v_value);
52572   __Pyx_FinishRefcountContext();
52573   return __pyx_r;
52574 }
52575
52576 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":318
52577  *             _setNodeText(self._c_node, value)
52578  * 
52579  * cdef _AppendOnlyElementProxy _newAppendOnlyProxy(             # <<<<<<<<<<<<<<
52580  *     _ReadOnlyElementProxy source_proxy, xmlNode* c_node):
52581  *     cdef _AppendOnlyElementProxy el
52582  */
52583
52584 static  struct __pyx_obj_4lxml_5etree__AppendOnlyElementProxy *__pyx_f_4lxml_5etree__newAppendOnlyProxy(struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *__pyx_v_source_proxy, xmlNode *__pyx_v_c_node) {
52585   struct __pyx_obj_4lxml_5etree__AppendOnlyElementProxy *__pyx_v_el;
52586   struct __pyx_obj_4lxml_5etree__AppendOnlyElementProxy *__pyx_r = NULL;
52587   PyObject *__pyx_t_1 = NULL;
52588   __Pyx_SetupRefcountContext("_newAppendOnlyProxy");
52589   __pyx_v_el = ((struct __pyx_obj_4lxml_5etree__AppendOnlyElementProxy *)Py_None); __Pyx_INCREF(Py_None);
52590
52591   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":321
52592  *     _ReadOnlyElementProxy source_proxy, xmlNode* c_node):
52593  *     cdef _AppendOnlyElementProxy el
52594  *     el = <_AppendOnlyElementProxy>NEW_RO_PROXY(_AppendOnlyElementProxy)             # <<<<<<<<<<<<<<
52595  *     el._c_node = c_node
52596  *     _initReadOnlyProxy(el, source_proxy)
52597  */
52598   __pyx_t_1 = ((PyObject *)PY_NEW(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__AppendOnlyElementProxy)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
52599   __Pyx_GOTREF(__pyx_t_1);
52600   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__AppendOnlyElementProxy *)__pyx_t_1)));
52601   __Pyx_DECREF(((PyObject *)__pyx_v_el));
52602   __pyx_v_el = ((struct __pyx_obj_4lxml_5etree__AppendOnlyElementProxy *)__pyx_t_1);
52603   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
52604
52605   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":322
52606  *     cdef _AppendOnlyElementProxy el
52607  *     el = <_AppendOnlyElementProxy>NEW_RO_PROXY(_AppendOnlyElementProxy)
52608  *     el._c_node = c_node             # <<<<<<<<<<<<<<
52609  *     _initReadOnlyProxy(el, source_proxy)
52610  *     return el
52611  */
52612   __pyx_v_el->__pyx_base._c_node = __pyx_v_c_node;
52613
52614   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":323
52615  *     el = <_AppendOnlyElementProxy>NEW_RO_PROXY(_AppendOnlyElementProxy)
52616  *     el._c_node = c_node
52617  *     _initReadOnlyProxy(el, source_proxy)             # <<<<<<<<<<<<<<
52618  *     return el
52619  * 
52620  */
52621   __pyx_t_1 = __pyx_f_4lxml_5etree__initReadOnlyProxy(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_el), __pyx_v_source_proxy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
52622   __Pyx_GOTREF(__pyx_t_1);
52623   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
52624
52625   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":324
52626  *     el._c_node = c_node
52627  *     _initReadOnlyProxy(el, source_proxy)
52628  *     return el             # <<<<<<<<<<<<<<
52629  * 
52630  * cdef xmlNode* _roNodeOf(element) except NULL:
52631  */
52632   __Pyx_XDECREF(((PyObject *)__pyx_r));
52633   __Pyx_INCREF(((PyObject *)__pyx_v_el));
52634   __pyx_r = __pyx_v_el;
52635   goto __pyx_L0;
52636
52637   __pyx_r = ((struct __pyx_obj_4lxml_5etree__AppendOnlyElementProxy *)Py_None); __Pyx_INCREF(Py_None);
52638   goto __pyx_L0;
52639   __pyx_L1_error:;
52640   __Pyx_XDECREF(__pyx_t_1);
52641   __Pyx_AddTraceback("lxml.etree._newAppendOnlyProxy");
52642   __pyx_r = 0;
52643   __pyx_L0:;
52644   __Pyx_DECREF((PyObject *)__pyx_v_el);
52645   __Pyx_XGIVEREF((PyObject *)__pyx_r);
52646   __Pyx_FinishRefcountContext();
52647   return __pyx_r;
52648 }
52649
52650 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":326
52651  *     return el
52652  * 
52653  * cdef xmlNode* _roNodeOf(element) except NULL:             # <<<<<<<<<<<<<<
52654  *     cdef xmlNode* c_node
52655  *     if isinstance(element, _Element):
52656  */
52657
52658 static  xmlNode *__pyx_f_4lxml_5etree__roNodeOf(PyObject *__pyx_v_element) {
52659   xmlNode *__pyx_v_c_node;
52660   xmlNode *__pyx_r;
52661   int __pyx_t_1;
52662   __Pyx_SetupRefcountContext("_roNodeOf");
52663
52664   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":328
52665  * cdef xmlNode* _roNodeOf(element) except NULL:
52666  *     cdef xmlNode* c_node
52667  *     if isinstance(element, _Element):             # <<<<<<<<<<<<<<
52668  *         c_node = (<_Element>element)._c_node
52669  *     elif isinstance(element, _ReadOnlyElementProxy):
52670  */
52671   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_element, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Element))); 
52672   if (__pyx_t_1) {
52673
52674     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":329
52675  *     cdef xmlNode* c_node
52676  *     if isinstance(element, _Element):
52677  *         c_node = (<_Element>element)._c_node             # <<<<<<<<<<<<<<
52678  *     elif isinstance(element, _ReadOnlyElementProxy):
52679  *         c_node = (<_ReadOnlyElementProxy>element)._c_node
52680  */
52681     __pyx_v_c_node = ((struct LxmlElement *)__pyx_v_element)->_c_node;
52682     goto __pyx_L3;
52683   }
52684
52685   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":330
52686  *     if isinstance(element, _Element):
52687  *         c_node = (<_Element>element)._c_node
52688  *     elif isinstance(element, _ReadOnlyElementProxy):             # <<<<<<<<<<<<<<
52689  *         c_node = (<_ReadOnlyElementProxy>element)._c_node
52690  *     else:
52691  */
52692   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_element, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ReadOnlyElementProxy))); 
52693   if (__pyx_t_1) {
52694
52695     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":331
52696  *         c_node = (<_Element>element)._c_node
52697  *     elif isinstance(element, _ReadOnlyElementProxy):
52698  *         c_node = (<_ReadOnlyElementProxy>element)._c_node             # <<<<<<<<<<<<<<
52699  *     else:
52700  *         raise TypeError, u"invalid value to append()"
52701  */
52702     __pyx_v_c_node = ((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_element)->_c_node;
52703     goto __pyx_L3;
52704   }
52705   /*else*/ {
52706
52707     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":333
52708  *         c_node = (<_ReadOnlyElementProxy>element)._c_node
52709  *     else:
52710  *         raise TypeError, u"invalid value to append()"             # <<<<<<<<<<<<<<
52711  * 
52712  *     if c_node is NULL:
52713  */
52714     __Pyx_Raise(__pyx_builtin_TypeError, ((PyObject *)__pyx_kp_395), 0);
52715     {__pyx_filename = __pyx_f[8]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
52716   }
52717   __pyx_L3:;
52718
52719   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":335
52720  *         raise TypeError, u"invalid value to append()"
52721  * 
52722  *     if c_node is NULL:             # <<<<<<<<<<<<<<
52723  *         raise TypeError, u"invalid element"
52724  *     return c_node
52725  */
52726   __pyx_t_1 = (__pyx_v_c_node == NULL);
52727   if (__pyx_t_1) {
52728
52729     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":336
52730  * 
52731  *     if c_node is NULL:
52732  *         raise TypeError, u"invalid element"             # <<<<<<<<<<<<<<
52733  *     return c_node
52734  */
52735     __Pyx_Raise(__pyx_builtin_TypeError, ((PyObject *)__pyx_kp_396), 0);
52736     {__pyx_filename = __pyx_f[8]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
52737     goto __pyx_L4;
52738   }
52739   __pyx_L4:;
52740
52741   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":337
52742  *     if c_node is NULL:
52743  *         raise TypeError, u"invalid element"
52744  *     return c_node             # <<<<<<<<<<<<<<
52745  */
52746   __pyx_r = __pyx_v_c_node;
52747   goto __pyx_L0;
52748
52749   __pyx_r = 0;
52750   goto __pyx_L0;
52751   __pyx_L1_error:;
52752   __Pyx_AddTraceback("lxml.etree._roNodeOf");
52753   __pyx_r = NULL;
52754   __pyx_L0:;
52755   __Pyx_FinishRefcountContext();
52756   return __pyx_r;
52757 }
52758
52759 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":42
52760  *     hierarchies that implement a common namespace.
52761  *     """
52762  *     def __init__(self, *children, attrib=None, nsmap=None, **_extra):             # <<<<<<<<<<<<<<
52763  *         u"""ElementBase(*children, attrib=None, nsmap=None, **_extra)
52764  *         """
52765  */
52766
52767 static int __pyx_pf_4lxml_5etree_11ElementBase___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
52768 static char __pyx_doc_4lxml_5etree_11ElementBase___init__[] = "ElementBase(*children, attrib=None, nsmap=None, **_extra)\n        ";
52769 static int __pyx_pf_4lxml_5etree_11ElementBase___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
52770   PyObject *__pyx_v_attrib = 0;
52771   PyObject *__pyx_v_nsmap = 0;
52772   PyObject *__pyx_v_children = 0;
52773   PyObject *__pyx_v__extra = 0;
52774   int __pyx_v_is_html;
52775   struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser;
52776   struct LxmlElement *__pyx_v_last_child;
52777   PyObject *__pyx_v_namespace;
52778   PyObject *__pyx_v_ns;
52779   PyObject *__pyx_v_tag;
52780   PyObject *__pyx_v_child;
52781   int __pyx_r;
52782   int __pyx_1;
52783   PyObject *__pyx_2 = 0;
52784   PyObject *__pyx_3 = 0;
52785   PyObject *__pyx_4 = 0;
52786   PyObject *__pyx_t_1 = NULL;
52787   PyObject *__pyx_t_2 = NULL;
52788   PyObject *__pyx_t_3 = NULL;
52789   int __pyx_t_4;
52790   PyObject *__pyx_t_5 = NULL;
52791   PyObject *__pyx_t_6 = NULL;
52792   PyObject *__pyx_t_7 = NULL;
52793   Py_ssize_t __pyx_t_8;
52794   int __pyx_t_9;
52795   int __pyx_t_10;
52796   int __pyx_t_11;
52797   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_attrib,&__pyx_kp_nsmap,0};
52798   __Pyx_SetupRefcountContext("__init__");
52799   __pyx_v__extra = PyDict_New(); if (unlikely(!__pyx_v__extra)) return -1;
52800   __Pyx_GOTREF(__pyx_v__extra);
52801   if (PyTuple_GET_SIZE(__pyx_args) > 0) {
52802     __pyx_v_children = PyTuple_GetSlice(__pyx_args, 0, PyTuple_GET_SIZE(__pyx_args)); __Pyx_GOTREF(__pyx_v_children);
52803
52804     if (unlikely(!__pyx_v_children)) {
52805       __Pyx_DECREF(__pyx_v__extra);
52806       return -1;
52807     }
52808   } else {
52809     __pyx_v_children = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
52810   }
52811   if (unlikely(__pyx_kwds)) {
52812     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
52813     PyObject* values[2] = {0,0};
52814     values[0] = Py_None;
52815     values[1] = Py_None;
52816     switch (PyTuple_GET_SIZE(__pyx_args)) {
52817       default:
52818       case  0: break;
52819     }
52820     if (unlikely(kw_args > 0)) {
52821       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__extra, values, 0, "__init__") < 0)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
52822     }
52823     __pyx_v_attrib = values[0];
52824     __pyx_v_nsmap = values[1];
52825   } else if (PyTuple_GET_SIZE(__pyx_args) < 0) {
52826     goto __pyx_L5_argtuple_error;
52827   } else {
52828     __pyx_v_attrib = Py_None;
52829     __pyx_v_nsmap = Py_None;
52830   }
52831   goto __pyx_L4_argument_unpacking_done;
52832   __pyx_L5_argtuple_error:;
52833   __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 0, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
52834   __pyx_L3_error:;
52835   __Pyx_DECREF(__pyx_v_children);
52836   __Pyx_DECREF(__pyx_v__extra);
52837   __Pyx_AddTraceback("lxml.etree.ElementBase.__init__");
52838   return -1;
52839   __pyx_L4_argument_unpacking_done:;
52840   __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None); __Pyx_INCREF(Py_None);
52841   __pyx_v_last_child = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
52842   __pyx_v_namespace = Py_None; __Pyx_INCREF(Py_None);
52843   __pyx_v_ns = Py_None; __Pyx_INCREF(Py_None);
52844   __pyx_v_tag = Py_None; __Pyx_INCREF(Py_None);
52845   __pyx_v_child = Py_None; __Pyx_INCREF(Py_None);
52846
52847   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":45
52848  *         u"""ElementBase(*children, attrib=None, nsmap=None, **_extra)
52849  *         """
52850  *         cdef bint is_html = 0             # <<<<<<<<<<<<<<
52851  *         cdef _BaseParser parser
52852  *         cdef _Element last_child
52853  */
52854   __pyx_v_is_html = 0;
52855
52856   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":48
52857  *         cdef _BaseParser parser
52858  *         cdef _Element last_child
52859  *         try:             # <<<<<<<<<<<<<<
52860  *             namespace = _utf8(self.NAMESPACE)
52861  *         except AttributeError:
52862  */
52863   {
52864     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
52865     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
52866     __Pyx_XGOTREF(__pyx_save_exc_type);
52867     __Pyx_XGOTREF(__pyx_save_exc_value);
52868     __Pyx_XGOTREF(__pyx_save_exc_tb);
52869     /*try:*/ {
52870
52871       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":49
52872  *         cdef _Element last_child
52873  *         try:
52874  *             namespace = _utf8(self.NAMESPACE)             # <<<<<<<<<<<<<<
52875  *         except AttributeError:
52876  *             namespace = None
52877  */
52878       __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_NAMESPACE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
52879       __Pyx_GOTREF(__pyx_t_1);
52880       __pyx_t_2 = __pyx_f_4lxml_5etree__utf8(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
52881       __Pyx_GOTREF(__pyx_t_2);
52882       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
52883       __Pyx_DECREF(__pyx_v_namespace);
52884       __pyx_v_namespace = __pyx_t_2;
52885       __pyx_t_2 = 0;
52886     }
52887     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
52888     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
52889     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
52890     goto __pyx_L13_try_end;
52891     __pyx_L6_error:;
52892     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
52893     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
52894
52895     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":50
52896  *         try:
52897  *             namespace = _utf8(self.NAMESPACE)
52898  *         except AttributeError:             # <<<<<<<<<<<<<<
52899  *             namespace = None
52900  *         try:
52901  */
52902     __pyx_1 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
52903     if (__pyx_1) {
52904       __Pyx_AddTraceback("lxml.etree.__init__");
52905       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
52906       __Pyx_GOTREF(__pyx_t_2);
52907       __Pyx_GOTREF(__pyx_t_1);
52908       __Pyx_GOTREF(__pyx_t_3);
52909
52910       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":51
52911  *             namespace = _utf8(self.NAMESPACE)
52912  *         except AttributeError:
52913  *             namespace = None             # <<<<<<<<<<<<<<
52914  *         try:
52915  *             ns, tag = _getNsTag(self.TAG)
52916  */
52917       __Pyx_INCREF(Py_None);
52918       __Pyx_DECREF(__pyx_v_namespace);
52919       __pyx_v_namespace = Py_None;
52920       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
52921       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
52922       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
52923       goto __pyx_L7_exception_handled;
52924     }
52925     __pyx_L8_except_error:;
52926     __Pyx_XDECREF(__pyx_save_exc_type);
52927     __Pyx_XDECREF(__pyx_save_exc_value);
52928     __Pyx_XDECREF(__pyx_save_exc_tb);
52929     goto __pyx_L1_error;
52930     __pyx_L7_exception_handled:;
52931     __Pyx_XGIVEREF(__pyx_save_exc_type);
52932     __Pyx_XGIVEREF(__pyx_save_exc_value);
52933     __Pyx_XGIVEREF(__pyx_save_exc_tb);
52934     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
52935     __pyx_L13_try_end:;
52936   }
52937
52938   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":52
52939  *         except AttributeError:
52940  *             namespace = None
52941  *         try:             # <<<<<<<<<<<<<<
52942  *             ns, tag = _getNsTag(self.TAG)
52943  *             if ns is not None:
52944  */
52945   {
52946     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
52947     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
52948     __Pyx_XGOTREF(__pyx_save_exc_type);
52949     __Pyx_XGOTREF(__pyx_save_exc_value);
52950     __Pyx_XGOTREF(__pyx_save_exc_tb);
52951     /*try:*/ {
52952
52953       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":53
52954  *             namespace = None
52955  *         try:
52956  *             ns, tag = _getNsTag(self.TAG)             # <<<<<<<<<<<<<<
52957  *             if ns is not None:
52958  *                 namespace = ns
52959  */
52960       __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_TAG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
52961       __Pyx_GOTREF(__pyx_t_3);
52962       __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
52963       __Pyx_GOTREF(__pyx_t_1);
52964       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
52965       if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 2)) {
52966         PyObject* tuple = __pyx_t_1;
52967         __pyx_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_3);
52968         __pyx_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_4);
52969         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
52970         __Pyx_DECREF(__pyx_v_ns);
52971         __pyx_v_ns = __pyx_3;
52972         __pyx_3 = 0;
52973         __Pyx_DECREF(__pyx_v_tag);
52974         __pyx_v_tag = __pyx_4;
52975         __pyx_4 = 0;
52976       } else {
52977         __pyx_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
52978         __Pyx_GOTREF(__pyx_2);
52979         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
52980         __pyx_3 = __Pyx_UnpackItem(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
52981         __Pyx_GOTREF(__pyx_3);
52982         __pyx_4 = __Pyx_UnpackItem(__pyx_2, 1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
52983         __Pyx_GOTREF(__pyx_4);
52984         if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
52985         __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
52986         __Pyx_DECREF(__pyx_v_ns);
52987         __pyx_v_ns = __pyx_3;
52988         __pyx_3 = 0;
52989         __Pyx_DECREF(__pyx_v_tag);
52990         __pyx_v_tag = __pyx_4;
52991         __pyx_4 = 0;
52992       }
52993
52994       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":54
52995  *         try:
52996  *             ns, tag = _getNsTag(self.TAG)
52997  *             if ns is not None:             # <<<<<<<<<<<<<<
52998  *                 namespace = ns
52999  *         except AttributeError:
53000  */
53001       __pyx_t_4 = (__pyx_v_ns != Py_None);
53002       if (__pyx_t_4) {
53003
53004         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":55
53005  *             ns, tag = _getNsTag(self.TAG)
53006  *             if ns is not None:
53007  *                 namespace = ns             # <<<<<<<<<<<<<<
53008  *         except AttributeError:
53009  *             tag = _utf8(self.__class__.__name__)
53010  */
53011         __Pyx_INCREF(__pyx_v_ns);
53012         __Pyx_DECREF(__pyx_v_namespace);
53013         __pyx_v_namespace = __pyx_v_ns;
53014         goto __pyx_L24;
53015       }
53016       __pyx_L24:;
53017     }
53018     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
53019     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
53020     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
53021     goto __pyx_L23_try_end;
53022     __pyx_L16_error:;
53023     __Pyx_XDECREF(__pyx_2); __pyx_2 = 0;
53024     __Pyx_XDECREF(__pyx_3); __pyx_3 = 0;
53025     __Pyx_XDECREF(__pyx_4); __pyx_4 = 0;
53026     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
53027     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
53028     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
53029
53030     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":56
53031  *             if ns is not None:
53032  *                 namespace = ns
53033  *         except AttributeError:             # <<<<<<<<<<<<<<
53034  *             tag = _utf8(self.__class__.__name__)
53035  *             if '.' in tag:
53036  */
53037     __pyx_1 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
53038     if (__pyx_1) {
53039       __Pyx_AddTraceback("lxml.etree.__init__");
53040       if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
53041       __Pyx_GOTREF(__pyx_t_1);
53042       __Pyx_GOTREF(__pyx_t_3);
53043       __Pyx_GOTREF(__pyx_t_2);
53044
53045       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":57
53046  *                 namespace = ns
53047  *         except AttributeError:
53048  *             tag = _utf8(self.__class__.__name__)             # <<<<<<<<<<<<<<
53049  *             if '.' in tag:
53050  *                 tag = tag.split('.')[-1]
53051  */
53052       __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_kp___class__); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
53053       __Pyx_GOTREF(__pyx_t_5);
53054       __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_kp___name__); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
53055       __Pyx_GOTREF(__pyx_t_6);
53056       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
53057       __pyx_t_5 = __pyx_f_4lxml_5etree__utf8(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
53058       __Pyx_GOTREF(__pyx_t_5);
53059       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
53060       __Pyx_DECREF(__pyx_v_tag);
53061       __pyx_v_tag = __pyx_t_5;
53062       __pyx_t_5 = 0;
53063
53064       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":58
53065  *         except AttributeError:
53066  *             tag = _utf8(self.__class__.__name__)
53067  *             if '.' in tag:             # <<<<<<<<<<<<<<
53068  *                 tag = tag.split('.')[-1]
53069  *         try:
53070  */
53071       __pyx_t_4 = (PySequence_Contains(__pyx_v_tag, __pyx_kp_397)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
53072       if (__pyx_t_4) {
53073
53074         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":59
53075  *             tag = _utf8(self.__class__.__name__)
53076  *             if '.' in tag:
53077  *                 tag = tag.split('.')[-1]             # <<<<<<<<<<<<<<
53078  *         try:
53079  *             parser = self.PARSER
53080  */
53081         __pyx_t_5 = PyObject_GetAttr(__pyx_v_tag, __pyx_kp_split); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
53082         __Pyx_GOTREF(__pyx_t_5);
53083         __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
53084         __Pyx_GOTREF(((PyObject *)__pyx_t_6));
53085         __Pyx_INCREF(__pyx_kp_398);
53086         PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_398);
53087         __Pyx_GIVEREF(__pyx_kp_398);
53088         __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
53089         __Pyx_GOTREF(__pyx_t_7);
53090         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
53091         __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
53092         __pyx_2 = __Pyx_GetItemInt(__pyx_t_7, -1, sizeof(long), PyInt_FromLong); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
53093         __Pyx_GOTREF(__pyx_2);
53094         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
53095         __Pyx_DECREF(__pyx_v_tag);
53096         __pyx_v_tag = __pyx_2;
53097         __pyx_2 = 0;
53098         goto __pyx_L27;
53099       }
53100       __pyx_L27:;
53101       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
53102       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
53103       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
53104       goto __pyx_L17_exception_handled;
53105     }
53106     __pyx_L18_except_error:;
53107     __Pyx_XDECREF(__pyx_save_exc_type);
53108     __Pyx_XDECREF(__pyx_save_exc_value);
53109     __Pyx_XDECREF(__pyx_save_exc_tb);
53110     goto __pyx_L1_error;
53111     __pyx_L17_exception_handled:;
53112     __Pyx_XGIVEREF(__pyx_save_exc_type);
53113     __Pyx_XGIVEREF(__pyx_save_exc_value);
53114     __Pyx_XGIVEREF(__pyx_save_exc_tb);
53115     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
53116     __pyx_L23_try_end:;
53117   }
53118
53119   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":60
53120  *             if '.' in tag:
53121  *                 tag = tag.split('.')[-1]
53122  *         try:             # <<<<<<<<<<<<<<
53123  *             parser = self.PARSER
53124  *         except AttributeError:
53125  */
53126   {
53127     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
53128     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
53129     __Pyx_XGOTREF(__pyx_save_exc_type);
53130     __Pyx_XGOTREF(__pyx_save_exc_value);
53131     __Pyx_XGOTREF(__pyx_save_exc_tb);
53132     /*try:*/ {
53133
53134       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":61
53135  *                 tag = tag.split('.')[-1]
53136  *         try:
53137  *             parser = self.PARSER             # <<<<<<<<<<<<<<
53138  *         except AttributeError:
53139  *             parser = None
53140  */
53141       __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_PARSER); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
53142       __Pyx_GOTREF(__pyx_t_2);
53143       if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__BaseParser))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
53144       __Pyx_DECREF(((PyObject *)__pyx_v_parser));
53145       __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_2);
53146       __pyx_t_2 = 0;
53147     }
53148     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
53149     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
53150     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
53151     goto __pyx_L35_try_end;
53152     __pyx_L28_error:;
53153     __Pyx_XDECREF(__pyx_3); __pyx_3 = 0;
53154     __Pyx_XDECREF(__pyx_4); __pyx_4 = 0;
53155     __Pyx_XDECREF(__pyx_2); __pyx_2 = 0;
53156     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
53157     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
53158     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
53159     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
53160     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
53161     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
53162
53163     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":62
53164  *         try:
53165  *             parser = self.PARSER
53166  *         except AttributeError:             # <<<<<<<<<<<<<<
53167  *             parser = None
53168  *             for child in children:
53169  */
53170     __pyx_1 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
53171     if (__pyx_1) {
53172       __Pyx_AddTraceback("lxml.etree.__init__");
53173       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;}
53174       __Pyx_GOTREF(__pyx_t_2);
53175       __Pyx_GOTREF(__pyx_t_3);
53176       __Pyx_GOTREF(__pyx_t_1);
53177
53178       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":63
53179  *             parser = self.PARSER
53180  *         except AttributeError:
53181  *             parser = None             # <<<<<<<<<<<<<<
53182  *             for child in children:
53183  *                 if isinstance(child, _Element):
53184  */
53185       __Pyx_INCREF(Py_None);
53186       __Pyx_DECREF(((PyObject *)__pyx_v_parser));
53187       __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None);
53188
53189       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":64
53190  *         except AttributeError:
53191  *             parser = None
53192  *             for child in children:             # <<<<<<<<<<<<<<
53193  *                 if isinstance(child, _Element):
53194  *                     parser = (<_Element>child)._doc._parser
53195  */
53196       if (PyList_CheckExact(__pyx_v_children) || PyTuple_CheckExact(__pyx_v_children)) {
53197         __pyx_t_8 = 0; __pyx_t_7 = __pyx_v_children; __Pyx_INCREF(__pyx_t_7);
53198       } else {
53199         __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_children); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;}
53200         __Pyx_GOTREF(__pyx_t_7);
53201       }
53202       for (;;) {
53203         if (likely(PyList_CheckExact(__pyx_t_7))) {
53204           if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break;
53205           __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++;
53206         } else if (likely(PyTuple_CheckExact(__pyx_t_7))) {
53207           if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
53208           __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++;
53209         } else {
53210           __pyx_t_6 = PyIter_Next(__pyx_t_7);
53211           if (!__pyx_t_6) {
53212             if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L30_except_error;}
53213             break;
53214           }
53215           __Pyx_GOTREF(__pyx_t_6);
53216         }
53217         __Pyx_DECREF(__pyx_v_child);
53218         __pyx_v_child = __pyx_t_6;
53219         __pyx_t_6 = 0;
53220
53221         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":65
53222  *             parser = None
53223  *             for child in children:
53224  *                 if isinstance(child, _Element):             # <<<<<<<<<<<<<<
53225  *                     parser = (<_Element>child)._doc._parser
53226  *                     break
53227  */
53228         __pyx_t_4 = PyObject_TypeCheck(__pyx_v_child, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Element))); 
53229         if (__pyx_t_4) {
53230
53231           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":66
53232  *             for child in children:
53233  *                 if isinstance(child, _Element):
53234  *                     parser = (<_Element>child)._doc._parser             # <<<<<<<<<<<<<<
53235  *                     break
53236  *         if isinstance(parser, HTMLParser):
53237  */
53238           __Pyx_INCREF(((PyObject *)((struct LxmlElement *)__pyx_v_child)->_doc->_parser));
53239           __Pyx_DECREF(((PyObject *)__pyx_v_parser));
53240           __pyx_v_parser = ((struct LxmlElement *)__pyx_v_child)->_doc->_parser;
53241
53242           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":67
53243  *                 if isinstance(child, _Element):
53244  *                     parser = (<_Element>child)._doc._parser
53245  *                     break             # <<<<<<<<<<<<<<
53246  *         if isinstance(parser, HTMLParser):
53247  *             is_html = 1
53248  */
53249           goto __pyx_L39_break;
53250           goto __pyx_L40;
53251         }
53252         __pyx_L40:;
53253       }
53254       __pyx_L39_break:;
53255       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
53256       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
53257       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
53258       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
53259       goto __pyx_L29_exception_handled;
53260     }
53261     __pyx_L30_except_error:;
53262     __Pyx_XDECREF(__pyx_save_exc_type);
53263     __Pyx_XDECREF(__pyx_save_exc_value);
53264     __Pyx_XDECREF(__pyx_save_exc_tb);
53265     goto __pyx_L1_error;
53266     __pyx_L29_exception_handled:;
53267     __Pyx_XGIVEREF(__pyx_save_exc_type);
53268     __Pyx_XGIVEREF(__pyx_save_exc_value);
53269     __Pyx_XGIVEREF(__pyx_save_exc_tb);
53270     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
53271     __pyx_L35_try_end:;
53272   }
53273
53274   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":68
53275  *                     parser = (<_Element>child)._doc._parser
53276  *                     break
53277  *         if isinstance(parser, HTMLParser):             # <<<<<<<<<<<<<<
53278  *             is_html = 1
53279  *         if namespace is None:
53280  */
53281   __pyx_t_4 = PyObject_TypeCheck(((PyObject *)__pyx_v_parser), ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree_HTMLParser))); 
53282   if (__pyx_t_4) {
53283
53284     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":69
53285  *                     break
53286  *         if isinstance(parser, HTMLParser):
53287  *             is_html = 1             # <<<<<<<<<<<<<<
53288  *         if namespace is None:
53289  *             try:
53290  */
53291     __pyx_v_is_html = 1;
53292     goto __pyx_L41;
53293   }
53294   __pyx_L41:;
53295
53296   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":70
53297  *         if isinstance(parser, HTMLParser):
53298  *             is_html = 1
53299  *         if namespace is None:             # <<<<<<<<<<<<<<
53300  *             try:
53301  *                 is_html = self.HTML
53302  */
53303   __pyx_t_4 = (__pyx_v_namespace == Py_None);
53304   if (__pyx_t_4) {
53305
53306     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":71
53307  *             is_html = 1
53308  *         if namespace is None:
53309  *             try:             # <<<<<<<<<<<<<<
53310  *                 is_html = self.HTML
53311  *             except AttributeError:
53312  */
53313     {
53314       PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
53315       __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
53316       __Pyx_XGOTREF(__pyx_save_exc_type);
53317       __Pyx_XGOTREF(__pyx_save_exc_value);
53318       __Pyx_XGOTREF(__pyx_save_exc_tb);
53319       /*try:*/ {
53320
53321         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":72
53322  *         if namespace is None:
53323  *             try:
53324  *                 is_html = self.HTML             # <<<<<<<<<<<<<<
53325  *             except AttributeError:
53326  *                 pass
53327  */
53328         __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_HTML); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L43_error;}
53329         __Pyx_GOTREF(__pyx_t_1);
53330         __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L43_error;}
53331         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
53332         __pyx_v_is_html = __pyx_t_4;
53333       }
53334       __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
53335       __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
53336       __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
53337       goto __pyx_L50_try_end;
53338       __pyx_L43_error:;
53339       __Pyx_XDECREF(__pyx_3); __pyx_3 = 0;
53340       __Pyx_XDECREF(__pyx_4); __pyx_4 = 0;
53341       __Pyx_XDECREF(__pyx_2); __pyx_2 = 0;
53342       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
53343       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
53344       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
53345       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
53346       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
53347       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
53348
53349       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":73
53350  *             try:
53351  *                 is_html = self.HTML
53352  *             except AttributeError:             # <<<<<<<<<<<<<<
53353  *                 pass
53354  *         _initNewElement(self, is_html, tag, namespace, parser,
53355  */
53356       __pyx_1 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
53357       if (__pyx_1) {
53358         PyErr_Restore(0,0,0);
53359         goto __pyx_L44_exception_handled;
53360       }
53361       __Pyx_XDECREF(__pyx_save_exc_type);
53362       __Pyx_XDECREF(__pyx_save_exc_value);
53363       __Pyx_XDECREF(__pyx_save_exc_tb);
53364       goto __pyx_L1_error;
53365       __pyx_L44_exception_handled:;
53366       __Pyx_XGIVEREF(__pyx_save_exc_type);
53367       __Pyx_XGIVEREF(__pyx_save_exc_value);
53368       __Pyx_XGIVEREF(__pyx_save_exc_tb);
53369       __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
53370       __pyx_L50_try_end:;
53371     }
53372     goto __pyx_L42;
53373   }
53374   __pyx_L42:;
53375
53376   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":76
53377  *                 pass
53378  *         _initNewElement(self, is_html, tag, namespace, parser,
53379  *                         attrib, nsmap, _extra)             # <<<<<<<<<<<<<<
53380  *         last_child = None
53381  *         for child in children:
53382  */
53383   __pyx_t_9 = __pyx_f_4lxml_5etree__initNewElement(((struct LxmlElement *)__pyx_v_self), __pyx_v_is_html, __pyx_v_tag, __pyx_v_namespace, __pyx_v_parser, __pyx_v_attrib, __pyx_v_nsmap, __pyx_v__extra); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
53384
53385   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":77
53386  *         _initNewElement(self, is_html, tag, namespace, parser,
53387  *                         attrib, nsmap, _extra)
53388  *         last_child = None             # <<<<<<<<<<<<<<
53389  *         for child in children:
53390  *             if _isString(child):
53391  */
53392   __Pyx_INCREF(Py_None);
53393   __Pyx_DECREF(((PyObject *)__pyx_v_last_child));
53394   __pyx_v_last_child = ((struct LxmlElement *)Py_None);
53395
53396   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":78
53397  *                         attrib, nsmap, _extra)
53398  *         last_child = None
53399  *         for child in children:             # <<<<<<<<<<<<<<
53400  *             if _isString(child):
53401  *                 if last_child is None:
53402  */
53403   if (PyList_CheckExact(__pyx_v_children) || PyTuple_CheckExact(__pyx_v_children)) {
53404     __pyx_t_8 = 0; __pyx_t_1 = __pyx_v_children; __Pyx_INCREF(__pyx_t_1);
53405   } else {
53406     __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
53407     __Pyx_GOTREF(__pyx_t_1);
53408   }
53409   for (;;) {
53410     if (likely(PyList_CheckExact(__pyx_t_1))) {
53411       if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break;
53412       __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++;
53413     } else if (likely(PyTuple_CheckExact(__pyx_t_1))) {
53414       if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
53415       __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++;
53416     } else {
53417       __pyx_t_3 = PyIter_Next(__pyx_t_1);
53418       if (!__pyx_t_3) {
53419         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
53420         break;
53421       }
53422       __Pyx_GOTREF(__pyx_t_3);
53423     }
53424     __Pyx_DECREF(__pyx_v_child);
53425     __pyx_v_child = __pyx_t_3;
53426     __pyx_t_3 = 0;
53427
53428     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":79
53429  *         last_child = None
53430  *         for child in children:
53431  *             if _isString(child):             # <<<<<<<<<<<<<<
53432  *                 if last_child is None:
53433  *                     if _hasText(self._c_node):
53434  */
53435     __pyx_t_4 = _isString(__pyx_v_child);
53436     if (__pyx_t_4) {
53437
53438       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":80
53439  *         for child in children:
53440  *             if _isString(child):
53441  *                 if last_child is None:             # <<<<<<<<<<<<<<
53442  *                     if _hasText(self._c_node):
53443  *                         self.text += child
53444  */
53445       __pyx_t_4 = (((PyObject *)__pyx_v_last_child) == Py_None);
53446       if (__pyx_t_4) {
53447
53448         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":81
53449  *             if _isString(child):
53450  *                 if last_child is None:
53451  *                     if _hasText(self._c_node):             # <<<<<<<<<<<<<<
53452  *                         self.text += child
53453  *                     else:
53454  */
53455         __pyx_t_9 = __pyx_f_4lxml_5etree__hasText(((struct LxmlElementBase *)__pyx_v_self)->__pyx_base._c_node);
53456         if (__pyx_t_9) {
53457
53458           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":82
53459  *                 if last_child is None:
53460  *                     if _hasText(self._c_node):
53461  *                         self.text += child             # <<<<<<<<<<<<<<
53462  *                     else:
53463  *                         self.text = child
53464  */
53465           __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_text); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
53466           __Pyx_GOTREF(__pyx_t_3);
53467           __pyx_3 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_v_child); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
53468           __Pyx_GOTREF(__pyx_3);
53469           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
53470           if (PyObject_SetAttr(__pyx_v_self, __pyx_kp_text, __pyx_3) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
53471           __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
53472           goto __pyx_L55;
53473         }
53474         /*else*/ {
53475
53476           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":84
53477  *                         self.text += child
53478  *                     else:
53479  *                         self.text = child             # <<<<<<<<<<<<<<
53480  *                 else:
53481  *                     if _hasTail(last_child._c_node):
53482  */
53483           if (PyObject_SetAttr(__pyx_v_self, __pyx_kp_text, __pyx_v_child) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
53484         }
53485         __pyx_L55:;
53486         goto __pyx_L54;
53487       }
53488       /*else*/ {
53489
53490         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":86
53491  *                         self.text = child
53492  *                 else:
53493  *                     if _hasTail(last_child._c_node):             # <<<<<<<<<<<<<<
53494  *                         last_child.tail += child
53495  *                     else:
53496  */
53497         __pyx_t_9 = __pyx_f_4lxml_5etree__hasTail(__pyx_v_last_child->_c_node);
53498         if (__pyx_t_9) {
53499
53500           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":87
53501  *                 else:
53502  *                     if _hasTail(last_child._c_node):
53503  *                         last_child.tail += child             # <<<<<<<<<<<<<<
53504  *                     else:
53505  *                         last_child.tail = child
53506  */
53507           __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_last_child), __pyx_kp_tail); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
53508           __Pyx_GOTREF(__pyx_t_3);
53509           __pyx_4 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_v_child); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
53510           __Pyx_GOTREF(__pyx_4);
53511           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
53512           if (PyObject_SetAttr(((PyObject *)__pyx_v_last_child), __pyx_kp_tail, __pyx_4) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
53513           __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
53514           goto __pyx_L56;
53515         }
53516         /*else*/ {
53517
53518           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":89
53519  *                         last_child.tail += child
53520  *                     else:
53521  *                         last_child.tail = child             # <<<<<<<<<<<<<<
53522  *             elif isinstance(child, _Element):
53523  *                 last_child = child
53524  */
53525           if (PyObject_SetAttr(((PyObject *)__pyx_v_last_child), __pyx_kp_tail, __pyx_v_child) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
53526         }
53527         __pyx_L56:;
53528       }
53529       __pyx_L54:;
53530       goto __pyx_L53;
53531     }
53532
53533     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":90
53534  *                     else:
53535  *                         last_child.tail = child
53536  *             elif isinstance(child, _Element):             # <<<<<<<<<<<<<<
53537  *                 last_child = child
53538  *                 _appendChild(self, last_child)
53539  */
53540     __pyx_t_4 = PyObject_TypeCheck(__pyx_v_child, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Element))); 
53541     if (__pyx_t_4) {
53542
53543       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":91
53544  *                         last_child.tail = child
53545  *             elif isinstance(child, _Element):
53546  *                 last_child = child             # <<<<<<<<<<<<<<
53547  *                 _appendChild(self, last_child)
53548  *             elif isinstance(child, type) and issubclass(child, ElementBase):
53549  */
53550       if (!(__Pyx_TypeTest(__pyx_v_child, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
53551       __Pyx_INCREF(__pyx_v_child);
53552       __Pyx_DECREF(((PyObject *)__pyx_v_last_child));
53553       __pyx_v_last_child = ((struct LxmlElement *)__pyx_v_child);
53554
53555       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":92
53556  *             elif isinstance(child, _Element):
53557  *                 last_child = child
53558  *                 _appendChild(self, last_child)             # <<<<<<<<<<<<<<
53559  *             elif isinstance(child, type) and issubclass(child, ElementBase):
53560  *                 last_child = child()
53561  */
53562       __pyx_t_9 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_v_self), __pyx_v_last_child); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
53563       goto __pyx_L53;
53564     }
53565
53566     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":93
53567  *                 last_child = child
53568  *                 _appendChild(self, last_child)
53569  *             elif isinstance(child, type) and issubclass(child, ElementBase):             # <<<<<<<<<<<<<<
53570  *                 last_child = child()
53571  *                 _appendChild(self, last_child)
53572  */
53573     __pyx_t_4 = PyObject_TypeCheck(__pyx_v_child, ((PyTypeObject *)((PyObject*)&PyType_Type))); 
53574     if (__pyx_t_4) {
53575       __pyx_t_10 = PyObject_IsSubclass(__pyx_v_child, ((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_ElementBase))); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
53576       __pyx_t_11 = __pyx_t_10;
53577     } else {
53578       __pyx_t_11 = __pyx_t_4;
53579     }
53580     if (__pyx_t_11) {
53581
53582       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":94
53583  *                 _appendChild(self, last_child)
53584  *             elif isinstance(child, type) and issubclass(child, ElementBase):
53585  *                 last_child = child()             # <<<<<<<<<<<<<<
53586  *                 _appendChild(self, last_child)
53587  *             else:
53588  */
53589       __pyx_t_3 = PyObject_Call(__pyx_v_child, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
53590       __Pyx_GOTREF(__pyx_t_3);
53591       if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
53592       __Pyx_DECREF(((PyObject *)__pyx_v_last_child));
53593       __pyx_v_last_child = ((struct LxmlElement *)__pyx_t_3);
53594       __pyx_t_3 = 0;
53595
53596       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":95
53597  *             elif isinstance(child, type) and issubclass(child, ElementBase):
53598  *                 last_child = child()
53599  *                 _appendChild(self, last_child)             # <<<<<<<<<<<<<<
53600  *             else:
53601  *                 raise TypeError, "Invalid child type: %r" % type(child)
53602  */
53603       __pyx_t_9 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_v_self), __pyx_v_last_child); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
53604       goto __pyx_L53;
53605     }
53606     /*else*/ {
53607
53608       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":97
53609  *                 _appendChild(self, last_child)
53610  *             else:
53611  *                 raise TypeError, "Invalid child type: %r" % type(child)             # <<<<<<<<<<<<<<
53612  * 
53613  * cdef class CommentBase(_Comment):
53614  */
53615       __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
53616       __Pyx_GOTREF(((PyObject *)__pyx_t_3));
53617       __Pyx_INCREF(__pyx_v_child);
53618       PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_child);
53619       __Pyx_GIVEREF(__pyx_v_child);
53620       __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyType_Type)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
53621       __Pyx_GOTREF(__pyx_t_2);
53622       __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
53623       __pyx_t_3 = PyNumber_Remainder(__pyx_kp_399, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
53624       __Pyx_GOTREF(__pyx_t_3);
53625       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
53626       __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_3, 0);
53627       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
53628       {__pyx_filename = __pyx_f[9]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
53629     }
53630     __pyx_L53:;
53631   }
53632   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
53633
53634   __pyx_r = 0;
53635   goto __pyx_L0;
53636   __pyx_L1_error:;
53637   __Pyx_XDECREF(__pyx_2);
53638   __Pyx_XDECREF(__pyx_3);
53639   __Pyx_XDECREF(__pyx_4);
53640   __Pyx_XDECREF(__pyx_t_1);
53641   __Pyx_XDECREF(__pyx_t_2);
53642   __Pyx_XDECREF(__pyx_t_3);
53643   __Pyx_XDECREF(__pyx_t_5);
53644   __Pyx_XDECREF(__pyx_t_6);
53645   __Pyx_XDECREF(__pyx_t_7);
53646   __Pyx_AddTraceback("lxml.etree.ElementBase.__init__");
53647   __pyx_r = -1;
53648   __pyx_L0:;
53649   __Pyx_DECREF(__pyx_v_children);
53650   __Pyx_DECREF(__pyx_v__extra);
53651   __Pyx_DECREF((PyObject *)__pyx_v_parser);
53652   __Pyx_DECREF((PyObject *)__pyx_v_last_child);
53653   __Pyx_DECREF(__pyx_v_namespace);
53654   __Pyx_DECREF(__pyx_v_ns);
53655   __Pyx_DECREF(__pyx_v_tag);
53656   __Pyx_DECREF(__pyx_v_child);
53657   __Pyx_FinishRefcountContext();
53658   return __pyx_r;
53659 }
53660
53661 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":154
53662  *     """
53663  *     cdef _element_class_lookup_function _lookup_function
53664  *     def __cinit__(self):             # <<<<<<<<<<<<<<
53665  *         self._lookup_function = NULL # use default lookup
53666  * 
53667  */
53668
53669 static int __pyx_pf_4lxml_5etree_18ElementClassLookup___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
53670 static int __pyx_pf_4lxml_5etree_18ElementClassLookup___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
53671   int __pyx_r;
53672   __Pyx_SetupRefcountContext("__cinit__");
53673   if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
53674     __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
53675   if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
53676
53677   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":155
53678  *     cdef _element_class_lookup_function _lookup_function
53679  *     def __cinit__(self):
53680  *         self._lookup_function = NULL # use default lookup             # <<<<<<<<<<<<<<
53681  * 
53682  * cdef public class FallbackElementClassLookup(ElementClassLookup) \
53683  */
53684   ((struct LxmlElementClassLookup *)__pyx_v_self)->_lookup_function = NULL;
53685
53686   __pyx_r = 0;
53687   __Pyx_FinishRefcountContext();
53688   return __pyx_r;
53689 }
53690
53691 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":166
53692  *     cdef readonly ElementClassLookup fallback
53693  *     cdef _element_class_lookup_function _fallback_function
53694  *     def __cinit__(self):             # <<<<<<<<<<<<<<
53695  *         # fall back to default lookup
53696  *         self._fallback_function = _lookupDefaultElementClass
53697  */
53698
53699 static int __pyx_pf_4lxml_5etree_26FallbackElementClassLookup___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
53700 static int __pyx_pf_4lxml_5etree_26FallbackElementClassLookup___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
53701   int __pyx_r;
53702   __Pyx_SetupRefcountContext("__cinit__");
53703   if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
53704     __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
53705   if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
53706
53707   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":168
53708  *     def __cinit__(self):
53709  *         # fall back to default lookup
53710  *         self._fallback_function = _lookupDefaultElementClass             # <<<<<<<<<<<<<<
53711  * 
53712  *     def __init__(self, ElementClassLookup fallback=None):
53713  */
53714   ((struct LxmlFallbackElementClassLookup *)__pyx_v_self)->_fallback_function = __pyx_f_4lxml_5etree__lookupDefaultElementClass;
53715
53716   __pyx_r = 0;
53717   __Pyx_FinishRefcountContext();
53718   return __pyx_r;
53719 }
53720
53721 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":170
53722  *         self._fallback_function = _lookupDefaultElementClass
53723  * 
53724  *     def __init__(self, ElementClassLookup fallback=None):             # <<<<<<<<<<<<<<
53725  *         if fallback is not None:
53726  *             self._setFallback(fallback)
53727  */
53728
53729 static int __pyx_pf_4lxml_5etree_26FallbackElementClassLookup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
53730 static int __pyx_pf_4lxml_5etree_26FallbackElementClassLookup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
53731   struct LxmlElementClassLookup *__pyx_v_fallback = 0;
53732   int __pyx_r;
53733   int __pyx_t_1;
53734   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_fallback,0};
53735   __Pyx_SetupRefcountContext("__init__");
53736   if (unlikely(__pyx_kwds)) {
53737     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
53738     PyObject* values[1] = {0};
53739     values[0] = (PyObject*)((struct LxmlElementClassLookup *)Py_None);
53740     switch (PyTuple_GET_SIZE(__pyx_args)) {
53741       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
53742       case  0: break;
53743       default: goto __pyx_L5_argtuple_error;
53744     }
53745     switch (PyTuple_GET_SIZE(__pyx_args)) {
53746       case  0:
53747       if (kw_args > 1) {
53748         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_fallback);
53749         if (unlikely(value)) { values[0] = value; kw_args--; }
53750       }
53751     }
53752     if (unlikely(kw_args > 0)) {
53753       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
53754     }
53755     __pyx_v_fallback = ((struct LxmlElementClassLookup *)values[0]);
53756   } else {
53757     __pyx_v_fallback = ((struct LxmlElementClassLookup *)Py_None);
53758     switch (PyTuple_GET_SIZE(__pyx_args)) {
53759       case  1: __pyx_v_fallback = ((struct LxmlElementClassLookup *)PyTuple_GET_ITEM(__pyx_args, 0));
53760       case  0: break;
53761       default: goto __pyx_L5_argtuple_error;
53762     }
53763   }
53764   goto __pyx_L4_argument_unpacking_done;
53765   __pyx_L5_argtuple_error:;
53766   __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
53767   __pyx_L3_error:;
53768   __Pyx_AddTraceback("lxml.etree.FallbackElementClassLookup.__init__");
53769   return -1;
53770   __pyx_L4_argument_unpacking_done:;
53771   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fallback), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "fallback", 0))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
53772
53773   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":171
53774  * 
53775  *     def __init__(self, ElementClassLookup fallback=None):
53776  *         if fallback is not None:             # <<<<<<<<<<<<<<
53777  *             self._setFallback(fallback)
53778  *         else:
53779  */
53780   __pyx_t_1 = (((PyObject *)__pyx_v_fallback) != Py_None);
53781   if (__pyx_t_1) {
53782
53783     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":172
53784  *     def __init__(self, ElementClassLookup fallback=None):
53785  *         if fallback is not None:
53786  *             self._setFallback(fallback)             # <<<<<<<<<<<<<<
53787  *         else:
53788  *             self._fallback_function = _lookupDefaultElementClass
53789  */
53790     ((struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup *)((struct LxmlFallbackElementClassLookup *)__pyx_v_self)->__pyx_vtab)->_setFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_self), __pyx_v_fallback);
53791     goto __pyx_L6;
53792   }
53793   /*else*/ {
53794
53795     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":174
53796  *             self._setFallback(fallback)
53797  *         else:
53798  *             self._fallback_function = _lookupDefaultElementClass             # <<<<<<<<<<<<<<
53799  * 
53800  *     cdef void _setFallback(self, ElementClassLookup lookup):
53801  */
53802     ((struct LxmlFallbackElementClassLookup *)__pyx_v_self)->_fallback_function = __pyx_f_4lxml_5etree__lookupDefaultElementClass;
53803   }
53804   __pyx_L6:;
53805
53806   __pyx_r = 0;
53807   goto __pyx_L0;
53808   __pyx_L1_error:;
53809   __Pyx_AddTraceback("lxml.etree.FallbackElementClassLookup.__init__");
53810   __pyx_r = -1;
53811   __pyx_L0:;
53812   __Pyx_FinishRefcountContext();
53813   return __pyx_r;
53814 }
53815
53816 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":176
53817  *             self._fallback_function = _lookupDefaultElementClass
53818  * 
53819  *     cdef void _setFallback(self, ElementClassLookup lookup):             # <<<<<<<<<<<<<<
53820  *         u"""Sets the fallback scheme for this lookup method.
53821  *         """
53822  */
53823
53824 static  void __pyx_f_4lxml_5etree_26FallbackElementClassLookup__setFallback(struct LxmlFallbackElementClassLookup *__pyx_v_self, struct LxmlElementClassLookup *__pyx_v_lookup) {
53825   int __pyx_t_1;
53826   __Pyx_SetupRefcountContext("_setFallback");
53827
53828   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":179
53829  *         u"""Sets the fallback scheme for this lookup method.
53830  *         """
53831  *         self.fallback = lookup             # <<<<<<<<<<<<<<
53832  *         self._fallback_function = lookup._lookup_function
53833  *         if self._fallback_function is NULL:
53834  */
53835   __Pyx_INCREF(((PyObject *)__pyx_v_lookup));
53836   __Pyx_GIVEREF(((PyObject *)__pyx_v_lookup));
53837   __Pyx_GOTREF(__pyx_v_self->fallback);
53838   __Pyx_DECREF(((PyObject *)__pyx_v_self->fallback));
53839   __pyx_v_self->fallback = __pyx_v_lookup;
53840
53841   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":180
53842  *         """
53843  *         self.fallback = lookup
53844  *         self._fallback_function = lookup._lookup_function             # <<<<<<<<<<<<<<
53845  *         if self._fallback_function is NULL:
53846  *             self._fallback_function = _lookupDefaultElementClass
53847  */
53848   __pyx_v_self->_fallback_function = __pyx_v_lookup->_lookup_function;
53849
53850   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":181
53851  *         self.fallback = lookup
53852  *         self._fallback_function = lookup._lookup_function
53853  *         if self._fallback_function is NULL:             # <<<<<<<<<<<<<<
53854  *             self._fallback_function = _lookupDefaultElementClass
53855  * 
53856  */
53857   __pyx_t_1 = (__pyx_v_self->_fallback_function == NULL);
53858   if (__pyx_t_1) {
53859
53860     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":182
53861  *         self._fallback_function = lookup._lookup_function
53862  *         if self._fallback_function is NULL:
53863  *             self._fallback_function = _lookupDefaultElementClass             # <<<<<<<<<<<<<<
53864  * 
53865  *     def set_fallback(self, ElementClassLookup lookup not None):
53866  */
53867     __pyx_v_self->_fallback_function = __pyx_f_4lxml_5etree__lookupDefaultElementClass;
53868     goto __pyx_L3;
53869   }
53870   __pyx_L3:;
53871
53872   __Pyx_FinishRefcountContext();
53873 }
53874
53875 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":184
53876  *             self._fallback_function = _lookupDefaultElementClass
53877  * 
53878  *     def set_fallback(self, ElementClassLookup lookup not None):             # <<<<<<<<<<<<<<
53879  *         u"""set_fallback(self, lookup)
53880  * 
53881  */
53882
53883 static PyObject *__pyx_pf_4lxml_5etree_26FallbackElementClassLookup_set_fallback(PyObject *__pyx_v_self, PyObject *__pyx_v_lookup); /*proto*/
53884 static char __pyx_doc_4lxml_5etree_26FallbackElementClassLookup_set_fallback[] = "set_fallback(self, lookup)\n\n        Sets the fallback scheme for this lookup method.\n        ";
53885 static PyObject *__pyx_pf_4lxml_5etree_26FallbackElementClassLookup_set_fallback(PyObject *__pyx_v_self, PyObject *__pyx_v_lookup) {
53886   PyObject *__pyx_r = NULL;
53887   __Pyx_SetupRefcountContext("set_fallback");
53888   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lookup), __pyx_ptype_4lxml_5etree_ElementClassLookup, 0, "lookup", 0))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
53889
53890   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":189
53891  *         Sets the fallback scheme for this lookup method.
53892  *         """
53893  *         self._setFallback(lookup)             # <<<<<<<<<<<<<<
53894  * 
53895  * cdef inline object _callLookupFallback(FallbackElementClassLookup lookup,
53896  */
53897   ((struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup *)((struct LxmlFallbackElementClassLookup *)__pyx_v_self)->__pyx_vtab)->_setFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_self), ((struct LxmlElementClassLookup *)__pyx_v_lookup));
53898
53899   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
53900   goto __pyx_L0;
53901   __pyx_L1_error:;
53902   __Pyx_AddTraceback("lxml.etree.FallbackElementClassLookup.set_fallback");
53903   __pyx_r = NULL;
53904   __pyx_L0:;
53905   __Pyx_XGIVEREF(__pyx_r);
53906   __Pyx_FinishRefcountContext();
53907   return __pyx_r;
53908 }
53909
53910 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":191
53911  *         self._setFallback(lookup)
53912  * 
53913  * cdef inline object _callLookupFallback(FallbackElementClassLookup lookup,             # <<<<<<<<<<<<<<
53914  *                                        _Document doc, xmlNode* c_node):
53915  *     return lookup._fallback_function(lookup.fallback, doc, c_node)
53916  */
53917
53918 static INLINE PyObject *__pyx_f_4lxml_5etree__callLookupFallback(struct LxmlFallbackElementClassLookup *__pyx_v_lookup, struct LxmlDocument *__pyx_v_doc, xmlNode *__pyx_v_c_node) {
53919   PyObject *__pyx_r = NULL;
53920   PyObject *__pyx_t_1 = NULL;
53921   __Pyx_SetupRefcountContext("_callLookupFallback");
53922
53923   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":193
53924  * cdef inline object _callLookupFallback(FallbackElementClassLookup lookup,
53925  *                                        _Document doc, xmlNode* c_node):
53926  *     return lookup._fallback_function(lookup.fallback, doc, c_node)             # <<<<<<<<<<<<<<
53927  * 
53928  * 
53929  */
53930   __Pyx_XDECREF(__pyx_r);
53931   __pyx_t_1 = __pyx_v_lookup->_fallback_function(((PyObject *)__pyx_v_lookup->fallback), __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
53932   __Pyx_GOTREF(__pyx_t_1);
53933   __pyx_r = __pyx_t_1;
53934   __pyx_t_1 = 0;
53935   goto __pyx_L0;
53936
53937   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
53938   goto __pyx_L0;
53939   __pyx_L1_error:;
53940   __Pyx_XDECREF(__pyx_t_1);
53941   __Pyx_AddTraceback("lxml.etree._callLookupFallback");
53942   __pyx_r = 0;
53943   __pyx_L0:;
53944   __Pyx_XGIVEREF(__pyx_r);
53945   __Pyx_FinishRefcountContext();
53946   return __pyx_r;
53947 }
53948
53949 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":211
53950  *     cdef readonly object pi_class
53951  *     cdef readonly object entity_class
53952  *     def __cinit__(self):             # <<<<<<<<<<<<<<
53953  *         self._lookup_function = _lookupDefaultElementClass
53954  * 
53955  */
53956
53957 static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
53958 static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
53959   int __pyx_r;
53960   __Pyx_SetupRefcountContext("__cinit__");
53961   if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
53962     __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
53963   if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
53964
53965   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":212
53966  *     cdef readonly object entity_class
53967  *     def __cinit__(self):
53968  *         self._lookup_function = _lookupDefaultElementClass             # <<<<<<<<<<<<<<
53969  * 
53970  *     def __init__(self, element=None, comment=None, pi=None, entity=None):
53971  */
53972   ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->__pyx_base._lookup_function = __pyx_f_4lxml_5etree__lookupDefaultElementClass;
53973
53974   __pyx_r = 0;
53975   __Pyx_FinishRefcountContext();
53976   return __pyx_r;
53977 }
53978
53979 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":214
53980  *         self._lookup_function = _lookupDefaultElementClass
53981  * 
53982  *     def __init__(self, element=None, comment=None, pi=None, entity=None):             # <<<<<<<<<<<<<<
53983  *         if element is None:
53984  *             self.element_class = _Element
53985  */
53986
53987 static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
53988 static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
53989   PyObject *__pyx_v_element = 0;
53990   PyObject *__pyx_v_comment = 0;
53991   PyObject *__pyx_v_pi = 0;
53992   PyObject *__pyx_v_entity = 0;
53993   int __pyx_r;
53994   int __pyx_t_1;
53995   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_element,&__pyx_kp_comment,&__pyx_kp_pi,&__pyx_kp_entity,0};
53996   __Pyx_SetupRefcountContext("__init__");
53997   if (unlikely(__pyx_kwds)) {
53998     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
53999     PyObject* values[4] = {0,0,0,0};
54000     values[0] = Py_None;
54001     values[1] = Py_None;
54002     values[2] = Py_None;
54003     values[3] = Py_None;
54004     switch (PyTuple_GET_SIZE(__pyx_args)) {
54005       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
54006       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
54007       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
54008       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
54009       case  0: break;
54010       default: goto __pyx_L5_argtuple_error;
54011     }
54012     switch (PyTuple_GET_SIZE(__pyx_args)) {
54013       case  0:
54014       if (kw_args > 1) {
54015         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_element);
54016         if (unlikely(value)) { values[0] = value; kw_args--; }
54017       }
54018       case  1:
54019       if (kw_args > 1) {
54020         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_comment);
54021         if (unlikely(value)) { values[1] = value; kw_args--; }
54022       }
54023       case  2:
54024       if (kw_args > 1) {
54025         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_pi);
54026         if (unlikely(value)) { values[2] = value; kw_args--; }
54027       }
54028       case  3:
54029       if (kw_args > 1) {
54030         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_entity);
54031         if (unlikely(value)) { values[3] = value; kw_args--; }
54032       }
54033     }
54034     if (unlikely(kw_args > 0)) {
54035       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
54036     }
54037     __pyx_v_element = values[0];
54038     __pyx_v_comment = values[1];
54039     __pyx_v_pi = values[2];
54040     __pyx_v_entity = values[3];
54041   } else {
54042     __pyx_v_element = Py_None;
54043     __pyx_v_comment = Py_None;
54044     __pyx_v_pi = Py_None;
54045     __pyx_v_entity = Py_None;
54046     switch (PyTuple_GET_SIZE(__pyx_args)) {
54047       case  4: __pyx_v_entity = PyTuple_GET_ITEM(__pyx_args, 3);
54048       case  3: __pyx_v_pi = PyTuple_GET_ITEM(__pyx_args, 2);
54049       case  2: __pyx_v_comment = PyTuple_GET_ITEM(__pyx_args, 1);
54050       case  1: __pyx_v_element = PyTuple_GET_ITEM(__pyx_args, 0);
54051       case  0: break;
54052       default: goto __pyx_L5_argtuple_error;
54053     }
54054   }
54055   goto __pyx_L4_argument_unpacking_done;
54056   __pyx_L5_argtuple_error:;
54057   __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
54058   __pyx_L3_error:;
54059   __Pyx_AddTraceback("lxml.etree.ElementDefaultClassLookup.__init__");
54060   return -1;
54061   __pyx_L4_argument_unpacking_done:;
54062
54063   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":215
54064  * 
54065  *     def __init__(self, element=None, comment=None, pi=None, entity=None):
54066  *         if element is None:             # <<<<<<<<<<<<<<
54067  *             self.element_class = _Element
54068  *         elif issubclass(element, ElementBase):
54069  */
54070   __pyx_t_1 = (__pyx_v_element == Py_None);
54071   if (__pyx_t_1) {
54072
54073     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":216
54074  *     def __init__(self, element=None, comment=None, pi=None, entity=None):
54075  *         if element is None:
54076  *             self.element_class = _Element             # <<<<<<<<<<<<<<
54077  *         elif issubclass(element, ElementBase):
54078  *             self.element_class = element
54079  */
54080     __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Element)));
54081     __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Element)));
54082     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->element_class);
54083     __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->element_class);
54084     ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->element_class = ((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Element));
54085     goto __pyx_L6;
54086   }
54087
54088   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":217
54089  *         if element is None:
54090  *             self.element_class = _Element
54091  *         elif issubclass(element, ElementBase):             # <<<<<<<<<<<<<<
54092  *             self.element_class = element
54093  *         else:
54094  */
54095   __pyx_t_1 = PyObject_IsSubclass(__pyx_v_element, ((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_ElementBase))); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
54096   if (__pyx_t_1) {
54097
54098     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":218
54099  *             self.element_class = _Element
54100  *         elif issubclass(element, ElementBase):
54101  *             self.element_class = element             # <<<<<<<<<<<<<<
54102  *         else:
54103  *             raise TypeError, u"element class must be subclass of ElementBase"
54104  */
54105     __Pyx_INCREF(__pyx_v_element);
54106     __Pyx_GIVEREF(__pyx_v_element);
54107     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->element_class);
54108     __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->element_class);
54109     ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->element_class = __pyx_v_element;
54110     goto __pyx_L6;
54111   }
54112   /*else*/ {
54113
54114     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":220
54115  *             self.element_class = element
54116  *         else:
54117  *             raise TypeError, u"element class must be subclass of ElementBase"             # <<<<<<<<<<<<<<
54118  * 
54119  *         if comment is None:
54120  */
54121     __Pyx_Raise(__pyx_builtin_TypeError, ((PyObject *)__pyx_kp_400), 0);
54122     {__pyx_filename = __pyx_f[9]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
54123   }
54124   __pyx_L6:;
54125
54126   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":222
54127  *             raise TypeError, u"element class must be subclass of ElementBase"
54128  * 
54129  *         if comment is None:             # <<<<<<<<<<<<<<
54130  *             self.comment_class = _Comment
54131  *         elif issubclass(comment, CommentBase):
54132  */
54133   __pyx_t_1 = (__pyx_v_comment == Py_None);
54134   if (__pyx_t_1) {
54135
54136     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":223
54137  * 
54138  *         if comment is None:
54139  *             self.comment_class = _Comment             # <<<<<<<<<<<<<<
54140  *         elif issubclass(comment, CommentBase):
54141  *             self.comment_class = comment
54142  */
54143     __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Comment)));
54144     __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Comment)));
54145     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->comment_class);
54146     __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->comment_class);
54147     ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->comment_class = ((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Comment));
54148     goto __pyx_L7;
54149   }
54150
54151   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":224
54152  *         if comment is None:
54153  *             self.comment_class = _Comment
54154  *         elif issubclass(comment, CommentBase):             # <<<<<<<<<<<<<<
54155  *             self.comment_class = comment
54156  *         else:
54157  */
54158   __pyx_t_1 = PyObject_IsSubclass(__pyx_v_comment, ((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_CommentBase))); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
54159   if (__pyx_t_1) {
54160
54161     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":225
54162  *             self.comment_class = _Comment
54163  *         elif issubclass(comment, CommentBase):
54164  *             self.comment_class = comment             # <<<<<<<<<<<<<<
54165  *         else:
54166  *             raise TypeError, u"comment class must be subclass of CommentBase"
54167  */
54168     __Pyx_INCREF(__pyx_v_comment);
54169     __Pyx_GIVEREF(__pyx_v_comment);
54170     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->comment_class);
54171     __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->comment_class);
54172     ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->comment_class = __pyx_v_comment;
54173     goto __pyx_L7;
54174   }
54175   /*else*/ {
54176
54177     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":227
54178  *             self.comment_class = comment
54179  *         else:
54180  *             raise TypeError, u"comment class must be subclass of CommentBase"             # <<<<<<<<<<<<<<
54181  * 
54182  *         if entity is None:
54183  */
54184     __Pyx_Raise(__pyx_builtin_TypeError, ((PyObject *)__pyx_kp_401), 0);
54185     {__pyx_filename = __pyx_f[9]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
54186   }
54187   __pyx_L7:;
54188
54189   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":229
54190  *             raise TypeError, u"comment class must be subclass of CommentBase"
54191  * 
54192  *         if entity is None:             # <<<<<<<<<<<<<<
54193  *             self.entity_class = _Entity
54194  *         elif issubclass(entity, EntityBase):
54195  */
54196   __pyx_t_1 = (__pyx_v_entity == Py_None);
54197   if (__pyx_t_1) {
54198
54199     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":230
54200  * 
54201  *         if entity is None:
54202  *             self.entity_class = _Entity             # <<<<<<<<<<<<<<
54203  *         elif issubclass(entity, EntityBase):
54204  *             self.entity_class = entity
54205  */
54206     __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Entity)));
54207     __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Entity)));
54208     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->entity_class);
54209     __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->entity_class);
54210     ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->entity_class = ((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Entity));
54211     goto __pyx_L8;
54212   }
54213
54214   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":231
54215  *         if entity is None:
54216  *             self.entity_class = _Entity
54217  *         elif issubclass(entity, EntityBase):             # <<<<<<<<<<<<<<
54218  *             self.entity_class = entity
54219  *         else:
54220  */
54221   __pyx_t_1 = PyObject_IsSubclass(__pyx_v_entity, ((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_EntityBase))); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
54222   if (__pyx_t_1) {
54223
54224     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":232
54225  *             self.entity_class = _Entity
54226  *         elif issubclass(entity, EntityBase):
54227  *             self.entity_class = entity             # <<<<<<<<<<<<<<
54228  *         else:
54229  *             raise TypeError, u"Entity class must be subclass of EntityBase"
54230  */
54231     __Pyx_INCREF(__pyx_v_entity);
54232     __Pyx_GIVEREF(__pyx_v_entity);
54233     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->entity_class);
54234     __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->entity_class);
54235     ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->entity_class = __pyx_v_entity;
54236     goto __pyx_L8;
54237   }
54238   /*else*/ {
54239
54240     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":234
54241  *             self.entity_class = entity
54242  *         else:
54243  *             raise TypeError, u"Entity class must be subclass of EntityBase"             # <<<<<<<<<<<<<<
54244  * 
54245  *         if pi is None:
54246  */
54247     __Pyx_Raise(__pyx_builtin_TypeError, ((PyObject *)__pyx_kp_402), 0);
54248     {__pyx_filename = __pyx_f[9]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
54249   }
54250   __pyx_L8:;
54251
54252   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":236
54253  *             raise TypeError, u"Entity class must be subclass of EntityBase"
54254  * 
54255  *         if pi is None:             # <<<<<<<<<<<<<<
54256  *             self.pi_class = None # special case, see below
54257  *         elif issubclass(pi, PIBase):
54258  */
54259   __pyx_t_1 = (__pyx_v_pi == Py_None);
54260   if (__pyx_t_1) {
54261
54262     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":237
54263  * 
54264  *         if pi is None:
54265  *             self.pi_class = None # special case, see below             # <<<<<<<<<<<<<<
54266  *         elif issubclass(pi, PIBase):
54267  *             self.pi_class = pi
54268  */
54269     __Pyx_INCREF(Py_None);
54270     __Pyx_GIVEREF(Py_None);
54271     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->pi_class);
54272     __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->pi_class);
54273     ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->pi_class = Py_None;
54274     goto __pyx_L9;
54275   }
54276
54277   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":238
54278  *         if pi is None:
54279  *             self.pi_class = None # special case, see below
54280  *         elif issubclass(pi, PIBase):             # <<<<<<<<<<<<<<
54281  *             self.pi_class = pi
54282  *         else:
54283  */
54284   __pyx_t_1 = PyObject_IsSubclass(__pyx_v_pi, ((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_PIBase))); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
54285   if (__pyx_t_1) {
54286
54287     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":239
54288  *             self.pi_class = None # special case, see below
54289  *         elif issubclass(pi, PIBase):
54290  *             self.pi_class = pi             # <<<<<<<<<<<<<<
54291  *         else:
54292  *             raise TypeError, u"PI class must be subclass of PIBase"
54293  */
54294     __Pyx_INCREF(__pyx_v_pi);
54295     __Pyx_GIVEREF(__pyx_v_pi);
54296     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->pi_class);
54297     __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->pi_class);
54298     ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->pi_class = __pyx_v_pi;
54299     goto __pyx_L9;
54300   }
54301   /*else*/ {
54302
54303     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":241
54304  *             self.pi_class = pi
54305  *         else:
54306  *             raise TypeError, u"PI class must be subclass of PIBase"             # <<<<<<<<<<<<<<
54307  * 
54308  * cdef object _lookupDefaultElementClass(state, _Document _doc, xmlNode* c_node):
54309  */
54310     __Pyx_Raise(__pyx_builtin_TypeError, ((PyObject *)__pyx_kp_403), 0);
54311     {__pyx_filename = __pyx_f[9]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
54312   }
54313   __pyx_L9:;
54314
54315   __pyx_r = 0;
54316   goto __pyx_L0;
54317   __pyx_L1_error:;
54318   __Pyx_AddTraceback("lxml.etree.ElementDefaultClassLookup.__init__");
54319   __pyx_r = -1;
54320   __pyx_L0:;
54321   __Pyx_FinishRefcountContext();
54322   return __pyx_r;
54323 }
54324
54325 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":243
54326  *             raise TypeError, u"PI class must be subclass of PIBase"
54327  * 
54328  * cdef object _lookupDefaultElementClass(state, _Document _doc, xmlNode* c_node):             # <<<<<<<<<<<<<<
54329  *     u"Trivial class lookup function that always returns the default class."
54330  *     if c_node.type == tree.XML_ELEMENT_NODE:
54331  */
54332
54333 static  PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx_v_state, struct LxmlDocument *__pyx_v__doc, xmlNode *__pyx_v_c_node) {
54334   PyObject *__pyx_v_cls;
54335   PyObject *__pyx_r = NULL;
54336   int __pyx_t_1;
54337   PyObject *__pyx_t_2 = NULL;
54338   PyObject *__pyx_t_3 = NULL;
54339   __Pyx_SetupRefcountContext("_lookupDefaultElementClass");
54340   __pyx_v_cls = Py_None; __Pyx_INCREF(Py_None);
54341
54342   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":245
54343  * cdef object _lookupDefaultElementClass(state, _Document _doc, xmlNode* c_node):
54344  *     u"Trivial class lookup function that always returns the default class."
54345  *     if c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
54346  *         if state is not None:
54347  *             return (<ElementDefaultClassLookup>state).element_class
54348  */
54349   __pyx_t_1 = (__pyx_v_c_node->type == XML_ELEMENT_NODE);
54350   if (__pyx_t_1) {
54351
54352     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":246
54353  *     u"Trivial class lookup function that always returns the default class."
54354  *     if c_node.type == tree.XML_ELEMENT_NODE:
54355  *         if state is not None:             # <<<<<<<<<<<<<<
54356  *             return (<ElementDefaultClassLookup>state).element_class
54357  *         else:
54358  */
54359     __pyx_t_1 = (__pyx_v_state != Py_None);
54360     if (__pyx_t_1) {
54361
54362       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":247
54363  *     if c_node.type == tree.XML_ELEMENT_NODE:
54364  *         if state is not None:
54365  *             return (<ElementDefaultClassLookup>state).element_class             # <<<<<<<<<<<<<<
54366  *         else:
54367  *             return _Element
54368  */
54369       __Pyx_XDECREF(__pyx_r);
54370       __Pyx_INCREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_state)->element_class);
54371       __pyx_r = ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_state)->element_class;
54372       goto __pyx_L0;
54373       goto __pyx_L4;
54374     }
54375     /*else*/ {
54376
54377       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":249
54378  *             return (<ElementDefaultClassLookup>state).element_class
54379  *         else:
54380  *             return _Element             # <<<<<<<<<<<<<<
54381  *     elif c_node.type == tree.XML_COMMENT_NODE:
54382  *         if state is not None:
54383  */
54384       __Pyx_XDECREF(__pyx_r);
54385       __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Element)));
54386       __pyx_r = ((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Element));
54387       goto __pyx_L0;
54388     }
54389     __pyx_L4:;
54390     goto __pyx_L3;
54391   }
54392
54393   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":250
54394  *         else:
54395  *             return _Element
54396  *     elif c_node.type == tree.XML_COMMENT_NODE:             # <<<<<<<<<<<<<<
54397  *         if state is not None:
54398  *             return (<ElementDefaultClassLookup>state).comment_class
54399  */
54400   __pyx_t_1 = (__pyx_v_c_node->type == XML_COMMENT_NODE);
54401   if (__pyx_t_1) {
54402
54403     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":251
54404  *             return _Element
54405  *     elif c_node.type == tree.XML_COMMENT_NODE:
54406  *         if state is not None:             # <<<<<<<<<<<<<<
54407  *             return (<ElementDefaultClassLookup>state).comment_class
54408  *         else:
54409  */
54410     __pyx_t_1 = (__pyx_v_state != Py_None);
54411     if (__pyx_t_1) {
54412
54413       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":252
54414  *     elif c_node.type == tree.XML_COMMENT_NODE:
54415  *         if state is not None:
54416  *             return (<ElementDefaultClassLookup>state).comment_class             # <<<<<<<<<<<<<<
54417  *         else:
54418  *             return _Comment
54419  */
54420       __Pyx_XDECREF(__pyx_r);
54421       __Pyx_INCREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_state)->comment_class);
54422       __pyx_r = ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_state)->comment_class;
54423       goto __pyx_L0;
54424       goto __pyx_L5;
54425     }
54426     /*else*/ {
54427
54428       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":254
54429  *             return (<ElementDefaultClassLookup>state).comment_class
54430  *         else:
54431  *             return _Comment             # <<<<<<<<<<<<<<
54432  *     elif c_node.type == tree.XML_ENTITY_REF_NODE:
54433  *         if state is not None:
54434  */
54435       __Pyx_XDECREF(__pyx_r);
54436       __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Comment)));
54437       __pyx_r = ((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Comment));
54438       goto __pyx_L0;
54439     }
54440     __pyx_L5:;
54441     goto __pyx_L3;
54442   }
54443
54444   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":255
54445  *         else:
54446  *             return _Comment
54447  *     elif c_node.type == tree.XML_ENTITY_REF_NODE:             # <<<<<<<<<<<<<<
54448  *         if state is not None:
54449  *             return (<ElementDefaultClassLookup>state).entity_class
54450  */
54451   __pyx_t_1 = (__pyx_v_c_node->type == XML_ENTITY_REF_NODE);
54452   if (__pyx_t_1) {
54453
54454     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":256
54455  *             return _Comment
54456  *     elif c_node.type == tree.XML_ENTITY_REF_NODE:
54457  *         if state is not None:             # <<<<<<<<<<<<<<
54458  *             return (<ElementDefaultClassLookup>state).entity_class
54459  *         else:
54460  */
54461     __pyx_t_1 = (__pyx_v_state != Py_None);
54462     if (__pyx_t_1) {
54463
54464       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":257
54465  *     elif c_node.type == tree.XML_ENTITY_REF_NODE:
54466  *         if state is not None:
54467  *             return (<ElementDefaultClassLookup>state).entity_class             # <<<<<<<<<<<<<<
54468  *         else:
54469  *             return _Entity
54470  */
54471       __Pyx_XDECREF(__pyx_r);
54472       __Pyx_INCREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_state)->entity_class);
54473       __pyx_r = ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_state)->entity_class;
54474       goto __pyx_L0;
54475       goto __pyx_L6;
54476     }
54477     /*else*/ {
54478
54479       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":259
54480  *             return (<ElementDefaultClassLookup>state).entity_class
54481  *         else:
54482  *             return _Entity             # <<<<<<<<<<<<<<
54483  *     elif c_node.type == tree.XML_PI_NODE:
54484  *         if state is not None:
54485  */
54486       __Pyx_XDECREF(__pyx_r);
54487       __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Entity)));
54488       __pyx_r = ((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Entity));
54489       goto __pyx_L0;
54490     }
54491     __pyx_L6:;
54492     goto __pyx_L3;
54493   }
54494
54495   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":260
54496  *         else:
54497  *             return _Entity
54498  *     elif c_node.type == tree.XML_PI_NODE:             # <<<<<<<<<<<<<<
54499  *         if state is not None:
54500  *             cls = (<ElementDefaultClassLookup>state).pi_class
54501  */
54502   __pyx_t_1 = (__pyx_v_c_node->type == XML_PI_NODE);
54503   if (__pyx_t_1) {
54504
54505     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":261
54506  *             return _Entity
54507  *     elif c_node.type == tree.XML_PI_NODE:
54508  *         if state is not None:             # <<<<<<<<<<<<<<
54509  *             cls = (<ElementDefaultClassLookup>state).pi_class
54510  *         if cls is None:
54511  */
54512     __pyx_t_1 = (__pyx_v_state != Py_None);
54513     if (__pyx_t_1) {
54514
54515       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":262
54516  *     elif c_node.type == tree.XML_PI_NODE:
54517  *         if state is not None:
54518  *             cls = (<ElementDefaultClassLookup>state).pi_class             # <<<<<<<<<<<<<<
54519  *         if cls is None:
54520  *             # special case XSLT-PI
54521  */
54522       __Pyx_INCREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_state)->pi_class);
54523       __Pyx_DECREF(__pyx_v_cls);
54524       __pyx_v_cls = ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_state)->pi_class;
54525       goto __pyx_L7;
54526     }
54527     __pyx_L7:;
54528
54529     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":263
54530  *         if state is not None:
54531  *             cls = (<ElementDefaultClassLookup>state).pi_class
54532  *         if cls is None:             # <<<<<<<<<<<<<<
54533  *             # special case XSLT-PI
54534  *             if c_node.name is not NULL and c_node.content is not NULL:
54535  */
54536     __pyx_t_1 = (__pyx_v_cls == Py_None);
54537     if (__pyx_t_1) {
54538
54539       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":265
54540  *         if cls is None:
54541  *             # special case XSLT-PI
54542  *             if c_node.name is not NULL and c_node.content is not NULL:             # <<<<<<<<<<<<<<
54543  *                 if cstd.strcmp(c_node.name, "xml-stylesheet") == 0:
54544  *                     if cstd.strstr(c_node.content, "text/xsl") is not NULL or \
54545  */
54546       if ((__pyx_v_c_node->name != NULL)) {
54547         __pyx_t_1 = (__pyx_v_c_node->content != NULL);
54548       } else {
54549         __pyx_t_1 = (__pyx_v_c_node->name != NULL);
54550       }
54551       if (__pyx_t_1) {
54552
54553         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":266
54554  *             # special case XSLT-PI
54555  *             if c_node.name is not NULL and c_node.content is not NULL:
54556  *                 if cstd.strcmp(c_node.name, "xml-stylesheet") == 0:             # <<<<<<<<<<<<<<
54557  *                     if cstd.strstr(c_node.content, "text/xsl") is not NULL or \
54558  *                            cstd.strstr(c_node.content, "text/xml") is not NULL:
54559  */
54560         __pyx_t_1 = (strcmp(__pyx_v_c_node->name, __pyx_k_404) == 0);
54561         if (__pyx_t_1) {
54562
54563           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":267
54564  *             if c_node.name is not NULL and c_node.content is not NULL:
54565  *                 if cstd.strcmp(c_node.name, "xml-stylesheet") == 0:
54566  *                     if cstd.strstr(c_node.content, "text/xsl") is not NULL or \             # <<<<<<<<<<<<<<
54567  *                            cstd.strstr(c_node.content, "text/xml") is not NULL:
54568  *                         return _XSLTProcessingInstruction
54569  */
54570           if (!(strstr(__pyx_v_c_node->content, __pyx_k_405) != NULL)) {
54571
54572             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":268
54573  *                 if cstd.strcmp(c_node.name, "xml-stylesheet") == 0:
54574  *                     if cstd.strstr(c_node.content, "text/xsl") is not NULL or \
54575  *                            cstd.strstr(c_node.content, "text/xml") is not NULL:             # <<<<<<<<<<<<<<
54576  *                         return _XSLTProcessingInstruction
54577  *             return _ProcessingInstruction
54578  */
54579             __pyx_t_1 = (strstr(__pyx_v_c_node->content, __pyx_k_406) != NULL);
54580           } else {
54581             __pyx_t_1 = (strstr(__pyx_v_c_node->content, __pyx_k_405) != NULL);
54582           }
54583           if (__pyx_t_1) {
54584
54585             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":269
54586  *                     if cstd.strstr(c_node.content, "text/xsl") is not NULL or \
54587  *                            cstd.strstr(c_node.content, "text/xml") is not NULL:
54588  *                         return _XSLTProcessingInstruction             # <<<<<<<<<<<<<<
54589  *             return _ProcessingInstruction
54590  *         else:
54591  */
54592             __Pyx_XDECREF(__pyx_r);
54593             __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__XSLTProcessingInstruction)));
54594             __pyx_r = ((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__XSLTProcessingInstruction));
54595             goto __pyx_L0;
54596             goto __pyx_L11;
54597           }
54598           __pyx_L11:;
54599           goto __pyx_L10;
54600         }
54601         __pyx_L10:;
54602         goto __pyx_L9;
54603       }
54604       __pyx_L9:;
54605
54606       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":270
54607  *                            cstd.strstr(c_node.content, "text/xml") is not NULL:
54608  *                         return _XSLTProcessingInstruction
54609  *             return _ProcessingInstruction             # <<<<<<<<<<<<<<
54610  *         else:
54611  *             return cls
54612  */
54613       __Pyx_XDECREF(__pyx_r);
54614       __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ProcessingInstruction)));
54615       __pyx_r = ((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ProcessingInstruction));
54616       goto __pyx_L0;
54617       goto __pyx_L8;
54618     }
54619     /*else*/ {
54620
54621       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":272
54622  *             return _ProcessingInstruction
54623  *         else:
54624  *             return cls             # <<<<<<<<<<<<<<
54625  *     else:
54626  *         assert 0, u"Unknown node type: %s" % c_node.type
54627  */
54628       __Pyx_XDECREF(__pyx_r);
54629       __Pyx_INCREF(__pyx_v_cls);
54630       __pyx_r = __pyx_v_cls;
54631       goto __pyx_L0;
54632     }
54633     __pyx_L8:;
54634     goto __pyx_L3;
54635   }
54636   /*else*/ {
54637
54638     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":274
54639  *             return cls
54640  *     else:
54641  *         assert 0, u"Unknown node type: %s" % c_node.type             # <<<<<<<<<<<<<<
54642  * 
54643  * 
54644  */
54645     #ifndef PYREX_WITHOUT_ASSERTIONS
54646     if (unlikely(!0)) {
54647       __pyx_t_2 = PyInt_FromLong(__pyx_v_c_node->type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
54648       __Pyx_GOTREF(__pyx_t_2);
54649       __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_407), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
54650       __Pyx_GOTREF(__pyx_t_3);
54651       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
54652       PyErr_SetObject(PyExc_AssertionError, __pyx_t_3);
54653       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
54654       {__pyx_filename = __pyx_f[9]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
54655     }
54656     #endif
54657   }
54658   __pyx_L3:;
54659
54660   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
54661   goto __pyx_L0;
54662   __pyx_L1_error:;
54663   __Pyx_XDECREF(__pyx_t_2);
54664   __Pyx_XDECREF(__pyx_t_3);
54665   __Pyx_AddTraceback("lxml.etree._lookupDefaultElementClass");
54666   __pyx_r = 0;
54667   __pyx_L0:;
54668   __Pyx_DECREF(__pyx_v_cls);
54669   __Pyx_XGIVEREF(__pyx_r);
54670   __Pyx_FinishRefcountContext();
54671   return __pyx_r;
54672 }
54673
54674 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":297
54675  *     cdef char* _c_ns
54676  *     cdef char* _c_name
54677  *     def __cinit__(self):             # <<<<<<<<<<<<<<
54678  *         self._lookup_function = _attribute_class_lookup
54679  * 
54680  */
54681
54682 static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
54683 static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
54684   int __pyx_r;
54685   __Pyx_SetupRefcountContext("__cinit__");
54686   if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
54687     __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
54688   if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
54689
54690   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":298
54691  *     cdef char* _c_name
54692  *     def __cinit__(self):
54693  *         self._lookup_function = _attribute_class_lookup             # <<<<<<<<<<<<<<
54694  * 
54695  *     def __init__(self, attribute_name, class_mapping,
54696  */
54697   ((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->__pyx_base.__pyx_base._lookup_function = __pyx_f_4lxml_5etree__attribute_class_lookup;
54698
54699   __pyx_r = 0;
54700   __Pyx_FinishRefcountContext();
54701   return __pyx_r;
54702 }
54703
54704 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":300
54705  *         self._lookup_function = _attribute_class_lookup
54706  * 
54707  *     def __init__(self, attribute_name, class_mapping,             # <<<<<<<<<<<<<<
54708  *                  ElementClassLookup fallback=None):
54709  *         self._pytag = _getNsTag(attribute_name)
54710  */
54711
54712 static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
54713 static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
54714   PyObject *__pyx_v_attribute_name = 0;
54715   PyObject *__pyx_v_class_mapping = 0;
54716   struct LxmlElementClassLookup *__pyx_v_fallback = 0;
54717   PyObject *__pyx_v_ns;
54718   PyObject *__pyx_v_name;
54719   int __pyx_r;
54720   PyObject *__pyx_1 = 0;
54721   PyObject *__pyx_2 = 0;
54722   PyObject *__pyx_3 = 0;
54723   PyObject *__pyx_t_1 = NULL;
54724   int __pyx_t_2;
54725   PyObject *__pyx_t_3 = NULL;
54726   PyObject *__pyx_t_4 = NULL;
54727   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_attribute_name,&__pyx_kp_class_mapping,&__pyx_kp_fallback,0};
54728   __Pyx_SetupRefcountContext("__init__");
54729   if (unlikely(__pyx_kwds)) {
54730     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
54731     PyObject* values[3] = {0,0,0};
54732     values[2] = (PyObject*)((struct LxmlElementClassLookup *)Py_None);
54733     switch (PyTuple_GET_SIZE(__pyx_args)) {
54734       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
54735       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
54736       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
54737       case  0: break;
54738       default: goto __pyx_L5_argtuple_error;
54739     }
54740     switch (PyTuple_GET_SIZE(__pyx_args)) {
54741       case  0:
54742       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_attribute_name);
54743       if (likely(values[0])) kw_args--;
54744       else goto __pyx_L5_argtuple_error;
54745       case  1:
54746       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_class_mapping);
54747       if (likely(values[1])) kw_args--;
54748       else {
54749         __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
54750       }
54751       case  2:
54752       if (kw_args > 1) {
54753         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_fallback);
54754         if (unlikely(value)) { values[2] = value; kw_args--; }
54755       }
54756     }
54757     if (unlikely(kw_args > 0)) {
54758       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
54759     }
54760     __pyx_v_attribute_name = values[0];
54761     __pyx_v_class_mapping = values[1];
54762     __pyx_v_fallback = ((struct LxmlElementClassLookup *)values[2]);
54763   } else {
54764     __pyx_v_fallback = ((struct LxmlElementClassLookup *)Py_None);
54765     switch (PyTuple_GET_SIZE(__pyx_args)) {
54766       case  3:
54767       __pyx_v_fallback = ((struct LxmlElementClassLookup *)PyTuple_GET_ITEM(__pyx_args, 2));
54768       case  2:
54769       __pyx_v_class_mapping = PyTuple_GET_ITEM(__pyx_args, 1);
54770       __pyx_v_attribute_name = PyTuple_GET_ITEM(__pyx_args, 0);
54771       break;
54772       default: goto __pyx_L5_argtuple_error;
54773     }
54774   }
54775   goto __pyx_L4_argument_unpacking_done;
54776   __pyx_L5_argtuple_error:;
54777   __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
54778   __pyx_L3_error:;
54779   __Pyx_AddTraceback("lxml.etree.AttributeBasedElementClassLookup.__init__");
54780   return -1;
54781   __pyx_L4_argument_unpacking_done:;
54782   __pyx_v_ns = Py_None; __Pyx_INCREF(Py_None);
54783   __pyx_v_name = Py_None; __Pyx_INCREF(Py_None);
54784   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fallback), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "fallback", 0))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
54785
54786   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":302
54787  *     def __init__(self, attribute_name, class_mapping,
54788  *                  ElementClassLookup fallback=None):
54789  *         self._pytag = _getNsTag(attribute_name)             # <<<<<<<<<<<<<<
54790  *         ns, name = self._pytag
54791  *         if ns is None:
54792  */
54793   __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_attribute_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
54794   __Pyx_GOTREF(__pyx_t_1);
54795   __Pyx_GIVEREF(__pyx_t_1);
54796   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_pytag);
54797   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_pytag);
54798   ((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_pytag = __pyx_t_1;
54799   __pyx_t_1 = 0;
54800
54801   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":303
54802  *                  ElementClassLookup fallback=None):
54803  *         self._pytag = _getNsTag(attribute_name)
54804  *         ns, name = self._pytag             # <<<<<<<<<<<<<<
54805  *         if ns is None:
54806  *             self._c_ns = NULL
54807  */
54808   if (PyTuple_CheckExact(((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_pytag) && likely(PyTuple_GET_SIZE(((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_pytag) == 2)) {
54809     PyObject* tuple = ((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_pytag;
54810     __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
54811     __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
54812     __Pyx_DECREF(__pyx_v_ns);
54813     __pyx_v_ns = __pyx_2;
54814     __pyx_2 = 0;
54815     __Pyx_DECREF(__pyx_v_name);
54816     __pyx_v_name = __pyx_3;
54817     __pyx_3 = 0;
54818   } else {
54819     __pyx_1 = PyObject_GetIter(((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_pytag); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
54820     __Pyx_GOTREF(__pyx_1);
54821     __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
54822     __Pyx_GOTREF(__pyx_2);
54823     __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
54824     __Pyx_GOTREF(__pyx_3);
54825     if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
54826     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
54827     __Pyx_DECREF(__pyx_v_ns);
54828     __pyx_v_ns = __pyx_2;
54829     __pyx_2 = 0;
54830     __Pyx_DECREF(__pyx_v_name);
54831     __pyx_v_name = __pyx_3;
54832     __pyx_3 = 0;
54833   }
54834
54835   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":304
54836  *         self._pytag = _getNsTag(attribute_name)
54837  *         ns, name = self._pytag
54838  *         if ns is None:             # <<<<<<<<<<<<<<
54839  *             self._c_ns = NULL
54840  *         else:
54841  */
54842   __pyx_t_2 = (__pyx_v_ns == Py_None);
54843   if (__pyx_t_2) {
54844
54845     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":305
54846  *         ns, name = self._pytag
54847  *         if ns is None:
54848  *             self._c_ns = NULL             # <<<<<<<<<<<<<<
54849  *         else:
54850  *             self._c_ns = _cstr(ns)
54851  */
54852     ((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_c_ns = NULL;
54853     goto __pyx_L6;
54854   }
54855   /*else*/ {
54856
54857     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":307
54858  *             self._c_ns = NULL
54859  *         else:
54860  *             self._c_ns = _cstr(ns)             # <<<<<<<<<<<<<<
54861  *         self._c_name = _cstr(name)
54862  *         self._class_mapping = dict(class_mapping)
54863  */
54864     ((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_c_ns = PyString_AS_STRING(__pyx_v_ns);
54865   }
54866   __pyx_L6:;
54867
54868   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":308
54869  *         else:
54870  *             self._c_ns = _cstr(ns)
54871  *         self._c_name = _cstr(name)             # <<<<<<<<<<<<<<
54872  *         self._class_mapping = dict(class_mapping)
54873  * 
54874  */
54875   ((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_c_name = PyString_AS_STRING(__pyx_v_name);
54876
54877   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":309
54878  *             self._c_ns = _cstr(ns)
54879  *         self._c_name = _cstr(name)
54880  *         self._class_mapping = dict(class_mapping)             # <<<<<<<<<<<<<<
54881  * 
54882  *         FallbackElementClassLookup.__init__(self, fallback)
54883  */
54884   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
54885   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
54886   __Pyx_INCREF(__pyx_v_class_mapping);
54887   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_class_mapping);
54888   __Pyx_GIVEREF(__pyx_v_class_mapping);
54889   __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyDict_Type)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
54890   __Pyx_GOTREF(__pyx_t_3);
54891   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
54892   __Pyx_GIVEREF(__pyx_t_3);
54893   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_class_mapping);
54894   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_class_mapping);
54895   ((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_class_mapping = __pyx_t_3;
54896   __pyx_t_3 = 0;
54897
54898   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":311
54899  *         self._class_mapping = dict(class_mapping)
54900  * 
54901  *         FallbackElementClassLookup.__init__(self, fallback)             # <<<<<<<<<<<<<<
54902  * 
54903  * cdef object _attribute_class_lookup(state, _Document doc, xmlNode* c_node):
54904  */
54905   __pyx_t_3 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_FallbackElementClassLookup)), __pyx_kp___init__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
54906   __Pyx_GOTREF(__pyx_t_3);
54907   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
54908   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
54909   __Pyx_INCREF(__pyx_v_self);
54910   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
54911   __Pyx_GIVEREF(__pyx_v_self);
54912   __Pyx_INCREF(((PyObject *)__pyx_v_fallback));
54913   PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_fallback));
54914   __Pyx_GIVEREF(((PyObject *)__pyx_v_fallback));
54915   __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
54916   __Pyx_GOTREF(__pyx_t_4);
54917   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
54918   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
54919   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
54920
54921   __pyx_r = 0;
54922   goto __pyx_L0;
54923   __pyx_L1_error:;
54924   __Pyx_XDECREF(__pyx_1);
54925   __Pyx_XDECREF(__pyx_2);
54926   __Pyx_XDECREF(__pyx_3);
54927   __Pyx_XDECREF(__pyx_t_1);
54928   __Pyx_XDECREF(__pyx_t_3);
54929   __Pyx_XDECREF(__pyx_t_4);
54930   __Pyx_AddTraceback("lxml.etree.AttributeBasedElementClassLookup.__init__");
54931   __pyx_r = -1;
54932   __pyx_L0:;
54933   __Pyx_DECREF(__pyx_v_ns);
54934   __Pyx_DECREF(__pyx_v_name);
54935   __Pyx_FinishRefcountContext();
54936   return __pyx_r;
54937 }
54938
54939 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":313
54940  *         FallbackElementClassLookup.__init__(self, fallback)
54941  * 
54942  * cdef object _attribute_class_lookup(state, _Document doc, xmlNode* c_node):             # <<<<<<<<<<<<<<
54943  *     cdef AttributeBasedElementClassLookup lookup
54944  *     cdef python.PyObject* dict_result
54945  */
54946
54947 static  PyObject *__pyx_f_4lxml_5etree__attribute_class_lookup(PyObject *__pyx_v_state, struct LxmlDocument *__pyx_v_doc, xmlNode *__pyx_v_c_node) {
54948   struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *__pyx_v_lookup;
54949   PyObject *__pyx_v_dict_result;
54950   PyObject *__pyx_v_value;
54951   PyObject *__pyx_r = NULL;
54952   int __pyx_t_1;
54953   PyObject *__pyx_t_2 = NULL;
54954   __Pyx_SetupRefcountContext("_attribute_class_lookup");
54955   __pyx_v_lookup = ((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)Py_None); __Pyx_INCREF(Py_None);
54956   __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);
54957
54958   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":317
54959  *     cdef python.PyObject* dict_result
54960  * 
54961  *     lookup = <AttributeBasedElementClassLookup>state             # <<<<<<<<<<<<<<
54962  *     if c_node.type == tree.XML_ELEMENT_NODE:
54963  *         value = _attributeValueFromNsName(
54964  */
54965   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_state)));
54966   __Pyx_DECREF(((PyObject *)__pyx_v_lookup));
54967   __pyx_v_lookup = ((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_state);
54968
54969   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":318
54970  * 
54971  *     lookup = <AttributeBasedElementClassLookup>state
54972  *     if c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
54973  *         value = _attributeValueFromNsName(
54974  *             c_node, lookup._c_ns, lookup._c_name)
54975  */
54976   __pyx_t_1 = (__pyx_v_c_node->type == XML_ELEMENT_NODE);
54977   if (__pyx_t_1) {
54978
54979     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":320
54980  *     if c_node.type == tree.XML_ELEMENT_NODE:
54981  *         value = _attributeValueFromNsName(
54982  *             c_node, lookup._c_ns, lookup._c_name)             # <<<<<<<<<<<<<<
54983  *         dict_result = python.PyDict_GetItem(lookup._class_mapping, value)
54984  *         if dict_result is not NULL:
54985  */
54986     __pyx_t_2 = __pyx_f_4lxml_5etree__attributeValueFromNsName(__pyx_v_c_node, __pyx_v_lookup->_c_ns, __pyx_v_lookup->_c_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
54987     __Pyx_GOTREF(__pyx_t_2);
54988     __Pyx_DECREF(__pyx_v_value);
54989     __pyx_v_value = __pyx_t_2;
54990     __pyx_t_2 = 0;
54991
54992     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":321
54993  *         value = _attributeValueFromNsName(
54994  *             c_node, lookup._c_ns, lookup._c_name)
54995  *         dict_result = python.PyDict_GetItem(lookup._class_mapping, value)             # <<<<<<<<<<<<<<
54996  *         if dict_result is not NULL:
54997  *             return <object>dict_result
54998  */
54999     __pyx_v_dict_result = PyDict_GetItem(__pyx_v_lookup->_class_mapping, __pyx_v_value);
55000
55001     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":322
55002  *             c_node, lookup._c_ns, lookup._c_name)
55003  *         dict_result = python.PyDict_GetItem(lookup._class_mapping, value)
55004  *         if dict_result is not NULL:             # <<<<<<<<<<<<<<
55005  *             return <object>dict_result
55006  *     return _callLookupFallback(lookup, doc, c_node)
55007  */
55008     __pyx_t_1 = (__pyx_v_dict_result != NULL);
55009     if (__pyx_t_1) {
55010
55011       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":323
55012  *         dict_result = python.PyDict_GetItem(lookup._class_mapping, value)
55013  *         if dict_result is not NULL:
55014  *             return <object>dict_result             # <<<<<<<<<<<<<<
55015  *     return _callLookupFallback(lookup, doc, c_node)
55016  * 
55017  */
55018       __Pyx_XDECREF(__pyx_r);
55019       __Pyx_INCREF(((PyObject *)__pyx_v_dict_result));
55020       __pyx_r = ((PyObject *)__pyx_v_dict_result);
55021       goto __pyx_L0;
55022       goto __pyx_L4;
55023     }
55024     __pyx_L4:;
55025     goto __pyx_L3;
55026   }
55027   __pyx_L3:;
55028
55029   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":324
55030  *         if dict_result is not NULL:
55031  *             return <object>dict_result
55032  *     return _callLookupFallback(lookup, doc, c_node)             # <<<<<<<<<<<<<<
55033  * 
55034  * 
55035  */
55036   __Pyx_XDECREF(__pyx_r);
55037   __pyx_t_2 = __pyx_f_4lxml_5etree__callLookupFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_lookup), __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
55038   __Pyx_GOTREF(__pyx_t_2);
55039   __pyx_r = __pyx_t_2;
55040   __pyx_t_2 = 0;
55041   goto __pyx_L0;
55042
55043   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
55044   goto __pyx_L0;
55045   __pyx_L1_error:;
55046   __Pyx_XDECREF(__pyx_t_2);
55047   __Pyx_AddTraceback("lxml.etree._attribute_class_lookup");
55048   __pyx_r = 0;
55049   __pyx_L0:;
55050   __Pyx_DECREF((PyObject *)__pyx_v_lookup);
55051   __Pyx_DECREF(__pyx_v_value);
55052   __Pyx_XGIVEREF(__pyx_r);
55053   __Pyx_FinishRefcountContext();
55054   return __pyx_r;
55055 }
55056
55057 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":334
55058  *     Element class lookup based on the XML parser.
55059  *     """
55060  *     def __cinit__(self):             # <<<<<<<<<<<<<<
55061  *         self._lookup_function = _parser_class_lookup
55062  * 
55063  */
55064
55065 static int __pyx_pf_4lxml_5etree_29ParserBasedElementClassLookup___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
55066 static int __pyx_pf_4lxml_5etree_29ParserBasedElementClassLookup___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
55067   int __pyx_r;
55068   __Pyx_SetupRefcountContext("__cinit__");
55069   if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
55070     __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
55071   if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
55072
55073   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":335
55074  *     """
55075  *     def __cinit__(self):
55076  *         self._lookup_function = _parser_class_lookup             # <<<<<<<<<<<<<<
55077  * 
55078  * cdef object _parser_class_lookup(state, _Document doc, xmlNode* c_node):
55079  */
55080   ((struct __pyx_obj_4lxml_5etree_ParserBasedElementClassLookup *)__pyx_v_self)->__pyx_base.__pyx_base._lookup_function = __pyx_f_4lxml_5etree__parser_class_lookup;
55081
55082   __pyx_r = 0;
55083   __Pyx_FinishRefcountContext();
55084   return __pyx_r;
55085 }
55086
55087 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":337
55088  *         self._lookup_function = _parser_class_lookup
55089  * 
55090  * cdef object _parser_class_lookup(state, _Document doc, xmlNode* c_node):             # <<<<<<<<<<<<<<
55091  *     if doc._parser._class_lookup is not None:
55092  *         return doc._parser._class_lookup._lookup_function(
55093  */
55094
55095 static  PyObject *__pyx_f_4lxml_5etree__parser_class_lookup(PyObject *__pyx_v_state, struct LxmlDocument *__pyx_v_doc, xmlNode *__pyx_v_c_node) {
55096   PyObject *__pyx_r = NULL;
55097   int __pyx_t_1;
55098   PyObject *__pyx_t_2 = NULL;
55099   __Pyx_SetupRefcountContext("_parser_class_lookup");
55100
55101   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":338
55102  * 
55103  * cdef object _parser_class_lookup(state, _Document doc, xmlNode* c_node):
55104  *     if doc._parser._class_lookup is not None:             # <<<<<<<<<<<<<<
55105  *         return doc._parser._class_lookup._lookup_function(
55106  *             doc._parser._class_lookup, doc, c_node)
55107  */
55108   __pyx_t_1 = (((PyObject *)__pyx_v_doc->_parser->_class_lookup) != Py_None);
55109   if (__pyx_t_1) {
55110
55111     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":339
55112  * cdef object _parser_class_lookup(state, _Document doc, xmlNode* c_node):
55113  *     if doc._parser._class_lookup is not None:
55114  *         return doc._parser._class_lookup._lookup_function(             # <<<<<<<<<<<<<<
55115  *             doc._parser._class_lookup, doc, c_node)
55116  *     return _callLookupFallback(<FallbackElementClassLookup>state, doc, c_node)
55117  */
55118     __Pyx_XDECREF(__pyx_r);
55119
55120     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":340
55121  *     if doc._parser._class_lookup is not None:
55122  *         return doc._parser._class_lookup._lookup_function(
55123  *             doc._parser._class_lookup, doc, c_node)             # <<<<<<<<<<<<<<
55124  *     return _callLookupFallback(<FallbackElementClassLookup>state, doc, c_node)
55125  * 
55126  */
55127     __pyx_t_2 = __pyx_v_doc->_parser->_class_lookup->_lookup_function(((PyObject *)__pyx_v_doc->_parser->_class_lookup), __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
55128     __Pyx_GOTREF(__pyx_t_2);
55129     __pyx_r = __pyx_t_2;
55130     __pyx_t_2 = 0;
55131     goto __pyx_L0;
55132     goto __pyx_L3;
55133   }
55134   __pyx_L3:;
55135
55136   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":341
55137  *         return doc._parser._class_lookup._lookup_function(
55138  *             doc._parser._class_lookup, doc, c_node)
55139  *     return _callLookupFallback(<FallbackElementClassLookup>state, doc, c_node)             # <<<<<<<<<<<<<<
55140  * 
55141  * 
55142  */
55143   __Pyx_XDECREF(__pyx_r);
55144   __pyx_t_2 = __pyx_f_4lxml_5etree__callLookupFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_state), __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
55145   __Pyx_GOTREF(__pyx_t_2);
55146   __pyx_r = __pyx_t_2;
55147   __pyx_t_2 = 0;
55148   goto __pyx_L0;
55149
55150   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
55151   goto __pyx_L0;
55152   __pyx_L1_error:;
55153   __Pyx_XDECREF(__pyx_t_2);
55154   __Pyx_AddTraceback("lxml.etree._parser_class_lookup");
55155   __pyx_r = 0;
55156   __pyx_L0:;
55157   __Pyx_XGIVEREF(__pyx_r);
55158   __Pyx_FinishRefcountContext();
55159   return __pyx_r;
55160 }
55161
55162 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":363
55163  *     If you return None from this method, the fallback will be called.
55164  *     """
55165  *     def __cinit__(self):             # <<<<<<<<<<<<<<
55166  *         self._lookup_function = _custom_class_lookup
55167  * 
55168  */
55169
55170 static int __pyx_pf_4lxml_5etree_24CustomElementClassLookup___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
55171 static int __pyx_pf_4lxml_5etree_24CustomElementClassLookup___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
55172   int __pyx_r;
55173   __Pyx_SetupRefcountContext("__cinit__");
55174   if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
55175     __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
55176   if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
55177
55178   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":364
55179  *     """
55180  *     def __cinit__(self):
55181  *         self._lookup_function = _custom_class_lookup             # <<<<<<<<<<<<<<
55182  * 
55183  *     def lookup(self, type, doc, namespace, name):
55184  */
55185   ((struct __pyx_obj_4lxml_5etree_CustomElementClassLookup *)__pyx_v_self)->__pyx_base.__pyx_base._lookup_function = __pyx_f_4lxml_5etree__custom_class_lookup;
55186
55187   __pyx_r = 0;
55188   __Pyx_FinishRefcountContext();
55189   return __pyx_r;
55190 }
55191
55192 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":366
55193  *         self._lookup_function = _custom_class_lookup
55194  * 
55195  *     def lookup(self, type, doc, namespace, name):             # <<<<<<<<<<<<<<
55196  *         u"lookup(self, type, doc, namespace, name)"
55197  *         return None
55198  */
55199
55200 static PyObject *__pyx_pf_4lxml_5etree_24CustomElementClassLookup_lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
55201 static char __pyx_doc_4lxml_5etree_24CustomElementClassLookup_lookup[] = "lookup(self, type, doc, namespace, name)";
55202 static PyObject *__pyx_pf_4lxml_5etree_24CustomElementClassLookup_lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
55203   PyObject *__pyx_v_type = 0;
55204   PyObject *__pyx_v_doc = 0;
55205   PyObject *__pyx_v_namespace = 0;
55206   PyObject *__pyx_v_name = 0;
55207   PyObject *__pyx_r = NULL;
55208   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_type,&__pyx_kp_doc,&__pyx_kp_namespace,&__pyx_kp_name,0};
55209   __Pyx_SetupRefcountContext("lookup");
55210   if (unlikely(__pyx_kwds)) {
55211     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
55212     PyObject* values[4] = {0,0,0,0};
55213     switch (PyTuple_GET_SIZE(__pyx_args)) {
55214       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
55215       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
55216       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
55217       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
55218       case  0: break;
55219       default: goto __pyx_L5_argtuple_error;
55220     }
55221     switch (PyTuple_GET_SIZE(__pyx_args)) {
55222       case  0:
55223       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_type);
55224       if (likely(values[0])) kw_args--;
55225       else goto __pyx_L5_argtuple_error;
55226       case  1:
55227       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_doc);
55228       if (likely(values[1])) kw_args--;
55229       else {
55230         __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 1); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
55231       }
55232       case  2:
55233       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_namespace);
55234       if (likely(values[2])) kw_args--;
55235       else {
55236         __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 2); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
55237       }
55238       case  3:
55239       values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_name);
55240       if (likely(values[3])) kw_args--;
55241       else {
55242         __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 3); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
55243       }
55244     }
55245     if (unlikely(kw_args > 0)) {
55246       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "lookup") < 0)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
55247     }
55248     __pyx_v_type = values[0];
55249     __pyx_v_doc = values[1];
55250     __pyx_v_namespace = values[2];
55251     __pyx_v_name = values[3];
55252   } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
55253     goto __pyx_L5_argtuple_error;
55254   } else {
55255     __pyx_v_type = PyTuple_GET_ITEM(__pyx_args, 0);
55256     __pyx_v_doc = PyTuple_GET_ITEM(__pyx_args, 1);
55257     __pyx_v_namespace = PyTuple_GET_ITEM(__pyx_args, 2);
55258     __pyx_v_name = PyTuple_GET_ITEM(__pyx_args, 3);
55259   }
55260   goto __pyx_L4_argument_unpacking_done;
55261   __pyx_L5_argtuple_error:;
55262   __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
55263   __pyx_L3_error:;
55264   __Pyx_AddTraceback("lxml.etree.CustomElementClassLookup.lookup");
55265   return NULL;
55266   __pyx_L4_argument_unpacking_done:;
55267
55268   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":368
55269  *     def lookup(self, type, doc, namespace, name):
55270  *         u"lookup(self, type, doc, namespace, name)"
55271  *         return None             # <<<<<<<<<<<<<<
55272  * 
55273  * cdef object _custom_class_lookup(state, _Document doc, xmlNode* c_node):
55274  */
55275   __Pyx_XDECREF(__pyx_r);
55276   __Pyx_INCREF(Py_None);
55277   __pyx_r = Py_None;
55278   goto __pyx_L0;
55279
55280   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
55281   __pyx_L0:;
55282   __Pyx_XGIVEREF(__pyx_r);
55283   __Pyx_FinishRefcountContext();
55284   return __pyx_r;
55285 }
55286
55287 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":370
55288  *         return None
55289  * 
55290  * cdef object _custom_class_lookup(state, _Document doc, xmlNode* c_node):             # <<<<<<<<<<<<<<
55291  *     cdef CustomElementClassLookup lookup
55292  *     cdef char* c_str
55293  */
55294
55295 static  PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_state, struct LxmlDocument *__pyx_v_doc, xmlNode *__pyx_v_c_node) {
55296   struct __pyx_obj_4lxml_5etree_CustomElementClassLookup *__pyx_v_lookup;
55297   char *__pyx_v_c_str;
55298   PyObject *__pyx_v_element_type;
55299   PyObject *__pyx_v_name;
55300   PyObject *__pyx_v_ns;
55301   PyObject *__pyx_v_cls;
55302   PyObject *__pyx_r = NULL;
55303   int __pyx_t_1;
55304   PyObject *__pyx_t_2 = NULL;
55305   PyObject *__pyx_t_3 = NULL;
55306   PyObject *__pyx_t_4 = NULL;
55307   __Pyx_SetupRefcountContext("_custom_class_lookup");
55308   __pyx_v_lookup = ((struct __pyx_obj_4lxml_5etree_CustomElementClassLookup *)Py_None); __Pyx_INCREF(Py_None);
55309   __pyx_v_element_type = Py_None; __Pyx_INCREF(Py_None);
55310   __pyx_v_name = Py_None; __Pyx_INCREF(Py_None);
55311   __pyx_v_ns = Py_None; __Pyx_INCREF(Py_None);
55312   __pyx_v_cls = Py_None; __Pyx_INCREF(Py_None);
55313
55314   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":374
55315  *     cdef char* c_str
55316  * 
55317  *     lookup = <CustomElementClassLookup>state             # <<<<<<<<<<<<<<
55318  * 
55319  *     if c_node.type == tree.XML_ELEMENT_NODE:
55320  */
55321   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_CustomElementClassLookup *)__pyx_v_state)));
55322   __Pyx_DECREF(((PyObject *)__pyx_v_lookup));
55323   __pyx_v_lookup = ((struct __pyx_obj_4lxml_5etree_CustomElementClassLookup *)__pyx_v_state);
55324
55325   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":376
55326  *     lookup = <CustomElementClassLookup>state
55327  * 
55328  *     if c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
55329  *         element_type = u"element"
55330  *     elif c_node.type == tree.XML_COMMENT_NODE:
55331  */
55332   __pyx_t_1 = (__pyx_v_c_node->type == XML_ELEMENT_NODE);
55333   if (__pyx_t_1) {
55334
55335     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":377
55336  * 
55337  *     if c_node.type == tree.XML_ELEMENT_NODE:
55338  *         element_type = u"element"             # <<<<<<<<<<<<<<
55339  *     elif c_node.type == tree.XML_COMMENT_NODE:
55340  *         element_type = u"comment"
55341  */
55342     __Pyx_INCREF(((PyObject *)__pyx_kp_408));
55343     __Pyx_DECREF(__pyx_v_element_type);
55344     __pyx_v_element_type = ((PyObject *)__pyx_kp_408);
55345     goto __pyx_L3;
55346   }
55347
55348   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":378
55349  *     if c_node.type == tree.XML_ELEMENT_NODE:
55350  *         element_type = u"element"
55351  *     elif c_node.type == tree.XML_COMMENT_NODE:             # <<<<<<<<<<<<<<
55352  *         element_type = u"comment"
55353  *     elif c_node.type == tree.XML_PI_NODE:
55354  */
55355   __pyx_t_1 = (__pyx_v_c_node->type == XML_COMMENT_NODE);
55356   if (__pyx_t_1) {
55357
55358     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":379
55359  *         element_type = u"element"
55360  *     elif c_node.type == tree.XML_COMMENT_NODE:
55361  *         element_type = u"comment"             # <<<<<<<<<<<<<<
55362  *     elif c_node.type == tree.XML_PI_NODE:
55363  *         element_type = u"PI"
55364  */
55365     __Pyx_INCREF(((PyObject *)__pyx_kp_409));
55366     __Pyx_DECREF(__pyx_v_element_type);
55367     __pyx_v_element_type = ((PyObject *)__pyx_kp_409);
55368     goto __pyx_L3;
55369   }
55370
55371   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":380
55372  *     elif c_node.type == tree.XML_COMMENT_NODE:
55373  *         element_type = u"comment"
55374  *     elif c_node.type == tree.XML_PI_NODE:             # <<<<<<<<<<<<<<
55375  *         element_type = u"PI"
55376  *     elif c_node.type == tree.XML_ENTITY_REF_NODE:
55377  */
55378   __pyx_t_1 = (__pyx_v_c_node->type == XML_PI_NODE);
55379   if (__pyx_t_1) {
55380
55381     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":381
55382  *         element_type = u"comment"
55383  *     elif c_node.type == tree.XML_PI_NODE:
55384  *         element_type = u"PI"             # <<<<<<<<<<<<<<
55385  *     elif c_node.type == tree.XML_ENTITY_REF_NODE:
55386  *         element_type = u"entity"
55387  */
55388     __Pyx_INCREF(((PyObject *)__pyx_kp_410));
55389     __Pyx_DECREF(__pyx_v_element_type);
55390     __pyx_v_element_type = ((PyObject *)__pyx_kp_410);
55391     goto __pyx_L3;
55392   }
55393
55394   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":382
55395  *     elif c_node.type == tree.XML_PI_NODE:
55396  *         element_type = u"PI"
55397  *     elif c_node.type == tree.XML_ENTITY_REF_NODE:             # <<<<<<<<<<<<<<
55398  *         element_type = u"entity"
55399  *     else:
55400  */
55401   __pyx_t_1 = (__pyx_v_c_node->type == XML_ENTITY_REF_NODE);
55402   if (__pyx_t_1) {
55403
55404     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":383
55405  *         element_type = u"PI"
55406  *     elif c_node.type == tree.XML_ENTITY_REF_NODE:
55407  *         element_type = u"entity"             # <<<<<<<<<<<<<<
55408  *     else:
55409  *         element_type = u"element"
55410  */
55411     __Pyx_INCREF(((PyObject *)__pyx_kp_411));
55412     __Pyx_DECREF(__pyx_v_element_type);
55413     __pyx_v_element_type = ((PyObject *)__pyx_kp_411);
55414     goto __pyx_L3;
55415   }
55416   /*else*/ {
55417
55418     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":385
55419  *         element_type = u"entity"
55420  *     else:
55421  *         element_type = u"element"             # <<<<<<<<<<<<<<
55422  *     if c_node.name is NULL:
55423  *         name = None
55424  */
55425     __Pyx_INCREF(((PyObject *)__pyx_kp_412));
55426     __Pyx_DECREF(__pyx_v_element_type);
55427     __pyx_v_element_type = ((PyObject *)__pyx_kp_412);
55428   }
55429   __pyx_L3:;
55430
55431   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":386
55432  *     else:
55433  *         element_type = u"element"
55434  *     if c_node.name is NULL:             # <<<<<<<<<<<<<<
55435  *         name = None
55436  *     else:
55437  */
55438   __pyx_t_1 = (__pyx_v_c_node->name == NULL);
55439   if (__pyx_t_1) {
55440
55441     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":387
55442  *         element_type = u"element"
55443  *     if c_node.name is NULL:
55444  *         name = None             # <<<<<<<<<<<<<<
55445  *     else:
55446  *         name = funicode(c_node.name)
55447  */
55448     __Pyx_INCREF(Py_None);
55449     __Pyx_DECREF(__pyx_v_name);
55450     __pyx_v_name = Py_None;
55451     goto __pyx_L4;
55452   }
55453   /*else*/ {
55454
55455     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":389
55456  *         name = None
55457  *     else:
55458  *         name = funicode(c_node.name)             # <<<<<<<<<<<<<<
55459  *     c_str = tree._getNs(c_node)
55460  *     if c_str is NULL:
55461  */
55462     __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_node->name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
55463     __Pyx_GOTREF(__pyx_t_2);
55464     __Pyx_DECREF(__pyx_v_name);
55465     __pyx_v_name = __pyx_t_2;
55466     __pyx_t_2 = 0;
55467   }
55468   __pyx_L4:;
55469
55470   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":390
55471  *     else:
55472  *         name = funicode(c_node.name)
55473  *     c_str = tree._getNs(c_node)             # <<<<<<<<<<<<<<
55474  *     if c_str is NULL:
55475  *         ns = None
55476  */
55477   __pyx_v_c_str = _getNs(__pyx_v_c_node);
55478
55479   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":391
55480  *         name = funicode(c_node.name)
55481  *     c_str = tree._getNs(c_node)
55482  *     if c_str is NULL:             # <<<<<<<<<<<<<<
55483  *         ns = None
55484  *     else:
55485  */
55486   __pyx_t_1 = (__pyx_v_c_str == NULL);
55487   if (__pyx_t_1) {
55488
55489     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":392
55490  *     c_str = tree._getNs(c_node)
55491  *     if c_str is NULL:
55492  *         ns = None             # <<<<<<<<<<<<<<
55493  *     else:
55494  *         ns = funicode(c_str)
55495  */
55496     __Pyx_INCREF(Py_None);
55497     __Pyx_DECREF(__pyx_v_ns);
55498     __pyx_v_ns = Py_None;
55499     goto __pyx_L5;
55500   }
55501   /*else*/ {
55502
55503     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":394
55504  *         ns = None
55505  *     else:
55506  *         ns = funicode(c_str)             # <<<<<<<<<<<<<<
55507  * 
55508  *     cls = lookup.lookup(element_type, doc, ns, name)
55509  */
55510     __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_str); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
55511     __Pyx_GOTREF(__pyx_t_2);
55512     __Pyx_DECREF(__pyx_v_ns);
55513     __pyx_v_ns = __pyx_t_2;
55514     __pyx_t_2 = 0;
55515   }
55516   __pyx_L5:;
55517
55518   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":396
55519  *         ns = funicode(c_str)
55520  * 
55521  *     cls = lookup.lookup(element_type, doc, ns, name)             # <<<<<<<<<<<<<<
55522  *     if cls is not None:
55523  *         return cls
55524  */
55525   __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_lookup), __pyx_kp_lookup); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
55526   __Pyx_GOTREF(__pyx_t_2);
55527   __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
55528   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
55529   __Pyx_INCREF(__pyx_v_element_type);
55530   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_element_type);
55531   __Pyx_GIVEREF(__pyx_v_element_type);
55532   __Pyx_INCREF(((PyObject *)__pyx_v_doc));
55533   PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_doc));
55534   __Pyx_GIVEREF(((PyObject *)__pyx_v_doc));
55535   __Pyx_INCREF(__pyx_v_ns);
55536   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_ns);
55537   __Pyx_GIVEREF(__pyx_v_ns);
55538   __Pyx_INCREF(__pyx_v_name);
55539   PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_name);
55540   __Pyx_GIVEREF(__pyx_v_name);
55541   __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
55542   __Pyx_GOTREF(__pyx_t_4);
55543   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
55544   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
55545   __Pyx_DECREF(__pyx_v_cls);
55546   __pyx_v_cls = __pyx_t_4;
55547   __pyx_t_4 = 0;
55548
55549   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":397
55550  * 
55551  *     cls = lookup.lookup(element_type, doc, ns, name)
55552  *     if cls is not None:             # <<<<<<<<<<<<<<
55553  *         return cls
55554  *     return _callLookupFallback(lookup, doc, c_node)
55555  */
55556   __pyx_t_1 = (__pyx_v_cls != Py_None);
55557   if (__pyx_t_1) {
55558
55559     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":398
55560  *     cls = lookup.lookup(element_type, doc, ns, name)
55561  *     if cls is not None:
55562  *         return cls             # <<<<<<<<<<<<<<
55563  *     return _callLookupFallback(lookup, doc, c_node)
55564  * 
55565  */
55566     __Pyx_XDECREF(__pyx_r);
55567     __Pyx_INCREF(__pyx_v_cls);
55568     __pyx_r = __pyx_v_cls;
55569     goto __pyx_L0;
55570     goto __pyx_L6;
55571   }
55572   __pyx_L6:;
55573
55574   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":399
55575  *     if cls is not None:
55576  *         return cls
55577  *     return _callLookupFallback(lookup, doc, c_node)             # <<<<<<<<<<<<<<
55578  * 
55579  * 
55580  */
55581   __Pyx_XDECREF(__pyx_r);
55582   __pyx_t_4 = __pyx_f_4lxml_5etree__callLookupFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_lookup), __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
55583   __Pyx_GOTREF(__pyx_t_4);
55584   __pyx_r = __pyx_t_4;
55585   __pyx_t_4 = 0;
55586   goto __pyx_L0;
55587
55588   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
55589   goto __pyx_L0;
55590   __pyx_L1_error:;
55591   __Pyx_XDECREF(__pyx_t_2);
55592   __Pyx_XDECREF(__pyx_t_3);
55593   __Pyx_XDECREF(__pyx_t_4);
55594   __Pyx_AddTraceback("lxml.etree._custom_class_lookup");
55595   __pyx_r = 0;
55596   __pyx_L0:;
55597   __Pyx_DECREF((PyObject *)__pyx_v_lookup);
55598   __Pyx_DECREF(__pyx_v_element_type);
55599   __Pyx_DECREF(__pyx_v_name);
55600   __Pyx_DECREF(__pyx_v_ns);
55601   __Pyx_DECREF(__pyx_v_cls);
55602   __Pyx_XGIVEREF(__pyx_r);
55603   __Pyx_FinishRefcountContext();
55604   return __pyx_r;
55605 }
55606
55607 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":448
55608  *     See http://codespeak.net/lxml/element_classes.html
55609  *     """
55610  *     def __cinit__(self):             # <<<<<<<<<<<<<<
55611  *         self._lookup_function = _python_class_lookup
55612  * 
55613  */
55614
55615 static int __pyx_pf_4lxml_5etree_24PythonElementClassLookup___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
55616 static int __pyx_pf_4lxml_5etree_24PythonElementClassLookup___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
55617   int __pyx_r;
55618   __Pyx_SetupRefcountContext("__cinit__");
55619   if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
55620     __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
55621   if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
55622
55623   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":449
55624  *     """
55625  *     def __cinit__(self):
55626  *         self._lookup_function = _python_class_lookup             # <<<<<<<<<<<<<<
55627  * 
55628  *     def lookup(self, doc, element):
55629  */
55630   ((struct __pyx_obj_4lxml_5etree_PythonElementClassLookup *)__pyx_v_self)->__pyx_base.__pyx_base._lookup_function = __pyx_f_4lxml_5etree__python_class_lookup;
55631
55632   __pyx_r = 0;
55633   __Pyx_FinishRefcountContext();
55634   return __pyx_r;
55635 }
55636
55637 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":451
55638  *         self._lookup_function = _python_class_lookup
55639  * 
55640  *     def lookup(self, doc, element):             # <<<<<<<<<<<<<<
55641  *         u"""lookup(self, doc, element)
55642  * 
55643  */
55644
55645 static PyObject *__pyx_pf_4lxml_5etree_24PythonElementClassLookup_lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
55646 static char __pyx_doc_4lxml_5etree_24PythonElementClassLookup_lookup[] = "lookup(self, doc, element)\n\n        Override this method to implement your own lookup scheme.\n        ";
55647 static PyObject *__pyx_pf_4lxml_5etree_24PythonElementClassLookup_lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
55648   PyObject *__pyx_v_doc = 0;
55649   PyObject *__pyx_v_element = 0;
55650   PyObject *__pyx_r = NULL;
55651   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_doc,&__pyx_kp_element,0};
55652   __Pyx_SetupRefcountContext("lookup");
55653   if (unlikely(__pyx_kwds)) {
55654     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
55655     PyObject* values[2] = {0,0};
55656     switch (PyTuple_GET_SIZE(__pyx_args)) {
55657       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
55658       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
55659       case  0: break;
55660       default: goto __pyx_L5_argtuple_error;
55661     }
55662     switch (PyTuple_GET_SIZE(__pyx_args)) {
55663       case  0:
55664       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_doc);
55665       if (likely(values[0])) kw_args--;
55666       else goto __pyx_L5_argtuple_error;
55667       case  1:
55668       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_element);
55669       if (likely(values[1])) kw_args--;
55670       else {
55671         __Pyx_RaiseArgtupleInvalid("lookup", 1, 2, 2, 1); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
55672       }
55673     }
55674     if (unlikely(kw_args > 0)) {
55675       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "lookup") < 0)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
55676     }
55677     __pyx_v_doc = values[0];
55678     __pyx_v_element = values[1];
55679   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
55680     goto __pyx_L5_argtuple_error;
55681   } else {
55682     __pyx_v_doc = PyTuple_GET_ITEM(__pyx_args, 0);
55683     __pyx_v_element = PyTuple_GET_ITEM(__pyx_args, 1);
55684   }
55685   goto __pyx_L4_argument_unpacking_done;
55686   __pyx_L5_argtuple_error:;
55687   __Pyx_RaiseArgtupleInvalid("lookup", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
55688   __pyx_L3_error:;
55689   __Pyx_AddTraceback("lxml.etree.PythonElementClassLookup.lookup");
55690   return NULL;
55691   __pyx_L4_argument_unpacking_done:;
55692
55693   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":456
55694  *         Override this method to implement your own lookup scheme.
55695  *         """
55696  *         return None             # <<<<<<<<<<<<<<
55697  * 
55698  * cdef object _python_class_lookup(state, _Document doc, tree.xmlNode* c_node):
55699  */
55700   __Pyx_XDECREF(__pyx_r);
55701   __Pyx_INCREF(Py_None);
55702   __pyx_r = Py_None;
55703   goto __pyx_L0;
55704
55705   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
55706   __pyx_L0:;
55707   __Pyx_XGIVEREF(__pyx_r);
55708   __Pyx_FinishRefcountContext();
55709   return __pyx_r;
55710 }
55711
55712 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":458
55713  *         return None
55714  * 
55715  * cdef object _python_class_lookup(state, _Document doc, tree.xmlNode* c_node):             # <<<<<<<<<<<<<<
55716  *     cdef PythonElementClassLookup lookup
55717  *     cdef _ReadOnlyElementProxy proxy
55718  */
55719
55720 static  PyObject *__pyx_f_4lxml_5etree__python_class_lookup(PyObject *__pyx_v_state, struct LxmlDocument *__pyx_v_doc, xmlNode *__pyx_v_c_node) {
55721   struct __pyx_obj_4lxml_5etree_PythonElementClassLookup *__pyx_v_lookup;
55722   struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *__pyx_v_proxy;
55723   PyObject *__pyx_v_cls;
55724   PyObject *__pyx_r = NULL;
55725   PyObject *__pyx_t_1 = NULL;
55726   PyObject *__pyx_t_2 = NULL;
55727   PyObject *__pyx_t_3 = NULL;
55728   int __pyx_t_4;
55729   __Pyx_SetupRefcountContext("_python_class_lookup");
55730   __pyx_v_lookup = ((struct __pyx_obj_4lxml_5etree_PythonElementClassLookup *)Py_None); __Pyx_INCREF(Py_None);
55731   __pyx_v_proxy = ((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)Py_None); __Pyx_INCREF(Py_None);
55732   __pyx_v_cls = Py_None; __Pyx_INCREF(Py_None);
55733
55734   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":461
55735  *     cdef PythonElementClassLookup lookup
55736  *     cdef _ReadOnlyElementProxy proxy
55737  *     lookup = <PythonElementClassLookup>state             # <<<<<<<<<<<<<<
55738  * 
55739  *     proxy = _newReadOnlyProxy(None, c_node)
55740  */
55741   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_PythonElementClassLookup *)__pyx_v_state)));
55742   __Pyx_DECREF(((PyObject *)__pyx_v_lookup));
55743   __pyx_v_lookup = ((struct __pyx_obj_4lxml_5etree_PythonElementClassLookup *)__pyx_v_state);
55744
55745   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":463
55746  *     lookup = <PythonElementClassLookup>state
55747  * 
55748  *     proxy = _newReadOnlyProxy(None, c_node)             # <<<<<<<<<<<<<<
55749  *     cls = lookup.lookup(doc, proxy)
55750  *     _freeReadOnlyProxies(proxy)
55751  */
55752   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__newReadOnlyProxy(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)Py_None), __pyx_v_c_node)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
55753   __Pyx_GOTREF(__pyx_t_1);
55754   __Pyx_DECREF(((PyObject *)__pyx_v_proxy));
55755   __pyx_v_proxy = ((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_t_1);
55756   __pyx_t_1 = 0;
55757
55758   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":464
55759  * 
55760  *     proxy = _newReadOnlyProxy(None, c_node)
55761  *     cls = lookup.lookup(doc, proxy)             # <<<<<<<<<<<<<<
55762  *     _freeReadOnlyProxies(proxy)
55763  * 
55764  */
55765   __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_lookup), __pyx_kp_lookup); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
55766   __Pyx_GOTREF(__pyx_t_1);
55767   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
55768   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
55769   __Pyx_INCREF(((PyObject *)__pyx_v_doc));
55770   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_doc));
55771   __Pyx_GIVEREF(((PyObject *)__pyx_v_doc));
55772   __Pyx_INCREF(((PyObject *)__pyx_v_proxy));
55773   PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_proxy));
55774   __Pyx_GIVEREF(((PyObject *)__pyx_v_proxy));
55775   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
55776   __Pyx_GOTREF(__pyx_t_3);
55777   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
55778   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
55779   __Pyx_DECREF(__pyx_v_cls);
55780   __pyx_v_cls = __pyx_t_3;
55781   __pyx_t_3 = 0;
55782
55783   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":465
55784  *     proxy = _newReadOnlyProxy(None, c_node)
55785  *     cls = lookup.lookup(doc, proxy)
55786  *     _freeReadOnlyProxies(proxy)             # <<<<<<<<<<<<<<
55787  * 
55788  *     if cls is not None:
55789  */
55790   __pyx_t_3 = __pyx_f_4lxml_5etree__freeReadOnlyProxies(__pyx_v_proxy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
55791   __Pyx_GOTREF(__pyx_t_3);
55792   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
55793
55794   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":467
55795  *     _freeReadOnlyProxies(proxy)
55796  * 
55797  *     if cls is not None:             # <<<<<<<<<<<<<<
55798  *         return cls
55799  *     return _callLookupFallback(lookup, doc, c_node)
55800  */
55801   __pyx_t_4 = (__pyx_v_cls != Py_None);
55802   if (__pyx_t_4) {
55803
55804     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":468
55805  * 
55806  *     if cls is not None:
55807  *         return cls             # <<<<<<<<<<<<<<
55808  *     return _callLookupFallback(lookup, doc, c_node)
55809  * 
55810  */
55811     __Pyx_XDECREF(__pyx_r);
55812     __Pyx_INCREF(__pyx_v_cls);
55813     __pyx_r = __pyx_v_cls;
55814     goto __pyx_L0;
55815     goto __pyx_L3;
55816   }
55817   __pyx_L3:;
55818
55819   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":469
55820  *     if cls is not None:
55821  *         return cls
55822  *     return _callLookupFallback(lookup, doc, c_node)             # <<<<<<<<<<<<<<
55823  * 
55824  * ################################################################################
55825  */
55826   __Pyx_XDECREF(__pyx_r);
55827   __pyx_t_3 = __pyx_f_4lxml_5etree__callLookupFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_lookup), __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
55828   __Pyx_GOTREF(__pyx_t_3);
55829   __pyx_r = __pyx_t_3;
55830   __pyx_t_3 = 0;
55831   goto __pyx_L0;
55832
55833   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
55834   goto __pyx_L0;
55835   __pyx_L1_error:;
55836   __Pyx_XDECREF(__pyx_t_1);
55837   __Pyx_XDECREF(__pyx_t_2);
55838   __Pyx_XDECREF(__pyx_t_3);
55839   __Pyx_AddTraceback("lxml.etree._python_class_lookup");
55840   __pyx_r = 0;
55841   __pyx_L0:;
55842   __Pyx_DECREF((PyObject *)__pyx_v_lookup);
55843   __Pyx_DECREF((PyObject *)__pyx_v_proxy);
55844   __Pyx_DECREF(__pyx_v_cls);
55845   __Pyx_XGIVEREF(__pyx_r);
55846   __Pyx_FinishRefcountContext();
55847   return __pyx_r;
55848 }
55849
55850 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":477
55851  * cdef object ELEMENT_CLASS_LOOKUP_STATE
55852  * 
55853  * cdef void _setElementClassLookupFunction(             # <<<<<<<<<<<<<<
55854  *     _element_class_lookup_function function, object state):
55855  *     global LOOKUP_ELEMENT_CLASS, ELEMENT_CLASS_LOOKUP_STATE
55856  */
55857
55858 static  void __pyx_f_4lxml_5etree__setElementClassLookupFunction(_element_class_lookup_function __pyx_v_function, PyObject *__pyx_v_state) {
55859   int __pyx_t_1;
55860   __Pyx_SetupRefcountContext("_setElementClassLookupFunction");
55861   __Pyx_INCREF(__pyx_v_state);
55862
55863   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":480
55864  *     _element_class_lookup_function function, object state):
55865  *     global LOOKUP_ELEMENT_CLASS, ELEMENT_CLASS_LOOKUP_STATE
55866  *     if function is NULL:             # <<<<<<<<<<<<<<
55867  *         state    = DEFAULT_ELEMENT_CLASS_LOOKUP
55868  *         function = DEFAULT_ELEMENT_CLASS_LOOKUP._lookup_function
55869  */
55870   __pyx_t_1 = (__pyx_v_function == NULL);
55871   if (__pyx_t_1) {
55872
55873     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":481
55874  *     global LOOKUP_ELEMENT_CLASS, ELEMENT_CLASS_LOOKUP_STATE
55875  *     if function is NULL:
55876  *         state    = DEFAULT_ELEMENT_CLASS_LOOKUP             # <<<<<<<<<<<<<<
55877  *         function = DEFAULT_ELEMENT_CLASS_LOOKUP._lookup_function
55878  * 
55879  */
55880     __Pyx_INCREF(((PyObject *)__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP));
55881     __Pyx_DECREF(__pyx_v_state);
55882     __pyx_v_state = ((PyObject *)__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP);
55883
55884     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":482
55885  *     if function is NULL:
55886  *         state    = DEFAULT_ELEMENT_CLASS_LOOKUP
55887  *         function = DEFAULT_ELEMENT_CLASS_LOOKUP._lookup_function             # <<<<<<<<<<<<<<
55888  * 
55889  *     ELEMENT_CLASS_LOOKUP_STATE = state
55890  */
55891     __pyx_v_function = __pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP->__pyx_base.__pyx_base._lookup_function;
55892     goto __pyx_L3;
55893   }
55894   __pyx_L3:;
55895
55896   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":484
55897  *         function = DEFAULT_ELEMENT_CLASS_LOOKUP._lookup_function
55898  * 
55899  *     ELEMENT_CLASS_LOOKUP_STATE = state             # <<<<<<<<<<<<<<
55900  *     LOOKUP_ELEMENT_CLASS = function
55901  * 
55902  */
55903   __Pyx_INCREF(__pyx_v_state);
55904   __Pyx_GOTREF(__pyx_v_4lxml_5etree_ELEMENT_CLASS_LOOKUP_STATE);
55905   __Pyx_DECREF(__pyx_v_4lxml_5etree_ELEMENT_CLASS_LOOKUP_STATE);
55906   __Pyx_GIVEREF(__pyx_v_state);
55907   __pyx_v_4lxml_5etree_ELEMENT_CLASS_LOOKUP_STATE = __pyx_v_state;
55908
55909   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":485
55910  * 
55911  *     ELEMENT_CLASS_LOOKUP_STATE = state
55912  *     LOOKUP_ELEMENT_CLASS = function             # <<<<<<<<<<<<<<
55913  * 
55914  * def set_element_class_lookup(ElementClassLookup lookup = None):
55915  */
55916   __pyx_v_4lxml_5etree_LOOKUP_ELEMENT_CLASS = __pyx_v_function;
55917
55918   __Pyx_DECREF(__pyx_v_state);
55919   __Pyx_FinishRefcountContext();
55920 }
55921
55922 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":487
55923  *     LOOKUP_ELEMENT_CLASS = function
55924  * 
55925  * def set_element_class_lookup(ElementClassLookup lookup = None):             # <<<<<<<<<<<<<<
55926  *     u"""set_element_class_lookup(lookup = None)
55927  * 
55928  */
55929
55930 static PyObject *__pyx_pf_4lxml_5etree_set_element_class_lookup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
55931 static char __pyx_doc_4lxml_5etree_set_element_class_lookup[] = "set_element_class_lookup(lookup = None)\n\n    Set the global default element class lookup method.\n    ";
55932 static PyObject *__pyx_pf_4lxml_5etree_set_element_class_lookup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
55933   struct LxmlElementClassLookup *__pyx_v_lookup = 0;
55934   PyObject *__pyx_r = NULL;
55935   int __pyx_t_1;
55936   int __pyx_t_2;
55937   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_lookup,0};
55938   __Pyx_SetupRefcountContext("set_element_class_lookup");
55939   __pyx_self = __pyx_self;
55940   if (unlikely(__pyx_kwds)) {
55941     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
55942     PyObject* values[1] = {0};
55943     values[0] = (PyObject*)((struct LxmlElementClassLookup *)Py_None);
55944     switch (PyTuple_GET_SIZE(__pyx_args)) {
55945       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
55946       case  0: break;
55947       default: goto __pyx_L5_argtuple_error;
55948     }
55949     switch (PyTuple_GET_SIZE(__pyx_args)) {
55950       case  0:
55951       if (kw_args > 0) {
55952         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_lookup);
55953         if (unlikely(value)) { values[0] = value; kw_args--; }
55954       }
55955     }
55956     if (unlikely(kw_args > 0)) {
55957       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "set_element_class_lookup") < 0)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
55958     }
55959     __pyx_v_lookup = ((struct LxmlElementClassLookup *)values[0]);
55960   } else {
55961     __pyx_v_lookup = ((struct LxmlElementClassLookup *)Py_None);
55962     switch (PyTuple_GET_SIZE(__pyx_args)) {
55963       case  1: __pyx_v_lookup = ((struct LxmlElementClassLookup *)PyTuple_GET_ITEM(__pyx_args, 0));
55964       case  0: break;
55965       default: goto __pyx_L5_argtuple_error;
55966     }
55967   }
55968   goto __pyx_L4_argument_unpacking_done;
55969   __pyx_L5_argtuple_error:;
55970   __Pyx_RaiseArgtupleInvalid("set_element_class_lookup", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[9]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
55971   __pyx_L3_error:;
55972   __Pyx_AddTraceback("lxml.etree.set_element_class_lookup");
55973   return NULL;
55974   __pyx_L4_argument_unpacking_done:;
55975   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lookup), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "lookup", 0))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
55976
55977   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":492
55978  *     Set the global default element class lookup method.
55979  *     """
55980  *     if lookup is None or lookup._lookup_function is NULL:             # <<<<<<<<<<<<<<
55981  *         _setElementClassLookupFunction(NULL, None)
55982  *     else:
55983  */
55984   __pyx_t_1 = (((PyObject *)__pyx_v_lookup) == Py_None);
55985   if (!__pyx_t_1) {
55986     __pyx_t_2 = (__pyx_v_lookup->_lookup_function == NULL);
55987   } else {
55988     __pyx_t_2 = __pyx_t_1;
55989   }
55990   if (__pyx_t_2) {
55991
55992     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":493
55993  *     """
55994  *     if lookup is None or lookup._lookup_function is NULL:
55995  *         _setElementClassLookupFunction(NULL, None)             # <<<<<<<<<<<<<<
55996  *     else:
55997  *         _setElementClassLookupFunction(lookup._lookup_function, lookup)
55998  */
55999     __pyx_f_4lxml_5etree__setElementClassLookupFunction(NULL, Py_None);
56000     goto __pyx_L6;
56001   }
56002   /*else*/ {
56003
56004     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":495
56005  *         _setElementClassLookupFunction(NULL, None)
56006  *     else:
56007  *         _setElementClassLookupFunction(lookup._lookup_function, lookup)             # <<<<<<<<<<<<<<
56008  * 
56009  * # default setup: parser delegation
56010  */
56011     __pyx_f_4lxml_5etree__setElementClassLookupFunction(__pyx_v_lookup->_lookup_function, ((PyObject *)__pyx_v_lookup));
56012   }
56013   __pyx_L6:;
56014
56015   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
56016   goto __pyx_L0;
56017   __pyx_L1_error:;
56018   __Pyx_AddTraceback("lxml.etree.set_element_class_lookup");
56019   __pyx_r = NULL;
56020   __pyx_L0:;
56021   __Pyx_XGIVEREF(__pyx_r);
56022   __Pyx_FinishRefcountContext();
56023   return __pyx_r;
56024 }
56025
56026 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":20
56027  *     cdef dict _entries
56028  *     cdef char* _c_ns_uri_utf
56029  *     def __init__(self, ns_uri):             # <<<<<<<<<<<<<<
56030  *         self._ns_uri = ns_uri
56031  *         if ns_uri is None:
56032  */
56033
56034 static int __pyx_pf_4lxml_5etree_18_NamespaceRegistry___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
56035 static int __pyx_pf_4lxml_5etree_18_NamespaceRegistry___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
56036   PyObject *__pyx_v_ns_uri = 0;
56037   int __pyx_r;
56038   PyObject *__pyx_1 = 0;
56039   int __pyx_t_1;
56040   PyObject *__pyx_t_2 = NULL;
56041   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_ns_uri,0};
56042   __Pyx_SetupRefcountContext("__init__");
56043   if (unlikely(__pyx_kwds)) {
56044     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
56045     PyObject* values[1] = {0};
56046     switch (PyTuple_GET_SIZE(__pyx_args)) {
56047       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
56048       case  0: break;
56049       default: goto __pyx_L5_argtuple_error;
56050     }
56051     switch (PyTuple_GET_SIZE(__pyx_args)) {
56052       case  0:
56053       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_ns_uri);
56054       if (likely(values[0])) kw_args--;
56055       else goto __pyx_L5_argtuple_error;
56056     }
56057     if (unlikely(kw_args > 0)) {
56058       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
56059     }
56060     __pyx_v_ns_uri = values[0];
56061   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
56062     goto __pyx_L5_argtuple_error;
56063   } else {
56064     __pyx_v_ns_uri = PyTuple_GET_ITEM(__pyx_args, 0);
56065   }
56066   goto __pyx_L4_argument_unpacking_done;
56067   __pyx_L5_argtuple_error:;
56068   __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
56069   __pyx_L3_error:;
56070   __Pyx_AddTraceback("lxml.etree._NamespaceRegistry.__init__");
56071   return -1;
56072   __pyx_L4_argument_unpacking_done:;
56073
56074   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":21
56075  *     cdef char* _c_ns_uri_utf
56076  *     def __init__(self, ns_uri):
56077  *         self._ns_uri = ns_uri             # <<<<<<<<<<<<<<
56078  *         if ns_uri is None:
56079  *             self._ns_uri_utf = None
56080  */
56081   __Pyx_INCREF(__pyx_v_ns_uri);
56082   __Pyx_GIVEREF(__pyx_v_ns_uri);
56083   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_ns_uri);
56084   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_ns_uri);
56085   ((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_ns_uri = __pyx_v_ns_uri;
56086
56087   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":22
56088  *     def __init__(self, ns_uri):
56089  *         self._ns_uri = ns_uri
56090  *         if ns_uri is None:             # <<<<<<<<<<<<<<
56091  *             self._ns_uri_utf = None
56092  *             self._c_ns_uri_utf = NULL
56093  */
56094   __pyx_t_1 = (__pyx_v_ns_uri == Py_None);
56095   if (__pyx_t_1) {
56096
56097     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":23
56098  *         self._ns_uri = ns_uri
56099  *         if ns_uri is None:
56100  *             self._ns_uri_utf = None             # <<<<<<<<<<<<<<
56101  *             self._c_ns_uri_utf = NULL
56102  *         else:
56103  */
56104     __Pyx_INCREF(Py_None);
56105     __Pyx_GIVEREF(Py_None);
56106     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_ns_uri_utf);
56107     __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_ns_uri_utf);
56108     ((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_ns_uri_utf = Py_None;
56109
56110     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":24
56111  *         if ns_uri is None:
56112  *             self._ns_uri_utf = None
56113  *             self._c_ns_uri_utf = NULL             # <<<<<<<<<<<<<<
56114  *         else:
56115  *             self._ns_uri_utf = _utf8(ns_uri)
56116  */
56117     ((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_c_ns_uri_utf = NULL;
56118     goto __pyx_L6;
56119   }
56120   /*else*/ {
56121
56122     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":26
56123  *             self._c_ns_uri_utf = NULL
56124  *         else:
56125  *             self._ns_uri_utf = _utf8(ns_uri)             # <<<<<<<<<<<<<<
56126  *             self._c_ns_uri_utf = _cstr(self._ns_uri_utf)
56127  *         self._entries = {}
56128  */
56129     __pyx_t_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_ns_uri); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56130     __Pyx_GOTREF(__pyx_t_2);
56131     __Pyx_GIVEREF(__pyx_t_2);
56132     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_ns_uri_utf);
56133     __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_ns_uri_utf);
56134     ((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_ns_uri_utf = __pyx_t_2;
56135     __pyx_t_2 = 0;
56136
56137     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":27
56138  *         else:
56139  *             self._ns_uri_utf = _utf8(ns_uri)
56140  *             self._c_ns_uri_utf = _cstr(self._ns_uri_utf)             # <<<<<<<<<<<<<<
56141  *         self._entries = {}
56142  * 
56143  */
56144     ((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_c_ns_uri_utf = PyString_AS_STRING(((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_ns_uri_utf);
56145   }
56146   __pyx_L6:;
56147
56148   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":28
56149  *             self._ns_uri_utf = _utf8(ns_uri)
56150  *             self._c_ns_uri_utf = _cstr(self._ns_uri_utf)
56151  *         self._entries = {}             # <<<<<<<<<<<<<<
56152  * 
56153  *     def update(self, class_dict_iterable):
56154  */
56155   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56156   __Pyx_GOTREF(((PyObject *)__pyx_1));
56157   __Pyx_GIVEREF(((PyObject *)__pyx_1));
56158   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_entries);
56159   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_entries));
56160   ((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_entries = __pyx_1;
56161   __pyx_1 = 0;
56162
56163   __pyx_r = 0;
56164   goto __pyx_L0;
56165   __pyx_L1_error:;
56166   __Pyx_XDECREF(__pyx_1);
56167   __Pyx_XDECREF(__pyx_t_2);
56168   __Pyx_AddTraceback("lxml.etree._NamespaceRegistry.__init__");
56169   __pyx_r = -1;
56170   __pyx_L0:;
56171   __Pyx_FinishRefcountContext();
56172   return __pyx_r;
56173 }
56174
56175 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":30
56176  *         self._entries = {}
56177  * 
56178  *     def update(self, class_dict_iterable):             # <<<<<<<<<<<<<<
56179  *         u"""update(self, class_dict_iterable)
56180  * 
56181  */
56182
56183 static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_update(PyObject *__pyx_v_self, PyObject *__pyx_v_class_dict_iterable); /*proto*/
56184 static char __pyx_doc_4lxml_5etree_18_NamespaceRegistry_update[] = "update(self, class_dict_iterable)\n\n        Forgivingly update the registry.\n\n        If registered values do not match the required type for this\n        registry, or if their name starts with '_', they will be\n        silently discarded. This allows registrations at the module or\n        class level using vars(), globals() etc.";
56185 static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_update(PyObject *__pyx_v_self, PyObject *__pyx_v_class_dict_iterable) {
56186   PyObject *__pyx_v_name;
56187   PyObject *__pyx_v_item;
56188   PyObject *__pyx_r = NULL;
56189   PyObject *__pyx_1 = 0;
56190   PyObject *__pyx_2 = 0;
56191   PyObject *__pyx_3 = 0;
56192   int __pyx_t_1;
56193   PyObject *__pyx_t_2 = NULL;
56194   PyObject *__pyx_t_3 = NULL;
56195   Py_ssize_t __pyx_t_4;
56196   int __pyx_t_5;
56197   int __pyx_t_6;
56198   int __pyx_t_7;
56199   __Pyx_SetupRefcountContext("update");
56200   __Pyx_INCREF(__pyx_v_class_dict_iterable);
56201   __pyx_v_name = Py_None; __Pyx_INCREF(Py_None);
56202   __pyx_v_item = Py_None; __Pyx_INCREF(Py_None);
56203
56204   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":39
56205  *         silently discarded. This allows registrations at the module or
56206  *         class level using vars(), globals() etc."""
56207  *         if hasattr(class_dict_iterable, u'items'):             # <<<<<<<<<<<<<<
56208  *             class_dict_iterable = class_dict_iterable.items()
56209  *         for name, item in class_dict_iterable:
56210  */
56211   __pyx_t_1 = PyObject_HasAttr(__pyx_v_class_dict_iterable, ((PyObject *)__pyx_kp_413)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56212   if (__pyx_t_1) {
56213
56214     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":40
56215  *         class level using vars(), globals() etc."""
56216  *         if hasattr(class_dict_iterable, u'items'):
56217  *             class_dict_iterable = class_dict_iterable.items()             # <<<<<<<<<<<<<<
56218  *         for name, item in class_dict_iterable:
56219  *             if (name is None or name[:1] != u'_') and callable(item):
56220  */
56221     __pyx_t_2 = PyObject_GetAttr(__pyx_v_class_dict_iterable, __pyx_kp_items); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56222     __Pyx_GOTREF(__pyx_t_2);
56223     __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56224     __Pyx_GOTREF(__pyx_t_3);
56225     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
56226     __Pyx_DECREF(__pyx_v_class_dict_iterable);
56227     __pyx_v_class_dict_iterable = __pyx_t_3;
56228     __pyx_t_3 = 0;
56229     goto __pyx_L5;
56230   }
56231   __pyx_L5:;
56232
56233   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":41
56234  *         if hasattr(class_dict_iterable, u'items'):
56235  *             class_dict_iterable = class_dict_iterable.items()
56236  *         for name, item in class_dict_iterable:             # <<<<<<<<<<<<<<
56237  *             if (name is None or name[:1] != u'_') and callable(item):
56238  *                 self[name] = item
56239  */
56240   if (PyList_CheckExact(__pyx_v_class_dict_iterable) || PyTuple_CheckExact(__pyx_v_class_dict_iterable)) {
56241     __pyx_t_4 = 0; __pyx_t_3 = __pyx_v_class_dict_iterable; __Pyx_INCREF(__pyx_t_3);
56242   } else {
56243     __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_class_dict_iterable); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56244     __Pyx_GOTREF(__pyx_t_3);
56245   }
56246   for (;;) {
56247     if (likely(PyList_CheckExact(__pyx_t_3))) {
56248       if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
56249       __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
56250     } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
56251       if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
56252       __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++;
56253     } else {
56254       __pyx_t_2 = PyIter_Next(__pyx_t_3);
56255       if (!__pyx_t_2) {
56256         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56257         break;
56258       }
56259       __Pyx_GOTREF(__pyx_t_2);
56260     }
56261     if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 2)) {
56262       PyObject* tuple = __pyx_t_2;
56263       __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
56264       __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
56265       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
56266       __Pyx_DECREF(__pyx_v_name);
56267       __pyx_v_name = __pyx_2;
56268       __pyx_2 = 0;
56269       __Pyx_DECREF(__pyx_v_item);
56270       __pyx_v_item = __pyx_3;
56271       __pyx_3 = 0;
56272     } else {
56273       __pyx_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56274       __Pyx_GOTREF(__pyx_1);
56275       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
56276       __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56277       __Pyx_GOTREF(__pyx_2);
56278       __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56279       __Pyx_GOTREF(__pyx_3);
56280       if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56281       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
56282       __Pyx_DECREF(__pyx_v_name);
56283       __pyx_v_name = __pyx_2;
56284       __pyx_2 = 0;
56285       __Pyx_DECREF(__pyx_v_item);
56286       __pyx_v_item = __pyx_3;
56287       __pyx_3 = 0;
56288     }
56289
56290     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":42
56291  *             class_dict_iterable = class_dict_iterable.items()
56292  *         for name, item in class_dict_iterable:
56293  *             if (name is None or name[:1] != u'_') and callable(item):             # <<<<<<<<<<<<<<
56294  *                 self[name] = item
56295  * 
56296  */
56297     __pyx_t_1 = (__pyx_v_name == Py_None);
56298     if (!__pyx_t_1) {
56299       __pyx_1 = PySequence_GetSlice(__pyx_v_name, 0, 1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56300       __Pyx_GOTREF(__pyx_1);
56301       __pyx_t_2 = PyObject_RichCompare(__pyx_1, ((PyObject *)__pyx_kp_414), Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56302       __Pyx_GOTREF(__pyx_t_2);
56303       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
56304       __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56305       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
56306       __pyx_t_6 = __pyx_t_5;
56307     } else {
56308       __pyx_t_6 = __pyx_t_1;
56309     }
56310     if (__pyx_t_6) {
56311       __pyx_t_7 = PyCallable_Check(__pyx_v_item);
56312       __pyx_t_1 = __pyx_t_7;
56313     } else {
56314       __pyx_t_1 = __pyx_t_6;
56315     }
56316     if (__pyx_t_1) {
56317
56318       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":43
56319  *         for name, item in class_dict_iterable:
56320  *             if (name is None or name[:1] != u'_') and callable(item):
56321  *                 self[name] = item             # <<<<<<<<<<<<<<
56322  * 
56323  *     def __getitem__(self, name):
56324  */
56325       if (PyObject_SetItem(__pyx_v_self, __pyx_v_name, __pyx_v_item) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56326       goto __pyx_L8;
56327     }
56328     __pyx_L8:;
56329   }
56330   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
56331
56332   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
56333   goto __pyx_L0;
56334   __pyx_L1_error:;
56335   __Pyx_XDECREF(__pyx_1);
56336   __Pyx_XDECREF(__pyx_2);
56337   __Pyx_XDECREF(__pyx_3);
56338   __Pyx_XDECREF(__pyx_t_2);
56339   __Pyx_XDECREF(__pyx_t_3);
56340   __Pyx_AddTraceback("lxml.etree._NamespaceRegistry.update");
56341   __pyx_r = NULL;
56342   __pyx_L0:;
56343   __Pyx_DECREF(__pyx_v_name);
56344   __Pyx_DECREF(__pyx_v_item);
56345   __Pyx_DECREF(__pyx_v_class_dict_iterable);
56346   __Pyx_XGIVEREF(__pyx_r);
56347   __Pyx_FinishRefcountContext();
56348   return __pyx_r;
56349 }
56350
56351 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":45
56352  *                 self[name] = item
56353  * 
56354  *     def __getitem__(self, name):             # <<<<<<<<<<<<<<
56355  *         if name is not None:
56356  *             name = _utf8(name)
56357  */
56358
56359 static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
56360 static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
56361   PyObject *__pyx_r = NULL;
56362   int __pyx_t_1;
56363   PyObject *__pyx_t_2 = NULL;
56364   __Pyx_SetupRefcountContext("__getitem__");
56365   __Pyx_INCREF(__pyx_v_name);
56366
56367   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":46
56368  * 
56369  *     def __getitem__(self, name):
56370  *         if name is not None:             # <<<<<<<<<<<<<<
56371  *             name = _utf8(name)
56372  *         return self._get(name)
56373  */
56374   __pyx_t_1 = (__pyx_v_name != Py_None);
56375   if (__pyx_t_1) {
56376
56377     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":47
56378  *     def __getitem__(self, name):
56379  *         if name is not None:
56380  *             name = _utf8(name)             # <<<<<<<<<<<<<<
56381  *         return self._get(name)
56382  * 
56383  */
56384     __pyx_t_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56385     __Pyx_GOTREF(__pyx_t_2);
56386     __Pyx_DECREF(__pyx_v_name);
56387     __pyx_v_name = __pyx_t_2;
56388     __pyx_t_2 = 0;
56389     goto __pyx_L5;
56390   }
56391   __pyx_L5:;
56392
56393   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":48
56394  *         if name is not None:
56395  *             name = _utf8(name)
56396  *         return self._get(name)             # <<<<<<<<<<<<<<
56397  * 
56398  *     def __delitem__(self, name):
56399  */
56400   __Pyx_XDECREF(__pyx_r);
56401   __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__NamespaceRegistry *)((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->__pyx_vtab)->_get(((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self), __pyx_v_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56402   __Pyx_GOTREF(__pyx_t_2);
56403   __pyx_r = __pyx_t_2;
56404   __pyx_t_2 = 0;
56405   goto __pyx_L0;
56406
56407   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
56408   goto __pyx_L0;
56409   __pyx_L1_error:;
56410   __Pyx_XDECREF(__pyx_t_2);
56411   __Pyx_AddTraceback("lxml.etree._NamespaceRegistry.__getitem__");
56412   __pyx_r = NULL;
56413   __pyx_L0:;
56414   __Pyx_DECREF(__pyx_v_name);
56415   __Pyx_XGIVEREF(__pyx_r);
56416   __Pyx_FinishRefcountContext();
56417   return __pyx_r;
56418 }
56419
56420 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":50
56421  *         return self._get(name)
56422  * 
56423  *     def __delitem__(self, name):             # <<<<<<<<<<<<<<
56424  *         if name is not None:
56425  *             name = _utf8(name)
56426  */
56427
56428 static int __pyx_pf_4lxml_5etree_18_NamespaceRegistry___delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
56429 static int __pyx_pf_4lxml_5etree_18_NamespaceRegistry___delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
56430   int __pyx_r;
56431   int __pyx_t_1;
56432   PyObject *__pyx_t_2 = NULL;
56433   __Pyx_SetupRefcountContext("__delitem__");
56434   __Pyx_INCREF(__pyx_v_name);
56435
56436   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":51
56437  * 
56438  *     def __delitem__(self, name):
56439  *         if name is not None:             # <<<<<<<<<<<<<<
56440  *             name = _utf8(name)
56441  *         del self._entries[name]
56442  */
56443   __pyx_t_1 = (__pyx_v_name != Py_None);
56444   if (__pyx_t_1) {
56445
56446     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":52
56447  *     def __delitem__(self, name):
56448  *         if name is not None:
56449  *             name = _utf8(name)             # <<<<<<<<<<<<<<
56450  *         del self._entries[name]
56451  * 
56452  */
56453     __pyx_t_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56454     __Pyx_GOTREF(__pyx_t_2);
56455     __Pyx_DECREF(__pyx_v_name);
56456     __pyx_v_name = __pyx_t_2;
56457     __pyx_t_2 = 0;
56458     goto __pyx_L5;
56459   }
56460   __pyx_L5:;
56461
56462   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":53
56463  *         if name is not None:
56464  *             name = _utf8(name)
56465  *         del self._entries[name]             # <<<<<<<<<<<<<<
56466  * 
56467  *     cdef object _get(self, object name):
56468  */
56469   if (PyDict_DelItem(((PyObject *)((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_entries), __pyx_v_name) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56470
56471   __pyx_r = 0;
56472   goto __pyx_L0;
56473   __pyx_L1_error:;
56474   __Pyx_XDECREF(__pyx_t_2);
56475   __Pyx_AddTraceback("lxml.etree._NamespaceRegistry.__delitem__");
56476   __pyx_r = -1;
56477   __pyx_L0:;
56478   __Pyx_DECREF(__pyx_v_name);
56479   __Pyx_FinishRefcountContext();
56480   return __pyx_r;
56481 }
56482
56483 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":55
56484  *         del self._entries[name]
56485  * 
56486  *     cdef object _get(self, object name):             # <<<<<<<<<<<<<<
56487  *         cdef python.PyObject* dict_result
56488  *         dict_result = python.PyDict_GetItem(self._entries, name)
56489  */
56490
56491 static  PyObject *__pyx_f_4lxml_5etree_18_NamespaceRegistry__get(struct __pyx_obj_4lxml_5etree__NamespaceRegistry *__pyx_v_self, PyObject *__pyx_v_name) {
56492   PyObject *__pyx_v_dict_result;
56493   PyObject *__pyx_r = NULL;
56494   int __pyx_t_1;
56495   __Pyx_SetupRefcountContext("_get");
56496
56497   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":57
56498  *     cdef object _get(self, object name):
56499  *         cdef python.PyObject* dict_result
56500  *         dict_result = python.PyDict_GetItem(self._entries, name)             # <<<<<<<<<<<<<<
56501  *         if dict_result is NULL:
56502  *             raise KeyError, u"Name not registered."
56503  */
56504   __pyx_v_dict_result = PyDict_GetItem(((PyObject *)__pyx_v_self->_entries), __pyx_v_name);
56505
56506   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":58
56507  *         cdef python.PyObject* dict_result
56508  *         dict_result = python.PyDict_GetItem(self._entries, name)
56509  *         if dict_result is NULL:             # <<<<<<<<<<<<<<
56510  *             raise KeyError, u"Name not registered."
56511  *         return <object>dict_result
56512  */
56513   __pyx_t_1 = (__pyx_v_dict_result == NULL);
56514   if (__pyx_t_1) {
56515
56516     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":59
56517  *         dict_result = python.PyDict_GetItem(self._entries, name)
56518  *         if dict_result is NULL:
56519  *             raise KeyError, u"Name not registered."             # <<<<<<<<<<<<<<
56520  *         return <object>dict_result
56521  * 
56522  */
56523     __Pyx_Raise(__pyx_builtin_KeyError, ((PyObject *)__pyx_kp_415), 0);
56524     {__pyx_filename = __pyx_f[10]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56525     goto __pyx_L3;
56526   }
56527   __pyx_L3:;
56528
56529   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":60
56530  *         if dict_result is NULL:
56531  *             raise KeyError, u"Name not registered."
56532  *         return <object>dict_result             # <<<<<<<<<<<<<<
56533  * 
56534  *     cdef object _getForString(self, char* name):
56535  */
56536   __Pyx_XDECREF(__pyx_r);
56537   __Pyx_INCREF(((PyObject *)__pyx_v_dict_result));
56538   __pyx_r = ((PyObject *)__pyx_v_dict_result);
56539   goto __pyx_L0;
56540
56541   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
56542   goto __pyx_L0;
56543   __pyx_L1_error:;
56544   __Pyx_AddTraceback("lxml.etree._NamespaceRegistry._get");
56545   __pyx_r = 0;
56546   __pyx_L0:;
56547   __Pyx_XGIVEREF(__pyx_r);
56548   __Pyx_FinishRefcountContext();
56549   return __pyx_r;
56550 }
56551
56552 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":62
56553  *         return <object>dict_result
56554  * 
56555  *     cdef object _getForString(self, char* name):             # <<<<<<<<<<<<<<
56556  *         cdef python.PyObject* dict_result
56557  *         dict_result = python.PyDict_GetItem(self._entries, name)
56558  */
56559
56560 static  PyObject *__pyx_f_4lxml_5etree_18_NamespaceRegistry__getForString(struct __pyx_obj_4lxml_5etree__NamespaceRegistry *__pyx_v_self, char *__pyx_v_name) {
56561   PyObject *__pyx_v_dict_result;
56562   PyObject *__pyx_r = NULL;
56563   PyObject *__pyx_t_1 = NULL;
56564   int __pyx_t_2;
56565   __Pyx_SetupRefcountContext("_getForString");
56566
56567   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":64
56568  *     cdef object _getForString(self, char* name):
56569  *         cdef python.PyObject* dict_result
56570  *         dict_result = python.PyDict_GetItem(self._entries, name)             # <<<<<<<<<<<<<<
56571  *         if dict_result is NULL:
56572  *             raise KeyError, u"Name not registered."
56573  */
56574   __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56575   __Pyx_GOTREF(__pyx_t_1);
56576   __pyx_v_dict_result = PyDict_GetItem(((PyObject *)__pyx_v_self->_entries), __pyx_t_1);
56577   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
56578
56579   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":65
56580  *         cdef python.PyObject* dict_result
56581  *         dict_result = python.PyDict_GetItem(self._entries, name)
56582  *         if dict_result is NULL:             # <<<<<<<<<<<<<<
56583  *             raise KeyError, u"Name not registered."
56584  *         return <object>dict_result
56585  */
56586   __pyx_t_2 = (__pyx_v_dict_result == NULL);
56587   if (__pyx_t_2) {
56588
56589     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":66
56590  *         dict_result = python.PyDict_GetItem(self._entries, name)
56591  *         if dict_result is NULL:
56592  *             raise KeyError, u"Name not registered."             # <<<<<<<<<<<<<<
56593  *         return <object>dict_result
56594  * 
56595  */
56596     __Pyx_Raise(__pyx_builtin_KeyError, ((PyObject *)__pyx_kp_416), 0);
56597     {__pyx_filename = __pyx_f[10]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56598     goto __pyx_L3;
56599   }
56600   __pyx_L3:;
56601
56602   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":67
56603  *         if dict_result is NULL:
56604  *             raise KeyError, u"Name not registered."
56605  *         return <object>dict_result             # <<<<<<<<<<<<<<
56606  * 
56607  *     def __iter__(self):
56608  */
56609   __Pyx_XDECREF(__pyx_r);
56610   __Pyx_INCREF(((PyObject *)__pyx_v_dict_result));
56611   __pyx_r = ((PyObject *)__pyx_v_dict_result);
56612   goto __pyx_L0;
56613
56614   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
56615   goto __pyx_L0;
56616   __pyx_L1_error:;
56617   __Pyx_XDECREF(__pyx_t_1);
56618   __Pyx_AddTraceback("lxml.etree._NamespaceRegistry._getForString");
56619   __pyx_r = 0;
56620   __pyx_L0:;
56621   __Pyx_XGIVEREF(__pyx_r);
56622   __Pyx_FinishRefcountContext();
56623   return __pyx_r;
56624 }
56625
56626 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":69
56627  *         return <object>dict_result
56628  * 
56629  *     def __iter__(self):             # <<<<<<<<<<<<<<
56630  *         return iter(self._entries)
56631  * 
56632  */
56633
56634 static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry___iter__(PyObject *__pyx_v_self); /*proto*/
56635 static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry___iter__(PyObject *__pyx_v_self) {
56636   PyObject *__pyx_r = NULL;
56637   PyObject *__pyx_t_1 = NULL;
56638   __Pyx_SetupRefcountContext("__iter__");
56639
56640   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":70
56641  * 
56642  *     def __iter__(self):
56643  *         return iter(self._entries)             # <<<<<<<<<<<<<<
56644  * 
56645  *     def items(self):
56646  */
56647   __Pyx_XDECREF(__pyx_r);
56648   __pyx_t_1 = PyObject_GetIter(((PyObject *)((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_entries)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56649   __Pyx_GOTREF(__pyx_t_1);
56650   __pyx_r = __pyx_t_1;
56651   __pyx_t_1 = 0;
56652   goto __pyx_L0;
56653
56654   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
56655   goto __pyx_L0;
56656   __pyx_L1_error:;
56657   __Pyx_XDECREF(__pyx_t_1);
56658   __Pyx_AddTraceback("lxml.etree._NamespaceRegistry.__iter__");
56659   __pyx_r = NULL;
56660   __pyx_L0:;
56661   __Pyx_XGIVEREF(__pyx_r);
56662   __Pyx_FinishRefcountContext();
56663   return __pyx_r;
56664 }
56665
56666 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":72
56667  *         return iter(self._entries)
56668  * 
56669  *     def items(self):             # <<<<<<<<<<<<<<
56670  *         return list(self._entries.items())
56671  * 
56672  */
56673
56674 static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_items(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
56675 static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_items(PyObject *__pyx_v_self, PyObject *unused) {
56676   PyObject *__pyx_r = NULL;
56677   PyObject *__pyx_t_1 = NULL;
56678   PyObject *__pyx_t_2 = NULL;
56679   __Pyx_SetupRefcountContext("items");
56680
56681   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":73
56682  * 
56683  *     def items(self):
56684  *         return list(self._entries.items())             # <<<<<<<<<<<<<<
56685  * 
56686  *     def iteritems(self):
56687  */
56688   __Pyx_XDECREF(__pyx_r);
56689   __pyx_t_1 = PyDict_Items(((PyObject *)((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_entries)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56690   __Pyx_GOTREF(__pyx_t_1);
56691   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56692   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
56693   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
56694   __Pyx_GIVEREF(__pyx_t_1);
56695   __pyx_t_1 = 0;
56696   __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)&PyList_Type)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56697   __Pyx_GOTREF(__pyx_t_1);
56698   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
56699   __pyx_r = __pyx_t_1;
56700   __pyx_t_1 = 0;
56701   goto __pyx_L0;
56702
56703   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
56704   goto __pyx_L0;
56705   __pyx_L1_error:;
56706   __Pyx_XDECREF(__pyx_t_1);
56707   __Pyx_XDECREF(__pyx_t_2);
56708   __Pyx_AddTraceback("lxml.etree._NamespaceRegistry.items");
56709   __pyx_r = NULL;
56710   __pyx_L0:;
56711   __Pyx_XGIVEREF(__pyx_r);
56712   __Pyx_FinishRefcountContext();
56713   return __pyx_r;
56714 }
56715
56716 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":75
56717  *         return list(self._entries.items())
56718  * 
56719  *     def iteritems(self):             # <<<<<<<<<<<<<<
56720  *         return iter(self._entries.items())
56721  * 
56722  */
56723
56724 static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_iteritems(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
56725 static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_iteritems(PyObject *__pyx_v_self, PyObject *unused) {
56726   PyObject *__pyx_r = NULL;
56727   PyObject *__pyx_t_1 = NULL;
56728   PyObject *__pyx_t_2 = NULL;
56729   __Pyx_SetupRefcountContext("iteritems");
56730
56731   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":76
56732  * 
56733  *     def iteritems(self):
56734  *         return iter(self._entries.items())             # <<<<<<<<<<<<<<
56735  * 
56736  *     def clear(self):
56737  */
56738   __Pyx_XDECREF(__pyx_r);
56739   __pyx_t_1 = PyDict_Items(((PyObject *)((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_entries)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56740   __Pyx_GOTREF(__pyx_t_1);
56741   __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56742   __Pyx_GOTREF(__pyx_t_2);
56743   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
56744   __pyx_r = __pyx_t_2;
56745   __pyx_t_2 = 0;
56746   goto __pyx_L0;
56747
56748   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
56749   goto __pyx_L0;
56750   __pyx_L1_error:;
56751   __Pyx_XDECREF(__pyx_t_1);
56752   __Pyx_XDECREF(__pyx_t_2);
56753   __Pyx_AddTraceback("lxml.etree._NamespaceRegistry.iteritems");
56754   __pyx_r = NULL;
56755   __pyx_L0:;
56756   __Pyx_XGIVEREF(__pyx_r);
56757   __Pyx_FinishRefcountContext();
56758   return __pyx_r;
56759 }
56760
56761 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":78
56762  *         return iter(self._entries.items())
56763  * 
56764  *     def clear(self):             # <<<<<<<<<<<<<<
56765  *         python.PyDict_Clear(self._entries)
56766  * 
56767  */
56768
56769 static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_clear(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
56770 static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_clear(PyObject *__pyx_v_self, PyObject *unused) {
56771   PyObject *__pyx_r = NULL;
56772   __Pyx_SetupRefcountContext("clear");
56773
56774   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":79
56775  * 
56776  *     def clear(self):
56777  *         python.PyDict_Clear(self._entries)             # <<<<<<<<<<<<<<
56778  * 
56779  * cdef class _ClassNamespaceRegistry(_NamespaceRegistry):
56780  */
56781   PyDict_Clear(((PyObject *)((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_entries));
56782
56783   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
56784   __Pyx_XGIVEREF(__pyx_r);
56785   __Pyx_FinishRefcountContext();
56786   return __pyx_r;
56787 }
56788
56789 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":83
56790  * cdef class _ClassNamespaceRegistry(_NamespaceRegistry):
56791  *     u"Dictionary-like registry for namespace implementation classes"
56792  *     def __setitem__(self, name, item):             # <<<<<<<<<<<<<<
56793  *         if not python.PyType_Check(item) or not issubclass(item, ElementBase):
56794  *             raise NamespaceRegistryError, \
56795  */
56796
56797 static int __pyx_pf_4lxml_5etree_23_ClassNamespaceRegistry___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_item); /*proto*/
56798 static int __pyx_pf_4lxml_5etree_23_ClassNamespaceRegistry___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_item) {
56799   int __pyx_r;
56800   PyObject *__pyx_1 = 0;
56801   int __pyx_t_1;
56802   int __pyx_t_2;
56803   PyObject *__pyx_t_3 = NULL;
56804   __Pyx_SetupRefcountContext("__setitem__");
56805   __Pyx_INCREF(__pyx_v_name);
56806
56807   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":84
56808  *     u"Dictionary-like registry for namespace implementation classes"
56809  *     def __setitem__(self, name, item):
56810  *         if not python.PyType_Check(item) or not issubclass(item, ElementBase):             # <<<<<<<<<<<<<<
56811  *             raise NamespaceRegistryError, \
56812  *                 u"Registered element classes must be subtypes of ElementBase"
56813  */
56814   if (!(!PyType_Check(__pyx_v_item))) {
56815     __pyx_t_1 = PyObject_IsSubclass(__pyx_v_item, ((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_ElementBase))); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56816     __pyx_t_2 = (!__pyx_t_1);
56817   } else {
56818     __pyx_t_2 = (!PyType_Check(__pyx_v_item));
56819   }
56820   if (__pyx_t_2) {
56821
56822     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":85
56823  *     def __setitem__(self, name, item):
56824  *         if not python.PyType_Check(item) or not issubclass(item, ElementBase):
56825  *             raise NamespaceRegistryError, \             # <<<<<<<<<<<<<<
56826  *                 u"Registered element classes must be subtypes of ElementBase"
56827  *         if name is not None:
56828  */
56829     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_112); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56830     __Pyx_GOTREF(__pyx_1);
56831
56832     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":86
56833  *         if not python.PyType_Check(item) or not issubclass(item, ElementBase):
56834  *             raise NamespaceRegistryError, \
56835  *                 u"Registered element classes must be subtypes of ElementBase"             # <<<<<<<<<<<<<<
56836  *         if name is not None:
56837  *             name = _utf8(name)
56838  */
56839     __Pyx_Raise(__pyx_1, ((PyObject *)__pyx_kp_417), 0);
56840     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
56841     {__pyx_filename = __pyx_f[10]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56842     goto __pyx_L5;
56843   }
56844   __pyx_L5:;
56845
56846   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":87
56847  *             raise NamespaceRegistryError, \
56848  *                 u"Registered element classes must be subtypes of ElementBase"
56849  *         if name is not None:             # <<<<<<<<<<<<<<
56850  *             name = _utf8(name)
56851  *         self._entries[name] = item
56852  */
56853   __pyx_t_2 = (__pyx_v_name != Py_None);
56854   if (__pyx_t_2) {
56855
56856     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":88
56857  *                 u"Registered element classes must be subtypes of ElementBase"
56858  *         if name is not None:
56859  *             name = _utf8(name)             # <<<<<<<<<<<<<<
56860  *         self._entries[name] = item
56861  * 
56862  */
56863     __pyx_t_3 = __pyx_f_4lxml_5etree__utf8(__pyx_v_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56864     __Pyx_GOTREF(__pyx_t_3);
56865     __Pyx_DECREF(__pyx_v_name);
56866     __pyx_v_name = __pyx_t_3;
56867     __pyx_t_3 = 0;
56868     goto __pyx_L6;
56869   }
56870   __pyx_L6:;
56871
56872   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":89
56873  *         if name is not None:
56874  *             name = _utf8(name)
56875  *         self._entries[name] = item             # <<<<<<<<<<<<<<
56876  * 
56877  *     def __repr__(self):
56878  */
56879   if (PyDict_SetItem(((PyObject *)((struct __pyx_obj_4lxml_5etree__ClassNamespaceRegistry *)__pyx_v_self)->__pyx_base._entries), __pyx_v_name, __pyx_v_item) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56880
56881   __pyx_r = 0;
56882   goto __pyx_L0;
56883   __pyx_L1_error:;
56884   __Pyx_XDECREF(__pyx_1);
56885   __Pyx_XDECREF(__pyx_t_3);
56886   __Pyx_AddTraceback("lxml.etree._ClassNamespaceRegistry.__setitem__");
56887   __pyx_r = -1;
56888   __pyx_L0:;
56889   __Pyx_DECREF(__pyx_v_name);
56890   __Pyx_FinishRefcountContext();
56891   return __pyx_r;
56892 }
56893
56894 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":91
56895  *         self._entries[name] = item
56896  * 
56897  *     def __repr__(self):             # <<<<<<<<<<<<<<
56898  *         return u"Namespace(%r)" % self._ns_uri
56899  * 
56900  */
56901
56902 static PyObject *__pyx_pf_4lxml_5etree_23_ClassNamespaceRegistry___repr__(PyObject *__pyx_v_self); /*proto*/
56903 static PyObject *__pyx_pf_4lxml_5etree_23_ClassNamespaceRegistry___repr__(PyObject *__pyx_v_self) {
56904   PyObject *__pyx_r = NULL;
56905   PyObject *__pyx_t_1 = NULL;
56906   __Pyx_SetupRefcountContext("__repr__");
56907
56908   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":92
56909  * 
56910  *     def __repr__(self):
56911  *         return u"Namespace(%r)" % self._ns_uri             # <<<<<<<<<<<<<<
56912  * 
56913  * 
56914  */
56915   __Pyx_XDECREF(__pyx_r);
56916   __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_418), ((struct __pyx_obj_4lxml_5etree__ClassNamespaceRegistry *)__pyx_v_self)->__pyx_base._ns_uri); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56917   __Pyx_GOTREF(__pyx_t_1);
56918   __pyx_r = __pyx_t_1;
56919   __pyx_t_1 = 0;
56920   goto __pyx_L0;
56921
56922   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
56923   goto __pyx_L0;
56924   __pyx_L1_error:;
56925   __Pyx_XDECREF(__pyx_t_1);
56926   __Pyx_AddTraceback("lxml.etree._ClassNamespaceRegistry.__repr__");
56927   __pyx_r = NULL;
56928   __pyx_L0:;
56929   __Pyx_XGIVEREF(__pyx_r);
56930   __Pyx_FinishRefcountContext();
56931   return __pyx_r;
56932 }
56933
56934 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":102
56935  *     """
56936  *     cdef object _namespace_registries
56937  *     def __init__(self, ElementClassLookup fallback=None):             # <<<<<<<<<<<<<<
56938  *         self._namespace_registries = {}
56939  *         FallbackElementClassLookup.__init__(self, fallback)
56940  */
56941
56942 static int __pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
56943 static int __pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
56944   struct LxmlElementClassLookup *__pyx_v_fallback = 0;
56945   int __pyx_r;
56946   PyObject *__pyx_1 = 0;
56947   PyObject *__pyx_t_1 = NULL;
56948   PyObject *__pyx_t_2 = NULL;
56949   PyObject *__pyx_t_3 = NULL;
56950   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_fallback,0};
56951   __Pyx_SetupRefcountContext("__init__");
56952   if (unlikely(__pyx_kwds)) {
56953     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
56954     PyObject* values[1] = {0};
56955     values[0] = (PyObject*)((struct LxmlElementClassLookup *)Py_None);
56956     switch (PyTuple_GET_SIZE(__pyx_args)) {
56957       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
56958       case  0: break;
56959       default: goto __pyx_L5_argtuple_error;
56960     }
56961     switch (PyTuple_GET_SIZE(__pyx_args)) {
56962       case  0:
56963       if (kw_args > 1) {
56964         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_fallback);
56965         if (unlikely(value)) { values[0] = value; kw_args--; }
56966       }
56967     }
56968     if (unlikely(kw_args > 0)) {
56969       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
56970     }
56971     __pyx_v_fallback = ((struct LxmlElementClassLookup *)values[0]);
56972   } else {
56973     __pyx_v_fallback = ((struct LxmlElementClassLookup *)Py_None);
56974     switch (PyTuple_GET_SIZE(__pyx_args)) {
56975       case  1: __pyx_v_fallback = ((struct LxmlElementClassLookup *)PyTuple_GET_ITEM(__pyx_args, 0));
56976       case  0: break;
56977       default: goto __pyx_L5_argtuple_error;
56978     }
56979   }
56980   goto __pyx_L4_argument_unpacking_done;
56981   __pyx_L5_argtuple_error:;
56982   __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[10]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
56983   __pyx_L3_error:;
56984   __Pyx_AddTraceback("lxml.etree.ElementNamespaceClassLookup.__init__");
56985   return -1;
56986   __pyx_L4_argument_unpacking_done:;
56987   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fallback), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "fallback", 0))) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56988
56989   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":103
56990  *     cdef object _namespace_registries
56991  *     def __init__(self, ElementClassLookup fallback=None):
56992  *         self._namespace_registries = {}             # <<<<<<<<<<<<<<
56993  *         FallbackElementClassLookup.__init__(self, fallback)
56994  *         self._lookup_function = _find_nselement_class
56995  */
56996   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56997   __Pyx_GOTREF(((PyObject *)__pyx_1));
56998   __Pyx_GIVEREF(((PyObject *)__pyx_1));
56999   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *)__pyx_v_self)->_namespace_registries);
57000   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *)__pyx_v_self)->_namespace_registries);
57001   ((struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *)__pyx_v_self)->_namespace_registries = ((PyObject *)__pyx_1);
57002   __pyx_1 = 0;
57003
57004   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":104
57005  *     def __init__(self, ElementClassLookup fallback=None):
57006  *         self._namespace_registries = {}
57007  *         FallbackElementClassLookup.__init__(self, fallback)             # <<<<<<<<<<<<<<
57008  *         self._lookup_function = _find_nselement_class
57009  * 
57010  */
57011   __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_FallbackElementClassLookup)), __pyx_kp___init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
57012   __Pyx_GOTREF(__pyx_t_1);
57013   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
57014   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
57015   __Pyx_INCREF(__pyx_v_self);
57016   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
57017   __Pyx_GIVEREF(__pyx_v_self);
57018   __Pyx_INCREF(((PyObject *)__pyx_v_fallback));
57019   PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_fallback));
57020   __Pyx_GIVEREF(((PyObject *)__pyx_v_fallback));
57021   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
57022   __Pyx_GOTREF(__pyx_t_3);
57023   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
57024   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
57025   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
57026
57027   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":105
57028  *         self._namespace_registries = {}
57029  *         FallbackElementClassLookup.__init__(self, fallback)
57030  *         self._lookup_function = _find_nselement_class             # <<<<<<<<<<<<<<
57031  * 
57032  *     def get_namespace(self, ns_uri):
57033  */
57034   ((struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *)__pyx_v_self)->__pyx_base.__pyx_base._lookup_function = __pyx_f_4lxml_5etree__find_nselement_class;
57035
57036   __pyx_r = 0;
57037   goto __pyx_L0;
57038   __pyx_L1_error:;
57039   __Pyx_XDECREF(__pyx_1);
57040   __Pyx_XDECREF(__pyx_t_1);
57041   __Pyx_XDECREF(__pyx_t_2);
57042   __Pyx_XDECREF(__pyx_t_3);
57043   __Pyx_AddTraceback("lxml.etree.ElementNamespaceClassLookup.__init__");
57044   __pyx_r = -1;
57045   __pyx_L0:;
57046   __Pyx_FinishRefcountContext();
57047   return __pyx_r;
57048 }
57049
57050 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":107
57051  *         self._lookup_function = _find_nselement_class
57052  * 
57053  *     def get_namespace(self, ns_uri):             # <<<<<<<<<<<<<<
57054  *         u"""get_namespace(self, ns_uri)
57055  * 
57056  */
57057
57058 static PyObject *__pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup_get_namespace(PyObject *__pyx_v_self, PyObject *__pyx_v_ns_uri); /*proto*/
57059 static char __pyx_doc_4lxml_5etree_27ElementNamespaceClassLookup_get_namespace[] = "get_namespace(self, ns_uri)\n\n        Retrieve the namespace object associated with the given URI.\n\n        Creates a new one if it does not yet exist.";
57060 static PyObject *__pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup_get_namespace(PyObject *__pyx_v_self, PyObject *__pyx_v_ns_uri) {
57061   PyObject *__pyx_v_ns_utf;
57062   PyObject *__pyx_v_registry;
57063   PyObject *__pyx_r = NULL;
57064   PyObject *__pyx_1 = 0;
57065   int __pyx_2;
57066   int __pyx_t_1;
57067   PyObject *__pyx_t_2 = NULL;
57068   PyObject *__pyx_t_3 = NULL;
57069   PyObject *__pyx_t_4 = NULL;
57070   PyObject *__pyx_t_5 = NULL;
57071   PyObject *__pyx_t_6 = NULL;
57072   __Pyx_SetupRefcountContext("get_namespace");
57073   __pyx_v_ns_utf = Py_None; __Pyx_INCREF(Py_None);
57074   __pyx_v_registry = Py_None; __Pyx_INCREF(Py_None);
57075
57076   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":113
57077  * 
57078  *         Creates a new one if it does not yet exist."""
57079  *         if ns_uri:             # <<<<<<<<<<<<<<
57080  *             ns_utf = _utf8(ns_uri)
57081  *         else:
57082  */
57083   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ns_uri); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
57084   if (__pyx_t_1) {
57085
57086     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":114
57087  *         Creates a new one if it does not yet exist."""
57088  *         if ns_uri:
57089  *             ns_utf = _utf8(ns_uri)             # <<<<<<<<<<<<<<
57090  *         else:
57091  *             ns_utf = None
57092  */
57093     __pyx_t_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_ns_uri); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
57094     __Pyx_GOTREF(__pyx_t_2);
57095     __Pyx_DECREF(__pyx_v_ns_utf);
57096     __pyx_v_ns_utf = __pyx_t_2;
57097     __pyx_t_2 = 0;
57098     goto __pyx_L5;
57099   }
57100   /*else*/ {
57101
57102     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":116
57103  *             ns_utf = _utf8(ns_uri)
57104  *         else:
57105  *             ns_utf = None             # <<<<<<<<<<<<<<
57106  *         try:
57107  *             return self._namespace_registries[ns_utf]
57108  */
57109     __Pyx_INCREF(Py_None);
57110     __Pyx_DECREF(__pyx_v_ns_utf);
57111     __pyx_v_ns_utf = Py_None;
57112   }
57113   __pyx_L5:;
57114
57115   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":117
57116  *         else:
57117  *             ns_utf = None
57118  *         try:             # <<<<<<<<<<<<<<
57119  *             return self._namespace_registries[ns_utf]
57120  *         except KeyError:
57121  */
57122   {
57123     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
57124     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
57125     __Pyx_XGOTREF(__pyx_save_exc_type);
57126     __Pyx_XGOTREF(__pyx_save_exc_value);
57127     __Pyx_XGOTREF(__pyx_save_exc_tb);
57128     /*try:*/ {
57129
57130       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":118
57131  *             ns_utf = None
57132  *         try:
57133  *             return self._namespace_registries[ns_utf]             # <<<<<<<<<<<<<<
57134  *         except KeyError:
57135  *             registry = self._namespace_registries[ns_utf] = \
57136  */
57137       __Pyx_XDECREF(__pyx_r);
57138       __pyx_1 = PyObject_GetItem(((struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *)__pyx_v_self)->_namespace_registries, __pyx_v_ns_utf); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
57139       __Pyx_GOTREF(__pyx_1);
57140       __pyx_r = __pyx_1;
57141       __pyx_1 = 0;
57142       goto __pyx_L10_try_return;
57143     }
57144     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
57145     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
57146     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
57147     goto __pyx_L13_try_end;
57148     __pyx_L10_try_return:;
57149     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
57150     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
57151     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
57152     goto __pyx_L0;
57153     __pyx_L6_error:;
57154     __Pyx_XDECREF(__pyx_1); __pyx_1 = 0;
57155     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
57156
57157     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":119
57158  *         try:
57159  *             return self._namespace_registries[ns_utf]
57160  *         except KeyError:             # <<<<<<<<<<<<<<
57161  *             registry = self._namespace_registries[ns_utf] = \
57162  *                        _ClassNamespaceRegistry(ns_uri)
57163  */
57164     __pyx_2 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
57165     if (__pyx_2) {
57166       __Pyx_AddTraceback("lxml.etree.get_namespace");
57167       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
57168       __Pyx_GOTREF(__pyx_t_2);
57169       __Pyx_GOTREF(__pyx_t_3);
57170       __Pyx_GOTREF(__pyx_t_4);
57171
57172       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":121
57173  *         except KeyError:
57174  *             registry = self._namespace_registries[ns_utf] = \
57175  *                        _ClassNamespaceRegistry(ns_uri)             # <<<<<<<<<<<<<<
57176  *             return registry
57177  * 
57178  */
57179       __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
57180       __Pyx_GOTREF(((PyObject *)__pyx_t_5));
57181       __Pyx_INCREF(__pyx_v_ns_uri);
57182       PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_ns_uri);
57183       __Pyx_GIVEREF(__pyx_v_ns_uri);
57184       __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ClassNamespaceRegistry)), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
57185       __Pyx_GOTREF(__pyx_t_6);
57186       __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
57187       __Pyx_INCREF(__pyx_t_6);
57188       __Pyx_DECREF(__pyx_v_registry);
57189       __pyx_v_registry = __pyx_t_6;
57190
57191       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":120
57192  *             return self._namespace_registries[ns_utf]
57193  *         except KeyError:
57194  *             registry = self._namespace_registries[ns_utf] = \             # <<<<<<<<<<<<<<
57195  *                        _ClassNamespaceRegistry(ns_uri)
57196  *             return registry
57197  */
57198       if (PyObject_SetItem(((struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *)__pyx_v_self)->_namespace_registries, __pyx_v_ns_utf, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
57199       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
57200
57201       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":122
57202  *             registry = self._namespace_registries[ns_utf] = \
57203  *                        _ClassNamespaceRegistry(ns_uri)
57204  *             return registry             # <<<<<<<<<<<<<<
57205  * 
57206  * cdef object _find_nselement_class(state, _Document doc, xmlNode* c_node):
57207  */
57208       __Pyx_XDECREF(__pyx_r);
57209       __Pyx_INCREF(__pyx_v_registry);
57210       __pyx_r = __pyx_v_registry;
57211       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
57212       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
57213       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
57214       goto __pyx_L9_except_return;
57215       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
57216       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
57217       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
57218       goto __pyx_L7_exception_handled;
57219     }
57220     __pyx_L8_except_error:;
57221     __Pyx_XDECREF(__pyx_save_exc_type);
57222     __Pyx_XDECREF(__pyx_save_exc_value);
57223     __Pyx_XDECREF(__pyx_save_exc_tb);
57224     goto __pyx_L1_error;
57225     __pyx_L9_except_return:;
57226     __Pyx_XGIVEREF(__pyx_save_exc_type);
57227     __Pyx_XGIVEREF(__pyx_save_exc_value);
57228     __Pyx_XGIVEREF(__pyx_save_exc_tb);
57229     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
57230     goto __pyx_L0;
57231     __pyx_L7_exception_handled:;
57232     __Pyx_XGIVEREF(__pyx_save_exc_type);
57233     __Pyx_XGIVEREF(__pyx_save_exc_value);
57234     __Pyx_XGIVEREF(__pyx_save_exc_tb);
57235     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
57236     __pyx_L13_try_end:;
57237   }
57238
57239   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
57240   goto __pyx_L0;
57241   __pyx_L1_error:;
57242   __Pyx_XDECREF(__pyx_1);
57243   __Pyx_XDECREF(__pyx_t_2);
57244   __Pyx_XDECREF(__pyx_t_3);
57245   __Pyx_XDECREF(__pyx_t_4);
57246   __Pyx_XDECREF(__pyx_t_5);
57247   __Pyx_XDECREF(__pyx_t_6);
57248   __Pyx_AddTraceback("lxml.etree.ElementNamespaceClassLookup.get_namespace");
57249   __pyx_r = NULL;
57250   __pyx_L0:;
57251   __Pyx_DECREF(__pyx_v_ns_utf);
57252   __Pyx_DECREF(__pyx_v_registry);
57253   __Pyx_XGIVEREF(__pyx_r);
57254   __Pyx_FinishRefcountContext();
57255   return __pyx_r;
57256 }
57257
57258 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":124
57259  *             return registry
57260  * 
57261  * cdef object _find_nselement_class(state, _Document doc, xmlNode* c_node):             # <<<<<<<<<<<<<<
57262  *     cdef python.PyObject* dict_result
57263  *     cdef ElementNamespaceClassLookup lookup
57264  */
57265
57266 static  PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_state, struct LxmlDocument *__pyx_v_doc, xmlNode *__pyx_v_c_node) {
57267   PyObject *__pyx_v_dict_result;
57268   struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *__pyx_v_lookup;
57269   struct __pyx_obj_4lxml_5etree__NamespaceRegistry *__pyx_v_registry;
57270   char *__pyx_v_c_namespace_utf;
57271   PyObject *__pyx_v_classes;
57272   PyObject *__pyx_r = NULL;
57273   int __pyx_t_1;
57274   PyObject *__pyx_t_2 = NULL;
57275   __Pyx_SetupRefcountContext("_find_nselement_class");
57276   __pyx_v_lookup = ((struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *)Py_None); __Pyx_INCREF(Py_None);
57277   __pyx_v_registry = ((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)Py_None); __Pyx_INCREF(Py_None);
57278   __pyx_v_classes = Py_None; __Pyx_INCREF(Py_None);
57279
57280   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":129
57281  *     cdef _NamespaceRegistry registry
57282  *     cdef char* c_namespace_utf
57283  *     if state is None:             # <<<<<<<<<<<<<<
57284  *         return _lookupDefaultElementClass(None, doc, c_node)
57285  * 
57286  */
57287   __pyx_t_1 = (__pyx_v_state == Py_None);
57288   if (__pyx_t_1) {
57289
57290     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":130
57291  *     cdef char* c_namespace_utf
57292  *     if state is None:
57293  *         return _lookupDefaultElementClass(None, doc, c_node)             # <<<<<<<<<<<<<<
57294  * 
57295  *     lookup = <ElementNamespaceClassLookup>state
57296  */
57297     __Pyx_XDECREF(__pyx_r);
57298     __pyx_t_2 = __pyx_f_4lxml_5etree__lookupDefaultElementClass(Py_None, __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
57299     __Pyx_GOTREF(__pyx_t_2);
57300     __pyx_r = __pyx_t_2;
57301     __pyx_t_2 = 0;
57302     goto __pyx_L0;
57303     goto __pyx_L3;
57304   }
57305   __pyx_L3:;
57306
57307   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":132
57308  *         return _lookupDefaultElementClass(None, doc, c_node)
57309  * 
57310  *     lookup = <ElementNamespaceClassLookup>state             # <<<<<<<<<<<<<<
57311  *     if c_node.type != tree.XML_ELEMENT_NODE:
57312  *         return _callLookupFallback(lookup, doc, c_node)
57313  */
57314   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *)__pyx_v_state)));
57315   __Pyx_DECREF(((PyObject *)__pyx_v_lookup));
57316   __pyx_v_lookup = ((struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *)__pyx_v_state);
57317
57318   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":133
57319  * 
57320  *     lookup = <ElementNamespaceClassLookup>state
57321  *     if c_node.type != tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
57322  *         return _callLookupFallback(lookup, doc, c_node)
57323  * 
57324  */
57325   __pyx_t_1 = (__pyx_v_c_node->type != XML_ELEMENT_NODE);
57326   if (__pyx_t_1) {
57327
57328     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":134
57329  *     lookup = <ElementNamespaceClassLookup>state
57330  *     if c_node.type != tree.XML_ELEMENT_NODE:
57331  *         return _callLookupFallback(lookup, doc, c_node)             # <<<<<<<<<<<<<<
57332  * 
57333  *     c_namespace_utf = _getNs(c_node)
57334  */
57335     __Pyx_XDECREF(__pyx_r);
57336     __pyx_t_2 = __pyx_f_4lxml_5etree__callLookupFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_lookup), __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
57337     __Pyx_GOTREF(__pyx_t_2);
57338     __pyx_r = __pyx_t_2;
57339     __pyx_t_2 = 0;
57340     goto __pyx_L0;
57341     goto __pyx_L4;
57342   }
57343   __pyx_L4:;
57344
57345   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":136
57346  *         return _callLookupFallback(lookup, doc, c_node)
57347  * 
57348  *     c_namespace_utf = _getNs(c_node)             # <<<<<<<<<<<<<<
57349  *     if c_namespace_utf is not NULL:
57350  *         dict_result = python.PyDict_GetItem(
57351  */
57352   __pyx_v_c_namespace_utf = _getNs(__pyx_v_c_node);
57353
57354   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":137
57355  * 
57356  *     c_namespace_utf = _getNs(c_node)
57357  *     if c_namespace_utf is not NULL:             # <<<<<<<<<<<<<<
57358  *         dict_result = python.PyDict_GetItem(
57359  *             lookup._namespace_registries, c_namespace_utf)
57360  */
57361   __pyx_t_1 = (__pyx_v_c_namespace_utf != NULL);
57362   if (__pyx_t_1) {
57363
57364     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":139
57365  *     if c_namespace_utf is not NULL:
57366  *         dict_result = python.PyDict_GetItem(
57367  *             lookup._namespace_registries, c_namespace_utf)             # <<<<<<<<<<<<<<
57368  *     else:
57369  *         dict_result = python.PyDict_GetItem(
57370  */
57371     __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_c_namespace_utf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
57372     __Pyx_GOTREF(__pyx_t_2);
57373     __pyx_v_dict_result = PyDict_GetItem(__pyx_v_lookup->_namespace_registries, __pyx_t_2);
57374     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
57375     goto __pyx_L5;
57376   }
57377   /*else*/ {
57378
57379     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":142
57380  *     else:
57381  *         dict_result = python.PyDict_GetItem(
57382  *             lookup._namespace_registries, None)             # <<<<<<<<<<<<<<
57383  *     if dict_result is not NULL:
57384  *         registry = <_NamespaceRegistry>dict_result
57385  */
57386     __pyx_v_dict_result = PyDict_GetItem(__pyx_v_lookup->_namespace_registries, Py_None);
57387   }
57388   __pyx_L5:;
57389
57390   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":143
57391  *         dict_result = python.PyDict_GetItem(
57392  *             lookup._namespace_registries, None)
57393  *     if dict_result is not NULL:             # <<<<<<<<<<<<<<
57394  *         registry = <_NamespaceRegistry>dict_result
57395  *         classes = registry._entries
57396  */
57397   __pyx_t_1 = (__pyx_v_dict_result != NULL);
57398   if (__pyx_t_1) {
57399
57400     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":144
57401  *             lookup._namespace_registries, None)
57402  *     if dict_result is not NULL:
57403  *         registry = <_NamespaceRegistry>dict_result             # <<<<<<<<<<<<<<
57404  *         classes = registry._entries
57405  * 
57406  */
57407     __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_dict_result)));
57408     __Pyx_DECREF(((PyObject *)__pyx_v_registry));
57409     __pyx_v_registry = ((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_dict_result);
57410
57411     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":145
57412  *     if dict_result is not NULL:
57413  *         registry = <_NamespaceRegistry>dict_result
57414  *         classes = registry._entries             # <<<<<<<<<<<<<<
57415  * 
57416  *         if c_node.name is not NULL:
57417  */
57418     __Pyx_INCREF(((PyObject *)__pyx_v_registry->_entries));
57419     __Pyx_DECREF(__pyx_v_classes);
57420     __pyx_v_classes = ((PyObject *)__pyx_v_registry->_entries);
57421
57422     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":147
57423  *         classes = registry._entries
57424  * 
57425  *         if c_node.name is not NULL:             # <<<<<<<<<<<<<<
57426  *             dict_result = python.PyDict_GetItem(
57427  *                 classes, c_node.name)
57428  */
57429     __pyx_t_1 = (__pyx_v_c_node->name != NULL);
57430     if (__pyx_t_1) {
57431
57432       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":149
57433  *         if c_node.name is not NULL:
57434  *             dict_result = python.PyDict_GetItem(
57435  *                 classes, c_node.name)             # <<<<<<<<<<<<<<
57436  *         else:
57437  *             dict_result = NULL
57438  */
57439       __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_c_node->name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
57440       __Pyx_GOTREF(__pyx_t_2);
57441       __pyx_v_dict_result = PyDict_GetItem(__pyx_v_classes, __pyx_t_2);
57442       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
57443       goto __pyx_L7;
57444     }
57445     /*else*/ {
57446
57447       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":151
57448  *                 classes, c_node.name)
57449  *         else:
57450  *             dict_result = NULL             # <<<<<<<<<<<<<<
57451  * 
57452  *         if dict_result is NULL:
57453  */
57454       __pyx_v_dict_result = NULL;
57455     }
57456     __pyx_L7:;
57457
57458     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":153
57459  *             dict_result = NULL
57460  * 
57461  *         if dict_result is NULL:             # <<<<<<<<<<<<<<
57462  *             dict_result = python.PyDict_GetItem(classes, None)
57463  * 
57464  */
57465     __pyx_t_1 = (__pyx_v_dict_result == NULL);
57466     if (__pyx_t_1) {
57467
57468       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":154
57469  * 
57470  *         if dict_result is NULL:
57471  *             dict_result = python.PyDict_GetItem(classes, None)             # <<<<<<<<<<<<<<
57472  * 
57473  *         if dict_result is not NULL:
57474  */
57475       __pyx_v_dict_result = PyDict_GetItem(__pyx_v_classes, Py_None);
57476       goto __pyx_L8;
57477     }
57478     __pyx_L8:;
57479
57480     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":156
57481  *             dict_result = python.PyDict_GetItem(classes, None)
57482  * 
57483  *         if dict_result is not NULL:             # <<<<<<<<<<<<<<
57484  *             return <object>dict_result
57485  *     return _callLookupFallback(lookup, doc, c_node)
57486  */
57487     __pyx_t_1 = (__pyx_v_dict_result != NULL);
57488     if (__pyx_t_1) {
57489
57490       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":157
57491  * 
57492  *         if dict_result is not NULL:
57493  *             return <object>dict_result             # <<<<<<<<<<<<<<
57494  *     return _callLookupFallback(lookup, doc, c_node)
57495  * 
57496  */
57497       __Pyx_XDECREF(__pyx_r);
57498       __Pyx_INCREF(((PyObject *)__pyx_v_dict_result));
57499       __pyx_r = ((PyObject *)__pyx_v_dict_result);
57500       goto __pyx_L0;
57501       goto __pyx_L9;
57502     }
57503     __pyx_L9:;
57504     goto __pyx_L6;
57505   }
57506   __pyx_L6:;
57507
57508   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":158
57509  *         if dict_result is not NULL:
57510  *             return <object>dict_result
57511  *     return _callLookupFallback(lookup, doc, c_node)             # <<<<<<<<<<<<<<
57512  * 
57513  * 
57514  */
57515   __Pyx_XDECREF(__pyx_r);
57516   __pyx_t_2 = __pyx_f_4lxml_5etree__callLookupFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_lookup), __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
57517   __Pyx_GOTREF(__pyx_t_2);
57518   __pyx_r = __pyx_t_2;
57519   __pyx_t_2 = 0;
57520   goto __pyx_L0;
57521
57522   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
57523   goto __pyx_L0;
57524   __pyx_L1_error:;
57525   __Pyx_XDECREF(__pyx_t_2);
57526   __Pyx_AddTraceback("lxml.etree._find_nselement_class");
57527   __pyx_r = 0;
57528   __pyx_L0:;
57529   __Pyx_DECREF((PyObject *)__pyx_v_lookup);
57530   __Pyx_DECREF((PyObject *)__pyx_v_registry);
57531   __Pyx_DECREF(__pyx_v_classes);
57532   __Pyx_XGIVEREF(__pyx_r);
57533   __Pyx_FinishRefcountContext();
57534   return __pyx_r;
57535 }
57536
57537 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":167
57538  * __FUNCTION_NAMESPACE_REGISTRIES = {}
57539  * 
57540  * def FunctionNamespace(ns_uri):             # <<<<<<<<<<<<<<
57541  *     u"""FunctionNamespace(ns_uri)
57542  * 
57543  */
57544
57545 static PyObject *__pyx_pf_4lxml_5etree_FunctionNamespace(PyObject *__pyx_self, PyObject *__pyx_v_ns_uri); /*proto*/
57546 static char __pyx_doc_4lxml_5etree_FunctionNamespace[] = "FunctionNamespace(ns_uri)\n\n    Retrieve the function namespace object associated with the given\n    URI.\n\n    Creates a new one if it does not yet exist. A function namespace\n    can only be used to register extension functions.";
57547 static PyObject *__pyx_pf_4lxml_5etree_FunctionNamespace(PyObject *__pyx_self, PyObject *__pyx_v_ns_uri) {
57548   PyObject *__pyx_v_ns_utf;
57549   PyObject *__pyx_v_registry;
57550   PyObject *__pyx_r = NULL;
57551   PyObject *__pyx_1 = 0;
57552   int __pyx_2;
57553   int __pyx_t_1;
57554   PyObject *__pyx_t_2 = NULL;
57555   PyObject *__pyx_t_3 = NULL;
57556   PyObject *__pyx_t_4 = NULL;
57557   PyObject *__pyx_t_5 = NULL;
57558   PyObject *__pyx_t_6 = NULL;
57559   __Pyx_SetupRefcountContext("FunctionNamespace");
57560   __pyx_self = __pyx_self;
57561   __pyx_v_ns_utf = Py_None; __Pyx_INCREF(Py_None);
57562   __pyx_v_registry = Py_None; __Pyx_INCREF(Py_None);
57563
57564   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":175
57565  *     Creates a new one if it does not yet exist. A function namespace
57566  *     can only be used to register extension functions."""
57567  *     if ns_uri:             # <<<<<<<<<<<<<<
57568  *         ns_utf = _utf8(ns_uri)
57569  *     else:
57570  */
57571   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ns_uri); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
57572   if (__pyx_t_1) {
57573
57574     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":176
57575  *     can only be used to register extension functions."""
57576  *     if ns_uri:
57577  *         ns_utf = _utf8(ns_uri)             # <<<<<<<<<<<<<<
57578  *     else:
57579  *         ns_utf = None
57580  */
57581     __pyx_t_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_ns_uri); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
57582     __Pyx_GOTREF(__pyx_t_2);
57583     __Pyx_DECREF(__pyx_v_ns_utf);
57584     __pyx_v_ns_utf = __pyx_t_2;
57585     __pyx_t_2 = 0;
57586     goto __pyx_L5;
57587   }
57588   /*else*/ {
57589
57590     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":178
57591  *         ns_utf = _utf8(ns_uri)
57592  *     else:
57593  *         ns_utf = None             # <<<<<<<<<<<<<<
57594  *     try:
57595  *         return __FUNCTION_NAMESPACE_REGISTRIES[ns_utf]
57596  */
57597     __Pyx_INCREF(Py_None);
57598     __Pyx_DECREF(__pyx_v_ns_utf);
57599     __pyx_v_ns_utf = Py_None;
57600   }
57601   __pyx_L5:;
57602
57603   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":179
57604  *     else:
57605  *         ns_utf = None
57606  *     try:             # <<<<<<<<<<<<<<
57607  *         return __FUNCTION_NAMESPACE_REGISTRIES[ns_utf]
57608  *     except KeyError:
57609  */
57610   {
57611     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
57612     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
57613     __Pyx_XGOTREF(__pyx_save_exc_type);
57614     __Pyx_XGOTREF(__pyx_save_exc_value);
57615     __Pyx_XGOTREF(__pyx_save_exc_tb);
57616     /*try:*/ {
57617
57618       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":180
57619  *         ns_utf = None
57620  *     try:
57621  *         return __FUNCTION_NAMESPACE_REGISTRIES[ns_utf]             # <<<<<<<<<<<<<<
57622  *     except KeyError:
57623  *         registry = __FUNCTION_NAMESPACE_REGISTRIES[ns_utf] = \
57624  */
57625       __Pyx_XDECREF(__pyx_r);
57626       __pyx_1 = PyObject_GetItem(((PyObject *)__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES), __pyx_v_ns_utf); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
57627       __Pyx_GOTREF(__pyx_1);
57628       __pyx_r = __pyx_1;
57629       __pyx_1 = 0;
57630       goto __pyx_L10_try_return;
57631     }
57632     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
57633     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
57634     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
57635     goto __pyx_L13_try_end;
57636     __pyx_L10_try_return:;
57637     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
57638     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
57639     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
57640     goto __pyx_L0;
57641     __pyx_L6_error:;
57642     __Pyx_XDECREF(__pyx_1); __pyx_1 = 0;
57643     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
57644
57645     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":181
57646  *     try:
57647  *         return __FUNCTION_NAMESPACE_REGISTRIES[ns_utf]
57648  *     except KeyError:             # <<<<<<<<<<<<<<
57649  *         registry = __FUNCTION_NAMESPACE_REGISTRIES[ns_utf] = \
57650  *                    _XPathFunctionNamespaceRegistry(ns_uri)
57651  */
57652     __pyx_2 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
57653     if (__pyx_2) {
57654       __Pyx_AddTraceback("lxml.etree.FunctionNamespace");
57655       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
57656       __Pyx_GOTREF(__pyx_t_2);
57657       __Pyx_GOTREF(__pyx_t_3);
57658       __Pyx_GOTREF(__pyx_t_4);
57659
57660       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":183
57661  *     except KeyError:
57662  *         registry = __FUNCTION_NAMESPACE_REGISTRIES[ns_utf] = \
57663  *                    _XPathFunctionNamespaceRegistry(ns_uri)             # <<<<<<<<<<<<<<
57664  *         return registry
57665  * 
57666  */
57667       __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
57668       __Pyx_GOTREF(((PyObject *)__pyx_t_5));
57669       __Pyx_INCREF(__pyx_v_ns_uri);
57670       PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_ns_uri);
57671       __Pyx_GIVEREF(__pyx_v_ns_uri);
57672       __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__XPathFunctionNamespaceRegistry)), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
57673       __Pyx_GOTREF(__pyx_t_6);
57674       __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
57675       __Pyx_INCREF(__pyx_t_6);
57676       __Pyx_DECREF(__pyx_v_registry);
57677       __pyx_v_registry = __pyx_t_6;
57678
57679       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":182
57680  *         return __FUNCTION_NAMESPACE_REGISTRIES[ns_utf]
57681  *     except KeyError:
57682  *         registry = __FUNCTION_NAMESPACE_REGISTRIES[ns_utf] = \             # <<<<<<<<<<<<<<
57683  *                    _XPathFunctionNamespaceRegistry(ns_uri)
57684  *         return registry
57685  */
57686       if (PyDict_SetItem(((PyObject *)__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES), __pyx_v_ns_utf, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
57687       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
57688
57689       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":184
57690  *         registry = __FUNCTION_NAMESPACE_REGISTRIES[ns_utf] = \
57691  *                    _XPathFunctionNamespaceRegistry(ns_uri)
57692  *         return registry             # <<<<<<<<<<<<<<
57693  * 
57694  * cdef class _FunctionNamespaceRegistry(_NamespaceRegistry):
57695  */
57696       __Pyx_XDECREF(__pyx_r);
57697       __Pyx_INCREF(__pyx_v_registry);
57698       __pyx_r = __pyx_v_registry;
57699       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
57700       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
57701       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
57702       goto __pyx_L9_except_return;
57703       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
57704       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
57705       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
57706       goto __pyx_L7_exception_handled;
57707     }
57708     __pyx_L8_except_error:;
57709     __Pyx_XDECREF(__pyx_save_exc_type);
57710     __Pyx_XDECREF(__pyx_save_exc_value);
57711     __Pyx_XDECREF(__pyx_save_exc_tb);
57712     goto __pyx_L1_error;
57713     __pyx_L9_except_return:;
57714     __Pyx_XGIVEREF(__pyx_save_exc_type);
57715     __Pyx_XGIVEREF(__pyx_save_exc_value);
57716     __Pyx_XGIVEREF(__pyx_save_exc_tb);
57717     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
57718     goto __pyx_L0;
57719     __pyx_L7_exception_handled:;
57720     __Pyx_XGIVEREF(__pyx_save_exc_type);
57721     __Pyx_XGIVEREF(__pyx_save_exc_value);
57722     __Pyx_XGIVEREF(__pyx_save_exc_tb);
57723     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
57724     __pyx_L13_try_end:;
57725   }
57726
57727   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
57728   goto __pyx_L0;
57729   __pyx_L1_error:;
57730   __Pyx_XDECREF(__pyx_1);
57731   __Pyx_XDECREF(__pyx_t_2);
57732   __Pyx_XDECREF(__pyx_t_3);
57733   __Pyx_XDECREF(__pyx_t_4);
57734   __Pyx_XDECREF(__pyx_t_5);
57735   __Pyx_XDECREF(__pyx_t_6);
57736   __Pyx_AddTraceback("lxml.etree.FunctionNamespace");
57737   __pyx_r = NULL;
57738   __pyx_L0:;
57739   __Pyx_DECREF(__pyx_v_ns_utf);
57740   __Pyx_DECREF(__pyx_v_registry);
57741   __Pyx_XGIVEREF(__pyx_r);
57742   __Pyx_FinishRefcountContext();
57743   return __pyx_r;
57744 }
57745
57746 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":187
57747  * 
57748  * cdef class _FunctionNamespaceRegistry(_NamespaceRegistry):
57749  *     def __setitem__(self, name, item):             # <<<<<<<<<<<<<<
57750  *         if not callable(item):
57751  *             raise NamespaceRegistryError, \
57752  */
57753
57754 static int __pyx_pf_4lxml_5etree_26_FunctionNamespaceRegistry___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_item); /*proto*/
57755 static int __pyx_pf_4lxml_5etree_26_FunctionNamespaceRegistry___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_item) {
57756   int __pyx_r;
57757   PyObject *__pyx_1 = 0;
57758   int __pyx_t_1;
57759   int __pyx_t_2;
57760   PyObject *__pyx_t_3 = NULL;
57761   __Pyx_SetupRefcountContext("__setitem__");
57762
57763   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":188
57764  * cdef class _FunctionNamespaceRegistry(_NamespaceRegistry):
57765  *     def __setitem__(self, name, item):
57766  *         if not callable(item):             # <<<<<<<<<<<<<<
57767  *             raise NamespaceRegistryError, \
57768  *                 u"Registered functions must be callable."
57769  */
57770   __pyx_t_1 = (!PyCallable_Check(__pyx_v_item));
57771   if (__pyx_t_1) {
57772
57773     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":189
57774  *     def __setitem__(self, name, item):
57775  *         if not callable(item):
57776  *             raise NamespaceRegistryError, \             # <<<<<<<<<<<<<<
57777  *                 u"Registered functions must be callable."
57778  *         if not name:
57779  */
57780     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_112); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
57781     __Pyx_GOTREF(__pyx_1);
57782
57783     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":190
57784  *         if not callable(item):
57785  *             raise NamespaceRegistryError, \
57786  *                 u"Registered functions must be callable."             # <<<<<<<<<<<<<<
57787  *         if not name:
57788  *             raise ValueError, \
57789  */
57790     __Pyx_Raise(__pyx_1, ((PyObject *)__pyx_kp_419), 0);
57791     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
57792     {__pyx_filename = __pyx_f[10]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
57793     goto __pyx_L5;
57794   }
57795   __pyx_L5:;
57796
57797   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":191
57798  *             raise NamespaceRegistryError, \
57799  *                 u"Registered functions must be callable."
57800  *         if not name:             # <<<<<<<<<<<<<<
57801  *             raise ValueError, \
57802  *                 u"extensions must have non empty names"
57803  */
57804   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
57805   __pyx_t_2 = (!__pyx_t_1);
57806   if (__pyx_t_2) {
57807
57808     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":193
57809  *         if not name:
57810  *             raise ValueError, \
57811  *                 u"extensions must have non empty names"             # <<<<<<<<<<<<<<
57812  *         self._entries[_utf8(name)] = item
57813  * 
57814  */
57815     __Pyx_Raise(__pyx_builtin_ValueError, ((PyObject *)__pyx_kp_420), 0);
57816     {__pyx_filename = __pyx_f[10]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
57817     goto __pyx_L6;
57818   }
57819   __pyx_L6:;
57820
57821   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":194
57822  *             raise ValueError, \
57823  *                 u"extensions must have non empty names"
57824  *         self._entries[_utf8(name)] = item             # <<<<<<<<<<<<<<
57825  * 
57826  *     def __repr__(self):
57827  */
57828   __pyx_t_3 = __pyx_f_4lxml_5etree__utf8(__pyx_v_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
57829   __Pyx_GOTREF(__pyx_t_3);
57830   if (PyDict_SetItem(((PyObject *)((struct __pyx_obj_4lxml_5etree__FunctionNamespaceRegistry *)__pyx_v_self)->__pyx_base._entries), __pyx_t_3, __pyx_v_item) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
57831   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
57832
57833   __pyx_r = 0;
57834   goto __pyx_L0;
57835   __pyx_L1_error:;
57836   __Pyx_XDECREF(__pyx_1);
57837   __Pyx_XDECREF(__pyx_t_3);
57838   __Pyx_AddTraceback("lxml.etree._FunctionNamespaceRegistry.__setitem__");
57839   __pyx_r = -1;
57840   __pyx_L0:;
57841   __Pyx_FinishRefcountContext();
57842   return __pyx_r;
57843 }
57844
57845 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":196
57846  *         self._entries[_utf8(name)] = item
57847  * 
57848  *     def __repr__(self):             # <<<<<<<<<<<<<<
57849  *         return u"FunctionNamespace(%r)" % self._ns_uri
57850  * 
57851  */
57852
57853 static PyObject *__pyx_pf_4lxml_5etree_26_FunctionNamespaceRegistry___repr__(PyObject *__pyx_v_self); /*proto*/
57854 static PyObject *__pyx_pf_4lxml_5etree_26_FunctionNamespaceRegistry___repr__(PyObject *__pyx_v_self) {
57855   PyObject *__pyx_r = NULL;
57856   PyObject *__pyx_t_1 = NULL;
57857   __Pyx_SetupRefcountContext("__repr__");
57858
57859   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":197
57860  * 
57861  *     def __repr__(self):
57862  *         return u"FunctionNamespace(%r)" % self._ns_uri             # <<<<<<<<<<<<<<
57863  * 
57864  * cdef class _XPathFunctionNamespaceRegistry(_FunctionNamespaceRegistry):
57865  */
57866   __Pyx_XDECREF(__pyx_r);
57867   __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_421), ((struct __pyx_obj_4lxml_5etree__FunctionNamespaceRegistry *)__pyx_v_self)->__pyx_base._ns_uri); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
57868   __Pyx_GOTREF(__pyx_t_1);
57869   __pyx_r = __pyx_t_1;
57870   __pyx_t_1 = 0;
57871   goto __pyx_L0;
57872
57873   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
57874   goto __pyx_L0;
57875   __pyx_L1_error:;
57876   __Pyx_XDECREF(__pyx_t_1);
57877   __Pyx_AddTraceback("lxml.etree._FunctionNamespaceRegistry.__repr__");
57878   __pyx_r = NULL;
57879   __pyx_L0:;
57880   __Pyx_XGIVEREF(__pyx_r);
57881   __Pyx_FinishRefcountContext();
57882   return __pyx_r;
57883 }
57884
57885 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":205
57886  *     property prefix:
57887  *         u"Namespace prefix for extension functions."
57888  *         def __del__(self):             # <<<<<<<<<<<<<<
57889  *             self._prefix = None # no prefix configured
57890  *             self._prefix_utf = None
57891  */
57892
57893 static int __pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix___del__(PyObject *__pyx_v_self); /*proto*/
57894 static int __pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix___del__(PyObject *__pyx_v_self) {
57895   int __pyx_r;
57896   __Pyx_SetupRefcountContext("__del__");
57897
57898   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":206
57899  *         u"Namespace prefix for extension functions."
57900  *         def __del__(self):
57901  *             self._prefix = None # no prefix configured             # <<<<<<<<<<<<<<
57902  *             self._prefix_utf = None
57903  *         def __get__(self):
57904  */
57905   __Pyx_INCREF(Py_None);
57906   __Pyx_GIVEREF(Py_None);
57907   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix);
57908   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix);
57909   ((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix = Py_None;
57910
57911   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":207
57912  *         def __del__(self):
57913  *             self._prefix = None # no prefix configured
57914  *             self._prefix_utf = None             # <<<<<<<<<<<<<<
57915  *         def __get__(self):
57916  *             if self._prefix is None:
57917  */
57918   __Pyx_INCREF(Py_None);
57919   __Pyx_GIVEREF(Py_None);
57920   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix_utf);
57921   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix_utf);
57922   ((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix_utf = Py_None;
57923
57924   __pyx_r = 0;
57925   __Pyx_FinishRefcountContext();
57926   return __pyx_r;
57927 }
57928
57929 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":208
57930  *             self._prefix = None # no prefix configured
57931  *             self._prefix_utf = None
57932  *         def __get__(self):             # <<<<<<<<<<<<<<
57933  *             if self._prefix is None:
57934  *                 return ''
57935  */
57936
57937 static PyObject *__pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix___get__(PyObject *__pyx_v_self); /*proto*/
57938 static PyObject *__pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix___get__(PyObject *__pyx_v_self) {
57939   PyObject *__pyx_r = NULL;
57940   int __pyx_t_1;
57941   __Pyx_SetupRefcountContext("__get__");
57942
57943   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":209
57944  *             self._prefix_utf = None
57945  *         def __get__(self):
57946  *             if self._prefix is None:             # <<<<<<<<<<<<<<
57947  *                 return ''
57948  *             else:
57949  */
57950   __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix == Py_None);
57951   if (__pyx_t_1) {
57952
57953     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":210
57954  *         def __get__(self):
57955  *             if self._prefix is None:
57956  *                 return ''             # <<<<<<<<<<<<<<
57957  *             else:
57958  *                 return self._prefix
57959  */
57960     __Pyx_XDECREF(__pyx_r);
57961     __Pyx_INCREF(__pyx_kp_422);
57962     __pyx_r = __pyx_kp_422;
57963     goto __pyx_L0;
57964     goto __pyx_L5;
57965   }
57966   /*else*/ {
57967
57968     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":212
57969  *                 return ''
57970  *             else:
57971  *                 return self._prefix             # <<<<<<<<<<<<<<
57972  *         def __set__(self, prefix):
57973  *             if prefix == '':
57974  */
57975     __Pyx_XDECREF(__pyx_r);
57976     __Pyx_INCREF(((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix);
57977     __pyx_r = ((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix;
57978     goto __pyx_L0;
57979   }
57980   __pyx_L5:;
57981
57982   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
57983   __pyx_L0:;
57984   __Pyx_XGIVEREF(__pyx_r);
57985   __Pyx_FinishRefcountContext();
57986   return __pyx_r;
57987 }
57988
57989 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":213
57990  *             else:
57991  *                 return self._prefix
57992  *         def __set__(self, prefix):             # <<<<<<<<<<<<<<
57993  *             if prefix == '':
57994  *                 prefix = None # empty prefix
57995  */
57996
57997 static int __pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_prefix); /*proto*/
57998 static int __pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_prefix) {
57999   int __pyx_r;
58000   PyObject *__pyx_t_1 = NULL;
58001   int __pyx_t_2;
58002   __Pyx_SetupRefcountContext("__set__");
58003   __Pyx_INCREF(__pyx_v_prefix);
58004
58005   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":214
58006  *                 return self._prefix
58007  *         def __set__(self, prefix):
58008  *             if prefix == '':             # <<<<<<<<<<<<<<
58009  *                 prefix = None # empty prefix
58010  *             if prefix is None:
58011  */
58012   __pyx_t_1 = PyObject_RichCompare(__pyx_v_prefix, __pyx_kp_423, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
58013   __Pyx_GOTREF(__pyx_t_1);
58014   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
58015   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
58016   if (__pyx_t_2) {
58017
58018     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":215
58019  *         def __set__(self, prefix):
58020  *             if prefix == '':
58021  *                 prefix = None # empty prefix             # <<<<<<<<<<<<<<
58022  *             if prefix is None:
58023  *                 self._prefix_utf = None
58024  */
58025     __Pyx_INCREF(Py_None);
58026     __Pyx_DECREF(__pyx_v_prefix);
58027     __pyx_v_prefix = Py_None;
58028     goto __pyx_L5;
58029   }
58030   __pyx_L5:;
58031
58032   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":216
58033  *             if prefix == '':
58034  *                 prefix = None # empty prefix
58035  *             if prefix is None:             # <<<<<<<<<<<<<<
58036  *                 self._prefix_utf = None
58037  *             else:
58038  */
58039   __pyx_t_2 = (__pyx_v_prefix == Py_None);
58040   if (__pyx_t_2) {
58041
58042     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":217
58043  *                 prefix = None # empty prefix
58044  *             if prefix is None:
58045  *                 self._prefix_utf = None             # <<<<<<<<<<<<<<
58046  *             else:
58047  *                 self._prefix_utf = _utf8(prefix)
58048  */
58049     __Pyx_INCREF(Py_None);
58050     __Pyx_GIVEREF(Py_None);
58051     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix_utf);
58052     __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix_utf);
58053     ((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix_utf = Py_None;
58054     goto __pyx_L6;
58055   }
58056   /*else*/ {
58057
58058     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":219
58059  *                 self._prefix_utf = None
58060  *             else:
58061  *                 self._prefix_utf = _utf8(prefix)             # <<<<<<<<<<<<<<
58062  *             self._prefix = prefix
58063  * 
58064  */
58065     __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_prefix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
58066     __Pyx_GOTREF(__pyx_t_1);
58067     __Pyx_GIVEREF(__pyx_t_1);
58068     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix_utf);
58069     __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix_utf);
58070     ((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix_utf = __pyx_t_1;
58071     __pyx_t_1 = 0;
58072   }
58073   __pyx_L6:;
58074
58075   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":220
58076  *             else:
58077  *                 self._prefix_utf = _utf8(prefix)
58078  *             self._prefix = prefix             # <<<<<<<<<<<<<<
58079  * 
58080  * cdef list _find_all_extension_prefixes():
58081  */
58082   __Pyx_INCREF(__pyx_v_prefix);
58083   __Pyx_GIVEREF(__pyx_v_prefix);
58084   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix);
58085   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix);
58086   ((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix = __pyx_v_prefix;
58087
58088   __pyx_r = 0;
58089   goto __pyx_L0;
58090   __pyx_L1_error:;
58091   __Pyx_XDECREF(__pyx_t_1);
58092   __Pyx_AddTraceback("lxml.etree._XPathFunctionNamespaceRegistry.prefix.__set__");
58093   __pyx_r = -1;
58094   __pyx_L0:;
58095   __Pyx_DECREF(__pyx_v_prefix);
58096   __Pyx_FinishRefcountContext();
58097   return __pyx_r;
58098 }
58099
58100 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":222
58101  *             self._prefix = prefix
58102  * 
58103  * cdef list _find_all_extension_prefixes():             # <<<<<<<<<<<<<<
58104  *     u"Internal lookup function to find all function prefixes for XSLT/XPath."
58105  *     cdef _XPathFunctionNamespaceRegistry registry
58106  */
58107
58108 static  PyObject *__pyx_f_4lxml_5etree__find_all_extension_prefixes(void) {
58109   struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *__pyx_v_registry;
58110   PyObject *__pyx_v_ns_prefixes = 0;
58111   PyObject *__pyx_r = NULL;
58112   PyObject *__pyx_t_1 = NULL;
58113   Py_ssize_t __pyx_t_2;
58114   void *__pyx_t_3;
58115   int __pyx_t_4;
58116   PyObject *__pyx_t_5 = NULL;
58117   int __pyx_t_6;
58118   __Pyx_SetupRefcountContext("_find_all_extension_prefixes");
58119   __pyx_v_registry = ((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)Py_None); __Pyx_INCREF(Py_None);
58120
58121   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":225
58122  *     u"Internal lookup function to find all function prefixes for XSLT/XPath."
58123  *     cdef _XPathFunctionNamespaceRegistry registry
58124  *     cdef list ns_prefixes = []             # <<<<<<<<<<<<<<
58125  *     for registry in __FUNCTION_NAMESPACE_REGISTRIES.itervalues():
58126  *         if registry._prefix_utf is not None:
58127  */
58128   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
58129   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
58130   __pyx_v_ns_prefixes = __pyx_t_1;
58131   __pyx_t_1 = 0;
58132
58133   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":226
58134  *     cdef _XPathFunctionNamespaceRegistry registry
58135  *     cdef list ns_prefixes = []
58136  *     for registry in __FUNCTION_NAMESPACE_REGISTRIES.itervalues():             # <<<<<<<<<<<<<<
58137  *         if registry._prefix_utf is not None:
58138  *             if registry._ns_uri_utf is not None:
58139  */
58140   __Pyx_INCREF(((PyObject *)__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES));
58141   __Pyx_XDECREF(__pyx_t_1);
58142   __pyx_t_1 = ((PyObject *)__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES);
58143   __pyx_t_2 = 0;
58144   while (1) {
58145     if (!PyDict_Next(__pyx_t_1, (&__pyx_t_2), NULL, ((PyObject **)(&__pyx_t_3)))) break;
58146     if (!(__Pyx_TypeTest(((PyObject *)__pyx_t_3), __pyx_ptype_4lxml_5etree__XPathFunctionNamespaceRegistry))) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
58147     __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_t_3)));
58148     __Pyx_DECREF(((PyObject *)__pyx_v_registry));
58149     __pyx_v_registry = ((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_t_3);
58150
58151     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":227
58152  *     cdef list ns_prefixes = []
58153  *     for registry in __FUNCTION_NAMESPACE_REGISTRIES.itervalues():
58154  *         if registry._prefix_utf is not None:             # <<<<<<<<<<<<<<
58155  *             if registry._ns_uri_utf is not None:
58156  *                 ns_prefixes.append(
58157  */
58158     __pyx_t_4 = (__pyx_v_registry->_prefix_utf != Py_None);
58159     if (__pyx_t_4) {
58160
58161       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":228
58162  *     for registry in __FUNCTION_NAMESPACE_REGISTRIES.itervalues():
58163  *         if registry._prefix_utf is not None:
58164  *             if registry._ns_uri_utf is not None:             # <<<<<<<<<<<<<<
58165  *                 ns_prefixes.append(
58166  *                     (registry._prefix_utf, registry._ns_uri_utf))
58167  */
58168       __pyx_t_4 = (__pyx_v_registry->__pyx_base.__pyx_base._ns_uri_utf != Py_None);
58169       if (__pyx_t_4) {
58170
58171         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":230
58172  *             if registry._ns_uri_utf is not None:
58173  *                 ns_prefixes.append(
58174  *                     (registry._prefix_utf, registry._ns_uri_utf))             # <<<<<<<<<<<<<<
58175  *     return ns_prefixes
58176  * 
58177  */
58178         __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
58179         __Pyx_GOTREF(((PyObject *)__pyx_t_5));
58180         __Pyx_INCREF(__pyx_v_registry->_prefix_utf);
58181         PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_registry->_prefix_utf);
58182         __Pyx_GIVEREF(__pyx_v_registry->_prefix_utf);
58183         __Pyx_INCREF(__pyx_v_registry->__pyx_base.__pyx_base._ns_uri_utf);
58184         PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_registry->__pyx_base.__pyx_base._ns_uri_utf);
58185         __Pyx_GIVEREF(__pyx_v_registry->__pyx_base.__pyx_base._ns_uri_utf);
58186         __pyx_t_6 = PyList_Append(((PyObject *)__pyx_v_ns_prefixes), ((PyObject *)__pyx_t_5)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
58187         __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
58188         goto __pyx_L6;
58189       }
58190       __pyx_L6:;
58191       goto __pyx_L5;
58192     }
58193     __pyx_L5:;
58194   }
58195   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
58196
58197   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":231
58198  *                 ns_prefixes.append(
58199  *                     (registry._prefix_utf, registry._ns_uri_utf))
58200  *     return ns_prefixes             # <<<<<<<<<<<<<<
58201  * 
58202  * cdef object _find_extension(ns_uri_utf, name_utf):
58203  */
58204   __Pyx_XDECREF(((PyObject *)__pyx_r));
58205   __Pyx_INCREF(((PyObject *)__pyx_v_ns_prefixes));
58206   __pyx_r = __pyx_v_ns_prefixes;
58207   goto __pyx_L0;
58208
58209   __pyx_r = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
58210   goto __pyx_L0;
58211   __pyx_L1_error:;
58212   __Pyx_XDECREF(__pyx_t_1);
58213   __Pyx_XDECREF(__pyx_t_5);
58214   __Pyx_AddTraceback("lxml.etree._find_all_extension_prefixes");
58215   __pyx_r = 0;
58216   __pyx_L0:;
58217   __Pyx_DECREF((PyObject *)__pyx_v_registry);
58218   __Pyx_XDECREF(__pyx_v_ns_prefixes);
58219   __Pyx_XGIVEREF(__pyx_r);
58220   __Pyx_FinishRefcountContext();
58221   return __pyx_r;
58222 }
58223
58224 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":233
58225  *     return ns_prefixes
58226  * 
58227  * cdef object _find_extension(ns_uri_utf, name_utf):             # <<<<<<<<<<<<<<
58228  *     cdef python.PyObject* dict_result
58229  *     dict_result = python.PyDict_GetItem(
58230  */
58231
58232 static  PyObject *__pyx_f_4lxml_5etree__find_extension(PyObject *__pyx_v_ns_uri_utf, PyObject *__pyx_v_name_utf) {
58233   PyObject *__pyx_v_dict_result;
58234   PyObject *__pyx_v_extensions;
58235   PyObject *__pyx_r = NULL;
58236   int __pyx_t_1;
58237   __Pyx_SetupRefcountContext("_find_extension");
58238   __pyx_v_extensions = Py_None; __Pyx_INCREF(Py_None);
58239
58240   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":236
58241  *     cdef python.PyObject* dict_result
58242  *     dict_result = python.PyDict_GetItem(
58243  *         __FUNCTION_NAMESPACE_REGISTRIES, ns_uri_utf)             # <<<<<<<<<<<<<<
58244  *     if dict_result is NULL:
58245  *         return None
58246  */
58247   __pyx_v_dict_result = PyDict_GetItem(((PyObject *)__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES), __pyx_v_ns_uri_utf);
58248
58249   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":237
58250  *     dict_result = python.PyDict_GetItem(
58251  *         __FUNCTION_NAMESPACE_REGISTRIES, ns_uri_utf)
58252  *     if dict_result is NULL:             # <<<<<<<<<<<<<<
58253  *         return None
58254  *     extensions = (<_NamespaceRegistry>dict_result)._entries
58255  */
58256   __pyx_t_1 = (__pyx_v_dict_result == NULL);
58257   if (__pyx_t_1) {
58258
58259     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":238
58260  *         __FUNCTION_NAMESPACE_REGISTRIES, ns_uri_utf)
58261  *     if dict_result is NULL:
58262  *         return None             # <<<<<<<<<<<<<<
58263  *     extensions = (<_NamespaceRegistry>dict_result)._entries
58264  *     dict_result = python.PyDict_GetItem(extensions, name_utf)
58265  */
58266     __Pyx_XDECREF(__pyx_r);
58267     __Pyx_INCREF(Py_None);
58268     __pyx_r = Py_None;
58269     goto __pyx_L0;
58270     goto __pyx_L3;
58271   }
58272   __pyx_L3:;
58273
58274   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":239
58275  *     if dict_result is NULL:
58276  *         return None
58277  *     extensions = (<_NamespaceRegistry>dict_result)._entries             # <<<<<<<<<<<<<<
58278  *     dict_result = python.PyDict_GetItem(extensions, name_utf)
58279  *     if dict_result is NULL:
58280  */
58281   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_dict_result)->_entries));
58282   __Pyx_DECREF(__pyx_v_extensions);
58283   __pyx_v_extensions = ((PyObject *)((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_dict_result)->_entries);
58284
58285   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":240
58286  *         return None
58287  *     extensions = (<_NamespaceRegistry>dict_result)._entries
58288  *     dict_result = python.PyDict_GetItem(extensions, name_utf)             # <<<<<<<<<<<<<<
58289  *     if dict_result is NULL:
58290  *         return None
58291  */
58292   __pyx_v_dict_result = PyDict_GetItem(__pyx_v_extensions, __pyx_v_name_utf);
58293
58294   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":241
58295  *     extensions = (<_NamespaceRegistry>dict_result)._entries
58296  *     dict_result = python.PyDict_GetItem(extensions, name_utf)
58297  *     if dict_result is NULL:             # <<<<<<<<<<<<<<
58298  *         return None
58299  *     else:
58300  */
58301   __pyx_t_1 = (__pyx_v_dict_result == NULL);
58302   if (__pyx_t_1) {
58303
58304     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":242
58305  *     dict_result = python.PyDict_GetItem(extensions, name_utf)
58306  *     if dict_result is NULL:
58307  *         return None             # <<<<<<<<<<<<<<
58308  *     else:
58309  *         return <object>dict_result
58310  */
58311     __Pyx_XDECREF(__pyx_r);
58312     __Pyx_INCREF(Py_None);
58313     __pyx_r = Py_None;
58314     goto __pyx_L0;
58315     goto __pyx_L4;
58316   }
58317   /*else*/ {
58318
58319     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":244
58320  *         return None
58321  *     else:
58322  *         return <object>dict_result             # <<<<<<<<<<<<<<
58323  */
58324     __Pyx_XDECREF(__pyx_r);
58325     __Pyx_INCREF(((PyObject *)__pyx_v_dict_result));
58326     __pyx_r = ((PyObject *)__pyx_v_dict_result);
58327     goto __pyx_L0;
58328   }
58329   __pyx_L4:;
58330
58331   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
58332   __pyx_L0:;
58333   __Pyx_DECREF(__pyx_v_extensions);
58334   __Pyx_XGIVEREF(__pyx_r);
58335   __Pyx_FinishRefcountContext();
58336   return __pyx_r;
58337 }
58338
58339 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":17
58340  * cdef class Resolver:
58341  *     u"This is the base class of all resolvers."
58342  *     def resolve(self, system_url, public_id, context):             # <<<<<<<<<<<<<<
58343  *         u"""resolve(self, system_url, public_id, context)
58344  * 
58345  */
58346
58347 static PyObject *__pyx_pf_4lxml_5etree_8Resolver_resolve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
58348 static char __pyx_doc_4lxml_5etree_8Resolver_resolve[] = "resolve(self, system_url, public_id, context)\n\n        Override this method to resolve an external source by\n        ``system_url`` and ``public_id``.  The third argument is an\n        opaque context object.\n\n        Return the result of one of the ``resolve_*()`` methods.\n        ";
58349 static PyObject *__pyx_pf_4lxml_5etree_8Resolver_resolve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
58350   PyObject *__pyx_v_system_url = 0;
58351   PyObject *__pyx_v_public_id = 0;
58352   PyObject *__pyx_v_context = 0;
58353   PyObject *__pyx_r = NULL;
58354   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_system_url,&__pyx_kp_public_id,&__pyx_kp_context,0};
58355   __Pyx_SetupRefcountContext("resolve");
58356   if (unlikely(__pyx_kwds)) {
58357     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
58358     PyObject* values[3] = {0,0,0};
58359     switch (PyTuple_GET_SIZE(__pyx_args)) {
58360       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
58361       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
58362       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
58363       case  0: break;
58364       default: goto __pyx_L5_argtuple_error;
58365     }
58366     switch (PyTuple_GET_SIZE(__pyx_args)) {
58367       case  0:
58368       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_system_url);
58369       if (likely(values[0])) kw_args--;
58370       else goto __pyx_L5_argtuple_error;
58371       case  1:
58372       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_public_id);
58373       if (likely(values[1])) kw_args--;
58374       else {
58375         __Pyx_RaiseArgtupleInvalid("resolve", 1, 3, 3, 1); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
58376       }
58377       case  2:
58378       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_context);
58379       if (likely(values[2])) kw_args--;
58380       else {
58381         __Pyx_RaiseArgtupleInvalid("resolve", 1, 3, 3, 2); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
58382       }
58383     }
58384     if (unlikely(kw_args > 0)) {
58385       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "resolve") < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
58386     }
58387     __pyx_v_system_url = values[0];
58388     __pyx_v_public_id = values[1];
58389     __pyx_v_context = values[2];
58390   } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
58391     goto __pyx_L5_argtuple_error;
58392   } else {
58393     __pyx_v_system_url = PyTuple_GET_ITEM(__pyx_args, 0);
58394     __pyx_v_public_id = PyTuple_GET_ITEM(__pyx_args, 1);
58395     __pyx_v_context = PyTuple_GET_ITEM(__pyx_args, 2);
58396   }
58397   goto __pyx_L4_argument_unpacking_done;
58398   __pyx_L5_argtuple_error:;
58399   __Pyx_RaiseArgtupleInvalid("resolve", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
58400   __pyx_L3_error:;
58401   __Pyx_AddTraceback("lxml.etree.Resolver.resolve");
58402   return NULL;
58403   __pyx_L4_argument_unpacking_done:;
58404
58405   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":26
58406  *         Return the result of one of the ``resolve_*()`` methods.
58407  *         """
58408  *         return None             # <<<<<<<<<<<<<<
58409  * 
58410  *     def resolve_empty(self, context):
58411  */
58412   __Pyx_XDECREF(__pyx_r);
58413   __Pyx_INCREF(Py_None);
58414   __pyx_r = Py_None;
58415   goto __pyx_L0;
58416
58417   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
58418   __pyx_L0:;
58419   __Pyx_XGIVEREF(__pyx_r);
58420   __Pyx_FinishRefcountContext();
58421   return __pyx_r;
58422 }
58423
58424 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":28
58425  *         return None
58426  * 
58427  *     def resolve_empty(self, context):             # <<<<<<<<<<<<<<
58428  *         u"""resolve_empty(self, context)
58429  * 
58430  */
58431
58432 static PyObject *__pyx_pf_4lxml_5etree_8Resolver_resolve_empty(PyObject *__pyx_v_self, PyObject *__pyx_v_context); /*proto*/
58433 static char __pyx_doc_4lxml_5etree_8Resolver_resolve_empty[] = "resolve_empty(self, context)\n\n        Return an empty input document.\n\n        Pass context as parameter.\n        ";
58434 static PyObject *__pyx_pf_4lxml_5etree_8Resolver_resolve_empty(PyObject *__pyx_v_self, PyObject *__pyx_v_context) {
58435   struct __pyx_obj_4lxml_5etree__InputDocument *__pyx_v_doc_ref;
58436   PyObject *__pyx_r = NULL;
58437   PyObject *__pyx_t_1 = NULL;
58438   __Pyx_SetupRefcountContext("resolve_empty");
58439   __pyx_v_doc_ref = ((struct __pyx_obj_4lxml_5etree__InputDocument *)Py_None); __Pyx_INCREF(Py_None);
58440
58441   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":36
58442  *         """
58443  *         cdef _InputDocument doc_ref
58444  *         doc_ref = _InputDocument()             # <<<<<<<<<<<<<<
58445  *         doc_ref._type = PARSER_DATA_EMPTY
58446  *         return doc_ref
58447  */
58448   __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__InputDocument)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
58449   __Pyx_GOTREF(__pyx_t_1);
58450   if (!(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__InputDocument))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
58451   __Pyx_DECREF(((PyObject *)__pyx_v_doc_ref));
58452   __pyx_v_doc_ref = ((struct __pyx_obj_4lxml_5etree__InputDocument *)__pyx_t_1);
58453   __pyx_t_1 = 0;
58454
58455   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":37
58456  *         cdef _InputDocument doc_ref
58457  *         doc_ref = _InputDocument()
58458  *         doc_ref._type = PARSER_DATA_EMPTY             # <<<<<<<<<<<<<<
58459  *         return doc_ref
58460  * 
58461  */
58462   __pyx_v_doc_ref->_type = __pyx_e_4lxml_5etree_PARSER_DATA_EMPTY;
58463
58464   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":38
58465  *         doc_ref = _InputDocument()
58466  *         doc_ref._type = PARSER_DATA_EMPTY
58467  *         return doc_ref             # <<<<<<<<<<<<<<
58468  * 
58469  *     def resolve_string(self, string, context, *, base_url=None):
58470  */
58471   __Pyx_XDECREF(__pyx_r);
58472   __Pyx_INCREF(((PyObject *)__pyx_v_doc_ref));
58473   __pyx_r = ((PyObject *)__pyx_v_doc_ref);
58474   goto __pyx_L0;
58475
58476   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
58477   goto __pyx_L0;
58478   __pyx_L1_error:;
58479   __Pyx_XDECREF(__pyx_t_1);
58480   __Pyx_AddTraceback("lxml.etree.Resolver.resolve_empty");
58481   __pyx_r = NULL;
58482   __pyx_L0:;
58483   __Pyx_DECREF((PyObject *)__pyx_v_doc_ref);
58484   __Pyx_XGIVEREF(__pyx_r);
58485   __Pyx_FinishRefcountContext();
58486   return __pyx_r;
58487 }
58488
58489 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":40
58490  *         return doc_ref
58491  * 
58492  *     def resolve_string(self, string, context, *, base_url=None):             # <<<<<<<<<<<<<<
58493  *         u"""resolve_string(self, string, context, base_url=None)
58494  * 
58495  */
58496
58497 static PyObject *__pyx_pf_4lxml_5etree_8Resolver_resolve_string(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
58498 static char __pyx_doc_4lxml_5etree_8Resolver_resolve_string[] = "resolve_string(self, string, context, base_url=None)\n\n        Return a parsable string as input document.\n\n        Pass data string and context as parameters.  You can pass the\n        source URL or filename through the ``base_url`` keyword\n        argument.\n        ";
58499 static PyObject *__pyx_pf_4lxml_5etree_8Resolver_resolve_string(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
58500   PyObject *__pyx_v_string = 0;
58501   PyObject *__pyx_v_context = 0;
58502   PyObject *__pyx_v_base_url = 0;
58503   struct __pyx_obj_4lxml_5etree__InputDocument *__pyx_v_doc_ref;
58504   PyObject *__pyx_r = NULL;
58505   int __pyx_t_1;
58506   PyObject *__pyx_t_2 = NULL;
58507   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_string,&__pyx_kp_context,&__pyx_kp_base_url,0};
58508   __Pyx_SetupRefcountContext("resolve_string");
58509   if (unlikely(__pyx_kwds)) {
58510     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
58511     PyObject* values[3] = {0,0,0};
58512     values[2] = Py_None;
58513     switch (PyTuple_GET_SIZE(__pyx_args)) {
58514       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
58515       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
58516       case  0: break;
58517       default: goto __pyx_L5_argtuple_error;
58518     }
58519     switch (PyTuple_GET_SIZE(__pyx_args)) {
58520       case  0:
58521       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_string);
58522       if (likely(values[0])) kw_args--;
58523       else goto __pyx_L5_argtuple_error;
58524       case  1:
58525       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_context);
58526       if (likely(values[1])) kw_args--;
58527       else {
58528         __Pyx_RaiseArgtupleInvalid("resolve_string", 1, 2, 2, 1); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
58529       }
58530     }
58531     while (kw_args > 0) {
58532       PyObject* value;
58533       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_base_url);
58534       if (value) { values[2] = value; if (!(--kw_args)) break; }
58535       break;
58536     }
58537     if (unlikely(kw_args > 0)) {
58538       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "resolve_string") < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
58539     }
58540     __pyx_v_string = values[0];
58541     __pyx_v_context = values[1];
58542     __pyx_v_base_url = values[2];
58543   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
58544     goto __pyx_L5_argtuple_error;
58545   } else {
58546     __pyx_v_string = PyTuple_GET_ITEM(__pyx_args, 0);
58547     __pyx_v_context = PyTuple_GET_ITEM(__pyx_args, 1);
58548     __pyx_v_base_url = Py_None;
58549   }
58550   goto __pyx_L4_argument_unpacking_done;
58551   __pyx_L5_argtuple_error:;
58552   __Pyx_RaiseArgtupleInvalid("resolve_string", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
58553   __pyx_L3_error:;
58554   __Pyx_AddTraceback("lxml.etree.Resolver.resolve_string");
58555   return NULL;
58556   __pyx_L4_argument_unpacking_done:;
58557   __Pyx_INCREF(__pyx_v_string);
58558   __pyx_v_doc_ref = ((struct __pyx_obj_4lxml_5etree__InputDocument *)Py_None); __Pyx_INCREF(Py_None);
58559
58560   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":50
58561  *         """
58562  *         cdef _InputDocument doc_ref
58563  *         if python.PyUnicode_Check(string):             # <<<<<<<<<<<<<<
58564  *             string = python.PyUnicode_AsUTF8String(string)
58565  *         elif not python.PyString_Check(string):
58566  */
58567   __pyx_t_1 = PyUnicode_Check(__pyx_v_string);
58568   if (__pyx_t_1) {
58569
58570     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":51
58571  *         cdef _InputDocument doc_ref
58572  *         if python.PyUnicode_Check(string):
58573  *             string = python.PyUnicode_AsUTF8String(string)             # <<<<<<<<<<<<<<
58574  *         elif not python.PyString_Check(string):
58575  *             raise TypeError, "argument must be a byte string or unicode string"
58576  */
58577     __pyx_t_2 = PyUnicode_AsUTF8String(__pyx_v_string); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
58578     __Pyx_GOTREF(__pyx_t_2);
58579     __Pyx_DECREF(__pyx_v_string);
58580     __pyx_v_string = __pyx_t_2;
58581     __pyx_t_2 = 0;
58582     goto __pyx_L6;
58583   }
58584
58585   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":52
58586  *         if python.PyUnicode_Check(string):
58587  *             string = python.PyUnicode_AsUTF8String(string)
58588  *         elif not python.PyString_Check(string):             # <<<<<<<<<<<<<<
58589  *             raise TypeError, "argument must be a byte string or unicode string"
58590  *         doc_ref = _InputDocument()
58591  */
58592   __pyx_t_1 = (!PyString_Check(__pyx_v_string));
58593   if (__pyx_t_1) {
58594
58595     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":53
58596  *             string = python.PyUnicode_AsUTF8String(string)
58597  *         elif not python.PyString_Check(string):
58598  *             raise TypeError, "argument must be a byte string or unicode string"             # <<<<<<<<<<<<<<
58599  *         doc_ref = _InputDocument()
58600  *         doc_ref._type = PARSER_DATA_STRING
58601  */
58602     __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_424, 0);
58603     {__pyx_filename = __pyx_f[11]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
58604     goto __pyx_L6;
58605   }
58606   __pyx_L6:;
58607
58608   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":54
58609  *         elif not python.PyString_Check(string):
58610  *             raise TypeError, "argument must be a byte string or unicode string"
58611  *         doc_ref = _InputDocument()             # <<<<<<<<<<<<<<
58612  *         doc_ref._type = PARSER_DATA_STRING
58613  *         doc_ref._data_bytes = string
58614  */
58615   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__InputDocument)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
58616   __Pyx_GOTREF(__pyx_t_2);
58617   if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__InputDocument))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
58618   __Pyx_DECREF(((PyObject *)__pyx_v_doc_ref));
58619   __pyx_v_doc_ref = ((struct __pyx_obj_4lxml_5etree__InputDocument *)__pyx_t_2);
58620   __pyx_t_2 = 0;
58621
58622   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":55
58623  *             raise TypeError, "argument must be a byte string or unicode string"
58624  *         doc_ref = _InputDocument()
58625  *         doc_ref._type = PARSER_DATA_STRING             # <<<<<<<<<<<<<<
58626  *         doc_ref._data_bytes = string
58627  *         if base_url is not None:
58628  */
58629   __pyx_v_doc_ref->_type = __pyx_e_4lxml_5etree_PARSER_DATA_STRING;
58630
58631   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":56
58632  *         doc_ref = _InputDocument()
58633  *         doc_ref._type = PARSER_DATA_STRING
58634  *         doc_ref._data_bytes = string             # <<<<<<<<<<<<<<
58635  *         if base_url is not None:
58636  *             doc_ref._filename = _encodeFilename(base_url)
58637  */
58638   __Pyx_INCREF(__pyx_v_string);
58639   __Pyx_GIVEREF(__pyx_v_string);
58640   __Pyx_GOTREF(__pyx_v_doc_ref->_data_bytes);
58641   __Pyx_DECREF(__pyx_v_doc_ref->_data_bytes);
58642   __pyx_v_doc_ref->_data_bytes = __pyx_v_string;
58643
58644   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":57
58645  *         doc_ref._type = PARSER_DATA_STRING
58646  *         doc_ref._data_bytes = string
58647  *         if base_url is not None:             # <<<<<<<<<<<<<<
58648  *             doc_ref._filename = _encodeFilename(base_url)
58649  *         return doc_ref
58650  */
58651   __pyx_t_1 = (__pyx_v_base_url != Py_None);
58652   if (__pyx_t_1) {
58653
58654     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":58
58655  *         doc_ref._data_bytes = string
58656  *         if base_url is not None:
58657  *             doc_ref._filename = _encodeFilename(base_url)             # <<<<<<<<<<<<<<
58658  *         return doc_ref
58659  * 
58660  */
58661     __pyx_t_2 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_base_url); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
58662     __Pyx_GOTREF(__pyx_t_2);
58663     __Pyx_GIVEREF(__pyx_t_2);
58664     __Pyx_GOTREF(__pyx_v_doc_ref->_filename);
58665     __Pyx_DECREF(__pyx_v_doc_ref->_filename);
58666     __pyx_v_doc_ref->_filename = __pyx_t_2;
58667     __pyx_t_2 = 0;
58668     goto __pyx_L7;
58669   }
58670   __pyx_L7:;
58671
58672   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":59
58673  *         if base_url is not None:
58674  *             doc_ref._filename = _encodeFilename(base_url)
58675  *         return doc_ref             # <<<<<<<<<<<<<<
58676  * 
58677  *     def resolve_filename(self, filename, context):
58678  */
58679   __Pyx_XDECREF(__pyx_r);
58680   __Pyx_INCREF(((PyObject *)__pyx_v_doc_ref));
58681   __pyx_r = ((PyObject *)__pyx_v_doc_ref);
58682   goto __pyx_L0;
58683
58684   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
58685   goto __pyx_L0;
58686   __pyx_L1_error:;
58687   __Pyx_XDECREF(__pyx_t_2);
58688   __Pyx_AddTraceback("lxml.etree.Resolver.resolve_string");
58689   __pyx_r = NULL;
58690   __pyx_L0:;
58691   __Pyx_DECREF((PyObject *)__pyx_v_doc_ref);
58692   __Pyx_DECREF(__pyx_v_string);
58693   __Pyx_XGIVEREF(__pyx_r);
58694   __Pyx_FinishRefcountContext();
58695   return __pyx_r;
58696 }
58697
58698 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":61
58699  *         return doc_ref
58700  * 
58701  *     def resolve_filename(self, filename, context):             # <<<<<<<<<<<<<<
58702  *         u"""resolve_filename(self, filename, context)
58703  * 
58704  */
58705
58706 static PyObject *__pyx_pf_4lxml_5etree_8Resolver_resolve_filename(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
58707 static char __pyx_doc_4lxml_5etree_8Resolver_resolve_filename[] = "resolve_filename(self, filename, context)\n\n        Return the name of a parsable file as input document.\n\n        Pass filename and context as parameters.  You can also pass a\n        URL with an HTTP, FTP or file target.\n        ";
58708 static PyObject *__pyx_pf_4lxml_5etree_8Resolver_resolve_filename(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
58709   PyObject *__pyx_v_filename = 0;
58710   PyObject *__pyx_v_context = 0;
58711   struct __pyx_obj_4lxml_5etree__InputDocument *__pyx_v_doc_ref;
58712   PyObject *__pyx_r = NULL;
58713   PyObject *__pyx_t_1 = NULL;
58714   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_filename,&__pyx_kp_context,0};
58715   __Pyx_SetupRefcountContext("resolve_filename");
58716   if (unlikely(__pyx_kwds)) {
58717     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
58718     PyObject* values[2] = {0,0};
58719     switch (PyTuple_GET_SIZE(__pyx_args)) {
58720       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
58721       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
58722       case  0: break;
58723       default: goto __pyx_L5_argtuple_error;
58724     }
58725     switch (PyTuple_GET_SIZE(__pyx_args)) {
58726       case  0:
58727       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_filename);
58728       if (likely(values[0])) kw_args--;
58729       else goto __pyx_L5_argtuple_error;
58730       case  1:
58731       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_context);
58732       if (likely(values[1])) kw_args--;
58733       else {
58734         __Pyx_RaiseArgtupleInvalid("resolve_filename", 1, 2, 2, 1); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
58735       }
58736     }
58737     if (unlikely(kw_args > 0)) {
58738       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "resolve_filename") < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
58739     }
58740     __pyx_v_filename = values[0];
58741     __pyx_v_context = values[1];
58742   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
58743     goto __pyx_L5_argtuple_error;
58744   } else {
58745     __pyx_v_filename = PyTuple_GET_ITEM(__pyx_args, 0);
58746     __pyx_v_context = PyTuple_GET_ITEM(__pyx_args, 1);
58747   }
58748   goto __pyx_L4_argument_unpacking_done;
58749   __pyx_L5_argtuple_error:;
58750   __Pyx_RaiseArgtupleInvalid("resolve_filename", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
58751   __pyx_L3_error:;
58752   __Pyx_AddTraceback("lxml.etree.Resolver.resolve_filename");
58753   return NULL;
58754   __pyx_L4_argument_unpacking_done:;
58755   __pyx_v_doc_ref = ((struct __pyx_obj_4lxml_5etree__InputDocument *)Py_None); __Pyx_INCREF(Py_None);
58756
58757   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":70
58758  *         """
58759  *         cdef _InputDocument doc_ref
58760  *         doc_ref = _InputDocument()             # <<<<<<<<<<<<<<
58761  *         doc_ref._type = PARSER_DATA_FILENAME
58762  *         doc_ref._filename = _encodeFilename(filename)
58763  */
58764   __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__InputDocument)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
58765   __Pyx_GOTREF(__pyx_t_1);
58766   if (!(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__InputDocument))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
58767   __Pyx_DECREF(((PyObject *)__pyx_v_doc_ref));
58768   __pyx_v_doc_ref = ((struct __pyx_obj_4lxml_5etree__InputDocument *)__pyx_t_1);
58769   __pyx_t_1 = 0;
58770
58771   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":71
58772  *         cdef _InputDocument doc_ref
58773  *         doc_ref = _InputDocument()
58774  *         doc_ref._type = PARSER_DATA_FILENAME             # <<<<<<<<<<<<<<
58775  *         doc_ref._filename = _encodeFilename(filename)
58776  *         return doc_ref
58777  */
58778   __pyx_v_doc_ref->_type = __pyx_e_4lxml_5etree_PARSER_DATA_FILENAME;
58779
58780   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":72
58781  *         doc_ref = _InputDocument()
58782  *         doc_ref._type = PARSER_DATA_FILENAME
58783  *         doc_ref._filename = _encodeFilename(filename)             # <<<<<<<<<<<<<<
58784  *         return doc_ref
58785  * 
58786  */
58787   __pyx_t_1 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
58788   __Pyx_GOTREF(__pyx_t_1);
58789   __Pyx_GIVEREF(__pyx_t_1);
58790   __Pyx_GOTREF(__pyx_v_doc_ref->_filename);
58791   __Pyx_DECREF(__pyx_v_doc_ref->_filename);
58792   __pyx_v_doc_ref->_filename = __pyx_t_1;
58793   __pyx_t_1 = 0;
58794
58795   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":73
58796  *         doc_ref._type = PARSER_DATA_FILENAME
58797  *         doc_ref._filename = _encodeFilename(filename)
58798  *         return doc_ref             # <<<<<<<<<<<<<<
58799  * 
58800  *     def resolve_file(self, f, context, *, base_url=None):
58801  */
58802   __Pyx_XDECREF(__pyx_r);
58803   __Pyx_INCREF(((PyObject *)__pyx_v_doc_ref));
58804   __pyx_r = ((PyObject *)__pyx_v_doc_ref);
58805   goto __pyx_L0;
58806
58807   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
58808   goto __pyx_L0;
58809   __pyx_L1_error:;
58810   __Pyx_XDECREF(__pyx_t_1);
58811   __Pyx_AddTraceback("lxml.etree.Resolver.resolve_filename");
58812   __pyx_r = NULL;
58813   __pyx_L0:;
58814   __Pyx_DECREF((PyObject *)__pyx_v_doc_ref);
58815   __Pyx_XGIVEREF(__pyx_r);
58816   __Pyx_FinishRefcountContext();
58817   return __pyx_r;
58818 }
58819
58820 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":75
58821  *         return doc_ref
58822  * 
58823  *     def resolve_file(self, f, context, *, base_url=None):             # <<<<<<<<<<<<<<
58824  *         u"""resolve_file(self, f, context, base_url=None)
58825  * 
58826  */
58827
58828 static PyObject *__pyx_pf_4lxml_5etree_8Resolver_resolve_file(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
58829 static char __pyx_doc_4lxml_5etree_8Resolver_resolve_file[] = "resolve_file(self, f, context, base_url=None)\n\n        Return an open file-like object as input document.\n\n        Pass open file and context as parameters.  You can pass the\n        base URL or filename of the file through the ``base_url``\n        keyword argument.\n\n        Note that using ``.resolve_filename()`` is more efficient,\n        especially in threaded environments.\n        ";
58830 static PyObject *__pyx_pf_4lxml_5etree_8Resolver_resolve_file(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
58831   PyObject *__pyx_v_f = 0;
58832   PyObject *__pyx_v_context = 0;
58833   PyObject *__pyx_v_base_url = 0;
58834   struct __pyx_obj_4lxml_5etree__InputDocument *__pyx_v_doc_ref;
58835   PyObject *__pyx_r = NULL;
58836   int __pyx_1;
58837   PyObject *__pyx_t_1 = NULL;
58838   PyObject *__pyx_t_2 = NULL;
58839   PyObject *__pyx_t_3 = NULL;
58840   int __pyx_t_4;
58841   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_f,&__pyx_kp_context,&__pyx_kp_base_url,0};
58842   __Pyx_SetupRefcountContext("resolve_file");
58843   if (unlikely(__pyx_kwds)) {
58844     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
58845     PyObject* values[3] = {0,0,0};
58846     values[2] = Py_None;
58847     switch (PyTuple_GET_SIZE(__pyx_args)) {
58848       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
58849       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
58850       case  0: break;
58851       default: goto __pyx_L5_argtuple_error;
58852     }
58853     switch (PyTuple_GET_SIZE(__pyx_args)) {
58854       case  0:
58855       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_f);
58856       if (likely(values[0])) kw_args--;
58857       else goto __pyx_L5_argtuple_error;
58858       case  1:
58859       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_context);
58860       if (likely(values[1])) kw_args--;
58861       else {
58862         __Pyx_RaiseArgtupleInvalid("resolve_file", 1, 2, 2, 1); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
58863       }
58864     }
58865     while (kw_args > 0) {
58866       PyObject* value;
58867       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_base_url);
58868       if (value) { values[2] = value; if (!(--kw_args)) break; }
58869       break;
58870     }
58871     if (unlikely(kw_args > 0)) {
58872       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "resolve_file") < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
58873     }
58874     __pyx_v_f = values[0];
58875     __pyx_v_context = values[1];
58876     __pyx_v_base_url = values[2];
58877   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
58878     goto __pyx_L5_argtuple_error;
58879   } else {
58880     __pyx_v_f = PyTuple_GET_ITEM(__pyx_args, 0);
58881     __pyx_v_context = PyTuple_GET_ITEM(__pyx_args, 1);
58882     __pyx_v_base_url = Py_None;
58883   }
58884   goto __pyx_L4_argument_unpacking_done;
58885   __pyx_L5_argtuple_error:;
58886   __Pyx_RaiseArgtupleInvalid("resolve_file", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
58887   __pyx_L3_error:;
58888   __Pyx_AddTraceback("lxml.etree.Resolver.resolve_file");
58889   return NULL;
58890   __pyx_L4_argument_unpacking_done:;
58891   __pyx_v_doc_ref = ((struct __pyx_obj_4lxml_5etree__InputDocument *)Py_None); __Pyx_INCREF(Py_None);
58892
58893   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":88
58894  *         """
58895  *         cdef _InputDocument doc_ref
58896  *         try:             # <<<<<<<<<<<<<<
58897  *             f.read
58898  *         except AttributeError:
58899  */
58900   {
58901     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
58902     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
58903     __Pyx_XGOTREF(__pyx_save_exc_type);
58904     __Pyx_XGOTREF(__pyx_save_exc_value);
58905     __Pyx_XGOTREF(__pyx_save_exc_tb);
58906     /*try:*/ {
58907
58908       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":89
58909  *         cdef _InputDocument doc_ref
58910  *         try:
58911  *             f.read             # <<<<<<<<<<<<<<
58912  *         except AttributeError:
58913  *             raise TypeError, u"Argument is not a file-like object"
58914  */
58915       __pyx_t_1 = PyObject_GetAttr(__pyx_v_f, __pyx_kp_read); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
58916       __Pyx_GOTREF(__pyx_t_1);
58917       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
58918     }
58919     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
58920     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
58921     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
58922     goto __pyx_L13_try_end;
58923     __pyx_L6_error:;
58924     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
58925
58926     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":90
58927  *         try:
58928  *             f.read
58929  *         except AttributeError:             # <<<<<<<<<<<<<<
58930  *             raise TypeError, u"Argument is not a file-like object"
58931  *         doc_ref = _InputDocument()
58932  */
58933     __pyx_1 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
58934     if (__pyx_1) {
58935       __Pyx_AddTraceback("lxml.etree.resolve_file");
58936       if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
58937       __Pyx_GOTREF(__pyx_t_1);
58938       __Pyx_GOTREF(__pyx_t_2);
58939       __Pyx_GOTREF(__pyx_t_3);
58940
58941       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":91
58942  *             f.read
58943  *         except AttributeError:
58944  *             raise TypeError, u"Argument is not a file-like object"             # <<<<<<<<<<<<<<
58945  *         doc_ref = _InputDocument()
58946  *         doc_ref._type = PARSER_DATA_FILE
58947  */
58948       __Pyx_Raise(__pyx_builtin_TypeError, ((PyObject *)__pyx_kp_425), 0);
58949       {__pyx_filename = __pyx_f[11]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
58950       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
58951       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
58952       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
58953       goto __pyx_L7_exception_handled;
58954     }
58955     __pyx_L8_except_error:;
58956     __Pyx_XDECREF(__pyx_save_exc_type);
58957     __Pyx_XDECREF(__pyx_save_exc_value);
58958     __Pyx_XDECREF(__pyx_save_exc_tb);
58959     goto __pyx_L1_error;
58960     __pyx_L7_exception_handled:;
58961     __Pyx_XGIVEREF(__pyx_save_exc_type);
58962     __Pyx_XGIVEREF(__pyx_save_exc_value);
58963     __Pyx_XGIVEREF(__pyx_save_exc_tb);
58964     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
58965     __pyx_L13_try_end:;
58966   }
58967
58968   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":92
58969  *         except AttributeError:
58970  *             raise TypeError, u"Argument is not a file-like object"
58971  *         doc_ref = _InputDocument()             # <<<<<<<<<<<<<<
58972  *         doc_ref._type = PARSER_DATA_FILE
58973  *         if base_url is not None:
58974  */
58975   __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__InputDocument)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
58976   __Pyx_GOTREF(__pyx_t_3);
58977   if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4lxml_5etree__InputDocument))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
58978   __Pyx_DECREF(((PyObject *)__pyx_v_doc_ref));
58979   __pyx_v_doc_ref = ((struct __pyx_obj_4lxml_5etree__InputDocument *)__pyx_t_3);
58980   __pyx_t_3 = 0;
58981
58982   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":93
58983  *             raise TypeError, u"Argument is not a file-like object"
58984  *         doc_ref = _InputDocument()
58985  *         doc_ref._type = PARSER_DATA_FILE             # <<<<<<<<<<<<<<
58986  *         if base_url is not None:
58987  *             doc_ref._filename = _encodeFilename(base_url)
58988  */
58989   __pyx_v_doc_ref->_type = __pyx_e_4lxml_5etree_PARSER_DATA_FILE;
58990
58991   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":94
58992  *         doc_ref = _InputDocument()
58993  *         doc_ref._type = PARSER_DATA_FILE
58994  *         if base_url is not None:             # <<<<<<<<<<<<<<
58995  *             doc_ref._filename = _encodeFilename(base_url)
58996  *         else:
58997  */
58998   __pyx_t_4 = (__pyx_v_base_url != Py_None);
58999   if (__pyx_t_4) {
59000
59001     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":95
59002  *         doc_ref._type = PARSER_DATA_FILE
59003  *         if base_url is not None:
59004  *             doc_ref._filename = _encodeFilename(base_url)             # <<<<<<<<<<<<<<
59005  *         else:
59006  *             doc_ref._filename = _getFilenameForFile(f)
59007  */
59008     __pyx_t_3 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_base_url); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59009     __Pyx_GOTREF(__pyx_t_3);
59010     __Pyx_GIVEREF(__pyx_t_3);
59011     __Pyx_GOTREF(__pyx_v_doc_ref->_filename);
59012     __Pyx_DECREF(__pyx_v_doc_ref->_filename);
59013     __pyx_v_doc_ref->_filename = __pyx_t_3;
59014     __pyx_t_3 = 0;
59015     goto __pyx_L16;
59016   }
59017   /*else*/ {
59018
59019     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":97
59020  *             doc_ref._filename = _encodeFilename(base_url)
59021  *         else:
59022  *             doc_ref._filename = _getFilenameForFile(f)             # <<<<<<<<<<<<<<
59023  *         doc_ref._file = f
59024  *         return doc_ref
59025  */
59026     __pyx_t_3 = __pyx_f_4lxml_5etree__getFilenameForFile(__pyx_v_f); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59027     __Pyx_GOTREF(__pyx_t_3);
59028     __Pyx_GIVEREF(__pyx_t_3);
59029     __Pyx_GOTREF(__pyx_v_doc_ref->_filename);
59030     __Pyx_DECREF(__pyx_v_doc_ref->_filename);
59031     __pyx_v_doc_ref->_filename = __pyx_t_3;
59032     __pyx_t_3 = 0;
59033   }
59034   __pyx_L16:;
59035
59036   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":98
59037  *         else:
59038  *             doc_ref._filename = _getFilenameForFile(f)
59039  *         doc_ref._file = f             # <<<<<<<<<<<<<<
59040  *         return doc_ref
59041  * 
59042  */
59043   __Pyx_INCREF(__pyx_v_f);
59044   __Pyx_GIVEREF(__pyx_v_f);
59045   __Pyx_GOTREF(__pyx_v_doc_ref->_file);
59046   __Pyx_DECREF(__pyx_v_doc_ref->_file);
59047   __pyx_v_doc_ref->_file = __pyx_v_f;
59048
59049   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":99
59050  *             doc_ref._filename = _getFilenameForFile(f)
59051  *         doc_ref._file = f
59052  *         return doc_ref             # <<<<<<<<<<<<<<
59053  * 
59054  * cdef class _ResolverRegistry:
59055  */
59056   __Pyx_XDECREF(__pyx_r);
59057   __Pyx_INCREF(((PyObject *)__pyx_v_doc_ref));
59058   __pyx_r = ((PyObject *)__pyx_v_doc_ref);
59059   goto __pyx_L0;
59060
59061   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
59062   goto __pyx_L0;
59063   __pyx_L1_error:;
59064   __Pyx_XDECREF(__pyx_t_1);
59065   __Pyx_XDECREF(__pyx_t_2);
59066   __Pyx_XDECREF(__pyx_t_3);
59067   __Pyx_AddTraceback("lxml.etree.Resolver.resolve_file");
59068   __pyx_r = NULL;
59069   __pyx_L0:;
59070   __Pyx_DECREF((PyObject *)__pyx_v_doc_ref);
59071   __Pyx_XGIVEREF(__pyx_r);
59072   __Pyx_FinishRefcountContext();
59073   return __pyx_r;
59074 }
59075
59076 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":104
59077  *     cdef object _resolvers
59078  *     cdef Resolver _default_resolver
59079  *     def __init__(self, Resolver default_resolver=None):             # <<<<<<<<<<<<<<
59080  *         self._resolvers = set()
59081  *         self._default_resolver = default_resolver
59082  */
59083
59084 static int __pyx_pf_4lxml_5etree_17_ResolverRegistry___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
59085 static int __pyx_pf_4lxml_5etree_17_ResolverRegistry___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
59086   struct __pyx_obj_4lxml_5etree_Resolver *__pyx_v_default_resolver = 0;
59087   int __pyx_r;
59088   PyObject *__pyx_t_1 = NULL;
59089   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_default_resolver,0};
59090   __Pyx_SetupRefcountContext("__init__");
59091   if (unlikely(__pyx_kwds)) {
59092     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
59093     PyObject* values[1] = {0};
59094     values[0] = (PyObject*)((struct __pyx_obj_4lxml_5etree_Resolver *)Py_None);
59095     switch (PyTuple_GET_SIZE(__pyx_args)) {
59096       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
59097       case  0: break;
59098       default: goto __pyx_L5_argtuple_error;
59099     }
59100     switch (PyTuple_GET_SIZE(__pyx_args)) {
59101       case  0:
59102       if (kw_args > 1) {
59103         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_default_resolver);
59104         if (unlikely(value)) { values[0] = value; kw_args--; }
59105       }
59106     }
59107     if (unlikely(kw_args > 0)) {
59108       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
59109     }
59110     __pyx_v_default_resolver = ((struct __pyx_obj_4lxml_5etree_Resolver *)values[0]);
59111   } else {
59112     __pyx_v_default_resolver = ((struct __pyx_obj_4lxml_5etree_Resolver *)Py_None);
59113     switch (PyTuple_GET_SIZE(__pyx_args)) {
59114       case  1: __pyx_v_default_resolver = ((struct __pyx_obj_4lxml_5etree_Resolver *)PyTuple_GET_ITEM(__pyx_args, 0));
59115       case  0: break;
59116       default: goto __pyx_L5_argtuple_error;
59117     }
59118   }
59119   goto __pyx_L4_argument_unpacking_done;
59120   __pyx_L5_argtuple_error:;
59121   __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
59122   __pyx_L3_error:;
59123   __Pyx_AddTraceback("lxml.etree._ResolverRegistry.__init__");
59124   return -1;
59125   __pyx_L4_argument_unpacking_done:;
59126   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_default_resolver), __pyx_ptype_4lxml_5etree_Resolver, 1, "default_resolver", 0))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59127
59128   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":105
59129  *     cdef Resolver _default_resolver
59130  *     def __init__(self, Resolver default_resolver=None):
59131  *         self._resolvers = set()             # <<<<<<<<<<<<<<
59132  *         self._default_resolver = default_resolver
59133  * 
59134  */
59135   __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59136   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
59137   __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
59138   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self)->_resolvers);
59139   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self)->_resolvers);
59140   ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self)->_resolvers = ((PyObject *)__pyx_t_1);
59141   __pyx_t_1 = 0;
59142
59143   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":106
59144  *     def __init__(self, Resolver default_resolver=None):
59145  *         self._resolvers = set()
59146  *         self._default_resolver = default_resolver             # <<<<<<<<<<<<<<
59147  * 
59148  *     def add(self, Resolver resolver not None):
59149  */
59150   __Pyx_INCREF(((PyObject *)__pyx_v_default_resolver));
59151   __Pyx_GIVEREF(((PyObject *)__pyx_v_default_resolver));
59152   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self)->_default_resolver);
59153   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self)->_default_resolver));
59154   ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self)->_default_resolver = __pyx_v_default_resolver;
59155
59156   __pyx_r = 0;
59157   goto __pyx_L0;
59158   __pyx_L1_error:;
59159   __Pyx_XDECREF(__pyx_t_1);
59160   __Pyx_AddTraceback("lxml.etree._ResolverRegistry.__init__");
59161   __pyx_r = -1;
59162   __pyx_L0:;
59163   __Pyx_FinishRefcountContext();
59164   return __pyx_r;
59165 }
59166
59167 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":108
59168  *         self._default_resolver = default_resolver
59169  * 
59170  *     def add(self, Resolver resolver not None):             # <<<<<<<<<<<<<<
59171  *         u"""add(self, resolver)
59172  * 
59173  */
59174
59175 static PyObject *__pyx_pf_4lxml_5etree_17_ResolverRegistry_add(PyObject *__pyx_v_self, PyObject *__pyx_v_resolver); /*proto*/
59176 static char __pyx_doc_4lxml_5etree_17_ResolverRegistry_add[] = "add(self, resolver)\n\n        Register a resolver.\n\n        For each requested entity, the 'resolve' method of the resolver will\n        be called and the result will be passed to the parser.  If this method\n        returns None, the request will be delegated to other resolvers or the\n        default resolver.  The resolvers will be tested in an arbitrary order\n        until the first match is found.\n        ";
59177 static PyObject *__pyx_pf_4lxml_5etree_17_ResolverRegistry_add(PyObject *__pyx_v_self, PyObject *__pyx_v_resolver) {
59178   PyObject *__pyx_r = NULL;
59179   PyObject *__pyx_t_1 = NULL;
59180   PyObject *__pyx_t_2 = NULL;
59181   PyObject *__pyx_t_3 = NULL;
59182   __Pyx_SetupRefcountContext("add");
59183   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_resolver), __pyx_ptype_4lxml_5etree_Resolver, 0, "resolver", 0))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59184
59185   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":119
59186  *         until the first match is found.
59187  *         """
59188  *         self._resolvers.add(resolver)             # <<<<<<<<<<<<<<
59189  * 
59190  *     def remove(self, resolver):
59191  */
59192   __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self)->_resolvers, __pyx_kp_add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59193   __Pyx_GOTREF(__pyx_t_1);
59194   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59195   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
59196   __Pyx_INCREF(__pyx_v_resolver);
59197   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_resolver);
59198   __Pyx_GIVEREF(__pyx_v_resolver);
59199   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59200   __Pyx_GOTREF(__pyx_t_3);
59201   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
59202   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
59203   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59204
59205   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
59206   goto __pyx_L0;
59207   __pyx_L1_error:;
59208   __Pyx_XDECREF(__pyx_t_1);
59209   __Pyx_XDECREF(__pyx_t_2);
59210   __Pyx_XDECREF(__pyx_t_3);
59211   __Pyx_AddTraceback("lxml.etree._ResolverRegistry.add");
59212   __pyx_r = NULL;
59213   __pyx_L0:;
59214   __Pyx_XGIVEREF(__pyx_r);
59215   __Pyx_FinishRefcountContext();
59216   return __pyx_r;
59217 }
59218
59219 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":121
59220  *         self._resolvers.add(resolver)
59221  * 
59222  *     def remove(self, resolver):             # <<<<<<<<<<<<<<
59223  *         u"remove(self, resolver)"
59224  *         self._resolvers.discard(resolver)
59225  */
59226
59227 static PyObject *__pyx_pf_4lxml_5etree_17_ResolverRegistry_remove(PyObject *__pyx_v_self, PyObject *__pyx_v_resolver); /*proto*/
59228 static char __pyx_doc_4lxml_5etree_17_ResolverRegistry_remove[] = "remove(self, resolver)";
59229 static PyObject *__pyx_pf_4lxml_5etree_17_ResolverRegistry_remove(PyObject *__pyx_v_self, PyObject *__pyx_v_resolver) {
59230   PyObject *__pyx_r = NULL;
59231   PyObject *__pyx_t_1 = NULL;
59232   PyObject *__pyx_t_2 = NULL;
59233   PyObject *__pyx_t_3 = NULL;
59234   __Pyx_SetupRefcountContext("remove");
59235
59236   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":123
59237  *     def remove(self, resolver):
59238  *         u"remove(self, resolver)"
59239  *         self._resolvers.discard(resolver)             # <<<<<<<<<<<<<<
59240  * 
59241  *     cdef _ResolverRegistry _copy(self):
59242  */
59243   __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self)->_resolvers, __pyx_kp_discard); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59244   __Pyx_GOTREF(__pyx_t_1);
59245   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59246   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
59247   __Pyx_INCREF(__pyx_v_resolver);
59248   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_resolver);
59249   __Pyx_GIVEREF(__pyx_v_resolver);
59250   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59251   __Pyx_GOTREF(__pyx_t_3);
59252   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
59253   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
59254   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59255
59256   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
59257   goto __pyx_L0;
59258   __pyx_L1_error:;
59259   __Pyx_XDECREF(__pyx_t_1);
59260   __Pyx_XDECREF(__pyx_t_2);
59261   __Pyx_XDECREF(__pyx_t_3);
59262   __Pyx_AddTraceback("lxml.etree._ResolverRegistry.remove");
59263   __pyx_r = NULL;
59264   __pyx_L0:;
59265   __Pyx_XGIVEREF(__pyx_r);
59266   __Pyx_FinishRefcountContext();
59267   return __pyx_r;
59268 }
59269
59270 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":125
59271  *         self._resolvers.discard(resolver)
59272  * 
59273  *     cdef _ResolverRegistry _copy(self):             # <<<<<<<<<<<<<<
59274  *         cdef _ResolverRegistry registry
59275  *         registry = _ResolverRegistry(self._default_resolver)
59276  */
59277
59278 static  struct __pyx_obj_4lxml_5etree__ResolverRegistry *__pyx_f_4lxml_5etree_17_ResolverRegistry__copy(struct __pyx_obj_4lxml_5etree__ResolverRegistry *__pyx_v_self) {
59279   struct __pyx_obj_4lxml_5etree__ResolverRegistry *__pyx_v_registry;
59280   struct __pyx_obj_4lxml_5etree__ResolverRegistry *__pyx_r = NULL;
59281   PyObject *__pyx_t_1 = NULL;
59282   PyObject *__pyx_t_2 = NULL;
59283   __Pyx_SetupRefcountContext("_copy");
59284   __pyx_v_registry = ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)Py_None); __Pyx_INCREF(Py_None);
59285
59286   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":127
59287  *     cdef _ResolverRegistry _copy(self):
59288  *         cdef _ResolverRegistry registry
59289  *         registry = _ResolverRegistry(self._default_resolver)             # <<<<<<<<<<<<<<
59290  *         registry._resolvers = self._resolvers.copy()
59291  *         return registry
59292  */
59293   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59294   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
59295   __Pyx_INCREF(((PyObject *)__pyx_v_self->_default_resolver));
59296   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->_default_resolver));
59297   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_default_resolver));
59298   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ResolverRegistry)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59299   __Pyx_GOTREF(__pyx_t_2);
59300   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
59301   if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__ResolverRegistry))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59302   __Pyx_DECREF(((PyObject *)__pyx_v_registry));
59303   __pyx_v_registry = ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_t_2);
59304   __pyx_t_2 = 0;
59305
59306   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":128
59307  *         cdef _ResolverRegistry registry
59308  *         registry = _ResolverRegistry(self._default_resolver)
59309  *         registry._resolvers = self._resolvers.copy()             # <<<<<<<<<<<<<<
59310  *         return registry
59311  * 
59312  */
59313   __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->_resolvers, __pyx_kp_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59314   __Pyx_GOTREF(__pyx_t_2);
59315   __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59316   __Pyx_GOTREF(__pyx_t_1);
59317   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
59318   __Pyx_GIVEREF(__pyx_t_1);
59319   __Pyx_GOTREF(__pyx_v_registry->_resolvers);
59320   __Pyx_DECREF(__pyx_v_registry->_resolvers);
59321   __pyx_v_registry->_resolvers = __pyx_t_1;
59322   __pyx_t_1 = 0;
59323
59324   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":129
59325  *         registry = _ResolverRegistry(self._default_resolver)
59326  *         registry._resolvers = self._resolvers.copy()
59327  *         return registry             # <<<<<<<<<<<<<<
59328  * 
59329  *     def copy(self):
59330  */
59331   __Pyx_XDECREF(((PyObject *)__pyx_r));
59332   __Pyx_INCREF(((PyObject *)__pyx_v_registry));
59333   __pyx_r = __pyx_v_registry;
59334   goto __pyx_L0;
59335
59336   __pyx_r = ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)Py_None); __Pyx_INCREF(Py_None);
59337   goto __pyx_L0;
59338   __pyx_L1_error:;
59339   __Pyx_XDECREF(__pyx_t_1);
59340   __Pyx_XDECREF(__pyx_t_2);
59341   __Pyx_AddTraceback("lxml.etree._ResolverRegistry._copy");
59342   __pyx_r = 0;
59343   __pyx_L0:;
59344   __Pyx_DECREF((PyObject *)__pyx_v_registry);
59345   __Pyx_XGIVEREF((PyObject *)__pyx_r);
59346   __Pyx_FinishRefcountContext();
59347   return __pyx_r;
59348 }
59349
59350 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":131
59351  *         return registry
59352  * 
59353  *     def copy(self):             # <<<<<<<<<<<<<<
59354  *         u"copy(self)"
59355  *         return self._copy()
59356  */
59357
59358 static PyObject *__pyx_pf_4lxml_5etree_17_ResolverRegistry_copy(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
59359 static char __pyx_doc_4lxml_5etree_17_ResolverRegistry_copy[] = "copy(self)";
59360 static PyObject *__pyx_pf_4lxml_5etree_17_ResolverRegistry_copy(PyObject *__pyx_v_self, PyObject *unused) {
59361   PyObject *__pyx_r = NULL;
59362   PyObject *__pyx_t_1 = NULL;
59363   __Pyx_SetupRefcountContext("copy");
59364
59365   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":133
59366  *     def copy(self):
59367  *         u"copy(self)"
59368  *         return self._copy()             # <<<<<<<<<<<<<<
59369  * 
59370  *     def resolve(self, system_url, public_id, context):
59371  */
59372   __Pyx_XDECREF(__pyx_r);
59373   __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__ResolverRegistry *)((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self)->__pyx_vtab)->_copy(((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59374   __Pyx_GOTREF(__pyx_t_1);
59375   __pyx_r = __pyx_t_1;
59376   __pyx_t_1 = 0;
59377   goto __pyx_L0;
59378
59379   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
59380   goto __pyx_L0;
59381   __pyx_L1_error:;
59382   __Pyx_XDECREF(__pyx_t_1);
59383   __Pyx_AddTraceback("lxml.etree._ResolverRegistry.copy");
59384   __pyx_r = NULL;
59385   __pyx_L0:;
59386   __Pyx_XGIVEREF(__pyx_r);
59387   __Pyx_FinishRefcountContext();
59388   return __pyx_r;
59389 }
59390
59391 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":135
59392  *         return self._copy()
59393  * 
59394  *     def resolve(self, system_url, public_id, context):             # <<<<<<<<<<<<<<
59395  *         u"resolve(self, system_url, public_id, context)"
59396  *         for resolver in self._resolvers:
59397  */
59398
59399 static PyObject *__pyx_pf_4lxml_5etree_17_ResolverRegistry_resolve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
59400 static char __pyx_doc_4lxml_5etree_17_ResolverRegistry_resolve[] = "resolve(self, system_url, public_id, context)";
59401 static PyObject *__pyx_pf_4lxml_5etree_17_ResolverRegistry_resolve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
59402   PyObject *__pyx_v_system_url = 0;
59403   PyObject *__pyx_v_public_id = 0;
59404   PyObject *__pyx_v_context = 0;
59405   PyObject *__pyx_v_resolver;
59406   PyObject *__pyx_v_result;
59407   PyObject *__pyx_r = NULL;
59408   Py_ssize_t __pyx_t_1;
59409   PyObject *__pyx_t_2 = NULL;
59410   PyObject *__pyx_t_3 = NULL;
59411   PyObject *__pyx_t_4 = NULL;
59412   PyObject *__pyx_t_5 = NULL;
59413   int __pyx_t_6;
59414   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_system_url,&__pyx_kp_public_id,&__pyx_kp_context,0};
59415   __Pyx_SetupRefcountContext("resolve");
59416   if (unlikely(__pyx_kwds)) {
59417     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
59418     PyObject* values[3] = {0,0,0};
59419     switch (PyTuple_GET_SIZE(__pyx_args)) {
59420       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
59421       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
59422       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
59423       case  0: break;
59424       default: goto __pyx_L5_argtuple_error;
59425     }
59426     switch (PyTuple_GET_SIZE(__pyx_args)) {
59427       case  0:
59428       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_system_url);
59429       if (likely(values[0])) kw_args--;
59430       else goto __pyx_L5_argtuple_error;
59431       case  1:
59432       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_public_id);
59433       if (likely(values[1])) kw_args--;
59434       else {
59435         __Pyx_RaiseArgtupleInvalid("resolve", 1, 3, 3, 1); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
59436       }
59437       case  2:
59438       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_context);
59439       if (likely(values[2])) kw_args--;
59440       else {
59441         __Pyx_RaiseArgtupleInvalid("resolve", 1, 3, 3, 2); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
59442       }
59443     }
59444     if (unlikely(kw_args > 0)) {
59445       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "resolve") < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
59446     }
59447     __pyx_v_system_url = values[0];
59448     __pyx_v_public_id = values[1];
59449     __pyx_v_context = values[2];
59450   } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
59451     goto __pyx_L5_argtuple_error;
59452   } else {
59453     __pyx_v_system_url = PyTuple_GET_ITEM(__pyx_args, 0);
59454     __pyx_v_public_id = PyTuple_GET_ITEM(__pyx_args, 1);
59455     __pyx_v_context = PyTuple_GET_ITEM(__pyx_args, 2);
59456   }
59457   goto __pyx_L4_argument_unpacking_done;
59458   __pyx_L5_argtuple_error:;
59459   __Pyx_RaiseArgtupleInvalid("resolve", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[11]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
59460   __pyx_L3_error:;
59461   __Pyx_AddTraceback("lxml.etree._ResolverRegistry.resolve");
59462   return NULL;
59463   __pyx_L4_argument_unpacking_done:;
59464   __pyx_v_resolver = Py_None; __Pyx_INCREF(Py_None);
59465   __pyx_v_result = Py_None; __Pyx_INCREF(Py_None);
59466
59467   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":137
59468  *     def resolve(self, system_url, public_id, context):
59469  *         u"resolve(self, system_url, public_id, context)"
59470  *         for resolver in self._resolvers:             # <<<<<<<<<<<<<<
59471  *             result = resolver.resolve(system_url, public_id, context)
59472  *             if result is not None:
59473  */
59474   if (PyList_CheckExact(((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self)->_resolvers) || PyTuple_CheckExact(((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self)->_resolvers)) {
59475     __pyx_t_1 = 0; __pyx_t_2 = ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self)->_resolvers; __Pyx_INCREF(__pyx_t_2);
59476   } else {
59477     __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self)->_resolvers); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59478     __Pyx_GOTREF(__pyx_t_2);
59479   }
59480   for (;;) {
59481     if (likely(PyList_CheckExact(__pyx_t_2))) {
59482       if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break;
59483       __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
59484     } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
59485       if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
59486       __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
59487     } else {
59488       __pyx_t_3 = PyIter_Next(__pyx_t_2);
59489       if (!__pyx_t_3) {
59490         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59491         break;
59492       }
59493       __Pyx_GOTREF(__pyx_t_3);
59494     }
59495     __Pyx_DECREF(__pyx_v_resolver);
59496     __pyx_v_resolver = __pyx_t_3;
59497     __pyx_t_3 = 0;
59498
59499     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":138
59500  *         u"resolve(self, system_url, public_id, context)"
59501  *         for resolver in self._resolvers:
59502  *             result = resolver.resolve(system_url, public_id, context)             # <<<<<<<<<<<<<<
59503  *             if result is not None:
59504  *                 return result
59505  */
59506     __pyx_t_3 = PyObject_GetAttr(__pyx_v_resolver, __pyx_kp_resolve); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59507     __Pyx_GOTREF(__pyx_t_3);
59508     __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59509     __Pyx_GOTREF(((PyObject *)__pyx_t_4));
59510     __Pyx_INCREF(__pyx_v_system_url);
59511     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_system_url);
59512     __Pyx_GIVEREF(__pyx_v_system_url);
59513     __Pyx_INCREF(__pyx_v_public_id);
59514     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_public_id);
59515     __Pyx_GIVEREF(__pyx_v_public_id);
59516     __Pyx_INCREF(__pyx_v_context);
59517     PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_context);
59518     __Pyx_GIVEREF(__pyx_v_context);
59519     __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59520     __Pyx_GOTREF(__pyx_t_5);
59521     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59522     __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
59523     __Pyx_DECREF(__pyx_v_result);
59524     __pyx_v_result = __pyx_t_5;
59525     __pyx_t_5 = 0;
59526
59527     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":139
59528  *         for resolver in self._resolvers:
59529  *             result = resolver.resolve(system_url, public_id, context)
59530  *             if result is not None:             # <<<<<<<<<<<<<<
59531  *                 return result
59532  *         if self._default_resolver is None:
59533  */
59534     __pyx_t_6 = (__pyx_v_result != Py_None);
59535     if (__pyx_t_6) {
59536
59537       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":140
59538  *             result = resolver.resolve(system_url, public_id, context)
59539  *             if result is not None:
59540  *                 return result             # <<<<<<<<<<<<<<
59541  *         if self._default_resolver is None:
59542  *             return None
59543  */
59544       __Pyx_XDECREF(__pyx_r);
59545       __Pyx_INCREF(__pyx_v_result);
59546       __pyx_r = __pyx_v_result;
59547       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
59548       goto __pyx_L0;
59549       goto __pyx_L8;
59550     }
59551     __pyx_L8:;
59552   }
59553   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
59554
59555   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":141
59556  *             if result is not None:
59557  *                 return result
59558  *         if self._default_resolver is None:             # <<<<<<<<<<<<<<
59559  *             return None
59560  *         return self._default_resolver.resolve(system_url, public_id, context)
59561  */
59562   __pyx_t_6 = (((PyObject *)((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self)->_default_resolver) == Py_None);
59563   if (__pyx_t_6) {
59564
59565     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":142
59566  *                 return result
59567  *         if self._default_resolver is None:
59568  *             return None             # <<<<<<<<<<<<<<
59569  *         return self._default_resolver.resolve(system_url, public_id, context)
59570  * 
59571  */
59572     __Pyx_XDECREF(__pyx_r);
59573     __Pyx_INCREF(Py_None);
59574     __pyx_r = Py_None;
59575     goto __pyx_L0;
59576     goto __pyx_L9;
59577   }
59578   __pyx_L9:;
59579
59580   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":143
59581  *         if self._default_resolver is None:
59582  *             return None
59583  *         return self._default_resolver.resolve(system_url, public_id, context)             # <<<<<<<<<<<<<<
59584  * 
59585  *     def __repr__(self):
59586  */
59587   __Pyx_XDECREF(__pyx_r);
59588   __pyx_t_2 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self)->_default_resolver), __pyx_kp_resolve); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59589   __Pyx_GOTREF(__pyx_t_2);
59590   __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59591   __Pyx_GOTREF(((PyObject *)__pyx_t_5));
59592   __Pyx_INCREF(__pyx_v_system_url);
59593   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_system_url);
59594   __Pyx_GIVEREF(__pyx_v_system_url);
59595   __Pyx_INCREF(__pyx_v_public_id);
59596   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_public_id);
59597   __Pyx_GIVEREF(__pyx_v_public_id);
59598   __Pyx_INCREF(__pyx_v_context);
59599   PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_context);
59600   __Pyx_GIVEREF(__pyx_v_context);
59601   __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59602   __Pyx_GOTREF(__pyx_t_4);
59603   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
59604   __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
59605   __pyx_r = __pyx_t_4;
59606   __pyx_t_4 = 0;
59607   goto __pyx_L0;
59608
59609   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
59610   goto __pyx_L0;
59611   __pyx_L1_error:;
59612   __Pyx_XDECREF(__pyx_t_2);
59613   __Pyx_XDECREF(__pyx_t_3);
59614   __Pyx_XDECREF(__pyx_t_4);
59615   __Pyx_XDECREF(__pyx_t_5);
59616   __Pyx_AddTraceback("lxml.etree._ResolverRegistry.resolve");
59617   __pyx_r = NULL;
59618   __pyx_L0:;
59619   __Pyx_DECREF(__pyx_v_resolver);
59620   __Pyx_DECREF(__pyx_v_result);
59621   __Pyx_XGIVEREF(__pyx_r);
59622   __Pyx_FinishRefcountContext();
59623   return __pyx_r;
59624 }
59625
59626 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":145
59627  *         return self._default_resolver.resolve(system_url, public_id, context)
59628  * 
59629  *     def __repr__(self):             # <<<<<<<<<<<<<<
59630  *         return repr(self._resolvers)
59631  * 
59632  */
59633
59634 static PyObject *__pyx_pf_4lxml_5etree_17_ResolverRegistry___repr__(PyObject *__pyx_v_self); /*proto*/
59635 static PyObject *__pyx_pf_4lxml_5etree_17_ResolverRegistry___repr__(PyObject *__pyx_v_self) {
59636   PyObject *__pyx_r = NULL;
59637   PyObject *__pyx_t_1 = NULL;
59638   __Pyx_SetupRefcountContext("__repr__");
59639
59640   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":146
59641  * 
59642  *     def __repr__(self):
59643  *         return repr(self._resolvers)             # <<<<<<<<<<<<<<
59644  * 
59645  * cdef class _ResolverContext(_ExceptionContext):
59646  */
59647   __Pyx_XDECREF(__pyx_r);
59648   __pyx_t_1 = PyObject_Repr(((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self)->_resolvers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59649   __Pyx_GOTREF(__pyx_t_1);
59650   __pyx_r = __pyx_t_1;
59651   __pyx_t_1 = 0;
59652   goto __pyx_L0;
59653
59654   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
59655   goto __pyx_L0;
59656   __pyx_L1_error:;
59657   __Pyx_XDECREF(__pyx_t_1);
59658   __Pyx_AddTraceback("lxml.etree._ResolverRegistry.__repr__");
59659   __pyx_r = NULL;
59660   __pyx_L0:;
59661   __Pyx_XGIVEREF(__pyx_r);
59662   __Pyx_FinishRefcountContext();
59663   return __pyx_r;
59664 }
59665
59666 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":152
59667  *     cdef _TempStore _storage
59668  * 
59669  *     cdef void clear(self):             # <<<<<<<<<<<<<<
59670  *         _ExceptionContext.clear(self)
59671  *         self._storage.clear()
59672  */
59673
59674 static  void __pyx_f_4lxml_5etree_16_ResolverContext_clear(struct __pyx_obj_4lxml_5etree__ResolverContext *__pyx_v_self) {
59675   int __pyx_t_1;
59676   __Pyx_SetupRefcountContext("clear");
59677
59678   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":153
59679  * 
59680  *     cdef void clear(self):
59681  *         _ExceptionContext.clear(self)             # <<<<<<<<<<<<<<
59682  *         self._storage.clear()
59683  * 
59684  */
59685   __pyx_vtabptr_4lxml_5etree__ExceptionContext->clear(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_self));
59686
59687   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":154
59688  *     cdef void clear(self):
59689  *         _ExceptionContext.clear(self)
59690  *         self._storage.clear()             # <<<<<<<<<<<<<<
59691  * 
59692  * cdef _initResolverContext(_ResolverContext context,
59693  */
59694   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__TempStore *)__pyx_v_self->_storage->__pyx_vtab)->clear(__pyx_v_self->_storage); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59695
59696   goto __pyx_L0;
59697   __pyx_L1_error:;
59698   __Pyx_WriteUnraisable("lxml.etree._ResolverContext.clear");
59699   __pyx_L0:;
59700   __Pyx_FinishRefcountContext();
59701 }
59702
59703 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":156
59704  *         self._storage.clear()
59705  * 
59706  * cdef _initResolverContext(_ResolverContext context,             # <<<<<<<<<<<<<<
59707  *                           _ResolverRegistry resolvers):
59708  *     if resolvers is None:
59709  */
59710
59711 static  PyObject *__pyx_f_4lxml_5etree__initResolverContext(struct __pyx_obj_4lxml_5etree__ResolverContext *__pyx_v_context, struct __pyx_obj_4lxml_5etree__ResolverRegistry *__pyx_v_resolvers) {
59712   PyObject *__pyx_r = NULL;
59713   int __pyx_t_1;
59714   PyObject *__pyx_t_2 = NULL;
59715   __Pyx_SetupRefcountContext("_initResolverContext");
59716
59717   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":158
59718  * cdef _initResolverContext(_ResolverContext context,
59719  *                           _ResolverRegistry resolvers):
59720  *     if resolvers is None:             # <<<<<<<<<<<<<<
59721  *         context._resolvers = _ResolverRegistry()
59722  *     else:
59723  */
59724   __pyx_t_1 = (((PyObject *)__pyx_v_resolvers) == Py_None);
59725   if (__pyx_t_1) {
59726
59727     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":159
59728  *                           _ResolverRegistry resolvers):
59729  *     if resolvers is None:
59730  *         context._resolvers = _ResolverRegistry()             # <<<<<<<<<<<<<<
59731  *     else:
59732  *         context._resolvers = resolvers
59733  */
59734     __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ResolverRegistry)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59735     __Pyx_GOTREF(__pyx_t_2);
59736     if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__ResolverRegistry))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59737     __Pyx_GIVEREF(__pyx_t_2);
59738     __Pyx_GOTREF(__pyx_v_context->_resolvers);
59739     __Pyx_DECREF(((PyObject *)__pyx_v_context->_resolvers));
59740     __pyx_v_context->_resolvers = ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_t_2);
59741     __pyx_t_2 = 0;
59742     goto __pyx_L3;
59743   }
59744   /*else*/ {
59745
59746     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":161
59747  *         context._resolvers = _ResolverRegistry()
59748  *     else:
59749  *         context._resolvers = resolvers             # <<<<<<<<<<<<<<
59750  *     context._storage = _TempStore()
59751  */
59752     __Pyx_INCREF(((PyObject *)__pyx_v_resolvers));
59753     __Pyx_GIVEREF(((PyObject *)__pyx_v_resolvers));
59754     __Pyx_GOTREF(__pyx_v_context->_resolvers);
59755     __Pyx_DECREF(((PyObject *)__pyx_v_context->_resolvers));
59756     __pyx_v_context->_resolvers = __pyx_v_resolvers;
59757   }
59758   __pyx_L3:;
59759
59760   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/docloader.pxi":162
59761  *     else:
59762  *         context._resolvers = resolvers
59763  *     context._storage = _TempStore()             # <<<<<<<<<<<<<<
59764  */
59765   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__TempStore)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59766   __Pyx_GOTREF(__pyx_t_2);
59767   if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__TempStore))) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59768   __Pyx_GIVEREF(__pyx_t_2);
59769   __Pyx_GOTREF(__pyx_v_context->_storage);
59770   __Pyx_DECREF(((PyObject *)__pyx_v_context->_storage));
59771   __pyx_v_context->_storage = ((struct __pyx_obj_4lxml_5etree__TempStore *)__pyx_t_2);
59772   __pyx_t_2 = 0;
59773
59774   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
59775   goto __pyx_L0;
59776   __pyx_L1_error:;
59777   __Pyx_XDECREF(__pyx_t_2);
59778   __Pyx_AddTraceback("lxml.etree._initResolverContext");
59779   __pyx_r = 0;
59780   __pyx_L0:;
59781   __Pyx_XGIVEREF(__pyx_r);
59782   __Pyx_FinishRefcountContext();
59783   return __pyx_r;
59784 }
59785
59786 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":23
59787  *     u"""Syntax error while parsing an XML document.
59788  *     """
59789  *     def __init__(self, message, code, line, column):             # <<<<<<<<<<<<<<
59790  *         if python.PY_VERSION_HEX >= 0x02050000:
59791  *             # Python >= 2.5 uses new style class exceptions
59792  */
59793
59794 static PyObject *__pyx_pf_4lxml_5etree_14XMLSyntaxError___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
59795 static PyMethodDef __pyx_mdef_4lxml_5etree_14XMLSyntaxError___init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pf_4lxml_5etree_14XMLSyntaxError___init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
59796 static PyObject *__pyx_pf_4lxml_5etree_14XMLSyntaxError___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
59797   PyObject *__pyx_v_self = 0;
59798   PyObject *__pyx_v_message = 0;
59799   PyObject *__pyx_v_code = 0;
59800   PyObject *__pyx_v_line = 0;
59801   PyObject *__pyx_v_column = 0;
59802   PyObject *__pyx_r = NULL;
59803   PyObject *__pyx_1 = 0;
59804   int __pyx_t_1;
59805   PyObject *__pyx_t_2 = NULL;
59806   PyObject *__pyx_t_3 = NULL;
59807   PyObject *__pyx_t_4 = NULL;
59808   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_self,&__pyx_kp_message,&__pyx_kp_code,&__pyx_kp_line,&__pyx_kp_column,0};
59809   __Pyx_SetupRefcountContext("__init__");
59810   __pyx_self = __pyx_self;
59811   if (unlikely(__pyx_kwds)) {
59812     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
59813     PyObject* values[5] = {0,0,0,0,0};
59814     switch (PyTuple_GET_SIZE(__pyx_args)) {
59815       case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
59816       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
59817       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
59818       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
59819       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
59820       case  0: break;
59821       default: goto __pyx_L5_argtuple_error;
59822     }
59823     switch (PyTuple_GET_SIZE(__pyx_args)) {
59824       case  0:
59825       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_self);
59826       if (likely(values[0])) kw_args--;
59827       else goto __pyx_L5_argtuple_error;
59828       case  1:
59829       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_message);
59830       if (likely(values[1])) kw_args--;
59831       else {
59832         __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
59833       }
59834       case  2:
59835       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_code);
59836       if (likely(values[2])) kw_args--;
59837       else {
59838         __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
59839       }
59840       case  3:
59841       values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_line);
59842       if (likely(values[3])) kw_args--;
59843       else {
59844         __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
59845       }
59846       case  4:
59847       values[4] = PyDict_GetItem(__pyx_kwds, __pyx_kp_column);
59848       if (likely(values[4])) kw_args--;
59849       else {
59850         __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
59851       }
59852     }
59853     if (unlikely(kw_args > 0)) {
59854       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
59855     }
59856     __pyx_v_self = values[0];
59857     __pyx_v_message = values[1];
59858     __pyx_v_code = values[2];
59859     __pyx_v_line = values[3];
59860     __pyx_v_column = values[4];
59861   } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
59862     goto __pyx_L5_argtuple_error;
59863   } else {
59864     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
59865     __pyx_v_message = PyTuple_GET_ITEM(__pyx_args, 1);
59866     __pyx_v_code = PyTuple_GET_ITEM(__pyx_args, 2);
59867     __pyx_v_line = PyTuple_GET_ITEM(__pyx_args, 3);
59868     __pyx_v_column = PyTuple_GET_ITEM(__pyx_args, 4);
59869   }
59870   goto __pyx_L4_argument_unpacking_done;
59871   __pyx_L5_argtuple_error:;
59872   __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
59873   __pyx_L3_error:;
59874   __Pyx_AddTraceback("lxml.etree.XMLSyntaxError.__init__");
59875   return NULL;
59876   __pyx_L4_argument_unpacking_done:;
59877
59878   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":24
59879  *     """
59880  *     def __init__(self, message, code, line, column):
59881  *         if python.PY_VERSION_HEX >= 0x02050000:             # <<<<<<<<<<<<<<
59882  *             # Python >= 2.5 uses new style class exceptions
59883  *             super(_XMLSyntaxError, self).__init__(message)
59884  */
59885   __pyx_t_1 = (PY_VERSION_HEX >= 0x02050000);
59886   if (__pyx_t_1) {
59887
59888     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":26
59889  *         if python.PY_VERSION_HEX >= 0x02050000:
59890  *             # Python >= 2.5 uses new style class exceptions
59891  *             super(_XMLSyntaxError, self).__init__(message)             # <<<<<<<<<<<<<<
59892  *         else:
59893  *             ParseError.__init__(self, message)
59894  */
59895     __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59896     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
59897     __Pyx_INCREF(__pyx_v_4lxml_5etree__XMLSyntaxError);
59898     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_4lxml_5etree__XMLSyntaxError);
59899     __Pyx_GIVEREF(__pyx_v_4lxml_5etree__XMLSyntaxError);
59900     __Pyx_INCREF(__pyx_v_self);
59901     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self);
59902     __Pyx_GIVEREF(__pyx_v_self);
59903     __pyx_t_3 = PyObject_Call(__pyx_builtin_super, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59904     __Pyx_GOTREF(__pyx_t_3);
59905     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
59906     __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_kp___init__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59907     __Pyx_GOTREF(__pyx_t_2);
59908     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
59909     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59910     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
59911     __Pyx_INCREF(__pyx_v_message);
59912     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_message);
59913     __Pyx_GIVEREF(__pyx_v_message);
59914     __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59915     __Pyx_GOTREF(__pyx_t_4);
59916     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
59917     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
59918     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
59919     goto __pyx_L6;
59920   }
59921   /*else*/ {
59922
59923     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":28
59924  *             super(_XMLSyntaxError, self).__init__(message)
59925  *         else:
59926  *             ParseError.__init__(self, message)             # <<<<<<<<<<<<<<
59927  *         self.position = (line, column)
59928  *         self.code = code
59929  */
59930     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ParseError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59931     __Pyx_GOTREF(__pyx_1);
59932     __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp___init__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59933     __Pyx_GOTREF(__pyx_t_4);
59934     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
59935     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59936     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
59937     __Pyx_INCREF(__pyx_v_self);
59938     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self);
59939     __Pyx_GIVEREF(__pyx_v_self);
59940     __Pyx_INCREF(__pyx_v_message);
59941     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_message);
59942     __Pyx_GIVEREF(__pyx_v_message);
59943     __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59944     __Pyx_GOTREF(__pyx_t_2);
59945     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
59946     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
59947     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
59948   }
59949   __pyx_L6:;
59950
59951   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":29
59952  *         else:
59953  *             ParseError.__init__(self, message)
59954  *         self.position = (line, column)             # <<<<<<<<<<<<<<
59955  *         self.code = code
59956  * 
59957  */
59958   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59959   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
59960   __Pyx_INCREF(__pyx_v_line);
59961   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_line);
59962   __Pyx_GIVEREF(__pyx_v_line);
59963   __Pyx_INCREF(__pyx_v_column);
59964   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_column);
59965   __Pyx_GIVEREF(__pyx_v_column);
59966   if (PyObject_SetAttr(__pyx_v_self, __pyx_kp_position, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59967   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
59968
59969   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":30
59970  *             ParseError.__init__(self, message)
59971  *         self.position = (line, column)
59972  *         self.code = code             # <<<<<<<<<<<<<<
59973  * 
59974  * cdef object _XMLSyntaxError
59975  */
59976   if (PyObject_SetAttr(__pyx_v_self, __pyx_kp_code, __pyx_v_code) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59977
59978   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
59979   goto __pyx_L0;
59980   __pyx_L1_error:;
59981   __Pyx_XDECREF(__pyx_1);
59982   __Pyx_XDECREF(__pyx_t_2);
59983   __Pyx_XDECREF(__pyx_t_3);
59984   __Pyx_XDECREF(__pyx_t_4);
59985   __Pyx_AddTraceback("lxml.etree.XMLSyntaxError.__init__");
59986   __pyx_r = NULL;
59987   __pyx_L0:;
59988   __Pyx_XGIVEREF(__pyx_r);
59989   __Pyx_FinishRefcountContext();
59990   return __pyx_r;
59991 }
59992
59993 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":54
59994  *     cdef list _implied_parser_contexts
59995  * 
59996  *     def __init__(self):             # <<<<<<<<<<<<<<
59997  *         self._implied_parser_contexts = []
59998  * 
59999  */
60000
60001 static int __pyx_pf_4lxml_5etree_24_ParserDictionaryContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
60002 static int __pyx_pf_4lxml_5etree_24_ParserDictionaryContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
60003   int __pyx_r;
60004   PyObject *__pyx_t_1 = NULL;
60005   __Pyx_SetupRefcountContext("__init__");
60006   if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
60007     __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
60008   if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
60009
60010   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":55
60011  * 
60012  *     def __init__(self):
60013  *         self._implied_parser_contexts = []             # <<<<<<<<<<<<<<
60014  * 
60015  *     def __dealloc__(self):
60016  */
60017   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60018   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
60019   __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
60020   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)__pyx_v_self)->_implied_parser_contexts);
60021   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)__pyx_v_self)->_implied_parser_contexts));
60022   ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)__pyx_v_self)->_implied_parser_contexts = __pyx_t_1;
60023   __pyx_t_1 = 0;
60024
60025   __pyx_r = 0;
60026   goto __pyx_L0;
60027   __pyx_L1_error:;
60028   __Pyx_XDECREF(__pyx_t_1);
60029   __Pyx_AddTraceback("lxml.etree._ParserDictionaryContext.__init__");
60030   __pyx_r = -1;
60031   __pyx_L0:;
60032   __Pyx_FinishRefcountContext();
60033   return __pyx_r;
60034 }
60035
60036 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":57
60037  *         self._implied_parser_contexts = []
60038  * 
60039  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
60040  *         if self._c_dict is not NULL:
60041  *             xmlparser.xmlDictFree(self._c_dict)
60042  */
60043
60044 static void __pyx_pf_4lxml_5etree_24_ParserDictionaryContext___dealloc__(PyObject *__pyx_v_self); /*proto*/
60045 static void __pyx_pf_4lxml_5etree_24_ParserDictionaryContext___dealloc__(PyObject *__pyx_v_self) {
60046   int __pyx_t_1;
60047   __Pyx_SetupRefcountContext("__dealloc__");
60048
60049   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":58
60050  * 
60051  *     def __dealloc__(self):
60052  *         if self._c_dict is not NULL:             # <<<<<<<<<<<<<<
60053  *             xmlparser.xmlDictFree(self._c_dict)
60054  * 
60055  */
60056   __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)__pyx_v_self)->_c_dict != NULL);
60057   if (__pyx_t_1) {
60058
60059     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":59
60060  *     def __dealloc__(self):
60061  *         if self._c_dict is not NULL:
60062  *             xmlparser.xmlDictFree(self._c_dict)             # <<<<<<<<<<<<<<
60063  * 
60064  *     cdef void initMainParserContext(self):
60065  */
60066     xmlDictFree(((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)__pyx_v_self)->_c_dict);
60067     goto __pyx_L5;
60068   }
60069   __pyx_L5:;
60070
60071   __Pyx_FinishRefcountContext();
60072 }
60073
60074 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":61
60075  *             xmlparser.xmlDictFree(self._c_dict)
60076  * 
60077  *     cdef void initMainParserContext(self):             # <<<<<<<<<<<<<<
60078  *         u"""Put the global context into the thread dictionary of the main
60079  *         thread.  To be called once and only in the main thread."""
60080  */
60081
60082 static  void __pyx_f_4lxml_5etree_24_ParserDictionaryContext_initMainParserContext(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_self) {
60083   PyObject *__pyx_v_thread_dict;
60084   int __pyx_t_1;
60085   __Pyx_SetupRefcountContext("initMainParserContext");
60086
60087   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":66
60088  *         cdef python.PyObject* thread_dict
60089  *         cdef python.PyObject* result
60090  *         thread_dict = python.PyThreadState_GetDict()             # <<<<<<<<<<<<<<
60091  *         if thread_dict is not NULL:
60092  *             (<object>thread_dict)[u"_ParserDictionaryContext"] = self
60093  */
60094   __pyx_v_thread_dict = PyThreadState_GetDict();
60095
60096   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":67
60097  *         cdef python.PyObject* result
60098  *         thread_dict = python.PyThreadState_GetDict()
60099  *         if thread_dict is not NULL:             # <<<<<<<<<<<<<<
60100  *             (<object>thread_dict)[u"_ParserDictionaryContext"] = self
60101  * 
60102  */
60103   __pyx_t_1 = (__pyx_v_thread_dict != NULL);
60104   if (__pyx_t_1) {
60105
60106     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":68
60107  *         thread_dict = python.PyThreadState_GetDict()
60108  *         if thread_dict is not NULL:
60109  *             (<object>thread_dict)[u"_ParserDictionaryContext"] = self             # <<<<<<<<<<<<<<
60110  * 
60111  *     cdef _ParserDictionaryContext _findThreadParserContext(self):
60112  */
60113     if (PyObject_SetItem(((PyObject *)__pyx_v_thread_dict), ((PyObject *)__pyx_kp_426), ((PyObject *)__pyx_v_self)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60114     goto __pyx_L3;
60115   }
60116   __pyx_L3:;
60117
60118   goto __pyx_L0;
60119   __pyx_L1_error:;
60120   __Pyx_WriteUnraisable("lxml.etree._ParserDictionaryContext.initMainParserContext");
60121   __pyx_L0:;
60122   __Pyx_FinishRefcountContext();
60123 }
60124
60125 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":70
60126  *             (<object>thread_dict)[u"_ParserDictionaryContext"] = self
60127  * 
60128  *     cdef _ParserDictionaryContext _findThreadParserContext(self):             # <<<<<<<<<<<<<<
60129  *         u"Find (or create) the _ParserDictionaryContext object for the current thread"
60130  *         cdef python.PyObject* thread_dict
60131  */
60132
60133 static  struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_f_4lxml_5etree_24_ParserDictionaryContext__findThreadParserContext(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_self) {
60134   PyObject *__pyx_v_thread_dict;
60135   PyObject *__pyx_v_result;
60136   struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_context;
60137   PyObject *__pyx_v_d;
60138   struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_r = NULL;
60139   int __pyx_t_1;
60140   PyObject *__pyx_t_2 = NULL;
60141   __Pyx_SetupRefcountContext("_findThreadParserContext");
60142   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)Py_None); __Pyx_INCREF(Py_None);
60143   __pyx_v_d = Py_None; __Pyx_INCREF(Py_None);
60144
60145   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":75
60146  *         cdef python.PyObject* result
60147  *         cdef _ParserDictionaryContext context
60148  *         thread_dict = python.PyThreadState_GetDict()             # <<<<<<<<<<<<<<
60149  *         if thread_dict is NULL:
60150  *             return self
60151  */
60152   __pyx_v_thread_dict = PyThreadState_GetDict();
60153
60154   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":76
60155  *         cdef _ParserDictionaryContext context
60156  *         thread_dict = python.PyThreadState_GetDict()
60157  *         if thread_dict is NULL:             # <<<<<<<<<<<<<<
60158  *             return self
60159  *         d = <object>thread_dict
60160  */
60161   __pyx_t_1 = (__pyx_v_thread_dict == NULL);
60162   if (__pyx_t_1) {
60163
60164     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":77
60165  *         thread_dict = python.PyThreadState_GetDict()
60166  *         if thread_dict is NULL:
60167  *             return self             # <<<<<<<<<<<<<<
60168  *         d = <object>thread_dict
60169  *         result = python.PyDict_GetItem(d, u"_ParserDictionaryContext")
60170  */
60171     __Pyx_XDECREF(((PyObject *)__pyx_r));
60172     __Pyx_INCREF(((PyObject *)__pyx_v_self));
60173     __pyx_r = __pyx_v_self;
60174     goto __pyx_L0;
60175     goto __pyx_L3;
60176   }
60177   __pyx_L3:;
60178
60179   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":78
60180  *         if thread_dict is NULL:
60181  *             return self
60182  *         d = <object>thread_dict             # <<<<<<<<<<<<<<
60183  *         result = python.PyDict_GetItem(d, u"_ParserDictionaryContext")
60184  *         if result is not NULL:
60185  */
60186   __Pyx_INCREF(((PyObject *)__pyx_v_thread_dict));
60187   __Pyx_DECREF(__pyx_v_d);
60188   __pyx_v_d = ((PyObject *)__pyx_v_thread_dict);
60189
60190   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":79
60191  *             return self
60192  *         d = <object>thread_dict
60193  *         result = python.PyDict_GetItem(d, u"_ParserDictionaryContext")             # <<<<<<<<<<<<<<
60194  *         if result is not NULL:
60195  *             return <object>result
60196  */
60197   __pyx_v_result = PyDict_GetItem(__pyx_v_d, ((PyObject *)__pyx_kp_427));
60198
60199   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":80
60200  *         d = <object>thread_dict
60201  *         result = python.PyDict_GetItem(d, u"_ParserDictionaryContext")
60202  *         if result is not NULL:             # <<<<<<<<<<<<<<
60203  *             return <object>result
60204  *         context = _ParserDictionaryContext()
60205  */
60206   __pyx_t_1 = (__pyx_v_result != NULL);
60207   if (__pyx_t_1) {
60208
60209     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":81
60210  *         result = python.PyDict_GetItem(d, u"_ParserDictionaryContext")
60211  *         if result is not NULL:
60212  *             return <object>result             # <<<<<<<<<<<<<<
60213  *         context = _ParserDictionaryContext()
60214  *         d[u"_ParserDictionaryContext"] = context
60215  */
60216     __Pyx_XDECREF(((PyObject *)__pyx_r));
60217     if (!(__Pyx_TypeTest(((PyObject *)__pyx_v_result), __pyx_ptype_4lxml_5etree__ParserDictionaryContext))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60218     __Pyx_INCREF(((PyObject *)__pyx_v_result));
60219     __pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)((PyObject *)__pyx_v_result));
60220     goto __pyx_L0;
60221     goto __pyx_L4;
60222   }
60223   __pyx_L4:;
60224
60225   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":82
60226  *         if result is not NULL:
60227  *             return <object>result
60228  *         context = _ParserDictionaryContext()             # <<<<<<<<<<<<<<
60229  *         d[u"_ParserDictionaryContext"] = context
60230  *         return context
60231  */
60232   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ParserDictionaryContext)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60233   __Pyx_GOTREF(__pyx_t_2);
60234   if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__ParserDictionaryContext))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60235   __Pyx_DECREF(((PyObject *)__pyx_v_context));
60236   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)__pyx_t_2);
60237   __pyx_t_2 = 0;
60238
60239   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":83
60240  *             return <object>result
60241  *         context = _ParserDictionaryContext()
60242  *         d[u"_ParserDictionaryContext"] = context             # <<<<<<<<<<<<<<
60243  *         return context
60244  * 
60245  */
60246   if (PyObject_SetItem(__pyx_v_d, ((PyObject *)__pyx_kp_428), ((PyObject *)__pyx_v_context)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60247
60248   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":84
60249  *         context = _ParserDictionaryContext()
60250  *         d[u"_ParserDictionaryContext"] = context
60251  *         return context             # <<<<<<<<<<<<<<
60252  * 
60253  *     cdef void setDefaultParser(self, _BaseParser parser):
60254  */
60255   __Pyx_XDECREF(((PyObject *)__pyx_r));
60256   __Pyx_INCREF(((PyObject *)__pyx_v_context));
60257   __pyx_r = __pyx_v_context;
60258   goto __pyx_L0;
60259
60260   __pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)Py_None); __Pyx_INCREF(Py_None);
60261   goto __pyx_L0;
60262   __pyx_L1_error:;
60263   __Pyx_XDECREF(__pyx_t_2);
60264   __Pyx_AddTraceback("lxml.etree._ParserDictionaryContext._findThreadParserContext");
60265   __pyx_r = 0;
60266   __pyx_L0:;
60267   __Pyx_DECREF((PyObject *)__pyx_v_context);
60268   __Pyx_DECREF(__pyx_v_d);
60269   __Pyx_XGIVEREF((PyObject *)__pyx_r);
60270   __Pyx_FinishRefcountContext();
60271   return __pyx_r;
60272 }
60273
60274 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":86
60275  *         return context
60276  * 
60277  *     cdef void setDefaultParser(self, _BaseParser parser):             # <<<<<<<<<<<<<<
60278  *         u"Set the default parser for the current thread"
60279  *         cdef _ParserDictionaryContext context
60280  */
60281
60282 static  void __pyx_f_4lxml_5etree_24_ParserDictionaryContext_setDefaultParser(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_self, struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser) {
60283   struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_context;
60284   PyObject *__pyx_t_1 = NULL;
60285   __Pyx_SetupRefcountContext("setDefaultParser");
60286   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)Py_None); __Pyx_INCREF(Py_None);
60287
60288   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":89
60289  *         u"Set the default parser for the current thread"
60290  *         cdef _ParserDictionaryContext context
60291  *         context = self._findThreadParserContext()             # <<<<<<<<<<<<<<
60292  *         context._default_parser = parser
60293  * 
60294  */
60295   __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_self->__pyx_vtab)->_findThreadParserContext(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60296   __Pyx_GOTREF(__pyx_t_1);
60297   __Pyx_DECREF(((PyObject *)__pyx_v_context));
60298   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)__pyx_t_1);
60299   __pyx_t_1 = 0;
60300
60301   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":90
60302  *         cdef _ParserDictionaryContext context
60303  *         context = self._findThreadParserContext()
60304  *         context._default_parser = parser             # <<<<<<<<<<<<<<
60305  * 
60306  *     cdef _BaseParser getDefaultParser(self):
60307  */
60308   __Pyx_INCREF(((PyObject *)__pyx_v_parser));
60309   __Pyx_GIVEREF(((PyObject *)__pyx_v_parser));
60310   __Pyx_GOTREF(__pyx_v_context->_default_parser);
60311   __Pyx_DECREF(((PyObject *)__pyx_v_context->_default_parser));
60312   __pyx_v_context->_default_parser = __pyx_v_parser;
60313
60314   goto __pyx_L0;
60315   __pyx_L1_error:;
60316   __Pyx_XDECREF(__pyx_t_1);
60317   __Pyx_WriteUnraisable("lxml.etree._ParserDictionaryContext.setDefaultParser");
60318   __pyx_L0:;
60319   __Pyx_DECREF((PyObject *)__pyx_v_context);
60320   __Pyx_FinishRefcountContext();
60321 }
60322
60323 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":92
60324  *         context._default_parser = parser
60325  * 
60326  *     cdef _BaseParser getDefaultParser(self):             # <<<<<<<<<<<<<<
60327  *         u"Return (or create) the default parser of the current thread"
60328  *         cdef _ParserDictionaryContext context
60329  */
60330
60331 static  struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_f_4lxml_5etree_24_ParserDictionaryContext_getDefaultParser(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_self) {
60332   struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_context;
60333   struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_r = NULL;
60334   PyObject *__pyx_t_1 = NULL;
60335   int __pyx_t_2;
60336   __Pyx_SetupRefcountContext("getDefaultParser");
60337   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)Py_None); __Pyx_INCREF(Py_None);
60338
60339   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":95
60340  *         u"Return (or create) the default parser of the current thread"
60341  *         cdef _ParserDictionaryContext context
60342  *         context = self._findThreadParserContext()             # <<<<<<<<<<<<<<
60343  *         if context._default_parser is None:
60344  *             if self._default_parser is None:
60345  */
60346   __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_self->__pyx_vtab)->_findThreadParserContext(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60347   __Pyx_GOTREF(__pyx_t_1);
60348   __Pyx_DECREF(((PyObject *)__pyx_v_context));
60349   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)__pyx_t_1);
60350   __pyx_t_1 = 0;
60351
60352   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":96
60353  *         cdef _ParserDictionaryContext context
60354  *         context = self._findThreadParserContext()
60355  *         if context._default_parser is None:             # <<<<<<<<<<<<<<
60356  *             if self._default_parser is None:
60357  *                 self._default_parser = __DEFAULT_XML_PARSER._copy()
60358  */
60359   __pyx_t_2 = (((PyObject *)__pyx_v_context->_default_parser) == Py_None);
60360   if (__pyx_t_2) {
60361
60362     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":97
60363  *         context = self._findThreadParserContext()
60364  *         if context._default_parser is None:
60365  *             if self._default_parser is None:             # <<<<<<<<<<<<<<
60366  *                 self._default_parser = __DEFAULT_XML_PARSER._copy()
60367  *             if context is not self:
60368  */
60369     __pyx_t_2 = (((PyObject *)__pyx_v_self->_default_parser) == Py_None);
60370     if (__pyx_t_2) {
60371
60372       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":98
60373  *         if context._default_parser is None:
60374  *             if self._default_parser is None:
60375  *                 self._default_parser = __DEFAULT_XML_PARSER._copy()             # <<<<<<<<<<<<<<
60376  *             if context is not self:
60377  *                 context._default_parser = self._default_parser._copy()
60378  */
60379       __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree_XMLParser *)__pyx_v_4lxml_5etree___DEFAULT_XML_PARSER->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._copy(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_4lxml_5etree___DEFAULT_XML_PARSER))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60380       __Pyx_GOTREF(__pyx_t_1);
60381       __Pyx_GIVEREF(__pyx_t_1);
60382       __Pyx_GOTREF(__pyx_v_self->_default_parser);
60383       __Pyx_DECREF(((PyObject *)__pyx_v_self->_default_parser));
60384       __pyx_v_self->_default_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_1);
60385       __pyx_t_1 = 0;
60386       goto __pyx_L4;
60387     }
60388     __pyx_L4:;
60389
60390     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":99
60391  *             if self._default_parser is None:
60392  *                 self._default_parser = __DEFAULT_XML_PARSER._copy()
60393  *             if context is not self:             # <<<<<<<<<<<<<<
60394  *                 context._default_parser = self._default_parser._copy()
60395  *         return context._default_parser
60396  */
60397     __pyx_t_2 = (__pyx_v_context != __pyx_v_self);
60398     if (__pyx_t_2) {
60399
60400       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":100
60401  *                 self._default_parser = __DEFAULT_XML_PARSER._copy()
60402  *             if context is not self:
60403  *                 context._default_parser = self._default_parser._copy()             # <<<<<<<<<<<<<<
60404  *         return context._default_parser
60405  * 
60406  */
60407       __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_self->_default_parser->__pyx_vtab)->_copy(__pyx_v_self->_default_parser)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60408       __Pyx_GOTREF(__pyx_t_1);
60409       __Pyx_GIVEREF(__pyx_t_1);
60410       __Pyx_GOTREF(__pyx_v_context->_default_parser);
60411       __Pyx_DECREF(((PyObject *)__pyx_v_context->_default_parser));
60412       __pyx_v_context->_default_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_1);
60413       __pyx_t_1 = 0;
60414       goto __pyx_L5;
60415     }
60416     __pyx_L5:;
60417     goto __pyx_L3;
60418   }
60419   __pyx_L3:;
60420
60421   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":101
60422  *             if context is not self:
60423  *                 context._default_parser = self._default_parser._copy()
60424  *         return context._default_parser             # <<<<<<<<<<<<<<
60425  * 
60426  *     cdef tree.xmlDict* _getThreadDict(self, tree.xmlDict* default):
60427  */
60428   __Pyx_XDECREF(((PyObject *)__pyx_r));
60429   __Pyx_INCREF(((PyObject *)__pyx_v_context->_default_parser));
60430   __pyx_r = __pyx_v_context->_default_parser;
60431   goto __pyx_L0;
60432
60433   __pyx_r = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None); __Pyx_INCREF(Py_None);
60434   goto __pyx_L0;
60435   __pyx_L1_error:;
60436   __Pyx_XDECREF(__pyx_t_1);
60437   __Pyx_AddTraceback("lxml.etree._ParserDictionaryContext.getDefaultParser");
60438   __pyx_r = 0;
60439   __pyx_L0:;
60440   __Pyx_DECREF((PyObject *)__pyx_v_context);
60441   __Pyx_XGIVEREF((PyObject *)__pyx_r);
60442   __Pyx_FinishRefcountContext();
60443   return __pyx_r;
60444 }
60445
60446 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":103
60447  *         return context._default_parser
60448  * 
60449  *     cdef tree.xmlDict* _getThreadDict(self, tree.xmlDict* default):             # <<<<<<<<<<<<<<
60450  *         u"Return the thread-local dict or create a new one if necessary."
60451  *         cdef _ParserDictionaryContext context
60452  */
60453
60454 static  xmlDict *__pyx_f_4lxml_5etree_24_ParserDictionaryContext__getThreadDict(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_self, xmlDict *__pyx_v_default) {
60455   struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_context;
60456   xmlDict *__pyx_r;
60457   PyObject *__pyx_t_1 = NULL;
60458   int __pyx_t_2;
60459   __Pyx_SetupRefcountContext("_getThreadDict");
60460   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)Py_None); __Pyx_INCREF(Py_None);
60461
60462   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":106
60463  *         u"Return the thread-local dict or create a new one if necessary."
60464  *         cdef _ParserDictionaryContext context
60465  *         context = self._findThreadParserContext()             # <<<<<<<<<<<<<<
60466  *         if context._c_dict is NULL:
60467  *             # thread dict not yet set up => use default or create a new one
60468  */
60469   __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_self->__pyx_vtab)->_findThreadParserContext(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60470   __Pyx_GOTREF(__pyx_t_1);
60471   __Pyx_DECREF(((PyObject *)__pyx_v_context));
60472   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)__pyx_t_1);
60473   __pyx_t_1 = 0;
60474
60475   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":107
60476  *         cdef _ParserDictionaryContext context
60477  *         context = self._findThreadParserContext()
60478  *         if context._c_dict is NULL:             # <<<<<<<<<<<<<<
60479  *             # thread dict not yet set up => use default or create a new one
60480  *             if default is not NULL:
60481  */
60482   __pyx_t_2 = (__pyx_v_context->_c_dict == NULL);
60483   if (__pyx_t_2) {
60484
60485     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":109
60486  *         if context._c_dict is NULL:
60487  *             # thread dict not yet set up => use default or create a new one
60488  *             if default is not NULL:             # <<<<<<<<<<<<<<
60489  *                 context._c_dict = default
60490  *                 xmlparser.xmlDictReference(default)
60491  */
60492     __pyx_t_2 = (__pyx_v_default != NULL);
60493     if (__pyx_t_2) {
60494
60495       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":110
60496  *             # thread dict not yet set up => use default or create a new one
60497  *             if default is not NULL:
60498  *                 context._c_dict = default             # <<<<<<<<<<<<<<
60499  *                 xmlparser.xmlDictReference(default)
60500  *                 return default
60501  */
60502       __pyx_v_context->_c_dict = __pyx_v_default;
60503
60504       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":111
60505  *             if default is not NULL:
60506  *                 context._c_dict = default
60507  *                 xmlparser.xmlDictReference(default)             # <<<<<<<<<<<<<<
60508  *                 return default
60509  *             if self._c_dict is NULL:
60510  */
60511       xmlDictReference(__pyx_v_default);
60512
60513       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":112
60514  *                 context._c_dict = default
60515  *                 xmlparser.xmlDictReference(default)
60516  *                 return default             # <<<<<<<<<<<<<<
60517  *             if self._c_dict is NULL:
60518  *                 self._c_dict = xmlparser.xmlDictCreate()
60519  */
60520       __pyx_r = __pyx_v_default;
60521       goto __pyx_L0;
60522       goto __pyx_L4;
60523     }
60524     __pyx_L4:;
60525
60526     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":113
60527  *                 xmlparser.xmlDictReference(default)
60528  *                 return default
60529  *             if self._c_dict is NULL:             # <<<<<<<<<<<<<<
60530  *                 self._c_dict = xmlparser.xmlDictCreate()
60531  *             if context is not self:
60532  */
60533     __pyx_t_2 = (__pyx_v_self->_c_dict == NULL);
60534     if (__pyx_t_2) {
60535
60536       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":114
60537  *                 return default
60538  *             if self._c_dict is NULL:
60539  *                 self._c_dict = xmlparser.xmlDictCreate()             # <<<<<<<<<<<<<<
60540  *             if context is not self:
60541  *                 context._c_dict = xmlparser.xmlDictCreateSub(self._c_dict)
60542  */
60543       __pyx_v_self->_c_dict = xmlDictCreate();
60544       goto __pyx_L5;
60545     }
60546     __pyx_L5:;
60547
60548     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":115
60549  *             if self._c_dict is NULL:
60550  *                 self._c_dict = xmlparser.xmlDictCreate()
60551  *             if context is not self:             # <<<<<<<<<<<<<<
60552  *                 context._c_dict = xmlparser.xmlDictCreateSub(self._c_dict)
60553  *         return context._c_dict
60554  */
60555     __pyx_t_2 = (__pyx_v_context != __pyx_v_self);
60556     if (__pyx_t_2) {
60557
60558       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":116
60559  *                 self._c_dict = xmlparser.xmlDictCreate()
60560  *             if context is not self:
60561  *                 context._c_dict = xmlparser.xmlDictCreateSub(self._c_dict)             # <<<<<<<<<<<<<<
60562  *         return context._c_dict
60563  * 
60564  */
60565       __pyx_v_context->_c_dict = xmlDictCreateSub(__pyx_v_self->_c_dict);
60566       goto __pyx_L6;
60567     }
60568     __pyx_L6:;
60569     goto __pyx_L3;
60570   }
60571   __pyx_L3:;
60572
60573   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":117
60574  *             if context is not self:
60575  *                 context._c_dict = xmlparser.xmlDictCreateSub(self._c_dict)
60576  *         return context._c_dict             # <<<<<<<<<<<<<<
60577  * 
60578  *     cdef void initThreadDictRef(self, tree.xmlDict** c_dict_ref):
60579  */
60580   __pyx_r = __pyx_v_context->_c_dict;
60581   goto __pyx_L0;
60582
60583   __pyx_r = 0;
60584   goto __pyx_L0;
60585   __pyx_L1_error:;
60586   __Pyx_XDECREF(__pyx_t_1);
60587   __Pyx_WriteUnraisable("lxml.etree._ParserDictionaryContext._getThreadDict");
60588   __pyx_r = 0;
60589   __pyx_L0:;
60590   __Pyx_DECREF((PyObject *)__pyx_v_context);
60591   __Pyx_FinishRefcountContext();
60592   return __pyx_r;
60593 }
60594
60595 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":119
60596  *         return context._c_dict
60597  * 
60598  *     cdef void initThreadDictRef(self, tree.xmlDict** c_dict_ref):             # <<<<<<<<<<<<<<
60599  *         cdef tree.xmlDict* c_dict
60600  *         cdef tree.xmlDict* c_thread_dict
60601  */
60602
60603 static  void __pyx_f_4lxml_5etree_24_ParserDictionaryContext_initThreadDictRef(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_self, xmlDict **__pyx_v_c_dict_ref) {
60604   xmlDict *__pyx_v_c_dict;
60605   xmlDict *__pyx_v_c_thread_dict;
60606   int __pyx_t_1;
60607   __Pyx_SetupRefcountContext("initThreadDictRef");
60608
60609   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":122
60610  *         cdef tree.xmlDict* c_dict
60611  *         cdef tree.xmlDict* c_thread_dict
60612  *         c_dict = c_dict_ref[0]             # <<<<<<<<<<<<<<
60613  *         c_thread_dict = self._getThreadDict(c_dict)
60614  *         if c_dict is c_thread_dict:
60615  */
60616   __pyx_v_c_dict = (__pyx_v_c_dict_ref[0]);
60617
60618   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":123
60619  *         cdef tree.xmlDict* c_thread_dict
60620  *         c_dict = c_dict_ref[0]
60621  *         c_thread_dict = self._getThreadDict(c_dict)             # <<<<<<<<<<<<<<
60622  *         if c_dict is c_thread_dict:
60623  *             return
60624  */
60625   __pyx_v_c_thread_dict = ((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_self->__pyx_vtab)->_getThreadDict(__pyx_v_self, __pyx_v_c_dict);
60626
60627   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":124
60628  *         c_dict = c_dict_ref[0]
60629  *         c_thread_dict = self._getThreadDict(c_dict)
60630  *         if c_dict is c_thread_dict:             # <<<<<<<<<<<<<<
60631  *             return
60632  *         if c_dict is not NULL:
60633  */
60634   __pyx_t_1 = (__pyx_v_c_dict == __pyx_v_c_thread_dict);
60635   if (__pyx_t_1) {
60636
60637     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":125
60638  *         c_thread_dict = self._getThreadDict(c_dict)
60639  *         if c_dict is c_thread_dict:
60640  *             return             # <<<<<<<<<<<<<<
60641  *         if c_dict is not NULL:
60642  *             xmlparser.xmlDictFree(c_dict)
60643  */
60644     goto __pyx_L0;
60645     goto __pyx_L3;
60646   }
60647   __pyx_L3:;
60648
60649   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":126
60650  *         if c_dict is c_thread_dict:
60651  *             return
60652  *         if c_dict is not NULL:             # <<<<<<<<<<<<<<
60653  *             xmlparser.xmlDictFree(c_dict)
60654  *         c_dict_ref[0] = c_thread_dict
60655  */
60656   __pyx_t_1 = (__pyx_v_c_dict != NULL);
60657   if (__pyx_t_1) {
60658
60659     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":127
60660  *             return
60661  *         if c_dict is not NULL:
60662  *             xmlparser.xmlDictFree(c_dict)             # <<<<<<<<<<<<<<
60663  *         c_dict_ref[0] = c_thread_dict
60664  *         xmlparser.xmlDictReference(c_thread_dict)
60665  */
60666     xmlDictFree(__pyx_v_c_dict);
60667     goto __pyx_L4;
60668   }
60669   __pyx_L4:;
60670
60671   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":128
60672  *         if c_dict is not NULL:
60673  *             xmlparser.xmlDictFree(c_dict)
60674  *         c_dict_ref[0] = c_thread_dict             # <<<<<<<<<<<<<<
60675  *         xmlparser.xmlDictReference(c_thread_dict)
60676  * 
60677  */
60678   (__pyx_v_c_dict_ref[0]) = __pyx_v_c_thread_dict;
60679
60680   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":129
60681  *             xmlparser.xmlDictFree(c_dict)
60682  *         c_dict_ref[0] = c_thread_dict
60683  *         xmlparser.xmlDictReference(c_thread_dict)             # <<<<<<<<<<<<<<
60684  * 
60685  *     cdef void initParserDict(self, xmlparser.xmlParserCtxt* pctxt):
60686  */
60687   xmlDictReference(__pyx_v_c_thread_dict);
60688
60689   __pyx_L0:;
60690   __Pyx_FinishRefcountContext();
60691 }
60692
60693 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":131
60694  *         xmlparser.xmlDictReference(c_thread_dict)
60695  * 
60696  *     cdef void initParserDict(self, xmlparser.xmlParserCtxt* pctxt):             # <<<<<<<<<<<<<<
60697  *         u"Assure we always use the same string dictionary."
60698  *         self.initThreadDictRef(&pctxt.dict)
60699  */
60700
60701 static  void __pyx_f_4lxml_5etree_24_ParserDictionaryContext_initParserDict(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_self, xmlParserCtxt *__pyx_v_pctxt) {
60702   __Pyx_SetupRefcountContext("initParserDict");
60703
60704   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":133
60705  *     cdef void initParserDict(self, xmlparser.xmlParserCtxt* pctxt):
60706  *         u"Assure we always use the same string dictionary."
60707  *         self.initThreadDictRef(&pctxt.dict)             # <<<<<<<<<<<<<<
60708  * 
60709  *     cdef void initXPathParserDict(self, xpath.xmlXPathContext* pctxt):
60710  */
60711   ((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_self->__pyx_vtab)->initThreadDictRef(__pyx_v_self, (&__pyx_v_pctxt->dict));
60712
60713   __Pyx_FinishRefcountContext();
60714 }
60715
60716 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":135
60717  *         self.initThreadDictRef(&pctxt.dict)
60718  * 
60719  *     cdef void initXPathParserDict(self, xpath.xmlXPathContext* pctxt):             # <<<<<<<<<<<<<<
60720  *         u"Assure we always use the same string dictionary."
60721  *         self.initThreadDictRef(&pctxt.dict)
60722  */
60723
60724 static  void __pyx_f_4lxml_5etree_24_ParserDictionaryContext_initXPathParserDict(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_self, xmlXPathContext *__pyx_v_pctxt) {
60725   __Pyx_SetupRefcountContext("initXPathParserDict");
60726
60727   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":137
60728  *     cdef void initXPathParserDict(self, xpath.xmlXPathContext* pctxt):
60729  *         u"Assure we always use the same string dictionary."
60730  *         self.initThreadDictRef(&pctxt.dict)             # <<<<<<<<<<<<<<
60731  * 
60732  *     cdef void initDocDict(self, xmlDoc* result):
60733  */
60734   ((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_self->__pyx_vtab)->initThreadDictRef(__pyx_v_self, (&__pyx_v_pctxt->dict));
60735
60736   __Pyx_FinishRefcountContext();
60737 }
60738
60739 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":139
60740  *         self.initThreadDictRef(&pctxt.dict)
60741  * 
60742  *     cdef void initDocDict(self, xmlDoc* result):             # <<<<<<<<<<<<<<
60743  *         u"Store dict of last object parsed if no shared dict yet"
60744  *         # XXX We also free the result dict here if there already was one.
60745  */
60746
60747 static  void __pyx_f_4lxml_5etree_24_ParserDictionaryContext_initDocDict(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_self, xmlDoc *__pyx_v_result) {
60748   __Pyx_SetupRefcountContext("initDocDict");
60749
60750   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":144
60751  *         # This case should only occur for new documents with empty dicts,
60752  *         # otherwise we'd free data that's in use => segfault
60753  *         self.initThreadDictRef(&result.dict)             # <<<<<<<<<<<<<<
60754  * 
60755  *     cdef _ParserContext findImpliedContext(self):
60756  */
60757   ((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_self->__pyx_vtab)->initThreadDictRef(__pyx_v_self, (&__pyx_v_result->dict));
60758
60759   __Pyx_FinishRefcountContext();
60760 }
60761
60762 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":146
60763  *         self.initThreadDictRef(&result.dict)
60764  * 
60765  *     cdef _ParserContext findImpliedContext(self):             # <<<<<<<<<<<<<<
60766  *         u"""Return any current implied xml parser context for the current
60767  *         thread.  This is used when the resolver functions are called
60768  */
60769
60770 static  struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_f_4lxml_5etree_24_ParserDictionaryContext_findImpliedContext(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_self) {
60771   struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_context;
60772   struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_implied_context;
60773   struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_r = NULL;
60774   PyObject *__pyx_1 = 0;
60775   PyObject *__pyx_t_1 = NULL;
60776   Py_ssize_t __pyx_t_2;
60777   __Pyx_SetupRefcountContext("findImpliedContext");
60778   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)Py_None); __Pyx_INCREF(Py_None);
60779   __pyx_v_implied_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); __Pyx_INCREF(Py_None);
60780
60781   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":156
60782  * 
60783  *         # see if we have a current implied parser
60784  *         context = self._findThreadParserContext()             # <<<<<<<<<<<<<<
60785  *         if python.PyList_GET_SIZE(context._implied_parser_contexts):
60786  *             implied_context = context._implied_parser_contexts[-1]
60787  */
60788   __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_self->__pyx_vtab)->_findThreadParserContext(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60789   __Pyx_GOTREF(__pyx_t_1);
60790   __Pyx_DECREF(((PyObject *)__pyx_v_context));
60791   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)__pyx_t_1);
60792   __pyx_t_1 = 0;
60793
60794   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":157
60795  *         # see if we have a current implied parser
60796  *         context = self._findThreadParserContext()
60797  *         if python.PyList_GET_SIZE(context._implied_parser_contexts):             # <<<<<<<<<<<<<<
60798  *             implied_context = context._implied_parser_contexts[-1]
60799  *             return implied_context
60800  */
60801   __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_v_context->_implied_parser_contexts));
60802   if (__pyx_t_2) {
60803
60804     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":158
60805  *         context = self._findThreadParserContext()
60806  *         if python.PyList_GET_SIZE(context._implied_parser_contexts):
60807  *             implied_context = context._implied_parser_contexts[-1]             # <<<<<<<<<<<<<<
60808  *             return implied_context
60809  *         return None
60810  */
60811     __pyx_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_context->_implied_parser_contexts), -1, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60812     __Pyx_GOTREF(__pyx_1);
60813     if (!(__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__ParserContext))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60814     __Pyx_DECREF(((PyObject *)__pyx_v_implied_context));
60815     __pyx_v_implied_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_1);
60816     __pyx_1 = 0;
60817
60818     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":159
60819  *         if python.PyList_GET_SIZE(context._implied_parser_contexts):
60820  *             implied_context = context._implied_parser_contexts[-1]
60821  *             return implied_context             # <<<<<<<<<<<<<<
60822  *         return None
60823  * 
60824  */
60825     __Pyx_XDECREF(((PyObject *)__pyx_r));
60826     __Pyx_INCREF(((PyObject *)__pyx_v_implied_context));
60827     __pyx_r = __pyx_v_implied_context;
60828     goto __pyx_L0;
60829     goto __pyx_L3;
60830   }
60831   __pyx_L3:;
60832
60833   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":160
60834  *             implied_context = context._implied_parser_contexts[-1]
60835  *             return implied_context
60836  *         return None             # <<<<<<<<<<<<<<
60837  * 
60838  *     cdef void pushImpliedContextFromParser(self, _BaseParser parser):
60839  */
60840   __Pyx_XDECREF(((PyObject *)__pyx_r));
60841   __Pyx_INCREF(Py_None);
60842   __pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None);
60843   goto __pyx_L0;
60844
60845   __pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); __Pyx_INCREF(Py_None);
60846   goto __pyx_L0;
60847   __pyx_L1_error:;
60848   __Pyx_XDECREF(__pyx_1);
60849   __Pyx_XDECREF(__pyx_t_1);
60850   __Pyx_AddTraceback("lxml.etree._ParserDictionaryContext.findImpliedContext");
60851   __pyx_r = 0;
60852   __pyx_L0:;
60853   __Pyx_DECREF((PyObject *)__pyx_v_context);
60854   __Pyx_DECREF((PyObject *)__pyx_v_implied_context);
60855   __Pyx_XGIVEREF((PyObject *)__pyx_r);
60856   __Pyx_FinishRefcountContext();
60857   return __pyx_r;
60858 }
60859
60860 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":162
60861  *         return None
60862  * 
60863  *     cdef void pushImpliedContextFromParser(self, _BaseParser parser):             # <<<<<<<<<<<<<<
60864  *         u"Push a new implied context object taken from the parser."
60865  *         if parser is not None:
60866  */
60867
60868 static  void __pyx_f_4lxml_5etree_24_ParserDictionaryContext_pushImpliedContextFromParser(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_self, struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser) {
60869   int __pyx_t_1;
60870   PyObject *__pyx_t_2 = NULL;
60871   __Pyx_SetupRefcountContext("pushImpliedContextFromParser");
60872
60873   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":164
60874  *     cdef void pushImpliedContextFromParser(self, _BaseParser parser):
60875  *         u"Push a new implied context object taken from the parser."
60876  *         if parser is not None:             # <<<<<<<<<<<<<<
60877  *             self.pushImpliedContext(parser._getParserContext())
60878  *         else:
60879  */
60880   __pyx_t_1 = (((PyObject *)__pyx_v_parser) != Py_None);
60881   if (__pyx_t_1) {
60882
60883     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":165
60884  *         u"Push a new implied context object taken from the parser."
60885  *         if parser is not None:
60886  *             self.pushImpliedContext(parser._getParserContext())             # <<<<<<<<<<<<<<
60887  *         else:
60888  *             self.pushImpliedContext(None)
60889  */
60890     __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_parser->__pyx_vtab)->_getParserContext(__pyx_v_parser)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60891     __Pyx_GOTREF(__pyx_t_2);
60892     ((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_self->__pyx_vtab)->pushImpliedContext(__pyx_v_self, ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_t_2));
60893     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
60894     goto __pyx_L3;
60895   }
60896   /*else*/ {
60897
60898     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":167
60899  *             self.pushImpliedContext(parser._getParserContext())
60900  *         else:
60901  *             self.pushImpliedContext(None)             # <<<<<<<<<<<<<<
60902  * 
60903  *     cdef void pushImpliedContext(self, _ParserContext parser_context):
60904  */
60905     ((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_self->__pyx_vtab)->pushImpliedContext(__pyx_v_self, ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None));
60906   }
60907   __pyx_L3:;
60908
60909   goto __pyx_L0;
60910   __pyx_L1_error:;
60911   __Pyx_XDECREF(__pyx_t_2);
60912   __Pyx_WriteUnraisable("lxml.etree._ParserDictionaryContext.pushImpliedContextFromParser");
60913   __pyx_L0:;
60914   __Pyx_FinishRefcountContext();
60915 }
60916
60917 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":169
60918  *             self.pushImpliedContext(None)
60919  * 
60920  *     cdef void pushImpliedContext(self, _ParserContext parser_context):             # <<<<<<<<<<<<<<
60921  *         u"Push a new implied context object."
60922  *         cdef _ParserDictionaryContext context
60923  */
60924
60925 static  void __pyx_f_4lxml_5etree_24_ParserDictionaryContext_pushImpliedContext(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_self, struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_parser_context) {
60926   struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_context;
60927   PyObject *__pyx_t_1 = NULL;
60928   int __pyx_t_2;
60929   __Pyx_SetupRefcountContext("pushImpliedContext");
60930   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)Py_None); __Pyx_INCREF(Py_None);
60931
60932   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":172
60933  *         u"Push a new implied context object."
60934  *         cdef _ParserDictionaryContext context
60935  *         context = self._findThreadParserContext()             # <<<<<<<<<<<<<<
60936  *         context._implied_parser_contexts.append(parser_context)
60937  * 
60938  */
60939   __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_self->__pyx_vtab)->_findThreadParserContext(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60940   __Pyx_GOTREF(__pyx_t_1);
60941   __Pyx_DECREF(((PyObject *)__pyx_v_context));
60942   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)__pyx_t_1);
60943   __pyx_t_1 = 0;
60944
60945   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":173
60946  *         cdef _ParserDictionaryContext context
60947  *         context = self._findThreadParserContext()
60948  *         context._implied_parser_contexts.append(parser_context)             # <<<<<<<<<<<<<<
60949  * 
60950  *     cdef void popImpliedContext(self):
60951  */
60952   __pyx_t_2 = PyList_Append(((PyObject *)__pyx_v_context->_implied_parser_contexts), ((PyObject *)__pyx_v_parser_context)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60953
60954   goto __pyx_L0;
60955   __pyx_L1_error:;
60956   __Pyx_XDECREF(__pyx_t_1);
60957   __Pyx_WriteUnraisable("lxml.etree._ParserDictionaryContext.pushImpliedContext");
60958   __pyx_L0:;
60959   __Pyx_DECREF((PyObject *)__pyx_v_context);
60960   __Pyx_FinishRefcountContext();
60961 }
60962
60963 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":175
60964  *         context._implied_parser_contexts.append(parser_context)
60965  * 
60966  *     cdef void popImpliedContext(self):             # <<<<<<<<<<<<<<
60967  *         u"Pop the current implied context object."
60968  *         cdef _ParserDictionaryContext context
60969  */
60970
60971 static  void __pyx_f_4lxml_5etree_24_ParserDictionaryContext_popImpliedContext(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_self) {
60972   struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_context;
60973   PyObject *__pyx_t_1 = NULL;
60974   PyObject *__pyx_t_2 = NULL;
60975   __Pyx_SetupRefcountContext("popImpliedContext");
60976   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)Py_None); __Pyx_INCREF(Py_None);
60977
60978   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":178
60979  *         u"Pop the current implied context object."
60980  *         cdef _ParserDictionaryContext context
60981  *         context = self._findThreadParserContext()             # <<<<<<<<<<<<<<
60982  *         context._implied_parser_contexts.pop()
60983  * 
60984  */
60985   __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_self->__pyx_vtab)->_findThreadParserContext(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60986   __Pyx_GOTREF(__pyx_t_1);
60987   __Pyx_DECREF(((PyObject *)__pyx_v_context));
60988   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)__pyx_t_1);
60989   __pyx_t_1 = 0;
60990
60991   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":179
60992  *         cdef _ParserDictionaryContext context
60993  *         context = self._findThreadParserContext()
60994  *         context._implied_parser_contexts.pop()             # <<<<<<<<<<<<<<
60995  * 
60996  * cdef _ParserDictionaryContext __GLOBAL_PARSER_CONTEXT
60997  */
60998   __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_context->_implied_parser_contexts), __pyx_kp_pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60999   __Pyx_GOTREF(__pyx_t_1);
61000   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
61001   __Pyx_GOTREF(__pyx_t_2);
61002   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
61003   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
61004
61005   goto __pyx_L0;
61006   __pyx_L1_error:;
61007   __Pyx_XDECREF(__pyx_t_1);
61008   __Pyx_XDECREF(__pyx_t_2);
61009   __Pyx_WriteUnraisable("lxml.etree._ParserDictionaryContext.popImpliedContext");
61010   __pyx_L0:;
61011   __Pyx_DECREF((PyObject *)__pyx_v_context);
61012   __Pyx_FinishRefcountContext();
61013 }
61014
61015 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":185
61016  * __GLOBAL_PARSER_CONTEXT.initMainParserContext()
61017  * 
61018  * cdef int _checkThreadDict(tree.xmlDict* c_dict):             # <<<<<<<<<<<<<<
61019  *     u"""Check that c_dict is either the local thread dictionary or the global
61020  *     parent dictionary.
61021  */
61022
61023 static  int __pyx_f_4lxml_5etree__checkThreadDict(xmlDict *__pyx_v_c_dict) {
61024   int __pyx_r;
61025   int __pyx_t_1;
61026   __Pyx_SetupRefcountContext("_checkThreadDict");
61027
61028   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":191
61029  *     #if __GLOBAL_PARSER_CONTEXT._c_dict is c_dict:
61030  *     #    return 1 # main thread
61031  *     if __GLOBAL_PARSER_CONTEXT._getThreadDict(NULL) is c_dict:             # <<<<<<<<<<<<<<
61032  *         return 1 # local thread dict
61033  *     return 0
61034  */
61035   __pyx_t_1 = (((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->_getThreadDict(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT, NULL) == __pyx_v_c_dict);
61036   if (__pyx_t_1) {
61037
61038     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":192
61039  *     #    return 1 # main thread
61040  *     if __GLOBAL_PARSER_CONTEXT._getThreadDict(NULL) is c_dict:
61041  *         return 1 # local thread dict             # <<<<<<<<<<<<<<
61042  *     return 0
61043  * 
61044  */
61045     __pyx_r = 1;
61046     goto __pyx_L0;
61047     goto __pyx_L3;
61048   }
61049   __pyx_L3:;
61050
61051   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":193
61052  *     if __GLOBAL_PARSER_CONTEXT._getThreadDict(NULL) is c_dict:
61053  *         return 1 # local thread dict
61054  *     return 0             # <<<<<<<<<<<<<<
61055  * 
61056  * ############################################################
61057  */
61058   __pyx_r = 0;
61059   goto __pyx_L0;
61060
61061   __pyx_r = 0;
61062   __pyx_L0:;
61063   __Pyx_FinishRefcountContext();
61064   return __pyx_r;
61065 }
61066
61067 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":203
61068  * _UNICODE_ENCODING = NULL
61069  * 
61070  * cdef void _setupPythonUnicode():             # <<<<<<<<<<<<<<
61071  *     u"""Sets _UNICODE_ENCODING to the internal encoding name of Python unicode
61072  *     strings if libxml2 supports reading native Python unicode.  This depends
61073  */
61074
61075 static  void __pyx_f_4lxml_5etree__setupPythonUnicode(void) {
61076   xmlCharEncodingHandler *__pyx_v_enchandler;
61077   Py_ssize_t __pyx_v_l;
61078   char *__pyx_v_buffer;
61079   char *__pyx_v_enc;
61080   PyObject *__pyx_v_utext;
61081   PyObject *__pyx_t_1 = NULL;
61082   int __pyx_t_2;
61083   int __pyx_t_3;
61084   __Pyx_SetupRefcountContext("_setupPythonUnicode");
61085   __pyx_v_utext = Py_None; __Pyx_INCREF(Py_None);
61086
61087   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":213
61088  *     cdef char* buffer
61089  *     cdef char* enc
61090  *     utext = python.PyUnicode_DecodeUTF8("<test/>", 7, NULL)             # <<<<<<<<<<<<<<
61091  *     l = python.PyUnicode_GET_DATA_SIZE(utext)
61092  *     buffer = python.PyUnicode_AS_DATA(utext)
61093  */
61094   __pyx_t_1 = PyUnicode_DecodeUTF8(__pyx_k_429, 7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
61095   __Pyx_GOTREF(__pyx_t_1);
61096   __Pyx_DECREF(__pyx_v_utext);
61097   __pyx_v_utext = __pyx_t_1;
61098   __pyx_t_1 = 0;
61099
61100   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":214
61101  *     cdef char* enc
61102  *     utext = python.PyUnicode_DecodeUTF8("<test/>", 7, NULL)
61103  *     l = python.PyUnicode_GET_DATA_SIZE(utext)             # <<<<<<<<<<<<<<
61104  *     buffer = python.PyUnicode_AS_DATA(utext)
61105  *     enc = _findEncodingName(buffer, l)
61106  */
61107   __pyx_v_l = PyUnicode_GET_DATA_SIZE(__pyx_v_utext);
61108
61109   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":215
61110  *     utext = python.PyUnicode_DecodeUTF8("<test/>", 7, NULL)
61111  *     l = python.PyUnicode_GET_DATA_SIZE(utext)
61112  *     buffer = python.PyUnicode_AS_DATA(utext)             # <<<<<<<<<<<<<<
61113  *     enc = _findEncodingName(buffer, l)
61114  *     if enc == NULL:
61115  */
61116   __pyx_v_buffer = PyUnicode_AS_DATA(__pyx_v_utext);
61117
61118   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":216
61119  *     l = python.PyUnicode_GET_DATA_SIZE(utext)
61120  *     buffer = python.PyUnicode_AS_DATA(utext)
61121  *     enc = _findEncodingName(buffer, l)             # <<<<<<<<<<<<<<
61122  *     if enc == NULL:
61123  *         # apparently, libxml2 can't detect UTF-16 on some systems
61124  */
61125   __pyx_v_enc = __pyx_f_4lxml_5etree__findEncodingName(__pyx_v_buffer, __pyx_v_l);
61126
61127   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":217
61128  *     buffer = python.PyUnicode_AS_DATA(utext)
61129  *     enc = _findEncodingName(buffer, l)
61130  *     if enc == NULL:             # <<<<<<<<<<<<<<
61131  *         # apparently, libxml2 can't detect UTF-16 on some systems
61132  *         if l >= 4 and \
61133  */
61134   __pyx_t_2 = (__pyx_v_enc == NULL);
61135   if (__pyx_t_2) {
61136
61137     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":219
61138  *     if enc == NULL:
61139  *         # apparently, libxml2 can't detect UTF-16 on some systems
61140  *         if l >= 4 and \             # <<<<<<<<<<<<<<
61141  *                buffer[0] == c'<' and buffer[1] == c'\0' and \
61142  *                buffer[2] == c't' and buffer[3] == c'\0':
61143  */
61144     if ((__pyx_v_l >= 4)) {
61145
61146       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":220
61147  *         # apparently, libxml2 can't detect UTF-16 on some systems
61148  *         if l >= 4 and \
61149  *                buffer[0] == c'<' and buffer[1] == c'\0' and \             # <<<<<<<<<<<<<<
61150  *                buffer[2] == c't' and buffer[3] == c'\0':
61151  *             enc = "UTF-16LE"
61152  */
61153       if (((__pyx_v_buffer[0]) == '<')) {
61154         if (((__pyx_v_buffer[1]) == '\x00')) {
61155
61156           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":221
61157  *         if l >= 4 and \
61158  *                buffer[0] == c'<' and buffer[1] == c'\0' and \
61159  *                buffer[2] == c't' and buffer[3] == c'\0':             # <<<<<<<<<<<<<<
61160  *             enc = "UTF-16LE"
61161  *         elif l >= 4 and \
61162  */
61163           if (((__pyx_v_buffer[2]) == 't')) {
61164             __pyx_t_2 = ((__pyx_v_buffer[3]) == '\x00');
61165           } else {
61166             __pyx_t_2 = ((__pyx_v_buffer[2]) == 't');
61167           }
61168           __pyx_t_3 = __pyx_t_2;
61169         } else {
61170           __pyx_t_3 = ((__pyx_v_buffer[1]) == '\x00');
61171         }
61172         __pyx_t_2 = __pyx_t_3;
61173       } else {
61174         __pyx_t_2 = ((__pyx_v_buffer[0]) == '<');
61175       }
61176       __pyx_t_3 = __pyx_t_2;
61177     } else {
61178       __pyx_t_3 = (__pyx_v_l >= 4);
61179     }
61180     if (__pyx_t_3) {
61181
61182       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":222
61183  *                buffer[0] == c'<' and buffer[1] == c'\0' and \
61184  *                buffer[2] == c't' and buffer[3] == c'\0':
61185  *             enc = "UTF-16LE"             # <<<<<<<<<<<<<<
61186  *         elif l >= 4 and \
61187  *                buffer[0] == c'\0' and buffer[1] == c'<' and \
61188  */
61189       __pyx_v_enc = __pyx_k_430;
61190       goto __pyx_L4;
61191     }
61192
61193     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":223
61194  *                buffer[2] == c't' and buffer[3] == c'\0':
61195  *             enc = "UTF-16LE"
61196  *         elif l >= 4 and \             # <<<<<<<<<<<<<<
61197  *                buffer[0] == c'\0' and buffer[1] == c'<' and \
61198  *                buffer[2] == c'\0' and buffer[3] == c't':
61199  */
61200     if ((__pyx_v_l >= 4)) {
61201
61202       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":224
61203  *             enc = "UTF-16LE"
61204  *         elif l >= 4 and \
61205  *                buffer[0] == c'\0' and buffer[1] == c'<' and \             # <<<<<<<<<<<<<<
61206  *                buffer[2] == c'\0' and buffer[3] == c't':
61207  *             enc = "UTF-16BE"
61208  */
61209       if (((__pyx_v_buffer[0]) == '\x00')) {
61210         if (((__pyx_v_buffer[1]) == '<')) {
61211
61212           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":225
61213  *         elif l >= 4 and \
61214  *                buffer[0] == c'\0' and buffer[1] == c'<' and \
61215  *                buffer[2] == c'\0' and buffer[3] == c't':             # <<<<<<<<<<<<<<
61216  *             enc = "UTF-16BE"
61217  *         else:
61218  */
61219           if (((__pyx_v_buffer[2]) == '\x00')) {
61220             __pyx_t_3 = ((__pyx_v_buffer[3]) == 't');
61221           } else {
61222             __pyx_t_3 = ((__pyx_v_buffer[2]) == '\x00');
61223           }
61224           __pyx_t_2 = __pyx_t_3;
61225         } else {
61226           __pyx_t_2 = ((__pyx_v_buffer[1]) == '<');
61227         }
61228         __pyx_t_3 = __pyx_t_2;
61229       } else {
61230         __pyx_t_3 = ((__pyx_v_buffer[0]) == '\x00');
61231       }
61232       __pyx_t_2 = __pyx_t_3;
61233     } else {
61234       __pyx_t_2 = (__pyx_v_l >= 4);
61235     }
61236     if (__pyx_t_2) {
61237
61238       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":226
61239  *                buffer[0] == c'\0' and buffer[1] == c'<' and \
61240  *                buffer[2] == c'\0' and buffer[3] == c't':
61241  *             enc = "UTF-16BE"             # <<<<<<<<<<<<<<
61242  *         else:
61243  *             # not my fault, it's YOUR broken system :)
61244  */
61245       __pyx_v_enc = __pyx_k_431;
61246       goto __pyx_L4;
61247     }
61248     /*else*/ {
61249
61250       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":229
61251  *         else:
61252  *             # not my fault, it's YOUR broken system :)
61253  *             return             # <<<<<<<<<<<<<<
61254  *     enchandler = tree.xmlFindCharEncodingHandler(enc)
61255  *     if enchandler is not NULL:
61256  */
61257       goto __pyx_L0;
61258     }
61259     __pyx_L4:;
61260     goto __pyx_L3;
61261   }
61262   __pyx_L3:;
61263
61264   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":230
61265  *             # not my fault, it's YOUR broken system :)
61266  *             return
61267  *     enchandler = tree.xmlFindCharEncodingHandler(enc)             # <<<<<<<<<<<<<<
61268  *     if enchandler is not NULL:
61269  *         global _UNICODE_ENCODING
61270  */
61271   __pyx_v_enchandler = xmlFindCharEncodingHandler(__pyx_v_enc);
61272
61273   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":231
61274  *             return
61275  *     enchandler = tree.xmlFindCharEncodingHandler(enc)
61276  *     if enchandler is not NULL:             # <<<<<<<<<<<<<<
61277  *         global _UNICODE_ENCODING
61278  *         tree.xmlCharEncCloseFunc(enchandler)
61279  */
61280   __pyx_t_2 = (__pyx_v_enchandler != NULL);
61281   if (__pyx_t_2) {
61282
61283     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":233
61284  *     if enchandler is not NULL:
61285  *         global _UNICODE_ENCODING
61286  *         tree.xmlCharEncCloseFunc(enchandler)             # <<<<<<<<<<<<<<
61287  *         _UNICODE_ENCODING = enc
61288  * 
61289  */
61290     xmlCharEncCloseFunc(__pyx_v_enchandler);
61291
61292     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":234
61293  *         global _UNICODE_ENCODING
61294  *         tree.xmlCharEncCloseFunc(enchandler)
61295  *         _UNICODE_ENCODING = enc             # <<<<<<<<<<<<<<
61296  * 
61297  * cdef char* _findEncodingName(char* buffer, int size):
61298  */
61299     __pyx_v_4lxml_5etree__UNICODE_ENCODING = __pyx_v_enc;
61300     goto __pyx_L5;
61301   }
61302   __pyx_L5:;
61303
61304   goto __pyx_L0;
61305   __pyx_L1_error:;
61306   __Pyx_XDECREF(__pyx_t_1);
61307   __Pyx_WriteUnraisable("lxml.etree._setupPythonUnicode");
61308   __pyx_L0:;
61309   __Pyx_DECREF(__pyx_v_utext);
61310   __Pyx_FinishRefcountContext();
61311 }
61312
61313 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":236
61314  *         _UNICODE_ENCODING = enc
61315  * 
61316  * cdef char* _findEncodingName(char* buffer, int size):             # <<<<<<<<<<<<<<
61317  *     u"Work around bug in libxml2: find iconv name of encoding on our own."
61318  *     cdef tree.xmlCharEncoding enc
61319  */
61320
61321 static  char *__pyx_f_4lxml_5etree__findEncodingName(char *__pyx_v_buffer, int __pyx_v_size) {
61322   xmlCharEncoding __pyx_v_enc;
61323   char *__pyx_r;
61324   int __pyx_t_1;
61325   __Pyx_SetupRefcountContext("_findEncodingName");
61326
61327   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":239
61328  *     u"Work around bug in libxml2: find iconv name of encoding on our own."
61329  *     cdef tree.xmlCharEncoding enc
61330  *     enc = tree.xmlDetectCharEncoding(buffer, size)             # <<<<<<<<<<<<<<
61331  *     if enc == tree.XML_CHAR_ENCODING_UTF16LE:
61332  *         return "UTF-16LE"
61333  */
61334   __pyx_v_enc = xmlDetectCharEncoding(__pyx_v_buffer, __pyx_v_size);
61335
61336   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":240
61337  *     cdef tree.xmlCharEncoding enc
61338  *     enc = tree.xmlDetectCharEncoding(buffer, size)
61339  *     if enc == tree.XML_CHAR_ENCODING_UTF16LE:             # <<<<<<<<<<<<<<
61340  *         return "UTF-16LE"
61341  *     elif enc == tree.XML_CHAR_ENCODING_UTF16BE:
61342  */
61343   __pyx_t_1 = (__pyx_v_enc == XML_CHAR_ENCODING_UTF16LE);
61344   if (__pyx_t_1) {
61345
61346     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":241
61347  *     enc = tree.xmlDetectCharEncoding(buffer, size)
61348  *     if enc == tree.XML_CHAR_ENCODING_UTF16LE:
61349  *         return "UTF-16LE"             # <<<<<<<<<<<<<<
61350  *     elif enc == tree.XML_CHAR_ENCODING_UTF16BE:
61351  *         return "UTF-16BE"
61352  */
61353     __pyx_r = __pyx_k_432;
61354     goto __pyx_L0;
61355     goto __pyx_L3;
61356   }
61357
61358   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":242
61359  *     if enc == tree.XML_CHAR_ENCODING_UTF16LE:
61360  *         return "UTF-16LE"
61361  *     elif enc == tree.XML_CHAR_ENCODING_UTF16BE:             # <<<<<<<<<<<<<<
61362  *         return "UTF-16BE"
61363  *     elif enc == tree.XML_CHAR_ENCODING_UCS4LE:
61364  */
61365   __pyx_t_1 = (__pyx_v_enc == XML_CHAR_ENCODING_UTF16BE);
61366   if (__pyx_t_1) {
61367
61368     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":243
61369  *         return "UTF-16LE"
61370  *     elif enc == tree.XML_CHAR_ENCODING_UTF16BE:
61371  *         return "UTF-16BE"             # <<<<<<<<<<<<<<
61372  *     elif enc == tree.XML_CHAR_ENCODING_UCS4LE:
61373  *         return "UCS-4LE"
61374  */
61375     __pyx_r = __pyx_k_433;
61376     goto __pyx_L0;
61377     goto __pyx_L3;
61378   }
61379
61380   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":244
61381  *     elif enc == tree.XML_CHAR_ENCODING_UTF16BE:
61382  *         return "UTF-16BE"
61383  *     elif enc == tree.XML_CHAR_ENCODING_UCS4LE:             # <<<<<<<<<<<<<<
61384  *         return "UCS-4LE"
61385  *     elif enc == tree.XML_CHAR_ENCODING_UCS4BE:
61386  */
61387   __pyx_t_1 = (__pyx_v_enc == XML_CHAR_ENCODING_UCS4LE);
61388   if (__pyx_t_1) {
61389
61390     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":245
61391  *         return "UTF-16BE"
61392  *     elif enc == tree.XML_CHAR_ENCODING_UCS4LE:
61393  *         return "UCS-4LE"             # <<<<<<<<<<<<<<
61394  *     elif enc == tree.XML_CHAR_ENCODING_UCS4BE:
61395  *         return "UCS-4BE"
61396  */
61397     __pyx_r = __pyx_k_434;
61398     goto __pyx_L0;
61399     goto __pyx_L3;
61400   }
61401
61402   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":246
61403  *     elif enc == tree.XML_CHAR_ENCODING_UCS4LE:
61404  *         return "UCS-4LE"
61405  *     elif enc == tree.XML_CHAR_ENCODING_UCS4BE:             # <<<<<<<<<<<<<<
61406  *         return "UCS-4BE"
61407  *     elif enc == tree.XML_CHAR_ENCODING_NONE:
61408  */
61409   __pyx_t_1 = (__pyx_v_enc == XML_CHAR_ENCODING_UCS4BE);
61410   if (__pyx_t_1) {
61411
61412     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":247
61413  *         return "UCS-4LE"
61414  *     elif enc == tree.XML_CHAR_ENCODING_UCS4BE:
61415  *         return "UCS-4BE"             # <<<<<<<<<<<<<<
61416  *     elif enc == tree.XML_CHAR_ENCODING_NONE:
61417  *         return NULL
61418  */
61419     __pyx_r = __pyx_k_435;
61420     goto __pyx_L0;
61421     goto __pyx_L3;
61422   }
61423
61424   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":248
61425  *     elif enc == tree.XML_CHAR_ENCODING_UCS4BE:
61426  *         return "UCS-4BE"
61427  *     elif enc == tree.XML_CHAR_ENCODING_NONE:             # <<<<<<<<<<<<<<
61428  *         return NULL
61429  *     else:
61430  */
61431   __pyx_t_1 = (__pyx_v_enc == XML_CHAR_ENCODING_NONE);
61432   if (__pyx_t_1) {
61433
61434     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":249
61435  *         return "UCS-4BE"
61436  *     elif enc == tree.XML_CHAR_ENCODING_NONE:
61437  *         return NULL             # <<<<<<<<<<<<<<
61438  *     else:
61439  *         return tree.xmlGetCharEncodingName(enc)
61440  */
61441     __pyx_r = NULL;
61442     goto __pyx_L0;
61443     goto __pyx_L3;
61444   }
61445   /*else*/ {
61446
61447     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":251
61448  *         return NULL
61449  *     else:
61450  *         return tree.xmlGetCharEncodingName(enc)             # <<<<<<<<<<<<<<
61451  * 
61452  * _setupPythonUnicode()
61453  */
61454     __pyx_r = xmlGetCharEncodingName(__pyx_v_enc);
61455     goto __pyx_L0;
61456   }
61457   __pyx_L3:;
61458
61459   __pyx_r = 0;
61460   __pyx_L0:;
61461   __Pyx_FinishRefcountContext();
61462   return __pyx_r;
61463 }
61464
61465 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":267
61466  *     cdef Py_ssize_t _bytes_read
61467  *     cdef char* _c_url
61468  *     def __init__(self, filelike, exc_context, url, encoding):             # <<<<<<<<<<<<<<
61469  *         self._exc_context = exc_context
61470  *         self._filelike = filelike
61471  */
61472
61473 static int __pyx_pf_4lxml_5etree_18_FileReaderContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
61474 static int __pyx_pf_4lxml_5etree_18_FileReaderContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
61475   PyObject *__pyx_v_filelike = 0;
61476   PyObject *__pyx_v_exc_context = 0;
61477   PyObject *__pyx_v_url = 0;
61478   PyObject *__pyx_v_encoding = 0;
61479   int __pyx_r;
61480   int __pyx_t_1;
61481   PyObject *__pyx_t_2 = NULL;
61482   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_filelike,&__pyx_kp_exc_context,&__pyx_kp_url,&__pyx_kp_encoding,0};
61483   __Pyx_SetupRefcountContext("__init__");
61484   if (unlikely(__pyx_kwds)) {
61485     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
61486     PyObject* values[4] = {0,0,0,0};
61487     switch (PyTuple_GET_SIZE(__pyx_args)) {
61488       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
61489       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
61490       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
61491       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
61492       case  0: break;
61493       default: goto __pyx_L5_argtuple_error;
61494     }
61495     switch (PyTuple_GET_SIZE(__pyx_args)) {
61496       case  0:
61497       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_filelike);
61498       if (likely(values[0])) kw_args--;
61499       else goto __pyx_L5_argtuple_error;
61500       case  1:
61501       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_exc_context);
61502       if (likely(values[1])) kw_args--;
61503       else {
61504         __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
61505       }
61506       case  2:
61507       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_url);
61508       if (likely(values[2])) kw_args--;
61509       else {
61510         __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
61511       }
61512       case  3:
61513       values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_encoding);
61514       if (likely(values[3])) kw_args--;
61515       else {
61516         __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
61517       }
61518     }
61519     if (unlikely(kw_args > 0)) {
61520       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
61521     }
61522     __pyx_v_filelike = values[0];
61523     __pyx_v_exc_context = values[1];
61524     __pyx_v_url = values[2];
61525     __pyx_v_encoding = values[3];
61526   } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
61527     goto __pyx_L5_argtuple_error;
61528   } else {
61529     __pyx_v_filelike = PyTuple_GET_ITEM(__pyx_args, 0);
61530     __pyx_v_exc_context = PyTuple_GET_ITEM(__pyx_args, 1);
61531     __pyx_v_url = PyTuple_GET_ITEM(__pyx_args, 2);
61532     __pyx_v_encoding = PyTuple_GET_ITEM(__pyx_args, 3);
61533   }
61534   goto __pyx_L4_argument_unpacking_done;
61535   __pyx_L5_argtuple_error:;
61536   __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
61537   __pyx_L3_error:;
61538   __Pyx_AddTraceback("lxml.etree._FileReaderContext.__init__");
61539   return -1;
61540   __pyx_L4_argument_unpacking_done:;
61541   __Pyx_INCREF(__pyx_v_url);
61542
61543   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":268
61544  *     cdef char* _c_url
61545  *     def __init__(self, filelike, exc_context, url, encoding):
61546  *         self._exc_context = exc_context             # <<<<<<<<<<<<<<
61547  *         self._filelike = filelike
61548  *         self._encoding = encoding
61549  */
61550   if (!(__Pyx_TypeTest(__pyx_v_exc_context, __pyx_ptype_4lxml_5etree__ExceptionContext))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
61551   __Pyx_INCREF(__pyx_v_exc_context);
61552   __Pyx_GIVEREF(__pyx_v_exc_context);
61553   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_exc_context);
61554   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_exc_context));
61555   ((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_exc_context = ((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_exc_context);
61556
61557   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":269
61558  *     def __init__(self, filelike, exc_context, url, encoding):
61559  *         self._exc_context = exc_context
61560  *         self._filelike = filelike             # <<<<<<<<<<<<<<
61561  *         self._encoding = encoding
61562  *         if url is None:
61563  */
61564   __Pyx_INCREF(__pyx_v_filelike);
61565   __Pyx_GIVEREF(__pyx_v_filelike);
61566   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_filelike);
61567   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_filelike);
61568   ((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_filelike = __pyx_v_filelike;
61569
61570   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":270
61571  *         self._exc_context = exc_context
61572  *         self._filelike = filelike
61573  *         self._encoding = encoding             # <<<<<<<<<<<<<<
61574  *         if url is None:
61575  *             self._c_url = NULL
61576  */
61577   __Pyx_INCREF(__pyx_v_encoding);
61578   __Pyx_GIVEREF(__pyx_v_encoding);
61579   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_encoding);
61580   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_encoding);
61581   ((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_encoding = __pyx_v_encoding;
61582
61583   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":271
61584  *         self._filelike = filelike
61585  *         self._encoding = encoding
61586  *         if url is None:             # <<<<<<<<<<<<<<
61587  *             self._c_url = NULL
61588  *         else:
61589  */
61590   __pyx_t_1 = (__pyx_v_url == Py_None);
61591   if (__pyx_t_1) {
61592
61593     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":272
61594  *         self._encoding = encoding
61595  *         if url is None:
61596  *             self._c_url = NULL             # <<<<<<<<<<<<<<
61597  *         else:
61598  *             url = _encodeFilename(url)
61599  */
61600     ((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_c_url = NULL;
61601     goto __pyx_L6;
61602   }
61603   /*else*/ {
61604
61605     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":274
61606  *             self._c_url = NULL
61607  *         else:
61608  *             url = _encodeFilename(url)             # <<<<<<<<<<<<<<
61609  *             self._c_url = _cstr(url)
61610  *         self._url = url
61611  */
61612     __pyx_t_2 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_url); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
61613     __Pyx_GOTREF(__pyx_t_2);
61614     __Pyx_DECREF(__pyx_v_url);
61615     __pyx_v_url = __pyx_t_2;
61616     __pyx_t_2 = 0;
61617
61618     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":275
61619  *         else:
61620  *             url = _encodeFilename(url)
61621  *             self._c_url = _cstr(url)             # <<<<<<<<<<<<<<
61622  *         self._url = url
61623  *         self._bytes  = ''
61624  */
61625     ((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_c_url = PyString_AS_STRING(__pyx_v_url);
61626   }
61627   __pyx_L6:;
61628
61629   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":276
61630  *             url = _encodeFilename(url)
61631  *             self._c_url = _cstr(url)
61632  *         self._url = url             # <<<<<<<<<<<<<<
61633  *         self._bytes  = ''
61634  *         self._bytes_read = 0
61635  */
61636   __Pyx_INCREF(__pyx_v_url);
61637   __Pyx_GIVEREF(__pyx_v_url);
61638   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_url);
61639   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_url);
61640   ((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_url = __pyx_v_url;
61641
61642   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":277
61643  *             self._c_url = _cstr(url)
61644  *         self._url = url
61645  *         self._bytes  = ''             # <<<<<<<<<<<<<<
61646  *         self._bytes_read = 0
61647  * 
61648  */
61649   __Pyx_INCREF(__pyx_kp_436);
61650   __Pyx_GIVEREF(__pyx_kp_436);
61651   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_bytes);
61652   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_bytes);
61653   ((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_bytes = __pyx_kp_436;
61654
61655   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":278
61656  *         self._url = url
61657  *         self._bytes  = ''
61658  *         self._bytes_read = 0             # <<<<<<<<<<<<<<
61659  * 
61660  *     cdef xmlparser.xmlParserInputBuffer* _createParserInputBuffer(self):
61661  */
61662   ((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_bytes_read = 0;
61663
61664   __pyx_r = 0;
61665   goto __pyx_L0;
61666   __pyx_L1_error:;
61667   __Pyx_XDECREF(__pyx_t_2);
61668   __Pyx_AddTraceback("lxml.etree._FileReaderContext.__init__");
61669   __pyx_r = -1;
61670   __pyx_L0:;
61671   __Pyx_DECREF(__pyx_v_url);
61672   __Pyx_FinishRefcountContext();
61673   return __pyx_r;
61674 }
61675
61676 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":280
61677  *         self._bytes_read = 0
61678  * 
61679  *     cdef xmlparser.xmlParserInputBuffer* _createParserInputBuffer(self):             # <<<<<<<<<<<<<<
61680  *         cdef cstd.FILE* c_stream
61681  *         cdef xmlparser.xmlParserInputBuffer* c_buffer
61682  */
61683
61684 static  xmlParserInputBuffer *__pyx_f_4lxml_5etree_18_FileReaderContext__createParserInputBuffer(struct __pyx_obj_4lxml_5etree__FileReaderContext *__pyx_v_self) {
61685   FILE *__pyx_v_c_stream;
61686   xmlParserInputBuffer *__pyx_v_c_buffer;
61687   xmlParserInputBuffer *__pyx_r;
61688   int __pyx_t_1;
61689   __Pyx_SetupRefcountContext("_createParserInputBuffer");
61690
61691   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":283
61692  *         cdef cstd.FILE* c_stream
61693  *         cdef xmlparser.xmlParserInputBuffer* c_buffer
61694  *         c_buffer = xmlparser.xmlAllocParserInputBuffer(0)             # <<<<<<<<<<<<<<
61695  *         c_stream = python.PyFile_AsFile(self._filelike)
61696  *         if c_stream is NULL:
61697  */
61698   __pyx_v_c_buffer = xmlAllocParserInputBuffer(0);
61699
61700   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":284
61701  *         cdef xmlparser.xmlParserInputBuffer* c_buffer
61702  *         c_buffer = xmlparser.xmlAllocParserInputBuffer(0)
61703  *         c_stream = python.PyFile_AsFile(self._filelike)             # <<<<<<<<<<<<<<
61704  *         if c_stream is NULL:
61705  *             c_buffer.readcallback  = _readFilelikeParser
61706  */
61707   __pyx_v_c_stream = PyFile_AsFile(__pyx_v_self->_filelike);
61708
61709   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":285
61710  *         c_buffer = xmlparser.xmlAllocParserInputBuffer(0)
61711  *         c_stream = python.PyFile_AsFile(self._filelike)
61712  *         if c_stream is NULL:             # <<<<<<<<<<<<<<
61713  *             c_buffer.readcallback  = _readFilelikeParser
61714  *             c_buffer.context = <python.PyObject*>self
61715  */
61716   __pyx_t_1 = (__pyx_v_c_stream == NULL);
61717   if (__pyx_t_1) {
61718
61719     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":286
61720  *         c_stream = python.PyFile_AsFile(self._filelike)
61721  *         if c_stream is NULL:
61722  *             c_buffer.readcallback  = _readFilelikeParser             # <<<<<<<<<<<<<<
61723  *             c_buffer.context = <python.PyObject*>self
61724  *         else:
61725  */
61726     __pyx_v_c_buffer->readcallback = __pyx_f_4lxml_5etree__readFilelikeParser;
61727
61728     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":287
61729  *         if c_stream is NULL:
61730  *             c_buffer.readcallback  = _readFilelikeParser
61731  *             c_buffer.context = <python.PyObject*>self             # <<<<<<<<<<<<<<
61732  *         else:
61733  *             c_buffer.readcallback  = _readFileParser
61734  */
61735     __pyx_v_c_buffer->context = ((PyObject *)__pyx_v_self);
61736     goto __pyx_L3;
61737   }
61738   /*else*/ {
61739
61740     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":289
61741  *             c_buffer.context = <python.PyObject*>self
61742  *         else:
61743  *             c_buffer.readcallback  = _readFileParser             # <<<<<<<<<<<<<<
61744  *             c_buffer.context = c_stream
61745  *         return c_buffer
61746  */
61747     __pyx_v_c_buffer->readcallback = __pyx_f_4lxml_5etree__readFileParser;
61748
61749     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":290
61750  *         else:
61751  *             c_buffer.readcallback  = _readFileParser
61752  *             c_buffer.context = c_stream             # <<<<<<<<<<<<<<
61753  *         return c_buffer
61754  * 
61755  */
61756     __pyx_v_c_buffer->context = __pyx_v_c_stream;
61757   }
61758   __pyx_L3:;
61759
61760   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":291
61761  *             c_buffer.readcallback  = _readFileParser
61762  *             c_buffer.context = c_stream
61763  *         return c_buffer             # <<<<<<<<<<<<<<
61764  * 
61765  *     cdef xmlparser.xmlParserInput* _createParserInput(
61766  */
61767   __pyx_r = __pyx_v_c_buffer;
61768   goto __pyx_L0;
61769
61770   __pyx_r = 0;
61771   __pyx_L0:;
61772   __Pyx_FinishRefcountContext();
61773   return __pyx_r;
61774 }
61775
61776 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":293
61777  *         return c_buffer
61778  * 
61779  *     cdef xmlparser.xmlParserInput* _createParserInput(             # <<<<<<<<<<<<<<
61780  *             self, xmlparser.xmlParserCtxt* ctxt):
61781  *         cdef xmlparser.xmlParserInputBuffer* c_buffer
61782  */
61783
61784 static  xmlParserInput *__pyx_f_4lxml_5etree_18_FileReaderContext__createParserInput(struct __pyx_obj_4lxml_5etree__FileReaderContext *__pyx_v_self, xmlParserCtxt *__pyx_v_ctxt) {
61785   xmlParserInputBuffer *__pyx_v_c_buffer;
61786   xmlParserInput *__pyx_r;
61787   __Pyx_SetupRefcountContext("_createParserInput");
61788
61789   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":296
61790  *             self, xmlparser.xmlParserCtxt* ctxt):
61791  *         cdef xmlparser.xmlParserInputBuffer* c_buffer
61792  *         c_buffer = self._createParserInputBuffer()             # <<<<<<<<<<<<<<
61793  *         return xmlparser.xmlNewIOInputStream(ctxt, c_buffer, 0)
61794  * 
61795  */
61796   __pyx_v_c_buffer = ((struct __pyx_vtabstruct_4lxml_5etree__FileReaderContext *)__pyx_v_self->__pyx_vtab)->_createParserInputBuffer(__pyx_v_self);
61797
61798   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":297
61799  *         cdef xmlparser.xmlParserInputBuffer* c_buffer
61800  *         c_buffer = self._createParserInputBuffer()
61801  *         return xmlparser.xmlNewIOInputStream(ctxt, c_buffer, 0)             # <<<<<<<<<<<<<<
61802  * 
61803  *     cdef tree.xmlDtd* _readDtd(self):
61804  */
61805   __pyx_r = xmlNewIOInputStream(__pyx_v_ctxt, __pyx_v_c_buffer, 0);
61806   goto __pyx_L0;
61807
61808   __pyx_r = 0;
61809   __pyx_L0:;
61810   __Pyx_FinishRefcountContext();
61811   return __pyx_r;
61812 }
61813
61814 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":299
61815  *         return xmlparser.xmlNewIOInputStream(ctxt, c_buffer, 0)
61816  * 
61817  *     cdef tree.xmlDtd* _readDtd(self):             # <<<<<<<<<<<<<<
61818  *         cdef xmlparser.xmlParserInputBuffer* c_buffer
61819  *         c_buffer = self._createParserInputBuffer()
61820  */
61821
61822 static  xmlDtd *__pyx_f_4lxml_5etree_18_FileReaderContext__readDtd(struct __pyx_obj_4lxml_5etree__FileReaderContext *__pyx_v_self) {
61823   xmlParserInputBuffer *__pyx_v_c_buffer;
61824   xmlDtd *__pyx_r;
61825   __Pyx_SetupRefcountContext("_readDtd");
61826
61827   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":301
61828  *     cdef tree.xmlDtd* _readDtd(self):
61829  *         cdef xmlparser.xmlParserInputBuffer* c_buffer
61830  *         c_buffer = self._createParserInputBuffer()             # <<<<<<<<<<<<<<
61831  *         with nogil:
61832  *             return xmlparser.xmlIOParseDTD(NULL, c_buffer, 0)
61833  */
61834   __pyx_v_c_buffer = ((struct __pyx_vtabstruct_4lxml_5etree__FileReaderContext *)__pyx_v_self->__pyx_vtab)->_createParserInputBuffer(__pyx_v_self);
61835
61836   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":302
61837  *         cdef xmlparser.xmlParserInputBuffer* c_buffer
61838  *         c_buffer = self._createParserInputBuffer()
61839  *         with nogil:             # <<<<<<<<<<<<<<
61840  *             return xmlparser.xmlIOParseDTD(NULL, c_buffer, 0)
61841  * 
61842  */
61843   { PyThreadState *_save;
61844     Py_UNBLOCK_THREADS
61845     /*try:*/ {
61846
61847       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":303
61848  *         c_buffer = self._createParserInputBuffer()
61849  *         with nogil:
61850  *             return xmlparser.xmlIOParseDTD(NULL, c_buffer, 0)             # <<<<<<<<<<<<<<
61851  * 
61852  *     cdef xmlDoc* _readDoc(self, xmlparser.xmlParserCtxt* ctxt, int options):
61853  */
61854       __pyx_r = xmlIOParseDTD(NULL, __pyx_v_c_buffer, 0);
61855       goto __pyx_L3;
61856     }
61857     /*finally:*/ {
61858       int __pyx_why;
61859       __pyx_why = 0; goto __pyx_L5;
61860       __pyx_L3: __pyx_why = 3; goto __pyx_L5;
61861       __pyx_L5:;
61862       Py_BLOCK_THREADS
61863       switch (__pyx_why) {
61864         case 3: goto __pyx_L0;
61865       }
61866     }
61867   }
61868
61869   __pyx_r = 0;
61870   __pyx_L0:;
61871   __Pyx_FinishRefcountContext();
61872   return __pyx_r;
61873 }
61874
61875 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":305
61876  *             return xmlparser.xmlIOParseDTD(NULL, c_buffer, 0)
61877  * 
61878  *     cdef xmlDoc* _readDoc(self, xmlparser.xmlParserCtxt* ctxt, int options):             # <<<<<<<<<<<<<<
61879  *         cdef xmlDoc* result
61880  *         cdef char* c_encoding
61881  */
61882
61883 static  xmlDoc *__pyx_f_4lxml_5etree_18_FileReaderContext__readDoc(struct __pyx_obj_4lxml_5etree__FileReaderContext *__pyx_v_self, xmlParserCtxt *__pyx_v_ctxt, int __pyx_v_options) {
61884   xmlDoc *__pyx_v_result;
61885   char *__pyx_v_c_encoding;
61886   FILE *__pyx_v_c_stream;
61887   xmlInputReadCallback __pyx_v_c_read_callback;
61888   void *__pyx_v_c_callback_context;
61889   xmlDoc *__pyx_r;
61890   int __pyx_t_1;
61891   __Pyx_SetupRefcountContext("_readDoc");
61892
61893   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":313
61894  *         cdef void* c_callback_context
61895  * 
61896  *         if self._encoding is None:             # <<<<<<<<<<<<<<
61897  *             c_encoding = NULL
61898  *         else:
61899  */
61900   __pyx_t_1 = (__pyx_v_self->_encoding == Py_None);
61901   if (__pyx_t_1) {
61902
61903     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":314
61904  * 
61905  *         if self._encoding is None:
61906  *             c_encoding = NULL             # <<<<<<<<<<<<<<
61907  *         else:
61908  *             c_encoding = _cstr(self._encoding)
61909  */
61910     __pyx_v_c_encoding = NULL;
61911     goto __pyx_L3;
61912   }
61913   /*else*/ {
61914
61915     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":316
61916  *             c_encoding = NULL
61917  *         else:
61918  *             c_encoding = _cstr(self._encoding)             # <<<<<<<<<<<<<<
61919  * 
61920  *         c_stream = python.PyFile_AsFile(self._filelike)
61921  */
61922     __pyx_v_c_encoding = PyString_AS_STRING(__pyx_v_self->_encoding);
61923   }
61924   __pyx_L3:;
61925
61926   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":318
61927  *             c_encoding = _cstr(self._encoding)
61928  * 
61929  *         c_stream = python.PyFile_AsFile(self._filelike)             # <<<<<<<<<<<<<<
61930  *         if c_stream is NULL:
61931  *             c_read_callback  = _readFilelikeParser
61932  */
61933   __pyx_v_c_stream = PyFile_AsFile(__pyx_v_self->_filelike);
61934
61935   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":319
61936  * 
61937  *         c_stream = python.PyFile_AsFile(self._filelike)
61938  *         if c_stream is NULL:             # <<<<<<<<<<<<<<
61939  *             c_read_callback  = _readFilelikeParser
61940  *             c_callback_context = <python.PyObject*>self
61941  */
61942   __pyx_t_1 = (__pyx_v_c_stream == NULL);
61943   if (__pyx_t_1) {
61944
61945     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":320
61946  *         c_stream = python.PyFile_AsFile(self._filelike)
61947  *         if c_stream is NULL:
61948  *             c_read_callback  = _readFilelikeParser             # <<<<<<<<<<<<<<
61949  *             c_callback_context = <python.PyObject*>self
61950  *         else:
61951  */
61952     __pyx_v_c_read_callback = __pyx_f_4lxml_5etree__readFilelikeParser;
61953
61954     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":321
61955  *         if c_stream is NULL:
61956  *             c_read_callback  = _readFilelikeParser
61957  *             c_callback_context = <python.PyObject*>self             # <<<<<<<<<<<<<<
61958  *         else:
61959  *             c_read_callback  = _readFileParser
61960  */
61961     __pyx_v_c_callback_context = ((PyObject *)__pyx_v_self);
61962     goto __pyx_L4;
61963   }
61964   /*else*/ {
61965
61966     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":323
61967  *             c_callback_context = <python.PyObject*>self
61968  *         else:
61969  *             c_read_callback  = _readFileParser             # <<<<<<<<<<<<<<
61970  *             c_callback_context = c_stream
61971  * 
61972  */
61973     __pyx_v_c_read_callback = __pyx_f_4lxml_5etree__readFileParser;
61974
61975     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":324
61976  *         else:
61977  *             c_read_callback  = _readFileParser
61978  *             c_callback_context = c_stream             # <<<<<<<<<<<<<<
61979  * 
61980  *         with nogil:
61981  */
61982     __pyx_v_c_callback_context = __pyx_v_c_stream;
61983   }
61984   __pyx_L4:;
61985
61986   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":326
61987  *             c_callback_context = c_stream
61988  * 
61989  *         with nogil:             # <<<<<<<<<<<<<<
61990  *             if ctxt.html:
61991  *                 result = htmlparser.htmlCtxtReadIO(
61992  */
61993   { PyThreadState *_save;
61994     Py_UNBLOCK_THREADS
61995     /*try:*/ {
61996
61997       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":327
61998  * 
61999  *         with nogil:
62000  *             if ctxt.html:             # <<<<<<<<<<<<<<
62001  *                 result = htmlparser.htmlCtxtReadIO(
62002  *                         ctxt, c_read_callback, NULL, c_callback_context,
62003  */
62004       __pyx_t_1 = __pyx_v_ctxt->html;
62005       if (__pyx_t_1) {
62006
62007         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":330
62008  *                 result = htmlparser.htmlCtxtReadIO(
62009  *                         ctxt, c_read_callback, NULL, c_callback_context,
62010  *                         self._c_url, c_encoding, options)             # <<<<<<<<<<<<<<
62011  *                 if result is not NULL:
62012  *                     if _fixHtmlDictNames(ctxt.dict, result) < 0:
62013  */
62014         __pyx_v_result = htmlCtxtReadIO(__pyx_v_ctxt, __pyx_v_c_read_callback, NULL, __pyx_v_c_callback_context, __pyx_v_self->_c_url, __pyx_v_c_encoding, __pyx_v_options);
62015
62016         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":331
62017  *                         ctxt, c_read_callback, NULL, c_callback_context,
62018  *                         self._c_url, c_encoding, options)
62019  *                 if result is not NULL:             # <<<<<<<<<<<<<<
62020  *                     if _fixHtmlDictNames(ctxt.dict, result) < 0:
62021  *                         tree.xmlFreeDoc(result)
62022  */
62023         __pyx_t_1 = (__pyx_v_result != NULL);
62024         if (__pyx_t_1) {
62025
62026           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":332
62027  *                         self._c_url, c_encoding, options)
62028  *                 if result is not NULL:
62029  *                     if _fixHtmlDictNames(ctxt.dict, result) < 0:             # <<<<<<<<<<<<<<
62030  *                         tree.xmlFreeDoc(result)
62031  *                         result = NULL
62032  */
62033           __pyx_t_1 = (__pyx_f_4lxml_5etree__fixHtmlDictNames(__pyx_v_ctxt->dict, __pyx_v_result) < 0);
62034           if (__pyx_t_1) {
62035
62036             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":333
62037  *                 if result is not NULL:
62038  *                     if _fixHtmlDictNames(ctxt.dict, result) < 0:
62039  *                         tree.xmlFreeDoc(result)             # <<<<<<<<<<<<<<
62040  *                         result = NULL
62041  *             else:
62042  */
62043             xmlFreeDoc(__pyx_v_result);
62044
62045             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":334
62046  *                     if _fixHtmlDictNames(ctxt.dict, result) < 0:
62047  *                         tree.xmlFreeDoc(result)
62048  *                         result = NULL             # <<<<<<<<<<<<<<
62049  *             else:
62050  *                 result = xmlparser.xmlCtxtReadIO(
62051  */
62052             __pyx_v_result = NULL;
62053             goto __pyx_L10;
62054           }
62055           __pyx_L10:;
62056           goto __pyx_L9;
62057         }
62058         __pyx_L9:;
62059         goto __pyx_L8;
62060       }
62061       /*else*/ {
62062
62063         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":338
62064  *                 result = xmlparser.xmlCtxtReadIO(
62065  *                     ctxt, c_read_callback, NULL, c_callback_context,
62066  *                     self._c_url, c_encoding, options)             # <<<<<<<<<<<<<<
62067  * 
62068  *         return result
62069  */
62070         __pyx_v_result = xmlCtxtReadIO(__pyx_v_ctxt, __pyx_v_c_read_callback, NULL, __pyx_v_c_callback_context, __pyx_v_self->_c_url, __pyx_v_c_encoding, __pyx_v_options);
62071       }
62072       __pyx_L8:;
62073     }
62074     /*finally:*/ {
62075       Py_BLOCK_THREADS
62076     }
62077   }
62078
62079   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":340
62080  *                     self._c_url, c_encoding, options)
62081  * 
62082  *         return result             # <<<<<<<<<<<<<<
62083  * 
62084  *     cdef int copyToBuffer(self, char* c_buffer, int c_requested):
62085  */
62086   __pyx_r = __pyx_v_result;
62087   goto __pyx_L0;
62088
62089   __pyx_r = 0;
62090   __pyx_L0:;
62091   __Pyx_FinishRefcountContext();
62092   return __pyx_r;
62093 }
62094
62095 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":342
62096  *         return result
62097  * 
62098  *     cdef int copyToBuffer(self, char* c_buffer, int c_requested):             # <<<<<<<<<<<<<<
62099  *         cdef int c_byte_count
62100  *         cdef char* c_start
62101  */
62102
62103 static  int __pyx_f_4lxml_5etree_18_FileReaderContext_copyToBuffer(struct __pyx_obj_4lxml_5etree__FileReaderContext *__pyx_v_self, char *__pyx_v_c_buffer, int __pyx_v_c_requested) {
62104   int __pyx_v_c_byte_count;
62105   char *__pyx_v_c_start;
62106   Py_ssize_t __pyx_v_byte_count;
62107   Py_ssize_t __pyx_v_remaining;
62108   int __pyx_r;
62109   int __pyx_t_1;
62110   PyObject *__pyx_t_2 = NULL;
62111   PyObject *__pyx_t_3 = NULL;
62112   PyObject *__pyx_t_4 = NULL;
62113   __Pyx_SetupRefcountContext("copyToBuffer");
62114
62115   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":346
62116  *         cdef char* c_start
62117  *         cdef Py_ssize_t byte_count, remaining
62118  *         if self._bytes_read < 0:             # <<<<<<<<<<<<<<
62119  *             return 0
62120  *         try:
62121  */
62122   __pyx_t_1 = (__pyx_v_self->_bytes_read < 0);
62123   if (__pyx_t_1) {
62124
62125     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":347
62126  *         cdef Py_ssize_t byte_count, remaining
62127  *         if self._bytes_read < 0:
62128  *             return 0             # <<<<<<<<<<<<<<
62129  *         try:
62130  *             c_byte_count = 0
62131  */
62132     __pyx_r = 0;
62133     goto __pyx_L0;
62134     goto __pyx_L3;
62135   }
62136   __pyx_L3:;
62137
62138   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":348
62139  *         if self._bytes_read < 0:
62140  *             return 0
62141  *         try:             # <<<<<<<<<<<<<<
62142  *             c_byte_count = 0
62143  *             byte_count = python.PyString_GET_SIZE(self._bytes)
62144  */
62145   {
62146     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
62147     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
62148     __Pyx_XGOTREF(__pyx_save_exc_type);
62149     __Pyx_XGOTREF(__pyx_save_exc_value);
62150     __Pyx_XGOTREF(__pyx_save_exc_tb);
62151     /*try:*/ {
62152
62153       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":349
62154  *             return 0
62155  *         try:
62156  *             c_byte_count = 0             # <<<<<<<<<<<<<<
62157  *             byte_count = python.PyString_GET_SIZE(self._bytes)
62158  *             remaining  = byte_count - self._bytes_read
62159  */
62160       __pyx_v_c_byte_count = 0;
62161
62162       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":350
62163  *         try:
62164  *             c_byte_count = 0
62165  *             byte_count = python.PyString_GET_SIZE(self._bytes)             # <<<<<<<<<<<<<<
62166  *             remaining  = byte_count - self._bytes_read
62167  *             while c_requested > remaining:
62168  */
62169       __pyx_v_byte_count = PyString_GET_SIZE(__pyx_v_self->_bytes);
62170
62171       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":351
62172  *             c_byte_count = 0
62173  *             byte_count = python.PyString_GET_SIZE(self._bytes)
62174  *             remaining  = byte_count - self._bytes_read             # <<<<<<<<<<<<<<
62175  *             while c_requested > remaining:
62176  *                 c_start = _cstr(self._bytes) + self._bytes_read
62177  */
62178       __pyx_v_remaining = (__pyx_v_byte_count - __pyx_v_self->_bytes_read);
62179
62180       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":352
62181  *             byte_count = python.PyString_GET_SIZE(self._bytes)
62182  *             remaining  = byte_count - self._bytes_read
62183  *             while c_requested > remaining:             # <<<<<<<<<<<<<<
62184  *                 c_start = _cstr(self._bytes) + self._bytes_read
62185  *                 cstd.memcpy(c_buffer, c_start, remaining)
62186  */
62187       while (1) {
62188         __pyx_t_1 = (__pyx_v_c_requested > __pyx_v_remaining);
62189         if (!__pyx_t_1) break;
62190
62191         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":353
62192  *             remaining  = byte_count - self._bytes_read
62193  *             while c_requested > remaining:
62194  *                 c_start = _cstr(self._bytes) + self._bytes_read             # <<<<<<<<<<<<<<
62195  *                 cstd.memcpy(c_buffer, c_start, remaining)
62196  *                 c_byte_count += remaining
62197  */
62198         __pyx_v_c_start = (PyString_AS_STRING(__pyx_v_self->_bytes) + __pyx_v_self->_bytes_read);
62199
62200         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":354
62201  *             while c_requested > remaining:
62202  *                 c_start = _cstr(self._bytes) + self._bytes_read
62203  *                 cstd.memcpy(c_buffer, c_start, remaining)             # <<<<<<<<<<<<<<
62204  *                 c_byte_count += remaining
62205  *                 c_buffer += remaining
62206  */
62207         memcpy(__pyx_v_c_buffer, __pyx_v_c_start, __pyx_v_remaining);
62208
62209         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":355
62210  *                 c_start = _cstr(self._bytes) + self._bytes_read
62211  *                 cstd.memcpy(c_buffer, c_start, remaining)
62212  *                 c_byte_count += remaining             # <<<<<<<<<<<<<<
62213  *                 c_buffer += remaining
62214  *                 c_requested -= remaining
62215  */
62216         __pyx_v_c_byte_count += __pyx_v_remaining;
62217
62218         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":356
62219  *                 cstd.memcpy(c_buffer, c_start, remaining)
62220  *                 c_byte_count += remaining
62221  *                 c_buffer += remaining             # <<<<<<<<<<<<<<
62222  *                 c_requested -= remaining
62223  * 
62224  */
62225         __pyx_v_c_buffer += __pyx_v_remaining;
62226
62227         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":357
62228  *                 c_byte_count += remaining
62229  *                 c_buffer += remaining
62230  *                 c_requested -= remaining             # <<<<<<<<<<<<<<
62231  * 
62232  *                 self._bytes = self._filelike.read(c_requested)
62233  */
62234         __pyx_v_c_requested -= __pyx_v_remaining;
62235
62236         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":359
62237  *                 c_requested -= remaining
62238  * 
62239  *                 self._bytes = self._filelike.read(c_requested)             # <<<<<<<<<<<<<<
62240  *                 if not python.PyString_Check(self._bytes):
62241  *                     if python.PyUnicode_Check(self._bytes):
62242  */
62243         __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->_filelike, __pyx_kp_read); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
62244         __Pyx_GOTREF(__pyx_t_2);
62245         __pyx_t_3 = PyInt_FromLong(__pyx_v_c_requested); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
62246         __Pyx_GOTREF(__pyx_t_3);
62247         __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
62248         __Pyx_GOTREF(((PyObject *)__pyx_t_4));
62249         PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
62250         __Pyx_GIVEREF(__pyx_t_3);
62251         __pyx_t_3 = 0;
62252         __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
62253         __Pyx_GOTREF(__pyx_t_3);
62254         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
62255         __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
62256         __Pyx_GIVEREF(__pyx_t_3);
62257         __Pyx_GOTREF(__pyx_v_self->_bytes);
62258         __Pyx_DECREF(__pyx_v_self->_bytes);
62259         __pyx_v_self->_bytes = __pyx_t_3;
62260         __pyx_t_3 = 0;
62261
62262         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":360
62263  * 
62264  *                 self._bytes = self._filelike.read(c_requested)
62265  *                 if not python.PyString_Check(self._bytes):             # <<<<<<<<<<<<<<
62266  *                     if python.PyUnicode_Check(self._bytes):
62267  *                         if self._encoding is None:
62268  */
62269         __pyx_t_1 = (!PyString_Check(__pyx_v_self->_bytes));
62270         if (__pyx_t_1) {
62271
62272           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":361
62273  *                 self._bytes = self._filelike.read(c_requested)
62274  *                 if not python.PyString_Check(self._bytes):
62275  *                     if python.PyUnicode_Check(self._bytes):             # <<<<<<<<<<<<<<
62276  *                         if self._encoding is None:
62277  *                             self._bytes = python.PyUnicode_AsUTF8String(self._bytes)
62278  */
62279           __pyx_t_1 = PyUnicode_Check(__pyx_v_self->_bytes);
62280           if (__pyx_t_1) {
62281
62282             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":362
62283  *                 if not python.PyString_Check(self._bytes):
62284  *                     if python.PyUnicode_Check(self._bytes):
62285  *                         if self._encoding is None:             # <<<<<<<<<<<<<<
62286  *                             self._bytes = python.PyUnicode_AsUTF8String(self._bytes)
62287  *                         else:
62288  */
62289             __pyx_t_1 = (__pyx_v_self->_encoding == Py_None);
62290             if (__pyx_t_1) {
62291
62292               /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":363
62293  *                     if python.PyUnicode_Check(self._bytes):
62294  *                         if self._encoding is None:
62295  *                             self._bytes = python.PyUnicode_AsUTF8String(self._bytes)             # <<<<<<<<<<<<<<
62296  *                         else:
62297  *                             self._bytes = python.PyUnicode_AsEncodedString(
62298  */
62299               __pyx_t_3 = PyUnicode_AsUTF8String(__pyx_v_self->_bytes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
62300               __Pyx_GOTREF(__pyx_t_3);
62301               __Pyx_GIVEREF(__pyx_t_3);
62302               __Pyx_GOTREF(__pyx_v_self->_bytes);
62303               __Pyx_DECREF(__pyx_v_self->_bytes);
62304               __pyx_v_self->_bytes = __pyx_t_3;
62305               __pyx_t_3 = 0;
62306               goto __pyx_L16;
62307             }
62308             /*else*/ {
62309
62310               /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":366
62311  *                         else:
62312  *                             self._bytes = python.PyUnicode_AsEncodedString(
62313  *                                 self._bytes, _cstr(self._encoding), NULL)             # <<<<<<<<<<<<<<
62314  *                     else:
62315  *                         raise TypeError, \
62316  */
62317               __pyx_t_3 = PyUnicode_AsEncodedString(__pyx_v_self->_bytes, PyString_AS_STRING(__pyx_v_self->_encoding), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
62318               __Pyx_GOTREF(__pyx_t_3);
62319
62320               /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":365
62321  *                             self._bytes = python.PyUnicode_AsUTF8String(self._bytes)
62322  *                         else:
62323  *                             self._bytes = python.PyUnicode_AsEncodedString(             # <<<<<<<<<<<<<<
62324  *                                 self._bytes, _cstr(self._encoding), NULL)
62325  *                     else:
62326  */
62327               __Pyx_GIVEREF(__pyx_t_3);
62328               __Pyx_GOTREF(__pyx_v_self->_bytes);
62329               __Pyx_DECREF(__pyx_v_self->_bytes);
62330               __pyx_v_self->_bytes = __pyx_t_3;
62331               __pyx_t_3 = 0;
62332             }
62333             __pyx_L16:;
62334             goto __pyx_L15;
62335           }
62336           /*else*/ {
62337
62338             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":369
62339  *                     else:
62340  *                         raise TypeError, \
62341  *                             u"reading from file-like objects must return byte strings or unicode strings"             # <<<<<<<<<<<<<<
62342  * 
62343  *                 remaining = python.PyString_GET_SIZE(self._bytes)
62344  */
62345             __Pyx_Raise(__pyx_builtin_TypeError, ((PyObject *)__pyx_kp_437), 0);
62346             {__pyx_filename = __pyx_f[2]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
62347           }
62348           __pyx_L15:;
62349           goto __pyx_L14;
62350         }
62351         __pyx_L14:;
62352
62353         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":371
62354  *                             u"reading from file-like objects must return byte strings or unicode strings"
62355  * 
62356  *                 remaining = python.PyString_GET_SIZE(self._bytes)             # <<<<<<<<<<<<<<
62357  *                 if remaining == 0:
62358  *                     self._bytes_read = -1
62359  */
62360         __pyx_v_remaining = PyString_GET_SIZE(__pyx_v_self->_bytes);
62361
62362         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":372
62363  * 
62364  *                 remaining = python.PyString_GET_SIZE(self._bytes)
62365  *                 if remaining == 0:             # <<<<<<<<<<<<<<
62366  *                     self._bytes_read = -1
62367  *                     return c_byte_count
62368  */
62369         __pyx_t_1 = (__pyx_v_remaining == 0);
62370         if (__pyx_t_1) {
62371
62372           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":373
62373  *                 remaining = python.PyString_GET_SIZE(self._bytes)
62374  *                 if remaining == 0:
62375  *                     self._bytes_read = -1             # <<<<<<<<<<<<<<
62376  *                     return c_byte_count
62377  *                 self._bytes_read = 0
62378  */
62379           __pyx_v_self->_bytes_read = -1;
62380
62381           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":374
62382  *                 if remaining == 0:
62383  *                     self._bytes_read = -1
62384  *                     return c_byte_count             # <<<<<<<<<<<<<<
62385  *                 self._bytes_read = 0
62386  * 
62387  */
62388           __pyx_r = __pyx_v_c_byte_count;
62389           goto __pyx_L8_try_return;
62390           goto __pyx_L17;
62391         }
62392         __pyx_L17:;
62393
62394         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":375
62395  *                     self._bytes_read = -1
62396  *                     return c_byte_count
62397  *                 self._bytes_read = 0             # <<<<<<<<<<<<<<
62398  * 
62399  *             if c_requested > 0:
62400  */
62401         __pyx_v_self->_bytes_read = 0;
62402       }
62403
62404       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":377
62405  *                 self._bytes_read = 0
62406  * 
62407  *             if c_requested > 0:             # <<<<<<<<<<<<<<
62408  *                 c_start = _cstr(self._bytes) + self._bytes_read
62409  *                 cstd.memcpy(c_buffer, c_start, c_requested)
62410  */
62411       __pyx_t_1 = (__pyx_v_c_requested > 0);
62412       if (__pyx_t_1) {
62413
62414         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":378
62415  * 
62416  *             if c_requested > 0:
62417  *                 c_start = _cstr(self._bytes) + self._bytes_read             # <<<<<<<<<<<<<<
62418  *                 cstd.memcpy(c_buffer, c_start, c_requested)
62419  *                 c_byte_count += c_requested
62420  */
62421         __pyx_v_c_start = (PyString_AS_STRING(__pyx_v_self->_bytes) + __pyx_v_self->_bytes_read);
62422
62423         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":379
62424  *             if c_requested > 0:
62425  *                 c_start = _cstr(self._bytes) + self._bytes_read
62426  *                 cstd.memcpy(c_buffer, c_start, c_requested)             # <<<<<<<<<<<<<<
62427  *                 c_byte_count += c_requested
62428  *                 self._bytes_read += c_requested
62429  */
62430         memcpy(__pyx_v_c_buffer, __pyx_v_c_start, __pyx_v_c_requested);
62431
62432         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":380
62433  *                 c_start = _cstr(self._bytes) + self._bytes_read
62434  *                 cstd.memcpy(c_buffer, c_start, c_requested)
62435  *                 c_byte_count += c_requested             # <<<<<<<<<<<<<<
62436  *                 self._bytes_read += c_requested
62437  *             return c_byte_count
62438  */
62439         __pyx_v_c_byte_count += __pyx_v_c_requested;
62440
62441         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":381
62442  *                 cstd.memcpy(c_buffer, c_start, c_requested)
62443  *                 c_byte_count += c_requested
62444  *                 self._bytes_read += c_requested             # <<<<<<<<<<<<<<
62445  *             return c_byte_count
62446  *         except:
62447  */
62448         __pyx_v_self->_bytes_read += __pyx_v_c_requested;
62449         goto __pyx_L18;
62450       }
62451       __pyx_L18:;
62452
62453       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":382
62454  *                 c_byte_count += c_requested
62455  *                 self._bytes_read += c_requested
62456  *             return c_byte_count             # <<<<<<<<<<<<<<
62457  *         except:
62458  *             self._exc_context._store_raised()
62459  */
62460       __pyx_r = __pyx_v_c_byte_count;
62461       goto __pyx_L8_try_return;
62462     }
62463     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
62464     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
62465     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
62466     goto __pyx_L11_try_end;
62467     __pyx_L8_try_return:;
62468     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
62469     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
62470     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
62471     goto __pyx_L0;
62472     __pyx_L4_error:;
62473     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
62474     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
62475     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
62476
62477     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":383
62478  *                 self._bytes_read += c_requested
62479  *             return c_byte_count
62480  *         except:             # <<<<<<<<<<<<<<
62481  *             self._exc_context._store_raised()
62482  *             return -1
62483  */
62484     /*except:*/ {
62485       __Pyx_AddTraceback("lxml.etree.copyToBuffer");
62486       if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
62487       __Pyx_GOTREF(__pyx_t_3);
62488       __Pyx_GOTREF(__pyx_t_4);
62489       __Pyx_GOTREF(__pyx_t_2);
62490
62491       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":384
62492  *             return c_byte_count
62493  *         except:
62494  *             self._exc_context._store_raised()             # <<<<<<<<<<<<<<
62495  *             return -1
62496  * 
62497  */
62498       ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_self->_exc_context->__pyx_vtab)->_store_raised(__pyx_v_self->_exc_context);
62499
62500       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":385
62501  *         except:
62502  *             self._exc_context._store_raised()
62503  *             return -1             # <<<<<<<<<<<<<<
62504  * 
62505  * cdef int _readFilelikeParser(void* ctxt, char* c_buffer, int c_size) with gil:
62506  */
62507       __pyx_r = -1;
62508       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
62509       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
62510       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
62511       goto __pyx_L7_except_return;
62512       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
62513       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
62514       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
62515       goto __pyx_L5_exception_handled;
62516     }
62517     __pyx_L6_except_error:;
62518     __Pyx_XDECREF(__pyx_save_exc_type);
62519     __Pyx_XDECREF(__pyx_save_exc_value);
62520     __Pyx_XDECREF(__pyx_save_exc_tb);
62521     goto __pyx_L1_error;
62522     __pyx_L7_except_return:;
62523     __Pyx_XGIVEREF(__pyx_save_exc_type);
62524     __Pyx_XGIVEREF(__pyx_save_exc_value);
62525     __Pyx_XGIVEREF(__pyx_save_exc_tb);
62526     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
62527     goto __pyx_L0;
62528     __pyx_L5_exception_handled:;
62529     __Pyx_XGIVEREF(__pyx_save_exc_type);
62530     __Pyx_XGIVEREF(__pyx_save_exc_value);
62531     __Pyx_XGIVEREF(__pyx_save_exc_tb);
62532     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
62533     __pyx_L11_try_end:;
62534   }
62535
62536   __pyx_r = 0;
62537   goto __pyx_L0;
62538   __pyx_L1_error:;
62539   __Pyx_XDECREF(__pyx_t_2);
62540   __Pyx_XDECREF(__pyx_t_3);
62541   __Pyx_XDECREF(__pyx_t_4);
62542   __Pyx_WriteUnraisable("lxml.etree._FileReaderContext.copyToBuffer");
62543   __pyx_r = 0;
62544   __pyx_L0:;
62545   __Pyx_FinishRefcountContext();
62546   return __pyx_r;
62547 }
62548
62549 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":387
62550  *             return -1
62551  * 
62552  * cdef int _readFilelikeParser(void* ctxt, char* c_buffer, int c_size) with gil:             # <<<<<<<<<<<<<<
62553  *     return (<_FileReaderContext>ctxt).copyToBuffer(c_buffer, c_size)
62554  * 
62555  */
62556
62557 static  int __pyx_f_4lxml_5etree__readFilelikeParser(void *__pyx_v_ctxt, char *__pyx_v_c_buffer, int __pyx_v_c_size) {
62558   int __pyx_r;
62559   PyGILState_STATE _save = PyGILState_Ensure();
62560   __Pyx_SetupRefcountContext("_readFilelikeParser");
62561
62562   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":388
62563  * 
62564  * cdef int _readFilelikeParser(void* ctxt, char* c_buffer, int c_size) with gil:
62565  *     return (<_FileReaderContext>ctxt).copyToBuffer(c_buffer, c_size)             # <<<<<<<<<<<<<<
62566  * 
62567  * cdef int _readFileParser(void* ctxt, char* c_buffer, int c_size) nogil:
62568  */
62569   __pyx_r = ((struct __pyx_vtabstruct_4lxml_5etree__FileReaderContext *)((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_ctxt)->__pyx_vtab)->copyToBuffer(((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_ctxt), __pyx_v_c_buffer, __pyx_v_c_size);
62570   goto __pyx_L0;
62571
62572   __pyx_r = 0;
62573   __pyx_L0:;
62574   __Pyx_FinishRefcountContext();
62575   PyGILState_Release(_save);
62576   return __pyx_r;
62577 }
62578
62579 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":390
62580  *     return (<_FileReaderContext>ctxt).copyToBuffer(c_buffer, c_size)
62581  * 
62582  * cdef int _readFileParser(void* ctxt, char* c_buffer, int c_size) nogil:             # <<<<<<<<<<<<<<
62583  *     return cstd.fread(c_buffer, 1,  c_size, <cstd.FILE*>ctxt)
62584  * 
62585  */
62586
62587 static  int __pyx_f_4lxml_5etree__readFileParser(void *__pyx_v_ctxt, char *__pyx_v_c_buffer, int __pyx_v_c_size) {
62588   int __pyx_r;
62589
62590   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":391
62591  * 
62592  * cdef int _readFileParser(void* ctxt, char* c_buffer, int c_size) nogil:
62593  *     return cstd.fread(c_buffer, 1,  c_size, <cstd.FILE*>ctxt)             # <<<<<<<<<<<<<<
62594  * 
62595  * ############################################################
62596  */
62597   __pyx_r = fread(__pyx_v_c_buffer, 1, __pyx_v_c_size, ((FILE *)__pyx_v_ctxt));
62598   goto __pyx_L0;
62599
62600   __pyx_r = 0;
62601   __pyx_L0:;
62602   return __pyx_r;
62603 }
62604
62605 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":397
62606  * ############################################################
62607  * 
62608  * cdef xmlparser.xmlParserInput* _local_resolver(char* c_url, char* c_pubid,             # <<<<<<<<<<<<<<
62609  *                                                xmlparser.xmlParserCtxt* c_context) with gil:
62610  *     cdef _ResolverContext context
62611  */
62612
62613 static  xmlParserInput *__pyx_f_4lxml_5etree__local_resolver(char *__pyx_v_c_url, char *__pyx_v_c_pubid, xmlParserCtxt *__pyx_v_c_context) {
62614   struct __pyx_obj_4lxml_5etree__ResolverContext *__pyx_v_context;
62615   xmlParserInput *__pyx_v_c_input;
62616   struct __pyx_obj_4lxml_5etree__InputDocument *__pyx_v_doc_ref;
62617   struct __pyx_obj_4lxml_5etree__FileReaderContext *__pyx_v_file_context;
62618   PyObject *__pyx_v_url;
62619   PyObject *__pyx_v_pubid;
62620   PyObject *__pyx_v_data;
62621   xmlParserInput *__pyx_r;
62622   int __pyx_t_1;
62623   PyObject *__pyx_t_2 = NULL;
62624   PyObject *__pyx_t_3 = NULL;
62625   PyObject *__pyx_t_4 = NULL;
62626   int __pyx_t_5;
62627   PyGILState_STATE _save = PyGILState_Ensure();
62628   __Pyx_SetupRefcountContext("_local_resolver");
62629   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ResolverContext *)Py_None); __Pyx_INCREF(Py_None);
62630   __pyx_v_doc_ref = ((struct __pyx_obj_4lxml_5etree__InputDocument *)Py_None); __Pyx_INCREF(Py_None);
62631   __pyx_v_file_context = ((struct __pyx_obj_4lxml_5etree__FileReaderContext *)Py_None); __Pyx_INCREF(Py_None);
62632   __pyx_v_url = Py_None; __Pyx_INCREF(Py_None);
62633   __pyx_v_pubid = Py_None; __Pyx_INCREF(Py_None);
62634   __pyx_v_data = Py_None; __Pyx_INCREF(Py_None);
62635
62636   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":406
62637  *     # passed, check to see if the thread state object has an implied
62638  *     # context.
62639  *     if c_context._private is not NULL:             # <<<<<<<<<<<<<<
62640  *         context = <_ResolverContext>c_context._private
62641  *     else:
62642  */
62643   __pyx_t_1 = (__pyx_v_c_context->_private != NULL);
62644   if (__pyx_t_1) {
62645
62646     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":407
62647  *     # context.
62648  *     if c_context._private is not NULL:
62649  *         context = <_ResolverContext>c_context._private             # <<<<<<<<<<<<<<
62650  *     else:
62651  *         context = __GLOBAL_PARSER_CONTEXT.findImpliedContext()
62652  */
62653     __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__ResolverContext *)__pyx_v_c_context->_private)));
62654     __Pyx_DECREF(((PyObject *)__pyx_v_context));
62655     __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ResolverContext *)__pyx_v_c_context->_private);
62656     goto __pyx_L3;
62657   }
62658   /*else*/ {
62659
62660     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":409
62661  *         context = <_ResolverContext>c_context._private
62662  *     else:
62663  *         context = __GLOBAL_PARSER_CONTEXT.findImpliedContext()             # <<<<<<<<<<<<<<
62664  * 
62665  *     if context is None:
62666  */
62667     __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->findImpliedContext(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
62668     __Pyx_GOTREF(__pyx_t_2);
62669     __Pyx_DECREF(((PyObject *)__pyx_v_context));
62670     __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ResolverContext *)__pyx_t_2);
62671     __pyx_t_2 = 0;
62672   }
62673   __pyx_L3:;
62674
62675   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":411
62676  *         context = __GLOBAL_PARSER_CONTEXT.findImpliedContext()
62677  * 
62678  *     if context is None:             # <<<<<<<<<<<<<<
62679  *         if __DEFAULT_ENTITY_LOADER is NULL:
62680  *             return NULL
62681  */
62682   __pyx_t_1 = (((PyObject *)__pyx_v_context) == Py_None);
62683   if (__pyx_t_1) {
62684
62685     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":412
62686  * 
62687  *     if context is None:
62688  *         if __DEFAULT_ENTITY_LOADER is NULL:             # <<<<<<<<<<<<<<
62689  *             return NULL
62690  *         return __DEFAULT_ENTITY_LOADER(c_url, c_pubid, c_context)
62691  */
62692     __pyx_t_1 = (__pyx_v_4lxml_5etree___DEFAULT_ENTITY_LOADER == NULL);
62693     if (__pyx_t_1) {
62694
62695       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":413
62696  *     if context is None:
62697  *         if __DEFAULT_ENTITY_LOADER is NULL:
62698  *             return NULL             # <<<<<<<<<<<<<<
62699  *         return __DEFAULT_ENTITY_LOADER(c_url, c_pubid, c_context)
62700  * 
62701  */
62702       __pyx_r = NULL;
62703       goto __pyx_L0;
62704       goto __pyx_L5;
62705     }
62706     __pyx_L5:;
62707
62708     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":414
62709  *         if __DEFAULT_ENTITY_LOADER is NULL:
62710  *             return NULL
62711  *         return __DEFAULT_ENTITY_LOADER(c_url, c_pubid, c_context)             # <<<<<<<<<<<<<<
62712  * 
62713  *     try:
62714  */
62715     __pyx_r = __pyx_v_4lxml_5etree___DEFAULT_ENTITY_LOADER(__pyx_v_c_url, __pyx_v_c_pubid, __pyx_v_c_context);
62716     goto __pyx_L0;
62717     goto __pyx_L4;
62718   }
62719   __pyx_L4:;
62720
62721   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":416
62722  *         return __DEFAULT_ENTITY_LOADER(c_url, c_pubid, c_context)
62723  * 
62724  *     try:             # <<<<<<<<<<<<<<
62725  *         if c_url is NULL:
62726  *             url = None
62727  */
62728   {
62729     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
62730     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
62731     __Pyx_XGOTREF(__pyx_save_exc_type);
62732     __Pyx_XGOTREF(__pyx_save_exc_value);
62733     __Pyx_XGOTREF(__pyx_save_exc_tb);
62734     /*try:*/ {
62735
62736       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":417
62737  * 
62738  *     try:
62739  *         if c_url is NULL:             # <<<<<<<<<<<<<<
62740  *             url = None
62741  *         else:
62742  */
62743       __pyx_t_1 = (__pyx_v_c_url == NULL);
62744       if (__pyx_t_1) {
62745
62746         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":418
62747  *     try:
62748  *         if c_url is NULL:
62749  *             url = None             # <<<<<<<<<<<<<<
62750  *         else:
62751  *             # parsing a related document (DTD etc.) => UTF-8 encoded URL?
62752  */
62753         __Pyx_INCREF(Py_None);
62754         __Pyx_DECREF(__pyx_v_url);
62755         __pyx_v_url = Py_None;
62756         goto __pyx_L14;
62757       }
62758       /*else*/ {
62759
62760         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":421
62761  *         else:
62762  *             # parsing a related document (DTD etc.) => UTF-8 encoded URL?
62763  *             url = _decodeFilename(c_url)             # <<<<<<<<<<<<<<
62764  *         if c_pubid is NULL:
62765  *             pubid = None
62766  */
62767         __pyx_t_2 = __pyx_f_4lxml_5etree__decodeFilename(__pyx_v_c_url); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
62768         __Pyx_GOTREF(__pyx_t_2);
62769         __Pyx_DECREF(__pyx_v_url);
62770         __pyx_v_url = __pyx_t_2;
62771         __pyx_t_2 = 0;
62772       }
62773       __pyx_L14:;
62774
62775       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":422
62776  *             # parsing a related document (DTD etc.) => UTF-8 encoded URL?
62777  *             url = _decodeFilename(c_url)
62778  *         if c_pubid is NULL:             # <<<<<<<<<<<<<<
62779  *             pubid = None
62780  *         else:
62781  */
62782       __pyx_t_1 = (__pyx_v_c_pubid == NULL);
62783       if (__pyx_t_1) {
62784
62785         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":423
62786  *             url = _decodeFilename(c_url)
62787  *         if c_pubid is NULL:
62788  *             pubid = None             # <<<<<<<<<<<<<<
62789  *         else:
62790  *             pubid = funicode(c_pubid) # always UTF-8
62791  */
62792         __Pyx_INCREF(Py_None);
62793         __Pyx_DECREF(__pyx_v_pubid);
62794         __pyx_v_pubid = Py_None;
62795         goto __pyx_L15;
62796       }
62797       /*else*/ {
62798
62799         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":425
62800  *             pubid = None
62801  *         else:
62802  *             pubid = funicode(c_pubid) # always UTF-8             # <<<<<<<<<<<<<<
62803  * 
62804  *         doc_ref = context._resolvers.resolve(url, pubid, context)
62805  */
62806         __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_pubid); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
62807         __Pyx_GOTREF(__pyx_t_2);
62808         __Pyx_DECREF(__pyx_v_pubid);
62809         __pyx_v_pubid = __pyx_t_2;
62810         __pyx_t_2 = 0;
62811       }
62812       __pyx_L15:;
62813
62814       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":427
62815  *             pubid = funicode(c_pubid) # always UTF-8
62816  * 
62817  *         doc_ref = context._resolvers.resolve(url, pubid, context)             # <<<<<<<<<<<<<<
62818  *     except:
62819  *         context._store_raised()
62820  */
62821       __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_context->_resolvers), __pyx_kp_resolve); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
62822       __Pyx_GOTREF(__pyx_t_2);
62823       __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
62824       __Pyx_GOTREF(((PyObject *)__pyx_t_3));
62825       __Pyx_INCREF(__pyx_v_url);
62826       PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_url);
62827       __Pyx_GIVEREF(__pyx_v_url);
62828       __Pyx_INCREF(__pyx_v_pubid);
62829       PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_pubid);
62830       __Pyx_GIVEREF(__pyx_v_pubid);
62831       __Pyx_INCREF(((PyObject *)__pyx_v_context));
62832       PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_context));
62833       __Pyx_GIVEREF(((PyObject *)__pyx_v_context));
62834       __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
62835       __Pyx_GOTREF(__pyx_t_4);
62836       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
62837       __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
62838       if (!(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__InputDocument))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
62839       __Pyx_DECREF(((PyObject *)__pyx_v_doc_ref));
62840       __pyx_v_doc_ref = ((struct __pyx_obj_4lxml_5etree__InputDocument *)__pyx_t_4);
62841       __pyx_t_4 = 0;
62842     }
62843     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
62844     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
62845     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
62846     goto __pyx_L13_try_end;
62847     __pyx_L6_error:;
62848     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
62849     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
62850     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
62851
62852     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":428
62853  * 
62854  *         doc_ref = context._resolvers.resolve(url, pubid, context)
62855  *     except:             # <<<<<<<<<<<<<<
62856  *         context._store_raised()
62857  *         return NULL
62858  */
62859     /*except:*/ {
62860       __Pyx_AddTraceback("lxml.etree._local_resolver");
62861       if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
62862       __Pyx_GOTREF(__pyx_t_4);
62863       __Pyx_GOTREF(__pyx_t_3);
62864       __Pyx_GOTREF(__pyx_t_2);
62865
62866       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":429
62867  *         doc_ref = context._resolvers.resolve(url, pubid, context)
62868  *     except:
62869  *         context._store_raised()             # <<<<<<<<<<<<<<
62870  *         return NULL
62871  * 
62872  */
62873       ((struct __pyx_vtabstruct_4lxml_5etree__ResolverContext *)__pyx_v_context->__pyx_base.__pyx_vtab)->__pyx_base._store_raised(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_context));
62874
62875       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":430
62876  *     except:
62877  *         context._store_raised()
62878  *         return NULL             # <<<<<<<<<<<<<<
62879  * 
62880  *     if doc_ref is not None:
62881  */
62882       __pyx_r = NULL;
62883       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
62884       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
62885       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
62886       goto __pyx_L9_except_return;
62887       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
62888       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
62889       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
62890       goto __pyx_L7_exception_handled;
62891     }
62892     __pyx_L8_except_error:;
62893     __Pyx_XDECREF(__pyx_save_exc_type);
62894     __Pyx_XDECREF(__pyx_save_exc_value);
62895     __Pyx_XDECREF(__pyx_save_exc_tb);
62896     goto __pyx_L1_error;
62897     __pyx_L9_except_return:;
62898     __Pyx_XGIVEREF(__pyx_save_exc_type);
62899     __Pyx_XGIVEREF(__pyx_save_exc_value);
62900     __Pyx_XGIVEREF(__pyx_save_exc_tb);
62901     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
62902     goto __pyx_L0;
62903     __pyx_L7_exception_handled:;
62904     __Pyx_XGIVEREF(__pyx_save_exc_type);
62905     __Pyx_XGIVEREF(__pyx_save_exc_value);
62906     __Pyx_XGIVEREF(__pyx_save_exc_tb);
62907     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
62908     __pyx_L13_try_end:;
62909   }
62910
62911   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":432
62912  *         return NULL
62913  * 
62914  *     if doc_ref is not None:             # <<<<<<<<<<<<<<
62915  *         if doc_ref._type == PARSER_DATA_STRING:
62916  *             data = doc_ref._data_bytes
62917  */
62918   __pyx_t_1 = (((PyObject *)__pyx_v_doc_ref) != Py_None);
62919   if (__pyx_t_1) {
62920
62921     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":433
62922  * 
62923  *     if doc_ref is not None:
62924  *         if doc_ref._type == PARSER_DATA_STRING:             # <<<<<<<<<<<<<<
62925  *             data = doc_ref._data_bytes
62926  *             c_input = xmlparser.xmlNewInputStream(c_context)
62927  */
62928     __pyx_t_1 = (__pyx_v_doc_ref->_type == __pyx_e_4lxml_5etree_PARSER_DATA_STRING);
62929     if (__pyx_t_1) {
62930
62931       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":434
62932  *     if doc_ref is not None:
62933  *         if doc_ref._type == PARSER_DATA_STRING:
62934  *             data = doc_ref._data_bytes             # <<<<<<<<<<<<<<
62935  *             c_input = xmlparser.xmlNewInputStream(c_context)
62936  *             if c_input is not NULL:
62937  */
62938       __Pyx_INCREF(__pyx_v_doc_ref->_data_bytes);
62939       __Pyx_DECREF(__pyx_v_data);
62940       __pyx_v_data = __pyx_v_doc_ref->_data_bytes;
62941
62942       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":435
62943  *         if doc_ref._type == PARSER_DATA_STRING:
62944  *             data = doc_ref._data_bytes
62945  *             c_input = xmlparser.xmlNewInputStream(c_context)             # <<<<<<<<<<<<<<
62946  *             if c_input is not NULL:
62947  *                 c_input.base = _cstr(data)
62948  */
62949       __pyx_v_c_input = xmlNewInputStream(__pyx_v_c_context);
62950
62951       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":436
62952  *             data = doc_ref._data_bytes
62953  *             c_input = xmlparser.xmlNewInputStream(c_context)
62954  *             if c_input is not NULL:             # <<<<<<<<<<<<<<
62955  *                 c_input.base = _cstr(data)
62956  *                 c_input.length = python.PyString_GET_SIZE(data)
62957  */
62958       __pyx_t_1 = (__pyx_v_c_input != NULL);
62959       if (__pyx_t_1) {
62960
62961         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":437
62962  *             c_input = xmlparser.xmlNewInputStream(c_context)
62963  *             if c_input is not NULL:
62964  *                 c_input.base = _cstr(data)             # <<<<<<<<<<<<<<
62965  *                 c_input.length = python.PyString_GET_SIZE(data)
62966  *                 c_input.cur = c_input.base
62967  */
62968         __pyx_v_c_input->base = PyString_AS_STRING(__pyx_v_data);
62969
62970         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":438
62971  *             if c_input is not NULL:
62972  *                 c_input.base = _cstr(data)
62973  *                 c_input.length = python.PyString_GET_SIZE(data)             # <<<<<<<<<<<<<<
62974  *                 c_input.cur = c_input.base
62975  *                 c_input.end = &c_input.base[c_input.length]
62976  */
62977         __pyx_v_c_input->length = PyString_GET_SIZE(__pyx_v_data);
62978
62979         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":439
62980  *                 c_input.base = _cstr(data)
62981  *                 c_input.length = python.PyString_GET_SIZE(data)
62982  *                 c_input.cur = c_input.base             # <<<<<<<<<<<<<<
62983  *                 c_input.end = &c_input.base[c_input.length]
62984  *         elif doc_ref._type == PARSER_DATA_FILENAME:
62985  */
62986         __pyx_v_c_input->cur = __pyx_v_c_input->base;
62987
62988         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":440
62989  *                 c_input.length = python.PyString_GET_SIZE(data)
62990  *                 c_input.cur = c_input.base
62991  *                 c_input.end = &c_input.base[c_input.length]             # <<<<<<<<<<<<<<
62992  *         elif doc_ref._type == PARSER_DATA_FILENAME:
62993  *             c_input = xmlparser.xmlNewInputFromFile(
62994  */
62995         __pyx_v_c_input->end = (&(__pyx_v_c_input->base[__pyx_v_c_input->length]));
62996         goto __pyx_L20;
62997       }
62998       __pyx_L20:;
62999       goto __pyx_L19;
63000     }
63001
63002     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":441
63003  *                 c_input.cur = c_input.base
63004  *                 c_input.end = &c_input.base[c_input.length]
63005  *         elif doc_ref._type == PARSER_DATA_FILENAME:             # <<<<<<<<<<<<<<
63006  *             c_input = xmlparser.xmlNewInputFromFile(
63007  *                 c_context, _cstr(doc_ref._filename))
63008  */
63009     __pyx_t_1 = (__pyx_v_doc_ref->_type == __pyx_e_4lxml_5etree_PARSER_DATA_FILENAME);
63010     if (__pyx_t_1) {
63011
63012       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":443
63013  *         elif doc_ref._type == PARSER_DATA_FILENAME:
63014  *             c_input = xmlparser.xmlNewInputFromFile(
63015  *                 c_context, _cstr(doc_ref._filename))             # <<<<<<<<<<<<<<
63016  *         elif doc_ref._type == PARSER_DATA_FILE:
63017  *             file_context = _FileReaderContext(doc_ref._file, context, url, None)
63018  */
63019       __pyx_v_c_input = xmlNewInputFromFile(__pyx_v_c_context, PyString_AS_STRING(__pyx_v_doc_ref->_filename));
63020       goto __pyx_L19;
63021     }
63022
63023     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":444
63024  *             c_input = xmlparser.xmlNewInputFromFile(
63025  *                 c_context, _cstr(doc_ref._filename))
63026  *         elif doc_ref._type == PARSER_DATA_FILE:             # <<<<<<<<<<<<<<
63027  *             file_context = _FileReaderContext(doc_ref._file, context, url, None)
63028  *             c_input = file_context._createParserInput(c_context)
63029  */
63030     __pyx_t_1 = (__pyx_v_doc_ref->_type == __pyx_e_4lxml_5etree_PARSER_DATA_FILE);
63031     if (__pyx_t_1) {
63032
63033       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":445
63034  *                 c_context, _cstr(doc_ref._filename))
63035  *         elif doc_ref._type == PARSER_DATA_FILE:
63036  *             file_context = _FileReaderContext(doc_ref._file, context, url, None)             # <<<<<<<<<<<<<<
63037  *             c_input = file_context._createParserInput(c_context)
63038  *             data = file_context
63039  */
63040       __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
63041       __Pyx_GOTREF(((PyObject *)__pyx_t_2));
63042       __Pyx_INCREF(__pyx_v_doc_ref->_file);
63043       PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_doc_ref->_file);
63044       __Pyx_GIVEREF(__pyx_v_doc_ref->_file);
63045       __Pyx_INCREF(((PyObject *)__pyx_v_context));
63046       PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_context));
63047       __Pyx_GIVEREF(((PyObject *)__pyx_v_context));
63048       __Pyx_INCREF(__pyx_v_url);
63049       PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_url);
63050       __Pyx_GIVEREF(__pyx_v_url);
63051       __Pyx_INCREF(Py_None);
63052       PyTuple_SET_ITEM(__pyx_t_2, 3, Py_None);
63053       __Pyx_GIVEREF(Py_None);
63054       __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__FileReaderContext)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
63055       __Pyx_GOTREF(__pyx_t_3);
63056       __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
63057       if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4lxml_5etree__FileReaderContext))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
63058       __Pyx_DECREF(((PyObject *)__pyx_v_file_context));
63059       __pyx_v_file_context = ((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_t_3);
63060       __pyx_t_3 = 0;
63061
63062       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":446
63063  *         elif doc_ref._type == PARSER_DATA_FILE:
63064  *             file_context = _FileReaderContext(doc_ref._file, context, url, None)
63065  *             c_input = file_context._createParserInput(c_context)             # <<<<<<<<<<<<<<
63066  *             data = file_context
63067  *         else:
63068  */
63069       __pyx_v_c_input = ((struct __pyx_vtabstruct_4lxml_5etree__FileReaderContext *)__pyx_v_file_context->__pyx_vtab)->_createParserInput(__pyx_v_file_context, __pyx_v_c_context);
63070
63071       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":447
63072  *             file_context = _FileReaderContext(doc_ref._file, context, url, None)
63073  *             c_input = file_context._createParserInput(c_context)
63074  *             data = file_context             # <<<<<<<<<<<<<<
63075  *         else:
63076  *             data = None
63077  */
63078       __Pyx_INCREF(((PyObject *)__pyx_v_file_context));
63079       __Pyx_DECREF(__pyx_v_data);
63080       __pyx_v_data = ((PyObject *)__pyx_v_file_context);
63081       goto __pyx_L19;
63082     }
63083     /*else*/ {
63084
63085       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":449
63086  *             data = file_context
63087  *         else:
63088  *             data = None             # <<<<<<<<<<<<<<
63089  *             c_input = NULL
63090  * 
63091  */
63092       __Pyx_INCREF(Py_None);
63093       __Pyx_DECREF(__pyx_v_data);
63094       __pyx_v_data = Py_None;
63095
63096       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":450
63097  *         else:
63098  *             data = None
63099  *             c_input = NULL             # <<<<<<<<<<<<<<
63100  * 
63101  *         if data is not None:
63102  */
63103       __pyx_v_c_input = NULL;
63104     }
63105     __pyx_L19:;
63106
63107     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":452
63108  *             c_input = NULL
63109  * 
63110  *         if data is not None:             # <<<<<<<<<<<<<<
63111  *             context._storage.add(data)
63112  *         if c_input is not NULL:
63113  */
63114     __pyx_t_1 = (__pyx_v_data != Py_None);
63115     if (__pyx_t_1) {
63116
63117       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":453
63118  * 
63119  *         if data is not None:
63120  *             context._storage.add(data)             # <<<<<<<<<<<<<<
63121  *         if c_input is not NULL:
63122  *             return c_input
63123  */
63124       __pyx_t_5 = ((struct __pyx_vtabstruct_4lxml_5etree__TempStore *)__pyx_v_context->_storage->__pyx_vtab)->add(__pyx_v_context->_storage, __pyx_v_data); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
63125       goto __pyx_L21;
63126     }
63127     __pyx_L21:;
63128
63129     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":454
63130  *         if data is not None:
63131  *             context._storage.add(data)
63132  *         if c_input is not NULL:             # <<<<<<<<<<<<<<
63133  *             return c_input
63134  * 
63135  */
63136     __pyx_t_1 = (__pyx_v_c_input != NULL);
63137     if (__pyx_t_1) {
63138
63139       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":455
63140  *             context._storage.add(data)
63141  *         if c_input is not NULL:
63142  *             return c_input             # <<<<<<<<<<<<<<
63143  * 
63144  *     if __DEFAULT_ENTITY_LOADER is NULL:
63145  */
63146       __pyx_r = __pyx_v_c_input;
63147       goto __pyx_L0;
63148       goto __pyx_L22;
63149     }
63150     __pyx_L22:;
63151     goto __pyx_L18;
63152   }
63153   __pyx_L18:;
63154
63155   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":457
63156  *             return c_input
63157  * 
63158  *     if __DEFAULT_ENTITY_LOADER is NULL:             # <<<<<<<<<<<<<<
63159  *         return NULL
63160  *     return __DEFAULT_ENTITY_LOADER(c_url, c_pubid, c_context)
63161  */
63162   __pyx_t_1 = (__pyx_v_4lxml_5etree___DEFAULT_ENTITY_LOADER == NULL);
63163   if (__pyx_t_1) {
63164
63165     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":458
63166  * 
63167  *     if __DEFAULT_ENTITY_LOADER is NULL:
63168  *         return NULL             # <<<<<<<<<<<<<<
63169  *     return __DEFAULT_ENTITY_LOADER(c_url, c_pubid, c_context)
63170  * 
63171  */
63172     __pyx_r = NULL;
63173     goto __pyx_L0;
63174     goto __pyx_L23;
63175   }
63176   __pyx_L23:;
63177
63178   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":459
63179  *     if __DEFAULT_ENTITY_LOADER is NULL:
63180  *         return NULL
63181  *     return __DEFAULT_ENTITY_LOADER(c_url, c_pubid, c_context)             # <<<<<<<<<<<<<<
63182  * 
63183  * cdef xmlparser.xmlExternalEntityLoader __DEFAULT_ENTITY_LOADER
63184  */
63185   __pyx_r = __pyx_v_4lxml_5etree___DEFAULT_ENTITY_LOADER(__pyx_v_c_url, __pyx_v_c_pubid, __pyx_v_c_context);
63186   goto __pyx_L0;
63187
63188   __pyx_r = 0;
63189   goto __pyx_L0;
63190   __pyx_L1_error:;
63191   __Pyx_XDECREF(__pyx_t_2);
63192   __Pyx_XDECREF(__pyx_t_3);
63193   __Pyx_XDECREF(__pyx_t_4);
63194   __Pyx_WriteUnraisable("lxml.etree._local_resolver");
63195   __pyx_r = 0;
63196   __pyx_L0:;
63197   __Pyx_DECREF((PyObject *)__pyx_v_context);
63198   __Pyx_DECREF((PyObject *)__pyx_v_doc_ref);
63199   __Pyx_DECREF((PyObject *)__pyx_v_file_context);
63200   __Pyx_DECREF(__pyx_v_url);
63201   __Pyx_DECREF(__pyx_v_pubid);
63202   __Pyx_DECREF(__pyx_v_data);
63203   __Pyx_FinishRefcountContext();
63204   PyGILState_Release(_save);
63205   return __pyx_r;
63206 }
63207
63208 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":476
63209  *     cdef python.PyThread_type_lock _lock
63210  * 
63211  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
63212  *         if self._validator is not None:
63213  *             self._validator.disconnect()
63214  */
63215
63216 static void __pyx_pf_4lxml_5etree_14_ParserContext___dealloc__(PyObject *__pyx_v_self); /*proto*/
63217 static void __pyx_pf_4lxml_5etree_14_ParserContext___dealloc__(PyObject *__pyx_v_self) {
63218   int __pyx_t_1;
63219   __Pyx_SetupRefcountContext("__dealloc__");
63220
63221   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":477
63222  * 
63223  *     def __dealloc__(self):
63224  *         if self._validator is not None:             # <<<<<<<<<<<<<<
63225  *             self._validator.disconnect()
63226  *         if self._lock is not NULL:
63227  */
63228   __pyx_t_1 = (((PyObject *)((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_v_self)->_validator) != Py_None);
63229   if (__pyx_t_1) {
63230
63231     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":478
63232  *     def __dealloc__(self):
63233  *         if self._validator is not None:
63234  *             self._validator.disconnect()             # <<<<<<<<<<<<<<
63235  *         if self._lock is not NULL:
63236  *             python.PyThread_free_lock(self._lock)
63237  */
63238     ((struct __pyx_vtabstruct_4lxml_5etree__ParserSchemaValidationContext *)((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_v_self)->_validator->__pyx_vtab)->disconnect(((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_v_self)->_validator);
63239     goto __pyx_L5;
63240   }
63241   __pyx_L5:;
63242
63243   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":479
63244  *         if self._validator is not None:
63245  *             self._validator.disconnect()
63246  *         if self._lock is not NULL:             # <<<<<<<<<<<<<<
63247  *             python.PyThread_free_lock(self._lock)
63248  *         if self._c_ctxt is not NULL:
63249  */
63250   __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_v_self)->_lock != NULL);
63251   if (__pyx_t_1) {
63252
63253     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":480
63254  *             self._validator.disconnect()
63255  *         if self._lock is not NULL:
63256  *             python.PyThread_free_lock(self._lock)             # <<<<<<<<<<<<<<
63257  *         if self._c_ctxt is not NULL:
63258  *             xmlparser.xmlFreeParserCtxt(self._c_ctxt)
63259  */
63260     PyThread_free_lock(((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_v_self)->_lock);
63261     goto __pyx_L6;
63262   }
63263   __pyx_L6:;
63264
63265   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":481
63266  *         if self._lock is not NULL:
63267  *             python.PyThread_free_lock(self._lock)
63268  *         if self._c_ctxt is not NULL:             # <<<<<<<<<<<<<<
63269  *             xmlparser.xmlFreeParserCtxt(self._c_ctxt)
63270  * 
63271  */
63272   __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_v_self)->_c_ctxt != NULL);
63273   if (__pyx_t_1) {
63274
63275     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":482
63276  *             python.PyThread_free_lock(self._lock)
63277  *         if self._c_ctxt is not NULL:
63278  *             xmlparser.xmlFreeParserCtxt(self._c_ctxt)             # <<<<<<<<<<<<<<
63279  * 
63280  *     cdef _ParserContext _copy(self):
63281  */
63282     xmlFreeParserCtxt(((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_v_self)->_c_ctxt);
63283     goto __pyx_L7;
63284   }
63285   __pyx_L7:;
63286
63287   __Pyx_FinishRefcountContext();
63288 }
63289
63290 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":484
63291  *             xmlparser.xmlFreeParserCtxt(self._c_ctxt)
63292  * 
63293  *     cdef _ParserContext _copy(self):             # <<<<<<<<<<<<<<
63294  *         cdef _ParserContext context
63295  *         context = self.__class__()
63296  */
63297
63298 static  struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_f_4lxml_5etree_14_ParserContext__copy(struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_self) {
63299   struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_context;
63300   struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_r = NULL;
63301   PyObject *__pyx_t_1 = NULL;
63302   PyObject *__pyx_t_2 = NULL;
63303   __Pyx_SetupRefcountContext("_copy");
63304   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); __Pyx_INCREF(Py_None);
63305
63306   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":486
63307  *     cdef _ParserContext _copy(self):
63308  *         cdef _ParserContext context
63309  *         context = self.__class__()             # <<<<<<<<<<<<<<
63310  *         context._validator = self._validator.copy()
63311  *         _initParserContext(context, self._resolvers._copy(), NULL)
63312  */
63313   __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_kp___class__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
63314   __Pyx_GOTREF(__pyx_t_1);
63315   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
63316   __Pyx_GOTREF(__pyx_t_2);
63317   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
63318   if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__ParserContext))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
63319   __Pyx_DECREF(((PyObject *)__pyx_v_context));
63320   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_t_2);
63321   __pyx_t_2 = 0;
63322
63323   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":487
63324  *         cdef _ParserContext context
63325  *         context = self.__class__()
63326  *         context._validator = self._validator.copy()             # <<<<<<<<<<<<<<
63327  *         _initParserContext(context, self._resolvers._copy(), NULL)
63328  *         return context
63329  */
63330   __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__ParserSchemaValidationContext *)__pyx_v_self->_validator->__pyx_vtab)->copy(__pyx_v_self->_validator)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
63331   __Pyx_GOTREF(__pyx_t_2);
63332   __Pyx_GIVEREF(__pyx_t_2);
63333   __Pyx_GOTREF(__pyx_v_context->_validator);
63334   __Pyx_DECREF(((PyObject *)__pyx_v_context->_validator));
63335   __pyx_v_context->_validator = ((struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *)__pyx_t_2);
63336   __pyx_t_2 = 0;
63337
63338   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":488
63339  *         context = self.__class__()
63340  *         context._validator = self._validator.copy()
63341  *         _initParserContext(context, self._resolvers._copy(), NULL)             # <<<<<<<<<<<<<<
63342  *         return context
63343  * 
63344  */
63345   __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__ResolverRegistry *)__pyx_v_self->__pyx_base._resolvers->__pyx_vtab)->_copy(__pyx_v_self->__pyx_base._resolvers)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
63346   __Pyx_GOTREF(__pyx_t_2);
63347   __pyx_t_1 = __pyx_f_4lxml_5etree__initParserContext(__pyx_v_context, ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
63348   __Pyx_GOTREF(__pyx_t_1);
63349   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
63350   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
63351
63352   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":489
63353  *         context._validator = self._validator.copy()
63354  *         _initParserContext(context, self._resolvers._copy(), NULL)
63355  *         return context             # <<<<<<<<<<<<<<
63356  * 
63357  *     cdef void _initParserContext(self, xmlparser.xmlParserCtxt* c_ctxt):
63358  */
63359   __Pyx_XDECREF(((PyObject *)__pyx_r));
63360   __Pyx_INCREF(((PyObject *)__pyx_v_context));
63361   __pyx_r = __pyx_v_context;
63362   goto __pyx_L0;
63363
63364   __pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); __Pyx_INCREF(Py_None);
63365   goto __pyx_L0;
63366   __pyx_L1_error:;
63367   __Pyx_XDECREF(__pyx_t_1);
63368   __Pyx_XDECREF(__pyx_t_2);
63369   __Pyx_AddTraceback("lxml.etree._ParserContext._copy");
63370   __pyx_r = 0;
63371   __pyx_L0:;
63372   __Pyx_DECREF((PyObject *)__pyx_v_context);
63373   __Pyx_XGIVEREF((PyObject *)__pyx_r);
63374   __Pyx_FinishRefcountContext();
63375   return __pyx_r;
63376 }
63377
63378 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":491
63379  *         return context
63380  * 
63381  *     cdef void _initParserContext(self, xmlparser.xmlParserCtxt* c_ctxt):             # <<<<<<<<<<<<<<
63382  *         self._c_ctxt = c_ctxt
63383  *         c_ctxt._private = <void*>self
63384  */
63385
63386 static  void __pyx_f_4lxml_5etree_14_ParserContext__initParserContext(struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_self, xmlParserCtxt *__pyx_v_c_ctxt) {
63387   __Pyx_SetupRefcountContext("_initParserContext");
63388
63389   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":492
63390  * 
63391  *     cdef void _initParserContext(self, xmlparser.xmlParserCtxt* c_ctxt):
63392  *         self._c_ctxt = c_ctxt             # <<<<<<<<<<<<<<
63393  *         c_ctxt._private = <void*>self
63394  * 
63395  */
63396   __pyx_v_self->_c_ctxt = __pyx_v_c_ctxt;
63397
63398   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":493
63399  *     cdef void _initParserContext(self, xmlparser.xmlParserCtxt* c_ctxt):
63400  *         self._c_ctxt = c_ctxt
63401  *         c_ctxt._private = <void*>self             # <<<<<<<<<<<<<<
63402  * 
63403  *     cdef void _resetParserContext(self):
63404  */
63405   __pyx_v_c_ctxt->_private = ((void *)__pyx_v_self);
63406
63407   __Pyx_FinishRefcountContext();
63408 }
63409
63410 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":495
63411  *         c_ctxt._private = <void*>self
63412  * 
63413  *     cdef void _resetParserContext(self):             # <<<<<<<<<<<<<<
63414  *         if self._c_ctxt is not NULL:
63415  *             if self._c_ctxt.html:
63416  */
63417
63418 static  void __pyx_f_4lxml_5etree_14_ParserContext__resetParserContext(struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_self) {
63419   int __pyx_t_1;
63420   __Pyx_SetupRefcountContext("_resetParserContext");
63421
63422   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":496
63423  * 
63424  *     cdef void _resetParserContext(self):
63425  *         if self._c_ctxt is not NULL:             # <<<<<<<<<<<<<<
63426  *             if self._c_ctxt.html:
63427  *                 htmlparser.htmlCtxtReset(self._c_ctxt)
63428  */
63429   __pyx_t_1 = (__pyx_v_self->_c_ctxt != NULL);
63430   if (__pyx_t_1) {
63431
63432     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":497
63433  *     cdef void _resetParserContext(self):
63434  *         if self._c_ctxt is not NULL:
63435  *             if self._c_ctxt.html:             # <<<<<<<<<<<<<<
63436  *                 htmlparser.htmlCtxtReset(self._c_ctxt)
63437  *             elif self._c_ctxt.spaceTab is not NULL or \
63438  */
63439     __pyx_t_1 = __pyx_v_self->_c_ctxt->html;
63440     if (__pyx_t_1) {
63441
63442       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":498
63443  *         if self._c_ctxt is not NULL:
63444  *             if self._c_ctxt.html:
63445  *                 htmlparser.htmlCtxtReset(self._c_ctxt)             # <<<<<<<<<<<<<<
63446  *             elif self._c_ctxt.spaceTab is not NULL or \
63447  *                     _LIBXML_VERSION_INT >= 20629: # work around bug in libxml2
63448  */
63449       htmlCtxtReset(__pyx_v_self->_c_ctxt);
63450       goto __pyx_L4;
63451     }
63452
63453     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":499
63454  *             if self._c_ctxt.html:
63455  *                 htmlparser.htmlCtxtReset(self._c_ctxt)
63456  *             elif self._c_ctxt.spaceTab is not NULL or \             # <<<<<<<<<<<<<<
63457  *                     _LIBXML_VERSION_INT >= 20629: # work around bug in libxml2
63458  *                 xmlparser.xmlClearParserCtxt(self._c_ctxt)
63459  */
63460     if (!(__pyx_v_self->_c_ctxt->spaceTab != NULL)) {
63461
63462       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":500
63463  *                 htmlparser.htmlCtxtReset(self._c_ctxt)
63464  *             elif self._c_ctxt.spaceTab is not NULL or \
63465  *                     _LIBXML_VERSION_INT >= 20629: # work around bug in libxml2             # <<<<<<<<<<<<<<
63466  *                 xmlparser.xmlClearParserCtxt(self._c_ctxt)
63467  * 
63468  */
63469       __pyx_t_1 = (__pyx_v_4lxml_5etree__LIBXML_VERSION_INT >= 20629);
63470     } else {
63471       __pyx_t_1 = (__pyx_v_self->_c_ctxt->spaceTab != NULL);
63472     }
63473     if (__pyx_t_1) {
63474
63475       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":501
63476  *             elif self._c_ctxt.spaceTab is not NULL or \
63477  *                     _LIBXML_VERSION_INT >= 20629: # work around bug in libxml2
63478  *                 xmlparser.xmlClearParserCtxt(self._c_ctxt)             # <<<<<<<<<<<<<<
63479  * 
63480  *     cdef int prepare(self) except -1:
63481  */
63482       xmlClearParserCtxt(__pyx_v_self->_c_ctxt);
63483       goto __pyx_L4;
63484     }
63485     __pyx_L4:;
63486     goto __pyx_L3;
63487   }
63488   __pyx_L3:;
63489
63490   __Pyx_FinishRefcountContext();
63491 }
63492
63493 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":503
63494  *                 xmlparser.xmlClearParserCtxt(self._c_ctxt)
63495  * 
63496  *     cdef int prepare(self) except -1:             # <<<<<<<<<<<<<<
63497  *         cdef int result
63498  *         if config.ENABLE_THREADING and self._lock is not NULL:
63499  */
63500
63501 static  int __pyx_f_4lxml_5etree_14_ParserContext_prepare(struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_self) {
63502   int __pyx_v_result;
63503   int __pyx_r;
63504   PyObject *__pyx_1 = 0;
63505   int __pyx_t_1;
63506   int __pyx_t_2;
63507   __Pyx_SetupRefcountContext("prepare");
63508
63509   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":505
63510  *     cdef int prepare(self) except -1:
63511  *         cdef int result
63512  *         if config.ENABLE_THREADING and self._lock is not NULL:             # <<<<<<<<<<<<<<
63513  *             with nogil:
63514  *                 result = python.PyThread_acquire_lock(
63515  */
63516   if (ENABLE_THREADING) {
63517     __pyx_t_1 = (__pyx_v_self->_lock != NULL);
63518   } else {
63519     __pyx_t_1 = ENABLE_THREADING;
63520   }
63521   if (__pyx_t_1) {
63522
63523     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":506
63524  *         cdef int result
63525  *         if config.ENABLE_THREADING and self._lock is not NULL:
63526  *             with nogil:             # <<<<<<<<<<<<<<
63527  *                 result = python.PyThread_acquire_lock(
63528  *                     self._lock, python.WAIT_LOCK)
63529  */
63530     { PyThreadState *_save;
63531       Py_UNBLOCK_THREADS
63532       /*try:*/ {
63533
63534         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":508
63535  *             with nogil:
63536  *                 result = python.PyThread_acquire_lock(
63537  *                     self._lock, python.WAIT_LOCK)             # <<<<<<<<<<<<<<
63538  *             if result == 0:
63539  *                 raise ParserError, u"parser locking failed"
63540  */
63541         __pyx_v_result = PyThread_acquire_lock(__pyx_v_self->_lock, WAIT_LOCK);
63542       }
63543       /*finally:*/ {
63544         Py_BLOCK_THREADS
63545       }
63546     }
63547
63548     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":509
63549  *                 result = python.PyThread_acquire_lock(
63550  *                     self._lock, python.WAIT_LOCK)
63551  *             if result == 0:             # <<<<<<<<<<<<<<
63552  *                 raise ParserError, u"parser locking failed"
63553  *         self._error_log.connect()
63554  */
63555     __pyx_t_1 = (__pyx_v_result == 0);
63556     if (__pyx_t_1) {
63557
63558       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":510
63559  *                     self._lock, python.WAIT_LOCK)
63560  *             if result == 0:
63561  *                 raise ParserError, u"parser locking failed"             # <<<<<<<<<<<<<<
63562  *         self._error_log.connect()
63563  *         if self._validator is not None:
63564  */
63565       __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ParserError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
63566       __Pyx_GOTREF(__pyx_1);
63567       __Pyx_Raise(__pyx_1, ((PyObject *)__pyx_kp_438), 0);
63568       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
63569       {__pyx_filename = __pyx_f[2]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
63570       goto __pyx_L7;
63571     }
63572     __pyx_L7:;
63573     goto __pyx_L3;
63574   }
63575   __pyx_L3:;
63576
63577   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":511
63578  *             if result == 0:
63579  *                 raise ParserError, u"parser locking failed"
63580  *         self._error_log.connect()             # <<<<<<<<<<<<<<
63581  *         if self._validator is not None:
63582  *             self._validator.connect(self._c_ctxt)
63583  */
63584   ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)__pyx_v_self->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(__pyx_v_self->_error_log);
63585
63586   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":512
63587  *                 raise ParserError, u"parser locking failed"
63588  *         self._error_log.connect()
63589  *         if self._validator is not None:             # <<<<<<<<<<<<<<
63590  *             self._validator.connect(self._c_ctxt)
63591  *         return 0
63592  */
63593   __pyx_t_1 = (((PyObject *)__pyx_v_self->_validator) != Py_None);
63594   if (__pyx_t_1) {
63595
63596     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":513
63597  *         self._error_log.connect()
63598  *         if self._validator is not None:
63599  *             self._validator.connect(self._c_ctxt)             # <<<<<<<<<<<<<<
63600  *         return 0
63601  * 
63602  */
63603     __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserSchemaValidationContext *)__pyx_v_self->_validator->__pyx_vtab)->connect(__pyx_v_self->_validator, __pyx_v_self->_c_ctxt); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
63604     goto __pyx_L8;
63605   }
63606   __pyx_L8:;
63607
63608   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":514
63609  *         if self._validator is not None:
63610  *             self._validator.connect(self._c_ctxt)
63611  *         return 0             # <<<<<<<<<<<<<<
63612  * 
63613  *     cdef int cleanup(self) except -1:
63614  */
63615   __pyx_r = 0;
63616   goto __pyx_L0;
63617
63618   __pyx_r = 0;
63619   goto __pyx_L0;
63620   __pyx_L1_error:;
63621   __Pyx_XDECREF(__pyx_1);
63622   __Pyx_AddTraceback("lxml.etree._ParserContext.prepare");
63623   __pyx_r = -1;
63624   __pyx_L0:;
63625   __Pyx_FinishRefcountContext();
63626   return __pyx_r;
63627 }
63628
63629 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":516
63630  *         return 0
63631  * 
63632  *     cdef int cleanup(self) except -1:             # <<<<<<<<<<<<<<
63633  *         if self._validator is not None:
63634  *             self._validator.disconnect()
63635  */
63636
63637 static  int __pyx_f_4lxml_5etree_14_ParserContext_cleanup(struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_self) {
63638   int __pyx_r;
63639   int __pyx_t_1;
63640   __Pyx_SetupRefcountContext("cleanup");
63641
63642   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":517
63643  * 
63644  *     cdef int cleanup(self) except -1:
63645  *         if self._validator is not None:             # <<<<<<<<<<<<<<
63646  *             self._validator.disconnect()
63647  *         self._resetParserContext()
63648  */
63649   __pyx_t_1 = (((PyObject *)__pyx_v_self->_validator) != Py_None);
63650   if (__pyx_t_1) {
63651
63652     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":518
63653  *     cdef int cleanup(self) except -1:
63654  *         if self._validator is not None:
63655  *             self._validator.disconnect()             # <<<<<<<<<<<<<<
63656  *         self._resetParserContext()
63657  *         self.clear()
63658  */
63659     ((struct __pyx_vtabstruct_4lxml_5etree__ParserSchemaValidationContext *)__pyx_v_self->_validator->__pyx_vtab)->disconnect(__pyx_v_self->_validator);
63660     goto __pyx_L3;
63661   }
63662   __pyx_L3:;
63663
63664   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":519
63665  *         if self._validator is not None:
63666  *             self._validator.disconnect()
63667  *         self._resetParserContext()             # <<<<<<<<<<<<<<
63668  *         self.clear()
63669  *         self._error_log.disconnect()
63670  */
63671   ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_resetParserContext(__pyx_v_self);
63672
63673   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":520
63674  *             self._validator.disconnect()
63675  *         self._resetParserContext()
63676  *         self.clear()             # <<<<<<<<<<<<<<
63677  *         self._error_log.disconnect()
63678  *         if config.ENABLE_THREADING and self._lock is not NULL:
63679  */
63680   ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.clear(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_self));
63681
63682   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":521
63683  *         self._resetParserContext()
63684  *         self.clear()
63685  *         self._error_log.disconnect()             # <<<<<<<<<<<<<<
63686  *         if config.ENABLE_THREADING and self._lock is not NULL:
63687  *             python.PyThread_release_lock(self._lock)
63688  */
63689   ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)__pyx_v_self->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(__pyx_v_self->_error_log);
63690
63691   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":522
63692  *         self.clear()
63693  *         self._error_log.disconnect()
63694  *         if config.ENABLE_THREADING and self._lock is not NULL:             # <<<<<<<<<<<<<<
63695  *             python.PyThread_release_lock(self._lock)
63696  *         return 0
63697  */
63698   if (ENABLE_THREADING) {
63699     __pyx_t_1 = (__pyx_v_self->_lock != NULL);
63700   } else {
63701     __pyx_t_1 = ENABLE_THREADING;
63702   }
63703   if (__pyx_t_1) {
63704
63705     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":523
63706  *         self._error_log.disconnect()
63707  *         if config.ENABLE_THREADING and self._lock is not NULL:
63708  *             python.PyThread_release_lock(self._lock)             # <<<<<<<<<<<<<<
63709  *         return 0
63710  * 
63711  */
63712     PyThread_release_lock(__pyx_v_self->_lock);
63713     goto __pyx_L4;
63714   }
63715   __pyx_L4:;
63716
63717   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":524
63718  *         if config.ENABLE_THREADING and self._lock is not NULL:
63719  *             python.PyThread_release_lock(self._lock)
63720  *         return 0             # <<<<<<<<<<<<<<
63721  * 
63722  *     cdef object _handleParseResult(self, _BaseParser parser,
63723  */
63724   __pyx_r = 0;
63725   goto __pyx_L0;
63726
63727   __pyx_r = 0;
63728   __pyx_L0:;
63729   __Pyx_FinishRefcountContext();
63730   return __pyx_r;
63731 }
63732
63733 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":526
63734  *         return 0
63735  * 
63736  *     cdef object _handleParseResult(self, _BaseParser parser,             # <<<<<<<<<<<<<<
63737  *                                    xmlDoc* result, filename):
63738  *         cdef xmlDoc* c_doc
63739  */
63740
63741 static  PyObject *__pyx_f_4lxml_5etree_14_ParserContext__handleParseResult(struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_self, struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser, xmlDoc *__pyx_v_result, PyObject *__pyx_v_filename) {
63742   xmlDoc *__pyx_v_c_doc;
63743   int __pyx_v_recover;
63744   PyObject *__pyx_r = NULL;
63745   xmlDoc *__pyx_t_1;
63746   PyObject *__pyx_t_2 = NULL;
63747   __Pyx_SetupRefcountContext("_handleParseResult");
63748
63749   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":530
63750  *         cdef xmlDoc* c_doc
63751  *         cdef bint recover
63752  *         recover = parser._parse_options & xmlparser.XML_PARSE_RECOVER             # <<<<<<<<<<<<<<
63753  *         c_doc = _handleParseResult(self, self._c_ctxt, result,
63754  *                                    filename, recover)
63755  */
63756   __pyx_v_recover = (__pyx_v_parser->_parse_options & XML_PARSE_RECOVER);
63757
63758   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":532
63759  *         recover = parser._parse_options & xmlparser.XML_PARSE_RECOVER
63760  *         c_doc = _handleParseResult(self, self._c_ctxt, result,
63761  *                                    filename, recover)             # <<<<<<<<<<<<<<
63762  *         return _documentFactory(c_doc, parser)
63763  * 
63764  */
63765   __pyx_t_1 = __pyx_f_4lxml_5etree__handleParseResult(__pyx_v_self, __pyx_v_self->_c_ctxt, __pyx_v_result, __pyx_v_filename, __pyx_v_recover); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
63766   __pyx_v_c_doc = __pyx_t_1;
63767
63768   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":533
63769  *         c_doc = _handleParseResult(self, self._c_ctxt, result,
63770  *                                    filename, recover)
63771  *         return _documentFactory(c_doc, parser)             # <<<<<<<<<<<<<<
63772  * 
63773  *     cdef xmlDoc* _handleParseResultDoc(self, _BaseParser parser,
63774  */
63775   __Pyx_XDECREF(__pyx_r);
63776   __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, __pyx_v_parser)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
63777   __Pyx_GOTREF(__pyx_t_2);
63778   __pyx_r = __pyx_t_2;
63779   __pyx_t_2 = 0;
63780   goto __pyx_L0;
63781
63782   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
63783   goto __pyx_L0;
63784   __pyx_L1_error:;
63785   __Pyx_XDECREF(__pyx_t_2);
63786   __Pyx_AddTraceback("lxml.etree._ParserContext._handleParseResult");
63787   __pyx_r = 0;
63788   __pyx_L0:;
63789   __Pyx_XGIVEREF(__pyx_r);
63790   __Pyx_FinishRefcountContext();
63791   return __pyx_r;
63792 }
63793
63794 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":535
63795  *         return _documentFactory(c_doc, parser)
63796  * 
63797  *     cdef xmlDoc* _handleParseResultDoc(self, _BaseParser parser,             # <<<<<<<<<<<<<<
63798  *                                        xmlDoc* result, filename) except NULL:
63799  *         cdef bint recover
63800  */
63801
63802 static  xmlDoc *__pyx_f_4lxml_5etree_14_ParserContext__handleParseResultDoc(struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_self, struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser, xmlDoc *__pyx_v_result, PyObject *__pyx_v_filename) {
63803   int __pyx_v_recover;
63804   xmlDoc *__pyx_r;
63805   xmlDoc *__pyx_t_1;
63806   __Pyx_SetupRefcountContext("_handleParseResultDoc");
63807
63808   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":538
63809  *                                        xmlDoc* result, filename) except NULL:
63810  *         cdef bint recover
63811  *         recover = parser._parse_options & xmlparser.XML_PARSE_RECOVER             # <<<<<<<<<<<<<<
63812  *         return _handleParseResult(self, self._c_ctxt, result,
63813  *                                    filename, recover)
63814  */
63815   __pyx_v_recover = (__pyx_v_parser->_parse_options & XML_PARSE_RECOVER);
63816
63817   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":540
63818  *         recover = parser._parse_options & xmlparser.XML_PARSE_RECOVER
63819  *         return _handleParseResult(self, self._c_ctxt, result,
63820  *                                    filename, recover)             # <<<<<<<<<<<<<<
63821  * 
63822  * cdef _initParserContext(_ParserContext context,
63823  */
63824   __pyx_t_1 = __pyx_f_4lxml_5etree__handleParseResult(__pyx_v_self, __pyx_v_self->_c_ctxt, __pyx_v_result, __pyx_v_filename, __pyx_v_recover); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
63825   __pyx_r = __pyx_t_1;
63826   goto __pyx_L0;
63827
63828   __pyx_r = 0;
63829   goto __pyx_L0;
63830   __pyx_L1_error:;
63831   __Pyx_AddTraceback("lxml.etree._ParserContext._handleParseResultDoc");
63832   __pyx_r = NULL;
63833   __pyx_L0:;
63834   __Pyx_FinishRefcountContext();
63835   return __pyx_r;
63836 }
63837
63838 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":542
63839  *                                    filename, recover)
63840  * 
63841  * cdef _initParserContext(_ParserContext context,             # <<<<<<<<<<<<<<
63842  *                         _ResolverRegistry resolvers,
63843  *                         xmlparser.xmlParserCtxt* c_ctxt):
63844  */
63845
63846 static  PyObject *__pyx_f_4lxml_5etree__initParserContext(struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_context, struct __pyx_obj_4lxml_5etree__ResolverRegistry *__pyx_v_resolvers, xmlParserCtxt *__pyx_v_c_ctxt) {
63847   PyObject *__pyx_r = NULL;
63848   PyObject *__pyx_t_1 = NULL;
63849   int __pyx_t_2;
63850   __Pyx_SetupRefcountContext("_initParserContext");
63851
63852   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":545
63853  *                         _ResolverRegistry resolvers,
63854  *                         xmlparser.xmlParserCtxt* c_ctxt):
63855  *     _initResolverContext(context, resolvers)             # <<<<<<<<<<<<<<
63856  *     if not config.ENABLE_THREADING:
63857  *         context._lock = NULL
63858  */
63859   __pyx_t_1 = __pyx_f_4lxml_5etree__initResolverContext(((struct __pyx_obj_4lxml_5etree__ResolverContext *)__pyx_v_context), __pyx_v_resolvers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
63860   __Pyx_GOTREF(__pyx_t_1);
63861   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
63862
63863   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":546
63864  *                         xmlparser.xmlParserCtxt* c_ctxt):
63865  *     _initResolverContext(context, resolvers)
63866  *     if not config.ENABLE_THREADING:             # <<<<<<<<<<<<<<
63867  *         context._lock = NULL
63868  *     else:
63869  */
63870   __pyx_t_2 = (!ENABLE_THREADING);
63871   if (__pyx_t_2) {
63872
63873     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":547
63874  *     _initResolverContext(context, resolvers)
63875  *     if not config.ENABLE_THREADING:
63876  *         context._lock = NULL             # <<<<<<<<<<<<<<
63877  *     else:
63878  *         context._lock = python.PyThread_allocate_lock()
63879  */
63880     __pyx_v_context->_lock = NULL;
63881     goto __pyx_L3;
63882   }
63883   /*else*/ {
63884
63885     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":549
63886  *         context._lock = NULL
63887  *     else:
63888  *         context._lock = python.PyThread_allocate_lock()             # <<<<<<<<<<<<<<
63889  *     if c_ctxt is not NULL:
63890  *         context._initParserContext(c_ctxt)
63891  */
63892     __pyx_v_context->_lock = PyThread_allocate_lock();
63893   }
63894   __pyx_L3:;
63895
63896   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":550
63897  *     else:
63898  *         context._lock = python.PyThread_allocate_lock()
63899  *     if c_ctxt is not NULL:             # <<<<<<<<<<<<<<
63900  *         context._initParserContext(c_ctxt)
63901  *     context._error_log = _ErrorLog()
63902  */
63903   __pyx_t_2 = (__pyx_v_c_ctxt != NULL);
63904   if (__pyx_t_2) {
63905
63906     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":551
63907  *         context._lock = python.PyThread_allocate_lock()
63908  *     if c_ctxt is not NULL:
63909  *         context._initParserContext(c_ctxt)             # <<<<<<<<<<<<<<
63910  *     context._error_log = _ErrorLog()
63911  * 
63912  */
63913     ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->_initParserContext(__pyx_v_context, __pyx_v_c_ctxt);
63914     goto __pyx_L4;
63915   }
63916   __pyx_L4:;
63917
63918   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":552
63919  *     if c_ctxt is not NULL:
63920  *         context._initParserContext(c_ctxt)
63921  *     context._error_log = _ErrorLog()             # <<<<<<<<<<<<<<
63922  * 
63923  * cdef int _raiseParseError(xmlparser.xmlParserCtxt* ctxt, filename,
63924  */
63925   __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ErrorLog)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
63926   __Pyx_GOTREF(__pyx_t_1);
63927   if (!(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__ErrorLog))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
63928   __Pyx_GIVEREF(__pyx_t_1);
63929   __Pyx_GOTREF(__pyx_v_context->_error_log);
63930   __Pyx_DECREF(((PyObject *)__pyx_v_context->_error_log));
63931   __pyx_v_context->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_t_1);
63932   __pyx_t_1 = 0;
63933
63934   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
63935   goto __pyx_L0;
63936   __pyx_L1_error:;
63937   __Pyx_XDECREF(__pyx_t_1);
63938   __Pyx_AddTraceback("lxml.etree._initParserContext");
63939   __pyx_r = 0;
63940   __pyx_L0:;
63941   __Pyx_XGIVEREF(__pyx_r);
63942   __Pyx_FinishRefcountContext();
63943   return __pyx_r;
63944 }
63945
63946 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":554
63947  *     context._error_log = _ErrorLog()
63948  * 
63949  * cdef int _raiseParseError(xmlparser.xmlParserCtxt* ctxt, filename,             # <<<<<<<<<<<<<<
63950  *                           _ErrorLog error_log) except 0:
63951  *     if filename is not None and \
63952  */
63953
63954 static  int __pyx_f_4lxml_5etree__raiseParseError(xmlParserCtxt *__pyx_v_ctxt, PyObject *__pyx_v_filename, struct __pyx_obj_4lxml_5etree__ErrorLog *__pyx_v_error_log) {
63955   PyObject *__pyx_v_message;
63956   PyObject *__pyx_v_code;
63957   PyObject *__pyx_v_line;
63958   PyObject *__pyx_v_column;
63959   int __pyx_r;
63960   PyObject *__pyx_1 = 0;
63961   int __pyx_t_1;
63962   int __pyx_t_2;
63963   PyObject *__pyx_t_3 = NULL;
63964   PyObject *__pyx_t_4 = NULL;
63965   __Pyx_SetupRefcountContext("_raiseParseError");
63966   __pyx_v_message = Py_None; __Pyx_INCREF(Py_None);
63967   __pyx_v_code = Py_None; __Pyx_INCREF(Py_None);
63968   __pyx_v_line = Py_None; __Pyx_INCREF(Py_None);
63969   __pyx_v_column = Py_None; __Pyx_INCREF(Py_None);
63970
63971   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":556
63972  * cdef int _raiseParseError(xmlparser.xmlParserCtxt* ctxt, filename,
63973  *                           _ErrorLog error_log) except 0:
63974  *     if filename is not None and \             # <<<<<<<<<<<<<<
63975  *            ctxt.lastError.domain == xmlerror.XML_FROM_IO:
63976  *         if ctxt.lastError.message is not NULL:
63977  */
63978   __pyx_t_1 = (__pyx_v_filename != Py_None);
63979   if (__pyx_t_1) {
63980
63981     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":557
63982  *                           _ErrorLog error_log) except 0:
63983  *     if filename is not None and \
63984  *            ctxt.lastError.domain == xmlerror.XML_FROM_IO:             # <<<<<<<<<<<<<<
63985  *         if ctxt.lastError.message is not NULL:
63986  *             message = u"Error reading file '%s': %s" % (
63987  */
63988     __pyx_t_2 = (__pyx_v_ctxt->lastError.domain == XML_FROM_IO);
63989   } else {
63990     __pyx_t_2 = __pyx_t_1;
63991   }
63992   if (__pyx_t_2) {
63993
63994     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":558
63995  *     if filename is not None and \
63996  *            ctxt.lastError.domain == xmlerror.XML_FROM_IO:
63997  *         if ctxt.lastError.message is not NULL:             # <<<<<<<<<<<<<<
63998  *             message = u"Error reading file '%s': %s" % (
63999  *                 filename, (ctxt.lastError.message).strip())
64000  */
64001     __pyx_t_2 = (__pyx_v_ctxt->lastError.message != NULL);
64002     if (__pyx_t_2) {
64003
64004       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":560
64005  *         if ctxt.lastError.message is not NULL:
64006  *             message = u"Error reading file '%s': %s" % (
64007  *                 filename, (ctxt.lastError.message).strip())             # <<<<<<<<<<<<<<
64008  *         else:
64009  *             message = u"Error reading '%s'" % filename
64010  */
64011       __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_ctxt->lastError.message); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64012       __Pyx_GOTREF(__pyx_t_3);
64013       __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_kp_strip); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64014       __Pyx_GOTREF(__pyx_t_4);
64015       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
64016       __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64017       __Pyx_GOTREF(__pyx_t_3);
64018       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64019       __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64020       __Pyx_GOTREF(((PyObject *)__pyx_t_4));
64021       __Pyx_INCREF(__pyx_v_filename);
64022       PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_filename);
64023       __Pyx_GIVEREF(__pyx_v_filename);
64024       PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
64025       __Pyx_GIVEREF(__pyx_t_3);
64026       __pyx_t_3 = 0;
64027       __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_439), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64028       __Pyx_GOTREF(__pyx_t_3);
64029       __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
64030       __Pyx_DECREF(__pyx_v_message);
64031       __pyx_v_message = __pyx_t_3;
64032       __pyx_t_3 = 0;
64033       goto __pyx_L4;
64034     }
64035     /*else*/ {
64036
64037       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":562
64038  *                 filename, (ctxt.lastError.message).strip())
64039  *         else:
64040  *             message = u"Error reading '%s'" % filename             # <<<<<<<<<<<<<<
64041  *         raise IOError, message
64042  *     elif error_log:
64043  */
64044       __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_440), __pyx_v_filename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64045       __Pyx_GOTREF(__pyx_t_3);
64046       __Pyx_DECREF(__pyx_v_message);
64047       __pyx_v_message = __pyx_t_3;
64048       __pyx_t_3 = 0;
64049     }
64050     __pyx_L4:;
64051
64052     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":563
64053  *         else:
64054  *             message = u"Error reading '%s'" % filename
64055  *         raise IOError, message             # <<<<<<<<<<<<<<
64056  *     elif error_log:
64057  *         raise error_log._buildParseException(
64058  */
64059     __Pyx_Raise(__pyx_builtin_IOError, __pyx_v_message, 0);
64060     {__pyx_filename = __pyx_f[2]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64061     goto __pyx_L3;
64062   }
64063
64064   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":564
64065  *             message = u"Error reading '%s'" % filename
64066  *         raise IOError, message
64067  *     elif error_log:             # <<<<<<<<<<<<<<
64068  *         raise error_log._buildParseException(
64069  *             XMLSyntaxError, u"Document is not well formed")
64070  */
64071   __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_error_log)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64072   if (__pyx_t_2) {
64073
64074     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":566
64075  *     elif error_log:
64076  *         raise error_log._buildParseException(
64077  *             XMLSyntaxError, u"Document is not well formed")             # <<<<<<<<<<<<<<
64078  *     elif ctxt.lastError.message is not NULL:
64079  *         message = (ctxt.lastError.message).strip()
64080  */
64081     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XMLSyntaxError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64082     __Pyx_GOTREF(__pyx_1);
64083     __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)__pyx_v_error_log->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._buildParseException(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_error_log), __pyx_1, ((PyObject *)__pyx_kp_441)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64084     __Pyx_GOTREF(__pyx_t_3);
64085     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
64086     __Pyx_Raise(__pyx_t_3, 0, 0);
64087     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
64088     {__pyx_filename = __pyx_f[2]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64089     goto __pyx_L3;
64090   }
64091
64092   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":567
64093  *         raise error_log._buildParseException(
64094  *             XMLSyntaxError, u"Document is not well formed")
64095  *     elif ctxt.lastError.message is not NULL:             # <<<<<<<<<<<<<<
64096  *         message = (ctxt.lastError.message).strip()
64097  *         code = ctxt.lastError.code
64098  */
64099   __pyx_t_2 = (__pyx_v_ctxt->lastError.message != NULL);
64100   if (__pyx_t_2) {
64101
64102     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":568
64103  *             XMLSyntaxError, u"Document is not well formed")
64104  *     elif ctxt.lastError.message is not NULL:
64105  *         message = (ctxt.lastError.message).strip()             # <<<<<<<<<<<<<<
64106  *         code = ctxt.lastError.code
64107  *         line = ctxt.lastError.line
64108  */
64109     __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_ctxt->lastError.message); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64110     __Pyx_GOTREF(__pyx_t_3);
64111     __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_kp_strip); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64112     __Pyx_GOTREF(__pyx_t_4);
64113     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
64114     __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64115     __Pyx_GOTREF(__pyx_t_3);
64116     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64117     __Pyx_DECREF(__pyx_v_message);
64118     __pyx_v_message = __pyx_t_3;
64119     __pyx_t_3 = 0;
64120
64121     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":569
64122  *     elif ctxt.lastError.message is not NULL:
64123  *         message = (ctxt.lastError.message).strip()
64124  *         code = ctxt.lastError.code             # <<<<<<<<<<<<<<
64125  *         line = ctxt.lastError.line
64126  *         column = ctxt.lastError.int2
64127  */
64128     __pyx_t_3 = PyInt_FromLong(__pyx_v_ctxt->lastError.code); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64129     __Pyx_GOTREF(__pyx_t_3);
64130     __Pyx_DECREF(__pyx_v_code);
64131     __pyx_v_code = __pyx_t_3;
64132     __pyx_t_3 = 0;
64133
64134     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":570
64135  *         message = (ctxt.lastError.message).strip()
64136  *         code = ctxt.lastError.code
64137  *         line = ctxt.lastError.line             # <<<<<<<<<<<<<<
64138  *         column = ctxt.lastError.int2
64139  *         if ctxt.lastError.line > 0:
64140  */
64141     __pyx_t_3 = PyInt_FromLong(__pyx_v_ctxt->lastError.line); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64142     __Pyx_GOTREF(__pyx_t_3);
64143     __Pyx_DECREF(__pyx_v_line);
64144     __pyx_v_line = __pyx_t_3;
64145     __pyx_t_3 = 0;
64146
64147     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":571
64148  *         code = ctxt.lastError.code
64149  *         line = ctxt.lastError.line
64150  *         column = ctxt.lastError.int2             # <<<<<<<<<<<<<<
64151  *         if ctxt.lastError.line > 0:
64152  *             message = u"line %d: %s" % (line, message)
64153  */
64154     __pyx_t_3 = PyInt_FromLong(__pyx_v_ctxt->lastError.int2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64155     __Pyx_GOTREF(__pyx_t_3);
64156     __Pyx_DECREF(__pyx_v_column);
64157     __pyx_v_column = __pyx_t_3;
64158     __pyx_t_3 = 0;
64159
64160     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":572
64161  *         line = ctxt.lastError.line
64162  *         column = ctxt.lastError.int2
64163  *         if ctxt.lastError.line > 0:             # <<<<<<<<<<<<<<
64164  *             message = u"line %d: %s" % (line, message)
64165  *         raise XMLSyntaxError(message, code, line, column)
64166  */
64167     __pyx_t_2 = (__pyx_v_ctxt->lastError.line > 0);
64168     if (__pyx_t_2) {
64169
64170       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":573
64171  *         column = ctxt.lastError.int2
64172  *         if ctxt.lastError.line > 0:
64173  *             message = u"line %d: %s" % (line, message)             # <<<<<<<<<<<<<<
64174  *         raise XMLSyntaxError(message, code, line, column)
64175  *     else:
64176  */
64177       __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64178       __Pyx_GOTREF(((PyObject *)__pyx_t_3));
64179       __Pyx_INCREF(__pyx_v_line);
64180       PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_line);
64181       __Pyx_GIVEREF(__pyx_v_line);
64182       __Pyx_INCREF(__pyx_v_message);
64183       PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_message);
64184       __Pyx_GIVEREF(__pyx_v_message);
64185       __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_442), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64186       __Pyx_GOTREF(__pyx_t_4);
64187       __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
64188       __Pyx_DECREF(__pyx_v_message);
64189       __pyx_v_message = __pyx_t_4;
64190       __pyx_t_4 = 0;
64191       goto __pyx_L5;
64192     }
64193     __pyx_L5:;
64194
64195     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":574
64196  *         if ctxt.lastError.line > 0:
64197  *             message = u"line %d: %s" % (line, message)
64198  *         raise XMLSyntaxError(message, code, line, column)             # <<<<<<<<<<<<<<
64199  *     else:
64200  *         raise XMLSyntaxError(None, xmlerror.XML_ERR_INTERNAL_ERROR, 0, 0)
64201  */
64202     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XMLSyntaxError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64203     __Pyx_GOTREF(__pyx_1);
64204     __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64205     __Pyx_GOTREF(((PyObject *)__pyx_t_4));
64206     __Pyx_INCREF(__pyx_v_message);
64207     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_message);
64208     __Pyx_GIVEREF(__pyx_v_message);
64209     __Pyx_INCREF(__pyx_v_code);
64210     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_code);
64211     __Pyx_GIVEREF(__pyx_v_code);
64212     __Pyx_INCREF(__pyx_v_line);
64213     PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_line);
64214     __Pyx_GIVEREF(__pyx_v_line);
64215     __Pyx_INCREF(__pyx_v_column);
64216     PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_column);
64217     __Pyx_GIVEREF(__pyx_v_column);
64218     __pyx_t_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64219     __Pyx_GOTREF(__pyx_t_3);
64220     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
64221     __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
64222     __Pyx_Raise(__pyx_t_3, 0, 0);
64223     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
64224     {__pyx_filename = __pyx_f[2]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64225     goto __pyx_L3;
64226   }
64227   /*else*/ {
64228
64229     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":576
64230  *         raise XMLSyntaxError(message, code, line, column)
64231  *     else:
64232  *         raise XMLSyntaxError(None, xmlerror.XML_ERR_INTERNAL_ERROR, 0, 0)             # <<<<<<<<<<<<<<
64233  * 
64234  * cdef xmlDoc* _handleParseResult(_ParserContext context,
64235  */
64236     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XMLSyntaxError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64237     __Pyx_GOTREF(__pyx_1);
64238     __pyx_t_3 = PyInt_FromLong(XML_ERR_INTERNAL_ERROR); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64239     __Pyx_GOTREF(__pyx_t_3);
64240     __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64241     __Pyx_GOTREF(((PyObject *)__pyx_t_4));
64242     __Pyx_INCREF(Py_None);
64243     PyTuple_SET_ITEM(__pyx_t_4, 0, Py_None);
64244     __Pyx_GIVEREF(Py_None);
64245     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
64246     __Pyx_GIVEREF(__pyx_t_3);
64247     __Pyx_INCREF(__pyx_int_0);
64248     PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_int_0);
64249     __Pyx_GIVEREF(__pyx_int_0);
64250     __Pyx_INCREF(__pyx_int_0);
64251     PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_int_0);
64252     __Pyx_GIVEREF(__pyx_int_0);
64253     __pyx_t_3 = 0;
64254     __pyx_t_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64255     __Pyx_GOTREF(__pyx_t_3);
64256     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
64257     __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
64258     __Pyx_Raise(__pyx_t_3, 0, 0);
64259     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
64260     {__pyx_filename = __pyx_f[2]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64261   }
64262   __pyx_L3:;
64263
64264   __pyx_r = 0;
64265   goto __pyx_L0;
64266   __pyx_L1_error:;
64267   __Pyx_XDECREF(__pyx_1);
64268   __Pyx_XDECREF(__pyx_t_3);
64269   __Pyx_XDECREF(__pyx_t_4);
64270   __Pyx_AddTraceback("lxml.etree._raiseParseError");
64271   __pyx_r = 0;
64272   __pyx_L0:;
64273   __Pyx_DECREF(__pyx_v_message);
64274   __Pyx_DECREF(__pyx_v_code);
64275   __Pyx_DECREF(__pyx_v_line);
64276   __Pyx_DECREF(__pyx_v_column);
64277   __Pyx_FinishRefcountContext();
64278   return __pyx_r;
64279 }
64280
64281 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":578
64282  *         raise XMLSyntaxError(None, xmlerror.XML_ERR_INTERNAL_ERROR, 0, 0)
64283  * 
64284  * cdef xmlDoc* _handleParseResult(_ParserContext context,             # <<<<<<<<<<<<<<
64285  *                                 xmlparser.xmlParserCtxt* c_ctxt,
64286  *                                 xmlDoc* result, filename,
64287  */
64288
64289 static  xmlDoc *__pyx_f_4lxml_5etree__handleParseResult(struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_context, xmlParserCtxt *__pyx_v_c_ctxt, xmlDoc *__pyx_v_result, PyObject *__pyx_v_filename, int __pyx_v_recover) {
64290   int __pyx_v_well_formed;
64291   PyObject *__pyx_v_error;
64292   xmlDoc *__pyx_r;
64293   PyObject *__pyx_1 = 0;
64294   int __pyx_t_1;
64295   int __pyx_t_2;
64296   Py_ssize_t __pyx_t_3;
64297   PyObject *__pyx_t_4 = NULL;
64298   PyObject *__pyx_t_5 = NULL;
64299   PyObject *__pyx_t_6 = NULL;
64300   PyObject *__pyx_t_7 = NULL;
64301   int __pyx_t_8;
64302   int __pyx_t_9;
64303   __Pyx_SetupRefcountContext("_handleParseResult");
64304   __pyx_v_error = Py_None; __Pyx_INCREF(Py_None);
64305
64306   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":583
64307  *                                 bint recover) except NULL:
64308  *     cdef bint well_formed
64309  *     if result is not NULL:             # <<<<<<<<<<<<<<
64310  *         __GLOBAL_PARSER_CONTEXT.initDocDict(result)
64311  * 
64312  */
64313   __pyx_t_1 = (__pyx_v_result != NULL);
64314   if (__pyx_t_1) {
64315
64316     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":584
64317  *     cdef bint well_formed
64318  *     if result is not NULL:
64319  *         __GLOBAL_PARSER_CONTEXT.initDocDict(result)             # <<<<<<<<<<<<<<
64320  * 
64321  *     if c_ctxt.myDoc is not NULL:
64322  */
64323     ((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initDocDict(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT, __pyx_v_result);
64324     goto __pyx_L3;
64325   }
64326   __pyx_L3:;
64327
64328   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":586
64329  *         __GLOBAL_PARSER_CONTEXT.initDocDict(result)
64330  * 
64331  *     if c_ctxt.myDoc is not NULL:             # <<<<<<<<<<<<<<
64332  *         if c_ctxt.myDoc is not result:
64333  *             __GLOBAL_PARSER_CONTEXT.initDocDict(c_ctxt.myDoc)
64334  */
64335   __pyx_t_1 = (__pyx_v_c_ctxt->myDoc != NULL);
64336   if (__pyx_t_1) {
64337
64338     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":587
64339  * 
64340  *     if c_ctxt.myDoc is not NULL:
64341  *         if c_ctxt.myDoc is not result:             # <<<<<<<<<<<<<<
64342  *             __GLOBAL_PARSER_CONTEXT.initDocDict(c_ctxt.myDoc)
64343  *             tree.xmlFreeDoc(c_ctxt.myDoc)
64344  */
64345     __pyx_t_1 = (__pyx_v_c_ctxt->myDoc != __pyx_v_result);
64346     if (__pyx_t_1) {
64347
64348       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":588
64349  *     if c_ctxt.myDoc is not NULL:
64350  *         if c_ctxt.myDoc is not result:
64351  *             __GLOBAL_PARSER_CONTEXT.initDocDict(c_ctxt.myDoc)             # <<<<<<<<<<<<<<
64352  *             tree.xmlFreeDoc(c_ctxt.myDoc)
64353  *         c_ctxt.myDoc = NULL
64354  */
64355       ((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initDocDict(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT, __pyx_v_c_ctxt->myDoc);
64356
64357       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":589
64358  *         if c_ctxt.myDoc is not result:
64359  *             __GLOBAL_PARSER_CONTEXT.initDocDict(c_ctxt.myDoc)
64360  *             tree.xmlFreeDoc(c_ctxt.myDoc)             # <<<<<<<<<<<<<<
64361  *         c_ctxt.myDoc = NULL
64362  * 
64363  */
64364       xmlFreeDoc(__pyx_v_c_ctxt->myDoc);
64365       goto __pyx_L5;
64366     }
64367     __pyx_L5:;
64368
64369     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":590
64370  *             __GLOBAL_PARSER_CONTEXT.initDocDict(c_ctxt.myDoc)
64371  *             tree.xmlFreeDoc(c_ctxt.myDoc)
64372  *         c_ctxt.myDoc = NULL             # <<<<<<<<<<<<<<
64373  * 
64374  *     if result is not NULL:
64375  */
64376     __pyx_v_c_ctxt->myDoc = NULL;
64377     goto __pyx_L4;
64378   }
64379   __pyx_L4:;
64380
64381   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":592
64382  *         c_ctxt.myDoc = NULL
64383  * 
64384  *     if result is not NULL:             # <<<<<<<<<<<<<<
64385  *         if context._validator is not None and \
64386  *                 not context._validator.isvalid():
64387  */
64388   __pyx_t_1 = (__pyx_v_result != NULL);
64389   if (__pyx_t_1) {
64390
64391     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":593
64392  * 
64393  *     if result is not NULL:
64394  *         if context._validator is not None and \             # <<<<<<<<<<<<<<
64395  *                 not context._validator.isvalid():
64396  *             well_formed = 0 # actually not 'valid', but anyway ...
64397  */
64398     __pyx_t_1 = (((PyObject *)__pyx_v_context->_validator) != Py_None);
64399     if (__pyx_t_1) {
64400
64401       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":594
64402  *     if result is not NULL:
64403  *         if context._validator is not None and \
64404  *                 not context._validator.isvalid():             # <<<<<<<<<<<<<<
64405  *             well_formed = 0 # actually not 'valid', but anyway ...
64406  *         elif recover or (c_ctxt.wellFormed and \
64407  */
64408       __pyx_t_2 = (!((struct __pyx_vtabstruct_4lxml_5etree__ParserSchemaValidationContext *)__pyx_v_context->_validator->__pyx_vtab)->isvalid(__pyx_v_context->_validator));
64409     } else {
64410       __pyx_t_2 = __pyx_t_1;
64411     }
64412     if (__pyx_t_2) {
64413
64414       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":595
64415  *         if context._validator is not None and \
64416  *                 not context._validator.isvalid():
64417  *             well_formed = 0 # actually not 'valid', but anyway ...             # <<<<<<<<<<<<<<
64418  *         elif recover or (c_ctxt.wellFormed and \
64419  *                              c_ctxt.lastError.level < xmlerror.XML_ERR_ERROR):
64420  */
64421       __pyx_v_well_formed = 0;
64422       goto __pyx_L7;
64423     }
64424
64425     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":596
64426  *                 not context._validator.isvalid():
64427  *             well_formed = 0 # actually not 'valid', but anyway ...
64428  *         elif recover or (c_ctxt.wellFormed and \             # <<<<<<<<<<<<<<
64429  *                              c_ctxt.lastError.level < xmlerror.XML_ERR_ERROR):
64430  *             well_formed = 1
64431  */
64432     if (!__pyx_v_recover) {
64433       if (__pyx_v_c_ctxt->wellFormed) {
64434
64435         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":597
64436  *             well_formed = 0 # actually not 'valid', but anyway ...
64437  *         elif recover or (c_ctxt.wellFormed and \
64438  *                              c_ctxt.lastError.level < xmlerror.XML_ERR_ERROR):             # <<<<<<<<<<<<<<
64439  *             well_formed = 1
64440  *         elif not c_ctxt.replaceEntities and not c_ctxt.validate \
64441  */
64442         __pyx_t_2 = (__pyx_v_c_ctxt->lastError.level < XML_ERR_ERROR);
64443       } else {
64444         __pyx_t_2 = __pyx_v_c_ctxt->wellFormed;
64445       }
64446       __pyx_t_1 = __pyx_t_2;
64447     } else {
64448       __pyx_t_1 = __pyx_v_recover;
64449     }
64450     if (__pyx_t_1) {
64451
64452       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":598
64453  *         elif recover or (c_ctxt.wellFormed and \
64454  *                              c_ctxt.lastError.level < xmlerror.XML_ERR_ERROR):
64455  *             well_formed = 1             # <<<<<<<<<<<<<<
64456  *         elif not c_ctxt.replaceEntities and not c_ctxt.validate \
64457  *                  and context is not None:
64458  */
64459       __pyx_v_well_formed = 1;
64460       goto __pyx_L7;
64461     }
64462
64463     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":599
64464  *                              c_ctxt.lastError.level < xmlerror.XML_ERR_ERROR):
64465  *             well_formed = 1
64466  *         elif not c_ctxt.replaceEntities and not c_ctxt.validate \             # <<<<<<<<<<<<<<
64467  *                  and context is not None:
64468  *             # in this mode, we ignore errors about undefined entities
64469  */
64470     if ((!__pyx_v_c_ctxt->replaceEntities)) {
64471
64472       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":600
64473  *             well_formed = 1
64474  *         elif not c_ctxt.replaceEntities and not c_ctxt.validate \
64475  *                  and context is not None:             # <<<<<<<<<<<<<<
64476  *             # in this mode, we ignore errors about undefined entities
64477  *             for error in context._error_log.filter_from_errors():
64478  */
64479       if ((!__pyx_v_c_ctxt->validate)) {
64480         __pyx_t_1 = (((PyObject *)__pyx_v_context) != Py_None);
64481         __pyx_t_2 = __pyx_t_1;
64482       } else {
64483         __pyx_t_2 = (!__pyx_v_c_ctxt->validate);
64484       }
64485       __pyx_t_1 = __pyx_t_2;
64486     } else {
64487       __pyx_t_1 = (!__pyx_v_c_ctxt->replaceEntities);
64488     }
64489     if (__pyx_t_1) {
64490
64491       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":602
64492  *                  and context is not None:
64493  *             # in this mode, we ignore errors about undefined entities
64494  *             for error in context._error_log.filter_from_errors():             # <<<<<<<<<<<<<<
64495  *                 if error.type != ErrorTypes.WAR_UNDECLARED_ENTITY and \
64496  *                        error.type != ErrorTypes.ERR_UNDECLARED_ENTITY:
64497  */
64498       __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_context->_error_log), __pyx_kp_filter_from_errors); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64499       __Pyx_GOTREF(__pyx_t_4);
64500       __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64501       __Pyx_GOTREF(__pyx_t_5);
64502       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64503       if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) {
64504         __pyx_t_3 = 0; __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4);
64505       } else {
64506         __pyx_t_3 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64507         __Pyx_GOTREF(__pyx_t_4);
64508       }
64509       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
64510       for (;;) {
64511         if (likely(PyList_CheckExact(__pyx_t_4))) {
64512           if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_4)) break;
64513           __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
64514         } else if (likely(PyTuple_CheckExact(__pyx_t_4))) {
64515           if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
64516           __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
64517         } else {
64518           __pyx_t_5 = PyIter_Next(__pyx_t_4);
64519           if (!__pyx_t_5) {
64520             if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64521             break;
64522           }
64523           __Pyx_GOTREF(__pyx_t_5);
64524         }
64525         __Pyx_DECREF(__pyx_v_error);
64526         __pyx_v_error = __pyx_t_5;
64527         __pyx_t_5 = 0;
64528
64529         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":603
64530  *             # in this mode, we ignore errors about undefined entities
64531  *             for error in context._error_log.filter_from_errors():
64532  *                 if error.type != ErrorTypes.WAR_UNDECLARED_ENTITY and \             # <<<<<<<<<<<<<<
64533  *                        error.type != ErrorTypes.ERR_UNDECLARED_ENTITY:
64534  *                     well_formed = 0
64535  */
64536         __pyx_t_5 = PyObject_GetAttr(__pyx_v_error, __pyx_kp_type); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64537         __Pyx_GOTREF(__pyx_t_5);
64538         __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ErrorTypes); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64539         __Pyx_GOTREF(__pyx_1);
64540         __pyx_t_6 = PyObject_GetAttr(__pyx_1, __pyx_kp_443); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64541         __Pyx_GOTREF(__pyx_t_6);
64542         __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
64543         __pyx_t_7 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_NE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64544         __Pyx_GOTREF(__pyx_t_7);
64545         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
64546         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
64547         __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64548         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64549         if (__pyx_t_1) {
64550
64551           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":604
64552  *             for error in context._error_log.filter_from_errors():
64553  *                 if error.type != ErrorTypes.WAR_UNDECLARED_ENTITY and \
64554  *                        error.type != ErrorTypes.ERR_UNDECLARED_ENTITY:             # <<<<<<<<<<<<<<
64555  *                     well_formed = 0
64556  *                     break
64557  */
64558           __pyx_t_7 = PyObject_GetAttr(__pyx_v_error, __pyx_kp_type); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64559           __Pyx_GOTREF(__pyx_t_7);
64560           __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ErrorTypes); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64561           __Pyx_GOTREF(__pyx_1);
64562           __pyx_t_6 = PyObject_GetAttr(__pyx_1, __pyx_kp_444); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64563           __Pyx_GOTREF(__pyx_t_6);
64564           __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
64565           __pyx_t_5 = PyObject_RichCompare(__pyx_t_7, __pyx_t_6, Py_NE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64566           __Pyx_GOTREF(__pyx_t_5);
64567           __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
64568           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
64569           __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64570           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
64571           __pyx_t_8 = __pyx_t_2;
64572         } else {
64573           __pyx_t_8 = __pyx_t_1;
64574         }
64575         if (__pyx_t_8) {
64576
64577           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":605
64578  *                 if error.type != ErrorTypes.WAR_UNDECLARED_ENTITY and \
64579  *                        error.type != ErrorTypes.ERR_UNDECLARED_ENTITY:
64580  *                     well_formed = 0             # <<<<<<<<<<<<<<
64581  *                     break
64582  *             else:
64583  */
64584           __pyx_v_well_formed = 0;
64585
64586           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":606
64587  *                        error.type != ErrorTypes.ERR_UNDECLARED_ENTITY:
64588  *                     well_formed = 0
64589  *                     break             # <<<<<<<<<<<<<<
64590  *             else:
64591  *                 well_formed = 1
64592  */
64593           goto __pyx_L9_break;
64594           goto __pyx_L10;
64595         }
64596         __pyx_L10:;
64597       }
64598       /*else*/ {
64599
64600         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":608
64601  *                     break
64602  *             else:
64603  *                 well_formed = 1             # <<<<<<<<<<<<<<
64604  *         else:
64605  *             well_formed = 0
64606  */
64607         __pyx_v_well_formed = 1;
64608       }
64609       __pyx_L9_break:;
64610       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
64611       goto __pyx_L7;
64612     }
64613     /*else*/ {
64614
64615       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":610
64616  *                 well_formed = 1
64617  *         else:
64618  *             well_formed = 0             # <<<<<<<<<<<<<<
64619  * 
64620  *         if not well_formed:
64621  */
64622       __pyx_v_well_formed = 0;
64623     }
64624     __pyx_L7:;
64625
64626     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":612
64627  *             well_formed = 0
64628  * 
64629  *         if not well_formed:             # <<<<<<<<<<<<<<
64630  *             # free broken document
64631  *             tree.xmlFreeDoc(result)
64632  */
64633     __pyx_t_8 = (!__pyx_v_well_formed);
64634     if (__pyx_t_8) {
64635
64636       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":614
64637  *         if not well_formed:
64638  *             # free broken document
64639  *             tree.xmlFreeDoc(result)             # <<<<<<<<<<<<<<
64640  *             result = NULL
64641  * 
64642  */
64643       xmlFreeDoc(__pyx_v_result);
64644
64645       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":615
64646  *             # free broken document
64647  *             tree.xmlFreeDoc(result)
64648  *             result = NULL             # <<<<<<<<<<<<<<
64649  * 
64650  *     if context is not None and context._has_raised():
64651  */
64652       __pyx_v_result = NULL;
64653       goto __pyx_L11;
64654     }
64655     __pyx_L11:;
64656     goto __pyx_L6;
64657   }
64658   __pyx_L6:;
64659
64660   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":617
64661  *             result = NULL
64662  * 
64663  *     if context is not None and context._has_raised():             # <<<<<<<<<<<<<<
64664  *         if result is not NULL:
64665  *             tree.xmlFreeDoc(result)
64666  */
64667   __pyx_t_8 = (((PyObject *)__pyx_v_context) != Py_None);
64668   if (__pyx_t_8) {
64669     __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._has_raised(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_context));
64670   } else {
64671     __pyx_t_1 = __pyx_t_8;
64672   }
64673   if (__pyx_t_1) {
64674
64675     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":618
64676  * 
64677  *     if context is not None and context._has_raised():
64678  *         if result is not NULL:             # <<<<<<<<<<<<<<
64679  *             tree.xmlFreeDoc(result)
64680  *             result = NULL
64681  */
64682     __pyx_t_1 = (__pyx_v_result != NULL);
64683     if (__pyx_t_1) {
64684
64685       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":619
64686  *     if context is not None and context._has_raised():
64687  *         if result is not NULL:
64688  *             tree.xmlFreeDoc(result)             # <<<<<<<<<<<<<<
64689  *             result = NULL
64690  *         context._raise_if_stored()
64691  */
64692       xmlFreeDoc(__pyx_v_result);
64693
64694       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":620
64695  *         if result is not NULL:
64696  *             tree.xmlFreeDoc(result)
64697  *             result = NULL             # <<<<<<<<<<<<<<
64698  *         context._raise_if_stored()
64699  * 
64700  */
64701       __pyx_v_result = NULL;
64702       goto __pyx_L13;
64703     }
64704     __pyx_L13:;
64705
64706     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":621
64707  *             tree.xmlFreeDoc(result)
64708  *             result = NULL
64709  *         context._raise_if_stored()             # <<<<<<<<<<<<<<
64710  * 
64711  *     if result is NULL:
64712  */
64713     __pyx_t_9 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._raise_if_stored(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_context)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64714     goto __pyx_L12;
64715   }
64716   __pyx_L12:;
64717
64718   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":623
64719  *         context._raise_if_stored()
64720  * 
64721  *     if result is NULL:             # <<<<<<<<<<<<<<
64722  *         if context is not None:
64723  *             _raiseParseError(c_ctxt, filename, context._error_log)
64724  */
64725   __pyx_t_1 = (__pyx_v_result == NULL);
64726   if (__pyx_t_1) {
64727
64728     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":624
64729  * 
64730  *     if result is NULL:
64731  *         if context is not None:             # <<<<<<<<<<<<<<
64732  *             _raiseParseError(c_ctxt, filename, context._error_log)
64733  *         else:
64734  */
64735     __pyx_t_1 = (((PyObject *)__pyx_v_context) != Py_None);
64736     if (__pyx_t_1) {
64737
64738       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":625
64739  *     if result is NULL:
64740  *         if context is not None:
64741  *             _raiseParseError(c_ctxt, filename, context._error_log)             # <<<<<<<<<<<<<<
64742  *         else:
64743  *             _raiseParseError(c_ctxt, filename, None)
64744  */
64745       __pyx_t_9 = __pyx_f_4lxml_5etree__raiseParseError(__pyx_v_c_ctxt, __pyx_v_filename, __pyx_v_context->_error_log); if (unlikely(__pyx_t_9 == 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64746       goto __pyx_L15;
64747     }
64748     /*else*/ {
64749
64750       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":627
64751  *             _raiseParseError(c_ctxt, filename, context._error_log)
64752  *         else:
64753  *             _raiseParseError(c_ctxt, filename, None)             # <<<<<<<<<<<<<<
64754  *     else:
64755  *         if result.URL is NULL and filename is not None:
64756  */
64757       __pyx_t_9 = __pyx_f_4lxml_5etree__raiseParseError(__pyx_v_c_ctxt, __pyx_v_filename, ((struct __pyx_obj_4lxml_5etree__ErrorLog *)Py_None)); if (unlikely(__pyx_t_9 == 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
64758     }
64759     __pyx_L15:;
64760     goto __pyx_L14;
64761   }
64762   /*else*/ {
64763
64764     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":629
64765  *             _raiseParseError(c_ctxt, filename, None)
64766  *     else:
64767  *         if result.URL is NULL and filename is not None:             # <<<<<<<<<<<<<<
64768  *             result.URL = tree.xmlStrdup(_cstr(filename))
64769  *         if result.encoding is NULL:
64770  */
64771     if ((__pyx_v_result->URL == NULL)) {
64772       __pyx_t_1 = (__pyx_v_filename != Py_None);
64773       __pyx_t_8 = __pyx_t_1;
64774     } else {
64775       __pyx_t_8 = (__pyx_v_result->URL == NULL);
64776     }
64777     if (__pyx_t_8) {
64778
64779       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":630
64780  *     else:
64781  *         if result.URL is NULL and filename is not None:
64782  *             result.URL = tree.xmlStrdup(_cstr(filename))             # <<<<<<<<<<<<<<
64783  *         if result.encoding is NULL:
64784  *             result.encoding = tree.xmlStrdup("UTF-8")
64785  */
64786       __pyx_v_result->URL = xmlStrdup(PyString_AS_STRING(__pyx_v_filename));
64787       goto __pyx_L16;
64788     }
64789     __pyx_L16:;
64790
64791     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":631
64792  *         if result.URL is NULL and filename is not None:
64793  *             result.URL = tree.xmlStrdup(_cstr(filename))
64794  *         if result.encoding is NULL:             # <<<<<<<<<<<<<<
64795  *             result.encoding = tree.xmlStrdup("UTF-8")
64796  * 
64797  */
64798     __pyx_t_8 = (__pyx_v_result->encoding == NULL);
64799     if (__pyx_t_8) {
64800
64801       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":632
64802  *             result.URL = tree.xmlStrdup(_cstr(filename))
64803  *         if result.encoding is NULL:
64804  *             result.encoding = tree.xmlStrdup("UTF-8")             # <<<<<<<<<<<<<<
64805  * 
64806  *     if context._validator is not None and \
64807  */
64808       __pyx_v_result->encoding = xmlStrdup(__pyx_k_445);
64809       goto __pyx_L17;
64810     }
64811     __pyx_L17:;
64812   }
64813   __pyx_L14:;
64814
64815   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":634
64816  *             result.encoding = tree.xmlStrdup("UTF-8")
64817  * 
64818  *     if context._validator is not None and \             # <<<<<<<<<<<<<<
64819  *            context._validator._add_default_attributes:
64820  *         # we currently need to do this here as libxml2 does not
64821  */
64822   __pyx_t_8 = (((PyObject *)__pyx_v_context->_validator) != Py_None);
64823   if (__pyx_t_8) {
64824
64825     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":635
64826  * 
64827  *     if context._validator is not None and \
64828  *            context._validator._add_default_attributes:             # <<<<<<<<<<<<<<
64829  *         # we currently need to do this here as libxml2 does not
64830  *         # support inserting default attributes during parse-time
64831  */
64832     __pyx_t_1 = __pyx_v_context->_validator->_add_default_attributes;
64833   } else {
64834     __pyx_t_1 = __pyx_t_8;
64835   }
64836   if (__pyx_t_1) {
64837
64838     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":639
64839  *         # support inserting default attributes during parse-time
64840  *         # validation
64841  *         context._validator.inject_default_attributes(result)             # <<<<<<<<<<<<<<
64842  * 
64843  *     return result
64844  */
64845     ((struct __pyx_vtabstruct_4lxml_5etree__ParserSchemaValidationContext *)__pyx_v_context->_validator->__pyx_vtab)->inject_default_attributes(__pyx_v_context->_validator, __pyx_v_result);
64846     goto __pyx_L18;
64847   }
64848   __pyx_L18:;
64849
64850   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":641
64851  *         context._validator.inject_default_attributes(result)
64852  * 
64853  *     return result             # <<<<<<<<<<<<<<
64854  * 
64855  * cdef int _fixHtmlDictNames(tree.xmlDict* c_dict, xmlDoc* c_doc) nogil:
64856  */
64857   __pyx_r = __pyx_v_result;
64858   goto __pyx_L0;
64859
64860   __pyx_r = 0;
64861   goto __pyx_L0;
64862   __pyx_L1_error:;
64863   __Pyx_XDECREF(__pyx_1);
64864   __Pyx_XDECREF(__pyx_t_4);
64865   __Pyx_XDECREF(__pyx_t_5);
64866   __Pyx_XDECREF(__pyx_t_6);
64867   __Pyx_XDECREF(__pyx_t_7);
64868   __Pyx_AddTraceback("lxml.etree._handleParseResult");
64869   __pyx_r = NULL;
64870   __pyx_L0:;
64871   __Pyx_DECREF(__pyx_v_error);
64872   __Pyx_FinishRefcountContext();
64873   return __pyx_r;
64874 }
64875
64876 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":643
64877  *     return result
64878  * 
64879  * cdef int _fixHtmlDictNames(tree.xmlDict* c_dict, xmlDoc* c_doc) nogil:             # <<<<<<<<<<<<<<
64880  *     cdef xmlNode* c_node
64881  *     if c_doc is NULL:
64882  */
64883
64884 static  int __pyx_f_4lxml_5etree__fixHtmlDictNames(xmlDict *__pyx_v_c_dict, xmlDoc *__pyx_v_c_doc) {
64885   xmlNode *__pyx_v_c_node;
64886   int __pyx_r;
64887   int __pyx_t_1;
64888
64889   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":645
64890  * cdef int _fixHtmlDictNames(tree.xmlDict* c_dict, xmlDoc* c_doc) nogil:
64891  *     cdef xmlNode* c_node
64892  *     if c_doc is NULL:             # <<<<<<<<<<<<<<
64893  *         return 0
64894  *     c_node = c_doc.children
64895  */
64896   __pyx_t_1 = (__pyx_v_c_doc == NULL);
64897   if (__pyx_t_1) {
64898
64899     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":646
64900  *     cdef xmlNode* c_node
64901  *     if c_doc is NULL:
64902  *         return 0             # <<<<<<<<<<<<<<
64903  *     c_node = c_doc.children
64904  *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(<xmlNode*>c_doc, c_node, 0)
64905  */
64906     __pyx_r = 0;
64907     goto __pyx_L0;
64908     goto __pyx_L3;
64909   }
64910   __pyx_L3:;
64911
64912   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":647
64913  *     if c_doc is NULL:
64914  *         return 0
64915  *     c_node = c_doc.children             # <<<<<<<<<<<<<<
64916  *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(<xmlNode*>c_doc, c_node, 0)
64917  *     if c_node.type == tree.XML_ELEMENT_NODE:
64918  */
64919   __pyx_v_c_node = __pyx_v_c_doc->children;
64920
64921   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":648
64922  *         return 0
64923  *     c_node = c_doc.children
64924  *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(<xmlNode*>c_doc, c_node, 0)             # <<<<<<<<<<<<<<
64925  *     if c_node.type == tree.XML_ELEMENT_NODE:
64926  *         if _fixHtmlDictNodeNames(c_dict, c_node) < 0:
64927  */
64928   BEGIN_FOR_EACH_ELEMENT_FROM(((xmlNode *)__pyx_v_c_doc), __pyx_v_c_node, 0);
64929
64930   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":649
64931  *     c_node = c_doc.children
64932  *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(<xmlNode*>c_doc, c_node, 0)
64933  *     if c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
64934  *         if _fixHtmlDictNodeNames(c_dict, c_node) < 0:
64935  *             return -1
64936  */
64937   __pyx_t_1 = (__pyx_v_c_node->type == XML_ELEMENT_NODE);
64938   if (__pyx_t_1) {
64939
64940     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":650
64941  *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(<xmlNode*>c_doc, c_node, 0)
64942  *     if c_node.type == tree.XML_ELEMENT_NODE:
64943  *         if _fixHtmlDictNodeNames(c_dict, c_node) < 0:             # <<<<<<<<<<<<<<
64944  *             return -1
64945  *     tree.END_FOR_EACH_ELEMENT_FROM(c_node)
64946  */
64947     __pyx_t_1 = (__pyx_f_4lxml_5etree__fixHtmlDictNodeNames(__pyx_v_c_dict, __pyx_v_c_node) < 0);
64948     if (__pyx_t_1) {
64949
64950       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":651
64951  *     if c_node.type == tree.XML_ELEMENT_NODE:
64952  *         if _fixHtmlDictNodeNames(c_dict, c_node) < 0:
64953  *             return -1             # <<<<<<<<<<<<<<
64954  *     tree.END_FOR_EACH_ELEMENT_FROM(c_node)
64955  *     return 0
64956  */
64957       __pyx_r = -1;
64958       goto __pyx_L0;
64959       goto __pyx_L5;
64960     }
64961     __pyx_L5:;
64962     goto __pyx_L4;
64963   }
64964   __pyx_L4:;
64965
64966   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":652
64967  *         if _fixHtmlDictNodeNames(c_dict, c_node) < 0:
64968  *             return -1
64969  *     tree.END_FOR_EACH_ELEMENT_FROM(c_node)             # <<<<<<<<<<<<<<
64970  *     return 0
64971  * 
64972  */
64973   END_FOR_EACH_ELEMENT_FROM(__pyx_v_c_node);
64974
64975   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":653
64976  *             return -1
64977  *     tree.END_FOR_EACH_ELEMENT_FROM(c_node)
64978  *     return 0             # <<<<<<<<<<<<<<
64979  * 
64980  * cdef inline int _fixHtmlDictNodeNames(tree.xmlDict* c_dict,
64981  */
64982   __pyx_r = 0;
64983   goto __pyx_L0;
64984
64985   __pyx_r = 0;
64986   __pyx_L0:;
64987   return __pyx_r;
64988 }
64989
64990 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":655
64991  *     return 0
64992  * 
64993  * cdef inline int _fixHtmlDictNodeNames(tree.xmlDict* c_dict,             # <<<<<<<<<<<<<<
64994  *                                       xmlNode* c_node) nogil:
64995  *     cdef xmlNode* c_attr
64996  */
64997
64998 static INLINE int __pyx_f_4lxml_5etree__fixHtmlDictNodeNames(xmlDict *__pyx_v_c_dict, xmlNode *__pyx_v_c_node) {
64999   xmlNode *__pyx_v_c_attr;
65000   char *__pyx_v_c_name;
65001   int __pyx_r;
65002   int __pyx_t_1;
65003
65004   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":659
65005  *     cdef xmlNode* c_attr
65006  *     cdef char* c_name
65007  *     c_name = tree.xmlDictLookup(c_dict, c_node.name, -1)             # <<<<<<<<<<<<<<
65008  *     if c_name is NULL:
65009  *         return -1
65010  */
65011   __pyx_v_c_name = xmlDictLookup(__pyx_v_c_dict, __pyx_v_c_node->name, -1);
65012
65013   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":660
65014  *     cdef char* c_name
65015  *     c_name = tree.xmlDictLookup(c_dict, c_node.name, -1)
65016  *     if c_name is NULL:             # <<<<<<<<<<<<<<
65017  *         return -1
65018  *     if c_name is not c_node.name:
65019  */
65020   __pyx_t_1 = (__pyx_v_c_name == NULL);
65021   if (__pyx_t_1) {
65022
65023     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":661
65024  *     c_name = tree.xmlDictLookup(c_dict, c_node.name, -1)
65025  *     if c_name is NULL:
65026  *         return -1             # <<<<<<<<<<<<<<
65027  *     if c_name is not c_node.name:
65028  *         tree.xmlFree(c_node.name)
65029  */
65030     __pyx_r = -1;
65031     goto __pyx_L0;
65032     goto __pyx_L3;
65033   }
65034   __pyx_L3:;
65035
65036   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":662
65037  *     if c_name is NULL:
65038  *         return -1
65039  *     if c_name is not c_node.name:             # <<<<<<<<<<<<<<
65040  *         tree.xmlFree(c_node.name)
65041  *         c_node.name = c_name
65042  */
65043   __pyx_t_1 = (__pyx_v_c_name != __pyx_v_c_node->name);
65044   if (__pyx_t_1) {
65045
65046     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":663
65047  *         return -1
65048  *     if c_name is not c_node.name:
65049  *         tree.xmlFree(c_node.name)             # <<<<<<<<<<<<<<
65050  *         c_node.name = c_name
65051  *     c_attr = <xmlNode*>c_node.properties
65052  */
65053     xmlFree(__pyx_v_c_node->name);
65054
65055     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":664
65056  *     if c_name is not c_node.name:
65057  *         tree.xmlFree(c_node.name)
65058  *         c_node.name = c_name             # <<<<<<<<<<<<<<
65059  *     c_attr = <xmlNode*>c_node.properties
65060  *     while c_attr is not NULL:
65061  */
65062     __pyx_v_c_node->name = __pyx_v_c_name;
65063     goto __pyx_L4;
65064   }
65065   __pyx_L4:;
65066
65067   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":665
65068  *         tree.xmlFree(c_node.name)
65069  *         c_node.name = c_name
65070  *     c_attr = <xmlNode*>c_node.properties             # <<<<<<<<<<<<<<
65071  *     while c_attr is not NULL:
65072  *         c_name = tree.xmlDictLookup(c_dict, c_attr.name, -1)
65073  */
65074   __pyx_v_c_attr = ((xmlNode *)__pyx_v_c_node->properties);
65075
65076   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":666
65077  *         c_node.name = c_name
65078  *     c_attr = <xmlNode*>c_node.properties
65079  *     while c_attr is not NULL:             # <<<<<<<<<<<<<<
65080  *         c_name = tree.xmlDictLookup(c_dict, c_attr.name, -1)
65081  *         if c_name is NULL:
65082  */
65083   while (1) {
65084     __pyx_t_1 = (__pyx_v_c_attr != NULL);
65085     if (!__pyx_t_1) break;
65086
65087     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":667
65088  *     c_attr = <xmlNode*>c_node.properties
65089  *     while c_attr is not NULL:
65090  *         c_name = tree.xmlDictLookup(c_dict, c_attr.name, -1)             # <<<<<<<<<<<<<<
65091  *         if c_name is NULL:
65092  *             return -1
65093  */
65094     __pyx_v_c_name = xmlDictLookup(__pyx_v_c_dict, __pyx_v_c_attr->name, -1);
65095
65096     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":668
65097  *     while c_attr is not NULL:
65098  *         c_name = tree.xmlDictLookup(c_dict, c_attr.name, -1)
65099  *         if c_name is NULL:             # <<<<<<<<<<<<<<
65100  *             return -1
65101  *         if c_name is not c_attr.name:
65102  */
65103     __pyx_t_1 = (__pyx_v_c_name == NULL);
65104     if (__pyx_t_1) {
65105
65106       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":669
65107  *         c_name = tree.xmlDictLookup(c_dict, c_attr.name, -1)
65108  *         if c_name is NULL:
65109  *             return -1             # <<<<<<<<<<<<<<
65110  *         if c_name is not c_attr.name:
65111  *             tree.xmlFree(c_attr.name)
65112  */
65113       __pyx_r = -1;
65114       goto __pyx_L0;
65115       goto __pyx_L7;
65116     }
65117     __pyx_L7:;
65118
65119     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":670
65120  *         if c_name is NULL:
65121  *             return -1
65122  *         if c_name is not c_attr.name:             # <<<<<<<<<<<<<<
65123  *             tree.xmlFree(c_attr.name)
65124  *             c_attr.name = c_name
65125  */
65126     __pyx_t_1 = (__pyx_v_c_name != __pyx_v_c_attr->name);
65127     if (__pyx_t_1) {
65128
65129       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":671
65130  *             return -1
65131  *         if c_name is not c_attr.name:
65132  *             tree.xmlFree(c_attr.name)             # <<<<<<<<<<<<<<
65133  *             c_attr.name = c_name
65134  *         c_attr = c_attr.next
65135  */
65136       xmlFree(__pyx_v_c_attr->name);
65137
65138       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":672
65139  *         if c_name is not c_attr.name:
65140  *             tree.xmlFree(c_attr.name)
65141  *             c_attr.name = c_name             # <<<<<<<<<<<<<<
65142  *         c_attr = c_attr.next
65143  *     return 0
65144  */
65145       __pyx_v_c_attr->name = __pyx_v_c_name;
65146       goto __pyx_L8;
65147     }
65148     __pyx_L8:;
65149
65150     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":673
65151  *             tree.xmlFree(c_attr.name)
65152  *             c_attr.name = c_name
65153  *         c_attr = c_attr.next             # <<<<<<<<<<<<<<
65154  *     return 0
65155  * 
65156  */
65157     __pyx_v_c_attr = __pyx_v_c_attr->next;
65158   }
65159
65160   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":674
65161  *             c_attr.name = c_name
65162  *         c_attr = c_attr.next
65163  *     return 0             # <<<<<<<<<<<<<<
65164  * 
65165  * cdef class _BaseParser:
65166  */
65167   __pyx_r = 0;
65168   goto __pyx_L0;
65169
65170   __pyx_r = 0;
65171   __pyx_L0:;
65172   return __pyx_r;
65173 }
65174
65175 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":691
65176  *     cdef object _default_encoding
65177  * 
65178  *     def __init__(self, int parse_options, bint for_html, XMLSchema schema,             # <<<<<<<<<<<<<<
65179  *                  remove_comments, remove_pis, strip_cdata, target,
65180  *                  filename, encoding):
65181  */
65182
65183 static int __pyx_pf_4lxml_5etree_11_BaseParser___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
65184 static int __pyx_pf_4lxml_5etree_11_BaseParser___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
65185   int __pyx_v_parse_options;
65186   int __pyx_v_for_html;
65187   struct __pyx_obj_4lxml_5etree_XMLSchema *__pyx_v_schema = 0;
65188   PyObject *__pyx_v_remove_comments = 0;
65189   PyObject *__pyx_v_remove_pis = 0;
65190   PyObject *__pyx_v_strip_cdata = 0;
65191   PyObject *__pyx_v_target = 0;
65192   PyObject *__pyx_v_filename = 0;
65193   PyObject *__pyx_v_encoding = 0;
65194   xmlCharEncodingHandler *__pyx_v_enchandler;
65195   int __pyx_r;
65196   int __pyx_t_1;
65197   int __pyx_t_2;
65198   int __pyx_t_3;
65199   int __pyx_t_4;
65200   PyObject *__pyx_t_5 = NULL;
65201   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_parse_options,&__pyx_kp_for_html,&__pyx_kp_schema,&__pyx_kp_remove_comments,&__pyx_kp_remove_pis,&__pyx_kp_strip_cdata,&__pyx_kp_target,&__pyx_kp_filename,&__pyx_kp_encoding,0};
65202   __Pyx_SetupRefcountContext("__init__");
65203   if (unlikely(__pyx_kwds)) {
65204     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
65205     PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
65206     switch (PyTuple_GET_SIZE(__pyx_args)) {
65207       case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
65208       case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
65209       case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
65210       case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
65211       case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
65212       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
65213       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
65214       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
65215       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
65216       case  0: break;
65217       default: goto __pyx_L5_argtuple_error;
65218     }
65219     switch (PyTuple_GET_SIZE(__pyx_args)) {
65220       case  0:
65221       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_parse_options);
65222       if (likely(values[0])) kw_args--;
65223       else goto __pyx_L5_argtuple_error;
65224       case  1:
65225       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_for_html);
65226       if (likely(values[1])) kw_args--;
65227       else {
65228         __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
65229       }
65230       case  2:
65231       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_schema);
65232       if (likely(values[2])) kw_args--;
65233       else {
65234         __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
65235       }
65236       case  3:
65237       values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_remove_comments);
65238       if (likely(values[3])) kw_args--;
65239       else {
65240         __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 3); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
65241       }
65242       case  4:
65243       values[4] = PyDict_GetItem(__pyx_kwds, __pyx_kp_remove_pis);
65244       if (likely(values[4])) kw_args--;
65245       else {
65246         __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 4); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
65247       }
65248       case  5:
65249       values[5] = PyDict_GetItem(__pyx_kwds, __pyx_kp_strip_cdata);
65250       if (likely(values[5])) kw_args--;
65251       else {
65252         __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 5); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
65253       }
65254       case  6:
65255       values[6] = PyDict_GetItem(__pyx_kwds, __pyx_kp_target);
65256       if (likely(values[6])) kw_args--;
65257       else {
65258         __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 6); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
65259       }
65260       case  7:
65261       values[7] = PyDict_GetItem(__pyx_kwds, __pyx_kp_filename);
65262       if (likely(values[7])) kw_args--;
65263       else {
65264         __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 7); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
65265       }
65266       case  8:
65267       values[8] = PyDict_GetItem(__pyx_kwds, __pyx_kp_encoding);
65268       if (likely(values[8])) kw_args--;
65269       else {
65270         __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 8); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
65271       }
65272     }
65273     if (unlikely(kw_args > 0)) {
65274       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
65275     }
65276     __pyx_v_parse_options = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_parse_options == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
65277     __pyx_v_for_html = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_for_html == (int)-1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
65278     __pyx_v_schema = ((struct __pyx_obj_4lxml_5etree_XMLSchema *)values[2]);
65279     __pyx_v_remove_comments = values[3];
65280     __pyx_v_remove_pis = values[4];
65281     __pyx_v_strip_cdata = values[5];
65282     __pyx_v_target = values[6];
65283     __pyx_v_filename = values[7];
65284     __pyx_v_encoding = values[8];
65285   } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
65286     goto __pyx_L5_argtuple_error;
65287   } else {
65288     __pyx_v_parse_options = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_parse_options == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
65289     __pyx_v_for_html = __Pyx_PyObject_IsTrue(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_for_html == (int)-1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
65290     __pyx_v_schema = ((struct __pyx_obj_4lxml_5etree_XMLSchema *)PyTuple_GET_ITEM(__pyx_args, 2));
65291     __pyx_v_remove_comments = PyTuple_GET_ITEM(__pyx_args, 3);
65292     __pyx_v_remove_pis = PyTuple_GET_ITEM(__pyx_args, 4);
65293     __pyx_v_strip_cdata = PyTuple_GET_ITEM(__pyx_args, 5);
65294     __pyx_v_target = PyTuple_GET_ITEM(__pyx_args, 6);
65295     __pyx_v_filename = PyTuple_GET_ITEM(__pyx_args, 7);
65296     __pyx_v_encoding = PyTuple_GET_ITEM(__pyx_args, 8);
65297   }
65298   goto __pyx_L4_argument_unpacking_done;
65299   __pyx_L5_argtuple_error:;
65300   __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
65301   __pyx_L3_error:;
65302   __Pyx_AddTraceback("lxml.etree._BaseParser.__init__");
65303   return -1;
65304   __pyx_L4_argument_unpacking_done:;
65305   __Pyx_INCREF(__pyx_v_encoding);
65306   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_ptype_4lxml_5etree_XMLSchema, 1, "schema", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
65307
65308   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":696
65309  *         cdef tree.xmlCharEncodingHandler* enchandler
65310  *         cdef int c_encoding
65311  *         if not isinstance(self, HTMLParser) and \             # <<<<<<<<<<<<<<
65312  *                 not isinstance(self, XMLParser) and \
65313  *                 not isinstance(self, iterparse):
65314  */
65315   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_self, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree_HTMLParser))); 
65316   if ((!__pyx_t_1)) {
65317
65318     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":697
65319  *         cdef int c_encoding
65320  *         if not isinstance(self, HTMLParser) and \
65321  *                 not isinstance(self, XMLParser) and \             # <<<<<<<<<<<<<<
65322  *                 not isinstance(self, iterparse):
65323  *             raise TypeError, u"This class cannot be instantiated"
65324  */
65325     __pyx_t_2 = PyObject_TypeCheck(__pyx_v_self, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree_XMLParser))); 
65326     if ((!__pyx_t_2)) {
65327
65328       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":698
65329  *         if not isinstance(self, HTMLParser) and \
65330  *                 not isinstance(self, XMLParser) and \
65331  *                 not isinstance(self, iterparse):             # <<<<<<<<<<<<<<
65332  *             raise TypeError, u"This class cannot be instantiated"
65333  * 
65334  */
65335       __pyx_t_3 = PyObject_TypeCheck(__pyx_v_self, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree_iterparse))); 
65336       __pyx_t_4 = (!__pyx_t_3);
65337     } else {
65338       __pyx_t_4 = (!__pyx_t_2);
65339     }
65340     __pyx_t_2 = __pyx_t_4;
65341   } else {
65342     __pyx_t_2 = (!__pyx_t_1);
65343   }
65344   if (__pyx_t_2) {
65345
65346     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":699
65347  *                 not isinstance(self, XMLParser) and \
65348  *                 not isinstance(self, iterparse):
65349  *             raise TypeError, u"This class cannot be instantiated"             # <<<<<<<<<<<<<<
65350  * 
65351  *         self._parse_options = parse_options
65352  */
65353     __Pyx_Raise(__pyx_builtin_TypeError, ((PyObject *)__pyx_kp_446), 0);
65354     {__pyx_filename = __pyx_f[2]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
65355     goto __pyx_L6;
65356   }
65357   __pyx_L6:;
65358
65359   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":701
65360  *             raise TypeError, u"This class cannot be instantiated"
65361  * 
65362  *         self._parse_options = parse_options             # <<<<<<<<<<<<<<
65363  *         self._filename = filename
65364  *         self._target = target
65365  */
65366   ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_parse_options = __pyx_v_parse_options;
65367
65368   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":702
65369  * 
65370  *         self._parse_options = parse_options
65371  *         self._filename = filename             # <<<<<<<<<<<<<<
65372  *         self._target = target
65373  *         self._for_html = for_html
65374  */
65375   __Pyx_INCREF(__pyx_v_filename);
65376   __Pyx_GIVEREF(__pyx_v_filename);
65377   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_filename);
65378   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_filename);
65379   ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_filename = __pyx_v_filename;
65380
65381   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":703
65382  *         self._parse_options = parse_options
65383  *         self._filename = filename
65384  *         self._target = target             # <<<<<<<<<<<<<<
65385  *         self._for_html = for_html
65386  *         self._remove_comments = remove_comments
65387  */
65388   __Pyx_INCREF(__pyx_v_target);
65389   __Pyx_GIVEREF(__pyx_v_target);
65390   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_target);
65391   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_target);
65392   ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_target = __pyx_v_target;
65393
65394   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":704
65395  *         self._filename = filename
65396  *         self._target = target
65397  *         self._for_html = for_html             # <<<<<<<<<<<<<<
65398  *         self._remove_comments = remove_comments
65399  *         self._remove_pis = remove_pis
65400  */
65401   ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_for_html = __pyx_v_for_html;
65402
65403   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":705
65404  *         self._target = target
65405  *         self._for_html = for_html
65406  *         self._remove_comments = remove_comments             # <<<<<<<<<<<<<<
65407  *         self._remove_pis = remove_pis
65408  *         self._strip_cdata = strip_cdata
65409  */
65410   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_remove_comments); if (unlikely((__pyx_t_2 == (int)-1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
65411   ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_remove_comments = __pyx_t_2;
65412
65413   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":706
65414  *         self._for_html = for_html
65415  *         self._remove_comments = remove_comments
65416  *         self._remove_pis = remove_pis             # <<<<<<<<<<<<<<
65417  *         self._strip_cdata = strip_cdata
65418  *         self._schema = schema
65419  */
65420   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_remove_pis); if (unlikely((__pyx_t_2 == (int)-1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
65421   ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_remove_pis = __pyx_t_2;
65422
65423   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":707
65424  *         self._remove_comments = remove_comments
65425  *         self._remove_pis = remove_pis
65426  *         self._strip_cdata = strip_cdata             # <<<<<<<<<<<<<<
65427  *         self._schema = schema
65428  * 
65429  */
65430   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_strip_cdata); if (unlikely((__pyx_t_2 == (int)-1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
65431   ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_strip_cdata = __pyx_t_2;
65432
65433   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":708
65434  *         self._remove_pis = remove_pis
65435  *         self._strip_cdata = strip_cdata
65436  *         self._schema = schema             # <<<<<<<<<<<<<<
65437  * 
65438  *         self._resolvers = _ResolverRegistry()
65439  */
65440   __Pyx_INCREF(((PyObject *)__pyx_v_schema));
65441   __Pyx_GIVEREF(((PyObject *)__pyx_v_schema));
65442   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_schema);
65443   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_schema));
65444   ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_schema = __pyx_v_schema;
65445
65446   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":710
65447  *         self._schema = schema
65448  * 
65449  *         self._resolvers = _ResolverRegistry()             # <<<<<<<<<<<<<<
65450  * 
65451  *         if encoding is None:
65452  */
65453   __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ResolverRegistry)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
65454   __Pyx_GOTREF(__pyx_t_5);
65455   if (!(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_4lxml_5etree__ResolverRegistry))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
65456   __Pyx_GIVEREF(__pyx_t_5);
65457   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_resolvers);
65458   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_resolvers));
65459   ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_resolvers = ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_t_5);
65460   __pyx_t_5 = 0;
65461
65462   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":712
65463  *         self._resolvers = _ResolverRegistry()
65464  * 
65465  *         if encoding is None:             # <<<<<<<<<<<<<<
65466  *             self._default_encoding = None
65467  *         else:
65468  */
65469   __pyx_t_2 = (__pyx_v_encoding == Py_None);
65470   if (__pyx_t_2) {
65471
65472     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":713
65473  * 
65474  *         if encoding is None:
65475  *             self._default_encoding = None             # <<<<<<<<<<<<<<
65476  *         else:
65477  *             encoding = _utf8(encoding)
65478  */
65479     __Pyx_INCREF(Py_None);
65480     __Pyx_GIVEREF(Py_None);
65481     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_default_encoding);
65482     __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_default_encoding);
65483     ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_default_encoding = Py_None;
65484     goto __pyx_L7;
65485   }
65486   /*else*/ {
65487
65488     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":715
65489  *             self._default_encoding = None
65490  *         else:
65491  *             encoding = _utf8(encoding)             # <<<<<<<<<<<<<<
65492  *             enchandler = tree.xmlFindCharEncodingHandler(_cstr(encoding))
65493  *             if enchandler is NULL:
65494  */
65495     __pyx_t_5 = __pyx_f_4lxml_5etree__utf8(__pyx_v_encoding); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
65496     __Pyx_GOTREF(__pyx_t_5);
65497     __Pyx_DECREF(__pyx_v_encoding);
65498     __pyx_v_encoding = __pyx_t_5;
65499     __pyx_t_5 = 0;
65500
65501     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":716
65502  *         else:
65503  *             encoding = _utf8(encoding)
65504  *             enchandler = tree.xmlFindCharEncodingHandler(_cstr(encoding))             # <<<<<<<<<<<<<<
65505  *             if enchandler is NULL:
65506  *                 raise LookupError, u"unknown encoding: '%s'" % encoding
65507  */
65508     __pyx_v_enchandler = xmlFindCharEncodingHandler(PyString_AS_STRING(__pyx_v_encoding));
65509
65510     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":717
65511  *             encoding = _utf8(encoding)
65512  *             enchandler = tree.xmlFindCharEncodingHandler(_cstr(encoding))
65513  *             if enchandler is NULL:             # <<<<<<<<<<<<<<
65514  *                 raise LookupError, u"unknown encoding: '%s'" % encoding
65515  *             tree.xmlCharEncCloseFunc(enchandler)
65516  */
65517     __pyx_t_2 = (__pyx_v_enchandler == NULL);
65518     if (__pyx_t_2) {
65519
65520       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":718
65521  *             enchandler = tree.xmlFindCharEncodingHandler(_cstr(encoding))
65522  *             if enchandler is NULL:
65523  *                 raise LookupError, u"unknown encoding: '%s'" % encoding             # <<<<<<<<<<<<<<
65524  *             tree.xmlCharEncCloseFunc(enchandler)
65525  *             self._default_encoding = encoding
65526  */
65527       __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_447), __pyx_v_encoding); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
65528       __Pyx_GOTREF(__pyx_t_5);
65529       __Pyx_Raise(__pyx_builtin_LookupError, __pyx_t_5, 0);
65530       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
65531       {__pyx_filename = __pyx_f[2]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
65532       goto __pyx_L8;
65533     }
65534     __pyx_L8:;
65535
65536     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":719
65537  *             if enchandler is NULL:
65538  *                 raise LookupError, u"unknown encoding: '%s'" % encoding
65539  *             tree.xmlCharEncCloseFunc(enchandler)             # <<<<<<<<<<<<<<
65540  *             self._default_encoding = encoding
65541  * 
65542  */
65543     xmlCharEncCloseFunc(__pyx_v_enchandler);
65544
65545     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":720
65546  *                 raise LookupError, u"unknown encoding: '%s'" % encoding
65547  *             tree.xmlCharEncCloseFunc(enchandler)
65548  *             self._default_encoding = encoding             # <<<<<<<<<<<<<<
65549  * 
65550  *     cdef _ParserContext _getParserContext(self):
65551  */
65552     __Pyx_INCREF(__pyx_v_encoding);
65553     __Pyx_GIVEREF(__pyx_v_encoding);
65554     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_default_encoding);
65555     __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_default_encoding);
65556     ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_default_encoding = __pyx_v_encoding;
65557   }
65558   __pyx_L7:;
65559
65560   __pyx_r = 0;
65561   goto __pyx_L0;
65562   __pyx_L1_error:;
65563   __Pyx_XDECREF(__pyx_t_5);
65564   __Pyx_AddTraceback("lxml.etree._BaseParser.__init__");
65565   __pyx_r = -1;
65566   __pyx_L0:;
65567   __Pyx_DECREF(__pyx_v_encoding);
65568   __Pyx_FinishRefcountContext();
65569   return __pyx_r;
65570 }
65571
65572 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":722
65573  *             self._default_encoding = encoding
65574  * 
65575  *     cdef _ParserContext _getParserContext(self):             # <<<<<<<<<<<<<<
65576  *         cdef xmlparser.xmlParserCtxt* pctxt
65577  *         if self._parser_context is None:
65578  */
65579
65580 static  struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_f_4lxml_5etree_11_BaseParser__getParserContext(struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_self) {
65581   xmlParserCtxt *__pyx_v_pctxt;
65582   struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_r = NULL;
65583   int __pyx_t_1;
65584   PyObject *__pyx_t_2 = NULL;
65585   __Pyx_SetupRefcountContext("_getParserContext");
65586
65587   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":724
65588  *     cdef _ParserContext _getParserContext(self):
65589  *         cdef xmlparser.xmlParserCtxt* pctxt
65590  *         if self._parser_context is None:             # <<<<<<<<<<<<<<
65591  *             self._parser_context = self._createContext(self._target)
65592  *             if self._schema is not None:
65593  */
65594   __pyx_t_1 = (((PyObject *)__pyx_v_self->_parser_context) == Py_None);
65595   if (__pyx_t_1) {
65596
65597     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":725
65598  *         cdef xmlparser.xmlParserCtxt* pctxt
65599  *         if self._parser_context is None:
65600  *             self._parser_context = self._createContext(self._target)             # <<<<<<<<<<<<<<
65601  *             if self._schema is not None:
65602  *                 self._parser_context._validator = \
65603  */
65604     __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_createContext(__pyx_v_self, __pyx_v_self->_target)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
65605     __Pyx_GOTREF(__pyx_t_2);
65606     __Pyx_GIVEREF(__pyx_t_2);
65607     __Pyx_GOTREF(__pyx_v_self->_parser_context);
65608     __Pyx_DECREF(((PyObject *)__pyx_v_self->_parser_context));
65609     __pyx_v_self->_parser_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_t_2);
65610     __pyx_t_2 = 0;
65611
65612     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":726
65613  *         if self._parser_context is None:
65614  *             self._parser_context = self._createContext(self._target)
65615  *             if self._schema is not None:             # <<<<<<<<<<<<<<
65616  *                 self._parser_context._validator = \
65617  *                     self._schema._newSaxValidator(
65618  */
65619     __pyx_t_1 = (((PyObject *)__pyx_v_self->_schema) != Py_None);
65620     if (__pyx_t_1) {
65621
65622       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":729
65623  *                 self._parser_context._validator = \
65624  *                     self._schema._newSaxValidator(
65625  *                         self._parse_options & xmlparser.XML_PARSE_DTDATTR)             # <<<<<<<<<<<<<<
65626  *             pctxt = self._newParserCtxt()
65627  *             if pctxt is NULL:
65628  */
65629       __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree_XMLSchema *)__pyx_v_self->_schema->__pyx_vtab)->_newSaxValidator(__pyx_v_self->_schema, (__pyx_v_self->_parse_options & XML_PARSE_DTDATTR))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
65630       __Pyx_GOTREF(__pyx_t_2);
65631
65632       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":727
65633  *             self._parser_context = self._createContext(self._target)
65634  *             if self._schema is not None:
65635  *                 self._parser_context._validator = \             # <<<<<<<<<<<<<<
65636  *                     self._schema._newSaxValidator(
65637  *                         self._parse_options & xmlparser.XML_PARSE_DTDATTR)
65638  */
65639       __Pyx_GIVEREF(__pyx_t_2);
65640       __Pyx_GOTREF(__pyx_v_self->_parser_context->_validator);
65641       __Pyx_DECREF(((PyObject *)__pyx_v_self->_parser_context->_validator));
65642       __pyx_v_self->_parser_context->_validator = ((struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *)__pyx_t_2);
65643       __pyx_t_2 = 0;
65644       goto __pyx_L4;
65645     }
65646     __pyx_L4:;
65647
65648     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":730
65649  *                     self._schema._newSaxValidator(
65650  *                         self._parse_options & xmlparser.XML_PARSE_DTDATTR)
65651  *             pctxt = self._newParserCtxt()             # <<<<<<<<<<<<<<
65652  *             if pctxt is NULL:
65653  *                 python.PyErr_NoMemory()
65654  */
65655     __pyx_v_pctxt = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_newParserCtxt(__pyx_v_self);
65656
65657     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":731
65658  *                         self._parse_options & xmlparser.XML_PARSE_DTDATTR)
65659  *             pctxt = self._newParserCtxt()
65660  *             if pctxt is NULL:             # <<<<<<<<<<<<<<
65661  *                 python.PyErr_NoMemory()
65662  *             _initParserContext(self._parser_context, self._resolvers, pctxt)
65663  */
65664     __pyx_t_1 = (__pyx_v_pctxt == NULL);
65665     if (__pyx_t_1) {
65666
65667       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":732
65668  *             pctxt = self._newParserCtxt()
65669  *             if pctxt is NULL:
65670  *                 python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
65671  *             _initParserContext(self._parser_context, self._resolvers, pctxt)
65672  *             if self._remove_comments:
65673  */
65674       __pyx_t_2 = PyErr_NoMemory(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
65675       __Pyx_GOTREF(__pyx_t_2);
65676       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
65677       goto __pyx_L5;
65678     }
65679     __pyx_L5:;
65680
65681     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":733
65682  *             if pctxt is NULL:
65683  *                 python.PyErr_NoMemory()
65684  *             _initParserContext(self._parser_context, self._resolvers, pctxt)             # <<<<<<<<<<<<<<
65685  *             if self._remove_comments:
65686  *                 pctxt.sax.comment = NULL
65687  */
65688     __pyx_t_2 = __pyx_f_4lxml_5etree__initParserContext(__pyx_v_self->_parser_context, __pyx_v_self->_resolvers, __pyx_v_pctxt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
65689     __Pyx_GOTREF(__pyx_t_2);
65690     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
65691
65692     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":734
65693  *                 python.PyErr_NoMemory()
65694  *             _initParserContext(self._parser_context, self._resolvers, pctxt)
65695  *             if self._remove_comments:             # <<<<<<<<<<<<<<
65696  *                 pctxt.sax.comment = NULL
65697  *             if self._remove_pis:
65698  */
65699     __pyx_t_1 = __pyx_v_self->_remove_comments;
65700     if (__pyx_t_1) {
65701
65702       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":735
65703  *             _initParserContext(self._parser_context, self._resolvers, pctxt)
65704  *             if self._remove_comments:
65705  *                 pctxt.sax.comment = NULL             # <<<<<<<<<<<<<<
65706  *             if self._remove_pis:
65707  *                 pctxt.sax.processingInstruction = NULL
65708  */
65709       __pyx_v_pctxt->sax->comment = NULL;
65710       goto __pyx_L6;
65711     }
65712     __pyx_L6:;
65713
65714     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":736
65715  *             if self._remove_comments:
65716  *                 pctxt.sax.comment = NULL
65717  *             if self._remove_pis:             # <<<<<<<<<<<<<<
65718  *                 pctxt.sax.processingInstruction = NULL
65719  *             if self._strip_cdata:
65720  */
65721     __pyx_t_1 = __pyx_v_self->_remove_pis;
65722     if (__pyx_t_1) {
65723
65724       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":737
65725  *                 pctxt.sax.comment = NULL
65726  *             if self._remove_pis:
65727  *                 pctxt.sax.processingInstruction = NULL             # <<<<<<<<<<<<<<
65728  *             if self._strip_cdata:
65729  *                 # hard switch-off for CDATA nodes => makes them plain text
65730  */
65731       __pyx_v_pctxt->sax->processingInstruction = NULL;
65732       goto __pyx_L7;
65733     }
65734     __pyx_L7:;
65735
65736     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":738
65737  *             if self._remove_pis:
65738  *                 pctxt.sax.processingInstruction = NULL
65739  *             if self._strip_cdata:             # <<<<<<<<<<<<<<
65740  *                 # hard switch-off for CDATA nodes => makes them plain text
65741  *                 pctxt.sax.cdataBlock = NULL
65742  */
65743     __pyx_t_1 = __pyx_v_self->_strip_cdata;
65744     if (__pyx_t_1) {
65745
65746       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":740
65747  *             if self._strip_cdata:
65748  *                 # hard switch-off for CDATA nodes => makes them plain text
65749  *                 pctxt.sax.cdataBlock = NULL             # <<<<<<<<<<<<<<
65750  *         return self._parser_context
65751  * 
65752  */
65753       __pyx_v_pctxt->sax->cdataBlock = NULL;
65754       goto __pyx_L8;
65755     }
65756     __pyx_L8:;
65757     goto __pyx_L3;
65758   }
65759   __pyx_L3:;
65760
65761   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":741
65762  *                 # hard switch-off for CDATA nodes => makes them plain text
65763  *                 pctxt.sax.cdataBlock = NULL
65764  *         return self._parser_context             # <<<<<<<<<<<<<<
65765  * 
65766  *     cdef _ParserContext _getPushParserContext(self):
65767  */
65768   __Pyx_XDECREF(((PyObject *)__pyx_r));
65769   __Pyx_INCREF(((PyObject *)__pyx_v_self->_parser_context));
65770   __pyx_r = __pyx_v_self->_parser_context;
65771   goto __pyx_L0;
65772
65773   __pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); __Pyx_INCREF(Py_None);
65774   goto __pyx_L0;
65775   __pyx_L1_error:;
65776   __Pyx_XDECREF(__pyx_t_2);
65777   __Pyx_AddTraceback("lxml.etree._BaseParser._getParserContext");
65778   __pyx_r = 0;
65779   __pyx_L0:;
65780   __Pyx_XGIVEREF((PyObject *)__pyx_r);
65781   __Pyx_FinishRefcountContext();
65782   return __pyx_r;
65783 }
65784
65785 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":743
65786  *         return self._parser_context
65787  * 
65788  *     cdef _ParserContext _getPushParserContext(self):             # <<<<<<<<<<<<<<
65789  *         cdef xmlparser.xmlParserCtxt* pctxt
65790  *         if self._push_parser_context is None:
65791  */
65792
65793 static  struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_f_4lxml_5etree_11_BaseParser__getPushParserContext(struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_self) {
65794   xmlParserCtxt *__pyx_v_pctxt;
65795   struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_r = NULL;
65796   int __pyx_t_1;
65797   PyObject *__pyx_t_2 = NULL;
65798   __Pyx_SetupRefcountContext("_getPushParserContext");
65799
65800   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":745
65801  *     cdef _ParserContext _getPushParserContext(self):
65802  *         cdef xmlparser.xmlParserCtxt* pctxt
65803  *         if self._push_parser_context is None:             # <<<<<<<<<<<<<<
65804  *             self._push_parser_context = self._createContext(self._target)
65805  *             if self._schema is not None:
65806  */
65807   __pyx_t_1 = (((PyObject *)__pyx_v_self->_push_parser_context) == Py_None);
65808   if (__pyx_t_1) {
65809
65810     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":746
65811  *         cdef xmlparser.xmlParserCtxt* pctxt
65812  *         if self._push_parser_context is None:
65813  *             self._push_parser_context = self._createContext(self._target)             # <<<<<<<<<<<<<<
65814  *             if self._schema is not None:
65815  *                 self._push_parser_context._validator = \
65816  */
65817     __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_createContext(__pyx_v_self, __pyx_v_self->_target)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
65818     __Pyx_GOTREF(__pyx_t_2);
65819     __Pyx_GIVEREF(__pyx_t_2);
65820     __Pyx_GOTREF(__pyx_v_self->_push_parser_context);
65821     __Pyx_DECREF(((PyObject *)__pyx_v_self->_push_parser_context));
65822     __pyx_v_self->_push_parser_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_t_2);
65823     __pyx_t_2 = 0;
65824
65825     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":747
65826  *         if self._push_parser_context is None:
65827  *             self._push_parser_context = self._createContext(self._target)
65828  *             if self._schema is not None:             # <<<<<<<<<<<<<<
65829  *                 self._push_parser_context._validator = \
65830  *                     self._schema._newSaxValidator(
65831  */
65832     __pyx_t_1 = (((PyObject *)__pyx_v_self->_schema) != Py_None);
65833     if (__pyx_t_1) {
65834
65835       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":750
65836  *                 self._push_parser_context._validator = \
65837  *                     self._schema._newSaxValidator(
65838  *                         self._parse_options & xmlparser.XML_PARSE_DTDATTR)             # <<<<<<<<<<<<<<
65839  *             pctxt = self._newPushParserCtxt()
65840  *             if pctxt is NULL:
65841  */
65842       __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree_XMLSchema *)__pyx_v_self->_schema->__pyx_vtab)->_newSaxValidator(__pyx_v_self->_schema, (__pyx_v_self->_parse_options & XML_PARSE_DTDATTR))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
65843       __Pyx_GOTREF(__pyx_t_2);
65844
65845       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":748
65846  *             self._push_parser_context = self._createContext(self._target)
65847  *             if self._schema is not None:
65848  *                 self._push_parser_context._validator = \             # <<<<<<<<<<<<<<
65849  *                     self._schema._newSaxValidator(
65850  *                         self._parse_options & xmlparser.XML_PARSE_DTDATTR)
65851  */
65852       __Pyx_GIVEREF(__pyx_t_2);
65853       __Pyx_GOTREF(__pyx_v_self->_push_parser_context->_validator);
65854       __Pyx_DECREF(((PyObject *)__pyx_v_self->_push_parser_context->_validator));
65855       __pyx_v_self->_push_parser_context->_validator = ((struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *)__pyx_t_2);
65856       __pyx_t_2 = 0;
65857       goto __pyx_L4;
65858     }
65859     __pyx_L4:;
65860
65861     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":751
65862  *                     self._schema._newSaxValidator(
65863  *                         self._parse_options & xmlparser.XML_PARSE_DTDATTR)
65864  *             pctxt = self._newPushParserCtxt()             # <<<<<<<<<<<<<<
65865  *             if pctxt is NULL:
65866  *                 python.PyErr_NoMemory()
65867  */
65868     __pyx_v_pctxt = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_newPushParserCtxt(__pyx_v_self);
65869
65870     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":752
65871  *                         self._parse_options & xmlparser.XML_PARSE_DTDATTR)
65872  *             pctxt = self._newPushParserCtxt()
65873  *             if pctxt is NULL:             # <<<<<<<<<<<<<<
65874  *                 python.PyErr_NoMemory()
65875  *             _initParserContext(
65876  */
65877     __pyx_t_1 = (__pyx_v_pctxt == NULL);
65878     if (__pyx_t_1) {
65879
65880       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":753
65881  *             pctxt = self._newPushParserCtxt()
65882  *             if pctxt is NULL:
65883  *                 python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
65884  *             _initParserContext(
65885  *                 self._push_parser_context, self._resolvers, pctxt)
65886  */
65887       __pyx_t_2 = PyErr_NoMemory(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
65888       __Pyx_GOTREF(__pyx_t_2);
65889       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
65890       goto __pyx_L5;
65891     }
65892     __pyx_L5:;
65893
65894     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":755
65895  *                 python.PyErr_NoMemory()
65896  *             _initParserContext(
65897  *                 self._push_parser_context, self._resolvers, pctxt)             # <<<<<<<<<<<<<<
65898  *             if self._remove_comments:
65899  *                 pctxt.sax.comment = NULL
65900  */
65901     __pyx_t_2 = __pyx_f_4lxml_5etree__initParserContext(__pyx_v_self->_push_parser_context, __pyx_v_self->_resolvers, __pyx_v_pctxt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
65902     __Pyx_GOTREF(__pyx_t_2);
65903     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
65904
65905     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":756
65906  *             _initParserContext(
65907  *                 self._push_parser_context, self._resolvers, pctxt)
65908  *             if self._remove_comments:             # <<<<<<<<<<<<<<
65909  *                 pctxt.sax.comment = NULL
65910  *             if self._remove_pis:
65911  */
65912     __pyx_t_1 = __pyx_v_self->_remove_comments;
65913     if (__pyx_t_1) {
65914
65915       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":757
65916  *                 self._push_parser_context, self._resolvers, pctxt)
65917  *             if self._remove_comments:
65918  *                 pctxt.sax.comment = NULL             # <<<<<<<<<<<<<<
65919  *             if self._remove_pis:
65920  *                 pctxt.sax.processingInstruction = NULL
65921  */
65922       __pyx_v_pctxt->sax->comment = NULL;
65923       goto __pyx_L6;
65924     }
65925     __pyx_L6:;
65926
65927     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":758
65928  *             if self._remove_comments:
65929  *                 pctxt.sax.comment = NULL
65930  *             if self._remove_pis:             # <<<<<<<<<<<<<<
65931  *                 pctxt.sax.processingInstruction = NULL
65932  *             if self._strip_cdata:
65933  */
65934     __pyx_t_1 = __pyx_v_self->_remove_pis;
65935     if (__pyx_t_1) {
65936
65937       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":759
65938  *                 pctxt.sax.comment = NULL
65939  *             if self._remove_pis:
65940  *                 pctxt.sax.processingInstruction = NULL             # <<<<<<<<<<<<<<
65941  *             if self._strip_cdata:
65942  *                 # hard switch-off for CDATA nodes => makes them plain text
65943  */
65944       __pyx_v_pctxt->sax->processingInstruction = NULL;
65945       goto __pyx_L7;
65946     }
65947     __pyx_L7:;
65948
65949     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":760
65950  *             if self._remove_pis:
65951  *                 pctxt.sax.processingInstruction = NULL
65952  *             if self._strip_cdata:             # <<<<<<<<<<<<<<
65953  *                 # hard switch-off for CDATA nodes => makes them plain text
65954  *                 pctxt.sax.cdataBlock = NULL
65955  */
65956     __pyx_t_1 = __pyx_v_self->_strip_cdata;
65957     if (__pyx_t_1) {
65958
65959       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":762
65960  *             if self._strip_cdata:
65961  *                 # hard switch-off for CDATA nodes => makes them plain text
65962  *                 pctxt.sax.cdataBlock = NULL             # <<<<<<<<<<<<<<
65963  *         return self._push_parser_context
65964  * 
65965  */
65966       __pyx_v_pctxt->sax->cdataBlock = NULL;
65967       goto __pyx_L8;
65968     }
65969     __pyx_L8:;
65970     goto __pyx_L3;
65971   }
65972   __pyx_L3:;
65973
65974   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":763
65975  *                 # hard switch-off for CDATA nodes => makes them plain text
65976  *                 pctxt.sax.cdataBlock = NULL
65977  *         return self._push_parser_context             # <<<<<<<<<<<<<<
65978  * 
65979  *     cdef _ParserContext _createContext(self, target):
65980  */
65981   __Pyx_XDECREF(((PyObject *)__pyx_r));
65982   __Pyx_INCREF(((PyObject *)__pyx_v_self->_push_parser_context));
65983   __pyx_r = __pyx_v_self->_push_parser_context;
65984   goto __pyx_L0;
65985
65986   __pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); __Pyx_INCREF(Py_None);
65987   goto __pyx_L0;
65988   __pyx_L1_error:;
65989   __Pyx_XDECREF(__pyx_t_2);
65990   __Pyx_AddTraceback("lxml.etree._BaseParser._getPushParserContext");
65991   __pyx_r = 0;
65992   __pyx_L0:;
65993   __Pyx_XGIVEREF((PyObject *)__pyx_r);
65994   __Pyx_FinishRefcountContext();
65995   return __pyx_r;
65996 }
65997
65998 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":765
65999  *         return self._push_parser_context
66000  * 
66001  *     cdef _ParserContext _createContext(self, target):             # <<<<<<<<<<<<<<
66002  *         cdef _TargetParserContext context
66003  *         if target is None:
66004  */
66005
66006 static  struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_f_4lxml_5etree_11_BaseParser__createContext(struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_self, PyObject *__pyx_v_target) {
66007   struct __pyx_obj_4lxml_5etree__TargetParserContext *__pyx_v_context;
66008   struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_r = NULL;
66009   int __pyx_t_1;
66010   PyObject *__pyx_t_2 = NULL;
66011   int __pyx_t_3;
66012   __Pyx_SetupRefcountContext("_createContext");
66013   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__TargetParserContext *)Py_None); __Pyx_INCREF(Py_None);
66014
66015   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":767
66016  *     cdef _ParserContext _createContext(self, target):
66017  *         cdef _TargetParserContext context
66018  *         if target is None:             # <<<<<<<<<<<<<<
66019  *             return _ParserContext()
66020  *         context = _TargetParserContext()
66021  */
66022   __pyx_t_1 = (__pyx_v_target == Py_None);
66023   if (__pyx_t_1) {
66024
66025     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":768
66026  *         cdef _TargetParserContext context
66027  *         if target is None:
66028  *             return _ParserContext()             # <<<<<<<<<<<<<<
66029  *         context = _TargetParserContext()
66030  *         context._setTarget(target)
66031  */
66032     __Pyx_XDECREF(((PyObject *)__pyx_r));
66033     __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ParserContext)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
66034     __Pyx_GOTREF(__pyx_t_2);
66035     if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__ParserContext))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
66036     __pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_t_2);
66037     __pyx_t_2 = 0;
66038     goto __pyx_L0;
66039     goto __pyx_L3;
66040   }
66041   __pyx_L3:;
66042
66043   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":769
66044  *         if target is None:
66045  *             return _ParserContext()
66046  *         context = _TargetParserContext()             # <<<<<<<<<<<<<<
66047  *         context._setTarget(target)
66048  *         return context
66049  */
66050   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__TargetParserContext)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
66051   __Pyx_GOTREF(__pyx_t_2);
66052   if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__TargetParserContext))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
66053   __Pyx_DECREF(((PyObject *)__pyx_v_context));
66054   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__TargetParserContext *)__pyx_t_2);
66055   __pyx_t_2 = 0;
66056
66057   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":770
66058  *             return _ParserContext()
66059  *         context = _TargetParserContext()
66060  *         context._setTarget(target)             # <<<<<<<<<<<<<<
66061  *         return context
66062  * 
66063  */
66064   __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__TargetParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->_setTarget(__pyx_v_context, __pyx_v_target); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
66065
66066   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":771
66067  *         context = _TargetParserContext()
66068  *         context._setTarget(target)
66069  *         return context             # <<<<<<<<<<<<<<
66070  * 
66071  *     cdef xmlparser.xmlParserCtxt* _newParserCtxt(self):
66072  */
66073   __Pyx_XDECREF(((PyObject *)__pyx_r));
66074   __Pyx_INCREF(((PyObject *)__pyx_v_context));
66075   __pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_v_context);
66076   goto __pyx_L0;
66077
66078   __pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); __Pyx_INCREF(Py_None);
66079   goto __pyx_L0;
66080   __pyx_L1_error:;
66081   __Pyx_XDECREF(__pyx_t_2);
66082   __Pyx_AddTraceback("lxml.etree._BaseParser._createContext");
66083   __pyx_r = 0;
66084   __pyx_L0:;
66085   __Pyx_DECREF((PyObject *)__pyx_v_context);
66086   __Pyx_XGIVEREF((PyObject *)__pyx_r);
66087   __Pyx_FinishRefcountContext();
66088   return __pyx_r;
66089 }
66090
66091 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":773
66092  *         return context
66093  * 
66094  *     cdef xmlparser.xmlParserCtxt* _newParserCtxt(self):             # <<<<<<<<<<<<<<
66095  *         if self._for_html:
66096  *             return htmlparser.htmlCreateMemoryParserCtxt('dummy', 5)
66097  */
66098
66099 static  xmlParserCtxt *__pyx_f_4lxml_5etree_11_BaseParser__newParserCtxt(struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_self) {
66100   xmlParserCtxt *__pyx_r;
66101   int __pyx_t_1;
66102   __Pyx_SetupRefcountContext("_newParserCtxt");
66103
66104   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":774
66105  * 
66106  *     cdef xmlparser.xmlParserCtxt* _newParserCtxt(self):
66107  *         if self._for_html:             # <<<<<<<<<<<<<<
66108  *             return htmlparser.htmlCreateMemoryParserCtxt('dummy', 5)
66109  *         else:
66110  */
66111   __pyx_t_1 = __pyx_v_self->_for_html;
66112   if (__pyx_t_1) {
66113
66114     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":775
66115  *     cdef xmlparser.xmlParserCtxt* _newParserCtxt(self):
66116  *         if self._for_html:
66117  *             return htmlparser.htmlCreateMemoryParserCtxt('dummy', 5)             # <<<<<<<<<<<<<<
66118  *         else:
66119  *             return xmlparser.xmlNewParserCtxt()
66120  */
66121     __pyx_r = htmlCreateMemoryParserCtxt(__pyx_k_448, 5);
66122     goto __pyx_L0;
66123     goto __pyx_L3;
66124   }
66125   /*else*/ {
66126
66127     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":777
66128  *             return htmlparser.htmlCreateMemoryParserCtxt('dummy', 5)
66129  *         else:
66130  *             return xmlparser.xmlNewParserCtxt()             # <<<<<<<<<<<<<<
66131  * 
66132  *     cdef xmlparser.xmlParserCtxt* _newPushParserCtxt(self):
66133  */
66134     __pyx_r = xmlNewParserCtxt();
66135     goto __pyx_L0;
66136   }
66137   __pyx_L3:;
66138
66139   __pyx_r = 0;
66140   __pyx_L0:;
66141   __Pyx_FinishRefcountContext();
66142   return __pyx_r;
66143 }
66144
66145 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":779
66146  *             return xmlparser.xmlNewParserCtxt()
66147  * 
66148  *     cdef xmlparser.xmlParserCtxt* _newPushParserCtxt(self):             # <<<<<<<<<<<<<<
66149  *         cdef xmlparser.xmlParserCtxt* c_ctxt
66150  *         cdef char* c_filename
66151  */
66152
66153 static  xmlParserCtxt *__pyx_f_4lxml_5etree_11_BaseParser__newPushParserCtxt(struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_self) {
66154   xmlParserCtxt *__pyx_v_c_ctxt;
66155   char *__pyx_v_c_filename;
66156   xmlParserCtxt *__pyx_r;
66157   int __pyx_t_1;
66158   __Pyx_SetupRefcountContext("_newPushParserCtxt");
66159
66160   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":782
66161  *         cdef xmlparser.xmlParserCtxt* c_ctxt
66162  *         cdef char* c_filename
66163  *         if self._filename is not None:             # <<<<<<<<<<<<<<
66164  *             c_filename = _cstr(self._filename)
66165  *         else:
66166  */
66167   __pyx_t_1 = (__pyx_v_self->_filename != Py_None);
66168   if (__pyx_t_1) {
66169
66170     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":783
66171  *         cdef char* c_filename
66172  *         if self._filename is not None:
66173  *             c_filename = _cstr(self._filename)             # <<<<<<<<<<<<<<
66174  *         else:
66175  *             c_filename = NULL
66176  */
66177     __pyx_v_c_filename = PyString_AS_STRING(__pyx_v_self->_filename);
66178     goto __pyx_L3;
66179   }
66180   /*else*/ {
66181
66182     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":785
66183  *             c_filename = _cstr(self._filename)
66184  *         else:
66185  *             c_filename = NULL             # <<<<<<<<<<<<<<
66186  *         if self._for_html:
66187  *             c_ctxt = htmlparser.htmlCreatePushParserCtxt(
66188  */
66189     __pyx_v_c_filename = NULL;
66190   }
66191   __pyx_L3:;
66192
66193   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":786
66194  *         else:
66195  *             c_filename = NULL
66196  *         if self._for_html:             # <<<<<<<<<<<<<<
66197  *             c_ctxt = htmlparser.htmlCreatePushParserCtxt(
66198  *                 NULL, NULL, NULL, 0, c_filename, tree.XML_CHAR_ENCODING_NONE)
66199  */
66200   __pyx_t_1 = __pyx_v_self->_for_html;
66201   if (__pyx_t_1) {
66202
66203     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":788
66204  *         if self._for_html:
66205  *             c_ctxt = htmlparser.htmlCreatePushParserCtxt(
66206  *                 NULL, NULL, NULL, 0, c_filename, tree.XML_CHAR_ENCODING_NONE)             # <<<<<<<<<<<<<<
66207  *             if c_ctxt is not NULL:
66208  *                 htmlparser.htmlCtxtUseOptions(c_ctxt, self._parse_options)
66209  */
66210     __pyx_v_c_ctxt = htmlCreatePushParserCtxt(NULL, NULL, NULL, 0, __pyx_v_c_filename, XML_CHAR_ENCODING_NONE);
66211
66212     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":789
66213  *             c_ctxt = htmlparser.htmlCreatePushParserCtxt(
66214  *                 NULL, NULL, NULL, 0, c_filename, tree.XML_CHAR_ENCODING_NONE)
66215  *             if c_ctxt is not NULL:             # <<<<<<<<<<<<<<
66216  *                 htmlparser.htmlCtxtUseOptions(c_ctxt, self._parse_options)
66217  *         else:
66218  */
66219     __pyx_t_1 = (__pyx_v_c_ctxt != NULL);
66220     if (__pyx_t_1) {
66221
66222       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":790
66223  *                 NULL, NULL, NULL, 0, c_filename, tree.XML_CHAR_ENCODING_NONE)
66224  *             if c_ctxt is not NULL:
66225  *                 htmlparser.htmlCtxtUseOptions(c_ctxt, self._parse_options)             # <<<<<<<<<<<<<<
66226  *         else:
66227  *             c_ctxt = xmlparser.xmlCreatePushParserCtxt(
66228  */
66229       htmlCtxtUseOptions(__pyx_v_c_ctxt, __pyx_v_self->_parse_options);
66230       goto __pyx_L5;
66231     }
66232     __pyx_L5:;
66233     goto __pyx_L4;
66234   }
66235   /*else*/ {
66236
66237     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":793
66238  *         else:
66239  *             c_ctxt = xmlparser.xmlCreatePushParserCtxt(
66240  *                 NULL, NULL, NULL, 0, c_filename)             # <<<<<<<<<<<<<<
66241  *             if c_ctxt is not NULL:
66242  *                 xmlparser.xmlCtxtUseOptions(c_ctxt, self._parse_options)
66243  */
66244     __pyx_v_c_ctxt = xmlCreatePushParserCtxt(NULL, NULL, NULL, 0, __pyx_v_c_filename);
66245
66246     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":794
66247  *             c_ctxt = xmlparser.xmlCreatePushParserCtxt(
66248  *                 NULL, NULL, NULL, 0, c_filename)
66249  *             if c_ctxt is not NULL:             # <<<<<<<<<<<<<<
66250  *                 xmlparser.xmlCtxtUseOptions(c_ctxt, self._parse_options)
66251  *         return c_ctxt
66252  */
66253     __pyx_t_1 = (__pyx_v_c_ctxt != NULL);
66254     if (__pyx_t_1) {
66255
66256       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":795
66257  *                 NULL, NULL, NULL, 0, c_filename)
66258  *             if c_ctxt is not NULL:
66259  *                 xmlparser.xmlCtxtUseOptions(c_ctxt, self._parse_options)             # <<<<<<<<<<<<<<
66260  *         return c_ctxt
66261  * 
66262  */
66263       xmlCtxtUseOptions(__pyx_v_c_ctxt, __pyx_v_self->_parse_options);
66264       goto __pyx_L6;
66265     }
66266     __pyx_L6:;
66267   }
66268   __pyx_L4:;
66269
66270   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":796
66271  *             if c_ctxt is not NULL:
66272  *                 xmlparser.xmlCtxtUseOptions(c_ctxt, self._parse_options)
66273  *         return c_ctxt             # <<<<<<<<<<<<<<
66274  * 
66275  *     property error_log:
66276  */
66277   __pyx_r = __pyx_v_c_ctxt;
66278   goto __pyx_L0;
66279
66280   __pyx_r = 0;
66281   __pyx_L0:;
66282   __Pyx_FinishRefcountContext();
66283   return __pyx_r;
66284 }
66285
66286 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":801
66287  *         u"""The error log of the last parser run.
66288  *         """
66289  *         def __get__(self):             # <<<<<<<<<<<<<<
66290  *             cdef _ParserContext context
66291  *             context = self._getParserContext()
66292  */
66293
66294 static PyObject *__pyx_pf_4lxml_5etree_11_BaseParser_9error_log___get__(PyObject *__pyx_v_self); /*proto*/
66295 static PyObject *__pyx_pf_4lxml_5etree_11_BaseParser_9error_log___get__(PyObject *__pyx_v_self) {
66296   struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_context;
66297   PyObject *__pyx_r = NULL;
66298   PyObject *__pyx_t_1 = NULL;
66299   PyObject *__pyx_t_2 = NULL;
66300   __Pyx_SetupRefcountContext("__get__");
66301   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); __Pyx_INCREF(Py_None);
66302
66303   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":803
66304  *         def __get__(self):
66305  *             cdef _ParserContext context
66306  *             context = self._getParserContext()             # <<<<<<<<<<<<<<
66307  *             return context._error_log.copy()
66308  * 
66309  */
66310   __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->__pyx_vtab)->_getParserContext(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
66311   __Pyx_GOTREF(__pyx_t_1);
66312   __Pyx_DECREF(((PyObject *)__pyx_v_context));
66313   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_t_1);
66314   __pyx_t_1 = 0;
66315
66316   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":804
66317  *             cdef _ParserContext context
66318  *             context = self._getParserContext()
66319  *             return context._error_log.copy()             # <<<<<<<<<<<<<<
66320  * 
66321  *     property resolvers:
66322  */
66323   __Pyx_XDECREF(__pyx_r);
66324   __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_context->_error_log), __pyx_kp_copy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
66325   __Pyx_GOTREF(__pyx_t_1);
66326   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
66327   __Pyx_GOTREF(__pyx_t_2);
66328   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66329   __pyx_r = __pyx_t_2;
66330   __pyx_t_2 = 0;
66331   goto __pyx_L0;
66332
66333   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
66334   goto __pyx_L0;
66335   __pyx_L1_error:;
66336   __Pyx_XDECREF(__pyx_t_1);
66337   __Pyx_XDECREF(__pyx_t_2);
66338   __Pyx_AddTraceback("lxml.etree._BaseParser.error_log.__get__");
66339   __pyx_r = NULL;
66340   __pyx_L0:;
66341   __Pyx_DECREF((PyObject *)__pyx_v_context);
66342   __Pyx_XGIVEREF(__pyx_r);
66343   __Pyx_FinishRefcountContext();
66344   return __pyx_r;
66345 }
66346
66347 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":808
66348  *     property resolvers:
66349  *         u"The custom resolver registry of this parser."
66350  *         def __get__(self):             # <<<<<<<<<<<<<<
66351  *             return self._resolvers
66352  * 
66353  */
66354
66355 static PyObject *__pyx_pf_4lxml_5etree_11_BaseParser_9resolvers___get__(PyObject *__pyx_v_self); /*proto*/
66356 static PyObject *__pyx_pf_4lxml_5etree_11_BaseParser_9resolvers___get__(PyObject *__pyx_v_self) {
66357   PyObject *__pyx_r = NULL;
66358   __Pyx_SetupRefcountContext("__get__");
66359
66360   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":809
66361  *         u"The custom resolver registry of this parser."
66362  *         def __get__(self):
66363  *             return self._resolvers             # <<<<<<<<<<<<<<
66364  * 
66365  *     property version:
66366  */
66367   __Pyx_XDECREF(__pyx_r);
66368   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_resolvers));
66369   __pyx_r = ((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_resolvers);
66370   goto __pyx_L0;
66371
66372   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
66373   __pyx_L0:;
66374   __Pyx_XGIVEREF(__pyx_r);
66375   __Pyx_FinishRefcountContext();
66376   return __pyx_r;
66377 }
66378
66379 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":813
66380  *     property version:
66381  *         u"The version of the underlying XML parser."
66382  *         def __get__(self):             # <<<<<<<<<<<<<<
66383  *             return u"libxml2 %d.%d.%d" % LIBXML_VERSION
66384  * 
66385  */
66386
66387 static PyObject *__pyx_pf_4lxml_5etree_11_BaseParser_7version___get__(PyObject *__pyx_v_self); /*proto*/
66388 static PyObject *__pyx_pf_4lxml_5etree_11_BaseParser_7version___get__(PyObject *__pyx_v_self) {
66389   PyObject *__pyx_r = NULL;
66390   PyObject *__pyx_1 = 0;
66391   PyObject *__pyx_t_1 = NULL;
66392   __Pyx_SetupRefcountContext("__get__");
66393
66394   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":814
66395  *         u"The version of the underlying XML parser."
66396  *         def __get__(self):
66397  *             return u"libxml2 %d.%d.%d" % LIBXML_VERSION             # <<<<<<<<<<<<<<
66398  * 
66399  *     def setElementClassLookup(self, ElementClassLookup lookup = None):
66400  */
66401   __Pyx_XDECREF(__pyx_r);
66402   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_LIBXML_VERSION); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
66403   __Pyx_GOTREF(__pyx_1);
66404   __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_449), __pyx_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
66405   __Pyx_GOTREF(__pyx_t_1);
66406   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
66407   __pyx_r = __pyx_t_1;
66408   __pyx_t_1 = 0;
66409   goto __pyx_L0;
66410
66411   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
66412   goto __pyx_L0;
66413   __pyx_L1_error:;
66414   __Pyx_XDECREF(__pyx_1);
66415   __Pyx_XDECREF(__pyx_t_1);
66416   __Pyx_AddTraceback("lxml.etree._BaseParser.version.__get__");
66417   __pyx_r = NULL;
66418   __pyx_L0:;
66419   __Pyx_XGIVEREF(__pyx_r);
66420   __Pyx_FinishRefcountContext();
66421   return __pyx_r;
66422 }
66423
66424 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":816
66425  *             return u"libxml2 %d.%d.%d" % LIBXML_VERSION
66426  * 
66427  *     def setElementClassLookup(self, ElementClassLookup lookup = None):             # <<<<<<<<<<<<<<
66428  *         u":deprecated: use ``parser.set_element_class_lookup(lookup)`` instead."
66429  *         self.set_element_class_lookup(lookup)
66430  */
66431
66432 static PyObject *__pyx_pf_4lxml_5etree_11_BaseParser_setElementClassLookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
66433 static char __pyx_doc_4lxml_5etree_11_BaseParser_setElementClassLookup[] = ":deprecated: use ``parser.set_element_class_lookup(lookup)`` instead.";
66434 static PyObject *__pyx_pf_4lxml_5etree_11_BaseParser_setElementClassLookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
66435   struct LxmlElementClassLookup *__pyx_v_lookup = 0;
66436   PyObject *__pyx_r = NULL;
66437   PyObject *__pyx_t_1 = NULL;
66438   PyObject *__pyx_t_2 = NULL;
66439   PyObject *__pyx_t_3 = NULL;
66440   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_lookup,0};
66441   __Pyx_SetupRefcountContext("setElementClassLookup");
66442   if (unlikely(__pyx_kwds)) {
66443     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
66444     PyObject* values[1] = {0};
66445     values[0] = (PyObject*)((struct LxmlElementClassLookup *)Py_None);
66446     switch (PyTuple_GET_SIZE(__pyx_args)) {
66447       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
66448       case  0: break;
66449       default: goto __pyx_L5_argtuple_error;
66450     }
66451     switch (PyTuple_GET_SIZE(__pyx_args)) {
66452       case  0:
66453       if (kw_args > 1) {
66454         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_lookup);
66455         if (unlikely(value)) { values[0] = value; kw_args--; }
66456       }
66457     }
66458     if (unlikely(kw_args > 0)) {
66459       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "setElementClassLookup") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
66460     }
66461     __pyx_v_lookup = ((struct LxmlElementClassLookup *)values[0]);
66462   } else {
66463     __pyx_v_lookup = ((struct LxmlElementClassLookup *)Py_None);
66464     switch (PyTuple_GET_SIZE(__pyx_args)) {
66465       case  1: __pyx_v_lookup = ((struct LxmlElementClassLookup *)PyTuple_GET_ITEM(__pyx_args, 0));
66466       case  0: break;
66467       default: goto __pyx_L5_argtuple_error;
66468     }
66469   }
66470   goto __pyx_L4_argument_unpacking_done;
66471   __pyx_L5_argtuple_error:;
66472   __Pyx_RaiseArgtupleInvalid("setElementClassLookup", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
66473   __pyx_L3_error:;
66474   __Pyx_AddTraceback("lxml.etree._BaseParser.setElementClassLookup");
66475   return NULL;
66476   __pyx_L4_argument_unpacking_done:;
66477   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lookup), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "lookup", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
66478
66479   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":818
66480  *     def setElementClassLookup(self, ElementClassLookup lookup = None):
66481  *         u":deprecated: use ``parser.set_element_class_lookup(lookup)`` instead."
66482  *         self.set_element_class_lookup(lookup)             # <<<<<<<<<<<<<<
66483  * 
66484  *     def set_element_class_lookup(self, ElementClassLookup lookup = None):
66485  */
66486   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_29); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
66487   __Pyx_GOTREF(__pyx_t_1);
66488   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
66489   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
66490   __Pyx_INCREF(((PyObject *)__pyx_v_lookup));
66491   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_lookup));
66492   __Pyx_GIVEREF(((PyObject *)__pyx_v_lookup));
66493   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
66494   __Pyx_GOTREF(__pyx_t_3);
66495   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66496   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
66497   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
66498
66499   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
66500   goto __pyx_L0;
66501   __pyx_L1_error:;
66502   __Pyx_XDECREF(__pyx_t_1);
66503   __Pyx_XDECREF(__pyx_t_2);
66504   __Pyx_XDECREF(__pyx_t_3);
66505   __Pyx_AddTraceback("lxml.etree._BaseParser.setElementClassLookup");
66506   __pyx_r = NULL;
66507   __pyx_L0:;
66508   __Pyx_XGIVEREF(__pyx_r);
66509   __Pyx_FinishRefcountContext();
66510   return __pyx_r;
66511 }
66512
66513 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":820
66514  *         self.set_element_class_lookup(lookup)
66515  * 
66516  *     def set_element_class_lookup(self, ElementClassLookup lookup = None):             # <<<<<<<<<<<<<<
66517  *         u"""set_element_class_lookup(self, lookup = None)
66518  * 
66519  */
66520
66521 static PyObject *__pyx_pf_4lxml_5etree_11_BaseParser_set_element_class_lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
66522 static char __pyx_doc_4lxml_5etree_11_BaseParser_set_element_class_lookup[] = "set_element_class_lookup(self, lookup = None)\n\n        Set a lookup scheme for element classes generated from this parser.\n\n        Reset it by passing None or nothing.\n        ";
66523 static PyObject *__pyx_pf_4lxml_5etree_11_BaseParser_set_element_class_lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
66524   struct LxmlElementClassLookup *__pyx_v_lookup = 0;
66525   PyObject *__pyx_r = NULL;
66526   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_lookup,0};
66527   __Pyx_SetupRefcountContext("set_element_class_lookup");
66528   if (unlikely(__pyx_kwds)) {
66529     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
66530     PyObject* values[1] = {0};
66531     values[0] = (PyObject*)((struct LxmlElementClassLookup *)Py_None);
66532     switch (PyTuple_GET_SIZE(__pyx_args)) {
66533       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
66534       case  0: break;
66535       default: goto __pyx_L5_argtuple_error;
66536     }
66537     switch (PyTuple_GET_SIZE(__pyx_args)) {
66538       case  0:
66539       if (kw_args > 1) {
66540         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_lookup);
66541         if (unlikely(value)) { values[0] = value; kw_args--; }
66542       }
66543     }
66544     if (unlikely(kw_args > 0)) {
66545       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "set_element_class_lookup") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
66546     }
66547     __pyx_v_lookup = ((struct LxmlElementClassLookup *)values[0]);
66548   } else {
66549     __pyx_v_lookup = ((struct LxmlElementClassLookup *)Py_None);
66550     switch (PyTuple_GET_SIZE(__pyx_args)) {
66551       case  1: __pyx_v_lookup = ((struct LxmlElementClassLookup *)PyTuple_GET_ITEM(__pyx_args, 0));
66552       case  0: break;
66553       default: goto __pyx_L5_argtuple_error;
66554     }
66555   }
66556   goto __pyx_L4_argument_unpacking_done;
66557   __pyx_L5_argtuple_error:;
66558   __Pyx_RaiseArgtupleInvalid("set_element_class_lookup", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
66559   __pyx_L3_error:;
66560   __Pyx_AddTraceback("lxml.etree._BaseParser.set_element_class_lookup");
66561   return NULL;
66562   __pyx_L4_argument_unpacking_done:;
66563   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lookup), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "lookup", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
66564
66565   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":827
66566  *         Reset it by passing None or nothing.
66567  *         """
66568  *         self._class_lookup = lookup             # <<<<<<<<<<<<<<
66569  * 
66570  *     cdef _BaseParser _copy(self):
66571  */
66572   __Pyx_INCREF(((PyObject *)__pyx_v_lookup));
66573   __Pyx_GIVEREF(((PyObject *)__pyx_v_lookup));
66574   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_class_lookup);
66575   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_class_lookup));
66576   ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_class_lookup = __pyx_v_lookup;
66577
66578   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
66579   goto __pyx_L0;
66580   __pyx_L1_error:;
66581   __Pyx_AddTraceback("lxml.etree._BaseParser.set_element_class_lookup");
66582   __pyx_r = NULL;
66583   __pyx_L0:;
66584   __Pyx_XGIVEREF(__pyx_r);
66585   __Pyx_FinishRefcountContext();
66586   return __pyx_r;
66587 }
66588
66589 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":829
66590  *         self._class_lookup = lookup
66591  * 
66592  *     cdef _BaseParser _copy(self):             # <<<<<<<<<<<<<<
66593  *         u"Create a new parser with the same configuration."
66594  *         cdef _BaseParser parser
66595  */
66596
66597 static  struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_f_4lxml_5etree_11_BaseParser__copy(struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_self) {
66598   struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser;
66599   struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_r = NULL;
66600   PyObject *__pyx_t_1 = NULL;
66601   PyObject *__pyx_t_2 = NULL;
66602   __Pyx_SetupRefcountContext("_copy");
66603   __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None); __Pyx_INCREF(Py_None);
66604
66605   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":832
66606  *         u"Create a new parser with the same configuration."
66607  *         cdef _BaseParser parser
66608  *         parser = self.__class__()             # <<<<<<<<<<<<<<
66609  *         parser._parse_options = self._parse_options
66610  *         parser._for_html = self._for_html
66611  */
66612   __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_kp___class__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
66613   __Pyx_GOTREF(__pyx_t_1);
66614   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
66615   __Pyx_GOTREF(__pyx_t_2);
66616   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
66617   if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__BaseParser))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
66618   __Pyx_DECREF(((PyObject *)__pyx_v_parser));
66619   __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_2);
66620   __pyx_t_2 = 0;
66621
66622   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":833
66623  *         cdef _BaseParser parser
66624  *         parser = self.__class__()
66625  *         parser._parse_options = self._parse_options             # <<<<<<<<<<<<<<
66626  *         parser._for_html = self._for_html
66627  *         parser._remove_comments = self._remove_comments
66628  */
66629   __pyx_v_parser->_parse_options = __pyx_v_self->_parse_options;
66630
66631   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":834
66632  *         parser = self.__class__()
66633  *         parser._parse_options = self._parse_options
66634  *         parser._for_html = self._for_html             # <<<<<<<<<<<<<<
66635  *         parser._remove_comments = self._remove_comments
66636  *         parser._remove_pis = self._remove_pis
66637  */
66638   __pyx_v_parser->_for_html = __pyx_v_self->_for_html;
66639
66640   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":835
66641  *         parser._parse_options = self._parse_options
66642  *         parser._for_html = self._for_html
66643  *         parser._remove_comments = self._remove_comments             # <<<<<<<<<<<<<<
66644  *         parser._remove_pis = self._remove_pis
66645  *         parser._strip_cdata = self._strip_cdata
66646  */
66647   __pyx_v_parser->_remove_comments = __pyx_v_self->_remove_comments;
66648
66649   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":836
66650  *         parser._for_html = self._for_html
66651  *         parser._remove_comments = self._remove_comments
66652  *         parser._remove_pis = self._remove_pis             # <<<<<<<<<<<<<<
66653  *         parser._strip_cdata = self._strip_cdata
66654  *         parser._filename = self._filename
66655  */
66656   __pyx_v_parser->_remove_pis = __pyx_v_self->_remove_pis;
66657
66658   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":837
66659  *         parser._remove_comments = self._remove_comments
66660  *         parser._remove_pis = self._remove_pis
66661  *         parser._strip_cdata = self._strip_cdata             # <<<<<<<<<<<<<<
66662  *         parser._filename = self._filename
66663  *         parser._resolvers = self._resolvers
66664  */
66665   __pyx_v_parser->_strip_cdata = __pyx_v_self->_strip_cdata;
66666
66667   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":838
66668  *         parser._remove_pis = self._remove_pis
66669  *         parser._strip_cdata = self._strip_cdata
66670  *         parser._filename = self._filename             # <<<<<<<<<<<<<<
66671  *         parser._resolvers = self._resolvers
66672  *         parser._target = self._target
66673  */
66674   __Pyx_INCREF(__pyx_v_self->_filename);
66675   __Pyx_GIVEREF(__pyx_v_self->_filename);
66676   __Pyx_GOTREF(__pyx_v_parser->_filename);
66677   __Pyx_DECREF(__pyx_v_parser->_filename);
66678   __pyx_v_parser->_filename = __pyx_v_self->_filename;
66679
66680   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":839
66681  *         parser._strip_cdata = self._strip_cdata
66682  *         parser._filename = self._filename
66683  *         parser._resolvers = self._resolvers             # <<<<<<<<<<<<<<
66684  *         parser._target = self._target
66685  *         parser._class_lookup  = self._class_lookup
66686  */
66687   __Pyx_INCREF(((PyObject *)__pyx_v_self->_resolvers));
66688   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_resolvers));
66689   __Pyx_GOTREF(__pyx_v_parser->_resolvers);
66690   __Pyx_DECREF(((PyObject *)__pyx_v_parser->_resolvers));
66691   __pyx_v_parser->_resolvers = __pyx_v_self->_resolvers;
66692
66693   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":840
66694  *         parser._filename = self._filename
66695  *         parser._resolvers = self._resolvers
66696  *         parser._target = self._target             # <<<<<<<<<<<<<<
66697  *         parser._class_lookup  = self._class_lookup
66698  *         return parser
66699  */
66700   __Pyx_INCREF(__pyx_v_self->_target);
66701   __Pyx_GIVEREF(__pyx_v_self->_target);
66702   __Pyx_GOTREF(__pyx_v_parser->_target);
66703   __Pyx_DECREF(__pyx_v_parser->_target);
66704   __pyx_v_parser->_target = __pyx_v_self->_target;
66705
66706   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":841
66707  *         parser._resolvers = self._resolvers
66708  *         parser._target = self._target
66709  *         parser._class_lookup  = self._class_lookup             # <<<<<<<<<<<<<<
66710  *         return parser
66711  * 
66712  */
66713   __Pyx_INCREF(((PyObject *)__pyx_v_self->_class_lookup));
66714   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_class_lookup));
66715   __Pyx_GOTREF(__pyx_v_parser->_class_lookup);
66716   __Pyx_DECREF(((PyObject *)__pyx_v_parser->_class_lookup));
66717   __pyx_v_parser->_class_lookup = __pyx_v_self->_class_lookup;
66718
66719   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":842
66720  *         parser._target = self._target
66721  *         parser._class_lookup  = self._class_lookup
66722  *         return parser             # <<<<<<<<<<<<<<
66723  * 
66724  *     def copy(self):
66725  */
66726   __Pyx_XDECREF(((PyObject *)__pyx_r));
66727   __Pyx_INCREF(((PyObject *)__pyx_v_parser));
66728   __pyx_r = __pyx_v_parser;
66729   goto __pyx_L0;
66730
66731   __pyx_r = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None); __Pyx_INCREF(Py_None);
66732   goto __pyx_L0;
66733   __pyx_L1_error:;
66734   __Pyx_XDECREF(__pyx_t_1);
66735   __Pyx_XDECREF(__pyx_t_2);
66736   __Pyx_AddTraceback("lxml.etree._BaseParser._copy");
66737   __pyx_r = 0;
66738   __pyx_L0:;
66739   __Pyx_DECREF((PyObject *)__pyx_v_parser);
66740   __Pyx_XGIVEREF((PyObject *)__pyx_r);
66741   __Pyx_FinishRefcountContext();
66742   return __pyx_r;
66743 }
66744
66745 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":844
66746  *         return parser
66747  * 
66748  *     def copy(self):             # <<<<<<<<<<<<<<
66749  *         u"""copy(self)
66750  * 
66751  */
66752
66753 static PyObject *__pyx_pf_4lxml_5etree_11_BaseParser_copy(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
66754 static char __pyx_doc_4lxml_5etree_11_BaseParser_copy[] = "copy(self)\n\n        Create a new parser with the same configuration.\n        ";
66755 static PyObject *__pyx_pf_4lxml_5etree_11_BaseParser_copy(PyObject *__pyx_v_self, PyObject *unused) {
66756   PyObject *__pyx_r = NULL;
66757   PyObject *__pyx_t_1 = NULL;
66758   __Pyx_SetupRefcountContext("copy");
66759
66760   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":849
66761  *         Create a new parser with the same configuration.
66762  *         """
66763  *         return self._copy()             # <<<<<<<<<<<<<<
66764  * 
66765  *     def makeelement(self, _tag, attrib=None, nsmap=None, **_extra):
66766  */
66767   __Pyx_XDECREF(__pyx_r);
66768   __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->__pyx_vtab)->_copy(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
66769   __Pyx_GOTREF(__pyx_t_1);
66770   __pyx_r = __pyx_t_1;
66771   __pyx_t_1 = 0;
66772   goto __pyx_L0;
66773
66774   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
66775   goto __pyx_L0;
66776   __pyx_L1_error:;
66777   __Pyx_XDECREF(__pyx_t_1);
66778   __Pyx_AddTraceback("lxml.etree._BaseParser.copy");
66779   __pyx_r = NULL;
66780   __pyx_L0:;
66781   __Pyx_XGIVEREF(__pyx_r);
66782   __Pyx_FinishRefcountContext();
66783   return __pyx_r;
66784 }
66785
66786 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":851
66787  *         return self._copy()
66788  * 
66789  *     def makeelement(self, _tag, attrib=None, nsmap=None, **_extra):             # <<<<<<<<<<<<<<
66790  *         u"""makeelement(self, _tag, attrib=None, nsmap=None, **_extra)
66791  * 
66792  */
66793
66794 static PyObject *__pyx_pf_4lxml_5etree_11_BaseParser_makeelement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
66795 static char __pyx_doc_4lxml_5etree_11_BaseParser_makeelement[] = "makeelement(self, _tag, attrib=None, nsmap=None, **_extra)\n\n        Creates a new element associated with this parser.\n        ";
66796 static PyObject *__pyx_pf_4lxml_5etree_11_BaseParser_makeelement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
66797   PyObject *__pyx_v__tag = 0;
66798   PyObject *__pyx_v_attrib = 0;
66799   PyObject *__pyx_v_nsmap = 0;
66800   PyObject *__pyx_v__extra = 0;
66801   PyObject *__pyx_r = NULL;
66802   PyObject *__pyx_t_1 = NULL;
66803   static PyObject **__pyx_pyargnames[] = {&__pyx_kp__tag,&__pyx_kp_attrib,&__pyx_kp_nsmap,0};
66804   __Pyx_SetupRefcountContext("makeelement");
66805   __pyx_v__extra = PyDict_New(); if (unlikely(!__pyx_v__extra)) return NULL;
66806   __Pyx_GOTREF(__pyx_v__extra);
66807   if (unlikely(__pyx_kwds)) {
66808     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
66809     PyObject* values[3] = {0,0,0};
66810     values[1] = Py_None;
66811     values[2] = Py_None;
66812     switch (PyTuple_GET_SIZE(__pyx_args)) {
66813       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
66814       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
66815       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
66816       case  0: break;
66817       default: goto __pyx_L5_argtuple_error;
66818     }
66819     switch (PyTuple_GET_SIZE(__pyx_args)) {
66820       case  0:
66821       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp__tag);
66822       if (likely(values[0])) kw_args--;
66823       else goto __pyx_L5_argtuple_error;
66824       case  1:
66825       if (kw_args > 1) {
66826         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_attrib);
66827         if (unlikely(value)) { values[1] = value; kw_args--; }
66828       }
66829       case  2:
66830       if (kw_args > 1) {
66831         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_nsmap);
66832         if (unlikely(value)) { values[2] = value; kw_args--; }
66833       }
66834     }
66835     if (unlikely(kw_args > 0)) {
66836       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__extra, values, PyTuple_GET_SIZE(__pyx_args), "makeelement") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
66837     }
66838     __pyx_v__tag = values[0];
66839     __pyx_v_attrib = values[1];
66840     __pyx_v_nsmap = values[2];
66841   } else {
66842     __pyx_v_attrib = Py_None;
66843     __pyx_v_nsmap = Py_None;
66844     switch (PyTuple_GET_SIZE(__pyx_args)) {
66845       case  3: __pyx_v_nsmap = PyTuple_GET_ITEM(__pyx_args, 2);
66846       case  2: __pyx_v_attrib = PyTuple_GET_ITEM(__pyx_args, 1);
66847       case  1: __pyx_v__tag = PyTuple_GET_ITEM(__pyx_args, 0);
66848       break;
66849       default: goto __pyx_L5_argtuple_error;
66850     }
66851   }
66852   goto __pyx_L4_argument_unpacking_done;
66853   __pyx_L5_argtuple_error:;
66854   __Pyx_RaiseArgtupleInvalid("makeelement", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
66855   __pyx_L3_error:;
66856   __Pyx_DECREF(__pyx_v__extra);
66857   __Pyx_AddTraceback("lxml.etree._BaseParser.makeelement");
66858   return NULL;
66859   __pyx_L4_argument_unpacking_done:;
66860
66861   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":856
66862  *         Creates a new element associated with this parser.
66863  *         """
66864  *         return _makeElement(_tag, NULL, None, self, None, None,             # <<<<<<<<<<<<<<
66865  *                             attrib, nsmap, _extra)
66866  * 
66867  */
66868   __Pyx_XDECREF(__pyx_r);
66869
66870   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":857
66871  *         """
66872  *         return _makeElement(_tag, NULL, None, self, None, None,
66873  *                             attrib, nsmap, _extra)             # <<<<<<<<<<<<<<
66874  * 
66875  *     # internal parser methods
66876  */
66877   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__makeElement(__pyx_v__tag, NULL, ((struct LxmlDocument *)Py_None), ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self), Py_None, Py_None, __pyx_v_attrib, __pyx_v_nsmap, __pyx_v__extra)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
66878   __Pyx_GOTREF(__pyx_t_1);
66879   __pyx_r = __pyx_t_1;
66880   __pyx_t_1 = 0;
66881   goto __pyx_L0;
66882
66883   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
66884   goto __pyx_L0;
66885   __pyx_L1_error:;
66886   __Pyx_XDECREF(__pyx_t_1);
66887   __Pyx_AddTraceback("lxml.etree._BaseParser.makeelement");
66888   __pyx_r = NULL;
66889   __pyx_L0:;
66890   __Pyx_DECREF(__pyx_v__extra);
66891   __Pyx_XGIVEREF(__pyx_r);
66892   __Pyx_FinishRefcountContext();
66893   return __pyx_r;
66894 }
66895
66896 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":861
66897  *     # internal parser methods
66898  * 
66899  *     cdef xmlDoc* _parseUnicodeDoc(self, utext, char* c_filename) except NULL:             # <<<<<<<<<<<<<<
66900  *         u"""Parse unicode document, share dictionary if possible.
66901  *         """
66902  */
66903
66904 static  xmlDoc *__pyx_f_4lxml_5etree_11_BaseParser__parseUnicodeDoc(struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_self, PyObject *__pyx_v_utext, char *__pyx_v_c_filename) {
66905   struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_context;
66906   xmlDoc *__pyx_v_result;
66907   xmlParserCtxt *__pyx_v_pctxt;
66908   Py_ssize_t __pyx_v_py_buffer_len;
66909   int __pyx_v_buffer_len;
66910   char *__pyx_v_c_text;
66911   PyObject *__pyx_v_text_utf;
66912   xmlDoc *__pyx_r;
66913   int __pyx_t_1;
66914   PyObject *__pyx_t_2 = NULL;
66915   xmlDoc *__pyx_t_3;
66916   int __pyx_t_4;
66917   xmlDoc *__pyx_t_5;
66918   __Pyx_SetupRefcountContext("_parseUnicodeDoc");
66919   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); __Pyx_INCREF(Py_None);
66920   __pyx_v_text_utf = Py_None; __Pyx_INCREF(Py_None);
66921
66922   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":870
66923  *         cdef int buffer_len
66924  *         cdef char* c_text
66925  *         py_buffer_len = python.PyUnicode_GET_DATA_SIZE(utext)             # <<<<<<<<<<<<<<
66926  *         if py_buffer_len > python.INT_MAX or _UNICODE_ENCODING is NULL:
66927  *             text_utf = python.PyUnicode_AsUTF8String(utext)
66928  */
66929   __pyx_v_py_buffer_len = PyUnicode_GET_DATA_SIZE(__pyx_v_utext);
66930
66931   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":871
66932  *         cdef char* c_text
66933  *         py_buffer_len = python.PyUnicode_GET_DATA_SIZE(utext)
66934  *         if py_buffer_len > python.INT_MAX or _UNICODE_ENCODING is NULL:             # <<<<<<<<<<<<<<
66935  *             text_utf = python.PyUnicode_AsUTF8String(utext)
66936  *             py_buffer_len = python.PyString_GET_SIZE(text_utf)
66937  */
66938   if (!(__pyx_v_py_buffer_len > INT_MAX)) {
66939     __pyx_t_1 = (__pyx_v_4lxml_5etree__UNICODE_ENCODING == NULL);
66940   } else {
66941     __pyx_t_1 = (__pyx_v_py_buffer_len > INT_MAX);
66942   }
66943   if (__pyx_t_1) {
66944
66945     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":872
66946  *         py_buffer_len = python.PyUnicode_GET_DATA_SIZE(utext)
66947  *         if py_buffer_len > python.INT_MAX or _UNICODE_ENCODING is NULL:
66948  *             text_utf = python.PyUnicode_AsUTF8String(utext)             # <<<<<<<<<<<<<<
66949  *             py_buffer_len = python.PyString_GET_SIZE(text_utf)
66950  *             return self._parseDoc(_cstr(text_utf), py_buffer_len, c_filename)
66951  */
66952     __pyx_t_2 = PyUnicode_AsUTF8String(__pyx_v_utext); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
66953     __Pyx_GOTREF(__pyx_t_2);
66954     __Pyx_DECREF(__pyx_v_text_utf);
66955     __pyx_v_text_utf = __pyx_t_2;
66956     __pyx_t_2 = 0;
66957
66958     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":873
66959  *         if py_buffer_len > python.INT_MAX or _UNICODE_ENCODING is NULL:
66960  *             text_utf = python.PyUnicode_AsUTF8String(utext)
66961  *             py_buffer_len = python.PyString_GET_SIZE(text_utf)             # <<<<<<<<<<<<<<
66962  *             return self._parseDoc(_cstr(text_utf), py_buffer_len, c_filename)
66963  *         buffer_len = py_buffer_len
66964  */
66965     __pyx_v_py_buffer_len = PyString_GET_SIZE(__pyx_v_text_utf);
66966
66967     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":874
66968  *             text_utf = python.PyUnicode_AsUTF8String(utext)
66969  *             py_buffer_len = python.PyString_GET_SIZE(text_utf)
66970  *             return self._parseDoc(_cstr(text_utf), py_buffer_len, c_filename)             # <<<<<<<<<<<<<<
66971  *         buffer_len = py_buffer_len
66972  * 
66973  */
66974     __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_parseDoc(__pyx_v_self, PyString_AS_STRING(__pyx_v_text_utf), __pyx_v_py_buffer_len, __pyx_v_c_filename); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
66975     __pyx_r = __pyx_t_3;
66976     goto __pyx_L0;
66977     goto __pyx_L3;
66978   }
66979   __pyx_L3:;
66980
66981   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":875
66982  *             py_buffer_len = python.PyString_GET_SIZE(text_utf)
66983  *             return self._parseDoc(_cstr(text_utf), py_buffer_len, c_filename)
66984  *         buffer_len = py_buffer_len             # <<<<<<<<<<<<<<
66985  * 
66986  *         context = self._getParserContext()
66987  */
66988   __pyx_v_buffer_len = __pyx_v_py_buffer_len;
66989
66990   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":877
66991  *         buffer_len = py_buffer_len
66992  * 
66993  *         context = self._getParserContext()             # <<<<<<<<<<<<<<
66994  *         context.prepare()
66995  *         try:
66996  */
66997   __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_getParserContext(__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
66998   __Pyx_GOTREF(__pyx_t_2);
66999   __Pyx_DECREF(((PyObject *)__pyx_v_context));
67000   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_t_2);
67001   __pyx_t_2 = 0;
67002
67003   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":878
67004  * 
67005  *         context = self._getParserContext()
67006  *         context.prepare()             # <<<<<<<<<<<<<<
67007  *         try:
67008  *             pctxt = context._c_ctxt
67009  */
67010   __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->prepare(__pyx_v_context); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
67011
67012   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":879
67013  *         context = self._getParserContext()
67014  *         context.prepare()
67015  *         try:             # <<<<<<<<<<<<<<
67016  *             pctxt = context._c_ctxt
67017  *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
67018  */
67019   /*try:*/ {
67020
67021     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":880
67022  *         context.prepare()
67023  *         try:
67024  *             pctxt = context._c_ctxt             # <<<<<<<<<<<<<<
67025  *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
67026  * 
67027  */
67028     __pyx_v_pctxt = __pyx_v_context->_c_ctxt;
67029
67030     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":881
67031  *         try:
67032  *             pctxt = context._c_ctxt
67033  *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)             # <<<<<<<<<<<<<<
67034  * 
67035  *             c_text = python.PyUnicode_AS_DATA(utext)
67036  */
67037     ((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initParserDict(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT, __pyx_v_pctxt);
67038
67039     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":883
67040  *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
67041  * 
67042  *             c_text = python.PyUnicode_AS_DATA(utext)             # <<<<<<<<<<<<<<
67043  *             with nogil:
67044  *                 if self._for_html:
67045  */
67046     __pyx_v_c_text = PyUnicode_AS_DATA(__pyx_v_utext);
67047
67048     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":884
67049  * 
67050  *             c_text = python.PyUnicode_AS_DATA(utext)
67051  *             with nogil:             # <<<<<<<<<<<<<<
67052  *                 if self._for_html:
67053  *                     result = htmlparser.htmlCtxtReadMemory(
67054  */
67055     { PyThreadState *_save;
67056       Py_UNBLOCK_THREADS
67057       /*try:*/ {
67058
67059         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":885
67060  *             c_text = python.PyUnicode_AS_DATA(utext)
67061  *             with nogil:
67062  *                 if self._for_html:             # <<<<<<<<<<<<<<
67063  *                     result = htmlparser.htmlCtxtReadMemory(
67064  *                         pctxt, c_text, buffer_len, c_filename, _UNICODE_ENCODING,
67065  */
67066         __pyx_t_1 = __pyx_v_self->_for_html;
67067         if (__pyx_t_1) {
67068
67069           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":888
67070  *                     result = htmlparser.htmlCtxtReadMemory(
67071  *                         pctxt, c_text, buffer_len, c_filename, _UNICODE_ENCODING,
67072  *                         self._parse_options)             # <<<<<<<<<<<<<<
67073  *                     if result is not NULL:
67074  *                         if _fixHtmlDictNames(pctxt.dict, result) < 0:
67075  */
67076           __pyx_v_result = htmlCtxtReadMemory(__pyx_v_pctxt, __pyx_v_c_text, __pyx_v_buffer_len, __pyx_v_c_filename, __pyx_v_4lxml_5etree__UNICODE_ENCODING, __pyx_v_self->_parse_options);
67077
67078           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":889
67079  *                         pctxt, c_text, buffer_len, c_filename, _UNICODE_ENCODING,
67080  *                         self._parse_options)
67081  *                     if result is not NULL:             # <<<<<<<<<<<<<<
67082  *                         if _fixHtmlDictNames(pctxt.dict, result) < 0:
67083  *                             tree.xmlFreeDoc(result)
67084  */
67085           __pyx_t_1 = (__pyx_v_result != NULL);
67086           if (__pyx_t_1) {
67087
67088             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":890
67089  *                         self._parse_options)
67090  *                     if result is not NULL:
67091  *                         if _fixHtmlDictNames(pctxt.dict, result) < 0:             # <<<<<<<<<<<<<<
67092  *                             tree.xmlFreeDoc(result)
67093  *                             result = NULL
67094  */
67095             __pyx_t_1 = (__pyx_f_4lxml_5etree__fixHtmlDictNames(__pyx_v_pctxt->dict, __pyx_v_result) < 0);
67096             if (__pyx_t_1) {
67097
67098               /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":891
67099  *                     if result is not NULL:
67100  *                         if _fixHtmlDictNames(pctxt.dict, result) < 0:
67101  *                             tree.xmlFreeDoc(result)             # <<<<<<<<<<<<<<
67102  *                             result = NULL
67103  *                 else:
67104  */
67105               xmlFreeDoc(__pyx_v_result);
67106
67107               /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":892
67108  *                         if _fixHtmlDictNames(pctxt.dict, result) < 0:
67109  *                             tree.xmlFreeDoc(result)
67110  *                             result = NULL             # <<<<<<<<<<<<<<
67111  *                 else:
67112  *                     result = xmlparser.xmlCtxtReadMemory(
67113  */
67114               __pyx_v_result = NULL;
67115               goto __pyx_L12;
67116             }
67117             __pyx_L12:;
67118             goto __pyx_L11;
67119           }
67120           __pyx_L11:;
67121           goto __pyx_L10;
67122         }
67123         /*else*/ {
67124
67125           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":896
67126  *                     result = xmlparser.xmlCtxtReadMemory(
67127  *                         pctxt, c_text, buffer_len, c_filename, _UNICODE_ENCODING,
67128  *                         self._parse_options)             # <<<<<<<<<<<<<<
67129  * 
67130  *             return context._handleParseResultDoc(self, result, None)
67131  */
67132           __pyx_v_result = xmlCtxtReadMemory(__pyx_v_pctxt, __pyx_v_c_text, __pyx_v_buffer_len, __pyx_v_c_filename, __pyx_v_4lxml_5etree__UNICODE_ENCODING, __pyx_v_self->_parse_options);
67133         }
67134         __pyx_L10:;
67135       }
67136       /*finally:*/ {
67137         Py_BLOCK_THREADS
67138       }
67139     }
67140
67141     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":898
67142  *                         self._parse_options)
67143  * 
67144  *             return context._handleParseResultDoc(self, result, None)             # <<<<<<<<<<<<<<
67145  *         finally:
67146  *             context.cleanup()
67147  */
67148     __pyx_t_5 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->_handleParseResultDoc(__pyx_v_context, __pyx_v_self, __pyx_v_result, Py_None); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L5;}
67149     __pyx_r = __pyx_t_5;
67150     goto __pyx_L4;
67151   }
67152   /*finally:*/ {
67153     int __pyx_why;
67154     PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
67155     int __pyx_exc_lineno;
67156     __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
67157     __pyx_why = 0; goto __pyx_L6;
67158     __pyx_L4: __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
67159     __pyx_why = 3; goto __pyx_L6;
67160     __pyx_L5: {
67161       __pyx_why = 4;
67162       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
67163       __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
67164       __pyx_exc_lineno = __pyx_lineno;
67165       goto __pyx_L6;
67166     }
67167     __pyx_L6:;
67168
67169     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":900
67170  *             return context._handleParseResultDoc(self, result, None)
67171  *         finally:
67172  *             context.cleanup()             # <<<<<<<<<<<<<<
67173  * 
67174  *     cdef xmlDoc* _parseDoc(self, char* c_text, Py_ssize_t c_len,
67175  */
67176     __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
67177     goto __pyx_L14;
67178     __pyx_L13_error:;
67179     if (__pyx_why == 4) {
67180       Py_XDECREF(__pyx_exc_type);
67181       Py_XDECREF(__pyx_exc_value);
67182       Py_XDECREF(__pyx_exc_tb);
67183     }
67184     goto __pyx_L1_error;
67185     __pyx_L14:;
67186     switch (__pyx_why) {
67187       case 3: goto __pyx_L0;
67188       case 4: {
67189         __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
67190         __pyx_lineno = __pyx_exc_lineno;
67191         __pyx_exc_type = 0;
67192         __pyx_exc_value = 0;
67193         __pyx_exc_tb = 0;
67194         goto __pyx_L1_error;
67195       }
67196     }
67197   }
67198
67199   __pyx_r = 0;
67200   goto __pyx_L0;
67201   __pyx_L1_error:;
67202   __Pyx_XDECREF(__pyx_t_2);
67203   __Pyx_AddTraceback("lxml.etree._BaseParser._parseUnicodeDoc");
67204   __pyx_r = NULL;
67205   __pyx_L0:;
67206   __Pyx_DECREF((PyObject *)__pyx_v_context);
67207   __Pyx_DECREF(__pyx_v_text_utf);
67208   __Pyx_FinishRefcountContext();
67209   return __pyx_r;
67210 }
67211
67212 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":902
67213  *             context.cleanup()
67214  * 
67215  *     cdef xmlDoc* _parseDoc(self, char* c_text, Py_ssize_t c_len,             # <<<<<<<<<<<<<<
67216  *                            char* c_filename) except NULL:
67217  *         u"""Parse document, share dictionary if possible.
67218  */
67219
67220 static  xmlDoc *__pyx_f_4lxml_5etree_11_BaseParser__parseDoc(struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_self, char *__pyx_v_c_text, Py_ssize_t __pyx_v_c_len, char *__pyx_v_c_filename) {
67221   struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_context;
67222   xmlDoc *__pyx_v_result;
67223   xmlParserCtxt *__pyx_v_pctxt;
67224   char *__pyx_v_c_encoding;
67225   xmlDoc *__pyx_r;
67226   PyObject *__pyx_1 = 0;
67227   int __pyx_t_1;
67228   PyObject *__pyx_t_2 = NULL;
67229   int __pyx_t_3;
67230   xmlDoc *__pyx_t_4;
67231   __Pyx_SetupRefcountContext("_parseDoc");
67232   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); __Pyx_INCREF(Py_None);
67233
67234   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":910
67235  *         cdef xmlparser.xmlParserCtxt* pctxt
67236  *         cdef char* c_encoding
67237  *         if c_len > python.INT_MAX:             # <<<<<<<<<<<<<<
67238  *             raise ParserError, u"string is too long to parse it with libxml2"
67239  * 
67240  */
67241   __pyx_t_1 = (__pyx_v_c_len > INT_MAX);
67242   if (__pyx_t_1) {
67243
67244     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":911
67245  *         cdef char* c_encoding
67246  *         if c_len > python.INT_MAX:
67247  *             raise ParserError, u"string is too long to parse it with libxml2"             # <<<<<<<<<<<<<<
67248  * 
67249  *         context = self._getParserContext()
67250  */
67251     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ParserError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
67252     __Pyx_GOTREF(__pyx_1);
67253     __Pyx_Raise(__pyx_1, ((PyObject *)__pyx_kp_450), 0);
67254     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
67255     {__pyx_filename = __pyx_f[2]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
67256     goto __pyx_L3;
67257   }
67258   __pyx_L3:;
67259
67260   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":913
67261  *             raise ParserError, u"string is too long to parse it with libxml2"
67262  * 
67263  *         context = self._getParserContext()             # <<<<<<<<<<<<<<
67264  *         context.prepare()
67265  *         try:
67266  */
67267   __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_getParserContext(__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
67268   __Pyx_GOTREF(__pyx_t_2);
67269   __Pyx_DECREF(((PyObject *)__pyx_v_context));
67270   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_t_2);
67271   __pyx_t_2 = 0;
67272
67273   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":914
67274  * 
67275  *         context = self._getParserContext()
67276  *         context.prepare()             # <<<<<<<<<<<<<<
67277  *         try:
67278  *             pctxt = context._c_ctxt
67279  */
67280   __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->prepare(__pyx_v_context); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
67281
67282   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":915
67283  *         context = self._getParserContext()
67284  *         context.prepare()
67285  *         try:             # <<<<<<<<<<<<<<
67286  *             pctxt = context._c_ctxt
67287  *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
67288  */
67289   /*try:*/ {
67290
67291     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":916
67292  *         context.prepare()
67293  *         try:
67294  *             pctxt = context._c_ctxt             # <<<<<<<<<<<<<<
67295  *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
67296  * 
67297  */
67298     __pyx_v_pctxt = __pyx_v_context->_c_ctxt;
67299
67300     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":917
67301  *         try:
67302  *             pctxt = context._c_ctxt
67303  *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)             # <<<<<<<<<<<<<<
67304  * 
67305  *             if self._default_encoding is None:
67306  */
67307     ((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initParserDict(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT, __pyx_v_pctxt);
67308
67309     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":919
67310  *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
67311  * 
67312  *             if self._default_encoding is None:             # <<<<<<<<<<<<<<
67313  *                 c_encoding = NULL
67314  *             else:
67315  */
67316     __pyx_t_1 = (__pyx_v_self->_default_encoding == Py_None);
67317     if (__pyx_t_1) {
67318
67319       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":920
67320  * 
67321  *             if self._default_encoding is None:
67322  *                 c_encoding = NULL             # <<<<<<<<<<<<<<
67323  *             else:
67324  *                 c_encoding = _cstr(self._default_encoding)
67325  */
67326       __pyx_v_c_encoding = NULL;
67327       goto __pyx_L7;
67328     }
67329     /*else*/ {
67330
67331       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":922
67332  *                 c_encoding = NULL
67333  *             else:
67334  *                 c_encoding = _cstr(self._default_encoding)             # <<<<<<<<<<<<<<
67335  * 
67336  *             with nogil:
67337  */
67338       __pyx_v_c_encoding = PyString_AS_STRING(__pyx_v_self->_default_encoding);
67339     }
67340     __pyx_L7:;
67341
67342     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":924
67343  *                 c_encoding = _cstr(self._default_encoding)
67344  * 
67345  *             with nogil:             # <<<<<<<<<<<<<<
67346  *                 if self._for_html:
67347  *                     result = htmlparser.htmlCtxtReadMemory(
67348  */
67349     { PyThreadState *_save;
67350       Py_UNBLOCK_THREADS
67351       /*try:*/ {
67352
67353         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":925
67354  * 
67355  *             with nogil:
67356  *                 if self._for_html:             # <<<<<<<<<<<<<<
67357  *                     result = htmlparser.htmlCtxtReadMemory(
67358  *                         pctxt, c_text, c_len, c_filename,
67359  */
67360         __pyx_t_1 = __pyx_v_self->_for_html;
67361         if (__pyx_t_1) {
67362
67363           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":928
67364  *                     result = htmlparser.htmlCtxtReadMemory(
67365  *                         pctxt, c_text, c_len, c_filename,
67366  *                         c_encoding, self._parse_options)             # <<<<<<<<<<<<<<
67367  *                     if result is not NULL:
67368  *                         if _fixHtmlDictNames(pctxt.dict, result) < 0:
67369  */
67370           __pyx_v_result = htmlCtxtReadMemory(__pyx_v_pctxt, __pyx_v_c_text, __pyx_v_c_len, __pyx_v_c_filename, __pyx_v_c_encoding, __pyx_v_self->_parse_options);
67371
67372           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":929
67373  *                         pctxt, c_text, c_len, c_filename,
67374  *                         c_encoding, self._parse_options)
67375  *                     if result is not NULL:             # <<<<<<<<<<<<<<
67376  *                         if _fixHtmlDictNames(pctxt.dict, result) < 0:
67377  *                             tree.xmlFreeDoc(result)
67378  */
67379           __pyx_t_1 = (__pyx_v_result != NULL);
67380           if (__pyx_t_1) {
67381
67382             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":930
67383  *                         c_encoding, self._parse_options)
67384  *                     if result is not NULL:
67385  *                         if _fixHtmlDictNames(pctxt.dict, result) < 0:             # <<<<<<<<<<<<<<
67386  *                             tree.xmlFreeDoc(result)
67387  *                             result = NULL
67388  */
67389             __pyx_t_1 = (__pyx_f_4lxml_5etree__fixHtmlDictNames(__pyx_v_pctxt->dict, __pyx_v_result) < 0);
67390             if (__pyx_t_1) {
67391
67392               /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":931
67393  *                     if result is not NULL:
67394  *                         if _fixHtmlDictNames(pctxt.dict, result) < 0:
67395  *                             tree.xmlFreeDoc(result)             # <<<<<<<<<<<<<<
67396  *                             result = NULL
67397  *                 else:
67398  */
67399               xmlFreeDoc(__pyx_v_result);
67400
67401               /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":932
67402  *                         if _fixHtmlDictNames(pctxt.dict, result) < 0:
67403  *                             tree.xmlFreeDoc(result)
67404  *                             result = NULL             # <<<<<<<<<<<<<<
67405  *                 else:
67406  *                     result = xmlparser.xmlCtxtReadMemory(
67407  */
67408               __pyx_v_result = NULL;
67409               goto __pyx_L13;
67410             }
67411             __pyx_L13:;
67412             goto __pyx_L12;
67413           }
67414           __pyx_L12:;
67415           goto __pyx_L11;
67416         }
67417         /*else*/ {
67418
67419           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":936
67420  *                     result = xmlparser.xmlCtxtReadMemory(
67421  *                         pctxt, c_text, c_len, c_filename,
67422  *                         c_encoding, self._parse_options)             # <<<<<<<<<<<<<<
67423  * 
67424  *             return context._handleParseResultDoc(self, result, None)
67425  */
67426           __pyx_v_result = xmlCtxtReadMemory(__pyx_v_pctxt, __pyx_v_c_text, __pyx_v_c_len, __pyx_v_c_filename, __pyx_v_c_encoding, __pyx_v_self->_parse_options);
67427         }
67428         __pyx_L11:;
67429       }
67430       /*finally:*/ {
67431         Py_BLOCK_THREADS
67432       }
67433     }
67434
67435     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":938
67436  *                         c_encoding, self._parse_options)
67437  * 
67438  *             return context._handleParseResultDoc(self, result, None)             # <<<<<<<<<<<<<<
67439  *         finally:
67440  *             context.cleanup()
67441  */
67442     __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->_handleParseResultDoc(__pyx_v_context, __pyx_v_self, __pyx_v_result, Py_None); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L5;}
67443     __pyx_r = __pyx_t_4;
67444     goto __pyx_L4;
67445   }
67446   /*finally:*/ {
67447     int __pyx_why;
67448     PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
67449     int __pyx_exc_lineno;
67450     __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
67451     __pyx_why = 0; goto __pyx_L6;
67452     __pyx_L4: __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
67453     __pyx_why = 3; goto __pyx_L6;
67454     __pyx_L5: {
67455       __pyx_why = 4;
67456       __Pyx_XDECREF(__pyx_1); __pyx_1 = 0;
67457       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
67458       __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
67459       __pyx_exc_lineno = __pyx_lineno;
67460       goto __pyx_L6;
67461     }
67462     __pyx_L6:;
67463
67464     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":940
67465  *             return context._handleParseResultDoc(self, result, None)
67466  *         finally:
67467  *             context.cleanup()             # <<<<<<<<<<<<<<
67468  * 
67469  *     cdef xmlDoc* _parseDocFromFile(self, char* c_filename) except NULL:
67470  */
67471     __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
67472     goto __pyx_L15;
67473     __pyx_L14_error:;
67474     if (__pyx_why == 4) {
67475       Py_XDECREF(__pyx_exc_type);
67476       Py_XDECREF(__pyx_exc_value);
67477       Py_XDECREF(__pyx_exc_tb);
67478     }
67479     goto __pyx_L1_error;
67480     __pyx_L15:;
67481     switch (__pyx_why) {
67482       case 3: goto __pyx_L0;
67483       case 4: {
67484         __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
67485         __pyx_lineno = __pyx_exc_lineno;
67486         __pyx_exc_type = 0;
67487         __pyx_exc_value = 0;
67488         __pyx_exc_tb = 0;
67489         goto __pyx_L1_error;
67490       }
67491     }
67492   }
67493
67494   __pyx_r = 0;
67495   goto __pyx_L0;
67496   __pyx_L1_error:;
67497   __Pyx_XDECREF(__pyx_1);
67498   __Pyx_XDECREF(__pyx_t_2);
67499   __Pyx_AddTraceback("lxml.etree._BaseParser._parseDoc");
67500   __pyx_r = NULL;
67501   __pyx_L0:;
67502   __Pyx_DECREF((PyObject *)__pyx_v_context);
67503   __Pyx_FinishRefcountContext();
67504   return __pyx_r;
67505 }
67506
67507 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":942
67508  *             context.cleanup()
67509  * 
67510  *     cdef xmlDoc* _parseDocFromFile(self, char* c_filename) except NULL:             # <<<<<<<<<<<<<<
67511  *         cdef _ParserContext context
67512  *         cdef xmlDoc* result
67513  */
67514
67515 static  xmlDoc *__pyx_f_4lxml_5etree_11_BaseParser__parseDocFromFile(struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_self, char *__pyx_v_c_filename) {
67516   struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_context;
67517   xmlDoc *__pyx_v_result;
67518   xmlParserCtxt *__pyx_v_pctxt;
67519   int __pyx_v_orig_options;
67520   char *__pyx_v_c_encoding;
67521   xmlDoc *__pyx_r;
67522   PyObject *__pyx_t_1 = NULL;
67523   int __pyx_t_2;
67524   int __pyx_t_3;
67525   xmlDoc *__pyx_t_4;
67526   __Pyx_SetupRefcountContext("_parseDocFromFile");
67527   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); __Pyx_INCREF(Py_None);
67528
67529   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":948
67530  *         cdef int orig_options
67531  *         cdef char* c_encoding
67532  *         result = NULL             # <<<<<<<<<<<<<<
67533  * 
67534  *         context = self._getParserContext()
67535  */
67536   __pyx_v_result = NULL;
67537
67538   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":950
67539  *         result = NULL
67540  * 
67541  *         context = self._getParserContext()             # <<<<<<<<<<<<<<
67542  *         context.prepare()
67543  *         try:
67544  */
67545   __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_getParserContext(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
67546   __Pyx_GOTREF(__pyx_t_1);
67547   __Pyx_DECREF(((PyObject *)__pyx_v_context));
67548   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_t_1);
67549   __pyx_t_1 = 0;
67550
67551   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":951
67552  * 
67553  *         context = self._getParserContext()
67554  *         context.prepare()             # <<<<<<<<<<<<<<
67555  *         try:
67556  *             pctxt = context._c_ctxt
67557  */
67558   __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->prepare(__pyx_v_context); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
67559
67560   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":952
67561  *         context = self._getParserContext()
67562  *         context.prepare()
67563  *         try:             # <<<<<<<<<<<<<<
67564  *             pctxt = context._c_ctxt
67565  *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
67566  */
67567   /*try:*/ {
67568
67569     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":953
67570  *         context.prepare()
67571  *         try:
67572  *             pctxt = context._c_ctxt             # <<<<<<<<<<<<<<
67573  *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
67574  * 
67575  */
67576     __pyx_v_pctxt = __pyx_v_context->_c_ctxt;
67577
67578     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":954
67579  *         try:
67580  *             pctxt = context._c_ctxt
67581  *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)             # <<<<<<<<<<<<<<
67582  * 
67583  *             if self._default_encoding is None:
67584  */
67585     ((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initParserDict(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT, __pyx_v_pctxt);
67586
67587     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":956
67588  *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
67589  * 
67590  *             if self._default_encoding is None:             # <<<<<<<<<<<<<<
67591  *                 c_encoding = NULL
67592  *             else:
67593  */
67594     __pyx_t_3 = (__pyx_v_self->_default_encoding == Py_None);
67595     if (__pyx_t_3) {
67596
67597       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":957
67598  * 
67599  *             if self._default_encoding is None:
67600  *                 c_encoding = NULL             # <<<<<<<<<<<<<<
67601  *             else:
67602  *                 c_encoding = _cstr(self._default_encoding)
67603  */
67604       __pyx_v_c_encoding = NULL;
67605       goto __pyx_L6;
67606     }
67607     /*else*/ {
67608
67609       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":959
67610  *                 c_encoding = NULL
67611  *             else:
67612  *                 c_encoding = _cstr(self._default_encoding)             # <<<<<<<<<<<<<<
67613  * 
67614  *             orig_options = pctxt.options
67615  */
67616       __pyx_v_c_encoding = PyString_AS_STRING(__pyx_v_self->_default_encoding);
67617     }
67618     __pyx_L6:;
67619
67620     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":961
67621  *                 c_encoding = _cstr(self._default_encoding)
67622  * 
67623  *             orig_options = pctxt.options             # <<<<<<<<<<<<<<
67624  *             with nogil:
67625  *                 if self._for_html:
67626  */
67627     __pyx_v_orig_options = __pyx_v_pctxt->options;
67628
67629     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":962
67630  * 
67631  *             orig_options = pctxt.options
67632  *             with nogil:             # <<<<<<<<<<<<<<
67633  *                 if self._for_html:
67634  *                     result = htmlparser.htmlCtxtReadFile(
67635  */
67636     { PyThreadState *_save;
67637       Py_UNBLOCK_THREADS
67638       /*try:*/ {
67639
67640         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":963
67641  *             orig_options = pctxt.options
67642  *             with nogil:
67643  *                 if self._for_html:             # <<<<<<<<<<<<<<
67644  *                     result = htmlparser.htmlCtxtReadFile(
67645  *                         pctxt, c_filename, c_encoding, self._parse_options)
67646  */
67647         __pyx_t_3 = __pyx_v_self->_for_html;
67648         if (__pyx_t_3) {
67649
67650           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":965
67651  *                 if self._for_html:
67652  *                     result = htmlparser.htmlCtxtReadFile(
67653  *                         pctxt, c_filename, c_encoding, self._parse_options)             # <<<<<<<<<<<<<<
67654  *                     if result is not NULL:
67655  *                         if _fixHtmlDictNames(pctxt.dict, result) < 0:
67656  */
67657           __pyx_v_result = htmlCtxtReadFile(__pyx_v_pctxt, __pyx_v_c_filename, __pyx_v_c_encoding, __pyx_v_self->_parse_options);
67658
67659           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":966
67660  *                     result = htmlparser.htmlCtxtReadFile(
67661  *                         pctxt, c_filename, c_encoding, self._parse_options)
67662  *                     if result is not NULL:             # <<<<<<<<<<<<<<
67663  *                         if _fixHtmlDictNames(pctxt.dict, result) < 0:
67664  *                             tree.xmlFreeDoc(result)
67665  */
67666           __pyx_t_3 = (__pyx_v_result != NULL);
67667           if (__pyx_t_3) {
67668
67669             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":967
67670  *                         pctxt, c_filename, c_encoding, self._parse_options)
67671  *                     if result is not NULL:
67672  *                         if _fixHtmlDictNames(pctxt.dict, result) < 0:             # <<<<<<<<<<<<<<
67673  *                             tree.xmlFreeDoc(result)
67674  *                             result = NULL
67675  */
67676             __pyx_t_3 = (__pyx_f_4lxml_5etree__fixHtmlDictNames(__pyx_v_pctxt->dict, __pyx_v_result) < 0);
67677             if (__pyx_t_3) {
67678
67679               /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":968
67680  *                     if result is not NULL:
67681  *                         if _fixHtmlDictNames(pctxt.dict, result) < 0:
67682  *                             tree.xmlFreeDoc(result)             # <<<<<<<<<<<<<<
67683  *                             result = NULL
67684  *                 else:
67685  */
67686               xmlFreeDoc(__pyx_v_result);
67687
67688               /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":969
67689  *                         if _fixHtmlDictNames(pctxt.dict, result) < 0:
67690  *                             tree.xmlFreeDoc(result)
67691  *                             result = NULL             # <<<<<<<<<<<<<<
67692  *                 else:
67693  *                     result = xmlparser.xmlCtxtReadFile(
67694  */
67695               __pyx_v_result = NULL;
67696               goto __pyx_L12;
67697             }
67698             __pyx_L12:;
67699             goto __pyx_L11;
67700           }
67701           __pyx_L11:;
67702           goto __pyx_L10;
67703         }
67704         /*else*/ {
67705
67706           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":972
67707  *                 else:
67708  *                     result = xmlparser.xmlCtxtReadFile(
67709  *                         pctxt, c_filename, c_encoding, self._parse_options)             # <<<<<<<<<<<<<<
67710  *             pctxt.options = orig_options # work around libxml2 problem
67711  * 
67712  */
67713           __pyx_v_result = xmlCtxtReadFile(__pyx_v_pctxt, __pyx_v_c_filename, __pyx_v_c_encoding, __pyx_v_self->_parse_options);
67714         }
67715         __pyx_L10:;
67716       }
67717       /*finally:*/ {
67718         Py_BLOCK_THREADS
67719       }
67720     }
67721
67722     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":973
67723  *                     result = xmlparser.xmlCtxtReadFile(
67724  *                         pctxt, c_filename, c_encoding, self._parse_options)
67725  *             pctxt.options = orig_options # work around libxml2 problem             # <<<<<<<<<<<<<<
67726  * 
67727  *             return context._handleParseResultDoc(self, result, c_filename)
67728  */
67729     __pyx_v_pctxt->options = __pyx_v_orig_options;
67730
67731     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":975
67732  *             pctxt.options = orig_options # work around libxml2 problem
67733  * 
67734  *             return context._handleParseResultDoc(self, result, c_filename)             # <<<<<<<<<<<<<<
67735  *         finally:
67736  *             context.cleanup()
67737  */
67738     __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_c_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L4;}
67739     __Pyx_GOTREF(__pyx_t_1);
67740     __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->_handleParseResultDoc(__pyx_v_context, __pyx_v_self, __pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L4;}
67741     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
67742     __pyx_r = __pyx_t_4;
67743     goto __pyx_L3;
67744   }
67745   /*finally:*/ {
67746     int __pyx_why;
67747     PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
67748     int __pyx_exc_lineno;
67749     __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
67750     __pyx_why = 0; goto __pyx_L5;
67751     __pyx_L3: __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
67752     __pyx_why = 3; goto __pyx_L5;
67753     __pyx_L4: {
67754       __pyx_why = 4;
67755       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
67756       __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
67757       __pyx_exc_lineno = __pyx_lineno;
67758       goto __pyx_L5;
67759     }
67760     __pyx_L5:;
67761
67762     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":977
67763  *             return context._handleParseResultDoc(self, result, c_filename)
67764  *         finally:
67765  *             context.cleanup()             # <<<<<<<<<<<<<<
67766  * 
67767  *     cdef xmlDoc* _parseDocFromFilelike(self, filelike, filename) except NULL:
67768  */
67769     __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
67770     goto __pyx_L14;
67771     __pyx_L13_error:;
67772     if (__pyx_why == 4) {
67773       Py_XDECREF(__pyx_exc_type);
67774       Py_XDECREF(__pyx_exc_value);
67775       Py_XDECREF(__pyx_exc_tb);
67776     }
67777     goto __pyx_L1_error;
67778     __pyx_L14:;
67779     switch (__pyx_why) {
67780       case 3: goto __pyx_L0;
67781       case 4: {
67782         __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
67783         __pyx_lineno = __pyx_exc_lineno;
67784         __pyx_exc_type = 0;
67785         __pyx_exc_value = 0;
67786         __pyx_exc_tb = 0;
67787         goto __pyx_L1_error;
67788       }
67789     }
67790   }
67791
67792   __pyx_r = 0;
67793   goto __pyx_L0;
67794   __pyx_L1_error:;
67795   __Pyx_XDECREF(__pyx_t_1);
67796   __Pyx_AddTraceback("lxml.etree._BaseParser._parseDocFromFile");
67797   __pyx_r = NULL;
67798   __pyx_L0:;
67799   __Pyx_DECREF((PyObject *)__pyx_v_context);
67800   __Pyx_FinishRefcountContext();
67801   return __pyx_r;
67802 }
67803
67804 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":979
67805  *             context.cleanup()
67806  * 
67807  *     cdef xmlDoc* _parseDocFromFilelike(self, filelike, filename) except NULL:             # <<<<<<<<<<<<<<
67808  *         cdef _ParserContext context
67809  *         cdef _FileReaderContext file_context
67810  */
67811
67812 static  xmlDoc *__pyx_f_4lxml_5etree_11_BaseParser__parseDocFromFilelike(struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_self, PyObject *__pyx_v_filelike, PyObject *__pyx_v_filename) {
67813   struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_context;
67814   struct __pyx_obj_4lxml_5etree__FileReaderContext *__pyx_v_file_context;
67815   xmlDoc *__pyx_v_result;
67816   xmlParserCtxt *__pyx_v_pctxt;
67817   xmlDoc *__pyx_r;
67818   int __pyx_t_1;
67819   int __pyx_t_2;
67820   PyObject *__pyx_t_3 = NULL;
67821   int __pyx_t_4;
67822   PyObject *__pyx_t_5 = NULL;
67823   xmlDoc *__pyx_t_6;
67824   __Pyx_SetupRefcountContext("_parseDocFromFilelike");
67825   __Pyx_INCREF(__pyx_v_filename);
67826   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); __Pyx_INCREF(Py_None);
67827   __pyx_v_file_context = ((struct __pyx_obj_4lxml_5etree__FileReaderContext *)Py_None); __Pyx_INCREF(Py_None);
67828
67829   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":985
67830  *         cdef xmlparser.xmlParserCtxt* pctxt
67831  *         cdef char* c_filename
67832  *         if not filename:             # <<<<<<<<<<<<<<
67833  *             filename = None
67834  * 
67835  */
67836   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_filename); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
67837   __pyx_t_2 = (!__pyx_t_1);
67838   if (__pyx_t_2) {
67839
67840     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":986
67841  *         cdef char* c_filename
67842  *         if not filename:
67843  *             filename = None             # <<<<<<<<<<<<<<
67844  * 
67845  *         context = self._getParserContext()
67846  */
67847     __Pyx_INCREF(Py_None);
67848     __Pyx_DECREF(__pyx_v_filename);
67849     __pyx_v_filename = Py_None;
67850     goto __pyx_L3;
67851   }
67852   __pyx_L3:;
67853
67854   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":988
67855  *             filename = None
67856  * 
67857  *         context = self._getParserContext()             # <<<<<<<<<<<<<<
67858  *         context.prepare()
67859  *         try:
67860  */
67861   __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_getParserContext(__pyx_v_self)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
67862   __Pyx_GOTREF(__pyx_t_3);
67863   __Pyx_DECREF(((PyObject *)__pyx_v_context));
67864   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_t_3);
67865   __pyx_t_3 = 0;
67866
67867   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":989
67868  * 
67869  *         context = self._getParserContext()
67870  *         context.prepare()             # <<<<<<<<<<<<<<
67871  *         try:
67872  *             pctxt = context._c_ctxt
67873  */
67874   __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->prepare(__pyx_v_context); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
67875
67876   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":990
67877  *         context = self._getParserContext()
67878  *         context.prepare()
67879  *         try:             # <<<<<<<<<<<<<<
67880  *             pctxt = context._c_ctxt
67881  *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
67882  */
67883   /*try:*/ {
67884
67885     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":991
67886  *         context.prepare()
67887  *         try:
67888  *             pctxt = context._c_ctxt             # <<<<<<<<<<<<<<
67889  *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
67890  *             file_context = _FileReaderContext(
67891  */
67892     __pyx_v_pctxt = __pyx_v_context->_c_ctxt;
67893
67894     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":992
67895  *         try:
67896  *             pctxt = context._c_ctxt
67897  *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)             # <<<<<<<<<<<<<<
67898  *             file_context = _FileReaderContext(
67899  *                 filelike, context, filename, self._default_encoding)
67900  */
67901     ((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initParserDict(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT, __pyx_v_pctxt);
67902
67903     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":994
67904  *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
67905  *             file_context = _FileReaderContext(
67906  *                 filelike, context, filename, self._default_encoding)             # <<<<<<<<<<<<<<
67907  *             result = file_context._readDoc(pctxt, self._parse_options)
67908  * 
67909  */
67910     __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L5;}
67911     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
67912     __Pyx_INCREF(__pyx_v_filelike);
67913     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_filelike);
67914     __Pyx_GIVEREF(__pyx_v_filelike);
67915     __Pyx_INCREF(((PyObject *)__pyx_v_context));
67916     PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_context));
67917     __Pyx_GIVEREF(((PyObject *)__pyx_v_context));
67918     __Pyx_INCREF(__pyx_v_filename);
67919     PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_filename);
67920     __Pyx_GIVEREF(__pyx_v_filename);
67921     __Pyx_INCREF(__pyx_v_self->_default_encoding);
67922     PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_self->_default_encoding);
67923     __Pyx_GIVEREF(__pyx_v_self->_default_encoding);
67924     __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__FileReaderContext)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L5;}
67925     __Pyx_GOTREF(__pyx_t_5);
67926     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
67927     if (!(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_4lxml_5etree__FileReaderContext))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L5;}
67928     __Pyx_DECREF(((PyObject *)__pyx_v_file_context));
67929     __pyx_v_file_context = ((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_t_5);
67930     __pyx_t_5 = 0;
67931
67932     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":995
67933  *             file_context = _FileReaderContext(
67934  *                 filelike, context, filename, self._default_encoding)
67935  *             result = file_context._readDoc(pctxt, self._parse_options)             # <<<<<<<<<<<<<<
67936  * 
67937  *             return context._handleParseResultDoc(
67938  */
67939     __pyx_v_result = ((struct __pyx_vtabstruct_4lxml_5etree__FileReaderContext *)__pyx_v_file_context->__pyx_vtab)->_readDoc(__pyx_v_file_context, __pyx_v_pctxt, __pyx_v_self->_parse_options);
67940
67941     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":998
67942  * 
67943  *             return context._handleParseResultDoc(
67944  *                 self, result, filename)             # <<<<<<<<<<<<<<
67945  *         finally:
67946  *             context.cleanup()
67947  */
67948     __pyx_t_6 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->_handleParseResultDoc(__pyx_v_context, __pyx_v_self, __pyx_v_result, __pyx_v_filename); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 997; __pyx_clineno = __LINE__; goto __pyx_L5;}
67949     __pyx_r = __pyx_t_6;
67950     goto __pyx_L4;
67951   }
67952   /*finally:*/ {
67953     int __pyx_why;
67954     PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
67955     int __pyx_exc_lineno;
67956     __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
67957     __pyx_why = 0; goto __pyx_L6;
67958     __pyx_L4: __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
67959     __pyx_why = 3; goto __pyx_L6;
67960     __pyx_L5: {
67961       __pyx_why = 4;
67962       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
67963       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
67964       __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
67965       __pyx_exc_lineno = __pyx_lineno;
67966       goto __pyx_L6;
67967     }
67968     __pyx_L6:;
67969
67970     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1000
67971  *                 self, result, filename)
67972  *         finally:
67973  *             context.cleanup()             # <<<<<<<<<<<<<<
67974  * 
67975  * ############################################################
67976  */
67977     __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
67978     goto __pyx_L8;
67979     __pyx_L7_error:;
67980     if (__pyx_why == 4) {
67981       Py_XDECREF(__pyx_exc_type);
67982       Py_XDECREF(__pyx_exc_value);
67983       Py_XDECREF(__pyx_exc_tb);
67984     }
67985     goto __pyx_L1_error;
67986     __pyx_L8:;
67987     switch (__pyx_why) {
67988       case 3: goto __pyx_L0;
67989       case 4: {
67990         __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
67991         __pyx_lineno = __pyx_exc_lineno;
67992         __pyx_exc_type = 0;
67993         __pyx_exc_value = 0;
67994         __pyx_exc_tb = 0;
67995         goto __pyx_L1_error;
67996       }
67997     }
67998   }
67999
68000   __pyx_r = 0;
68001   goto __pyx_L0;
68002   __pyx_L1_error:;
68003   __Pyx_XDECREF(__pyx_t_3);
68004   __Pyx_XDECREF(__pyx_t_5);
68005   __Pyx_AddTraceback("lxml.etree._BaseParser._parseDocFromFilelike");
68006   __pyx_r = NULL;
68007   __pyx_L0:;
68008   __Pyx_DECREF((PyObject *)__pyx_v_context);
68009   __Pyx_DECREF((PyObject *)__pyx_v_file_context);
68010   __Pyx_DECREF(__pyx_v_filename);
68011   __Pyx_FinishRefcountContext();
68012   return __pyx_r;
68013 }
68014
68015 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1015
68016  *         different from what the ``error_log`` property returns.
68017  *         """
68018  *         def __get__(self):             # <<<<<<<<<<<<<<
68019  *             cdef _ParserContext context
68020  *             context = self._getPushParserContext()
68021  */
68022
68023 static PyObject *__pyx_pf_4lxml_5etree_11_FeedParser_14feed_error_log___get__(PyObject *__pyx_v_self); /*proto*/
68024 static PyObject *__pyx_pf_4lxml_5etree_11_FeedParser_14feed_error_log___get__(PyObject *__pyx_v_self) {
68025   struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_context;
68026   PyObject *__pyx_r = NULL;
68027   PyObject *__pyx_t_1 = NULL;
68028   PyObject *__pyx_t_2 = NULL;
68029   __Pyx_SetupRefcountContext("__get__");
68030   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); __Pyx_INCREF(Py_None);
68031
68032   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1017
68033  *         def __get__(self):
68034  *             cdef _ParserContext context
68035  *             context = self._getPushParserContext()             # <<<<<<<<<<<<<<
68036  *             return context._error_log.copy()
68037  * 
68038  */
68039   __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__FeedParser *)((struct __pyx_obj_4lxml_5etree__FeedParser *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._getPushParserContext(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68040   __Pyx_GOTREF(__pyx_t_1);
68041   __Pyx_DECREF(((PyObject *)__pyx_v_context));
68042   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_t_1);
68043   __pyx_t_1 = 0;
68044
68045   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1018
68046  *             cdef _ParserContext context
68047  *             context = self._getPushParserContext()
68048  *             return context._error_log.copy()             # <<<<<<<<<<<<<<
68049  * 
68050  *     def feed(self, data):
68051  */
68052   __Pyx_XDECREF(__pyx_r);
68053   __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_context->_error_log), __pyx_kp_copy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68054   __Pyx_GOTREF(__pyx_t_1);
68055   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68056   __Pyx_GOTREF(__pyx_t_2);
68057   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
68058   __pyx_r = __pyx_t_2;
68059   __pyx_t_2 = 0;
68060   goto __pyx_L0;
68061
68062   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
68063   goto __pyx_L0;
68064   __pyx_L1_error:;
68065   __Pyx_XDECREF(__pyx_t_1);
68066   __Pyx_XDECREF(__pyx_t_2);
68067   __Pyx_AddTraceback("lxml.etree._FeedParser.feed_error_log.__get__");
68068   __pyx_r = NULL;
68069   __pyx_L0:;
68070   __Pyx_DECREF((PyObject *)__pyx_v_context);
68071   __Pyx_XGIVEREF(__pyx_r);
68072   __Pyx_FinishRefcountContext();
68073   return __pyx_r;
68074 }
68075
68076 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1020
68077  *             return context._error_log.copy()
68078  * 
68079  *     def feed(self, data):             # <<<<<<<<<<<<<<
68080  *         u"""feed(self, data)
68081  * 
68082  */
68083
68084 static PyObject *__pyx_pf_4lxml_5etree_11_FeedParser_feed(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
68085 static char __pyx_doc_4lxml_5etree_11_FeedParser_feed[] = "feed(self, data)\n\n        Feeds data to the parser.  The argument should be an 8-bit string\n        buffer containing encoded data, although Unicode is supported as long\n        as both string types are not mixed.\n\n        This is the main entry point to the consumer interface of a\n        parser.  The parser will parse as much of the XML stream as it\n        can on each call.  To finish parsing or to reset the parser,\n        call the ``close()`` method.  Both methods may raise\n        ParseError if errors occur in the input data.  If an error is\n        raised, there is no longer a need to call ``close()``.\n\n        The feed parser interface is independent of the normal parser\n        usage.  You can use the same parser as a feed parser and in\n        the ``parse()`` function concurrently.\n        ";
68086 static PyObject *__pyx_pf_4lxml_5etree_11_FeedParser_feed(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
68087   struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_context;
68088   xmlParserCtxt *__pyx_v_pctxt;
68089   Py_ssize_t __pyx_v_py_buffer_len;
68090   char *__pyx_v_c_data;
68091   char *__pyx_v_c_encoding;
68092   int __pyx_v_buffer_len;
68093   int __pyx_v_error;
68094   int __pyx_v_recover;
68095   PyObject *__pyx_v_entry;
68096   PyObject *__pyx_r = NULL;
68097   PyObject *__pyx_1 = 0;
68098   int __pyx_t_1;
68099   char *__pyx_t_2;
68100   PyObject *__pyx_t_3 = NULL;
68101   int __pyx_t_4;
68102   int __pyx_t_5;
68103   Py_ssize_t __pyx_t_6;
68104   PyObject *__pyx_t_7 = NULL;
68105   PyObject *__pyx_t_8 = NULL;
68106   PyObject *__pyx_t_9 = NULL;
68107   int __pyx_t_10;
68108   __Pyx_SetupRefcountContext("feed");
68109   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); __Pyx_INCREF(Py_None);
68110   __pyx_v_entry = Py_None; __Pyx_INCREF(Py_None);
68111
68112   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1045
68113  *         cdef int buffer_len
68114  *         cdef int error
68115  *         cdef bint recover = self._parse_options & xmlparser.XML_PARSE_RECOVER             # <<<<<<<<<<<<<<
68116  *         if python.PyString_Check(data):
68117  *             if self._default_encoding is None:
68118  */
68119   __pyx_v_recover = (((struct __pyx_obj_4lxml_5etree__FeedParser *)__pyx_v_self)->__pyx_base._parse_options & XML_PARSE_RECOVER);
68120
68121   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1046
68122  *         cdef int error
68123  *         cdef bint recover = self._parse_options & xmlparser.XML_PARSE_RECOVER
68124  *         if python.PyString_Check(data):             # <<<<<<<<<<<<<<
68125  *             if self._default_encoding is None:
68126  *                 c_encoding = NULL
68127  */
68128   __pyx_t_1 = PyString_Check(__pyx_v_data);
68129   if (__pyx_t_1) {
68130
68131     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1047
68132  *         cdef bint recover = self._parse_options & xmlparser.XML_PARSE_RECOVER
68133  *         if python.PyString_Check(data):
68134  *             if self._default_encoding is None:             # <<<<<<<<<<<<<<
68135  *                 c_encoding = NULL
68136  *             else:
68137  */
68138     __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree__FeedParser *)__pyx_v_self)->__pyx_base._default_encoding == Py_None);
68139     if (__pyx_t_1) {
68140
68141       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1048
68142  *         if python.PyString_Check(data):
68143  *             if self._default_encoding is None:
68144  *                 c_encoding = NULL             # <<<<<<<<<<<<<<
68145  *             else:
68146  *                 c_encoding = self._default_encoding
68147  */
68148       __pyx_v_c_encoding = NULL;
68149       goto __pyx_L6;
68150     }
68151     /*else*/ {
68152
68153       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1050
68154  *                 c_encoding = NULL
68155  *             else:
68156  *                 c_encoding = self._default_encoding             # <<<<<<<<<<<<<<
68157  *             c_data = _cstr(data)
68158  *             py_buffer_len = python.PyString_GET_SIZE(data)
68159  */
68160       __pyx_t_2 = __Pyx_PyBytes_AsString(((struct __pyx_obj_4lxml_5etree__FeedParser *)__pyx_v_self)->__pyx_base._default_encoding); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68161       __pyx_v_c_encoding = __pyx_t_2;
68162     }
68163     __pyx_L6:;
68164
68165     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1051
68166  *             else:
68167  *                 c_encoding = self._default_encoding
68168  *             c_data = _cstr(data)             # <<<<<<<<<<<<<<
68169  *             py_buffer_len = python.PyString_GET_SIZE(data)
68170  *         elif python.PyUnicode_Check(data):
68171  */
68172     __pyx_v_c_data = PyString_AS_STRING(__pyx_v_data);
68173
68174     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1052
68175  *                 c_encoding = self._default_encoding
68176  *             c_data = _cstr(data)
68177  *             py_buffer_len = python.PyString_GET_SIZE(data)             # <<<<<<<<<<<<<<
68178  *         elif python.PyUnicode_Check(data):
68179  *             if _UNICODE_ENCODING is NULL:
68180  */
68181     __pyx_v_py_buffer_len = PyString_GET_SIZE(__pyx_v_data);
68182     goto __pyx_L5;
68183   }
68184
68185   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1053
68186  *             c_data = _cstr(data)
68187  *             py_buffer_len = python.PyString_GET_SIZE(data)
68188  *         elif python.PyUnicode_Check(data):             # <<<<<<<<<<<<<<
68189  *             if _UNICODE_ENCODING is NULL:
68190  *                 raise ParserError, \
68191  */
68192   __pyx_t_1 = PyUnicode_Check(__pyx_v_data);
68193   if (__pyx_t_1) {
68194
68195     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1054
68196  *             py_buffer_len = python.PyString_GET_SIZE(data)
68197  *         elif python.PyUnicode_Check(data):
68198  *             if _UNICODE_ENCODING is NULL:             # <<<<<<<<<<<<<<
68199  *                 raise ParserError, \
68200  *                     u"Unicode parsing is not supported on this platform"
68201  */
68202     __pyx_t_1 = (__pyx_v_4lxml_5etree__UNICODE_ENCODING == NULL);
68203     if (__pyx_t_1) {
68204
68205       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1055
68206  *         elif python.PyUnicode_Check(data):
68207  *             if _UNICODE_ENCODING is NULL:
68208  *                 raise ParserError, \             # <<<<<<<<<<<<<<
68209  *                     u"Unicode parsing is not supported on this platform"
68210  *             c_encoding = _UNICODE_ENCODING
68211  */
68212       __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ParserError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68213       __Pyx_GOTREF(__pyx_1);
68214
68215       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1056
68216  *             if _UNICODE_ENCODING is NULL:
68217  *                 raise ParserError, \
68218  *                     u"Unicode parsing is not supported on this platform"             # <<<<<<<<<<<<<<
68219  *             c_encoding = _UNICODE_ENCODING
68220  *             c_data = python.PyUnicode_AS_DATA(data)
68221  */
68222       __Pyx_Raise(__pyx_1, ((PyObject *)__pyx_kp_451), 0);
68223       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
68224       {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68225       goto __pyx_L7;
68226     }
68227     __pyx_L7:;
68228
68229     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1057
68230  *                 raise ParserError, \
68231  *                     u"Unicode parsing is not supported on this platform"
68232  *             c_encoding = _UNICODE_ENCODING             # <<<<<<<<<<<<<<
68233  *             c_data = python.PyUnicode_AS_DATA(data)
68234  *             py_buffer_len = python.PyUnicode_GET_DATA_SIZE(data)
68235  */
68236     __pyx_v_c_encoding = __pyx_v_4lxml_5etree__UNICODE_ENCODING;
68237
68238     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1058
68239  *                     u"Unicode parsing is not supported on this platform"
68240  *             c_encoding = _UNICODE_ENCODING
68241  *             c_data = python.PyUnicode_AS_DATA(data)             # <<<<<<<<<<<<<<
68242  *             py_buffer_len = python.PyUnicode_GET_DATA_SIZE(data)
68243  *         else:
68244  */
68245     __pyx_v_c_data = PyUnicode_AS_DATA(__pyx_v_data);
68246
68247     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1059
68248  *             c_encoding = _UNICODE_ENCODING
68249  *             c_data = python.PyUnicode_AS_DATA(data)
68250  *             py_buffer_len = python.PyUnicode_GET_DATA_SIZE(data)             # <<<<<<<<<<<<<<
68251  *         else:
68252  *             raise TypeError, u"Parsing requires string data"
68253  */
68254     __pyx_v_py_buffer_len = PyUnicode_GET_DATA_SIZE(__pyx_v_data);
68255     goto __pyx_L5;
68256   }
68257   /*else*/ {
68258
68259     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1061
68260  *             py_buffer_len = python.PyUnicode_GET_DATA_SIZE(data)
68261  *         else:
68262  *             raise TypeError, u"Parsing requires string data"             # <<<<<<<<<<<<<<
68263  * 
68264  *         context = self._getPushParserContext()
68265  */
68266     __Pyx_Raise(__pyx_builtin_TypeError, ((PyObject *)__pyx_kp_452), 0);
68267     {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68268   }
68269   __pyx_L5:;
68270
68271   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1063
68272  *             raise TypeError, u"Parsing requires string data"
68273  * 
68274  *         context = self._getPushParserContext()             # <<<<<<<<<<<<<<
68275  *         pctxt = context._c_ctxt
68276  *         error = 0
68277  */
68278   __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__FeedParser *)((struct __pyx_obj_4lxml_5etree__FeedParser *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._getPushParserContext(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68279   __Pyx_GOTREF(__pyx_t_3);
68280   __Pyx_DECREF(((PyObject *)__pyx_v_context));
68281   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_t_3);
68282   __pyx_t_3 = 0;
68283
68284   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1064
68285  * 
68286  *         context = self._getPushParserContext()
68287  *         pctxt = context._c_ctxt             # <<<<<<<<<<<<<<
68288  *         error = 0
68289  *         if not self._feed_parser_running:
68290  */
68291   __pyx_v_pctxt = __pyx_v_context->_c_ctxt;
68292
68293   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1065
68294  *         context = self._getPushParserContext()
68295  *         pctxt = context._c_ctxt
68296  *         error = 0             # <<<<<<<<<<<<<<
68297  *         if not self._feed_parser_running:
68298  *             context.prepare()
68299  */
68300   __pyx_v_error = 0;
68301
68302   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1066
68303  *         pctxt = context._c_ctxt
68304  *         error = 0
68305  *         if not self._feed_parser_running:             # <<<<<<<<<<<<<<
68306  *             context.prepare()
68307  *             self._feed_parser_running = 1
68308  */
68309   __pyx_t_1 = (!((struct __pyx_obj_4lxml_5etree__FeedParser *)__pyx_v_self)->_feed_parser_running);
68310   if (__pyx_t_1) {
68311
68312     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1067
68313  *         error = 0
68314  *         if not self._feed_parser_running:
68315  *             context.prepare()             # <<<<<<<<<<<<<<
68316  *             self._feed_parser_running = 1
68317  *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
68318  */
68319     __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->prepare(__pyx_v_context); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68320
68321     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1068
68322  *         if not self._feed_parser_running:
68323  *             context.prepare()
68324  *             self._feed_parser_running = 1             # <<<<<<<<<<<<<<
68325  *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
68326  * 
68327  */
68328     ((struct __pyx_obj_4lxml_5etree__FeedParser *)__pyx_v_self)->_feed_parser_running = 1;
68329
68330     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1069
68331  *             context.prepare()
68332  *             self._feed_parser_running = 1
68333  *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)             # <<<<<<<<<<<<<<
68334  * 
68335  *             if py_buffer_len > python.INT_MAX:
68336  */
68337     ((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initParserDict(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT, __pyx_v_pctxt);
68338
68339     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1071
68340  *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
68341  * 
68342  *             if py_buffer_len > python.INT_MAX:             # <<<<<<<<<<<<<<
68343  *                 buffer_len = python.INT_MAX
68344  *             else:
68345  */
68346     __pyx_t_1 = (__pyx_v_py_buffer_len > INT_MAX);
68347     if (__pyx_t_1) {
68348
68349       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1072
68350  * 
68351  *             if py_buffer_len > python.INT_MAX:
68352  *                 buffer_len = python.INT_MAX             # <<<<<<<<<<<<<<
68353  *             else:
68354  *                 buffer_len = <int>py_buffer_len
68355  */
68356       __pyx_v_buffer_len = INT_MAX;
68357       goto __pyx_L9;
68358     }
68359     /*else*/ {
68360
68361       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1074
68362  *                 buffer_len = python.INT_MAX
68363  *             else:
68364  *                 buffer_len = <int>py_buffer_len             # <<<<<<<<<<<<<<
68365  *             if self._for_html:
68366  *                 error = _htmlCtxtResetPush(pctxt, c_data, buffer_len,
68367  */
68368       __pyx_v_buffer_len = ((int)__pyx_v_py_buffer_len);
68369     }
68370     __pyx_L9:;
68371
68372     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1075
68373  *             else:
68374  *                 buffer_len = <int>py_buffer_len
68375  *             if self._for_html:             # <<<<<<<<<<<<<<
68376  *                 error = _htmlCtxtResetPush(pctxt, c_data, buffer_len,
68377  *                                            c_encoding, self._parse_options)
68378  */
68379     __pyx_t_1 = ((struct __pyx_obj_4lxml_5etree__FeedParser *)__pyx_v_self)->__pyx_base._for_html;
68380     if (__pyx_t_1) {
68381
68382       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1077
68383  *             if self._for_html:
68384  *                 error = _htmlCtxtResetPush(pctxt, c_data, buffer_len,
68385  *                                            c_encoding, self._parse_options)             # <<<<<<<<<<<<<<
68386  *             else:
68387  *                 xmlparser.xmlCtxtUseOptions(pctxt, self._parse_options)
68388  */
68389       __pyx_t_4 = __pyx_f_4lxml_5etree__htmlCtxtResetPush(__pyx_v_pctxt, __pyx_v_c_data, __pyx_v_buffer_len, __pyx_v_c_encoding, ((struct __pyx_obj_4lxml_5etree__FeedParser *)__pyx_v_self)->__pyx_base._parse_options); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68390       __pyx_v_error = __pyx_t_4;
68391       goto __pyx_L10;
68392     }
68393     /*else*/ {
68394
68395       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1079
68396  *                                            c_encoding, self._parse_options)
68397  *             else:
68398  *                 xmlparser.xmlCtxtUseOptions(pctxt, self._parse_options)             # <<<<<<<<<<<<<<
68399  *                 error = xmlparser.xmlCtxtResetPush(
68400  *                     pctxt, c_data, buffer_len, NULL, c_encoding)
68401  */
68402       xmlCtxtUseOptions(__pyx_v_pctxt, ((struct __pyx_obj_4lxml_5etree__FeedParser *)__pyx_v_self)->__pyx_base._parse_options);
68403
68404       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1081
68405  *                 xmlparser.xmlCtxtUseOptions(pctxt, self._parse_options)
68406  *                 error = xmlparser.xmlCtxtResetPush(
68407  *                     pctxt, c_data, buffer_len, NULL, c_encoding)             # <<<<<<<<<<<<<<
68408  *             py_buffer_len -= buffer_len
68409  *             c_data += buffer_len
68410  */
68411       __pyx_v_error = xmlCtxtResetPush(__pyx_v_pctxt, __pyx_v_c_data, __pyx_v_buffer_len, NULL, __pyx_v_c_encoding);
68412     }
68413     __pyx_L10:;
68414
68415     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1082
68416  *                 error = xmlparser.xmlCtxtResetPush(
68417  *                     pctxt, c_data, buffer_len, NULL, c_encoding)
68418  *             py_buffer_len -= buffer_len             # <<<<<<<<<<<<<<
68419  *             c_data += buffer_len
68420  * 
68421  */
68422     __pyx_v_py_buffer_len -= __pyx_v_buffer_len;
68423
68424     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1083
68425  *                     pctxt, c_data, buffer_len, NULL, c_encoding)
68426  *             py_buffer_len -= buffer_len
68427  *             c_data += buffer_len             # <<<<<<<<<<<<<<
68428  * 
68429  *         while (recover or error == 0) and py_buffer_len > 0:
68430  */
68431     __pyx_v_c_data += __pyx_v_buffer_len;
68432     goto __pyx_L8;
68433   }
68434   __pyx_L8:;
68435
68436   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1085
68437  *             c_data += buffer_len
68438  * 
68439  *         while (recover or error == 0) and py_buffer_len > 0:             # <<<<<<<<<<<<<<
68440  *             if py_buffer_len > python.INT_MAX:
68441  *                 buffer_len = python.INT_MAX
68442  */
68443   while (1) {
68444     if (!__pyx_v_recover) {
68445       __pyx_t_1 = (__pyx_v_error == 0);
68446     } else {
68447       __pyx_t_1 = __pyx_v_recover;
68448     }
68449     if (__pyx_t_1) {
68450       __pyx_t_5 = (__pyx_v_py_buffer_len > 0);
68451     } else {
68452       __pyx_t_5 = __pyx_t_1;
68453     }
68454     if (!__pyx_t_5) break;
68455
68456     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1086
68457  * 
68458  *         while (recover or error == 0) and py_buffer_len > 0:
68459  *             if py_buffer_len > python.INT_MAX:             # <<<<<<<<<<<<<<
68460  *                 buffer_len = python.INT_MAX
68461  *             else:
68462  */
68463     __pyx_t_5 = (__pyx_v_py_buffer_len > INT_MAX);
68464     if (__pyx_t_5) {
68465
68466       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1087
68467  *         while (recover or error == 0) and py_buffer_len > 0:
68468  *             if py_buffer_len > python.INT_MAX:
68469  *                 buffer_len = python.INT_MAX             # <<<<<<<<<<<<<<
68470  *             else:
68471  *                 buffer_len = <int>py_buffer_len
68472  */
68473       __pyx_v_buffer_len = INT_MAX;
68474       goto __pyx_L13;
68475     }
68476     /*else*/ {
68477
68478       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1089
68479  *                 buffer_len = python.INT_MAX
68480  *             else:
68481  *                 buffer_len = <int>py_buffer_len             # <<<<<<<<<<<<<<
68482  *             if self._for_html:
68483  *                 error = htmlparser.htmlParseChunk(pctxt, c_data, buffer_len, 0)
68484  */
68485       __pyx_v_buffer_len = ((int)__pyx_v_py_buffer_len);
68486     }
68487     __pyx_L13:;
68488
68489     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1090
68490  *             else:
68491  *                 buffer_len = <int>py_buffer_len
68492  *             if self._for_html:             # <<<<<<<<<<<<<<
68493  *                 error = htmlparser.htmlParseChunk(pctxt, c_data, buffer_len, 0)
68494  *             else:
68495  */
68496     __pyx_t_5 = ((struct __pyx_obj_4lxml_5etree__FeedParser *)__pyx_v_self)->__pyx_base._for_html;
68497     if (__pyx_t_5) {
68498
68499       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1091
68500  *                 buffer_len = <int>py_buffer_len
68501  *             if self._for_html:
68502  *                 error = htmlparser.htmlParseChunk(pctxt, c_data, buffer_len, 0)             # <<<<<<<<<<<<<<
68503  *             else:
68504  *                 error = xmlparser.xmlParseChunk(pctxt, c_data, buffer_len, 0)
68505  */
68506       __pyx_v_error = htmlParseChunk(__pyx_v_pctxt, __pyx_v_c_data, __pyx_v_buffer_len, 0);
68507       goto __pyx_L14;
68508     }
68509     /*else*/ {
68510
68511       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1093
68512  *                 error = htmlparser.htmlParseChunk(pctxt, c_data, buffer_len, 0)
68513  *             else:
68514  *                 error = xmlparser.xmlParseChunk(pctxt, c_data, buffer_len, 0)             # <<<<<<<<<<<<<<
68515  *             py_buffer_len -= buffer_len
68516  *             c_data += buffer_len
68517  */
68518       __pyx_v_error = xmlParseChunk(__pyx_v_pctxt, __pyx_v_c_data, __pyx_v_buffer_len, 0);
68519     }
68520     __pyx_L14:;
68521
68522     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1094
68523  *             else:
68524  *                 error = xmlparser.xmlParseChunk(pctxt, c_data, buffer_len, 0)
68525  *             py_buffer_len -= buffer_len             # <<<<<<<<<<<<<<
68526  *             c_data += buffer_len
68527  * 
68528  */
68529     __pyx_v_py_buffer_len -= __pyx_v_buffer_len;
68530
68531     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1095
68532  *                 error = xmlparser.xmlParseChunk(pctxt, c_data, buffer_len, 0)
68533  *             py_buffer_len -= buffer_len
68534  *             c_data += buffer_len             # <<<<<<<<<<<<<<
68535  * 
68536  *             if error and not pctxt.replaceEntities and not pctxt.validate:
68537  */
68538     __pyx_v_c_data += __pyx_v_buffer_len;
68539
68540     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1097
68541  *             c_data += buffer_len
68542  * 
68543  *             if error and not pctxt.replaceEntities and not pctxt.validate:             # <<<<<<<<<<<<<<
68544  *                 # in this mode, we ignore errors about undefined entities
68545  *                 for entry in context._error_log.filter_from_errors():
68546  */
68547     if (__pyx_v_error) {
68548       if ((!__pyx_v_pctxt->replaceEntities)) {
68549         __pyx_t_5 = (!__pyx_v_pctxt->validate);
68550       } else {
68551         __pyx_t_5 = (!__pyx_v_pctxt->replaceEntities);
68552       }
68553       __pyx_t_1 = __pyx_t_5;
68554     } else {
68555       __pyx_t_1 = __pyx_v_error;
68556     }
68557     if (__pyx_t_1) {
68558
68559       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1099
68560  *             if error and not pctxt.replaceEntities and not pctxt.validate:
68561  *                 # in this mode, we ignore errors about undefined entities
68562  *                 for entry in context._error_log.filter_from_errors():             # <<<<<<<<<<<<<<
68563  *                     if entry.type != ErrorTypes.WAR_UNDECLARED_ENTITY and \
68564  *                            entry.type != ErrorTypes.ERR_UNDECLARED_ENTITY:
68565  */
68566       __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_context->_error_log), __pyx_kp_filter_from_errors); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68567       __Pyx_GOTREF(__pyx_t_3);
68568       __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68569       __Pyx_GOTREF(__pyx_t_7);
68570       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
68571       if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) {
68572         __pyx_t_6 = 0; __pyx_t_3 = __pyx_t_7; __Pyx_INCREF(__pyx_t_3);
68573       } else {
68574         __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68575         __Pyx_GOTREF(__pyx_t_3);
68576       }
68577       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
68578       for (;;) {
68579         if (likely(PyList_CheckExact(__pyx_t_3))) {
68580           if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
68581           __pyx_t_7 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_7); __pyx_t_6++;
68582         } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
68583           if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
68584           __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_7); __pyx_t_6++;
68585         } else {
68586           __pyx_t_7 = PyIter_Next(__pyx_t_3);
68587           if (!__pyx_t_7) {
68588             if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68589             break;
68590           }
68591           __Pyx_GOTREF(__pyx_t_7);
68592         }
68593         __Pyx_DECREF(__pyx_v_entry);
68594         __pyx_v_entry = __pyx_t_7;
68595         __pyx_t_7 = 0;
68596
68597         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1100
68598  *                 # in this mode, we ignore errors about undefined entities
68599  *                 for entry in context._error_log.filter_from_errors():
68600  *                     if entry.type != ErrorTypes.WAR_UNDECLARED_ENTITY and \             # <<<<<<<<<<<<<<
68601  *                            entry.type != ErrorTypes.ERR_UNDECLARED_ENTITY:
68602  *                         break
68603  */
68604         __pyx_t_7 = PyObject_GetAttr(__pyx_v_entry, __pyx_kp_type); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68605         __Pyx_GOTREF(__pyx_t_7);
68606         __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ErrorTypes); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68607         __Pyx_GOTREF(__pyx_1);
68608         __pyx_t_8 = PyObject_GetAttr(__pyx_1, __pyx_kp_443); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68609         __Pyx_GOTREF(__pyx_t_8);
68610         __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
68611         __pyx_t_9 = PyObject_RichCompare(__pyx_t_7, __pyx_t_8, Py_NE); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68612         __Pyx_GOTREF(__pyx_t_9);
68613         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
68614         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
68615         __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68616         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
68617         if (__pyx_t_1) {
68618
68619           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1101
68620  *                 for entry in context._error_log.filter_from_errors():
68621  *                     if entry.type != ErrorTypes.WAR_UNDECLARED_ENTITY and \
68622  *                            entry.type != ErrorTypes.ERR_UNDECLARED_ENTITY:             # <<<<<<<<<<<<<<
68623  *                         break
68624  *                 else:
68625  */
68626           __pyx_t_9 = PyObject_GetAttr(__pyx_v_entry, __pyx_kp_type); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68627           __Pyx_GOTREF(__pyx_t_9);
68628           __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ErrorTypes); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68629           __Pyx_GOTREF(__pyx_1);
68630           __pyx_t_8 = PyObject_GetAttr(__pyx_1, __pyx_kp_444); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68631           __Pyx_GOTREF(__pyx_t_8);
68632           __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
68633           __pyx_t_7 = PyObject_RichCompare(__pyx_t_9, __pyx_t_8, Py_NE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68634           __Pyx_GOTREF(__pyx_t_7);
68635           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
68636           __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
68637           __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68638           __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
68639           __pyx_t_10 = __pyx_t_5;
68640         } else {
68641           __pyx_t_10 = __pyx_t_1;
68642         }
68643         if (__pyx_t_10) {
68644
68645           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1102
68646  *                     if entry.type != ErrorTypes.WAR_UNDECLARED_ENTITY and \
68647  *                            entry.type != ErrorTypes.ERR_UNDECLARED_ENTITY:
68648  *                         break             # <<<<<<<<<<<<<<
68649  *                 else:
68650  *                     error = 0
68651  */
68652           goto __pyx_L17_break;
68653           goto __pyx_L18;
68654         }
68655         __pyx_L18:;
68656       }
68657       /*else*/ {
68658
68659         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1104
68660  *                         break
68661  *                 else:
68662  *                     error = 0             # <<<<<<<<<<<<<<
68663  * 
68664  *         if not recover and (error or not pctxt.wellFormed):
68665  */
68666         __pyx_v_error = 0;
68667       }
68668       __pyx_L17_break:;
68669       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
68670       goto __pyx_L15;
68671     }
68672     __pyx_L15:;
68673   }
68674
68675   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1106
68676  *                     error = 0
68677  * 
68678  *         if not recover and (error or not pctxt.wellFormed):             # <<<<<<<<<<<<<<
68679  *             self._feed_parser_running = 0
68680  *             try:
68681  */
68682   if ((!__pyx_v_recover)) {
68683     if (!__pyx_v_error) {
68684       __pyx_t_10 = (!__pyx_v_pctxt->wellFormed);
68685     } else {
68686       __pyx_t_10 = __pyx_v_error;
68687     }
68688     __pyx_t_1 = __pyx_t_10;
68689   } else {
68690     __pyx_t_1 = (!__pyx_v_recover);
68691   }
68692   if (__pyx_t_1) {
68693
68694     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1107
68695  * 
68696  *         if not recover and (error or not pctxt.wellFormed):
68697  *             self._feed_parser_running = 0             # <<<<<<<<<<<<<<
68698  *             try:
68699  *                 context._handleParseResult(self, NULL, None)
68700  */
68701     ((struct __pyx_obj_4lxml_5etree__FeedParser *)__pyx_v_self)->_feed_parser_running = 0;
68702
68703     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1108
68704  *         if not recover and (error or not pctxt.wellFormed):
68705  *             self._feed_parser_running = 0
68706  *             try:             # <<<<<<<<<<<<<<
68707  *                 context._handleParseResult(self, NULL, None)
68708  *             finally:
68709  */
68710     /*try:*/ {
68711
68712       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1109
68713  *             self._feed_parser_running = 0
68714  *             try:
68715  *                 context._handleParseResult(self, NULL, None)             # <<<<<<<<<<<<<<
68716  *             finally:
68717  *                 context.cleanup()
68718  */
68719       __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->_handleParseResult(__pyx_v_context, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self), NULL, Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L21;}
68720       __Pyx_GOTREF(__pyx_t_3);
68721       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
68722     }
68723     /*finally:*/ {
68724       int __pyx_why;
68725       PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
68726       int __pyx_exc_lineno;
68727       __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
68728       __pyx_why = 0; goto __pyx_L22;
68729       __pyx_L21: {
68730         __pyx_why = 4;
68731         __Pyx_XDECREF(__pyx_1); __pyx_1 = 0;
68732         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
68733         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
68734         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
68735         __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
68736         __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
68737         __pyx_exc_lineno = __pyx_lineno;
68738         goto __pyx_L22;
68739       }
68740       __pyx_L22:;
68741
68742       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1111
68743  *                 context._handleParseResult(self, NULL, None)
68744  *             finally:
68745  *                 context.cleanup()             # <<<<<<<<<<<<<<
68746  * 
68747  *     def close(self):
68748  */
68749       __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L23_error;}
68750       goto __pyx_L24;
68751       __pyx_L23_error:;
68752       if (__pyx_why == 4) {
68753         Py_XDECREF(__pyx_exc_type);
68754         Py_XDECREF(__pyx_exc_value);
68755         Py_XDECREF(__pyx_exc_tb);
68756       }
68757       goto __pyx_L1_error;
68758       __pyx_L24:;
68759       switch (__pyx_why) {
68760         case 4: {
68761           __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
68762           __pyx_lineno = __pyx_exc_lineno;
68763           __pyx_exc_type = 0;
68764           __pyx_exc_value = 0;
68765           __pyx_exc_tb = 0;
68766           goto __pyx_L1_error;
68767         }
68768       }
68769     }
68770     goto __pyx_L19;
68771   }
68772   __pyx_L19:;
68773
68774   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
68775   goto __pyx_L0;
68776   __pyx_L1_error:;
68777   __Pyx_XDECREF(__pyx_1);
68778   __Pyx_XDECREF(__pyx_t_3);
68779   __Pyx_XDECREF(__pyx_t_7);
68780   __Pyx_XDECREF(__pyx_t_8);
68781   __Pyx_XDECREF(__pyx_t_9);
68782   __Pyx_AddTraceback("lxml.etree._FeedParser.feed");
68783   __pyx_r = NULL;
68784   __pyx_L0:;
68785   __Pyx_DECREF((PyObject *)__pyx_v_context);
68786   __Pyx_DECREF(__pyx_v_entry);
68787   __Pyx_XGIVEREF(__pyx_r);
68788   __Pyx_FinishRefcountContext();
68789   return __pyx_r;
68790 }
68791
68792 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1113
68793  *                 context.cleanup()
68794  * 
68795  *     def close(self):             # <<<<<<<<<<<<<<
68796  *         u"""close(self)
68797  * 
68798  */
68799
68800 static PyObject *__pyx_pf_4lxml_5etree_11_FeedParser_close(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
68801 static char __pyx_doc_4lxml_5etree_11_FeedParser_close[] = "close(self)\n\n        Terminates feeding data to this parser.  This tells the parser to\n        process any remaining data in the feed buffer, and then returns the\n        root Element of the tree that was parsed.\n\n        This method must be called after passing the last chunk of data into\n        the ``feed()`` method.  It should only be called when using the feed\n        parser interface, all other usage is undefined.\n        ";
68802 static PyObject *__pyx_pf_4lxml_5etree_11_FeedParser_close(PyObject *__pyx_v_self, PyObject *unused) {
68803   struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_context;
68804   xmlParserCtxt *__pyx_v_pctxt;
68805   PyObject *__pyx_v_result;
68806   PyObject *__pyx_r = NULL;
68807   PyObject *__pyx_1 = 0;
68808   int __pyx_t_1;
68809   PyObject *__pyx_t_2 = NULL;
68810   PyObject *__pyx_t_3 = NULL;
68811   int __pyx_t_4;
68812   __Pyx_SetupRefcountContext("close");
68813   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); __Pyx_INCREF(Py_None);
68814   __pyx_v_result = Py_None; __Pyx_INCREF(Py_None);
68815
68816   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1128
68817  *         cdef xmlDoc* c_doc
68818  *         cdef _Document doc
68819  *         if not self._feed_parser_running:             # <<<<<<<<<<<<<<
68820  *             raise XMLSyntaxError(u"no element found",
68821  *                                  xmlerror.XML_ERR_INTERNAL_ERROR, 0, 0)
68822  */
68823   __pyx_t_1 = (!((struct __pyx_obj_4lxml_5etree__FeedParser *)__pyx_v_self)->_feed_parser_running);
68824   if (__pyx_t_1) {
68825
68826     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1129
68827  *         cdef _Document doc
68828  *         if not self._feed_parser_running:
68829  *             raise XMLSyntaxError(u"no element found",             # <<<<<<<<<<<<<<
68830  *                                  xmlerror.XML_ERR_INTERNAL_ERROR, 0, 0)
68831  * 
68832  */
68833     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XMLSyntaxError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68834     __Pyx_GOTREF(__pyx_1);
68835
68836     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1130
68837  *         if not self._feed_parser_running:
68838  *             raise XMLSyntaxError(u"no element found",
68839  *                                  xmlerror.XML_ERR_INTERNAL_ERROR, 0, 0)             # <<<<<<<<<<<<<<
68840  * 
68841  *         context = self._getPushParserContext()
68842  */
68843     __pyx_t_2 = PyInt_FromLong(XML_ERR_INTERNAL_ERROR); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68844     __Pyx_GOTREF(__pyx_t_2);
68845     __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68846     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
68847     __Pyx_INCREF(((PyObject *)__pyx_kp_453));
68848     PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_453));
68849     __Pyx_GIVEREF(((PyObject *)__pyx_kp_453));
68850     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
68851     __Pyx_GIVEREF(__pyx_t_2);
68852     __Pyx_INCREF(__pyx_int_0);
68853     PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_int_0);
68854     __Pyx_GIVEREF(__pyx_int_0);
68855     __Pyx_INCREF(__pyx_int_0);
68856     PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_int_0);
68857     __Pyx_GIVEREF(__pyx_int_0);
68858     __pyx_t_2 = 0;
68859     __pyx_t_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68860     __Pyx_GOTREF(__pyx_t_2);
68861     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
68862     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
68863     __Pyx_Raise(__pyx_t_2, 0, 0);
68864     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
68865     {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68866     goto __pyx_L5;
68867   }
68868   __pyx_L5:;
68869
68870   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1132
68871  *                                  xmlerror.XML_ERR_INTERNAL_ERROR, 0, 0)
68872  * 
68873  *         context = self._getPushParserContext()             # <<<<<<<<<<<<<<
68874  *         pctxt = context._c_ctxt
68875  * 
68876  */
68877   __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__FeedParser *)((struct __pyx_obj_4lxml_5etree__FeedParser *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._getPushParserContext(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
68878   __Pyx_GOTREF(__pyx_t_2);
68879   __Pyx_DECREF(((PyObject *)__pyx_v_context));
68880   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_t_2);
68881   __pyx_t_2 = 0;
68882
68883   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1133
68884  * 
68885  *         context = self._getPushParserContext()
68886  *         pctxt = context._c_ctxt             # <<<<<<<<<<<<<<
68887  * 
68888  *         self._feed_parser_running = 0
68889  */
68890   __pyx_v_pctxt = __pyx_v_context->_c_ctxt;
68891
68892   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1135
68893  *         pctxt = context._c_ctxt
68894  * 
68895  *         self._feed_parser_running = 0             # <<<<<<<<<<<<<<
68896  *         if self._for_html:
68897  *             htmlparser.htmlParseChunk(pctxt, NULL, 0, 1)
68898  */
68899   ((struct __pyx_obj_4lxml_5etree__FeedParser *)__pyx_v_self)->_feed_parser_running = 0;
68900
68901   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1136
68902  * 
68903  *         self._feed_parser_running = 0
68904  *         if self._for_html:             # <<<<<<<<<<<<<<
68905  *             htmlparser.htmlParseChunk(pctxt, NULL, 0, 1)
68906  *         else:
68907  */
68908   __pyx_t_1 = ((struct __pyx_obj_4lxml_5etree__FeedParser *)__pyx_v_self)->__pyx_base._for_html;
68909   if (__pyx_t_1) {
68910
68911     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1137
68912  *         self._feed_parser_running = 0
68913  *         if self._for_html:
68914  *             htmlparser.htmlParseChunk(pctxt, NULL, 0, 1)             # <<<<<<<<<<<<<<
68915  *         else:
68916  *             xmlparser.xmlParseChunk(pctxt, NULL, 0, 1)
68917  */
68918     htmlParseChunk(__pyx_v_pctxt, NULL, 0, 1);
68919     goto __pyx_L6;
68920   }
68921   /*else*/ {
68922
68923     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1139
68924  *             htmlparser.htmlParseChunk(pctxt, NULL, 0, 1)
68925  *         else:
68926  *             xmlparser.xmlParseChunk(pctxt, NULL, 0, 1)             # <<<<<<<<<<<<<<
68927  *         try:
68928  *             result = context._handleParseResult(self, pctxt.myDoc, None)
68929  */
68930     xmlParseChunk(__pyx_v_pctxt, NULL, 0, 1);
68931   }
68932   __pyx_L6:;
68933
68934   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1140
68935  *         else:
68936  *             xmlparser.xmlParseChunk(pctxt, NULL, 0, 1)
68937  *         try:             # <<<<<<<<<<<<<<
68938  *             result = context._handleParseResult(self, pctxt.myDoc, None)
68939  *         finally:
68940  */
68941   /*try:*/ {
68942
68943     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1141
68944  *             xmlparser.xmlParseChunk(pctxt, NULL, 0, 1)
68945  *         try:
68946  *             result = context._handleParseResult(self, pctxt.myDoc, None)             # <<<<<<<<<<<<<<
68947  *         finally:
68948  *             context.cleanup()
68949  */
68950     __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->_handleParseResult(__pyx_v_context, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self), __pyx_v_pctxt->myDoc, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L8;}
68951     __Pyx_GOTREF(__pyx_t_2);
68952     __Pyx_DECREF(__pyx_v_result);
68953     __pyx_v_result = __pyx_t_2;
68954     __pyx_t_2 = 0;
68955   }
68956   /*finally:*/ {
68957     int __pyx_why;
68958     PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
68959     int __pyx_exc_lineno;
68960     __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
68961     __pyx_why = 0; goto __pyx_L9;
68962     __pyx_L8: {
68963       __pyx_why = 4;
68964       __Pyx_XDECREF(__pyx_1); __pyx_1 = 0;
68965       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
68966       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
68967       __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
68968       __pyx_exc_lineno = __pyx_lineno;
68969       goto __pyx_L9;
68970     }
68971     __pyx_L9:;
68972
68973     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1143
68974  *             result = context._handleParseResult(self, pctxt.myDoc, None)
68975  *         finally:
68976  *             context.cleanup()             # <<<<<<<<<<<<<<
68977  * 
68978  *         if isinstance(result, _Document):
68979  */
68980     __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
68981     goto __pyx_L11;
68982     __pyx_L10_error:;
68983     if (__pyx_why == 4) {
68984       Py_XDECREF(__pyx_exc_type);
68985       Py_XDECREF(__pyx_exc_value);
68986       Py_XDECREF(__pyx_exc_tb);
68987     }
68988     goto __pyx_L1_error;
68989     __pyx_L11:;
68990     switch (__pyx_why) {
68991       case 4: {
68992         __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
68993         __pyx_lineno = __pyx_exc_lineno;
68994         __pyx_exc_type = 0;
68995         __pyx_exc_value = 0;
68996         __pyx_exc_tb = 0;
68997         goto __pyx_L1_error;
68998       }
68999     }
69000   }
69001
69002   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1145
69003  *             context.cleanup()
69004  * 
69005  *         if isinstance(result, _Document):             # <<<<<<<<<<<<<<
69006  *             return (<_Document>result).getroot()
69007  *         else:
69008  */
69009   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_result, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Document))); 
69010   if (__pyx_t_1) {
69011
69012     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1146
69013  * 
69014  *         if isinstance(result, _Document):
69015  *             return (<_Document>result).getroot()             # <<<<<<<<<<<<<<
69016  *         else:
69017  *             return result
69018  */
69019     __Pyx_XDECREF(__pyx_r);
69020     __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)((struct LxmlDocument *)__pyx_v_result)->__pyx_vtab)->getroot(((struct LxmlDocument *)__pyx_v_result)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69021     __Pyx_GOTREF(__pyx_t_2);
69022     __pyx_r = __pyx_t_2;
69023     __pyx_t_2 = 0;
69024     goto __pyx_L0;
69025     goto __pyx_L12;
69026   }
69027   /*else*/ {
69028
69029     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1148
69030  *             return (<_Document>result).getroot()
69031  *         else:
69032  *             return result             # <<<<<<<<<<<<<<
69033  * 
69034  * cdef int _htmlCtxtResetPush(xmlparser.xmlParserCtxt* c_ctxt,
69035  */
69036     __Pyx_XDECREF(__pyx_r);
69037     __Pyx_INCREF(__pyx_v_result);
69038     __pyx_r = __pyx_v_result;
69039     goto __pyx_L0;
69040   }
69041   __pyx_L12:;
69042
69043   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
69044   goto __pyx_L0;
69045   __pyx_L1_error:;
69046   __Pyx_XDECREF(__pyx_1);
69047   __Pyx_XDECREF(__pyx_t_2);
69048   __Pyx_XDECREF(__pyx_t_3);
69049   __Pyx_AddTraceback("lxml.etree._FeedParser.close");
69050   __pyx_r = NULL;
69051   __pyx_L0:;
69052   __Pyx_DECREF((PyObject *)__pyx_v_context);
69053   __Pyx_DECREF(__pyx_v_result);
69054   __Pyx_XGIVEREF(__pyx_r);
69055   __Pyx_FinishRefcountContext();
69056   return __pyx_r;
69057 }
69058
69059 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1150
69060  *             return result
69061  * 
69062  * cdef int _htmlCtxtResetPush(xmlparser.xmlParserCtxt* c_ctxt,             # <<<<<<<<<<<<<<
69063  *                              char* c_data, int buffer_len,
69064  *                              char* c_encoding, int parse_options) except -1:
69065  */
69066
69067 static  int __pyx_f_4lxml_5etree__htmlCtxtResetPush(xmlParserCtxt *__pyx_v_c_ctxt, char *__pyx_v_c_data, int __pyx_v_buffer_len, char *__pyx_v_c_encoding, int __pyx_v_parse_options) {
69068   PyObject *__pyx_v_error;
69069   int __pyx_r;
69070   int __pyx_t_1;
69071   PyObject *__pyx_t_2 = NULL;
69072   int __pyx_t_3;
69073   __Pyx_SetupRefcountContext("_htmlCtxtResetPush");
69074   __pyx_v_error = Py_None; __Pyx_INCREF(Py_None);
69075
69076   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1155
69077  *     cdef xmlparser.xmlParserInput* c_input_stream
69078  *     # libxml2 crashes if spaceTab is not initialised
69079  *     if _LIBXML_VERSION_INT < 20629 and c_ctxt.spaceTab is NULL:             # <<<<<<<<<<<<<<
69080  *         c_ctxt.spaceTab = <int*>tree.xmlMalloc(10 * sizeof(int))
69081  *         c_ctxt.spaceMax = 10
69082  */
69083   if ((__pyx_v_4lxml_5etree__LIBXML_VERSION_INT < 20629)) {
69084     __pyx_t_1 = (__pyx_v_c_ctxt->spaceTab == NULL);
69085   } else {
69086     __pyx_t_1 = (__pyx_v_4lxml_5etree__LIBXML_VERSION_INT < 20629);
69087   }
69088   if (__pyx_t_1) {
69089
69090     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1156
69091  *     # libxml2 crashes if spaceTab is not initialised
69092  *     if _LIBXML_VERSION_INT < 20629 and c_ctxt.spaceTab is NULL:
69093  *         c_ctxt.spaceTab = <int*>tree.xmlMalloc(10 * sizeof(int))             # <<<<<<<<<<<<<<
69094  *         c_ctxt.spaceMax = 10
69095  * 
69096  */
69097     __pyx_v_c_ctxt->spaceTab = ((int *)xmlMalloc((10 * (sizeof(int)))));
69098
69099     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1157
69100  *     if _LIBXML_VERSION_INT < 20629 and c_ctxt.spaceTab is NULL:
69101  *         c_ctxt.spaceTab = <int*>tree.xmlMalloc(10 * sizeof(int))
69102  *         c_ctxt.spaceMax = 10             # <<<<<<<<<<<<<<
69103  * 
69104  *     # libxml2 lacks an HTML push parser setup function
69105  */
69106     __pyx_v_c_ctxt->spaceMax = 10;
69107     goto __pyx_L3;
69108   }
69109   __pyx_L3:;
69110
69111   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1160
69112  * 
69113  *     # libxml2 lacks an HTML push parser setup function
69114  *     error = xmlparser.xmlCtxtResetPush(c_ctxt, NULL, 0, NULL, c_encoding)             # <<<<<<<<<<<<<<
69115  *     if error:
69116  *         return error
69117  */
69118   __pyx_t_2 = PyInt_FromLong(xmlCtxtResetPush(__pyx_v_c_ctxt, NULL, 0, NULL, __pyx_v_c_encoding)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69119   __Pyx_GOTREF(__pyx_t_2);
69120   __Pyx_DECREF(__pyx_v_error);
69121   __pyx_v_error = __pyx_t_2;
69122   __pyx_t_2 = 0;
69123
69124   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1161
69125  *     # libxml2 lacks an HTML push parser setup function
69126  *     error = xmlparser.xmlCtxtResetPush(c_ctxt, NULL, 0, NULL, c_encoding)
69127  *     if error:             # <<<<<<<<<<<<<<
69128  *         return error
69129  * 
69130  */
69131   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_error); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69132   if (__pyx_t_1) {
69133
69134     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1162
69135  *     error = xmlparser.xmlCtxtResetPush(c_ctxt, NULL, 0, NULL, c_encoding)
69136  *     if error:
69137  *         return error             # <<<<<<<<<<<<<<
69138  * 
69139  *     # fix libxml2 setup for HTML
69140  */
69141     __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_v_error); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69142     __pyx_r = __pyx_t_3;
69143     goto __pyx_L0;
69144     goto __pyx_L4;
69145   }
69146   __pyx_L4:;
69147
69148   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1165
69149  * 
69150  *     # fix libxml2 setup for HTML
69151  *     c_ctxt.progressive = 1             # <<<<<<<<<<<<<<
69152  *     c_ctxt.html = 1
69153  *     htmlparser.htmlCtxtUseOptions(c_ctxt, parse_options)
69154  */
69155   __pyx_v_c_ctxt->progressive = 1;
69156
69157   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1166
69158  *     # fix libxml2 setup for HTML
69159  *     c_ctxt.progressive = 1
69160  *     c_ctxt.html = 1             # <<<<<<<<<<<<<<
69161  *     htmlparser.htmlCtxtUseOptions(c_ctxt, parse_options)
69162  * 
69163  */
69164   __pyx_v_c_ctxt->html = 1;
69165
69166   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1167
69167  *     c_ctxt.progressive = 1
69168  *     c_ctxt.html = 1
69169  *     htmlparser.htmlCtxtUseOptions(c_ctxt, parse_options)             # <<<<<<<<<<<<<<
69170  * 
69171  *     if c_data is not NULL and buffer_len > 0:
69172  */
69173   htmlCtxtUseOptions(__pyx_v_c_ctxt, __pyx_v_parse_options);
69174
69175   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1169
69176  *     htmlparser.htmlCtxtUseOptions(c_ctxt, parse_options)
69177  * 
69178  *     if c_data is not NULL and buffer_len > 0:             # <<<<<<<<<<<<<<
69179  *         return htmlparser.htmlParseChunk(c_ctxt, c_data, buffer_len, 0)
69180  *     return 0
69181  */
69182   if ((__pyx_v_c_data != NULL)) {
69183     __pyx_t_1 = (__pyx_v_buffer_len > 0);
69184   } else {
69185     __pyx_t_1 = (__pyx_v_c_data != NULL);
69186   }
69187   if (__pyx_t_1) {
69188
69189     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1170
69190  * 
69191  *     if c_data is not NULL and buffer_len > 0:
69192  *         return htmlparser.htmlParseChunk(c_ctxt, c_data, buffer_len, 0)             # <<<<<<<<<<<<<<
69193  *     return 0
69194  * 
69195  */
69196     __pyx_r = htmlParseChunk(__pyx_v_c_ctxt, __pyx_v_c_data, __pyx_v_buffer_len, 0);
69197     goto __pyx_L0;
69198     goto __pyx_L5;
69199   }
69200   __pyx_L5:;
69201
69202   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1171
69203  *     if c_data is not NULL and buffer_len > 0:
69204  *         return htmlparser.htmlParseChunk(c_ctxt, c_data, buffer_len, 0)
69205  *     return 0             # <<<<<<<<<<<<<<
69206  * 
69207  * ############################################################
69208  */
69209   __pyx_r = 0;
69210   goto __pyx_L0;
69211
69212   __pyx_r = 0;
69213   goto __pyx_L0;
69214   __pyx_L1_error:;
69215   __Pyx_XDECREF(__pyx_t_2);
69216   __Pyx_AddTraceback("lxml.etree._htmlCtxtResetPush");
69217   __pyx_r = -1;
69218   __pyx_L0:;
69219   __Pyx_DECREF(__pyx_v_error);
69220   __Pyx_FinishRefcountContext();
69221   return __pyx_r;
69222 }
69223
69224 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1229
69225  *     apply to the default parser.
69226  *     """
69227  *     def __init__(self, *, encoding=None, attribute_defaults=False,             # <<<<<<<<<<<<<<
69228  *                  dtd_validation=False, load_dtd=False, no_network=True,
69229  *                  ns_clean=False, recover=False, XMLSchema schema=None,
69230  */
69231
69232 static int __pyx_pf_4lxml_5etree_9XMLParser___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
69233 static int __pyx_pf_4lxml_5etree_9XMLParser___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
69234   PyObject *__pyx_v_encoding = 0;
69235   PyObject *__pyx_v_attribute_defaults = 0;
69236   PyObject *__pyx_v_dtd_validation = 0;
69237   PyObject *__pyx_v_load_dtd = 0;
69238   PyObject *__pyx_v_no_network = 0;
69239   PyObject *__pyx_v_ns_clean = 0;
69240   PyObject *__pyx_v_recover = 0;
69241   struct __pyx_obj_4lxml_5etree_XMLSchema *__pyx_v_schema = 0;
69242   PyObject *__pyx_v_huge_tree = 0;
69243   PyObject *__pyx_v_remove_blank_text = 0;
69244   PyObject *__pyx_v_resolve_entities = 0;
69245   PyObject *__pyx_v_remove_comments = 0;
69246   PyObject *__pyx_v_remove_pis = 0;
69247   PyObject *__pyx_v_strip_cdata = 0;
69248   PyObject *__pyx_v_target = 0;
69249   PyObject *__pyx_v_compact = 0;
69250   int __pyx_v_parse_options;
69251   int __pyx_r;
69252   int __pyx_t_1;
69253   int __pyx_t_2;
69254   PyObject *__pyx_t_3 = NULL;
69255   PyObject *__pyx_t_4 = NULL;
69256   PyObject *__pyx_t_5 = NULL;
69257   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_encoding,&__pyx_kp_attribute_defaults,&__pyx_kp_dtd_validation,&__pyx_kp_load_dtd,&__pyx_kp_no_network,&__pyx_kp_ns_clean,&__pyx_kp_recover,&__pyx_kp_schema,&__pyx_kp_huge_tree,&__pyx_kp_remove_blank_text,&__pyx_kp_resolve_entities,&__pyx_kp_remove_comments,&__pyx_kp_remove_pis,&__pyx_kp_strip_cdata,&__pyx_kp_target,&__pyx_kp_compact,0};
69258   __Pyx_SetupRefcountContext("__init__");
69259   if (unlikely(__pyx_kwds)) {
69260     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
69261     PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
69262     values[0] = Py_None;
69263     values[1] = __pyx_k_117;
69264     values[2] = __pyx_k_118;
69265     values[3] = __pyx_k_119;
69266     values[4] = __pyx_k_120;
69267     values[5] = __pyx_k_121;
69268     values[6] = __pyx_k_122;
69269     values[7] = (PyObject*)((struct __pyx_obj_4lxml_5etree_XMLSchema *)Py_None);
69270     values[8] = __pyx_k_123;
69271     values[9] = __pyx_k_124;
69272     values[10] = __pyx_k_125;
69273     values[11] = __pyx_k_126;
69274     values[12] = __pyx_k_127;
69275     values[13] = __pyx_k_128;
69276     values[14] = Py_None;
69277     values[15] = __pyx_k_129;
69278     switch (PyTuple_GET_SIZE(__pyx_args)) {
69279       case  0: break;
69280       default: goto __pyx_L5_argtuple_error;
69281     }
69282     while (kw_args > 0) {
69283       PyObject* value;
69284       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_encoding);
69285       if (value) { values[0] = value; if (!(--kw_args)) break; }
69286       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_attribute_defaults);
69287       if (value) { values[1] = value; if (!(--kw_args)) break; }
69288       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_dtd_validation);
69289       if (value) { values[2] = value; if (!(--kw_args)) break; }
69290       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_load_dtd);
69291       if (value) { values[3] = value; if (!(--kw_args)) break; }
69292       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_no_network);
69293       if (value) { values[4] = value; if (!(--kw_args)) break; }
69294       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_ns_clean);
69295       if (value) { values[5] = value; if (!(--kw_args)) break; }
69296       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_recover);
69297       if (value) { values[6] = value; if (!(--kw_args)) break; }
69298       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_schema);
69299       if (value) { values[7] = value; if (!(--kw_args)) break; }
69300       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_huge_tree);
69301       if (value) { values[8] = value; if (!(--kw_args)) break; }
69302       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_remove_blank_text);
69303       if (value) { values[9] = value; if (!(--kw_args)) break; }
69304       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_resolve_entities);
69305       if (value) { values[10] = value; if (!(--kw_args)) break; }
69306       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_remove_comments);
69307       if (value) { values[11] = value; if (!(--kw_args)) break; }
69308       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_remove_pis);
69309       if (value) { values[12] = value; if (!(--kw_args)) break; }
69310       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_strip_cdata);
69311       if (value) { values[13] = value; if (!(--kw_args)) break; }
69312       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_target);
69313       if (value) { values[14] = value; if (!(--kw_args)) break; }
69314       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_compact);
69315       if (value) { values[15] = value; if (!(--kw_args)) break; }
69316       break;
69317     }
69318     if (unlikely(kw_args > 0)) {
69319       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, 0, "__init__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1229; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
69320     }
69321     __pyx_v_encoding = values[0];
69322     __pyx_v_attribute_defaults = values[1];
69323     __pyx_v_dtd_validation = values[2];
69324     __pyx_v_load_dtd = values[3];
69325     __pyx_v_no_network = values[4];
69326     __pyx_v_ns_clean = values[5];
69327     __pyx_v_recover = values[6];
69328     __pyx_v_schema = ((struct __pyx_obj_4lxml_5etree_XMLSchema *)values[7]);
69329     __pyx_v_huge_tree = values[8];
69330     __pyx_v_remove_blank_text = values[9];
69331     __pyx_v_resolve_entities = values[10];
69332     __pyx_v_remove_comments = values[11];
69333     __pyx_v_remove_pis = values[12];
69334     __pyx_v_strip_cdata = values[13];
69335     __pyx_v_target = values[14];
69336     __pyx_v_compact = values[15];
69337   } else if (PyTuple_GET_SIZE(__pyx_args) != 0) {
69338     goto __pyx_L5_argtuple_error;
69339   } else {
69340     __pyx_v_encoding = Py_None;
69341     __pyx_v_attribute_defaults = __pyx_k_117;
69342     __pyx_v_dtd_validation = __pyx_k_118;
69343     __pyx_v_load_dtd = __pyx_k_119;
69344     __pyx_v_no_network = __pyx_k_120;
69345     __pyx_v_ns_clean = __pyx_k_121;
69346     __pyx_v_recover = __pyx_k_122;
69347     __pyx_v_schema = ((struct __pyx_obj_4lxml_5etree_XMLSchema *)Py_None);
69348     __pyx_v_huge_tree = __pyx_k_123;
69349     __pyx_v_remove_blank_text = __pyx_k_124;
69350     __pyx_v_resolve_entities = __pyx_k_125;
69351     __pyx_v_remove_comments = __pyx_k_126;
69352     __pyx_v_remove_pis = __pyx_k_127;
69353     __pyx_v_strip_cdata = __pyx_k_128;
69354     __pyx_v_target = Py_None;
69355     __pyx_v_compact = __pyx_k_129;
69356   }
69357   goto __pyx_L4_argument_unpacking_done;
69358   __pyx_L5_argtuple_error:;
69359   __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1229; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
69360   __pyx_L3_error:;
69361   __Pyx_AddTraceback("lxml.etree.XMLParser.__init__");
69362   return -1;
69363   __pyx_L4_argument_unpacking_done:;
69364   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_ptype_4lxml_5etree_XMLSchema, 1, "schema", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69365
69366   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1236
69367  *                  target=None, compact=True):
69368  *         cdef int parse_options
69369  *         parse_options = _XML_DEFAULT_PARSE_OPTIONS             # <<<<<<<<<<<<<<
69370  *         if load_dtd:
69371  *             parse_options = parse_options | xmlparser.XML_PARSE_DTDLOAD
69372  */
69373   __pyx_v_parse_options = __pyx_v_4lxml_5etree__XML_DEFAULT_PARSE_OPTIONS;
69374
69375   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1237
69376  *         cdef int parse_options
69377  *         parse_options = _XML_DEFAULT_PARSE_OPTIONS
69378  *         if load_dtd:             # <<<<<<<<<<<<<<
69379  *             parse_options = parse_options | xmlparser.XML_PARSE_DTDLOAD
69380  *         if dtd_validation:
69381  */
69382   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_load_dtd); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69383   if (__pyx_t_1) {
69384
69385     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1238
69386  *         parse_options = _XML_DEFAULT_PARSE_OPTIONS
69387  *         if load_dtd:
69388  *             parse_options = parse_options | xmlparser.XML_PARSE_DTDLOAD             # <<<<<<<<<<<<<<
69389  *         if dtd_validation:
69390  *             parse_options = parse_options | xmlparser.XML_PARSE_DTDVALID | \
69391  */
69392     __pyx_v_parse_options = (__pyx_v_parse_options | XML_PARSE_DTDLOAD);
69393     goto __pyx_L6;
69394   }
69395   __pyx_L6:;
69396
69397   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1239
69398  *         if load_dtd:
69399  *             parse_options = parse_options | xmlparser.XML_PARSE_DTDLOAD
69400  *         if dtd_validation:             # <<<<<<<<<<<<<<
69401  *             parse_options = parse_options | xmlparser.XML_PARSE_DTDVALID | \
69402  *                             xmlparser.XML_PARSE_DTDLOAD
69403  */
69404   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_dtd_validation); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69405   if (__pyx_t_1) {
69406
69407     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1241
69408  *         if dtd_validation:
69409  *             parse_options = parse_options | xmlparser.XML_PARSE_DTDVALID | \
69410  *                             xmlparser.XML_PARSE_DTDLOAD             # <<<<<<<<<<<<<<
69411  *         if attribute_defaults:
69412  *             parse_options = parse_options | xmlparser.XML_PARSE_DTDATTR
69413  */
69414     __pyx_v_parse_options = ((__pyx_v_parse_options | XML_PARSE_DTDVALID) | XML_PARSE_DTDLOAD);
69415     goto __pyx_L7;
69416   }
69417   __pyx_L7:;
69418
69419   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1242
69420  *             parse_options = parse_options | xmlparser.XML_PARSE_DTDVALID | \
69421  *                             xmlparser.XML_PARSE_DTDLOAD
69422  *         if attribute_defaults:             # <<<<<<<<<<<<<<
69423  *             parse_options = parse_options | xmlparser.XML_PARSE_DTDATTR
69424  *             if schema is None:
69425  */
69426   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_attribute_defaults); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69427   if (__pyx_t_1) {
69428
69429     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1243
69430  *                             xmlparser.XML_PARSE_DTDLOAD
69431  *         if attribute_defaults:
69432  *             parse_options = parse_options | xmlparser.XML_PARSE_DTDATTR             # <<<<<<<<<<<<<<
69433  *             if schema is None:
69434  *                 parse_options = parse_options | xmlparser.XML_PARSE_DTDLOAD
69435  */
69436     __pyx_v_parse_options = (__pyx_v_parse_options | XML_PARSE_DTDATTR);
69437
69438     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1244
69439  *         if attribute_defaults:
69440  *             parse_options = parse_options | xmlparser.XML_PARSE_DTDATTR
69441  *             if schema is None:             # <<<<<<<<<<<<<<
69442  *                 parse_options = parse_options | xmlparser.XML_PARSE_DTDLOAD
69443  *         if ns_clean:
69444  */
69445     __pyx_t_1 = (((PyObject *)__pyx_v_schema) == Py_None);
69446     if (__pyx_t_1) {
69447
69448       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1245
69449  *             parse_options = parse_options | xmlparser.XML_PARSE_DTDATTR
69450  *             if schema is None:
69451  *                 parse_options = parse_options | xmlparser.XML_PARSE_DTDLOAD             # <<<<<<<<<<<<<<
69452  *         if ns_clean:
69453  *             parse_options = parse_options | xmlparser.XML_PARSE_NSCLEAN
69454  */
69455       __pyx_v_parse_options = (__pyx_v_parse_options | XML_PARSE_DTDLOAD);
69456       goto __pyx_L9;
69457     }
69458     __pyx_L9:;
69459     goto __pyx_L8;
69460   }
69461   __pyx_L8:;
69462
69463   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1246
69464  *             if schema is None:
69465  *                 parse_options = parse_options | xmlparser.XML_PARSE_DTDLOAD
69466  *         if ns_clean:             # <<<<<<<<<<<<<<
69467  *             parse_options = parse_options | xmlparser.XML_PARSE_NSCLEAN
69468  *         if recover:
69469  */
69470   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ns_clean); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69471   if (__pyx_t_1) {
69472
69473     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1247
69474  *                 parse_options = parse_options | xmlparser.XML_PARSE_DTDLOAD
69475  *         if ns_clean:
69476  *             parse_options = parse_options | xmlparser.XML_PARSE_NSCLEAN             # <<<<<<<<<<<<<<
69477  *         if recover:
69478  *             parse_options = parse_options | xmlparser.XML_PARSE_RECOVER
69479  */
69480     __pyx_v_parse_options = (__pyx_v_parse_options | XML_PARSE_NSCLEAN);
69481     goto __pyx_L10;
69482   }
69483   __pyx_L10:;
69484
69485   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1248
69486  *         if ns_clean:
69487  *             parse_options = parse_options | xmlparser.XML_PARSE_NSCLEAN
69488  *         if recover:             # <<<<<<<<<<<<<<
69489  *             parse_options = parse_options | xmlparser.XML_PARSE_RECOVER
69490  *         if remove_blank_text:
69491  */
69492   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_recover); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69493   if (__pyx_t_1) {
69494
69495     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1249
69496  *             parse_options = parse_options | xmlparser.XML_PARSE_NSCLEAN
69497  *         if recover:
69498  *             parse_options = parse_options | xmlparser.XML_PARSE_RECOVER             # <<<<<<<<<<<<<<
69499  *         if remove_blank_text:
69500  *             parse_options = parse_options | xmlparser.XML_PARSE_NOBLANKS
69501  */
69502     __pyx_v_parse_options = (__pyx_v_parse_options | XML_PARSE_RECOVER);
69503     goto __pyx_L11;
69504   }
69505   __pyx_L11:;
69506
69507   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1250
69508  *         if recover:
69509  *             parse_options = parse_options | xmlparser.XML_PARSE_RECOVER
69510  *         if remove_blank_text:             # <<<<<<<<<<<<<<
69511  *             parse_options = parse_options | xmlparser.XML_PARSE_NOBLANKS
69512  *         if huge_tree:
69513  */
69514   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_remove_blank_text); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69515   if (__pyx_t_1) {
69516
69517     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1251
69518  *             parse_options = parse_options | xmlparser.XML_PARSE_RECOVER
69519  *         if remove_blank_text:
69520  *             parse_options = parse_options | xmlparser.XML_PARSE_NOBLANKS             # <<<<<<<<<<<<<<
69521  *         if huge_tree:
69522  *             parse_options = parse_options | xmlparser.XML_PARSE_HUGE
69523  */
69524     __pyx_v_parse_options = (__pyx_v_parse_options | XML_PARSE_NOBLANKS);
69525     goto __pyx_L12;
69526   }
69527   __pyx_L12:;
69528
69529   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1252
69530  *         if remove_blank_text:
69531  *             parse_options = parse_options | xmlparser.XML_PARSE_NOBLANKS
69532  *         if huge_tree:             # <<<<<<<<<<<<<<
69533  *             parse_options = parse_options | xmlparser.XML_PARSE_HUGE
69534  *         if not no_network:
69535  */
69536   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_huge_tree); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69537   if (__pyx_t_1) {
69538
69539     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1253
69540  *             parse_options = parse_options | xmlparser.XML_PARSE_NOBLANKS
69541  *         if huge_tree:
69542  *             parse_options = parse_options | xmlparser.XML_PARSE_HUGE             # <<<<<<<<<<<<<<
69543  *         if not no_network:
69544  *             parse_options = parse_options ^ xmlparser.XML_PARSE_NONET
69545  */
69546     __pyx_v_parse_options = (__pyx_v_parse_options | XML_PARSE_HUGE);
69547     goto __pyx_L13;
69548   }
69549   __pyx_L13:;
69550
69551   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1254
69552  *         if huge_tree:
69553  *             parse_options = parse_options | xmlparser.XML_PARSE_HUGE
69554  *         if not no_network:             # <<<<<<<<<<<<<<
69555  *             parse_options = parse_options ^ xmlparser.XML_PARSE_NONET
69556  *         if not compact:
69557  */
69558   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_no_network); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69559   __pyx_t_2 = (!__pyx_t_1);
69560   if (__pyx_t_2) {
69561
69562     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1255
69563  *             parse_options = parse_options | xmlparser.XML_PARSE_HUGE
69564  *         if not no_network:
69565  *             parse_options = parse_options ^ xmlparser.XML_PARSE_NONET             # <<<<<<<<<<<<<<
69566  *         if not compact:
69567  *             parse_options = parse_options ^ xmlparser.XML_PARSE_COMPACT
69568  */
69569     __pyx_v_parse_options = (__pyx_v_parse_options ^ XML_PARSE_NONET);
69570     goto __pyx_L14;
69571   }
69572   __pyx_L14:;
69573
69574   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1256
69575  *         if not no_network:
69576  *             parse_options = parse_options ^ xmlparser.XML_PARSE_NONET
69577  *         if not compact:             # <<<<<<<<<<<<<<
69578  *             parse_options = parse_options ^ xmlparser.XML_PARSE_COMPACT
69579  *         if not resolve_entities:
69580  */
69581   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_compact); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69582   __pyx_t_1 = (!__pyx_t_2);
69583   if (__pyx_t_1) {
69584
69585     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1257
69586  *             parse_options = parse_options ^ xmlparser.XML_PARSE_NONET
69587  *         if not compact:
69588  *             parse_options = parse_options ^ xmlparser.XML_PARSE_COMPACT             # <<<<<<<<<<<<<<
69589  *         if not resolve_entities:
69590  *             parse_options = parse_options ^ xmlparser.XML_PARSE_NOENT
69591  */
69592     __pyx_v_parse_options = (__pyx_v_parse_options ^ XML_PARSE_COMPACT);
69593     goto __pyx_L15;
69594   }
69595   __pyx_L15:;
69596
69597   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1258
69598  *         if not compact:
69599  *             parse_options = parse_options ^ xmlparser.XML_PARSE_COMPACT
69600  *         if not resolve_entities:             # <<<<<<<<<<<<<<
69601  *             parse_options = parse_options ^ xmlparser.XML_PARSE_NOENT
69602  *         if not strip_cdata:
69603  */
69604   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_resolve_entities); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69605   __pyx_t_2 = (!__pyx_t_1);
69606   if (__pyx_t_2) {
69607
69608     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1259
69609  *             parse_options = parse_options ^ xmlparser.XML_PARSE_COMPACT
69610  *         if not resolve_entities:
69611  *             parse_options = parse_options ^ xmlparser.XML_PARSE_NOENT             # <<<<<<<<<<<<<<
69612  *         if not strip_cdata:
69613  *             parse_options = parse_options ^ xmlparser.XML_PARSE_NOCDATA
69614  */
69615     __pyx_v_parse_options = (__pyx_v_parse_options ^ XML_PARSE_NOENT);
69616     goto __pyx_L16;
69617   }
69618   __pyx_L16:;
69619
69620   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1260
69621  *         if not resolve_entities:
69622  *             parse_options = parse_options ^ xmlparser.XML_PARSE_NOENT
69623  *         if not strip_cdata:             # <<<<<<<<<<<<<<
69624  *             parse_options = parse_options ^ xmlparser.XML_PARSE_NOCDATA
69625  * 
69626  */
69627   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_strip_cdata); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69628   __pyx_t_1 = (!__pyx_t_2);
69629   if (__pyx_t_1) {
69630
69631     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1261
69632  *             parse_options = parse_options ^ xmlparser.XML_PARSE_NOENT
69633  *         if not strip_cdata:
69634  *             parse_options = parse_options ^ xmlparser.XML_PARSE_NOCDATA             # <<<<<<<<<<<<<<
69635  * 
69636  *         _BaseParser.__init__(self, parse_options, 0, schema,
69637  */
69638     __pyx_v_parse_options = (__pyx_v_parse_options ^ XML_PARSE_NOCDATA);
69639     goto __pyx_L17;
69640   }
69641   __pyx_L17:;
69642
69643   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1263
69644  *             parse_options = parse_options ^ xmlparser.XML_PARSE_NOCDATA
69645  * 
69646  *         _BaseParser.__init__(self, parse_options, 0, schema,             # <<<<<<<<<<<<<<
69647  *                              remove_comments, remove_pis, strip_cdata,
69648  *                              target, None, encoding)
69649  */
69650   __pyx_t_3 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__BaseParser)), __pyx_kp___init__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69651   __Pyx_GOTREF(__pyx_t_3);
69652   __pyx_t_4 = PyInt_FromLong(__pyx_v_parse_options); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69653   __Pyx_GOTREF(__pyx_t_4);
69654
69655   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1265
69656  *         _BaseParser.__init__(self, parse_options, 0, schema,
69657  *                              remove_comments, remove_pis, strip_cdata,
69658  *                              target, None, encoding)             # <<<<<<<<<<<<<<
69659  * 
69660  * cdef class ETCompatXMLParser(XMLParser):
69661  */
69662   __pyx_t_5 = PyTuple_New(10); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69663   __Pyx_GOTREF(((PyObject *)__pyx_t_5));
69664   __Pyx_INCREF(__pyx_v_self);
69665   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self);
69666   __Pyx_GIVEREF(__pyx_v_self);
69667   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
69668   __Pyx_GIVEREF(__pyx_t_4);
69669   __Pyx_INCREF(__pyx_int_0);
69670   PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_0);
69671   __Pyx_GIVEREF(__pyx_int_0);
69672   __Pyx_INCREF(((PyObject *)__pyx_v_schema));
69673   PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_schema));
69674   __Pyx_GIVEREF(((PyObject *)__pyx_v_schema));
69675   __Pyx_INCREF(__pyx_v_remove_comments);
69676   PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_v_remove_comments);
69677   __Pyx_GIVEREF(__pyx_v_remove_comments);
69678   __Pyx_INCREF(__pyx_v_remove_pis);
69679   PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_v_remove_pis);
69680   __Pyx_GIVEREF(__pyx_v_remove_pis);
69681   __Pyx_INCREF(__pyx_v_strip_cdata);
69682   PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_v_strip_cdata);
69683   __Pyx_GIVEREF(__pyx_v_strip_cdata);
69684   __Pyx_INCREF(__pyx_v_target);
69685   PyTuple_SET_ITEM(__pyx_t_5, 7, __pyx_v_target);
69686   __Pyx_GIVEREF(__pyx_v_target);
69687   __Pyx_INCREF(Py_None);
69688   PyTuple_SET_ITEM(__pyx_t_5, 8, Py_None);
69689   __Pyx_GIVEREF(Py_None);
69690   __Pyx_INCREF(__pyx_v_encoding);
69691   PyTuple_SET_ITEM(__pyx_t_5, 9, __pyx_v_encoding);
69692   __Pyx_GIVEREF(__pyx_v_encoding);
69693   __pyx_t_4 = 0;
69694   __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69695   __Pyx_GOTREF(__pyx_t_4);
69696   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
69697   __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
69698   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
69699
69700   __pyx_r = 0;
69701   goto __pyx_L0;
69702   __pyx_L1_error:;
69703   __Pyx_XDECREF(__pyx_t_3);
69704   __Pyx_XDECREF(__pyx_t_4);
69705   __Pyx_XDECREF(__pyx_t_5);
69706   __Pyx_AddTraceback("lxml.etree.XMLParser.__init__");
69707   __pyx_r = -1;
69708   __pyx_L0:;
69709   __Pyx_FinishRefcountContext();
69710   return __pyx_r;
69711 }
69712
69713 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1282
69714  *     and thus ignores comments and processing instructions.
69715  *     """
69716  *     def __init__(self, *, encoding=None, attribute_defaults=False,             # <<<<<<<<<<<<<<
69717  *                  dtd_validation=False, load_dtd=False, no_network=True,
69718  *                  ns_clean=False, recover=False, schema=None,
69719  */
69720
69721 static int __pyx_pf_4lxml_5etree_17ETCompatXMLParser___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
69722 static int __pyx_pf_4lxml_5etree_17ETCompatXMLParser___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
69723   PyObject *__pyx_v_encoding = 0;
69724   PyObject *__pyx_v_attribute_defaults = 0;
69725   PyObject *__pyx_v_dtd_validation = 0;
69726   PyObject *__pyx_v_load_dtd = 0;
69727   PyObject *__pyx_v_no_network = 0;
69728   PyObject *__pyx_v_ns_clean = 0;
69729   PyObject *__pyx_v_recover = 0;
69730   PyObject *__pyx_v_schema = 0;
69731   PyObject *__pyx_v_huge_tree = 0;
69732   PyObject *__pyx_v_remove_blank_text = 0;
69733   PyObject *__pyx_v_resolve_entities = 0;
69734   PyObject *__pyx_v_remove_comments = 0;
69735   PyObject *__pyx_v_remove_pis = 0;
69736   PyObject *__pyx_v_strip_cdata = 0;
69737   PyObject *__pyx_v_target = 0;
69738   PyObject *__pyx_v_compact = 0;
69739   int __pyx_r;
69740   PyObject *__pyx_1 = 0;
69741   PyObject *__pyx_t_1 = NULL;
69742   PyObject *__pyx_t_2 = NULL;
69743   PyObject *__pyx_t_3 = NULL;
69744   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_encoding,&__pyx_kp_attribute_defaults,&__pyx_kp_dtd_validation,&__pyx_kp_load_dtd,&__pyx_kp_no_network,&__pyx_kp_ns_clean,&__pyx_kp_recover,&__pyx_kp_schema,&__pyx_kp_huge_tree,&__pyx_kp_remove_blank_text,&__pyx_kp_resolve_entities,&__pyx_kp_remove_comments,&__pyx_kp_remove_pis,&__pyx_kp_strip_cdata,&__pyx_kp_target,&__pyx_kp_compact,0};
69745   __Pyx_SetupRefcountContext("__init__");
69746   if (unlikely(__pyx_kwds)) {
69747     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
69748     PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
69749     values[0] = Py_None;
69750     values[1] = __pyx_k_130;
69751     values[2] = __pyx_k_131;
69752     values[3] = __pyx_k_132;
69753     values[4] = __pyx_k_133;
69754     values[5] = __pyx_k_134;
69755     values[6] = __pyx_k_135;
69756     values[7] = Py_None;
69757     values[8] = __pyx_k_136;
69758     values[9] = __pyx_k_137;
69759     values[10] = __pyx_k_138;
69760     values[11] = __pyx_k_139;
69761     values[12] = __pyx_k_140;
69762     values[13] = __pyx_k_141;
69763     values[14] = Py_None;
69764     values[15] = __pyx_k_142;
69765     switch (PyTuple_GET_SIZE(__pyx_args)) {
69766       case  0: break;
69767       default: goto __pyx_L5_argtuple_error;
69768     }
69769     while (kw_args > 0) {
69770       PyObject* value;
69771       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_encoding);
69772       if (value) { values[0] = value; if (!(--kw_args)) break; }
69773       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_attribute_defaults);
69774       if (value) { values[1] = value; if (!(--kw_args)) break; }
69775       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_dtd_validation);
69776       if (value) { values[2] = value; if (!(--kw_args)) break; }
69777       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_load_dtd);
69778       if (value) { values[3] = value; if (!(--kw_args)) break; }
69779       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_no_network);
69780       if (value) { values[4] = value; if (!(--kw_args)) break; }
69781       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_ns_clean);
69782       if (value) { values[5] = value; if (!(--kw_args)) break; }
69783       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_recover);
69784       if (value) { values[6] = value; if (!(--kw_args)) break; }
69785       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_schema);
69786       if (value) { values[7] = value; if (!(--kw_args)) break; }
69787       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_huge_tree);
69788       if (value) { values[8] = value; if (!(--kw_args)) break; }
69789       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_remove_blank_text);
69790       if (value) { values[9] = value; if (!(--kw_args)) break; }
69791       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_resolve_entities);
69792       if (value) { values[10] = value; if (!(--kw_args)) break; }
69793       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_remove_comments);
69794       if (value) { values[11] = value; if (!(--kw_args)) break; }
69795       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_remove_pis);
69796       if (value) { values[12] = value; if (!(--kw_args)) break; }
69797       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_strip_cdata);
69798       if (value) { values[13] = value; if (!(--kw_args)) break; }
69799       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_target);
69800       if (value) { values[14] = value; if (!(--kw_args)) break; }
69801       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_compact);
69802       if (value) { values[15] = value; if (!(--kw_args)) break; }
69803       break;
69804     }
69805     if (unlikely(kw_args > 0)) {
69806       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, 0, "__init__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1282; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
69807     }
69808     __pyx_v_encoding = values[0];
69809     __pyx_v_attribute_defaults = values[1];
69810     __pyx_v_dtd_validation = values[2];
69811     __pyx_v_load_dtd = values[3];
69812     __pyx_v_no_network = values[4];
69813     __pyx_v_ns_clean = values[5];
69814     __pyx_v_recover = values[6];
69815     __pyx_v_schema = values[7];
69816     __pyx_v_huge_tree = values[8];
69817     __pyx_v_remove_blank_text = values[9];
69818     __pyx_v_resolve_entities = values[10];
69819     __pyx_v_remove_comments = values[11];
69820     __pyx_v_remove_pis = values[12];
69821     __pyx_v_strip_cdata = values[13];
69822     __pyx_v_target = values[14];
69823     __pyx_v_compact = values[15];
69824   } else if (PyTuple_GET_SIZE(__pyx_args) != 0) {
69825     goto __pyx_L5_argtuple_error;
69826   } else {
69827     __pyx_v_encoding = Py_None;
69828     __pyx_v_attribute_defaults = __pyx_k_130;
69829     __pyx_v_dtd_validation = __pyx_k_131;
69830     __pyx_v_load_dtd = __pyx_k_132;
69831     __pyx_v_no_network = __pyx_k_133;
69832     __pyx_v_ns_clean = __pyx_k_134;
69833     __pyx_v_recover = __pyx_k_135;
69834     __pyx_v_schema = Py_None;
69835     __pyx_v_huge_tree = __pyx_k_136;
69836     __pyx_v_remove_blank_text = __pyx_k_137;
69837     __pyx_v_resolve_entities = __pyx_k_138;
69838     __pyx_v_remove_comments = __pyx_k_139;
69839     __pyx_v_remove_pis = __pyx_k_140;
69840     __pyx_v_strip_cdata = __pyx_k_141;
69841     __pyx_v_target = Py_None;
69842     __pyx_v_compact = __pyx_k_142;
69843   }
69844   goto __pyx_L4_argument_unpacking_done;
69845   __pyx_L5_argtuple_error:;
69846   __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1282; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
69847   __pyx_L3_error:;
69848   __Pyx_AddTraceback("lxml.etree.ETCompatXMLParser.__init__");
69849   return -1;
69850   __pyx_L4_argument_unpacking_done:;
69851
69852   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1288
69853  *                  remove_comments=True, remove_pis=True, strip_cdata=True,
69854  *                  target=None, compact=True):
69855  *         XMLParser.__init__(self,             # <<<<<<<<<<<<<<
69856  *                            attribute_defaults=attribute_defaults,
69857  *                            dtd_validation=dtd_validation,
69858  */
69859   __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_XMLParser)), __pyx_kp___init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69860   __Pyx_GOTREF(__pyx_t_1);
69861   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69862   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
69863   __Pyx_INCREF(__pyx_v_self);
69864   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
69865   __Pyx_GIVEREF(__pyx_v_self);
69866   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69867   __Pyx_GOTREF(((PyObject *)__pyx_1));
69868
69869   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1289
69870  *                  target=None, compact=True):
69871  *         XMLParser.__init__(self,
69872  *                            attribute_defaults=attribute_defaults,             # <<<<<<<<<<<<<<
69873  *                            dtd_validation=dtd_validation,
69874  *                            load_dtd=load_dtd,
69875  */
69876   if (PyDict_SetItem(__pyx_1, __pyx_kp_attribute_defaults, __pyx_v_attribute_defaults) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69877
69878   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1290
69879  *         XMLParser.__init__(self,
69880  *                            attribute_defaults=attribute_defaults,
69881  *                            dtd_validation=dtd_validation,             # <<<<<<<<<<<<<<
69882  *                            load_dtd=load_dtd,
69883  *                            no_network=no_network,
69884  */
69885   if (PyDict_SetItem(__pyx_1, __pyx_kp_dtd_validation, __pyx_v_dtd_validation) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69886
69887   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1291
69888  *                            attribute_defaults=attribute_defaults,
69889  *                            dtd_validation=dtd_validation,
69890  *                            load_dtd=load_dtd,             # <<<<<<<<<<<<<<
69891  *                            no_network=no_network,
69892  *                            ns_clean=ns_clean,
69893  */
69894   if (PyDict_SetItem(__pyx_1, __pyx_kp_load_dtd, __pyx_v_load_dtd) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69895
69896   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1292
69897  *                            dtd_validation=dtd_validation,
69898  *                            load_dtd=load_dtd,
69899  *                            no_network=no_network,             # <<<<<<<<<<<<<<
69900  *                            ns_clean=ns_clean,
69901  *                            recover=recover,
69902  */
69903   if (PyDict_SetItem(__pyx_1, __pyx_kp_no_network, __pyx_v_no_network) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69904
69905   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1293
69906  *                            load_dtd=load_dtd,
69907  *                            no_network=no_network,
69908  *                            ns_clean=ns_clean,             # <<<<<<<<<<<<<<
69909  *                            recover=recover,
69910  *                            remove_blank_text=remove_blank_text,
69911  */
69912   if (PyDict_SetItem(__pyx_1, __pyx_kp_ns_clean, __pyx_v_ns_clean) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69913
69914   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1294
69915  *                            no_network=no_network,
69916  *                            ns_clean=ns_clean,
69917  *                            recover=recover,             # <<<<<<<<<<<<<<
69918  *                            remove_blank_text=remove_blank_text,
69919  *                            huge_tree=huge_tree,
69920  */
69921   if (PyDict_SetItem(__pyx_1, __pyx_kp_recover, __pyx_v_recover) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69922
69923   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1295
69924  *                            ns_clean=ns_clean,
69925  *                            recover=recover,
69926  *                            remove_blank_text=remove_blank_text,             # <<<<<<<<<<<<<<
69927  *                            huge_tree=huge_tree,
69928  *                            compact=compact,
69929  */
69930   if (PyDict_SetItem(__pyx_1, __pyx_kp_remove_blank_text, __pyx_v_remove_blank_text) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69931
69932   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1296
69933  *                            recover=recover,
69934  *                            remove_blank_text=remove_blank_text,
69935  *                            huge_tree=huge_tree,             # <<<<<<<<<<<<<<
69936  *                            compact=compact,
69937  *                            resolve_entities=resolve_entities,
69938  */
69939   if (PyDict_SetItem(__pyx_1, __pyx_kp_huge_tree, __pyx_v_huge_tree) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69940
69941   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1297
69942  *                            remove_blank_text=remove_blank_text,
69943  *                            huge_tree=huge_tree,
69944  *                            compact=compact,             # <<<<<<<<<<<<<<
69945  *                            resolve_entities=resolve_entities,
69946  *                            remove_comments=remove_comments,
69947  */
69948   if (PyDict_SetItem(__pyx_1, __pyx_kp_compact, __pyx_v_compact) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69949
69950   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1298
69951  *                            huge_tree=huge_tree,
69952  *                            compact=compact,
69953  *                            resolve_entities=resolve_entities,             # <<<<<<<<<<<<<<
69954  *                            remove_comments=remove_comments,
69955  *                            remove_pis=remove_pis,
69956  */
69957   if (PyDict_SetItem(__pyx_1, __pyx_kp_resolve_entities, __pyx_v_resolve_entities) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69958
69959   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1299
69960  *                            compact=compact,
69961  *                            resolve_entities=resolve_entities,
69962  *                            remove_comments=remove_comments,             # <<<<<<<<<<<<<<
69963  *                            remove_pis=remove_pis,
69964  *                            strip_cdata=strip_cdata,
69965  */
69966   if (PyDict_SetItem(__pyx_1, __pyx_kp_remove_comments, __pyx_v_remove_comments) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69967
69968   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1300
69969  *                            resolve_entities=resolve_entities,
69970  *                            remove_comments=remove_comments,
69971  *                            remove_pis=remove_pis,             # <<<<<<<<<<<<<<
69972  *                            strip_cdata=strip_cdata,
69973  *                            target=target,
69974  */
69975   if (PyDict_SetItem(__pyx_1, __pyx_kp_remove_pis, __pyx_v_remove_pis) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69976
69977   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1301
69978  *                            remove_comments=remove_comments,
69979  *                            remove_pis=remove_pis,
69980  *                            strip_cdata=strip_cdata,             # <<<<<<<<<<<<<<
69981  *                            target=target,
69982  *                            encoding=encoding,
69983  */
69984   if (PyDict_SetItem(__pyx_1, __pyx_kp_strip_cdata, __pyx_v_strip_cdata) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69985
69986   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1302
69987  *                            remove_pis=remove_pis,
69988  *                            strip_cdata=strip_cdata,
69989  *                            target=target,             # <<<<<<<<<<<<<<
69990  *                            encoding=encoding,
69991  *                            schema=schema)
69992  */
69993   if (PyDict_SetItem(__pyx_1, __pyx_kp_target, __pyx_v_target) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
69994
69995   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1303
69996  *                            strip_cdata=strip_cdata,
69997  *                            target=target,
69998  *                            encoding=encoding,             # <<<<<<<<<<<<<<
69999  *                            schema=schema)
70000  * 
70001  */
70002   if (PyDict_SetItem(__pyx_1, __pyx_kp_encoding, __pyx_v_encoding) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70003
70004   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1304
70005  *                            target=target,
70006  *                            encoding=encoding,
70007  *                            schema=schema)             # <<<<<<<<<<<<<<
70008  * 
70009  * 
70010  */
70011   if (PyDict_SetItem(__pyx_1, __pyx_kp_schema, __pyx_v_schema) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70012   __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70013   __Pyx_GOTREF(__pyx_t_3);
70014   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
70015   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
70016   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
70017   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
70018
70019   __pyx_r = 0;
70020   goto __pyx_L0;
70021   __pyx_L1_error:;
70022   __Pyx_XDECREF(__pyx_1);
70023   __Pyx_XDECREF(__pyx_t_1);
70024   __Pyx_XDECREF(__pyx_t_2);
70025   __Pyx_XDECREF(__pyx_t_3);
70026   __Pyx_AddTraceback("lxml.etree.ETCompatXMLParser.__init__");
70027   __pyx_r = -1;
70028   __pyx_L0:;
70029   __Pyx_FinishRefcountContext();
70030   return __pyx_r;
70031 }
70032
70033 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1312
70034  * __GLOBAL_PARSER_CONTEXT.setDefaultParser(__DEFAULT_XML_PARSER)
70035  * 
70036  * def set_default_parser(_BaseParser parser=None):             # <<<<<<<<<<<<<<
70037  *     u"""set_default_parser(parser=None)
70038  * 
70039  */
70040
70041 static PyObject *__pyx_pf_4lxml_5etree_set_default_parser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
70042 static char __pyx_doc_4lxml_5etree_set_default_parser[] = "set_default_parser(parser=None)\n\n    Set a default parser for the current thread.  This parser is used\n    globally whenever no parser is supplied to the various parse functions of\n    the lxml API.  If this function is called without a parser (or if it is\n    None), the default parser is reset to the original configuration.\n\n    Note that the pre-installed default parser is not thread-safe.  Avoid the\n    default parser in multi-threaded environments.  You can create a separate\n    parser for each thread explicitly or use a parser pool.\n    ";
70043 static PyObject *__pyx_pf_4lxml_5etree_set_default_parser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
70044   struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser = 0;
70045   PyObject *__pyx_r = NULL;
70046   int __pyx_t_1;
70047   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_parser,0};
70048   __Pyx_SetupRefcountContext("set_default_parser");
70049   __pyx_self = __pyx_self;
70050   if (unlikely(__pyx_kwds)) {
70051     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
70052     PyObject* values[1] = {0};
70053     values[0] = (PyObject*)((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None);
70054     switch (PyTuple_GET_SIZE(__pyx_args)) {
70055       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
70056       case  0: break;
70057       default: goto __pyx_L5_argtuple_error;
70058     }
70059     switch (PyTuple_GET_SIZE(__pyx_args)) {
70060       case  0:
70061       if (kw_args > 0) {
70062         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_parser);
70063         if (unlikely(value)) { values[0] = value; kw_args--; }
70064       }
70065     }
70066     if (unlikely(kw_args > 0)) {
70067       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "set_default_parser") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
70068     }
70069     __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)values[0]);
70070   } else {
70071     __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None);
70072     switch (PyTuple_GET_SIZE(__pyx_args)) {
70073       case  1: __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)PyTuple_GET_ITEM(__pyx_args, 0));
70074       case  0: break;
70075       default: goto __pyx_L5_argtuple_error;
70076     }
70077   }
70078   goto __pyx_L4_argument_unpacking_done;
70079   __pyx_L5_argtuple_error:;
70080   __Pyx_RaiseArgtupleInvalid("set_default_parser", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
70081   __pyx_L3_error:;
70082   __Pyx_AddTraceback("lxml.etree.set_default_parser");
70083   return NULL;
70084   __pyx_L4_argument_unpacking_done:;
70085   __Pyx_INCREF((PyObject *)__pyx_v_parser);
70086   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70087
70088   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1324
70089  *     parser for each thread explicitly or use a parser pool.
70090  *     """
70091  *     if parser is None:             # <<<<<<<<<<<<<<
70092  *         parser = __DEFAULT_XML_PARSER
70093  *     __GLOBAL_PARSER_CONTEXT.setDefaultParser(parser)
70094  */
70095   __pyx_t_1 = (((PyObject *)__pyx_v_parser) == Py_None);
70096   if (__pyx_t_1) {
70097
70098     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1325
70099  *     """
70100  *     if parser is None:
70101  *         parser = __DEFAULT_XML_PARSER             # <<<<<<<<<<<<<<
70102  *     __GLOBAL_PARSER_CONTEXT.setDefaultParser(parser)
70103  * 
70104  */
70105     __Pyx_INCREF(((PyObject *)__pyx_v_4lxml_5etree___DEFAULT_XML_PARSER));
70106     __Pyx_DECREF(((PyObject *)__pyx_v_parser));
70107     __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_4lxml_5etree___DEFAULT_XML_PARSER);
70108     goto __pyx_L6;
70109   }
70110   __pyx_L6:;
70111
70112   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1326
70113  *     if parser is None:
70114  *         parser = __DEFAULT_XML_PARSER
70115  *     __GLOBAL_PARSER_CONTEXT.setDefaultParser(parser)             # <<<<<<<<<<<<<<
70116  * 
70117  * def get_default_parser():
70118  */
70119   ((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->setDefaultParser(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT, __pyx_v_parser);
70120
70121   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
70122   goto __pyx_L0;
70123   __pyx_L1_error:;
70124   __Pyx_AddTraceback("lxml.etree.set_default_parser");
70125   __pyx_r = NULL;
70126   __pyx_L0:;
70127   __Pyx_DECREF((PyObject *)__pyx_v_parser);
70128   __Pyx_XGIVEREF(__pyx_r);
70129   __Pyx_FinishRefcountContext();
70130   return __pyx_r;
70131 }
70132
70133 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1328
70134  *     __GLOBAL_PARSER_CONTEXT.setDefaultParser(parser)
70135  * 
70136  * def get_default_parser():             # <<<<<<<<<<<<<<
70137  *     u"get_default_parser()"
70138  *     return __GLOBAL_PARSER_CONTEXT.getDefaultParser()
70139  */
70140
70141 static PyObject *__pyx_pf_4lxml_5etree_get_default_parser(PyObject *__pyx_self, PyObject *unused); /*proto*/
70142 static char __pyx_doc_4lxml_5etree_get_default_parser[] = "get_default_parser()";
70143 static PyObject *__pyx_pf_4lxml_5etree_get_default_parser(PyObject *__pyx_self, PyObject *unused) {
70144   PyObject *__pyx_r = NULL;
70145   PyObject *__pyx_t_1 = NULL;
70146   __Pyx_SetupRefcountContext("get_default_parser");
70147   __pyx_self = __pyx_self;
70148
70149   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1330
70150  * def get_default_parser():
70151  *     u"get_default_parser()"
70152  *     return __GLOBAL_PARSER_CONTEXT.getDefaultParser()             # <<<<<<<<<<<<<<
70153  * 
70154  * ############################################################
70155  */
70156   __Pyx_XDECREF(__pyx_r);
70157   __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->getDefaultParser(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70158   __Pyx_GOTREF(__pyx_t_1);
70159   __pyx_r = __pyx_t_1;
70160   __pyx_t_1 = 0;
70161   goto __pyx_L0;
70162
70163   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
70164   goto __pyx_L0;
70165   __pyx_L1_error:;
70166   __Pyx_XDECREF(__pyx_t_1);
70167   __Pyx_AddTraceback("lxml.etree.get_default_parser");
70168   __pyx_r = NULL;
70169   __pyx_L0:;
70170   __Pyx_XGIVEREF(__pyx_r);
70171   __Pyx_FinishRefcountContext();
70172   return __pyx_r;
70173 }
70174
70175 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1375
70176  *     reasons.
70177  *     """
70178  *     def __init__(self, *, encoding=None, remove_blank_text=False,             # <<<<<<<<<<<<<<
70179  *                  remove_comments=False, remove_pis=False, strip_cdata=True,
70180  *                  no_network=True, target=None, XMLSchema schema=None,
70181  */
70182
70183 static int __pyx_pf_4lxml_5etree_10HTMLParser___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
70184 static int __pyx_pf_4lxml_5etree_10HTMLParser___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
70185   PyObject *__pyx_v_encoding = 0;
70186   PyObject *__pyx_v_remove_blank_text = 0;
70187   PyObject *__pyx_v_remove_comments = 0;
70188   PyObject *__pyx_v_remove_pis = 0;
70189   PyObject *__pyx_v_strip_cdata = 0;
70190   PyObject *__pyx_v_no_network = 0;
70191   PyObject *__pyx_v_target = 0;
70192   struct __pyx_obj_4lxml_5etree_XMLSchema *__pyx_v_schema = 0;
70193   PyObject *__pyx_v_recover = 0;
70194   PyObject *__pyx_v_compact = 0;
70195   int __pyx_v_parse_options;
70196   int __pyx_r;
70197   int __pyx_t_1;
70198   int __pyx_t_2;
70199   PyObject *__pyx_t_3 = NULL;
70200   PyObject *__pyx_t_4 = NULL;
70201   PyObject *__pyx_t_5 = NULL;
70202   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_encoding,&__pyx_kp_remove_blank_text,&__pyx_kp_remove_comments,&__pyx_kp_remove_pis,&__pyx_kp_strip_cdata,&__pyx_kp_no_network,&__pyx_kp_target,&__pyx_kp_schema,&__pyx_kp_recover,&__pyx_kp_compact,0};
70203   __Pyx_SetupRefcountContext("__init__");
70204   if (unlikely(__pyx_kwds)) {
70205     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
70206     PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
70207     values[0] = Py_None;
70208     values[1] = __pyx_k_143;
70209     values[2] = __pyx_k_144;
70210     values[3] = __pyx_k_145;
70211     values[4] = __pyx_k_146;
70212     values[5] = __pyx_k_147;
70213     values[6] = Py_None;
70214     values[7] = (PyObject*)((struct __pyx_obj_4lxml_5etree_XMLSchema *)Py_None);
70215     values[8] = __pyx_k_148;
70216     values[9] = __pyx_k_149;
70217     switch (PyTuple_GET_SIZE(__pyx_args)) {
70218       case  0: break;
70219       default: goto __pyx_L5_argtuple_error;
70220     }
70221     while (kw_args > 0) {
70222       PyObject* value;
70223       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_encoding);
70224       if (value) { values[0] = value; if (!(--kw_args)) break; }
70225       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_remove_blank_text);
70226       if (value) { values[1] = value; if (!(--kw_args)) break; }
70227       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_remove_comments);
70228       if (value) { values[2] = value; if (!(--kw_args)) break; }
70229       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_remove_pis);
70230       if (value) { values[3] = value; if (!(--kw_args)) break; }
70231       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_strip_cdata);
70232       if (value) { values[4] = value; if (!(--kw_args)) break; }
70233       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_no_network);
70234       if (value) { values[5] = value; if (!(--kw_args)) break; }
70235       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_target);
70236       if (value) { values[6] = value; if (!(--kw_args)) break; }
70237       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_schema);
70238       if (value) { values[7] = value; if (!(--kw_args)) break; }
70239       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_recover);
70240       if (value) { values[8] = value; if (!(--kw_args)) break; }
70241       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_compact);
70242       if (value) { values[9] = value; if (!(--kw_args)) break; }
70243       break;
70244     }
70245     if (unlikely(kw_args > 0)) {
70246       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, 0, "__init__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
70247     }
70248     __pyx_v_encoding = values[0];
70249     __pyx_v_remove_blank_text = values[1];
70250     __pyx_v_remove_comments = values[2];
70251     __pyx_v_remove_pis = values[3];
70252     __pyx_v_strip_cdata = values[4];
70253     __pyx_v_no_network = values[5];
70254     __pyx_v_target = values[6];
70255     __pyx_v_schema = ((struct __pyx_obj_4lxml_5etree_XMLSchema *)values[7]);
70256     __pyx_v_recover = values[8];
70257     __pyx_v_compact = values[9];
70258   } else if (PyTuple_GET_SIZE(__pyx_args) != 0) {
70259     goto __pyx_L5_argtuple_error;
70260   } else {
70261     __pyx_v_encoding = Py_None;
70262     __pyx_v_remove_blank_text = __pyx_k_143;
70263     __pyx_v_remove_comments = __pyx_k_144;
70264     __pyx_v_remove_pis = __pyx_k_145;
70265     __pyx_v_strip_cdata = __pyx_k_146;
70266     __pyx_v_no_network = __pyx_k_147;
70267     __pyx_v_target = Py_None;
70268     __pyx_v_schema = ((struct __pyx_obj_4lxml_5etree_XMLSchema *)Py_None);
70269     __pyx_v_recover = __pyx_k_148;
70270     __pyx_v_compact = __pyx_k_149;
70271   }
70272   goto __pyx_L4_argument_unpacking_done;
70273   __pyx_L5_argtuple_error:;
70274   __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
70275   __pyx_L3_error:;
70276   __Pyx_AddTraceback("lxml.etree.HTMLParser.__init__");
70277   return -1;
70278   __pyx_L4_argument_unpacking_done:;
70279   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_ptype_4lxml_5etree_XMLSchema, 1, "schema", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70280
70281   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1380
70282  *                  recover=True, compact=True):
70283  *         cdef int parse_options
70284  *         parse_options = _HTML_DEFAULT_PARSE_OPTIONS             # <<<<<<<<<<<<<<
70285  *         if remove_blank_text:
70286  *             parse_options = parse_options | htmlparser.HTML_PARSE_NOBLANKS
70287  */
70288   __pyx_v_parse_options = __pyx_v_4lxml_5etree__HTML_DEFAULT_PARSE_OPTIONS;
70289
70290   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1381
70291  *         cdef int parse_options
70292  *         parse_options = _HTML_DEFAULT_PARSE_OPTIONS
70293  *         if remove_blank_text:             # <<<<<<<<<<<<<<
70294  *             parse_options = parse_options | htmlparser.HTML_PARSE_NOBLANKS
70295  *         if not recover:
70296  */
70297   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_remove_blank_text); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70298   if (__pyx_t_1) {
70299
70300     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1382
70301  *         parse_options = _HTML_DEFAULT_PARSE_OPTIONS
70302  *         if remove_blank_text:
70303  *             parse_options = parse_options | htmlparser.HTML_PARSE_NOBLANKS             # <<<<<<<<<<<<<<
70304  *         if not recover:
70305  *             parse_options = parse_options ^ htmlparser.HTML_PARSE_RECOVER
70306  */
70307     __pyx_v_parse_options = (__pyx_v_parse_options | HTML_PARSE_NOBLANKS);
70308     goto __pyx_L6;
70309   }
70310   __pyx_L6:;
70311
70312   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1383
70313  *         if remove_blank_text:
70314  *             parse_options = parse_options | htmlparser.HTML_PARSE_NOBLANKS
70315  *         if not recover:             # <<<<<<<<<<<<<<
70316  *             parse_options = parse_options ^ htmlparser.HTML_PARSE_RECOVER
70317  *         if not no_network:
70318  */
70319   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_recover); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70320   __pyx_t_2 = (!__pyx_t_1);
70321   if (__pyx_t_2) {
70322
70323     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1384
70324  *             parse_options = parse_options | htmlparser.HTML_PARSE_NOBLANKS
70325  *         if not recover:
70326  *             parse_options = parse_options ^ htmlparser.HTML_PARSE_RECOVER             # <<<<<<<<<<<<<<
70327  *         if not no_network:
70328  *             parse_options = parse_options ^ htmlparser.HTML_PARSE_NONET
70329  */
70330     __pyx_v_parse_options = (__pyx_v_parse_options ^ HTML_PARSE_RECOVER);
70331     goto __pyx_L7;
70332   }
70333   __pyx_L7:;
70334
70335   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1385
70336  *         if not recover:
70337  *             parse_options = parse_options ^ htmlparser.HTML_PARSE_RECOVER
70338  *         if not no_network:             # <<<<<<<<<<<<<<
70339  *             parse_options = parse_options ^ htmlparser.HTML_PARSE_NONET
70340  *         if not compact:
70341  */
70342   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_no_network); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70343   __pyx_t_1 = (!__pyx_t_2);
70344   if (__pyx_t_1) {
70345
70346     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1386
70347  *             parse_options = parse_options ^ htmlparser.HTML_PARSE_RECOVER
70348  *         if not no_network:
70349  *             parse_options = parse_options ^ htmlparser.HTML_PARSE_NONET             # <<<<<<<<<<<<<<
70350  *         if not compact:
70351  *             parse_options = parse_options ^ htmlparser.HTML_PARSE_COMPACT
70352  */
70353     __pyx_v_parse_options = (__pyx_v_parse_options ^ HTML_PARSE_NONET);
70354     goto __pyx_L8;
70355   }
70356   __pyx_L8:;
70357
70358   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1387
70359  *         if not no_network:
70360  *             parse_options = parse_options ^ htmlparser.HTML_PARSE_NONET
70361  *         if not compact:             # <<<<<<<<<<<<<<
70362  *             parse_options = parse_options ^ htmlparser.HTML_PARSE_COMPACT
70363  * 
70364  */
70365   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_compact); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70366   __pyx_t_2 = (!__pyx_t_1);
70367   if (__pyx_t_2) {
70368
70369     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1388
70370  *             parse_options = parse_options ^ htmlparser.HTML_PARSE_NONET
70371  *         if not compact:
70372  *             parse_options = parse_options ^ htmlparser.HTML_PARSE_COMPACT             # <<<<<<<<<<<<<<
70373  * 
70374  *         _BaseParser.__init__(self, parse_options, 1, schema,
70375  */
70376     __pyx_v_parse_options = (__pyx_v_parse_options ^ HTML_PARSE_COMPACT);
70377     goto __pyx_L9;
70378   }
70379   __pyx_L9:;
70380
70381   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1390
70382  *             parse_options = parse_options ^ htmlparser.HTML_PARSE_COMPACT
70383  * 
70384  *         _BaseParser.__init__(self, parse_options, 1, schema,             # <<<<<<<<<<<<<<
70385  *                              remove_comments, remove_pis, strip_cdata,
70386  *                              target, None, encoding)
70387  */
70388   __pyx_t_3 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__BaseParser)), __pyx_kp___init__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70389   __Pyx_GOTREF(__pyx_t_3);
70390   __pyx_t_4 = PyInt_FromLong(__pyx_v_parse_options); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70391   __Pyx_GOTREF(__pyx_t_4);
70392
70393   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1392
70394  *         _BaseParser.__init__(self, parse_options, 1, schema,
70395  *                              remove_comments, remove_pis, strip_cdata,
70396  *                              target, None, encoding)             # <<<<<<<<<<<<<<
70397  * 
70398  * cdef HTMLParser __DEFAULT_HTML_PARSER
70399  */
70400   __pyx_t_5 = PyTuple_New(10); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70401   __Pyx_GOTREF(((PyObject *)__pyx_t_5));
70402   __Pyx_INCREF(__pyx_v_self);
70403   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self);
70404   __Pyx_GIVEREF(__pyx_v_self);
70405   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
70406   __Pyx_GIVEREF(__pyx_t_4);
70407   __Pyx_INCREF(__pyx_int_1);
70408   PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_1);
70409   __Pyx_GIVEREF(__pyx_int_1);
70410   __Pyx_INCREF(((PyObject *)__pyx_v_schema));
70411   PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_v_schema));
70412   __Pyx_GIVEREF(((PyObject *)__pyx_v_schema));
70413   __Pyx_INCREF(__pyx_v_remove_comments);
70414   PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_v_remove_comments);
70415   __Pyx_GIVEREF(__pyx_v_remove_comments);
70416   __Pyx_INCREF(__pyx_v_remove_pis);
70417   PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_v_remove_pis);
70418   __Pyx_GIVEREF(__pyx_v_remove_pis);
70419   __Pyx_INCREF(__pyx_v_strip_cdata);
70420   PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_v_strip_cdata);
70421   __Pyx_GIVEREF(__pyx_v_strip_cdata);
70422   __Pyx_INCREF(__pyx_v_target);
70423   PyTuple_SET_ITEM(__pyx_t_5, 7, __pyx_v_target);
70424   __Pyx_GIVEREF(__pyx_v_target);
70425   __Pyx_INCREF(Py_None);
70426   PyTuple_SET_ITEM(__pyx_t_5, 8, Py_None);
70427   __Pyx_GIVEREF(Py_None);
70428   __Pyx_INCREF(__pyx_v_encoding);
70429   PyTuple_SET_ITEM(__pyx_t_5, 9, __pyx_v_encoding);
70430   __Pyx_GIVEREF(__pyx_v_encoding);
70431   __pyx_t_4 = 0;
70432   __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70433   __Pyx_GOTREF(__pyx_t_4);
70434   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
70435   __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
70436   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
70437
70438   __pyx_r = 0;
70439   goto __pyx_L0;
70440   __pyx_L1_error:;
70441   __Pyx_XDECREF(__pyx_t_3);
70442   __Pyx_XDECREF(__pyx_t_4);
70443   __Pyx_XDECREF(__pyx_t_5);
70444   __Pyx_AddTraceback("lxml.etree.HTMLParser.__init__");
70445   __pyx_r = -1;
70446   __pyx_L0:;
70447   __Pyx_FinishRefcountContext();
70448   return __pyx_r;
70449 }
70450
70451 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1401
70452  * ############################################################
70453  * 
70454  * cdef xmlDoc* _parseDoc(text, filename, _BaseParser parser) except NULL:             # <<<<<<<<<<<<<<
70455  *     cdef char* c_filename
70456  *     cdef char* c_text
70457  */
70458
70459 static  xmlDoc *__pyx_f_4lxml_5etree__parseDoc(PyObject *__pyx_v_text, PyObject *__pyx_v_filename, struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser) {
70460   char *__pyx_v_c_filename;
70461   char *__pyx_v_c_text;
70462   Py_ssize_t __pyx_v_c_len;
70463   PyObject *__pyx_v_filename_utf;
70464   xmlDoc *__pyx_r;
70465   int __pyx_t_1;
70466   PyObject *__pyx_t_2 = NULL;
70467   int __pyx_t_3;
70468   PyObject *__pyx_t_4 = NULL;
70469   xmlDoc *__pyx_t_5;
70470   xmlDoc *__pyx_t_6;
70471   xmlDoc *__pyx_t_7;
70472   __Pyx_SetupRefcountContext("_parseDoc");
70473   __Pyx_INCREF((PyObject *)__pyx_v_parser);
70474   __pyx_v_filename_utf = Py_None; __Pyx_INCREF(Py_None);
70475
70476   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1405
70477  *     cdef char* c_text
70478  *     cdef Py_ssize_t c_len
70479  *     if parser is None:             # <<<<<<<<<<<<<<
70480  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
70481  *     if not filename:
70482  */
70483   __pyx_t_1 = (((PyObject *)__pyx_v_parser) == Py_None);
70484   if (__pyx_t_1) {
70485
70486     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1406
70487  *     cdef Py_ssize_t c_len
70488  *     if parser is None:
70489  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()             # <<<<<<<<<<<<<<
70490  *     if not filename:
70491  *         c_filename = NULL
70492  */
70493     __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->getDefaultParser(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70494     __Pyx_GOTREF(__pyx_t_2);
70495     __Pyx_DECREF(((PyObject *)__pyx_v_parser));
70496     __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_2);
70497     __pyx_t_2 = 0;
70498     goto __pyx_L3;
70499   }
70500   __pyx_L3:;
70501
70502   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1407
70503  *     if parser is None:
70504  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
70505  *     if not filename:             # <<<<<<<<<<<<<<
70506  *         c_filename = NULL
70507  *     else:
70508  */
70509   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_filename); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70510   __pyx_t_3 = (!__pyx_t_1);
70511   if (__pyx_t_3) {
70512
70513     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1408
70514  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
70515  *     if not filename:
70516  *         c_filename = NULL             # <<<<<<<<<<<<<<
70517  *     else:
70518  *         filename_utf = _encodeFilenameUTF8(filename)
70519  */
70520     __pyx_v_c_filename = NULL;
70521     goto __pyx_L4;
70522   }
70523   /*else*/ {
70524
70525     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1410
70526  *         c_filename = NULL
70527  *     else:
70528  *         filename_utf = _encodeFilenameUTF8(filename)             # <<<<<<<<<<<<<<
70529  *         c_filename = _cstr(filename_utf)
70530  *     if python.PyUnicode_Check(text):
70531  */
70532     __pyx_t_2 = __pyx_f_4lxml_5etree__encodeFilenameUTF8(__pyx_v_filename); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70533     __Pyx_GOTREF(__pyx_t_2);
70534     __Pyx_DECREF(__pyx_v_filename_utf);
70535     __pyx_v_filename_utf = __pyx_t_2;
70536     __pyx_t_2 = 0;
70537
70538     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1411
70539  *     else:
70540  *         filename_utf = _encodeFilenameUTF8(filename)
70541  *         c_filename = _cstr(filename_utf)             # <<<<<<<<<<<<<<
70542  *     if python.PyUnicode_Check(text):
70543  *         c_len = python.PyUnicode_GET_DATA_SIZE(text)
70544  */
70545     __pyx_v_c_filename = PyString_AS_STRING(__pyx_v_filename_utf);
70546   }
70547   __pyx_L4:;
70548
70549   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1412
70550  *         filename_utf = _encodeFilenameUTF8(filename)
70551  *         c_filename = _cstr(filename_utf)
70552  *     if python.PyUnicode_Check(text):             # <<<<<<<<<<<<<<
70553  *         c_len = python.PyUnicode_GET_DATA_SIZE(text)
70554  *         if c_len > python.INT_MAX:
70555  */
70556   __pyx_t_3 = PyUnicode_Check(__pyx_v_text);
70557   if (__pyx_t_3) {
70558
70559     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1413
70560  *         c_filename = _cstr(filename_utf)
70561  *     if python.PyUnicode_Check(text):
70562  *         c_len = python.PyUnicode_GET_DATA_SIZE(text)             # <<<<<<<<<<<<<<
70563  *         if c_len > python.INT_MAX:
70564  *             return (<_BaseParser>parser)._parseDocFromFilelike(
70565  */
70566     __pyx_v_c_len = PyUnicode_GET_DATA_SIZE(__pyx_v_text);
70567
70568     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1414
70569  *     if python.PyUnicode_Check(text):
70570  *         c_len = python.PyUnicode_GET_DATA_SIZE(text)
70571  *         if c_len > python.INT_MAX:             # <<<<<<<<<<<<<<
70572  *             return (<_BaseParser>parser)._parseDocFromFilelike(
70573  *                 StringIO(text), filename)
70574  */
70575     __pyx_t_3 = (__pyx_v_c_len > INT_MAX);
70576     if (__pyx_t_3) {
70577
70578       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1416
70579  *         if c_len > python.INT_MAX:
70580  *             return (<_BaseParser>parser)._parseDocFromFilelike(
70581  *                 StringIO(text), filename)             # <<<<<<<<<<<<<<
70582  *         return (<_BaseParser>parser)._parseUnicodeDoc(text, c_filename)
70583  *     else:
70584  */
70585       __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70586       __Pyx_GOTREF(((PyObject *)__pyx_t_2));
70587       __Pyx_INCREF(__pyx_v_text);
70588       PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_text);
70589       __Pyx_GIVEREF(__pyx_v_text);
70590       __pyx_t_4 = PyObject_Call(__pyx_v_4lxml_5etree_StringIO, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70591       __Pyx_GOTREF(__pyx_t_4);
70592       __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
70593       __pyx_t_5 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser)->__pyx_vtab)->_parseDocFromFilelike(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser), __pyx_t_4, __pyx_v_filename); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70594       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
70595       __pyx_r = __pyx_t_5;
70596       goto __pyx_L0;
70597       goto __pyx_L6;
70598     }
70599     __pyx_L6:;
70600
70601     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1417
70602  *             return (<_BaseParser>parser)._parseDocFromFilelike(
70603  *                 StringIO(text), filename)
70604  *         return (<_BaseParser>parser)._parseUnicodeDoc(text, c_filename)             # <<<<<<<<<<<<<<
70605  *     else:
70606  *         c_len = python.PyString_GET_SIZE(text)
70607  */
70608     __pyx_t_6 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser)->__pyx_vtab)->_parseUnicodeDoc(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser), __pyx_v_text, __pyx_v_c_filename); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70609     __pyx_r = __pyx_t_6;
70610     goto __pyx_L0;
70611     goto __pyx_L5;
70612   }
70613   /*else*/ {
70614
70615     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1419
70616  *         return (<_BaseParser>parser)._parseUnicodeDoc(text, c_filename)
70617  *     else:
70618  *         c_len = python.PyString_GET_SIZE(text)             # <<<<<<<<<<<<<<
70619  *         if c_len > python.INT_MAX:
70620  *             return (<_BaseParser>parser)._parseDocFromFilelike(
70621  */
70622     __pyx_v_c_len = PyString_GET_SIZE(__pyx_v_text);
70623
70624     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1420
70625  *     else:
70626  *         c_len = python.PyString_GET_SIZE(text)
70627  *         if c_len > python.INT_MAX:             # <<<<<<<<<<<<<<
70628  *             return (<_BaseParser>parser)._parseDocFromFilelike(
70629  *                 BytesIO(text), filename)
70630  */
70631     __pyx_t_3 = (__pyx_v_c_len > INT_MAX);
70632     if (__pyx_t_3) {
70633
70634       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1422
70635  *         if c_len > python.INT_MAX:
70636  *             return (<_BaseParser>parser)._parseDocFromFilelike(
70637  *                 BytesIO(text), filename)             # <<<<<<<<<<<<<<
70638  *         c_text = _cstr(text)
70639  *         return (<_BaseParser>parser)._parseDoc(c_text, c_len, c_filename)
70640  */
70641       __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70642       __Pyx_GOTREF(((PyObject *)__pyx_t_4));
70643       __Pyx_INCREF(__pyx_v_text);
70644       PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_text);
70645       __Pyx_GIVEREF(__pyx_v_text);
70646       __pyx_t_2 = PyObject_Call(__pyx_v_4lxml_5etree_BytesIO, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70647       __Pyx_GOTREF(__pyx_t_2);
70648       __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
70649       __pyx_t_5 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser)->__pyx_vtab)->_parseDocFromFilelike(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser), __pyx_t_2, __pyx_v_filename); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70650       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
70651       __pyx_r = __pyx_t_5;
70652       goto __pyx_L0;
70653       goto __pyx_L7;
70654     }
70655     __pyx_L7:;
70656
70657     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1423
70658  *             return (<_BaseParser>parser)._parseDocFromFilelike(
70659  *                 BytesIO(text), filename)
70660  *         c_text = _cstr(text)             # <<<<<<<<<<<<<<
70661  *         return (<_BaseParser>parser)._parseDoc(c_text, c_len, c_filename)
70662  * 
70663  */
70664     __pyx_v_c_text = PyString_AS_STRING(__pyx_v_text);
70665
70666     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1424
70667  *                 BytesIO(text), filename)
70668  *         c_text = _cstr(text)
70669  *         return (<_BaseParser>parser)._parseDoc(c_text, c_len, c_filename)             # <<<<<<<<<<<<<<
70670  * 
70671  * cdef xmlDoc* _parseDocFromFile(filename8, _BaseParser parser) except NULL:
70672  */
70673     __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser)->__pyx_vtab)->_parseDoc(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser), __pyx_v_c_text, __pyx_v_c_len, __pyx_v_c_filename); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70674     __pyx_r = __pyx_t_7;
70675     goto __pyx_L0;
70676   }
70677   __pyx_L5:;
70678
70679   __pyx_r = 0;
70680   goto __pyx_L0;
70681   __pyx_L1_error:;
70682   __Pyx_XDECREF(__pyx_t_2);
70683   __Pyx_XDECREF(__pyx_t_4);
70684   __Pyx_AddTraceback("lxml.etree._parseDoc");
70685   __pyx_r = NULL;
70686   __pyx_L0:;
70687   __Pyx_DECREF(__pyx_v_filename_utf);
70688   __Pyx_DECREF((PyObject *)__pyx_v_parser);
70689   __Pyx_FinishRefcountContext();
70690   return __pyx_r;
70691 }
70692
70693 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1426
70694  *         return (<_BaseParser>parser)._parseDoc(c_text, c_len, c_filename)
70695  * 
70696  * cdef xmlDoc* _parseDocFromFile(filename8, _BaseParser parser) except NULL:             # <<<<<<<<<<<<<<
70697  *     if parser is None:
70698  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
70699  */
70700
70701 static  xmlDoc *__pyx_f_4lxml_5etree__parseDocFromFile(PyObject *__pyx_v_filename8, struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser) {
70702   xmlDoc *__pyx_r;
70703   int __pyx_t_1;
70704   PyObject *__pyx_t_2 = NULL;
70705   xmlDoc *__pyx_t_3;
70706   __Pyx_SetupRefcountContext("_parseDocFromFile");
70707   __Pyx_INCREF((PyObject *)__pyx_v_parser);
70708
70709   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1427
70710  * 
70711  * cdef xmlDoc* _parseDocFromFile(filename8, _BaseParser parser) except NULL:
70712  *     if parser is None:             # <<<<<<<<<<<<<<
70713  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
70714  *     return (<_BaseParser>parser)._parseDocFromFile(_cstr(filename8))
70715  */
70716   __pyx_t_1 = (((PyObject *)__pyx_v_parser) == Py_None);
70717   if (__pyx_t_1) {
70718
70719     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1428
70720  * cdef xmlDoc* _parseDocFromFile(filename8, _BaseParser parser) except NULL:
70721  *     if parser is None:
70722  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()             # <<<<<<<<<<<<<<
70723  *     return (<_BaseParser>parser)._parseDocFromFile(_cstr(filename8))
70724  * 
70725  */
70726     __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->getDefaultParser(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70727     __Pyx_GOTREF(__pyx_t_2);
70728     __Pyx_DECREF(((PyObject *)__pyx_v_parser));
70729     __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_2);
70730     __pyx_t_2 = 0;
70731     goto __pyx_L3;
70732   }
70733   __pyx_L3:;
70734
70735   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1429
70736  *     if parser is None:
70737  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
70738  *     return (<_BaseParser>parser)._parseDocFromFile(_cstr(filename8))             # <<<<<<<<<<<<<<
70739  * 
70740  * cdef xmlDoc* _parseDocFromFilelike(source, filename,
70741  */
70742   __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser)->__pyx_vtab)->_parseDocFromFile(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser), PyString_AS_STRING(__pyx_v_filename8)); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70743   __pyx_r = __pyx_t_3;
70744   goto __pyx_L0;
70745
70746   __pyx_r = 0;
70747   goto __pyx_L0;
70748   __pyx_L1_error:;
70749   __Pyx_XDECREF(__pyx_t_2);
70750   __Pyx_AddTraceback("lxml.etree._parseDocFromFile");
70751   __pyx_r = NULL;
70752   __pyx_L0:;
70753   __Pyx_DECREF((PyObject *)__pyx_v_parser);
70754   __Pyx_FinishRefcountContext();
70755   return __pyx_r;
70756 }
70757
70758 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1431
70759  *     return (<_BaseParser>parser)._parseDocFromFile(_cstr(filename8))
70760  * 
70761  * cdef xmlDoc* _parseDocFromFilelike(source, filename,             # <<<<<<<<<<<<<<
70762  *                                    _BaseParser parser) except NULL:
70763  *     if parser is None:
70764  */
70765
70766 static  xmlDoc *__pyx_f_4lxml_5etree__parseDocFromFilelike(PyObject *__pyx_v_source, PyObject *__pyx_v_filename, struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser) {
70767   xmlDoc *__pyx_r;
70768   int __pyx_t_1;
70769   PyObject *__pyx_t_2 = NULL;
70770   xmlDoc *__pyx_t_3;
70771   __Pyx_SetupRefcountContext("_parseDocFromFilelike");
70772   __Pyx_INCREF((PyObject *)__pyx_v_parser);
70773
70774   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1433
70775  * cdef xmlDoc* _parseDocFromFilelike(source, filename,
70776  *                                    _BaseParser parser) except NULL:
70777  *     if parser is None:             # <<<<<<<<<<<<<<
70778  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
70779  *     return (<_BaseParser>parser)._parseDocFromFilelike(source, filename)
70780  */
70781   __pyx_t_1 = (((PyObject *)__pyx_v_parser) == Py_None);
70782   if (__pyx_t_1) {
70783
70784     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1434
70785  *                                    _BaseParser parser) except NULL:
70786  *     if parser is None:
70787  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()             # <<<<<<<<<<<<<<
70788  *     return (<_BaseParser>parser)._parseDocFromFilelike(source, filename)
70789  * 
70790  */
70791     __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->getDefaultParser(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70792     __Pyx_GOTREF(__pyx_t_2);
70793     __Pyx_DECREF(((PyObject *)__pyx_v_parser));
70794     __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_2);
70795     __pyx_t_2 = 0;
70796     goto __pyx_L3;
70797   }
70798   __pyx_L3:;
70799
70800   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1435
70801  *     if parser is None:
70802  *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
70803  *     return (<_BaseParser>parser)._parseDocFromFilelike(source, filename)             # <<<<<<<<<<<<<<
70804  * 
70805  * cdef xmlDoc* _newXMLDoc() except NULL:
70806  */
70807   __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser)->__pyx_vtab)->_parseDocFromFilelike(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser), __pyx_v_source, __pyx_v_filename); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70808   __pyx_r = __pyx_t_3;
70809   goto __pyx_L0;
70810
70811   __pyx_r = 0;
70812   goto __pyx_L0;
70813   __pyx_L1_error:;
70814   __Pyx_XDECREF(__pyx_t_2);
70815   __Pyx_AddTraceback("lxml.etree._parseDocFromFilelike");
70816   __pyx_r = NULL;
70817   __pyx_L0:;
70818   __Pyx_DECREF((PyObject *)__pyx_v_parser);
70819   __Pyx_FinishRefcountContext();
70820   return __pyx_r;
70821 }
70822
70823 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1437
70824  *     return (<_BaseParser>parser)._parseDocFromFilelike(source, filename)
70825  * 
70826  * cdef xmlDoc* _newXMLDoc() except NULL:             # <<<<<<<<<<<<<<
70827  *     cdef xmlDoc* result
70828  *     result = tree.xmlNewDoc(NULL)
70829  */
70830
70831 static  xmlDoc *__pyx_f_4lxml_5etree__newXMLDoc(void) {
70832   xmlDoc *__pyx_v_result;
70833   xmlDoc *__pyx_r;
70834   int __pyx_t_1;
70835   PyObject *__pyx_t_2 = NULL;
70836   __Pyx_SetupRefcountContext("_newXMLDoc");
70837
70838   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1439
70839  * cdef xmlDoc* _newXMLDoc() except NULL:
70840  *     cdef xmlDoc* result
70841  *     result = tree.xmlNewDoc(NULL)             # <<<<<<<<<<<<<<
70842  *     if result is NULL:
70843  *         python.PyErr_NoMemory()
70844  */
70845   __pyx_v_result = xmlNewDoc(NULL);
70846
70847   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1440
70848  *     cdef xmlDoc* result
70849  *     result = tree.xmlNewDoc(NULL)
70850  *     if result is NULL:             # <<<<<<<<<<<<<<
70851  *         python.PyErr_NoMemory()
70852  *     if result.encoding is NULL:
70853  */
70854   __pyx_t_1 = (__pyx_v_result == NULL);
70855   if (__pyx_t_1) {
70856
70857     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1441
70858  *     result = tree.xmlNewDoc(NULL)
70859  *     if result is NULL:
70860  *         python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
70861  *     if result.encoding is NULL:
70862  *         result.encoding = tree.xmlStrdup("UTF-8")
70863  */
70864     __pyx_t_2 = PyErr_NoMemory(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70865     __Pyx_GOTREF(__pyx_t_2);
70866     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
70867     goto __pyx_L3;
70868   }
70869   __pyx_L3:;
70870
70871   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1442
70872  *     if result is NULL:
70873  *         python.PyErr_NoMemory()
70874  *     if result.encoding is NULL:             # <<<<<<<<<<<<<<
70875  *         result.encoding = tree.xmlStrdup("UTF-8")
70876  *     __GLOBAL_PARSER_CONTEXT.initDocDict(result)
70877  */
70878   __pyx_t_1 = (__pyx_v_result->encoding == NULL);
70879   if (__pyx_t_1) {
70880
70881     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1443
70882  *         python.PyErr_NoMemory()
70883  *     if result.encoding is NULL:
70884  *         result.encoding = tree.xmlStrdup("UTF-8")             # <<<<<<<<<<<<<<
70885  *     __GLOBAL_PARSER_CONTEXT.initDocDict(result)
70886  *     return result
70887  */
70888     __pyx_v_result->encoding = xmlStrdup(__pyx_k_454);
70889     goto __pyx_L4;
70890   }
70891   __pyx_L4:;
70892
70893   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1444
70894  *     if result.encoding is NULL:
70895  *         result.encoding = tree.xmlStrdup("UTF-8")
70896  *     __GLOBAL_PARSER_CONTEXT.initDocDict(result)             # <<<<<<<<<<<<<<
70897  *     return result
70898  * 
70899  */
70900   ((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initDocDict(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT, __pyx_v_result);
70901
70902   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1445
70903  *         result.encoding = tree.xmlStrdup("UTF-8")
70904  *     __GLOBAL_PARSER_CONTEXT.initDocDict(result)
70905  *     return result             # <<<<<<<<<<<<<<
70906  * 
70907  * cdef xmlDoc* _newHTMLDoc() except NULL:
70908  */
70909   __pyx_r = __pyx_v_result;
70910   goto __pyx_L0;
70911
70912   __pyx_r = 0;
70913   goto __pyx_L0;
70914   __pyx_L1_error:;
70915   __Pyx_XDECREF(__pyx_t_2);
70916   __Pyx_AddTraceback("lxml.etree._newXMLDoc");
70917   __pyx_r = NULL;
70918   __pyx_L0:;
70919   __Pyx_FinishRefcountContext();
70920   return __pyx_r;
70921 }
70922
70923 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1447
70924  *     return result
70925  * 
70926  * cdef xmlDoc* _newHTMLDoc() except NULL:             # <<<<<<<<<<<<<<
70927  *     cdef xmlDoc* result
70928  *     result = tree.htmlNewDoc(NULL, NULL)
70929  */
70930
70931 static  xmlDoc *__pyx_f_4lxml_5etree__newHTMLDoc(void) {
70932   xmlDoc *__pyx_v_result;
70933   xmlDoc *__pyx_r;
70934   int __pyx_t_1;
70935   PyObject *__pyx_t_2 = NULL;
70936   __Pyx_SetupRefcountContext("_newHTMLDoc");
70937
70938   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1449
70939  * cdef xmlDoc* _newHTMLDoc() except NULL:
70940  *     cdef xmlDoc* result
70941  *     result = tree.htmlNewDoc(NULL, NULL)             # <<<<<<<<<<<<<<
70942  *     if result is NULL:
70943  *         python.PyErr_NoMemory()
70944  */
70945   __pyx_v_result = htmlNewDoc(NULL, NULL);
70946
70947   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1450
70948  *     cdef xmlDoc* result
70949  *     result = tree.htmlNewDoc(NULL, NULL)
70950  *     if result is NULL:             # <<<<<<<<<<<<<<
70951  *         python.PyErr_NoMemory()
70952  *     __GLOBAL_PARSER_CONTEXT.initDocDict(result)
70953  */
70954   __pyx_t_1 = (__pyx_v_result == NULL);
70955   if (__pyx_t_1) {
70956
70957     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1451
70958  *     result = tree.htmlNewDoc(NULL, NULL)
70959  *     if result is NULL:
70960  *         python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
70961  *     __GLOBAL_PARSER_CONTEXT.initDocDict(result)
70962  *     return result
70963  */
70964     __pyx_t_2 = PyErr_NoMemory(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
70965     __Pyx_GOTREF(__pyx_t_2);
70966     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
70967     goto __pyx_L3;
70968   }
70969   __pyx_L3:;
70970
70971   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1452
70972  *     if result is NULL:
70973  *         python.PyErr_NoMemory()
70974  *     __GLOBAL_PARSER_CONTEXT.initDocDict(result)             # <<<<<<<<<<<<<<
70975  *     return result
70976  * 
70977  */
70978   ((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initDocDict(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT, __pyx_v_result);
70979
70980   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1453
70981  *         python.PyErr_NoMemory()
70982  *     __GLOBAL_PARSER_CONTEXT.initDocDict(result)
70983  *     return result             # <<<<<<<<<<<<<<
70984  * 
70985  * cdef xmlDoc* _copyDoc(xmlDoc* c_doc, int recursive) except NULL:
70986  */
70987   __pyx_r = __pyx_v_result;
70988   goto __pyx_L0;
70989
70990   __pyx_r = 0;
70991   goto __pyx_L0;
70992   __pyx_L1_error:;
70993   __Pyx_XDECREF(__pyx_t_2);
70994   __Pyx_AddTraceback("lxml.etree._newHTMLDoc");
70995   __pyx_r = NULL;
70996   __pyx_L0:;
70997   __Pyx_FinishRefcountContext();
70998   return __pyx_r;
70999 }
71000
71001 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1455
71002  *     return result
71003  * 
71004  * cdef xmlDoc* _copyDoc(xmlDoc* c_doc, int recursive) except NULL:             # <<<<<<<<<<<<<<
71005  *     cdef xmlDoc* result
71006  *     if recursive:
71007  */
71008
71009 static  xmlDoc *__pyx_f_4lxml_5etree__copyDoc(xmlDoc *__pyx_v_c_doc, int __pyx_v_recursive) {
71010   xmlDoc *__pyx_v_result;
71011   xmlDoc *__pyx_r;
71012   int __pyx_t_1;
71013   int __pyx_t_2;
71014   PyObject *__pyx_t_3 = NULL;
71015   __Pyx_SetupRefcountContext("_copyDoc");
71016
71017   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1457
71018  * cdef xmlDoc* _copyDoc(xmlDoc* c_doc, int recursive) except NULL:
71019  *     cdef xmlDoc* result
71020  *     if recursive:             # <<<<<<<<<<<<<<
71021  *         with nogil:
71022  *             result = tree.xmlCopyDoc(c_doc, recursive)
71023  */
71024   __pyx_t_1 = __pyx_v_recursive;
71025   if (__pyx_t_1) {
71026
71027     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1458
71028  *     cdef xmlDoc* result
71029  *     if recursive:
71030  *         with nogil:             # <<<<<<<<<<<<<<
71031  *             result = tree.xmlCopyDoc(c_doc, recursive)
71032  *     else:
71033  */
71034     { PyThreadState *_save;
71035       Py_UNBLOCK_THREADS
71036       /*try:*/ {
71037
71038         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1459
71039  *     if recursive:
71040  *         with nogil:
71041  *             result = tree.xmlCopyDoc(c_doc, recursive)             # <<<<<<<<<<<<<<
71042  *     else:
71043  *         result = tree.xmlCopyDoc(c_doc, 0)
71044  */
71045         __pyx_v_result = xmlCopyDoc(__pyx_v_c_doc, __pyx_v_recursive);
71046       }
71047       /*finally:*/ {
71048         Py_BLOCK_THREADS
71049       }
71050     }
71051     goto __pyx_L3;
71052   }
71053   /*else*/ {
71054
71055     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1461
71056  *             result = tree.xmlCopyDoc(c_doc, recursive)
71057  *     else:
71058  *         result = tree.xmlCopyDoc(c_doc, 0)             # <<<<<<<<<<<<<<
71059  *     if result is NULL:
71060  *         python.PyErr_NoMemory()
71061  */
71062     __pyx_v_result = xmlCopyDoc(__pyx_v_c_doc, 0);
71063   }
71064   __pyx_L3:;
71065
71066   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1462
71067  *     else:
71068  *         result = tree.xmlCopyDoc(c_doc, 0)
71069  *     if result is NULL:             # <<<<<<<<<<<<<<
71070  *         python.PyErr_NoMemory()
71071  *     __GLOBAL_PARSER_CONTEXT.initDocDict(result)
71072  */
71073   __pyx_t_2 = (__pyx_v_result == NULL);
71074   if (__pyx_t_2) {
71075
71076     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1463
71077  *         result = tree.xmlCopyDoc(c_doc, 0)
71078  *     if result is NULL:
71079  *         python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
71080  *     __GLOBAL_PARSER_CONTEXT.initDocDict(result)
71081  *     return result
71082  */
71083     __pyx_t_3 = PyErr_NoMemory(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71084     __Pyx_GOTREF(__pyx_t_3);
71085     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
71086     goto __pyx_L7;
71087   }
71088   __pyx_L7:;
71089
71090   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1464
71091  *     if result is NULL:
71092  *         python.PyErr_NoMemory()
71093  *     __GLOBAL_PARSER_CONTEXT.initDocDict(result)             # <<<<<<<<<<<<<<
71094  *     return result
71095  * 
71096  */
71097   ((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initDocDict(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT, __pyx_v_result);
71098
71099   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1465
71100  *         python.PyErr_NoMemory()
71101  *     __GLOBAL_PARSER_CONTEXT.initDocDict(result)
71102  *     return result             # <<<<<<<<<<<<<<
71103  * 
71104  * cdef xmlDoc* _copyDocRoot(xmlDoc* c_doc, xmlNode* c_new_root) except NULL:
71105  */
71106   __pyx_r = __pyx_v_result;
71107   goto __pyx_L0;
71108
71109   __pyx_r = 0;
71110   goto __pyx_L0;
71111   __pyx_L1_error:;
71112   __Pyx_XDECREF(__pyx_t_3);
71113   __Pyx_AddTraceback("lxml.etree._copyDoc");
71114   __pyx_r = NULL;
71115   __pyx_L0:;
71116   __Pyx_FinishRefcountContext();
71117   return __pyx_r;
71118 }
71119
71120 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1467
71121  *     return result
71122  * 
71123  * cdef xmlDoc* _copyDocRoot(xmlDoc* c_doc, xmlNode* c_new_root) except NULL:             # <<<<<<<<<<<<<<
71124  *     u"Recursively copy the document and make c_new_root the new root node."
71125  *     cdef xmlDoc* result
71126  */
71127
71128 static  xmlDoc *__pyx_f_4lxml_5etree__copyDocRoot(xmlDoc *__pyx_v_c_doc, xmlNode *__pyx_v_c_new_root) {
71129   xmlDoc *__pyx_v_result;
71130   xmlNode *__pyx_v_c_node;
71131   xmlDoc *__pyx_r;
71132   int __pyx_t_1;
71133   PyObject *__pyx_t_2 = NULL;
71134   int __pyx_t_3;
71135   __Pyx_SetupRefcountContext("_copyDocRoot");
71136
71137   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1471
71138  *     cdef xmlDoc* result
71139  *     cdef xmlNode* c_node
71140  *     result = tree.xmlCopyDoc(c_doc, 0) # non recursive             # <<<<<<<<<<<<<<
71141  *     __GLOBAL_PARSER_CONTEXT.initDocDict(result)
71142  *     with nogil:
71143  */
71144   __pyx_v_result = xmlCopyDoc(__pyx_v_c_doc, 0);
71145
71146   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1472
71147  *     cdef xmlNode* c_node
71148  *     result = tree.xmlCopyDoc(c_doc, 0) # non recursive
71149  *     __GLOBAL_PARSER_CONTEXT.initDocDict(result)             # <<<<<<<<<<<<<<
71150  *     with nogil:
71151  *         c_node = tree.xmlDocCopyNode(c_new_root, result, 1) # recursive
71152  */
71153   ((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initDocDict(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT, __pyx_v_result);
71154
71155   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1473
71156  *     result = tree.xmlCopyDoc(c_doc, 0) # non recursive
71157  *     __GLOBAL_PARSER_CONTEXT.initDocDict(result)
71158  *     with nogil:             # <<<<<<<<<<<<<<
71159  *         c_node = tree.xmlDocCopyNode(c_new_root, result, 1) # recursive
71160  *     if c_node is NULL:
71161  */
71162   { PyThreadState *_save;
71163     Py_UNBLOCK_THREADS
71164     /*try:*/ {
71165
71166       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1474
71167  *     __GLOBAL_PARSER_CONTEXT.initDocDict(result)
71168  *     with nogil:
71169  *         c_node = tree.xmlDocCopyNode(c_new_root, result, 1) # recursive             # <<<<<<<<<<<<<<
71170  *     if c_node is NULL:
71171  *         python.PyErr_NoMemory()
71172  */
71173       __pyx_v_c_node = xmlDocCopyNode(__pyx_v_c_new_root, __pyx_v_result, 1);
71174     }
71175     /*finally:*/ {
71176       Py_BLOCK_THREADS
71177     }
71178   }
71179
71180   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1475
71181  *     with nogil:
71182  *         c_node = tree.xmlDocCopyNode(c_new_root, result, 1) # recursive
71183  *     if c_node is NULL:             # <<<<<<<<<<<<<<
71184  *         python.PyErr_NoMemory()
71185  *     tree.xmlDocSetRootElement(result, c_node)
71186  */
71187   __pyx_t_1 = (__pyx_v_c_node == NULL);
71188   if (__pyx_t_1) {
71189
71190     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1476
71191  *         c_node = tree.xmlDocCopyNode(c_new_root, result, 1) # recursive
71192  *     if c_node is NULL:
71193  *         python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
71194  *     tree.xmlDocSetRootElement(result, c_node)
71195  *     _copyTail(c_new_root.next, c_node)
71196  */
71197     __pyx_t_2 = PyErr_NoMemory(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71198     __Pyx_GOTREF(__pyx_t_2);
71199     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
71200     goto __pyx_L6;
71201   }
71202   __pyx_L6:;
71203
71204   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1477
71205  *     if c_node is NULL:
71206  *         python.PyErr_NoMemory()
71207  *     tree.xmlDocSetRootElement(result, c_node)             # <<<<<<<<<<<<<<
71208  *     _copyTail(c_new_root.next, c_node)
71209  *     return result
71210  */
71211   xmlDocSetRootElement(__pyx_v_result, __pyx_v_c_node);
71212
71213   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1478
71214  *         python.PyErr_NoMemory()
71215  *     tree.xmlDocSetRootElement(result, c_node)
71216  *     _copyTail(c_new_root.next, c_node)             # <<<<<<<<<<<<<<
71217  *     return result
71218  * 
71219  */
71220   __pyx_t_3 = __pyx_f_4lxml_5etree__copyTail(__pyx_v_c_new_root->next, __pyx_v_c_node); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71221
71222   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1479
71223  *     tree.xmlDocSetRootElement(result, c_node)
71224  *     _copyTail(c_new_root.next, c_node)
71225  *     return result             # <<<<<<<<<<<<<<
71226  * 
71227  * cdef xmlNode* _copyNodeToDoc(xmlNode* c_node, xmlDoc* c_doc) except NULL:
71228  */
71229   __pyx_r = __pyx_v_result;
71230   goto __pyx_L0;
71231
71232   __pyx_r = 0;
71233   goto __pyx_L0;
71234   __pyx_L1_error:;
71235   __Pyx_XDECREF(__pyx_t_2);
71236   __Pyx_AddTraceback("lxml.etree._copyDocRoot");
71237   __pyx_r = NULL;
71238   __pyx_L0:;
71239   __Pyx_FinishRefcountContext();
71240   return __pyx_r;
71241 }
71242
71243 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1481
71244  *     return result
71245  * 
71246  * cdef xmlNode* _copyNodeToDoc(xmlNode* c_node, xmlDoc* c_doc) except NULL:             # <<<<<<<<<<<<<<
71247  *     u"Recursively copy the element into the document. c_doc is not modified."
71248  *     cdef xmlNode* c_root
71249  */
71250
71251 static  xmlNode *__pyx_f_4lxml_5etree__copyNodeToDoc(xmlNode *__pyx_v_c_node, xmlDoc *__pyx_v_c_doc) {
71252   xmlNode *__pyx_v_c_root;
71253   xmlNode *__pyx_r;
71254   int __pyx_t_1;
71255   PyObject *__pyx_t_2 = NULL;
71256   int __pyx_t_3;
71257   __Pyx_SetupRefcountContext("_copyNodeToDoc");
71258
71259   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1484
71260  *     u"Recursively copy the element into the document. c_doc is not modified."
71261  *     cdef xmlNode* c_root
71262  *     c_root = tree.xmlDocCopyNode(c_node, c_doc, 1) # recursive             # <<<<<<<<<<<<<<
71263  *     if c_root is NULL:
71264  *         python.PyErr_NoMemory()
71265  */
71266   __pyx_v_c_root = xmlDocCopyNode(__pyx_v_c_node, __pyx_v_c_doc, 1);
71267
71268   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1485
71269  *     cdef xmlNode* c_root
71270  *     c_root = tree.xmlDocCopyNode(c_node, c_doc, 1) # recursive
71271  *     if c_root is NULL:             # <<<<<<<<<<<<<<
71272  *         python.PyErr_NoMemory()
71273  *     _copyTail(c_node.next, c_root)
71274  */
71275   __pyx_t_1 = (__pyx_v_c_root == NULL);
71276   if (__pyx_t_1) {
71277
71278     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1486
71279  *     c_root = tree.xmlDocCopyNode(c_node, c_doc, 1) # recursive
71280  *     if c_root is NULL:
71281  *         python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
71282  *     _copyTail(c_node.next, c_root)
71283  *     return c_root
71284  */
71285     __pyx_t_2 = PyErr_NoMemory(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71286     __Pyx_GOTREF(__pyx_t_2);
71287     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
71288     goto __pyx_L3;
71289   }
71290   __pyx_L3:;
71291
71292   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1487
71293  *     if c_root is NULL:
71294  *         python.PyErr_NoMemory()
71295  *     _copyTail(c_node.next, c_root)             # <<<<<<<<<<<<<<
71296  *     return c_root
71297  * 
71298  */
71299   __pyx_t_3 = __pyx_f_4lxml_5etree__copyTail(__pyx_v_c_node->next, __pyx_v_c_root); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71300
71301   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1488
71302  *         python.PyErr_NoMemory()
71303  *     _copyTail(c_node.next, c_root)
71304  *     return c_root             # <<<<<<<<<<<<<<
71305  * 
71306  * 
71307  */
71308   __pyx_r = __pyx_v_c_root;
71309   goto __pyx_L0;
71310
71311   __pyx_r = 0;
71312   goto __pyx_L0;
71313   __pyx_L1_error:;
71314   __Pyx_XDECREF(__pyx_t_2);
71315   __Pyx_AddTraceback("lxml.etree._copyNodeToDoc");
71316   __pyx_r = NULL;
71317   __pyx_L0:;
71318   __Pyx_FinishRefcountContext();
71319   return __pyx_r;
71320 }
71321
71322 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1496
71323  * ############################################################
71324  * 
71325  * cdef _Document _parseDocument(source, _BaseParser parser, base_url):             # <<<<<<<<<<<<<<
71326  *     cdef _Document doc
71327  *     if _isString(source):
71328  */
71329
71330 static  struct LxmlDocument *__pyx_f_4lxml_5etree__parseDocument(PyObject *__pyx_v_source, struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser, PyObject *__pyx_v_base_url) {
71331   struct LxmlDocument *__pyx_v_doc;
71332   PyObject *__pyx_v_url;
71333   struct LxmlDocument *__pyx_r = NULL;
71334   int __pyx_t_1;
71335   PyObject *__pyx_t_2 = NULL;
71336   PyObject *__pyx_t_3 = NULL;
71337   int __pyx_t_4;
71338   int __pyx_t_5;
71339   PyObject *__pyx_t_6 = NULL;
71340   __Pyx_SetupRefcountContext("_parseDocument");
71341   __Pyx_INCREF(__pyx_v_base_url);
71342   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
71343   __pyx_v_url = Py_None; __Pyx_INCREF(Py_None);
71344
71345   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1498
71346  * cdef _Document _parseDocument(source, _BaseParser parser, base_url):
71347  *     cdef _Document doc
71348  *     if _isString(source):             # <<<<<<<<<<<<<<
71349  *         # parse the file directly from the filesystem
71350  *         doc = _parseDocumentFromURL(_encodeFilename(source), parser)
71351  */
71352   __pyx_t_1 = _isString(__pyx_v_source);
71353   if (__pyx_t_1) {
71354
71355     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1500
71356  *     if _isString(source):
71357  *         # parse the file directly from the filesystem
71358  *         doc = _parseDocumentFromURL(_encodeFilename(source), parser)             # <<<<<<<<<<<<<<
71359  *         # fix base URL if requested
71360  *         if base_url is not None:
71361  */
71362     __pyx_t_2 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_source); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71363     __Pyx_GOTREF(__pyx_t_2);
71364     __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__parseDocumentFromURL(__pyx_t_2, __pyx_v_parser)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71365     __Pyx_GOTREF(__pyx_t_3);
71366     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
71367     __Pyx_DECREF(((PyObject *)__pyx_v_doc));
71368     __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_3);
71369     __pyx_t_3 = 0;
71370
71371     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1502
71372  *         doc = _parseDocumentFromURL(_encodeFilename(source), parser)
71373  *         # fix base URL if requested
71374  *         if base_url is not None:             # <<<<<<<<<<<<<<
71375  *             base_url = _encodeFilenameUTF8(base_url)
71376  *             if doc._c_doc.URL is not NULL:
71377  */
71378     __pyx_t_1 = (__pyx_v_base_url != Py_None);
71379     if (__pyx_t_1) {
71380
71381       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1503
71382  *         # fix base URL if requested
71383  *         if base_url is not None:
71384  *             base_url = _encodeFilenameUTF8(base_url)             # <<<<<<<<<<<<<<
71385  *             if doc._c_doc.URL is not NULL:
71386  *                 tree.xmlFree(doc._c_doc.URL)
71387  */
71388       __pyx_t_3 = __pyx_f_4lxml_5etree__encodeFilenameUTF8(__pyx_v_base_url); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71389       __Pyx_GOTREF(__pyx_t_3);
71390       __Pyx_DECREF(__pyx_v_base_url);
71391       __pyx_v_base_url = __pyx_t_3;
71392       __pyx_t_3 = 0;
71393
71394       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1504
71395  *         if base_url is not None:
71396  *             base_url = _encodeFilenameUTF8(base_url)
71397  *             if doc._c_doc.URL is not NULL:             # <<<<<<<<<<<<<<
71398  *                 tree.xmlFree(doc._c_doc.URL)
71399  *             doc._c_doc.URL = tree.xmlStrdup(_cstr(base_url))
71400  */
71401       __pyx_t_1 = (__pyx_v_doc->_c_doc->URL != NULL);
71402       if (__pyx_t_1) {
71403
71404         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1505
71405  *             base_url = _encodeFilenameUTF8(base_url)
71406  *             if doc._c_doc.URL is not NULL:
71407  *                 tree.xmlFree(doc._c_doc.URL)             # <<<<<<<<<<<<<<
71408  *             doc._c_doc.URL = tree.xmlStrdup(_cstr(base_url))
71409  *         return doc
71410  */
71411         xmlFree(__pyx_v_doc->_c_doc->URL);
71412         goto __pyx_L5;
71413       }
71414       __pyx_L5:;
71415
71416       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1506
71417  *             if doc._c_doc.URL is not NULL:
71418  *                 tree.xmlFree(doc._c_doc.URL)
71419  *             doc._c_doc.URL = tree.xmlStrdup(_cstr(base_url))             # <<<<<<<<<<<<<<
71420  *         return doc
71421  * 
71422  */
71423       __pyx_v_doc->_c_doc->URL = xmlStrdup(PyString_AS_STRING(__pyx_v_base_url));
71424       goto __pyx_L4;
71425     }
71426     __pyx_L4:;
71427
71428     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1507
71429  *                 tree.xmlFree(doc._c_doc.URL)
71430  *             doc._c_doc.URL = tree.xmlStrdup(_cstr(base_url))
71431  *         return doc             # <<<<<<<<<<<<<<
71432  * 
71433  *     if base_url is not None:
71434  */
71435     __Pyx_XDECREF(((PyObject *)__pyx_r));
71436     __Pyx_INCREF(((PyObject *)__pyx_v_doc));
71437     __pyx_r = __pyx_v_doc;
71438     goto __pyx_L0;
71439     goto __pyx_L3;
71440   }
71441   __pyx_L3:;
71442
71443   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1509
71444  *         return doc
71445  * 
71446  *     if base_url is not None:             # <<<<<<<<<<<<<<
71447  *         url = base_url
71448  *     else:
71449  */
71450   __pyx_t_1 = (__pyx_v_base_url != Py_None);
71451   if (__pyx_t_1) {
71452
71453     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1510
71454  * 
71455  *     if base_url is not None:
71456  *         url = base_url             # <<<<<<<<<<<<<<
71457  *     else:
71458  *         url = _getFilenameForFile(source)
71459  */
71460     __Pyx_INCREF(__pyx_v_base_url);
71461     __Pyx_DECREF(__pyx_v_url);
71462     __pyx_v_url = __pyx_v_base_url;
71463     goto __pyx_L6;
71464   }
71465   /*else*/ {
71466
71467     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1512
71468  *         url = base_url
71469  *     else:
71470  *         url = _getFilenameForFile(source)             # <<<<<<<<<<<<<<
71471  * 
71472  *     if hasattr(source, u'getvalue') and hasattr(source, u'tell'):
71473  */
71474     __pyx_t_3 = __pyx_f_4lxml_5etree__getFilenameForFile(__pyx_v_source); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71475     __Pyx_GOTREF(__pyx_t_3);
71476     __Pyx_DECREF(__pyx_v_url);
71477     __pyx_v_url = __pyx_t_3;
71478     __pyx_t_3 = 0;
71479   }
71480   __pyx_L6:;
71481
71482   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1514
71483  *         url = _getFilenameForFile(source)
71484  * 
71485  *     if hasattr(source, u'getvalue') and hasattr(source, u'tell'):             # <<<<<<<<<<<<<<
71486  *         # StringIO - reading from start?
71487  *         if source.tell() == 0:
71488  */
71489   __pyx_t_1 = PyObject_HasAttr(__pyx_v_source, ((PyObject *)__pyx_kp_455)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71490   if (__pyx_t_1) {
71491     __pyx_t_4 = PyObject_HasAttr(__pyx_v_source, ((PyObject *)__pyx_kp_456)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71492     __pyx_t_5 = __pyx_t_4;
71493   } else {
71494     __pyx_t_5 = __pyx_t_1;
71495   }
71496   if (__pyx_t_5) {
71497
71498     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1516
71499  *     if hasattr(source, u'getvalue') and hasattr(source, u'tell'):
71500  *         # StringIO - reading from start?
71501  *         if source.tell() == 0:             # <<<<<<<<<<<<<<
71502  *             return _parseMemoryDocument(
71503  *                 source.getvalue(), _encodeFilenameUTF8(url), parser)
71504  */
71505     __pyx_t_3 = PyObject_GetAttr(__pyx_v_source, __pyx_kp_tell); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71506     __Pyx_GOTREF(__pyx_t_3);
71507     __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71508     __Pyx_GOTREF(__pyx_t_2);
71509     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
71510     __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71511     __Pyx_GOTREF(__pyx_t_3);
71512     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
71513     __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71514     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
71515     if (__pyx_t_5) {
71516
71517       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1517
71518  *         # StringIO - reading from start?
71519  *         if source.tell() == 0:
71520  *             return _parseMemoryDocument(             # <<<<<<<<<<<<<<
71521  *                 source.getvalue(), _encodeFilenameUTF8(url), parser)
71522  * 
71523  */
71524       __Pyx_XDECREF(((PyObject *)__pyx_r));
71525
71526       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1518
71527  *         if source.tell() == 0:
71528  *             return _parseMemoryDocument(
71529  *                 source.getvalue(), _encodeFilenameUTF8(url), parser)             # <<<<<<<<<<<<<<
71530  * 
71531  *     # Support for file-like objects (urlgrabber.urlopen, ...)
71532  */
71533       __pyx_t_3 = PyObject_GetAttr(__pyx_v_source, __pyx_kp_getvalue); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71534       __Pyx_GOTREF(__pyx_t_3);
71535       __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71536       __Pyx_GOTREF(__pyx_t_2);
71537       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
71538       __pyx_t_3 = __pyx_f_4lxml_5etree__encodeFilenameUTF8(__pyx_v_url); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71539       __Pyx_GOTREF(__pyx_t_3);
71540       __pyx_t_6 = ((PyObject *)__pyx_f_4lxml_5etree__parseMemoryDocument(__pyx_t_2, __pyx_t_3, __pyx_v_parser)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71541       __Pyx_GOTREF(__pyx_t_6);
71542       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
71543       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
71544       __pyx_r = ((struct LxmlDocument *)__pyx_t_6);
71545       __pyx_t_6 = 0;
71546       goto __pyx_L0;
71547       goto __pyx_L8;
71548     }
71549     __pyx_L8:;
71550     goto __pyx_L7;
71551   }
71552   __pyx_L7:;
71553
71554   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1521
71555  * 
71556  *     # Support for file-like objects (urlgrabber.urlopen, ...)
71557  *     if hasattr(source, u'read'):             # <<<<<<<<<<<<<<
71558  *         return _parseFilelikeDocument(
71559  *             source, _encodeFilenameUTF8(url), parser)
71560  */
71561   __pyx_t_5 = PyObject_HasAttr(__pyx_v_source, ((PyObject *)__pyx_kp_457)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71562   if (__pyx_t_5) {
71563
71564     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1522
71565  *     # Support for file-like objects (urlgrabber.urlopen, ...)
71566  *     if hasattr(source, u'read'):
71567  *         return _parseFilelikeDocument(             # <<<<<<<<<<<<<<
71568  *             source, _encodeFilenameUTF8(url), parser)
71569  * 
71570  */
71571     __Pyx_XDECREF(((PyObject *)__pyx_r));
71572
71573     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1523
71574  *     if hasattr(source, u'read'):
71575  *         return _parseFilelikeDocument(
71576  *             source, _encodeFilenameUTF8(url), parser)             # <<<<<<<<<<<<<<
71577  * 
71578  *     raise TypeError, u"cannot parse from '%s'" % funicode(python._fqtypename(source))
71579  */
71580     __pyx_t_6 = __pyx_f_4lxml_5etree__encodeFilenameUTF8(__pyx_v_url); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71581     __Pyx_GOTREF(__pyx_t_6);
71582     __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__parseFilelikeDocument(__pyx_v_source, __pyx_t_6, __pyx_v_parser)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71583     __Pyx_GOTREF(__pyx_t_3);
71584     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
71585     __pyx_r = ((struct LxmlDocument *)__pyx_t_3);
71586     __pyx_t_3 = 0;
71587     goto __pyx_L0;
71588     goto __pyx_L9;
71589   }
71590   __pyx_L9:;
71591
71592   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1525
71593  *             source, _encodeFilenameUTF8(url), parser)
71594  * 
71595  *     raise TypeError, u"cannot parse from '%s'" % funicode(python._fqtypename(source))             # <<<<<<<<<<<<<<
71596  * 
71597  * cdef _Document _parseDocumentFromURL(url, _BaseParser parser):
71598  */
71599   __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(_fqtypename(__pyx_v_source)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71600   __Pyx_GOTREF(__pyx_t_3);
71601   __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_458), __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71602   __Pyx_GOTREF(__pyx_t_6);
71603   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
71604   __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_6, 0);
71605   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
71606   {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71607
71608   __pyx_r = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
71609   goto __pyx_L0;
71610   __pyx_L1_error:;
71611   __Pyx_XDECREF(__pyx_t_2);
71612   __Pyx_XDECREF(__pyx_t_3);
71613   __Pyx_XDECREF(__pyx_t_6);
71614   __Pyx_AddTraceback("lxml.etree._parseDocument");
71615   __pyx_r = 0;
71616   __pyx_L0:;
71617   __Pyx_DECREF((PyObject *)__pyx_v_doc);
71618   __Pyx_DECREF(__pyx_v_url);
71619   __Pyx_DECREF(__pyx_v_base_url);
71620   __Pyx_XGIVEREF((PyObject *)__pyx_r);
71621   __Pyx_FinishRefcountContext();
71622   return __pyx_r;
71623 }
71624
71625 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1527
71626  *     raise TypeError, u"cannot parse from '%s'" % funicode(python._fqtypename(source))
71627  * 
71628  * cdef _Document _parseDocumentFromURL(url, _BaseParser parser):             # <<<<<<<<<<<<<<
71629  *     cdef xmlDoc* c_doc
71630  *     c_doc = _parseDocFromFile(url, parser)
71631  */
71632
71633 static  struct LxmlDocument *__pyx_f_4lxml_5etree__parseDocumentFromURL(PyObject *__pyx_v_url, struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser) {
71634   xmlDoc *__pyx_v_c_doc;
71635   struct LxmlDocument *__pyx_r = NULL;
71636   xmlDoc *__pyx_t_1;
71637   PyObject *__pyx_t_2 = NULL;
71638   __Pyx_SetupRefcountContext("_parseDocumentFromURL");
71639
71640   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1529
71641  * cdef _Document _parseDocumentFromURL(url, _BaseParser parser):
71642  *     cdef xmlDoc* c_doc
71643  *     c_doc = _parseDocFromFile(url, parser)             # <<<<<<<<<<<<<<
71644  *     return _documentFactory(c_doc, parser)
71645  * 
71646  */
71647   __pyx_t_1 = __pyx_f_4lxml_5etree__parseDocFromFile(__pyx_v_url, __pyx_v_parser); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71648   __pyx_v_c_doc = __pyx_t_1;
71649
71650   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1530
71651  *     cdef xmlDoc* c_doc
71652  *     c_doc = _parseDocFromFile(url, parser)
71653  *     return _documentFactory(c_doc, parser)             # <<<<<<<<<<<<<<
71654  * 
71655  * cdef _Document _parseMemoryDocument(text, url, _BaseParser parser):
71656  */
71657   __Pyx_XDECREF(((PyObject *)__pyx_r));
71658   __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, __pyx_v_parser)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71659   __Pyx_GOTREF(__pyx_t_2);
71660   __pyx_r = ((struct LxmlDocument *)__pyx_t_2);
71661   __pyx_t_2 = 0;
71662   goto __pyx_L0;
71663
71664   __pyx_r = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
71665   goto __pyx_L0;
71666   __pyx_L1_error:;
71667   __Pyx_XDECREF(__pyx_t_2);
71668   __Pyx_AddTraceback("lxml.etree._parseDocumentFromURL");
71669   __pyx_r = 0;
71670   __pyx_L0:;
71671   __Pyx_XGIVEREF((PyObject *)__pyx_r);
71672   __Pyx_FinishRefcountContext();
71673   return __pyx_r;
71674 }
71675
71676 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1532
71677  *     return _documentFactory(c_doc, parser)
71678  * 
71679  * cdef _Document _parseMemoryDocument(text, url, _BaseParser parser):             # <<<<<<<<<<<<<<
71680  *     cdef xmlDoc* c_doc
71681  *     if python.PyUnicode_Check(text):
71682  */
71683
71684 static  struct LxmlDocument *__pyx_f_4lxml_5etree__parseMemoryDocument(PyObject *__pyx_v_text, PyObject *__pyx_v_url, struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser) {
71685   xmlDoc *__pyx_v_c_doc;
71686   struct LxmlDocument *__pyx_r = NULL;
71687   int __pyx_t_1;
71688   int __pyx_t_2;
71689   PyObject *__pyx_t_3 = NULL;
71690   xmlDoc *__pyx_t_4;
71691   __Pyx_SetupRefcountContext("_parseMemoryDocument");
71692   __Pyx_INCREF(__pyx_v_text);
71693   __Pyx_INCREF(__pyx_v_url);
71694
71695   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1534
71696  * cdef _Document _parseMemoryDocument(text, url, _BaseParser parser):
71697  *     cdef xmlDoc* c_doc
71698  *     if python.PyUnicode_Check(text):             # <<<<<<<<<<<<<<
71699  *         if _hasEncodingDeclaration(text):
71700  *             raise ValueError, \
71701  */
71702   __pyx_t_1 = PyUnicode_Check(__pyx_v_text);
71703   if (__pyx_t_1) {
71704
71705     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1535
71706  *     cdef xmlDoc* c_doc
71707  *     if python.PyUnicode_Check(text):
71708  *         if _hasEncodingDeclaration(text):             # <<<<<<<<<<<<<<
71709  *             raise ValueError, \
71710  *                 u"Unicode strings with encoding declaration are not supported."
71711  */
71712     __pyx_t_2 = __pyx_f_4lxml_5etree__hasEncodingDeclaration(__pyx_v_text);
71713     if (__pyx_t_2) {
71714
71715       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1537
71716  *         if _hasEncodingDeclaration(text):
71717  *             raise ValueError, \
71718  *                 u"Unicode strings with encoding declaration are not supported."             # <<<<<<<<<<<<<<
71719  *         # pass native unicode only if libxml2 can handle it
71720  *         if _UNICODE_ENCODING is NULL:
71721  */
71722       __Pyx_Raise(__pyx_builtin_ValueError, ((PyObject *)__pyx_kp_459), 0);
71723       {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71724       goto __pyx_L4;
71725     }
71726     __pyx_L4:;
71727
71728     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1539
71729  *                 u"Unicode strings with encoding declaration are not supported."
71730  *         # pass native unicode only if libxml2 can handle it
71731  *         if _UNICODE_ENCODING is NULL:             # <<<<<<<<<<<<<<
71732  *             text = python.PyUnicode_AsUTF8String(text)
71733  *     elif not python.PyString_Check(text):
71734  */
71735     __pyx_t_1 = (__pyx_v_4lxml_5etree__UNICODE_ENCODING == NULL);
71736     if (__pyx_t_1) {
71737
71738       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1540
71739  *         # pass native unicode only if libxml2 can handle it
71740  *         if _UNICODE_ENCODING is NULL:
71741  *             text = python.PyUnicode_AsUTF8String(text)             # <<<<<<<<<<<<<<
71742  *     elif not python.PyString_Check(text):
71743  *         raise ValueError, u"can only parse strings"
71744  */
71745       __pyx_t_3 = PyUnicode_AsUTF8String(__pyx_v_text); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71746       __Pyx_GOTREF(__pyx_t_3);
71747       __Pyx_DECREF(__pyx_v_text);
71748       __pyx_v_text = __pyx_t_3;
71749       __pyx_t_3 = 0;
71750       goto __pyx_L5;
71751     }
71752     __pyx_L5:;
71753     goto __pyx_L3;
71754   }
71755
71756   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1541
71757  *         if _UNICODE_ENCODING is NULL:
71758  *             text = python.PyUnicode_AsUTF8String(text)
71759  *     elif not python.PyString_Check(text):             # <<<<<<<<<<<<<<
71760  *         raise ValueError, u"can only parse strings"
71761  *     if python.PyUnicode_Check(url):
71762  */
71763   __pyx_t_1 = (!PyString_Check(__pyx_v_text));
71764   if (__pyx_t_1) {
71765
71766     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1542
71767  *             text = python.PyUnicode_AsUTF8String(text)
71768  *     elif not python.PyString_Check(text):
71769  *         raise ValueError, u"can only parse strings"             # <<<<<<<<<<<<<<
71770  *     if python.PyUnicode_Check(url):
71771  *         url = python.PyUnicode_AsUTF8String(url)
71772  */
71773     __Pyx_Raise(__pyx_builtin_ValueError, ((PyObject *)__pyx_kp_460), 0);
71774     {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71775     goto __pyx_L3;
71776   }
71777   __pyx_L3:;
71778
71779   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1543
71780  *     elif not python.PyString_Check(text):
71781  *         raise ValueError, u"can only parse strings"
71782  *     if python.PyUnicode_Check(url):             # <<<<<<<<<<<<<<
71783  *         url = python.PyUnicode_AsUTF8String(url)
71784  *     c_doc = _parseDoc(text, url, parser)
71785  */
71786   __pyx_t_1 = PyUnicode_Check(__pyx_v_url);
71787   if (__pyx_t_1) {
71788
71789     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1544
71790  *         raise ValueError, u"can only parse strings"
71791  *     if python.PyUnicode_Check(url):
71792  *         url = python.PyUnicode_AsUTF8String(url)             # <<<<<<<<<<<<<<
71793  *     c_doc = _parseDoc(text, url, parser)
71794  *     return _documentFactory(c_doc, parser)
71795  */
71796     __pyx_t_3 = PyUnicode_AsUTF8String(__pyx_v_url); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71797     __Pyx_GOTREF(__pyx_t_3);
71798     __Pyx_DECREF(__pyx_v_url);
71799     __pyx_v_url = __pyx_t_3;
71800     __pyx_t_3 = 0;
71801     goto __pyx_L6;
71802   }
71803   __pyx_L6:;
71804
71805   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1545
71806  *     if python.PyUnicode_Check(url):
71807  *         url = python.PyUnicode_AsUTF8String(url)
71808  *     c_doc = _parseDoc(text, url, parser)             # <<<<<<<<<<<<<<
71809  *     return _documentFactory(c_doc, parser)
71810  * 
71811  */
71812   __pyx_t_4 = __pyx_f_4lxml_5etree__parseDoc(__pyx_v_text, __pyx_v_url, __pyx_v_parser); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71813   __pyx_v_c_doc = __pyx_t_4;
71814
71815   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1546
71816  *         url = python.PyUnicode_AsUTF8String(url)
71817  *     c_doc = _parseDoc(text, url, parser)
71818  *     return _documentFactory(c_doc, parser)             # <<<<<<<<<<<<<<
71819  * 
71820  * cdef _Document _parseFilelikeDocument(source, url, _BaseParser parser):
71821  */
71822   __Pyx_XDECREF(((PyObject *)__pyx_r));
71823   __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, __pyx_v_parser)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71824   __Pyx_GOTREF(__pyx_t_3);
71825   __pyx_r = ((struct LxmlDocument *)__pyx_t_3);
71826   __pyx_t_3 = 0;
71827   goto __pyx_L0;
71828
71829   __pyx_r = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
71830   goto __pyx_L0;
71831   __pyx_L1_error:;
71832   __Pyx_XDECREF(__pyx_t_3);
71833   __Pyx_AddTraceback("lxml.etree._parseMemoryDocument");
71834   __pyx_r = 0;
71835   __pyx_L0:;
71836   __Pyx_DECREF(__pyx_v_text);
71837   __Pyx_DECREF(__pyx_v_url);
71838   __Pyx_XGIVEREF((PyObject *)__pyx_r);
71839   __Pyx_FinishRefcountContext();
71840   return __pyx_r;
71841 }
71842
71843 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1548
71844  *     return _documentFactory(c_doc, parser)
71845  * 
71846  * cdef _Document _parseFilelikeDocument(source, url, _BaseParser parser):             # <<<<<<<<<<<<<<
71847  *     cdef xmlDoc* c_doc
71848  *     if python.PyUnicode_Check(url):
71849  */
71850
71851 static  struct LxmlDocument *__pyx_f_4lxml_5etree__parseFilelikeDocument(PyObject *__pyx_v_source, PyObject *__pyx_v_url, struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser) {
71852   xmlDoc *__pyx_v_c_doc;
71853   struct LxmlDocument *__pyx_r = NULL;
71854   int __pyx_t_1;
71855   PyObject *__pyx_t_2 = NULL;
71856   xmlDoc *__pyx_t_3;
71857   __Pyx_SetupRefcountContext("_parseFilelikeDocument");
71858   __Pyx_INCREF(__pyx_v_url);
71859
71860   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1550
71861  * cdef _Document _parseFilelikeDocument(source, url, _BaseParser parser):
71862  *     cdef xmlDoc* c_doc
71863  *     if python.PyUnicode_Check(url):             # <<<<<<<<<<<<<<
71864  *         url = python.PyUnicode_AsUTF8String(url)
71865  *     c_doc = _parseDocFromFilelike(source, url, parser)
71866  */
71867   __pyx_t_1 = PyUnicode_Check(__pyx_v_url);
71868   if (__pyx_t_1) {
71869
71870     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1551
71871  *     cdef xmlDoc* c_doc
71872  *     if python.PyUnicode_Check(url):
71873  *         url = python.PyUnicode_AsUTF8String(url)             # <<<<<<<<<<<<<<
71874  *     c_doc = _parseDocFromFilelike(source, url, parser)
71875  *     return _documentFactory(c_doc, parser)
71876  */
71877     __pyx_t_2 = PyUnicode_AsUTF8String(__pyx_v_url); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71878     __Pyx_GOTREF(__pyx_t_2);
71879     __Pyx_DECREF(__pyx_v_url);
71880     __pyx_v_url = __pyx_t_2;
71881     __pyx_t_2 = 0;
71882     goto __pyx_L3;
71883   }
71884   __pyx_L3:;
71885
71886   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1552
71887  *     if python.PyUnicode_Check(url):
71888  *         url = python.PyUnicode_AsUTF8String(url)
71889  *     c_doc = _parseDocFromFilelike(source, url, parser)             # <<<<<<<<<<<<<<
71890  *     return _documentFactory(c_doc, parser)
71891  */
71892   __pyx_t_3 = __pyx_f_4lxml_5etree__parseDocFromFilelike(__pyx_v_source, __pyx_v_url, __pyx_v_parser); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71893   __pyx_v_c_doc = __pyx_t_3;
71894
71895   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1553
71896  *         url = python.PyUnicode_AsUTF8String(url)
71897  *     c_doc = _parseDocFromFilelike(source, url, parser)
71898  *     return _documentFactory(c_doc, parser)             # <<<<<<<<<<<<<<
71899  */
71900   __Pyx_XDECREF(((PyObject *)__pyx_r));
71901   __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, __pyx_v_parser)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
71902   __Pyx_GOTREF(__pyx_t_2);
71903   __pyx_r = ((struct LxmlDocument *)__pyx_t_2);
71904   __pyx_t_2 = 0;
71905   goto __pyx_L0;
71906
71907   __pyx_r = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
71908   goto __pyx_L0;
71909   __pyx_L1_error:;
71910   __Pyx_XDECREF(__pyx_t_2);
71911   __Pyx_AddTraceback("lxml.etree._parseFilelikeDocument");
71912   __pyx_r = 0;
71913   __pyx_L0:;
71914   __Pyx_DECREF(__pyx_v_url);
71915   __Pyx_XGIVEREF((PyObject *)__pyx_r);
71916   __Pyx_FinishRefcountContext();
71917   return __pyx_r;
71918 }
71919
71920 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":14
71921  *     cdef int _sax_event_filter
71922  *     cdef int _sax_event_propagate
71923  *     def __cinit__(self):             # <<<<<<<<<<<<<<
71924  *         self._sax_event_filter = 0
71925  *         self._sax_event_propagate = 0
71926  */
71927
71928 static int __pyx_pf_4lxml_5etree_16_SaxParserTarget___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
71929 static int __pyx_pf_4lxml_5etree_16_SaxParserTarget___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
71930   int __pyx_r;
71931   __Pyx_SetupRefcountContext("__cinit__");
71932   if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
71933     __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
71934   if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
71935
71936   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":15
71937  *     cdef int _sax_event_propagate
71938  *     def __cinit__(self):
71939  *         self._sax_event_filter = 0             # <<<<<<<<<<<<<<
71940  *         self._sax_event_propagate = 0
71941  * 
71942  */
71943   ((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self)->_sax_event_filter = 0;
71944
71945   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":16
71946  *     def __cinit__(self):
71947  *         self._sax_event_filter = 0
71948  *         self._sax_event_propagate = 0             # <<<<<<<<<<<<<<
71949  * 
71950  *     cdef _handleSaxStart(self, tag, attrib, nsmap):
71951  */
71952   ((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self)->_sax_event_propagate = 0;
71953
71954   __pyx_r = 0;
71955   __Pyx_FinishRefcountContext();
71956   return __pyx_r;
71957 }
71958
71959 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":18
71960  *         self._sax_event_propagate = 0
71961  * 
71962  *     cdef _handleSaxStart(self, tag, attrib, nsmap):             # <<<<<<<<<<<<<<
71963  *         return None
71964  *     cdef _handleSaxEnd(self, tag):
71965  */
71966
71967 static  PyObject *__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxStart(struct __pyx_obj_4lxml_5etree__SaxParserTarget *__pyx_v_self, PyObject *__pyx_v_tag, PyObject *__pyx_v_attrib, PyObject *__pyx_v_nsmap) {
71968   PyObject *__pyx_r = NULL;
71969   __Pyx_SetupRefcountContext("_handleSaxStart");
71970
71971   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":19
71972  * 
71973  *     cdef _handleSaxStart(self, tag, attrib, nsmap):
71974  *         return None             # <<<<<<<<<<<<<<
71975  *     cdef _handleSaxEnd(self, tag):
71976  *         return None
71977  */
71978   __Pyx_XDECREF(__pyx_r);
71979   __Pyx_INCREF(Py_None);
71980   __pyx_r = Py_None;
71981   goto __pyx_L0;
71982
71983   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
71984   __pyx_L0:;
71985   __Pyx_XGIVEREF(__pyx_r);
71986   __Pyx_FinishRefcountContext();
71987   return __pyx_r;
71988 }
71989
71990 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":20
71991  *     cdef _handleSaxStart(self, tag, attrib, nsmap):
71992  *         return None
71993  *     cdef _handleSaxEnd(self, tag):             # <<<<<<<<<<<<<<
71994  *         return None
71995  *     cdef int _handleSaxData(self, data) except -1:
71996  */
71997
71998 static  PyObject *__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxEnd(struct __pyx_obj_4lxml_5etree__SaxParserTarget *__pyx_v_self, PyObject *__pyx_v_tag) {
71999   PyObject *__pyx_r = NULL;
72000   __Pyx_SetupRefcountContext("_handleSaxEnd");
72001
72002   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":21
72003  *         return None
72004  *     cdef _handleSaxEnd(self, tag):
72005  *         return None             # <<<<<<<<<<<<<<
72006  *     cdef int _handleSaxData(self, data) except -1:
72007  *         return 0
72008  */
72009   __Pyx_XDECREF(__pyx_r);
72010   __Pyx_INCREF(Py_None);
72011   __pyx_r = Py_None;
72012   goto __pyx_L0;
72013
72014   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
72015   __pyx_L0:;
72016   __Pyx_XGIVEREF(__pyx_r);
72017   __Pyx_FinishRefcountContext();
72018   return __pyx_r;
72019 }
72020
72021 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":22
72022  *     cdef _handleSaxEnd(self, tag):
72023  *         return None
72024  *     cdef int _handleSaxData(self, data) except -1:             # <<<<<<<<<<<<<<
72025  *         return 0
72026  *     cdef int _handleSaxDoctype(self, root_tag, public_id, system_id) except -1:
72027  */
72028
72029 static  int __pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxData(struct __pyx_obj_4lxml_5etree__SaxParserTarget *__pyx_v_self, PyObject *__pyx_v_data) {
72030   int __pyx_r;
72031   __Pyx_SetupRefcountContext("_handleSaxData");
72032
72033   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":23
72034  *         return None
72035  *     cdef int _handleSaxData(self, data) except -1:
72036  *         return 0             # <<<<<<<<<<<<<<
72037  *     cdef int _handleSaxDoctype(self, root_tag, public_id, system_id) except -1:
72038  *         return 0
72039  */
72040   __pyx_r = 0;
72041   goto __pyx_L0;
72042
72043   __pyx_r = 0;
72044   __pyx_L0:;
72045   __Pyx_FinishRefcountContext();
72046   return __pyx_r;
72047 }
72048
72049 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":24
72050  *     cdef int _handleSaxData(self, data) except -1:
72051  *         return 0
72052  *     cdef int _handleSaxDoctype(self, root_tag, public_id, system_id) except -1:             # <<<<<<<<<<<<<<
72053  *         return 0
72054  *     cdef _handleSaxPi(self, target, data):
72055  */
72056
72057 static  int __pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxDoctype(struct __pyx_obj_4lxml_5etree__SaxParserTarget *__pyx_v_self, PyObject *__pyx_v_root_tag, PyObject *__pyx_v_public_id, PyObject *__pyx_v_system_id) {
72058   int __pyx_r;
72059   __Pyx_SetupRefcountContext("_handleSaxDoctype");
72060
72061   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":25
72062  *         return 0
72063  *     cdef int _handleSaxDoctype(self, root_tag, public_id, system_id) except -1:
72064  *         return 0             # <<<<<<<<<<<<<<
72065  *     cdef _handleSaxPi(self, target, data):
72066  *         return None
72067  */
72068   __pyx_r = 0;
72069   goto __pyx_L0;
72070
72071   __pyx_r = 0;
72072   __pyx_L0:;
72073   __Pyx_FinishRefcountContext();
72074   return __pyx_r;
72075 }
72076
72077 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":26
72078  *     cdef int _handleSaxDoctype(self, root_tag, public_id, system_id) except -1:
72079  *         return 0
72080  *     cdef _handleSaxPi(self, target, data):             # <<<<<<<<<<<<<<
72081  *         return None
72082  *     cdef _handleSaxComment(self, comment):
72083  */
72084
72085 static  PyObject *__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxPi(struct __pyx_obj_4lxml_5etree__SaxParserTarget *__pyx_v_self, PyObject *__pyx_v_target, PyObject *__pyx_v_data) {
72086   PyObject *__pyx_r = NULL;
72087   __Pyx_SetupRefcountContext("_handleSaxPi");
72088
72089   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":27
72090  *         return 0
72091  *     cdef _handleSaxPi(self, target, data):
72092  *         return None             # <<<<<<<<<<<<<<
72093  *     cdef _handleSaxComment(self, comment):
72094  *         return None
72095  */
72096   __Pyx_XDECREF(__pyx_r);
72097   __Pyx_INCREF(Py_None);
72098   __pyx_r = Py_None;
72099   goto __pyx_L0;
72100
72101   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
72102   __pyx_L0:;
72103   __Pyx_XGIVEREF(__pyx_r);
72104   __Pyx_FinishRefcountContext();
72105   return __pyx_r;
72106 }
72107
72108 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":28
72109  *     cdef _handleSaxPi(self, target, data):
72110  *         return None
72111  *     cdef _handleSaxComment(self, comment):             # <<<<<<<<<<<<<<
72112  *         return None
72113  * 
72114  */
72115
72116 static  PyObject *__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxComment(struct __pyx_obj_4lxml_5etree__SaxParserTarget *__pyx_v_self, PyObject *__pyx_v_comment) {
72117   PyObject *__pyx_r = NULL;
72118   __Pyx_SetupRefcountContext("_handleSaxComment");
72119
72120   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":29
72121  *         return None
72122  *     cdef _handleSaxComment(self, comment):
72123  *         return None             # <<<<<<<<<<<<<<
72124  * 
72125  * cdef class _SaxParserContext(_ParserContext):
72126  */
72127   __Pyx_XDECREF(__pyx_r);
72128   __Pyx_INCREF(Py_None);
72129   __pyx_r = Py_None;
72130   goto __pyx_L0;
72131
72132   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
72133   __pyx_L0:;
72134   __Pyx_XGIVEREF(__pyx_r);
72135   __Pyx_FinishRefcountContext();
72136   return __pyx_r;
72137 }
72138
72139 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":45
72140  *     cdef xmlparser.processingInstructionSAXFunc    _origSaxPi
72141  * 
72142  *     cdef void _setSaxParserTarget(self, _SaxParserTarget target):             # <<<<<<<<<<<<<<
72143  *         self._target = target
72144  * 
72145  */
72146
72147 static  void __pyx_f_4lxml_5etree_17_SaxParserContext__setSaxParserTarget(struct __pyx_obj_4lxml_5etree__SaxParserContext *__pyx_v_self, struct __pyx_obj_4lxml_5etree__SaxParserTarget *__pyx_v_target) {
72148   __Pyx_SetupRefcountContext("_setSaxParserTarget");
72149
72150   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":46
72151  * 
72152  *     cdef void _setSaxParserTarget(self, _SaxParserTarget target):
72153  *         self._target = target             # <<<<<<<<<<<<<<
72154  * 
72155  *     cdef void _initParserContext(self, xmlparser.xmlParserCtxt* c_ctxt):
72156  */
72157   __Pyx_INCREF(((PyObject *)__pyx_v_target));
72158   __Pyx_GIVEREF(((PyObject *)__pyx_v_target));
72159   __Pyx_GOTREF(__pyx_v_self->_target);
72160   __Pyx_DECREF(((PyObject *)__pyx_v_self->_target));
72161   __pyx_v_self->_target = __pyx_v_target;
72162
72163   __Pyx_FinishRefcountContext();
72164 }
72165
72166 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":48
72167  *         self._target = target
72168  * 
72169  *     cdef void _initParserContext(self, xmlparser.xmlParserCtxt* c_ctxt):             # <<<<<<<<<<<<<<
72170  *         u"wrap original SAX2 callbacks"
72171  *         cdef xmlparser.xmlSAXHandler* sax
72172  */
72173
72174 static  void __pyx_f_4lxml_5etree_17_SaxParserContext__initParserContext(struct __pyx_obj_4lxml_5etree__SaxParserContext *__pyx_v_self, xmlParserCtxt *__pyx_v_c_ctxt) {
72175   xmlSAXHandler *__pyx_v_sax;
72176   int __pyx_t_1;
72177   int __pyx_t_2;
72178   __Pyx_SetupRefcountContext("_initParserContext");
72179
72180   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":51
72181  *         u"wrap original SAX2 callbacks"
72182  *         cdef xmlparser.xmlSAXHandler* sax
72183  *         _ParserContext._initParserContext(self, c_ctxt)             # <<<<<<<<<<<<<<
72184  *         sax = c_ctxt.sax
72185  *         if self._target._sax_event_propagate & SAX_EVENT_START:
72186  */
72187   __pyx_vtabptr_4lxml_5etree__ParserContext->_initParserContext(((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_v_self), __pyx_v_c_ctxt);
72188
72189   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":52
72190  *         cdef xmlparser.xmlSAXHandler* sax
72191  *         _ParserContext._initParserContext(self, c_ctxt)
72192  *         sax = c_ctxt.sax             # <<<<<<<<<<<<<<
72193  *         if self._target._sax_event_propagate & SAX_EVENT_START:
72194  *             # propagate => keep orig callback
72195  */
72196   __pyx_v_sax = __pyx_v_c_ctxt->sax;
72197
72198   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":53
72199  *         _ParserContext._initParserContext(self, c_ctxt)
72200  *         sax = c_ctxt.sax
72201  *         if self._target._sax_event_propagate & SAX_EVENT_START:             # <<<<<<<<<<<<<<
72202  *             # propagate => keep orig callback
72203  *             self._origSaxStart = sax.startElementNs
72204  */
72205   __pyx_t_1 = (__pyx_v_self->_target->_sax_event_propagate & __pyx_e_4lxml_5etree_SAX_EVENT_START);
72206   if (__pyx_t_1) {
72207
72208     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":55
72209  *         if self._target._sax_event_propagate & SAX_EVENT_START:
72210  *             # propagate => keep orig callback
72211  *             self._origSaxStart = sax.startElementNs             # <<<<<<<<<<<<<<
72212  *             self._origSaxStartNoNs = sax.startElement
72213  *         else:
72214  */
72215     __pyx_v_self->_origSaxStart = __pyx_v_sax->startElementNs;
72216
72217     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":56
72218  *             # propagate => keep orig callback
72219  *             self._origSaxStart = sax.startElementNs
72220  *             self._origSaxStartNoNs = sax.startElement             # <<<<<<<<<<<<<<
72221  *         else:
72222  *             # otherwise: never call orig callback
72223  */
72224     __pyx_v_self->_origSaxStartNoNs = __pyx_v_sax->startElement;
72225     goto __pyx_L3;
72226   }
72227   /*else*/ {
72228
72229     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":59
72230  *         else:
72231  *             # otherwise: never call orig callback
72232  *             self._origSaxStart = sax.startElementNs = NULL             # <<<<<<<<<<<<<<
72233  *             self._origSaxStartNoNs = sax.startElement = NULL
72234  *         if self._target._sax_event_filter & SAX_EVENT_START:
72235  */
72236     __pyx_v_self->_origSaxStart = NULL;
72237     __pyx_v_sax->startElementNs = NULL;
72238
72239     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":60
72240  *             # otherwise: never call orig callback
72241  *             self._origSaxStart = sax.startElementNs = NULL
72242  *             self._origSaxStartNoNs = sax.startElement = NULL             # <<<<<<<<<<<<<<
72243  *         if self._target._sax_event_filter & SAX_EVENT_START:
72244  *             # intercept => overwrite orig callback
72245  */
72246     __pyx_v_self->_origSaxStartNoNs = NULL;
72247     __pyx_v_sax->startElement = NULL;
72248   }
72249   __pyx_L3:;
72250
72251   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":61
72252  *             self._origSaxStart = sax.startElementNs = NULL
72253  *             self._origSaxStartNoNs = sax.startElement = NULL
72254  *         if self._target._sax_event_filter & SAX_EVENT_START:             # <<<<<<<<<<<<<<
72255  *             # intercept => overwrite orig callback
72256  *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:
72257  */
72258   __pyx_t_1 = (__pyx_v_self->_target->_sax_event_filter & __pyx_e_4lxml_5etree_SAX_EVENT_START);
72259   if (__pyx_t_1) {
72260
72261     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":63
72262  *         if self._target._sax_event_filter & SAX_EVENT_START:
72263  *             # intercept => overwrite orig callback
72264  *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:             # <<<<<<<<<<<<<<
72265  *                 sax.startElementNs = _handleSaxStart
72266  *             sax.startElement = _handleSaxStartNoNs
72267  */
72268     __pyx_t_2 = (__pyx_v_sax->initialized == XML_SAX2_MAGIC);
72269     if (__pyx_t_2) {
72270
72271       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":64
72272  *             # intercept => overwrite orig callback
72273  *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:
72274  *                 sax.startElementNs = _handleSaxStart             # <<<<<<<<<<<<<<
72275  *             sax.startElement = _handleSaxStartNoNs
72276  * 
72277  */
72278       __pyx_v_sax->startElementNs = __pyx_f_4lxml_5etree__handleSaxStart;
72279       goto __pyx_L5;
72280     }
72281     __pyx_L5:;
72282
72283     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":65
72284  *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:
72285  *                 sax.startElementNs = _handleSaxStart
72286  *             sax.startElement = _handleSaxStartNoNs             # <<<<<<<<<<<<<<
72287  * 
72288  *         if self._target._sax_event_propagate & SAX_EVENT_END:
72289  */
72290     __pyx_v_sax->startElement = __pyx_f_4lxml_5etree__handleSaxStartNoNs;
72291     goto __pyx_L4;
72292   }
72293   __pyx_L4:;
72294
72295   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":67
72296  *             sax.startElement = _handleSaxStartNoNs
72297  * 
72298  *         if self._target._sax_event_propagate & SAX_EVENT_END:             # <<<<<<<<<<<<<<
72299  *             self._origSaxEnd = sax.endElementNs
72300  *             self._origSaxEndNoNs = sax.endElement
72301  */
72302   __pyx_t_1 = (__pyx_v_self->_target->_sax_event_propagate & __pyx_e_4lxml_5etree_SAX_EVENT_END);
72303   if (__pyx_t_1) {
72304
72305     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":68
72306  * 
72307  *         if self._target._sax_event_propagate & SAX_EVENT_END:
72308  *             self._origSaxEnd = sax.endElementNs             # <<<<<<<<<<<<<<
72309  *             self._origSaxEndNoNs = sax.endElement
72310  *         else:
72311  */
72312     __pyx_v_self->_origSaxEnd = __pyx_v_sax->endElementNs;
72313
72314     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":69
72315  *         if self._target._sax_event_propagate & SAX_EVENT_END:
72316  *             self._origSaxEnd = sax.endElementNs
72317  *             self._origSaxEndNoNs = sax.endElement             # <<<<<<<<<<<<<<
72318  *         else:
72319  *             self._origSaxEnd = sax.endElementNs = NULL
72320  */
72321     __pyx_v_self->_origSaxEndNoNs = __pyx_v_sax->endElement;
72322     goto __pyx_L6;
72323   }
72324   /*else*/ {
72325
72326     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":71
72327  *             self._origSaxEndNoNs = sax.endElement
72328  *         else:
72329  *             self._origSaxEnd = sax.endElementNs = NULL             # <<<<<<<<<<<<<<
72330  *             self._origSaxEndNoNs = sax.endElement = NULL
72331  *         if self._target._sax_event_filter & SAX_EVENT_END:
72332  */
72333     __pyx_v_self->_origSaxEnd = NULL;
72334     __pyx_v_sax->endElementNs = NULL;
72335
72336     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":72
72337  *         else:
72338  *             self._origSaxEnd = sax.endElementNs = NULL
72339  *             self._origSaxEndNoNs = sax.endElement = NULL             # <<<<<<<<<<<<<<
72340  *         if self._target._sax_event_filter & SAX_EVENT_END:
72341  *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:
72342  */
72343     __pyx_v_self->_origSaxEndNoNs = NULL;
72344     __pyx_v_sax->endElement = NULL;
72345   }
72346   __pyx_L6:;
72347
72348   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":73
72349  *             self._origSaxEnd = sax.endElementNs = NULL
72350  *             self._origSaxEndNoNs = sax.endElement = NULL
72351  *         if self._target._sax_event_filter & SAX_EVENT_END:             # <<<<<<<<<<<<<<
72352  *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:
72353  *                 sax.endElementNs = _handleSaxEnd
72354  */
72355   __pyx_t_1 = (__pyx_v_self->_target->_sax_event_filter & __pyx_e_4lxml_5etree_SAX_EVENT_END);
72356   if (__pyx_t_1) {
72357
72358     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":74
72359  *             self._origSaxEndNoNs = sax.endElement = NULL
72360  *         if self._target._sax_event_filter & SAX_EVENT_END:
72361  *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:             # <<<<<<<<<<<<<<
72362  *                 sax.endElementNs = _handleSaxEnd
72363  *             sax.endElement = _handleSaxEndNoNs
72364  */
72365     __pyx_t_2 = (__pyx_v_sax->initialized == XML_SAX2_MAGIC);
72366     if (__pyx_t_2) {
72367
72368       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":75
72369  *         if self._target._sax_event_filter & SAX_EVENT_END:
72370  *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:
72371  *                 sax.endElementNs = _handleSaxEnd             # <<<<<<<<<<<<<<
72372  *             sax.endElement = _handleSaxEndNoNs
72373  * 
72374  */
72375       __pyx_v_sax->endElementNs = __pyx_f_4lxml_5etree__handleSaxEnd;
72376       goto __pyx_L8;
72377     }
72378     __pyx_L8:;
72379
72380     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":76
72381  *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:
72382  *                 sax.endElementNs = _handleSaxEnd
72383  *             sax.endElement = _handleSaxEndNoNs             # <<<<<<<<<<<<<<
72384  * 
72385  *         if self._target._sax_event_propagate & SAX_EVENT_DATA:
72386  */
72387     __pyx_v_sax->endElement = __pyx_f_4lxml_5etree__handleSaxEndNoNs;
72388     goto __pyx_L7;
72389   }
72390   __pyx_L7:;
72391
72392   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":78
72393  *             sax.endElement = _handleSaxEndNoNs
72394  * 
72395  *         if self._target._sax_event_propagate & SAX_EVENT_DATA:             # <<<<<<<<<<<<<<
72396  *             self._origSaxData = sax.characters
72397  *             self._origSaxCData = sax.cdataBlock
72398  */
72399   __pyx_t_1 = (__pyx_v_self->_target->_sax_event_propagate & __pyx_e_4lxml_5etree_SAX_EVENT_DATA);
72400   if (__pyx_t_1) {
72401
72402     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":79
72403  * 
72404  *         if self._target._sax_event_propagate & SAX_EVENT_DATA:
72405  *             self._origSaxData = sax.characters             # <<<<<<<<<<<<<<
72406  *             self._origSaxCData = sax.cdataBlock
72407  *         else:
72408  */
72409     __pyx_v_self->_origSaxData = __pyx_v_sax->characters;
72410
72411     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":80
72412  *         if self._target._sax_event_propagate & SAX_EVENT_DATA:
72413  *             self._origSaxData = sax.characters
72414  *             self._origSaxCData = sax.cdataBlock             # <<<<<<<<<<<<<<
72415  *         else:
72416  *             self._origSaxData = sax.characters = sax.cdataBlock = NULL
72417  */
72418     __pyx_v_self->_origSaxCData = __pyx_v_sax->cdataBlock;
72419     goto __pyx_L9;
72420   }
72421   /*else*/ {
72422
72423     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":82
72424  *             self._origSaxCData = sax.cdataBlock
72425  *         else:
72426  *             self._origSaxData = sax.characters = sax.cdataBlock = NULL             # <<<<<<<<<<<<<<
72427  *         if self._target._sax_event_filter & SAX_EVENT_DATA:
72428  *             sax.characters = _handleSaxData
72429  */
72430     __pyx_v_self->_origSaxData = NULL;
72431     __pyx_v_sax->characters = NULL;
72432     __pyx_v_sax->cdataBlock = NULL;
72433   }
72434   __pyx_L9:;
72435
72436   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":83
72437  *         else:
72438  *             self._origSaxData = sax.characters = sax.cdataBlock = NULL
72439  *         if self._target._sax_event_filter & SAX_EVENT_DATA:             # <<<<<<<<<<<<<<
72440  *             sax.characters = _handleSaxData
72441  *             sax.cdataBlock = _handleSaxCData
72442  */
72443   __pyx_t_1 = (__pyx_v_self->_target->_sax_event_filter & __pyx_e_4lxml_5etree_SAX_EVENT_DATA);
72444   if (__pyx_t_1) {
72445
72446     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":84
72447  *             self._origSaxData = sax.characters = sax.cdataBlock = NULL
72448  *         if self._target._sax_event_filter & SAX_EVENT_DATA:
72449  *             sax.characters = _handleSaxData             # <<<<<<<<<<<<<<
72450  *             sax.cdataBlock = _handleSaxCData
72451  * 
72452  */
72453     __pyx_v_sax->characters = __pyx_f_4lxml_5etree__handleSaxData;
72454
72455     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":85
72456  *         if self._target._sax_event_filter & SAX_EVENT_DATA:
72457  *             sax.characters = _handleSaxData
72458  *             sax.cdataBlock = _handleSaxCData             # <<<<<<<<<<<<<<
72459  * 
72460  *         # doctype propagation is always required for entity replacement
72461  */
72462     __pyx_v_sax->cdataBlock = __pyx_f_4lxml_5etree__handleSaxCData;
72463     goto __pyx_L10;
72464   }
72465   __pyx_L10:;
72466
72467   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":88
72468  * 
72469  *         # doctype propagation is always required for entity replacement
72470  *         self._origSaxDoctype = sax.internalSubset             # <<<<<<<<<<<<<<
72471  *         if self._target._sax_event_filter & SAX_EVENT_DOCTYPE:
72472  *             sax.internalSubset = _handleSaxDoctype
72473  */
72474   __pyx_v_self->_origSaxDoctype = __pyx_v_sax->internalSubset;
72475
72476   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":89
72477  *         # doctype propagation is always required for entity replacement
72478  *         self._origSaxDoctype = sax.internalSubset
72479  *         if self._target._sax_event_filter & SAX_EVENT_DOCTYPE:             # <<<<<<<<<<<<<<
72480  *             sax.internalSubset = _handleSaxDoctype
72481  * 
72482  */
72483   __pyx_t_1 = (__pyx_v_self->_target->_sax_event_filter & __pyx_e_4lxml_5etree_SAX_EVENT_DOCTYPE);
72484   if (__pyx_t_1) {
72485
72486     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":90
72487  *         self._origSaxDoctype = sax.internalSubset
72488  *         if self._target._sax_event_filter & SAX_EVENT_DOCTYPE:
72489  *             sax.internalSubset = _handleSaxDoctype             # <<<<<<<<<<<<<<
72490  * 
72491  *         if self._target._sax_event_propagate & SAX_EVENT_PI:
72492  */
72493     __pyx_v_sax->internalSubset = __pyx_f_4lxml_5etree__handleSaxDoctype;
72494     goto __pyx_L11;
72495   }
72496   __pyx_L11:;
72497
72498   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":92
72499  *             sax.internalSubset = _handleSaxDoctype
72500  * 
72501  *         if self._target._sax_event_propagate & SAX_EVENT_PI:             # <<<<<<<<<<<<<<
72502  *             self._origSaxPi = sax.processingInstruction
72503  *         else:
72504  */
72505   __pyx_t_1 = (__pyx_v_self->_target->_sax_event_propagate & __pyx_e_4lxml_5etree_SAX_EVENT_PI);
72506   if (__pyx_t_1) {
72507
72508     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":93
72509  * 
72510  *         if self._target._sax_event_propagate & SAX_EVENT_PI:
72511  *             self._origSaxPi = sax.processingInstruction             # <<<<<<<<<<<<<<
72512  *         else:
72513  *             self._origSaxPi = sax.processingInstruction = NULL
72514  */
72515     __pyx_v_self->_origSaxPi = __pyx_v_sax->processingInstruction;
72516     goto __pyx_L12;
72517   }
72518   /*else*/ {
72519
72520     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":95
72521  *             self._origSaxPi = sax.processingInstruction
72522  *         else:
72523  *             self._origSaxPi = sax.processingInstruction = NULL             # <<<<<<<<<<<<<<
72524  *         if self._target._sax_event_filter & SAX_EVENT_PI:
72525  *             sax.processingInstruction = _handleSaxPI
72526  */
72527     __pyx_v_self->_origSaxPi = NULL;
72528     __pyx_v_sax->processingInstruction = NULL;
72529   }
72530   __pyx_L12:;
72531
72532   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":96
72533  *         else:
72534  *             self._origSaxPi = sax.processingInstruction = NULL
72535  *         if self._target._sax_event_filter & SAX_EVENT_PI:             # <<<<<<<<<<<<<<
72536  *             sax.processingInstruction = _handleSaxPI
72537  * 
72538  */
72539   __pyx_t_1 = (__pyx_v_self->_target->_sax_event_filter & __pyx_e_4lxml_5etree_SAX_EVENT_PI);
72540   if (__pyx_t_1) {
72541
72542     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":97
72543  *             self._origSaxPi = sax.processingInstruction = NULL
72544  *         if self._target._sax_event_filter & SAX_EVENT_PI:
72545  *             sax.processingInstruction = _handleSaxPI             # <<<<<<<<<<<<<<
72546  * 
72547  *         if self._target._sax_event_propagate & SAX_EVENT_COMMENT:
72548  */
72549     __pyx_v_sax->processingInstruction = __pyx_f_4lxml_5etree__handleSaxPI;
72550     goto __pyx_L13;
72551   }
72552   __pyx_L13:;
72553
72554   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":99
72555  *             sax.processingInstruction = _handleSaxPI
72556  * 
72557  *         if self._target._sax_event_propagate & SAX_EVENT_COMMENT:             # <<<<<<<<<<<<<<
72558  *             self._origSaxComment = sax.comment
72559  *         else:
72560  */
72561   __pyx_t_1 = (__pyx_v_self->_target->_sax_event_propagate & __pyx_e_4lxml_5etree_SAX_EVENT_COMMENT);
72562   if (__pyx_t_1) {
72563
72564     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":100
72565  * 
72566  *         if self._target._sax_event_propagate & SAX_EVENT_COMMENT:
72567  *             self._origSaxComment = sax.comment             # <<<<<<<<<<<<<<
72568  *         else:
72569  *             self._origSaxComment = sax.comment = NULL
72570  */
72571     __pyx_v_self->_origSaxComment = __pyx_v_sax->comment;
72572     goto __pyx_L14;
72573   }
72574   /*else*/ {
72575
72576     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":102
72577  *             self._origSaxComment = sax.comment
72578  *         else:
72579  *             self._origSaxComment = sax.comment = NULL             # <<<<<<<<<<<<<<
72580  *         if self._target._sax_event_filter & SAX_EVENT_COMMENT:
72581  *             sax.comment = _handleSaxComment
72582  */
72583     __pyx_v_self->_origSaxComment = NULL;
72584     __pyx_v_sax->comment = NULL;
72585   }
72586   __pyx_L14:;
72587
72588   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":103
72589  *         else:
72590  *             self._origSaxComment = sax.comment = NULL
72591  *         if self._target._sax_event_filter & SAX_EVENT_COMMENT:             # <<<<<<<<<<<<<<
72592  *             sax.comment = _handleSaxComment
72593  * 
72594  */
72595   __pyx_t_1 = (__pyx_v_self->_target->_sax_event_filter & __pyx_e_4lxml_5etree_SAX_EVENT_COMMENT);
72596   if (__pyx_t_1) {
72597
72598     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":104
72599  *             self._origSaxComment = sax.comment = NULL
72600  *         if self._target._sax_event_filter & SAX_EVENT_COMMENT:
72601  *             sax.comment = _handleSaxComment             # <<<<<<<<<<<<<<
72602  * 
72603  *         # enforce entity replacement
72604  */
72605     __pyx_v_sax->comment = __pyx_f_4lxml_5etree__handleSaxComment;
72606     goto __pyx_L15;
72607   }
72608   __pyx_L15:;
72609
72610   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":107
72611  * 
72612  *         # enforce entity replacement
72613  *         sax.reference = NULL             # <<<<<<<<<<<<<<
72614  *         c_ctxt.replaceEntities = 1
72615  * 
72616  */
72617   __pyx_v_sax->reference = NULL;
72618
72619   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":108
72620  *         # enforce entity replacement
72621  *         sax.reference = NULL
72622  *         c_ctxt.replaceEntities = 1             # <<<<<<<<<<<<<<
72623  * 
72624  *     cdef void _handleSaxException(self, xmlparser.xmlParserCtxt* c_ctxt):
72625  */
72626   __pyx_v_c_ctxt->replaceEntities = 1;
72627
72628   __Pyx_FinishRefcountContext();
72629 }
72630
72631 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":110
72632  *         c_ctxt.replaceEntities = 1
72633  * 
72634  *     cdef void _handleSaxException(self, xmlparser.xmlParserCtxt* c_ctxt):             # <<<<<<<<<<<<<<
72635  *         if c_ctxt.errNo == xmlerror.XML_ERR_OK:
72636  *             c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR
72637  */
72638
72639 static  void __pyx_f_4lxml_5etree_17_SaxParserContext__handleSaxException(struct __pyx_obj_4lxml_5etree__SaxParserContext *__pyx_v_self, xmlParserCtxt *__pyx_v_c_ctxt) {
72640   int __pyx_t_1;
72641   __Pyx_SetupRefcountContext("_handleSaxException");
72642
72643   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":111
72644  * 
72645  *     cdef void _handleSaxException(self, xmlparser.xmlParserCtxt* c_ctxt):
72646  *         if c_ctxt.errNo == xmlerror.XML_ERR_OK:             # <<<<<<<<<<<<<<
72647  *             c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR
72648  *         # stop parsing immediately
72649  */
72650   __pyx_t_1 = (__pyx_v_c_ctxt->errNo == XML_ERR_OK);
72651   if (__pyx_t_1) {
72652
72653     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":112
72654  *     cdef void _handleSaxException(self, xmlparser.xmlParserCtxt* c_ctxt):
72655  *         if c_ctxt.errNo == xmlerror.XML_ERR_OK:
72656  *             c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR             # <<<<<<<<<<<<<<
72657  *         # stop parsing immediately
72658  *         c_ctxt.wellFormed = 0
72659  */
72660     __pyx_v_c_ctxt->errNo = XML_ERR_INTERNAL_ERROR;
72661     goto __pyx_L3;
72662   }
72663   __pyx_L3:;
72664
72665   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":114
72666  *             c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR
72667  *         # stop parsing immediately
72668  *         c_ctxt.wellFormed = 0             # <<<<<<<<<<<<<<
72669  *         c_ctxt.disableSAX = 1
72670  *         self._store_raised()
72671  */
72672   __pyx_v_c_ctxt->wellFormed = 0;
72673
72674   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":115
72675  *         # stop parsing immediately
72676  *         c_ctxt.wellFormed = 0
72677  *         c_ctxt.disableSAX = 1             # <<<<<<<<<<<<<<
72678  *         self._store_raised()
72679  * 
72680  */
72681   __pyx_v_c_ctxt->disableSAX = 1;
72682
72683   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":116
72684  *         c_ctxt.wellFormed = 0
72685  *         c_ctxt.disableSAX = 1
72686  *         self._store_raised()             # <<<<<<<<<<<<<<
72687  * 
72688  * cdef void _handleSaxStart(void* ctxt, char* c_localname, char* c_prefix,
72689  */
72690   ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.__pyx_base._store_raised(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_self));
72691
72692   __Pyx_FinishRefcountContext();
72693 }
72694
72695 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":118
72696  *         self._store_raised()
72697  * 
72698  * cdef void _handleSaxStart(void* ctxt, char* c_localname, char* c_prefix,             # <<<<<<<<<<<<<<
72699  *                           char* c_namespace, int c_nb_namespaces,
72700  *                           char** c_namespaces,
72701  */
72702
72703 static  void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, char *__pyx_v_c_localname, char *__pyx_v_c_prefix, char *__pyx_v_c_namespace, int __pyx_v_c_nb_namespaces, char **__pyx_v_c_namespaces, int __pyx_v_c_nb_attributes, int __pyx_v_c_nb_defaulted, char **__pyx_v_c_attributes) {
72704   struct __pyx_obj_4lxml_5etree__SaxParserContext *__pyx_v_context;
72705   xmlParserCtxt *__pyx_v_c_ctxt;
72706   struct LxmlElement *__pyx_v_element;
72707   int __pyx_v_i;
72708   PyObject *__pyx_v_tag;
72709   PyObject *__pyx_v_attrib;
72710   PyObject *__pyx_v_name;
72711   PyObject *__pyx_v_value;
72712   PyObject *__pyx_v_nsmap;
72713   PyObject *__pyx_v_prefix;
72714   PyObject *__pyx_1 = 0;
72715   int __pyx_t_1;
72716   PyObject *__pyx_t_2 = NULL;
72717   int __pyx_t_3;
72718   int __pyx_t_4;
72719   PyObject *__pyx_t_5 = NULL;
72720   PyObject *__pyx_t_6 = NULL;
72721   PyGILState_STATE _save = PyGILState_Ensure();
72722   __Pyx_SetupRefcountContext("_handleSaxStart");
72723   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)Py_None); __Pyx_INCREF(Py_None);
72724   __pyx_v_element = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
72725   __pyx_v_tag = Py_None; __Pyx_INCREF(Py_None);
72726   __pyx_v_attrib = Py_None; __Pyx_INCREF(Py_None);
72727   __pyx_v_name = Py_None; __Pyx_INCREF(Py_None);
72728   __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);
72729   __pyx_v_nsmap = Py_None; __Pyx_INCREF(Py_None);
72730   __pyx_v_prefix = Py_None; __Pyx_INCREF(Py_None);
72731
72732   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":127
72733  *     cdef _Element element
72734  *     cdef int i
72735  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<<
72736  *     if c_ctxt._private is NULL:
72737  *         return
72738  */
72739   __pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);
72740
72741   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":128
72742  *     cdef int i
72743  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
72744  *     if c_ctxt._private is NULL:             # <<<<<<<<<<<<<<
72745  *         return
72746  *     context = <_SaxParserContext>c_ctxt._private
72747  */
72748   __pyx_t_1 = (__pyx_v_c_ctxt->_private == NULL);
72749   if (__pyx_t_1) {
72750
72751     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":129
72752  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
72753  *     if c_ctxt._private is NULL:
72754  *         return             # <<<<<<<<<<<<<<
72755  *     context = <_SaxParserContext>c_ctxt._private
72756  *     if context._origSaxStart is not NULL:
72757  */
72758     goto __pyx_L0;
72759     goto __pyx_L3;
72760   }
72761   __pyx_L3:;
72762
72763   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":130
72764  *     if c_ctxt._private is NULL:
72765  *         return
72766  *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<<
72767  *     if context._origSaxStart is not NULL:
72768  *         context._origSaxStart(c_ctxt, c_localname, c_prefix, c_namespace,
72769  */
72770   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_v_c_ctxt->_private)));
72771   __Pyx_DECREF(((PyObject *)__pyx_v_context));
72772   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_v_c_ctxt->_private);
72773
72774   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":131
72775  *         return
72776  *     context = <_SaxParserContext>c_ctxt._private
72777  *     if context._origSaxStart is not NULL:             # <<<<<<<<<<<<<<
72778  *         context._origSaxStart(c_ctxt, c_localname, c_prefix, c_namespace,
72779  *                               c_nb_namespaces, c_namespaces, c_nb_attributes,
72780  */
72781   __pyx_t_1 = (__pyx_v_context->_origSaxStart != NULL);
72782   if (__pyx_t_1) {
72783
72784     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":134
72785  *         context._origSaxStart(c_ctxt, c_localname, c_prefix, c_namespace,
72786  *                               c_nb_namespaces, c_namespaces, c_nb_attributes,
72787  *                               c_nb_defaulted, c_attributes)             # <<<<<<<<<<<<<<
72788  *     try:
72789  *         tag = _namespacedNameFromNsName(c_namespace, c_localname)
72790  */
72791     __pyx_v_context->_origSaxStart(__pyx_v_c_ctxt, __pyx_v_c_localname, __pyx_v_c_prefix, __pyx_v_c_namespace, __pyx_v_c_nb_namespaces, __pyx_v_c_namespaces, __pyx_v_c_nb_attributes, __pyx_v_c_nb_defaulted, __pyx_v_c_attributes);
72792     goto __pyx_L4;
72793   }
72794   __pyx_L4:;
72795
72796   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":135
72797  *                               c_nb_namespaces, c_namespaces, c_nb_attributes,
72798  *                               c_nb_defaulted, c_attributes)
72799  *     try:             # <<<<<<<<<<<<<<
72800  *         tag = _namespacedNameFromNsName(c_namespace, c_localname)
72801  *         if c_nb_defaulted > 0:
72802  */
72803   {
72804     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
72805     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
72806     __Pyx_XGOTREF(__pyx_save_exc_type);
72807     __Pyx_XGOTREF(__pyx_save_exc_value);
72808     __Pyx_XGOTREF(__pyx_save_exc_tb);
72809     /*try:*/ {
72810
72811       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":136
72812  *                               c_nb_defaulted, c_attributes)
72813  *     try:
72814  *         tag = _namespacedNameFromNsName(c_namespace, c_localname)             # <<<<<<<<<<<<<<
72815  *         if c_nb_defaulted > 0:
72816  *             # only add default attributes if we asked for them
72817  */
72818       __pyx_t_2 = __pyx_f_4lxml_5etree__namespacedNameFromNsName(__pyx_v_c_namespace, __pyx_v_c_localname); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
72819       __Pyx_GOTREF(__pyx_t_2);
72820       __Pyx_DECREF(__pyx_v_tag);
72821       __pyx_v_tag = __pyx_t_2;
72822       __pyx_t_2 = 0;
72823
72824       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":137
72825  *     try:
72826  *         tag = _namespacedNameFromNsName(c_namespace, c_localname)
72827  *         if c_nb_defaulted > 0:             # <<<<<<<<<<<<<<
72828  *             # only add default attributes if we asked for them
72829  *             if c_ctxt.loadsubset & xmlparser.XML_COMPLETE_ATTRS == 0:
72830  */
72831       __pyx_t_1 = (__pyx_v_c_nb_defaulted > 0);
72832       if (__pyx_t_1) {
72833
72834         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":139
72835  *         if c_nb_defaulted > 0:
72836  *             # only add default attributes if we asked for them
72837  *             if c_ctxt.loadsubset & xmlparser.XML_COMPLETE_ATTRS == 0:             # <<<<<<<<<<<<<<
72838  *                 c_nb_attributes = c_nb_attributes - c_nb_defaulted
72839  *         if c_nb_attributes == 0:
72840  */
72841         __pyx_t_1 = ((__pyx_v_c_ctxt->loadsubset & XML_COMPLETE_ATTRS) == 0);
72842         if (__pyx_t_1) {
72843
72844           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":140
72845  *             # only add default attributes if we asked for them
72846  *             if c_ctxt.loadsubset & xmlparser.XML_COMPLETE_ATTRS == 0:
72847  *                 c_nb_attributes = c_nb_attributes - c_nb_defaulted             # <<<<<<<<<<<<<<
72848  *         if c_nb_attributes == 0:
72849  *             attrib = EMPTY_READ_ONLY_DICT
72850  */
72851           __pyx_v_c_nb_attributes = (__pyx_v_c_nb_attributes - __pyx_v_c_nb_defaulted);
72852           goto __pyx_L14;
72853         }
72854         __pyx_L14:;
72855         goto __pyx_L13;
72856       }
72857       __pyx_L13:;
72858
72859       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":141
72860  *             if c_ctxt.loadsubset & xmlparser.XML_COMPLETE_ATTRS == 0:
72861  *                 c_nb_attributes = c_nb_attributes - c_nb_defaulted
72862  *         if c_nb_attributes == 0:             # <<<<<<<<<<<<<<
72863  *             attrib = EMPTY_READ_ONLY_DICT
72864  *         else:
72865  */
72866       __pyx_t_1 = (__pyx_v_c_nb_attributes == 0);
72867       if (__pyx_t_1) {
72868
72869         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":142
72870  *                 c_nb_attributes = c_nb_attributes - c_nb_defaulted
72871  *         if c_nb_attributes == 0:
72872  *             attrib = EMPTY_READ_ONLY_DICT             # <<<<<<<<<<<<<<
72873  *         else:
72874  *             attrib = {}
72875  */
72876         __Pyx_INCREF(__pyx_v_4lxml_5etree_EMPTY_READ_ONLY_DICT);
72877         __Pyx_DECREF(__pyx_v_attrib);
72878         __pyx_v_attrib = __pyx_v_4lxml_5etree_EMPTY_READ_ONLY_DICT;
72879         goto __pyx_L15;
72880       }
72881       /*else*/ {
72882
72883         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":144
72884  *             attrib = EMPTY_READ_ONLY_DICT
72885  *         else:
72886  *             attrib = {}             # <<<<<<<<<<<<<<
72887  *             for i from 0 <= i < c_nb_attributes:
72888  *                 name = _namespacedNameFromNsName(
72889  */
72890         __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
72891         __Pyx_GOTREF(((PyObject *)__pyx_1));
72892         __Pyx_DECREF(__pyx_v_attrib);
72893         __pyx_v_attrib = ((PyObject *)__pyx_1);
72894         __pyx_1 = 0;
72895
72896         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":145
72897  *         else:
72898  *             attrib = {}
72899  *             for i from 0 <= i < c_nb_attributes:             # <<<<<<<<<<<<<<
72900  *                 name = _namespacedNameFromNsName(
72901  *                     c_attributes[2], c_attributes[0])
72902  */
72903         __pyx_t_3 = __pyx_v_c_nb_attributes;
72904         for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
72905
72906           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":147
72907  *             for i from 0 <= i < c_nb_attributes:
72908  *                 name = _namespacedNameFromNsName(
72909  *                     c_attributes[2], c_attributes[0])             # <<<<<<<<<<<<<<
72910  *                 if c_attributes[3] is NULL:
72911  *                     if python.IS_PYTHON3:
72912  */
72913           __pyx_t_2 = __pyx_f_4lxml_5etree__namespacedNameFromNsName((__pyx_v_c_attributes[2]), (__pyx_v_c_attributes[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
72914           __Pyx_GOTREF(__pyx_t_2);
72915           __Pyx_DECREF(__pyx_v_name);
72916           __pyx_v_name = __pyx_t_2;
72917           __pyx_t_2 = 0;
72918
72919           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":148
72920  *                 name = _namespacedNameFromNsName(
72921  *                     c_attributes[2], c_attributes[0])
72922  *                 if c_attributes[3] is NULL:             # <<<<<<<<<<<<<<
72923  *                     if python.IS_PYTHON3:
72924  *                         value = u''
72925  */
72926           __pyx_t_1 = ((__pyx_v_c_attributes[3]) == NULL);
72927           if (__pyx_t_1) {
72928
72929             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":149
72930  *                     c_attributes[2], c_attributes[0])
72931  *                 if c_attributes[3] is NULL:
72932  *                     if python.IS_PYTHON3:             # <<<<<<<<<<<<<<
72933  *                         value = u''
72934  *                     else:
72935  */
72936             __pyx_t_1 = IS_PYTHON3;
72937             if (__pyx_t_1) {
72938
72939               /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":150
72940  *                 if c_attributes[3] is NULL:
72941  *                     if python.IS_PYTHON3:
72942  *                         value = u''             # <<<<<<<<<<<<<<
72943  *                     else:
72944  *                         value = ''
72945  */
72946               __Pyx_INCREF(((PyObject *)__pyx_kp_461));
72947               __Pyx_DECREF(__pyx_v_value);
72948               __pyx_v_value = ((PyObject *)__pyx_kp_461);
72949               goto __pyx_L19;
72950             }
72951             /*else*/ {
72952
72953               /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":152
72954  *                         value = u''
72955  *                     else:
72956  *                         value = ''             # <<<<<<<<<<<<<<
72957  *                 else:
72958  *                     value = python.PyUnicode_DecodeUTF8(
72959  */
72960               __Pyx_INCREF(__pyx_kp_462);
72961               __Pyx_DECREF(__pyx_v_value);
72962               __pyx_v_value = __pyx_kp_462;
72963             }
72964             __pyx_L19:;
72965             goto __pyx_L18;
72966           }
72967           /*else*/ {
72968
72969             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":156
72970  *                     value = python.PyUnicode_DecodeUTF8(
72971  *                         c_attributes[3], c_attributes[4] - c_attributes[3],
72972  *                         "strict")             # <<<<<<<<<<<<<<
72973  *                 attrib[name] = value
72974  *                 c_attributes += 5
72975  */
72976             __pyx_t_2 = PyUnicode_DecodeUTF8((__pyx_v_c_attributes[3]), ((__pyx_v_c_attributes[4]) - (__pyx_v_c_attributes[3])), __pyx_k_463); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
72977             __Pyx_GOTREF(__pyx_t_2);
72978             __Pyx_DECREF(__pyx_v_value);
72979             __pyx_v_value = __pyx_t_2;
72980             __pyx_t_2 = 0;
72981           }
72982           __pyx_L18:;
72983
72984           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":157
72985  *                         c_attributes[3], c_attributes[4] - c_attributes[3],
72986  *                         "strict")
72987  *                 attrib[name] = value             # <<<<<<<<<<<<<<
72988  *                 c_attributes += 5
72989  *         if c_nb_namespaces == 0:
72990  */
72991           if (PyObject_SetItem(__pyx_v_attrib, __pyx_v_name, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
72992
72993           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":158
72994  *                         "strict")
72995  *                 attrib[name] = value
72996  *                 c_attributes += 5             # <<<<<<<<<<<<<<
72997  *         if c_nb_namespaces == 0:
72998  *             nsmap = EMPTY_READ_ONLY_DICT
72999  */
73000           __pyx_v_c_attributes += 5;
73001         }
73002       }
73003       __pyx_L15:;
73004
73005       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":159
73006  *                 attrib[name] = value
73007  *                 c_attributes += 5
73008  *         if c_nb_namespaces == 0:             # <<<<<<<<<<<<<<
73009  *             nsmap = EMPTY_READ_ONLY_DICT
73010  *         else:
73011  */
73012       __pyx_t_1 = (__pyx_v_c_nb_namespaces == 0);
73013       if (__pyx_t_1) {
73014
73015         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":160
73016  *                 c_attributes += 5
73017  *         if c_nb_namespaces == 0:
73018  *             nsmap = EMPTY_READ_ONLY_DICT             # <<<<<<<<<<<<<<
73019  *         else:
73020  *             nsmap = {}
73021  */
73022         __Pyx_INCREF(__pyx_v_4lxml_5etree_EMPTY_READ_ONLY_DICT);
73023         __Pyx_DECREF(__pyx_v_nsmap);
73024         __pyx_v_nsmap = __pyx_v_4lxml_5etree_EMPTY_READ_ONLY_DICT;
73025         goto __pyx_L20;
73026       }
73027       /*else*/ {
73028
73029         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":162
73030  *             nsmap = EMPTY_READ_ONLY_DICT
73031  *         else:
73032  *             nsmap = {}             # <<<<<<<<<<<<<<
73033  *             for i from 0 <= i < c_nb_namespaces:
73034  *                 if c_namespaces[0] is NULL:
73035  */
73036         __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
73037         __Pyx_GOTREF(((PyObject *)__pyx_1));
73038         __Pyx_DECREF(__pyx_v_nsmap);
73039         __pyx_v_nsmap = ((PyObject *)__pyx_1);
73040         __pyx_1 = 0;
73041
73042         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":163
73043  *         else:
73044  *             nsmap = {}
73045  *             for i from 0 <= i < c_nb_namespaces:             # <<<<<<<<<<<<<<
73046  *                 if c_namespaces[0] is NULL:
73047  *                     prefix = None
73048  */
73049         __pyx_t_3 = __pyx_v_c_nb_namespaces;
73050         for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
73051
73052           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":164
73053  *             nsmap = {}
73054  *             for i from 0 <= i < c_nb_namespaces:
73055  *                 if c_namespaces[0] is NULL:             # <<<<<<<<<<<<<<
73056  *                     prefix = None
73057  *                 else:
73058  */
73059           __pyx_t_1 = ((__pyx_v_c_namespaces[0]) == NULL);
73060           if (__pyx_t_1) {
73061
73062             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":165
73063  *             for i from 0 <= i < c_nb_namespaces:
73064  *                 if c_namespaces[0] is NULL:
73065  *                     prefix = None             # <<<<<<<<<<<<<<
73066  *                 else:
73067  *                     prefix = funicode(c_namespaces[0])
73068  */
73069             __Pyx_INCREF(Py_None);
73070             __Pyx_DECREF(__pyx_v_prefix);
73071             __pyx_v_prefix = Py_None;
73072             goto __pyx_L23;
73073           }
73074           /*else*/ {
73075
73076             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":167
73077  *                     prefix = None
73078  *                 else:
73079  *                     prefix = funicode(c_namespaces[0])             # <<<<<<<<<<<<<<
73080  *                 nsmap[prefix] = funicode(c_namespaces[1])
73081  *                 c_namespaces += 2
73082  */
73083             __pyx_t_2 = __pyx_f_4lxml_5etree_funicode((__pyx_v_c_namespaces[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
73084             __Pyx_GOTREF(__pyx_t_2);
73085             __Pyx_DECREF(__pyx_v_prefix);
73086             __pyx_v_prefix = __pyx_t_2;
73087             __pyx_t_2 = 0;
73088           }
73089           __pyx_L23:;
73090
73091           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":168
73092  *                 else:
73093  *                     prefix = funicode(c_namespaces[0])
73094  *                 nsmap[prefix] = funicode(c_namespaces[1])             # <<<<<<<<<<<<<<
73095  *                 c_namespaces += 2
73096  *         element = context._target._handleSaxStart(tag, attrib, nsmap)
73097  */
73098           __pyx_t_2 = __pyx_f_4lxml_5etree_funicode((__pyx_v_c_namespaces[1])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
73099           __Pyx_GOTREF(__pyx_t_2);
73100           if (PyObject_SetItem(__pyx_v_nsmap, __pyx_v_prefix, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
73101           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
73102
73103           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":169
73104  *                     prefix = funicode(c_namespaces[0])
73105  *                 nsmap[prefix] = funicode(c_namespaces[1])
73106  *                 c_namespaces += 2             # <<<<<<<<<<<<<<
73107  *         element = context._target._handleSaxStart(tag, attrib, nsmap)
73108  *         if element is not None and c_ctxt.input is not NULL:
73109  */
73110           __pyx_v_c_namespaces += 2;
73111         }
73112       }
73113       __pyx_L20:;
73114
73115       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":170
73116  *                 nsmap[prefix] = funicode(c_namespaces[1])
73117  *                 c_namespaces += 2
73118  *         element = context._target._handleSaxStart(tag, attrib, nsmap)             # <<<<<<<<<<<<<<
73119  *         if element is not None and c_ctxt.input is not NULL:
73120  *             if c_ctxt.input.line < 65535:
73121  */
73122       __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxStart(__pyx_v_context->_target, __pyx_v_tag, __pyx_v_attrib, __pyx_v_nsmap); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
73123       __Pyx_GOTREF(__pyx_t_2);
73124       if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
73125       __Pyx_DECREF(((PyObject *)__pyx_v_element));
73126       __pyx_v_element = ((struct LxmlElement *)__pyx_t_2);
73127       __pyx_t_2 = 0;
73128
73129       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":171
73130  *                 c_namespaces += 2
73131  *         element = context._target._handleSaxStart(tag, attrib, nsmap)
73132  *         if element is not None and c_ctxt.input is not NULL:             # <<<<<<<<<<<<<<
73133  *             if c_ctxt.input.line < 65535:
73134  *                 element._c_node.line = <short>c_ctxt.input.line
73135  */
73136       __pyx_t_1 = (((PyObject *)__pyx_v_element) != Py_None);
73137       if (__pyx_t_1) {
73138         __pyx_t_4 = (__pyx_v_c_ctxt->input != NULL);
73139       } else {
73140         __pyx_t_4 = __pyx_t_1;
73141       }
73142       if (__pyx_t_4) {
73143
73144         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":172
73145  *         element = context._target._handleSaxStart(tag, attrib, nsmap)
73146  *         if element is not None and c_ctxt.input is not NULL:
73147  *             if c_ctxt.input.line < 65535:             # <<<<<<<<<<<<<<
73148  *                 element._c_node.line = <short>c_ctxt.input.line
73149  *             else:
73150  */
73151         __pyx_t_4 = (__pyx_v_c_ctxt->input->line < 65535);
73152         if (__pyx_t_4) {
73153
73154           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":173
73155  *         if element is not None and c_ctxt.input is not NULL:
73156  *             if c_ctxt.input.line < 65535:
73157  *                 element._c_node.line = <short>c_ctxt.input.line             # <<<<<<<<<<<<<<
73158  *             else:
73159  *                 element._c_node.line = 65535
73160  */
73161           __pyx_v_element->_c_node->line = ((short)__pyx_v_c_ctxt->input->line);
73162           goto __pyx_L25;
73163         }
73164         /*else*/ {
73165
73166           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":175
73167  *                 element._c_node.line = <short>c_ctxt.input.line
73168  *             else:
73169  *                 element._c_node.line = 65535             # <<<<<<<<<<<<<<
73170  *     except:
73171  *         context._handleSaxException(c_ctxt)
73172  */
73173           __pyx_v_element->_c_node->line = 65535;
73174         }
73175         __pyx_L25:;
73176         goto __pyx_L24;
73177       }
73178       __pyx_L24:;
73179     }
73180     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
73181     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
73182     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
73183     goto __pyx_L12_try_end;
73184     __pyx_L5_error:;
73185     __Pyx_XDECREF(__pyx_1); __pyx_1 = 0;
73186     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
73187
73188     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":176
73189  *             else:
73190  *                 element._c_node.line = 65535
73191  *     except:             # <<<<<<<<<<<<<<
73192  *         context._handleSaxException(c_ctxt)
73193  * 
73194  */
73195     /*except:*/ {
73196       __Pyx_AddTraceback("lxml.etree._handleSaxStart");
73197       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
73198       __Pyx_GOTREF(__pyx_t_2);
73199       __Pyx_GOTREF(__pyx_t_5);
73200       __Pyx_GOTREF(__pyx_t_6);
73201
73202       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":177
73203  *                 element._c_node.line = 65535
73204  *     except:
73205  *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<<
73206  * 
73207  * cdef void _handleSaxStartNoNs(void* ctxt, char* c_name,
73208  */
73209       ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->_handleSaxException(__pyx_v_context, __pyx_v_c_ctxt);
73210       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
73211       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
73212       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
73213       goto __pyx_L6_exception_handled;
73214     }
73215     __pyx_L7_except_error:;
73216     __Pyx_XDECREF(__pyx_save_exc_type);
73217     __Pyx_XDECREF(__pyx_save_exc_value);
73218     __Pyx_XDECREF(__pyx_save_exc_tb);
73219     goto __pyx_L1_error;
73220     __pyx_L6_exception_handled:;
73221     __Pyx_XGIVEREF(__pyx_save_exc_type);
73222     __Pyx_XGIVEREF(__pyx_save_exc_value);
73223     __Pyx_XGIVEREF(__pyx_save_exc_tb);
73224     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
73225     __pyx_L12_try_end:;
73226   }
73227
73228   goto __pyx_L0;
73229   __pyx_L1_error:;
73230   __Pyx_XDECREF(__pyx_1);
73231   __Pyx_XDECREF(__pyx_t_2);
73232   __Pyx_XDECREF(__pyx_t_5);
73233   __Pyx_XDECREF(__pyx_t_6);
73234   __Pyx_WriteUnraisable("lxml.etree._handleSaxStart");
73235   __pyx_L0:;
73236   __Pyx_DECREF((PyObject *)__pyx_v_context);
73237   __Pyx_DECREF((PyObject *)__pyx_v_element);
73238   __Pyx_DECREF(__pyx_v_tag);
73239   __Pyx_DECREF(__pyx_v_attrib);
73240   __Pyx_DECREF(__pyx_v_name);
73241   __Pyx_DECREF(__pyx_v_value);
73242   __Pyx_DECREF(__pyx_v_nsmap);
73243   __Pyx_DECREF(__pyx_v_prefix);
73244   __Pyx_FinishRefcountContext();
73245   PyGILState_Release(_save);
73246 }
73247
73248 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":179
73249  *         context._handleSaxException(c_ctxt)
73250  * 
73251  * cdef void _handleSaxStartNoNs(void* ctxt, char* c_name,             # <<<<<<<<<<<<<<
73252  *                               char** c_attributes) with gil:
73253  *     cdef _SaxParserContext context
73254  */
73255
73256 static  void __pyx_f_4lxml_5etree__handleSaxStartNoNs(void *__pyx_v_ctxt, char *__pyx_v_c_name, char **__pyx_v_c_attributes) {
73257   struct __pyx_obj_4lxml_5etree__SaxParserContext *__pyx_v_context;
73258   xmlParserCtxt *__pyx_v_c_ctxt;
73259   struct LxmlElement *__pyx_v_element;
73260   PyObject *__pyx_v_tag;
73261   PyObject *__pyx_v_attrib;
73262   PyObject *__pyx_v_name;
73263   PyObject *__pyx_v_value;
73264   PyObject *__pyx_1 = 0;
73265   int __pyx_t_1;
73266   PyObject *__pyx_t_2 = NULL;
73267   int __pyx_t_3;
73268   PyObject *__pyx_t_4 = NULL;
73269   PyObject *__pyx_t_5 = NULL;
73270   PyGILState_STATE _save = PyGILState_Ensure();
73271   __Pyx_SetupRefcountContext("_handleSaxStartNoNs");
73272   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)Py_None); __Pyx_INCREF(Py_None);
73273   __pyx_v_element = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
73274   __pyx_v_tag = Py_None; __Pyx_INCREF(Py_None);
73275   __pyx_v_attrib = Py_None; __Pyx_INCREF(Py_None);
73276   __pyx_v_name = Py_None; __Pyx_INCREF(Py_None);
73277   __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);
73278
73279   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":184
73280  *     cdef xmlparser.xmlParserCtxt* c_ctxt
73281  *     cdef _Element element
73282  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<<
73283  *     if c_ctxt._private is NULL:
73284  *         return
73285  */
73286   __pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);
73287
73288   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":185
73289  *     cdef _Element element
73290  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
73291  *     if c_ctxt._private is NULL:             # <<<<<<<<<<<<<<
73292  *         return
73293  *     context = <_SaxParserContext>c_ctxt._private
73294  */
73295   __pyx_t_1 = (__pyx_v_c_ctxt->_private == NULL);
73296   if (__pyx_t_1) {
73297
73298     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":186
73299  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
73300  *     if c_ctxt._private is NULL:
73301  *         return             # <<<<<<<<<<<<<<
73302  *     context = <_SaxParserContext>c_ctxt._private
73303  *     if context._origSaxStartNoNs is not NULL:
73304  */
73305     goto __pyx_L0;
73306     goto __pyx_L3;
73307   }
73308   __pyx_L3:;
73309
73310   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":187
73311  *     if c_ctxt._private is NULL:
73312  *         return
73313  *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<<
73314  *     if context._origSaxStartNoNs is not NULL:
73315  *         context._origSaxStartNoNs(c_ctxt, c_name, c_attributes)
73316  */
73317   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_v_c_ctxt->_private)));
73318   __Pyx_DECREF(((PyObject *)__pyx_v_context));
73319   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_v_c_ctxt->_private);
73320
73321   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":188
73322  *         return
73323  *     context = <_SaxParserContext>c_ctxt._private
73324  *     if context._origSaxStartNoNs is not NULL:             # <<<<<<<<<<<<<<
73325  *         context._origSaxStartNoNs(c_ctxt, c_name, c_attributes)
73326  *     try:
73327  */
73328   __pyx_t_1 = (__pyx_v_context->_origSaxStartNoNs != NULL);
73329   if (__pyx_t_1) {
73330
73331     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":189
73332  *     context = <_SaxParserContext>c_ctxt._private
73333  *     if context._origSaxStartNoNs is not NULL:
73334  *         context._origSaxStartNoNs(c_ctxt, c_name, c_attributes)             # <<<<<<<<<<<<<<
73335  *     try:
73336  *         tag = funicode(c_name)
73337  */
73338     __pyx_v_context->_origSaxStartNoNs(__pyx_v_c_ctxt, __pyx_v_c_name, __pyx_v_c_attributes);
73339     goto __pyx_L4;
73340   }
73341   __pyx_L4:;
73342
73343   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":190
73344  *     if context._origSaxStartNoNs is not NULL:
73345  *         context._origSaxStartNoNs(c_ctxt, c_name, c_attributes)
73346  *     try:             # <<<<<<<<<<<<<<
73347  *         tag = funicode(c_name)
73348  *         if c_attributes is NULL:
73349  */
73350   {
73351     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
73352     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
73353     __Pyx_XGOTREF(__pyx_save_exc_type);
73354     __Pyx_XGOTREF(__pyx_save_exc_value);
73355     __Pyx_XGOTREF(__pyx_save_exc_tb);
73356     /*try:*/ {
73357
73358       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":191
73359  *         context._origSaxStartNoNs(c_ctxt, c_name, c_attributes)
73360  *     try:
73361  *         tag = funicode(c_name)             # <<<<<<<<<<<<<<
73362  *         if c_attributes is NULL:
73363  *             attrib = EMPTY_READ_ONLY_DICT
73364  */
73365       __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
73366       __Pyx_GOTREF(__pyx_t_2);
73367       __Pyx_DECREF(__pyx_v_tag);
73368       __pyx_v_tag = __pyx_t_2;
73369       __pyx_t_2 = 0;
73370
73371       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":192
73372  *     try:
73373  *         tag = funicode(c_name)
73374  *         if c_attributes is NULL:             # <<<<<<<<<<<<<<
73375  *             attrib = EMPTY_READ_ONLY_DICT
73376  *         else:
73377  */
73378       __pyx_t_1 = (__pyx_v_c_attributes == NULL);
73379       if (__pyx_t_1) {
73380
73381         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":193
73382  *         tag = funicode(c_name)
73383  *         if c_attributes is NULL:
73384  *             attrib = EMPTY_READ_ONLY_DICT             # <<<<<<<<<<<<<<
73385  *         else:
73386  *             attrib = {}
73387  */
73388         __Pyx_INCREF(__pyx_v_4lxml_5etree_EMPTY_READ_ONLY_DICT);
73389         __Pyx_DECREF(__pyx_v_attrib);
73390         __pyx_v_attrib = __pyx_v_4lxml_5etree_EMPTY_READ_ONLY_DICT;
73391         goto __pyx_L13;
73392       }
73393       /*else*/ {
73394
73395         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":195
73396  *             attrib = EMPTY_READ_ONLY_DICT
73397  *         else:
73398  *             attrib = {}             # <<<<<<<<<<<<<<
73399  *             while c_attributes[0] is not NULL:
73400  *                 name = funicode(c_attributes[0])
73401  */
73402         __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
73403         __Pyx_GOTREF(((PyObject *)__pyx_1));
73404         __Pyx_DECREF(__pyx_v_attrib);
73405         __pyx_v_attrib = ((PyObject *)__pyx_1);
73406         __pyx_1 = 0;
73407
73408         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":196
73409  *         else:
73410  *             attrib = {}
73411  *             while c_attributes[0] is not NULL:             # <<<<<<<<<<<<<<
73412  *                 name = funicode(c_attributes[0])
73413  *                 if c_attributes[1] is NULL:
73414  */
73415         while (1) {
73416           __pyx_t_1 = ((__pyx_v_c_attributes[0]) != NULL);
73417           if (!__pyx_t_1) break;
73418
73419           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":197
73420  *             attrib = {}
73421  *             while c_attributes[0] is not NULL:
73422  *                 name = funicode(c_attributes[0])             # <<<<<<<<<<<<<<
73423  *                 if c_attributes[1] is NULL:
73424  *                     if python.IS_PYTHON3:
73425  */
73426           __pyx_t_2 = __pyx_f_4lxml_5etree_funicode((__pyx_v_c_attributes[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
73427           __Pyx_GOTREF(__pyx_t_2);
73428           __Pyx_DECREF(__pyx_v_name);
73429           __pyx_v_name = __pyx_t_2;
73430           __pyx_t_2 = 0;
73431
73432           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":198
73433  *             while c_attributes[0] is not NULL:
73434  *                 name = funicode(c_attributes[0])
73435  *                 if c_attributes[1] is NULL:             # <<<<<<<<<<<<<<
73436  *                     if python.IS_PYTHON3:
73437  *                         value = u''
73438  */
73439           __pyx_t_1 = ((__pyx_v_c_attributes[1]) == NULL);
73440           if (__pyx_t_1) {
73441
73442             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":199
73443  *                 name = funicode(c_attributes[0])
73444  *                 if c_attributes[1] is NULL:
73445  *                     if python.IS_PYTHON3:             # <<<<<<<<<<<<<<
73446  *                         value = u''
73447  *                     else:
73448  */
73449             __pyx_t_1 = IS_PYTHON3;
73450             if (__pyx_t_1) {
73451
73452               /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":200
73453  *                 if c_attributes[1] is NULL:
73454  *                     if python.IS_PYTHON3:
73455  *                         value = u''             # <<<<<<<<<<<<<<
73456  *                     else:
73457  *                         value = ''
73458  */
73459               __Pyx_INCREF(((PyObject *)__pyx_kp_464));
73460               __Pyx_DECREF(__pyx_v_value);
73461               __pyx_v_value = ((PyObject *)__pyx_kp_464);
73462               goto __pyx_L17;
73463             }
73464             /*else*/ {
73465
73466               /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":202
73467  *                         value = u''
73468  *                     else:
73469  *                         value = ''             # <<<<<<<<<<<<<<
73470  *                 else:
73471  *                     value = funicode(c_attributes[1])
73472  */
73473               __Pyx_INCREF(__pyx_kp_465);
73474               __Pyx_DECREF(__pyx_v_value);
73475               __pyx_v_value = __pyx_kp_465;
73476             }
73477             __pyx_L17:;
73478             goto __pyx_L16;
73479           }
73480           /*else*/ {
73481
73482             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":204
73483  *                         value = ''
73484  *                 else:
73485  *                     value = funicode(c_attributes[1])             # <<<<<<<<<<<<<<
73486  *                 c_attributes = c_attributes + 2
73487  *                 attrib[name] = value
73488  */
73489             __pyx_t_2 = __pyx_f_4lxml_5etree_funicode((__pyx_v_c_attributes[1])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
73490             __Pyx_GOTREF(__pyx_t_2);
73491             __Pyx_DECREF(__pyx_v_value);
73492             __pyx_v_value = __pyx_t_2;
73493             __pyx_t_2 = 0;
73494           }
73495           __pyx_L16:;
73496
73497           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":205
73498  *                 else:
73499  *                     value = funicode(c_attributes[1])
73500  *                 c_attributes = c_attributes + 2             # <<<<<<<<<<<<<<
73501  *                 attrib[name] = value
73502  *         element = context._target._handleSaxStart(
73503  */
73504           __pyx_v_c_attributes = (__pyx_v_c_attributes + 2);
73505
73506           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":206
73507  *                     value = funicode(c_attributes[1])
73508  *                 c_attributes = c_attributes + 2
73509  *                 attrib[name] = value             # <<<<<<<<<<<<<<
73510  *         element = context._target._handleSaxStart(
73511  *             tag, attrib, EMPTY_READ_ONLY_DICT)
73512  */
73513           if (PyObject_SetItem(__pyx_v_attrib, __pyx_v_name, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
73514         }
73515       }
73516       __pyx_L13:;
73517
73518       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":208
73519  *                 attrib[name] = value
73520  *         element = context._target._handleSaxStart(
73521  *             tag, attrib, EMPTY_READ_ONLY_DICT)             # <<<<<<<<<<<<<<
73522  *         if element is not None and c_ctxt.input is not NULL:
73523  *             if c_ctxt.input.line < 65535:
73524  */
73525       __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxStart(__pyx_v_context->_target, __pyx_v_tag, __pyx_v_attrib, __pyx_v_4lxml_5etree_EMPTY_READ_ONLY_DICT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
73526       __Pyx_GOTREF(__pyx_t_2);
73527       if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
73528       __Pyx_DECREF(((PyObject *)__pyx_v_element));
73529       __pyx_v_element = ((struct LxmlElement *)__pyx_t_2);
73530       __pyx_t_2 = 0;
73531
73532       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":209
73533  *         element = context._target._handleSaxStart(
73534  *             tag, attrib, EMPTY_READ_ONLY_DICT)
73535  *         if element is not None and c_ctxt.input is not NULL:             # <<<<<<<<<<<<<<
73536  *             if c_ctxt.input.line < 65535:
73537  *                 element._c_node.line = <short>c_ctxt.input.line
73538  */
73539       __pyx_t_1 = (((PyObject *)__pyx_v_element) != Py_None);
73540       if (__pyx_t_1) {
73541         __pyx_t_3 = (__pyx_v_c_ctxt->input != NULL);
73542       } else {
73543         __pyx_t_3 = __pyx_t_1;
73544       }
73545       if (__pyx_t_3) {
73546
73547         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":210
73548  *             tag, attrib, EMPTY_READ_ONLY_DICT)
73549  *         if element is not None and c_ctxt.input is not NULL:
73550  *             if c_ctxt.input.line < 65535:             # <<<<<<<<<<<<<<
73551  *                 element._c_node.line = <short>c_ctxt.input.line
73552  *             else:
73553  */
73554         __pyx_t_3 = (__pyx_v_c_ctxt->input->line < 65535);
73555         if (__pyx_t_3) {
73556
73557           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":211
73558  *         if element is not None and c_ctxt.input is not NULL:
73559  *             if c_ctxt.input.line < 65535:
73560  *                 element._c_node.line = <short>c_ctxt.input.line             # <<<<<<<<<<<<<<
73561  *             else:
73562  *                 element._c_node.line = 65535
73563  */
73564           __pyx_v_element->_c_node->line = ((short)__pyx_v_c_ctxt->input->line);
73565           goto __pyx_L19;
73566         }
73567         /*else*/ {
73568
73569           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":213
73570  *                 element._c_node.line = <short>c_ctxt.input.line
73571  *             else:
73572  *                 element._c_node.line = 65535             # <<<<<<<<<<<<<<
73573  *     except:
73574  *         context._handleSaxException(c_ctxt)
73575  */
73576           __pyx_v_element->_c_node->line = 65535;
73577         }
73578         __pyx_L19:;
73579         goto __pyx_L18;
73580       }
73581       __pyx_L18:;
73582     }
73583     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
73584     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
73585     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
73586     goto __pyx_L12_try_end;
73587     __pyx_L5_error:;
73588     __Pyx_XDECREF(__pyx_1); __pyx_1 = 0;
73589     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
73590
73591     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":214
73592  *             else:
73593  *                 element._c_node.line = 65535
73594  *     except:             # <<<<<<<<<<<<<<
73595  *         context._handleSaxException(c_ctxt)
73596  * 
73597  */
73598     /*except:*/ {
73599       __Pyx_AddTraceback("lxml.etree._handleSaxStartNoNs");
73600       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
73601       __Pyx_GOTREF(__pyx_t_2);
73602       __Pyx_GOTREF(__pyx_t_4);
73603       __Pyx_GOTREF(__pyx_t_5);
73604
73605       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":215
73606  *                 element._c_node.line = 65535
73607  *     except:
73608  *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<<
73609  * 
73610  * cdef void _handleSaxEnd(void* ctxt, char* c_localname, char* c_prefix,
73611  */
73612       ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->_handleSaxException(__pyx_v_context, __pyx_v_c_ctxt);
73613       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
73614       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
73615       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
73616       goto __pyx_L6_exception_handled;
73617     }
73618     __pyx_L7_except_error:;
73619     __Pyx_XDECREF(__pyx_save_exc_type);
73620     __Pyx_XDECREF(__pyx_save_exc_value);
73621     __Pyx_XDECREF(__pyx_save_exc_tb);
73622     goto __pyx_L1_error;
73623     __pyx_L6_exception_handled:;
73624     __Pyx_XGIVEREF(__pyx_save_exc_type);
73625     __Pyx_XGIVEREF(__pyx_save_exc_value);
73626     __Pyx_XGIVEREF(__pyx_save_exc_tb);
73627     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
73628     __pyx_L12_try_end:;
73629   }
73630
73631   goto __pyx_L0;
73632   __pyx_L1_error:;
73633   __Pyx_XDECREF(__pyx_1);
73634   __Pyx_XDECREF(__pyx_t_2);
73635   __Pyx_XDECREF(__pyx_t_4);
73636   __Pyx_XDECREF(__pyx_t_5);
73637   __Pyx_WriteUnraisable("lxml.etree._handleSaxStartNoNs");
73638   __pyx_L0:;
73639   __Pyx_DECREF((PyObject *)__pyx_v_context);
73640   __Pyx_DECREF((PyObject *)__pyx_v_element);
73641   __Pyx_DECREF(__pyx_v_tag);
73642   __Pyx_DECREF(__pyx_v_attrib);
73643   __Pyx_DECREF(__pyx_v_name);
73644   __Pyx_DECREF(__pyx_v_value);
73645   __Pyx_FinishRefcountContext();
73646   PyGILState_Release(_save);
73647 }
73648
73649 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":217
73650  *         context._handleSaxException(c_ctxt)
73651  * 
73652  * cdef void _handleSaxEnd(void* ctxt, char* c_localname, char* c_prefix,             # <<<<<<<<<<<<<<
73653  *                         char* c_namespace) with gil:
73654  *     cdef _SaxParserContext context
73655  */
73656
73657 static  void __pyx_f_4lxml_5etree__handleSaxEnd(void *__pyx_v_ctxt, char *__pyx_v_c_localname, char *__pyx_v_c_prefix, char *__pyx_v_c_namespace) {
73658   struct __pyx_obj_4lxml_5etree__SaxParserContext *__pyx_v_context;
73659   xmlParserCtxt *__pyx_v_c_ctxt;
73660   PyObject *__pyx_v_tag;
73661   int __pyx_t_1;
73662   PyObject *__pyx_t_2 = NULL;
73663   PyObject *__pyx_t_3 = NULL;
73664   PyObject *__pyx_t_4 = NULL;
73665   PyGILState_STATE _save = PyGILState_Ensure();
73666   __Pyx_SetupRefcountContext("_handleSaxEnd");
73667   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)Py_None); __Pyx_INCREF(Py_None);
73668   __pyx_v_tag = Py_None; __Pyx_INCREF(Py_None);
73669
73670   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":221
73671  *     cdef _SaxParserContext context
73672  *     cdef xmlparser.xmlParserCtxt* c_ctxt
73673  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<<
73674  *     if c_ctxt._private is NULL:
73675  *         return
73676  */
73677   __pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);
73678
73679   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":222
73680  *     cdef xmlparser.xmlParserCtxt* c_ctxt
73681  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
73682  *     if c_ctxt._private is NULL:             # <<<<<<<<<<<<<<
73683  *         return
73684  *     context = <_SaxParserContext>c_ctxt._private
73685  */
73686   __pyx_t_1 = (__pyx_v_c_ctxt->_private == NULL);
73687   if (__pyx_t_1) {
73688
73689     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":223
73690  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
73691  *     if c_ctxt._private is NULL:
73692  *         return             # <<<<<<<<<<<<<<
73693  *     context = <_SaxParserContext>c_ctxt._private
73694  *     if context._origSaxEnd is not NULL:
73695  */
73696     goto __pyx_L0;
73697     goto __pyx_L3;
73698   }
73699   __pyx_L3:;
73700
73701   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":224
73702  *     if c_ctxt._private is NULL:
73703  *         return
73704  *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<<
73705  *     if context._origSaxEnd is not NULL:
73706  *         context._origSaxEnd(c_ctxt, c_localname, c_prefix, c_namespace)
73707  */
73708   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_v_c_ctxt->_private)));
73709   __Pyx_DECREF(((PyObject *)__pyx_v_context));
73710   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_v_c_ctxt->_private);
73711
73712   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":225
73713  *         return
73714  *     context = <_SaxParserContext>c_ctxt._private
73715  *     if context._origSaxEnd is not NULL:             # <<<<<<<<<<<<<<
73716  *         context._origSaxEnd(c_ctxt, c_localname, c_prefix, c_namespace)
73717  *     try:
73718  */
73719   __pyx_t_1 = (__pyx_v_context->_origSaxEnd != NULL);
73720   if (__pyx_t_1) {
73721
73722     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":226
73723  *     context = <_SaxParserContext>c_ctxt._private
73724  *     if context._origSaxEnd is not NULL:
73725  *         context._origSaxEnd(c_ctxt, c_localname, c_prefix, c_namespace)             # <<<<<<<<<<<<<<
73726  *     try:
73727  *         tag = _namespacedNameFromNsName(c_namespace, c_localname)
73728  */
73729     __pyx_v_context->_origSaxEnd(__pyx_v_c_ctxt, __pyx_v_c_localname, __pyx_v_c_prefix, __pyx_v_c_namespace);
73730     goto __pyx_L4;
73731   }
73732   __pyx_L4:;
73733
73734   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":227
73735  *     if context._origSaxEnd is not NULL:
73736  *         context._origSaxEnd(c_ctxt, c_localname, c_prefix, c_namespace)
73737  *     try:             # <<<<<<<<<<<<<<
73738  *         tag = _namespacedNameFromNsName(c_namespace, c_localname)
73739  *         context._target._handleSaxEnd(tag)
73740  */
73741   {
73742     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
73743     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
73744     __Pyx_XGOTREF(__pyx_save_exc_type);
73745     __Pyx_XGOTREF(__pyx_save_exc_value);
73746     __Pyx_XGOTREF(__pyx_save_exc_tb);
73747     /*try:*/ {
73748
73749       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":228
73750  *         context._origSaxEnd(c_ctxt, c_localname, c_prefix, c_namespace)
73751  *     try:
73752  *         tag = _namespacedNameFromNsName(c_namespace, c_localname)             # <<<<<<<<<<<<<<
73753  *         context._target._handleSaxEnd(tag)
73754  *     except:
73755  */
73756       __pyx_t_2 = __pyx_f_4lxml_5etree__namespacedNameFromNsName(__pyx_v_c_namespace, __pyx_v_c_localname); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
73757       __Pyx_GOTREF(__pyx_t_2);
73758       __Pyx_DECREF(__pyx_v_tag);
73759       __pyx_v_tag = __pyx_t_2;
73760       __pyx_t_2 = 0;
73761
73762       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":229
73763  *     try:
73764  *         tag = _namespacedNameFromNsName(c_namespace, c_localname)
73765  *         context._target._handleSaxEnd(tag)             # <<<<<<<<<<<<<<
73766  *     except:
73767  *         context._handleSaxException(c_ctxt)
73768  */
73769       __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxEnd(__pyx_v_context->_target, __pyx_v_tag); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
73770       __Pyx_GOTREF(__pyx_t_2);
73771       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
73772     }
73773     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
73774     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
73775     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
73776     goto __pyx_L12_try_end;
73777     __pyx_L5_error:;
73778     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
73779
73780     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":230
73781  *         tag = _namespacedNameFromNsName(c_namespace, c_localname)
73782  *         context._target._handleSaxEnd(tag)
73783  *     except:             # <<<<<<<<<<<<<<
73784  *         context._handleSaxException(c_ctxt)
73785  * 
73786  */
73787     /*except:*/ {
73788       __Pyx_AddTraceback("lxml.etree._handleSaxEnd");
73789       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
73790       __Pyx_GOTREF(__pyx_t_2);
73791       __Pyx_GOTREF(__pyx_t_3);
73792       __Pyx_GOTREF(__pyx_t_4);
73793
73794       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":231
73795  *         context._target._handleSaxEnd(tag)
73796  *     except:
73797  *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<<
73798  * 
73799  * cdef void _handleSaxEndNoNs(void* ctxt, char* c_name) with gil:
73800  */
73801       ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->_handleSaxException(__pyx_v_context, __pyx_v_c_ctxt);
73802       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
73803       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
73804       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
73805       goto __pyx_L6_exception_handled;
73806     }
73807     __pyx_L7_except_error:;
73808     __Pyx_XDECREF(__pyx_save_exc_type);
73809     __Pyx_XDECREF(__pyx_save_exc_value);
73810     __Pyx_XDECREF(__pyx_save_exc_tb);
73811     goto __pyx_L1_error;
73812     __pyx_L6_exception_handled:;
73813     __Pyx_XGIVEREF(__pyx_save_exc_type);
73814     __Pyx_XGIVEREF(__pyx_save_exc_value);
73815     __Pyx_XGIVEREF(__pyx_save_exc_tb);
73816     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
73817     __pyx_L12_try_end:;
73818   }
73819
73820   goto __pyx_L0;
73821   __pyx_L1_error:;
73822   __Pyx_XDECREF(__pyx_t_2);
73823   __Pyx_XDECREF(__pyx_t_3);
73824   __Pyx_XDECREF(__pyx_t_4);
73825   __Pyx_WriteUnraisable("lxml.etree._handleSaxEnd");
73826   __pyx_L0:;
73827   __Pyx_DECREF((PyObject *)__pyx_v_context);
73828   __Pyx_DECREF(__pyx_v_tag);
73829   __Pyx_FinishRefcountContext();
73830   PyGILState_Release(_save);
73831 }
73832
73833 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":233
73834  *         context._handleSaxException(c_ctxt)
73835  * 
73836  * cdef void _handleSaxEndNoNs(void* ctxt, char* c_name) with gil:             # <<<<<<<<<<<<<<
73837  *     cdef _SaxParserContext context
73838  *     cdef xmlparser.xmlParserCtxt* c_ctxt
73839  */
73840
73841 static  void __pyx_f_4lxml_5etree__handleSaxEndNoNs(void *__pyx_v_ctxt, char *__pyx_v_c_name) {
73842   struct __pyx_obj_4lxml_5etree__SaxParserContext *__pyx_v_context;
73843   xmlParserCtxt *__pyx_v_c_ctxt;
73844   int __pyx_t_1;
73845   PyObject *__pyx_t_2 = NULL;
73846   PyObject *__pyx_t_3 = NULL;
73847   PyObject *__pyx_t_4 = NULL;
73848   PyGILState_STATE _save = PyGILState_Ensure();
73849   __Pyx_SetupRefcountContext("_handleSaxEndNoNs");
73850   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)Py_None); __Pyx_INCREF(Py_None);
73851
73852   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":236
73853  *     cdef _SaxParserContext context
73854  *     cdef xmlparser.xmlParserCtxt* c_ctxt
73855  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<<
73856  *     if c_ctxt._private is NULL:
73857  *         return
73858  */
73859   __pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);
73860
73861   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":237
73862  *     cdef xmlparser.xmlParserCtxt* c_ctxt
73863  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
73864  *     if c_ctxt._private is NULL:             # <<<<<<<<<<<<<<
73865  *         return
73866  *     context = <_SaxParserContext>c_ctxt._private
73867  */
73868   __pyx_t_1 = (__pyx_v_c_ctxt->_private == NULL);
73869   if (__pyx_t_1) {
73870
73871     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":238
73872  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
73873  *     if c_ctxt._private is NULL:
73874  *         return             # <<<<<<<<<<<<<<
73875  *     context = <_SaxParserContext>c_ctxt._private
73876  *     if context._origSaxEndNoNs is not NULL:
73877  */
73878     goto __pyx_L0;
73879     goto __pyx_L3;
73880   }
73881   __pyx_L3:;
73882
73883   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":239
73884  *     if c_ctxt._private is NULL:
73885  *         return
73886  *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<<
73887  *     if context._origSaxEndNoNs is not NULL:
73888  *         context._origSaxEndNoNs(c_ctxt, c_name)
73889  */
73890   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_v_c_ctxt->_private)));
73891   __Pyx_DECREF(((PyObject *)__pyx_v_context));
73892   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_v_c_ctxt->_private);
73893
73894   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":240
73895  *         return
73896  *     context = <_SaxParserContext>c_ctxt._private
73897  *     if context._origSaxEndNoNs is not NULL:             # <<<<<<<<<<<<<<
73898  *         context._origSaxEndNoNs(c_ctxt, c_name)
73899  *     try:
73900  */
73901   __pyx_t_1 = (__pyx_v_context->_origSaxEndNoNs != NULL);
73902   if (__pyx_t_1) {
73903
73904     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":241
73905  *     context = <_SaxParserContext>c_ctxt._private
73906  *     if context._origSaxEndNoNs is not NULL:
73907  *         context._origSaxEndNoNs(c_ctxt, c_name)             # <<<<<<<<<<<<<<
73908  *     try:
73909  *         context._target._handleSaxEnd(funicode(c_name))
73910  */
73911     __pyx_v_context->_origSaxEndNoNs(__pyx_v_c_ctxt, __pyx_v_c_name);
73912     goto __pyx_L4;
73913   }
73914   __pyx_L4:;
73915
73916   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":242
73917  *     if context._origSaxEndNoNs is not NULL:
73918  *         context._origSaxEndNoNs(c_ctxt, c_name)
73919  *     try:             # <<<<<<<<<<<<<<
73920  *         context._target._handleSaxEnd(funicode(c_name))
73921  *     except:
73922  */
73923   {
73924     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
73925     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
73926     __Pyx_XGOTREF(__pyx_save_exc_type);
73927     __Pyx_XGOTREF(__pyx_save_exc_value);
73928     __Pyx_XGOTREF(__pyx_save_exc_tb);
73929     /*try:*/ {
73930
73931       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":243
73932  *         context._origSaxEndNoNs(c_ctxt, c_name)
73933  *     try:
73934  *         context._target._handleSaxEnd(funicode(c_name))             # <<<<<<<<<<<<<<
73935  *     except:
73936  *         context._handleSaxException(c_ctxt)
73937  */
73938       __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
73939       __Pyx_GOTREF(__pyx_t_2);
73940       __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxEnd(__pyx_v_context->_target, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
73941       __Pyx_GOTREF(__pyx_t_3);
73942       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
73943       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
73944     }
73945     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
73946     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
73947     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
73948     goto __pyx_L12_try_end;
73949     __pyx_L5_error:;
73950     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
73951     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
73952
73953     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":244
73954  *     try:
73955  *         context._target._handleSaxEnd(funicode(c_name))
73956  *     except:             # <<<<<<<<<<<<<<
73957  *         context._handleSaxException(c_ctxt)
73958  * 
73959  */
73960     /*except:*/ {
73961       __Pyx_AddTraceback("lxml.etree._handleSaxEndNoNs");
73962       if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
73963       __Pyx_GOTREF(__pyx_t_3);
73964       __Pyx_GOTREF(__pyx_t_2);
73965       __Pyx_GOTREF(__pyx_t_4);
73966
73967       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":245
73968  *         context._target._handleSaxEnd(funicode(c_name))
73969  *     except:
73970  *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<<
73971  * 
73972  * cdef void _handleSaxData(void* ctxt, char* c_data, int data_len) with gil:
73973  */
73974       ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->_handleSaxException(__pyx_v_context, __pyx_v_c_ctxt);
73975       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
73976       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
73977       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
73978       goto __pyx_L6_exception_handled;
73979     }
73980     __pyx_L7_except_error:;
73981     __Pyx_XDECREF(__pyx_save_exc_type);
73982     __Pyx_XDECREF(__pyx_save_exc_value);
73983     __Pyx_XDECREF(__pyx_save_exc_tb);
73984     goto __pyx_L1_error;
73985     __pyx_L6_exception_handled:;
73986     __Pyx_XGIVEREF(__pyx_save_exc_type);
73987     __Pyx_XGIVEREF(__pyx_save_exc_value);
73988     __Pyx_XGIVEREF(__pyx_save_exc_tb);
73989     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
73990     __pyx_L12_try_end:;
73991   }
73992
73993   goto __pyx_L0;
73994   __pyx_L1_error:;
73995   __Pyx_XDECREF(__pyx_t_2);
73996   __Pyx_XDECREF(__pyx_t_3);
73997   __Pyx_XDECREF(__pyx_t_4);
73998   __Pyx_WriteUnraisable("lxml.etree._handleSaxEndNoNs");
73999   __pyx_L0:;
74000   __Pyx_DECREF((PyObject *)__pyx_v_context);
74001   __Pyx_FinishRefcountContext();
74002   PyGILState_Release(_save);
74003 }
74004
74005 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":247
74006  *         context._handleSaxException(c_ctxt)
74007  * 
74008  * cdef void _handleSaxData(void* ctxt, char* c_data, int data_len) with gil:             # <<<<<<<<<<<<<<
74009  *     cdef _SaxParserContext context
74010  *     cdef xmlparser.xmlParserCtxt* c_ctxt
74011  */
74012
74013 static  void __pyx_f_4lxml_5etree__handleSaxData(void *__pyx_v_ctxt, char *__pyx_v_c_data, int __pyx_v_data_len) {
74014   struct __pyx_obj_4lxml_5etree__SaxParserContext *__pyx_v_context;
74015   xmlParserCtxt *__pyx_v_c_ctxt;
74016   int __pyx_t_1;
74017   PyObject *__pyx_t_2 = NULL;
74018   int __pyx_t_3;
74019   PyObject *__pyx_t_4 = NULL;
74020   PyObject *__pyx_t_5 = NULL;
74021   PyGILState_STATE _save = PyGILState_Ensure();
74022   __Pyx_SetupRefcountContext("_handleSaxData");
74023   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)Py_None); __Pyx_INCREF(Py_None);
74024
74025   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":250
74026  *     cdef _SaxParserContext context
74027  *     cdef xmlparser.xmlParserCtxt* c_ctxt
74028  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<<
74029  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
74030  *         return
74031  */
74032   __pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);
74033
74034   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":251
74035  *     cdef xmlparser.xmlParserCtxt* c_ctxt
74036  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
74037  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
74038  *         return
74039  *     context = <_SaxParserContext>c_ctxt._private
74040  */
74041   if (!(__pyx_v_c_ctxt->_private == NULL)) {
74042     __pyx_t_1 = __pyx_v_c_ctxt->disableSAX;
74043   } else {
74044     __pyx_t_1 = (__pyx_v_c_ctxt->_private == NULL);
74045   }
74046   if (__pyx_t_1) {
74047
74048     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":252
74049  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
74050  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
74051  *         return             # <<<<<<<<<<<<<<
74052  *     context = <_SaxParserContext>c_ctxt._private
74053  *     if context._origSaxData is not NULL:
74054  */
74055     goto __pyx_L0;
74056     goto __pyx_L3;
74057   }
74058   __pyx_L3:;
74059
74060   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":253
74061  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
74062  *         return
74063  *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<<
74064  *     if context._origSaxData is not NULL:
74065  *         context._origSaxData(c_ctxt, c_data, data_len)
74066  */
74067   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_v_c_ctxt->_private)));
74068   __Pyx_DECREF(((PyObject *)__pyx_v_context));
74069   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_v_c_ctxt->_private);
74070
74071   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":254
74072  *         return
74073  *     context = <_SaxParserContext>c_ctxt._private
74074  *     if context._origSaxData is not NULL:             # <<<<<<<<<<<<<<
74075  *         context._origSaxData(c_ctxt, c_data, data_len)
74076  *     try:
74077  */
74078   __pyx_t_1 = (__pyx_v_context->_origSaxData != NULL);
74079   if (__pyx_t_1) {
74080
74081     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":255
74082  *     context = <_SaxParserContext>c_ctxt._private
74083  *     if context._origSaxData is not NULL:
74084  *         context._origSaxData(c_ctxt, c_data, data_len)             # <<<<<<<<<<<<<<
74085  *     try:
74086  *         context._target._handleSaxData(
74087  */
74088     __pyx_v_context->_origSaxData(__pyx_v_c_ctxt, __pyx_v_c_data, __pyx_v_data_len);
74089     goto __pyx_L4;
74090   }
74091   __pyx_L4:;
74092
74093   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":256
74094  *     if context._origSaxData is not NULL:
74095  *         context._origSaxData(c_ctxt, c_data, data_len)
74096  *     try:             # <<<<<<<<<<<<<<
74097  *         context._target._handleSaxData(
74098  *             python.PyUnicode_DecodeUTF8(c_data, data_len, NULL))
74099  */
74100   {
74101     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
74102     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
74103     __Pyx_XGOTREF(__pyx_save_exc_type);
74104     __Pyx_XGOTREF(__pyx_save_exc_value);
74105     __Pyx_XGOTREF(__pyx_save_exc_tb);
74106     /*try:*/ {
74107
74108       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":258
74109  *     try:
74110  *         context._target._handleSaxData(
74111  *             python.PyUnicode_DecodeUTF8(c_data, data_len, NULL))             # <<<<<<<<<<<<<<
74112  *     except:
74113  *         context._handleSaxException(c_ctxt)
74114  */
74115       __pyx_t_2 = PyUnicode_DecodeUTF8(__pyx_v_c_data, __pyx_v_data_len, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
74116       __Pyx_GOTREF(__pyx_t_2);
74117       __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxData(__pyx_v_context->_target, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
74118       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
74119     }
74120     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
74121     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
74122     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
74123     goto __pyx_L12_try_end;
74124     __pyx_L5_error:;
74125     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
74126
74127     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":259
74128  *         context._target._handleSaxData(
74129  *             python.PyUnicode_DecodeUTF8(c_data, data_len, NULL))
74130  *     except:             # <<<<<<<<<<<<<<
74131  *         context._handleSaxException(c_ctxt)
74132  * 
74133  */
74134     /*except:*/ {
74135       __Pyx_AddTraceback("lxml.etree._handleSaxData");
74136       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
74137       __Pyx_GOTREF(__pyx_t_2);
74138       __Pyx_GOTREF(__pyx_t_4);
74139       __Pyx_GOTREF(__pyx_t_5);
74140
74141       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":260
74142  *             python.PyUnicode_DecodeUTF8(c_data, data_len, NULL))
74143  *     except:
74144  *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<<
74145  * 
74146  * cdef void _handleSaxCData(void* ctxt, char* c_data, int data_len) with gil:
74147  */
74148       ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->_handleSaxException(__pyx_v_context, __pyx_v_c_ctxt);
74149       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
74150       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
74151       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
74152       goto __pyx_L6_exception_handled;
74153     }
74154     __pyx_L7_except_error:;
74155     __Pyx_XDECREF(__pyx_save_exc_type);
74156     __Pyx_XDECREF(__pyx_save_exc_value);
74157     __Pyx_XDECREF(__pyx_save_exc_tb);
74158     goto __pyx_L1_error;
74159     __pyx_L6_exception_handled:;
74160     __Pyx_XGIVEREF(__pyx_save_exc_type);
74161     __Pyx_XGIVEREF(__pyx_save_exc_value);
74162     __Pyx_XGIVEREF(__pyx_save_exc_tb);
74163     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
74164     __pyx_L12_try_end:;
74165   }
74166
74167   goto __pyx_L0;
74168   __pyx_L1_error:;
74169   __Pyx_XDECREF(__pyx_t_2);
74170   __Pyx_XDECREF(__pyx_t_4);
74171   __Pyx_XDECREF(__pyx_t_5);
74172   __Pyx_WriteUnraisable("lxml.etree._handleSaxData");
74173   __pyx_L0:;
74174   __Pyx_DECREF((PyObject *)__pyx_v_context);
74175   __Pyx_FinishRefcountContext();
74176   PyGILState_Release(_save);
74177 }
74178
74179 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":262
74180  *         context._handleSaxException(c_ctxt)
74181  * 
74182  * cdef void _handleSaxCData(void* ctxt, char* c_data, int data_len) with gil:             # <<<<<<<<<<<<<<
74183  *     cdef _SaxParserContext context
74184  *     cdef xmlparser.xmlParserCtxt* c_ctxt
74185  */
74186
74187 static  void __pyx_f_4lxml_5etree__handleSaxCData(void *__pyx_v_ctxt, char *__pyx_v_c_data, int __pyx_v_data_len) {
74188   struct __pyx_obj_4lxml_5etree__SaxParserContext *__pyx_v_context;
74189   xmlParserCtxt *__pyx_v_c_ctxt;
74190   int __pyx_t_1;
74191   PyObject *__pyx_t_2 = NULL;
74192   int __pyx_t_3;
74193   PyObject *__pyx_t_4 = NULL;
74194   PyObject *__pyx_t_5 = NULL;
74195   PyGILState_STATE _save = PyGILState_Ensure();
74196   __Pyx_SetupRefcountContext("_handleSaxCData");
74197   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)Py_None); __Pyx_INCREF(Py_None);
74198
74199   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":265
74200  *     cdef _SaxParserContext context
74201  *     cdef xmlparser.xmlParserCtxt* c_ctxt
74202  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<<
74203  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
74204  *         return
74205  */
74206   __pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);
74207
74208   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":266
74209  *     cdef xmlparser.xmlParserCtxt* c_ctxt
74210  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
74211  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
74212  *         return
74213  *     context = <_SaxParserContext>c_ctxt._private
74214  */
74215   if (!(__pyx_v_c_ctxt->_private == NULL)) {
74216     __pyx_t_1 = __pyx_v_c_ctxt->disableSAX;
74217   } else {
74218     __pyx_t_1 = (__pyx_v_c_ctxt->_private == NULL);
74219   }
74220   if (__pyx_t_1) {
74221
74222     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":267
74223  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
74224  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
74225  *         return             # <<<<<<<<<<<<<<
74226  *     context = <_SaxParserContext>c_ctxt._private
74227  *     if context._origSaxCData is not NULL:
74228  */
74229     goto __pyx_L0;
74230     goto __pyx_L3;
74231   }
74232   __pyx_L3:;
74233
74234   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":268
74235  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
74236  *         return
74237  *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<<
74238  *     if context._origSaxCData is not NULL:
74239  *         context._origSaxCData(c_ctxt, c_data, data_len)
74240  */
74241   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_v_c_ctxt->_private)));
74242   __Pyx_DECREF(((PyObject *)__pyx_v_context));
74243   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_v_c_ctxt->_private);
74244
74245   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":269
74246  *         return
74247  *     context = <_SaxParserContext>c_ctxt._private
74248  *     if context._origSaxCData is not NULL:             # <<<<<<<<<<<<<<
74249  *         context._origSaxCData(c_ctxt, c_data, data_len)
74250  *     try:
74251  */
74252   __pyx_t_1 = (__pyx_v_context->_origSaxCData != NULL);
74253   if (__pyx_t_1) {
74254
74255     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":270
74256  *     context = <_SaxParserContext>c_ctxt._private
74257  *     if context._origSaxCData is not NULL:
74258  *         context._origSaxCData(c_ctxt, c_data, data_len)             # <<<<<<<<<<<<<<
74259  *     try:
74260  *         context._target._handleSaxData(
74261  */
74262     __pyx_v_context->_origSaxCData(__pyx_v_c_ctxt, __pyx_v_c_data, __pyx_v_data_len);
74263     goto __pyx_L4;
74264   }
74265   __pyx_L4:;
74266
74267   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":271
74268  *     if context._origSaxCData is not NULL:
74269  *         context._origSaxCData(c_ctxt, c_data, data_len)
74270  *     try:             # <<<<<<<<<<<<<<
74271  *         context._target._handleSaxData(
74272  *             python.PyUnicode_DecodeUTF8(c_data, data_len, NULL))
74273  */
74274   {
74275     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
74276     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
74277     __Pyx_XGOTREF(__pyx_save_exc_type);
74278     __Pyx_XGOTREF(__pyx_save_exc_value);
74279     __Pyx_XGOTREF(__pyx_save_exc_tb);
74280     /*try:*/ {
74281
74282       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":273
74283  *     try:
74284  *         context._target._handleSaxData(
74285  *             python.PyUnicode_DecodeUTF8(c_data, data_len, NULL))             # <<<<<<<<<<<<<<
74286  *     except:
74287  *         context._handleSaxException(c_ctxt)
74288  */
74289       __pyx_t_2 = PyUnicode_DecodeUTF8(__pyx_v_c_data, __pyx_v_data_len, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
74290       __Pyx_GOTREF(__pyx_t_2);
74291       __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxData(__pyx_v_context->_target, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
74292       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
74293     }
74294     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
74295     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
74296     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
74297     goto __pyx_L12_try_end;
74298     __pyx_L5_error:;
74299     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
74300
74301     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":274
74302  *         context._target._handleSaxData(
74303  *             python.PyUnicode_DecodeUTF8(c_data, data_len, NULL))
74304  *     except:             # <<<<<<<<<<<<<<
74305  *         context._handleSaxException(c_ctxt)
74306  * 
74307  */
74308     /*except:*/ {
74309       __Pyx_AddTraceback("lxml.etree._handleSaxCData");
74310       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
74311       __Pyx_GOTREF(__pyx_t_2);
74312       __Pyx_GOTREF(__pyx_t_4);
74313       __Pyx_GOTREF(__pyx_t_5);
74314
74315       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":275
74316  *             python.PyUnicode_DecodeUTF8(c_data, data_len, NULL))
74317  *     except:
74318  *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<<
74319  * 
74320  * cdef void _handleSaxDoctype(void* ctxt, char* c_name, char* c_public,
74321  */
74322       ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->_handleSaxException(__pyx_v_context, __pyx_v_c_ctxt);
74323       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
74324       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
74325       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
74326       goto __pyx_L6_exception_handled;
74327     }
74328     __pyx_L7_except_error:;
74329     __Pyx_XDECREF(__pyx_save_exc_type);
74330     __Pyx_XDECREF(__pyx_save_exc_value);
74331     __Pyx_XDECREF(__pyx_save_exc_tb);
74332     goto __pyx_L1_error;
74333     __pyx_L6_exception_handled:;
74334     __Pyx_XGIVEREF(__pyx_save_exc_type);
74335     __Pyx_XGIVEREF(__pyx_save_exc_value);
74336     __Pyx_XGIVEREF(__pyx_save_exc_tb);
74337     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
74338     __pyx_L12_try_end:;
74339   }
74340
74341   goto __pyx_L0;
74342   __pyx_L1_error:;
74343   __Pyx_XDECREF(__pyx_t_2);
74344   __Pyx_XDECREF(__pyx_t_4);
74345   __Pyx_XDECREF(__pyx_t_5);
74346   __Pyx_WriteUnraisable("lxml.etree._handleSaxCData");
74347   __pyx_L0:;
74348   __Pyx_DECREF((PyObject *)__pyx_v_context);
74349   __Pyx_FinishRefcountContext();
74350   PyGILState_Release(_save);
74351 }
74352
74353 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":277
74354  *         context._handleSaxException(c_ctxt)
74355  * 
74356  * cdef void _handleSaxDoctype(void* ctxt, char* c_name, char* c_public,             # <<<<<<<<<<<<<<
74357  *                             char* c_system) with gil:
74358  *     cdef _SaxParserContext context
74359  */
74360
74361 static  void __pyx_f_4lxml_5etree__handleSaxDoctype(void *__pyx_v_ctxt, char *__pyx_v_c_name, char *__pyx_v_c_public, char *__pyx_v_c_system) {
74362   struct __pyx_obj_4lxml_5etree__SaxParserContext *__pyx_v_context;
74363   xmlParserCtxt *__pyx_v_c_ctxt;
74364   PyObject *__pyx_v_public_id;
74365   PyObject *__pyx_v_system_id;
74366   int __pyx_t_1;
74367   PyObject *__pyx_t_2 = NULL;
74368   int __pyx_t_3;
74369   PyObject *__pyx_t_4 = NULL;
74370   PyObject *__pyx_t_5 = NULL;
74371   PyGILState_STATE _save = PyGILState_Ensure();
74372   __Pyx_SetupRefcountContext("_handleSaxDoctype");
74373   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)Py_None); __Pyx_INCREF(Py_None);
74374   __pyx_v_public_id = Py_None; __Pyx_INCREF(Py_None);
74375   __pyx_v_system_id = Py_None; __Pyx_INCREF(Py_None);
74376
74377   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":281
74378  *     cdef _SaxParserContext context
74379  *     cdef xmlparser.xmlParserCtxt* c_ctxt
74380  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<<
74381  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
74382  *         return
74383  */
74384   __pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);
74385
74386   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":282
74387  *     cdef xmlparser.xmlParserCtxt* c_ctxt
74388  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
74389  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
74390  *         return
74391  *     context = <_SaxParserContext>c_ctxt._private
74392  */
74393   if (!(__pyx_v_c_ctxt->_private == NULL)) {
74394     __pyx_t_1 = __pyx_v_c_ctxt->disableSAX;
74395   } else {
74396     __pyx_t_1 = (__pyx_v_c_ctxt->_private == NULL);
74397   }
74398   if (__pyx_t_1) {
74399
74400     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":283
74401  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
74402  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
74403  *         return             # <<<<<<<<<<<<<<
74404  *     context = <_SaxParserContext>c_ctxt._private
74405  *     if context._origSaxDoctype is not NULL:
74406  */
74407     goto __pyx_L0;
74408     goto __pyx_L3;
74409   }
74410   __pyx_L3:;
74411
74412   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":284
74413  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
74414  *         return
74415  *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<<
74416  *     if context._origSaxDoctype is not NULL:
74417  *         context._origSaxDoctype(c_ctxt, c_name, c_public, c_system)
74418  */
74419   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_v_c_ctxt->_private)));
74420   __Pyx_DECREF(((PyObject *)__pyx_v_context));
74421   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_v_c_ctxt->_private);
74422
74423   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":285
74424  *         return
74425  *     context = <_SaxParserContext>c_ctxt._private
74426  *     if context._origSaxDoctype is not NULL:             # <<<<<<<<<<<<<<
74427  *         context._origSaxDoctype(c_ctxt, c_name, c_public, c_system)
74428  *     try:
74429  */
74430   __pyx_t_1 = (__pyx_v_context->_origSaxDoctype != NULL);
74431   if (__pyx_t_1) {
74432
74433     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":286
74434  *     context = <_SaxParserContext>c_ctxt._private
74435  *     if context._origSaxDoctype is not NULL:
74436  *         context._origSaxDoctype(c_ctxt, c_name, c_public, c_system)             # <<<<<<<<<<<<<<
74437  *     try:
74438  *         if c_public is not NULL:
74439  */
74440     __pyx_v_context->_origSaxDoctype(__pyx_v_c_ctxt, __pyx_v_c_name, __pyx_v_c_public, __pyx_v_c_system);
74441     goto __pyx_L4;
74442   }
74443   __pyx_L4:;
74444
74445   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":287
74446  *     if context._origSaxDoctype is not NULL:
74447  *         context._origSaxDoctype(c_ctxt, c_name, c_public, c_system)
74448  *     try:             # <<<<<<<<<<<<<<
74449  *         if c_public is not NULL:
74450  *             public_id = funicode(c_public)
74451  */
74452   {
74453     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
74454     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
74455     __Pyx_XGOTREF(__pyx_save_exc_type);
74456     __Pyx_XGOTREF(__pyx_save_exc_value);
74457     __Pyx_XGOTREF(__pyx_save_exc_tb);
74458     /*try:*/ {
74459
74460       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":288
74461  *         context._origSaxDoctype(c_ctxt, c_name, c_public, c_system)
74462  *     try:
74463  *         if c_public is not NULL:             # <<<<<<<<<<<<<<
74464  *             public_id = funicode(c_public)
74465  *         if c_system is not NULL:
74466  */
74467       __pyx_t_1 = (__pyx_v_c_public != NULL);
74468       if (__pyx_t_1) {
74469
74470         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":289
74471  *     try:
74472  *         if c_public is not NULL:
74473  *             public_id = funicode(c_public)             # <<<<<<<<<<<<<<
74474  *         if c_system is not NULL:
74475  *             system_id = funicode(c_system)
74476  */
74477         __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_public); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
74478         __Pyx_GOTREF(__pyx_t_2);
74479         __Pyx_DECREF(__pyx_v_public_id);
74480         __pyx_v_public_id = __pyx_t_2;
74481         __pyx_t_2 = 0;
74482         goto __pyx_L13;
74483       }
74484       __pyx_L13:;
74485
74486       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":290
74487  *         if c_public is not NULL:
74488  *             public_id = funicode(c_public)
74489  *         if c_system is not NULL:             # <<<<<<<<<<<<<<
74490  *             system_id = funicode(c_system)
74491  *         context._target._handleSaxDoctype(
74492  */
74493       __pyx_t_1 = (__pyx_v_c_system != NULL);
74494       if (__pyx_t_1) {
74495
74496         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":291
74497  *             public_id = funicode(c_public)
74498  *         if c_system is not NULL:
74499  *             system_id = funicode(c_system)             # <<<<<<<<<<<<<<
74500  *         context._target._handleSaxDoctype(
74501  *             funicode(c_name), public_id, system_id)
74502  */
74503         __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_system); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
74504         __Pyx_GOTREF(__pyx_t_2);
74505         __Pyx_DECREF(__pyx_v_system_id);
74506         __pyx_v_system_id = __pyx_t_2;
74507         __pyx_t_2 = 0;
74508         goto __pyx_L14;
74509       }
74510       __pyx_L14:;
74511
74512       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":293
74513  *             system_id = funicode(c_system)
74514  *         context._target._handleSaxDoctype(
74515  *             funicode(c_name), public_id, system_id)             # <<<<<<<<<<<<<<
74516  *     except:
74517  *         context._handleSaxException(c_ctxt)
74518  */
74519       __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
74520       __Pyx_GOTREF(__pyx_t_2);
74521       __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxDoctype(__pyx_v_context->_target, __pyx_t_2, __pyx_v_public_id, __pyx_v_system_id); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
74522       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
74523     }
74524     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
74525     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
74526     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
74527     goto __pyx_L12_try_end;
74528     __pyx_L5_error:;
74529     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
74530
74531     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":294
74532  *         context._target._handleSaxDoctype(
74533  *             funicode(c_name), public_id, system_id)
74534  *     except:             # <<<<<<<<<<<<<<
74535  *         context._handleSaxException(c_ctxt)
74536  * 
74537  */
74538     /*except:*/ {
74539       __Pyx_AddTraceback("lxml.etree._handleSaxDoctype");
74540       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
74541       __Pyx_GOTREF(__pyx_t_2);
74542       __Pyx_GOTREF(__pyx_t_4);
74543       __Pyx_GOTREF(__pyx_t_5);
74544
74545       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":295
74546  *             funicode(c_name), public_id, system_id)
74547  *     except:
74548  *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<<
74549  * 
74550  * cdef void _handleSaxPI(void* ctxt, char* c_target, char* c_data) with gil:
74551  */
74552       ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->_handleSaxException(__pyx_v_context, __pyx_v_c_ctxt);
74553       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
74554       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
74555       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
74556       goto __pyx_L6_exception_handled;
74557     }
74558     __pyx_L7_except_error:;
74559     __Pyx_XDECREF(__pyx_save_exc_type);
74560     __Pyx_XDECREF(__pyx_save_exc_value);
74561     __Pyx_XDECREF(__pyx_save_exc_tb);
74562     goto __pyx_L1_error;
74563     __pyx_L6_exception_handled:;
74564     __Pyx_XGIVEREF(__pyx_save_exc_type);
74565     __Pyx_XGIVEREF(__pyx_save_exc_value);
74566     __Pyx_XGIVEREF(__pyx_save_exc_tb);
74567     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
74568     __pyx_L12_try_end:;
74569   }
74570
74571   goto __pyx_L0;
74572   __pyx_L1_error:;
74573   __Pyx_XDECREF(__pyx_t_2);
74574   __Pyx_XDECREF(__pyx_t_4);
74575   __Pyx_XDECREF(__pyx_t_5);
74576   __Pyx_WriteUnraisable("lxml.etree._handleSaxDoctype");
74577   __pyx_L0:;
74578   __Pyx_DECREF((PyObject *)__pyx_v_context);
74579   __Pyx_DECREF(__pyx_v_public_id);
74580   __Pyx_DECREF(__pyx_v_system_id);
74581   __Pyx_FinishRefcountContext();
74582   PyGILState_Release(_save);
74583 }
74584
74585 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":297
74586  *         context._handleSaxException(c_ctxt)
74587  * 
74588  * cdef void _handleSaxPI(void* ctxt, char* c_target, char* c_data) with gil:             # <<<<<<<<<<<<<<
74589  *     cdef _SaxParserContext context
74590  *     cdef xmlparser.xmlParserCtxt* c_ctxt
74591  */
74592
74593 static  void __pyx_f_4lxml_5etree__handleSaxPI(void *__pyx_v_ctxt, char *__pyx_v_c_target, char *__pyx_v_c_data) {
74594   struct __pyx_obj_4lxml_5etree__SaxParserContext *__pyx_v_context;
74595   xmlParserCtxt *__pyx_v_c_ctxt;
74596   PyObject *__pyx_v_data;
74597   int __pyx_t_1;
74598   PyObject *__pyx_t_2 = NULL;
74599   PyObject *__pyx_t_3 = NULL;
74600   PyObject *__pyx_t_4 = NULL;
74601   PyGILState_STATE _save = PyGILState_Ensure();
74602   __Pyx_SetupRefcountContext("_handleSaxPI");
74603   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)Py_None); __Pyx_INCREF(Py_None);
74604   __pyx_v_data = Py_None; __Pyx_INCREF(Py_None);
74605
74606   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":300
74607  *     cdef _SaxParserContext context
74608  *     cdef xmlparser.xmlParserCtxt* c_ctxt
74609  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<<
74610  *     if c_ctxt._private is NULL:
74611  *         return
74612  */
74613   __pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);
74614
74615   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":301
74616  *     cdef xmlparser.xmlParserCtxt* c_ctxt
74617  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
74618  *     if c_ctxt._private is NULL:             # <<<<<<<<<<<<<<
74619  *         return
74620  *     context = <_SaxParserContext>c_ctxt._private
74621  */
74622   __pyx_t_1 = (__pyx_v_c_ctxt->_private == NULL);
74623   if (__pyx_t_1) {
74624
74625     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":302
74626  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
74627  *     if c_ctxt._private is NULL:
74628  *         return             # <<<<<<<<<<<<<<
74629  *     context = <_SaxParserContext>c_ctxt._private
74630  *     if context._origSaxPi is not NULL:
74631  */
74632     goto __pyx_L0;
74633     goto __pyx_L3;
74634   }
74635   __pyx_L3:;
74636
74637   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":303
74638  *     if c_ctxt._private is NULL:
74639  *         return
74640  *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<<
74641  *     if context._origSaxPi is not NULL:
74642  *         context._origSaxPi(c_ctxt, c_target, c_data)
74643  */
74644   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_v_c_ctxt->_private)));
74645   __Pyx_DECREF(((PyObject *)__pyx_v_context));
74646   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_v_c_ctxt->_private);
74647
74648   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":304
74649  *         return
74650  *     context = <_SaxParserContext>c_ctxt._private
74651  *     if context._origSaxPi is not NULL:             # <<<<<<<<<<<<<<
74652  *         context._origSaxPi(c_ctxt, c_target, c_data)
74653  *     try:
74654  */
74655   __pyx_t_1 = (__pyx_v_context->_origSaxPi != NULL);
74656   if (__pyx_t_1) {
74657
74658     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":305
74659  *     context = <_SaxParserContext>c_ctxt._private
74660  *     if context._origSaxPi is not NULL:
74661  *         context._origSaxPi(c_ctxt, c_target, c_data)             # <<<<<<<<<<<<<<
74662  *     try:
74663  *         if c_data is not NULL:
74664  */
74665     __pyx_v_context->_origSaxPi(__pyx_v_c_ctxt, __pyx_v_c_target, __pyx_v_c_data);
74666     goto __pyx_L4;
74667   }
74668   __pyx_L4:;
74669
74670   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":306
74671  *     if context._origSaxPi is not NULL:
74672  *         context._origSaxPi(c_ctxt, c_target, c_data)
74673  *     try:             # <<<<<<<<<<<<<<
74674  *         if c_data is not NULL:
74675  *             data = funicode(c_data)
74676  */
74677   {
74678     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
74679     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
74680     __Pyx_XGOTREF(__pyx_save_exc_type);
74681     __Pyx_XGOTREF(__pyx_save_exc_value);
74682     __Pyx_XGOTREF(__pyx_save_exc_tb);
74683     /*try:*/ {
74684
74685       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":307
74686  *         context._origSaxPi(c_ctxt, c_target, c_data)
74687  *     try:
74688  *         if c_data is not NULL:             # <<<<<<<<<<<<<<
74689  *             data = funicode(c_data)
74690  *         context._target._handleSaxPi(funicode(c_target), data)
74691  */
74692       __pyx_t_1 = (__pyx_v_c_data != NULL);
74693       if (__pyx_t_1) {
74694
74695         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":308
74696  *     try:
74697  *         if c_data is not NULL:
74698  *             data = funicode(c_data)             # <<<<<<<<<<<<<<
74699  *         context._target._handleSaxPi(funicode(c_target), data)
74700  *     except:
74701  */
74702         __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
74703         __Pyx_GOTREF(__pyx_t_2);
74704         __Pyx_DECREF(__pyx_v_data);
74705         __pyx_v_data = __pyx_t_2;
74706         __pyx_t_2 = 0;
74707         goto __pyx_L13;
74708       }
74709       __pyx_L13:;
74710
74711       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":309
74712  *         if c_data is not NULL:
74713  *             data = funicode(c_data)
74714  *         context._target._handleSaxPi(funicode(c_target), data)             # <<<<<<<<<<<<<<
74715  *     except:
74716  *         context._handleSaxException(c_ctxt)
74717  */
74718       __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_target); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
74719       __Pyx_GOTREF(__pyx_t_2);
74720       __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxPi(__pyx_v_context->_target, __pyx_t_2, __pyx_v_data); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
74721       __Pyx_GOTREF(__pyx_t_3);
74722       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
74723       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
74724     }
74725     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
74726     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
74727     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
74728     goto __pyx_L12_try_end;
74729     __pyx_L5_error:;
74730     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
74731     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
74732
74733     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":310
74734  *             data = funicode(c_data)
74735  *         context._target._handleSaxPi(funicode(c_target), data)
74736  *     except:             # <<<<<<<<<<<<<<
74737  *         context._handleSaxException(c_ctxt)
74738  * 
74739  */
74740     /*except:*/ {
74741       __Pyx_AddTraceback("lxml.etree._handleSaxPI");
74742       if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
74743       __Pyx_GOTREF(__pyx_t_3);
74744       __Pyx_GOTREF(__pyx_t_2);
74745       __Pyx_GOTREF(__pyx_t_4);
74746
74747       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":311
74748  *         context._target._handleSaxPi(funicode(c_target), data)
74749  *     except:
74750  *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<<
74751  * 
74752  * cdef void _handleSaxComment(void* ctxt, char* c_data) with gil:
74753  */
74754       ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->_handleSaxException(__pyx_v_context, __pyx_v_c_ctxt);
74755       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
74756       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
74757       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
74758       goto __pyx_L6_exception_handled;
74759     }
74760     __pyx_L7_except_error:;
74761     __Pyx_XDECREF(__pyx_save_exc_type);
74762     __Pyx_XDECREF(__pyx_save_exc_value);
74763     __Pyx_XDECREF(__pyx_save_exc_tb);
74764     goto __pyx_L1_error;
74765     __pyx_L6_exception_handled:;
74766     __Pyx_XGIVEREF(__pyx_save_exc_type);
74767     __Pyx_XGIVEREF(__pyx_save_exc_value);
74768     __Pyx_XGIVEREF(__pyx_save_exc_tb);
74769     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
74770     __pyx_L12_try_end:;
74771   }
74772
74773   goto __pyx_L0;
74774   __pyx_L1_error:;
74775   __Pyx_XDECREF(__pyx_t_2);
74776   __Pyx_XDECREF(__pyx_t_3);
74777   __Pyx_XDECREF(__pyx_t_4);
74778   __Pyx_WriteUnraisable("lxml.etree._handleSaxPI");
74779   __pyx_L0:;
74780   __Pyx_DECREF((PyObject *)__pyx_v_context);
74781   __Pyx_DECREF(__pyx_v_data);
74782   __Pyx_FinishRefcountContext();
74783   PyGILState_Release(_save);
74784 }
74785
74786 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":313
74787  *         context._handleSaxException(c_ctxt)
74788  * 
74789  * cdef void _handleSaxComment(void* ctxt, char* c_data) with gil:             # <<<<<<<<<<<<<<
74790  *     cdef _SaxParserContext context
74791  *     cdef xmlparser.xmlParserCtxt* c_ctxt
74792  */
74793
74794 static  void __pyx_f_4lxml_5etree__handleSaxComment(void *__pyx_v_ctxt, char *__pyx_v_c_data) {
74795   struct __pyx_obj_4lxml_5etree__SaxParserContext *__pyx_v_context;
74796   xmlParserCtxt *__pyx_v_c_ctxt;
74797   int __pyx_t_1;
74798   PyObject *__pyx_t_2 = NULL;
74799   PyObject *__pyx_t_3 = NULL;
74800   PyObject *__pyx_t_4 = NULL;
74801   PyGILState_STATE _save = PyGILState_Ensure();
74802   __Pyx_SetupRefcountContext("_handleSaxComment");
74803   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)Py_None); __Pyx_INCREF(Py_None);
74804
74805   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":316
74806  *     cdef _SaxParserContext context
74807  *     cdef xmlparser.xmlParserCtxt* c_ctxt
74808  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<<
74809  *     if c_ctxt._private is NULL:
74810  *         return
74811  */
74812   __pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);
74813
74814   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":317
74815  *     cdef xmlparser.xmlParserCtxt* c_ctxt
74816  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
74817  *     if c_ctxt._private is NULL:             # <<<<<<<<<<<<<<
74818  *         return
74819  *     context = <_SaxParserContext>c_ctxt._private
74820  */
74821   __pyx_t_1 = (__pyx_v_c_ctxt->_private == NULL);
74822   if (__pyx_t_1) {
74823
74824     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":318
74825  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
74826  *     if c_ctxt._private is NULL:
74827  *         return             # <<<<<<<<<<<<<<
74828  *     context = <_SaxParserContext>c_ctxt._private
74829  *     if context._origSaxComment is not NULL:
74830  */
74831     goto __pyx_L0;
74832     goto __pyx_L3;
74833   }
74834   __pyx_L3:;
74835
74836   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":319
74837  *     if c_ctxt._private is NULL:
74838  *         return
74839  *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<<
74840  *     if context._origSaxComment is not NULL:
74841  *         context._origSaxComment(c_ctxt, c_data)
74842  */
74843   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_v_c_ctxt->_private)));
74844   __Pyx_DECREF(((PyObject *)__pyx_v_context));
74845   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_v_c_ctxt->_private);
74846
74847   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":320
74848  *         return
74849  *     context = <_SaxParserContext>c_ctxt._private
74850  *     if context._origSaxComment is not NULL:             # <<<<<<<<<<<<<<
74851  *         context._origSaxComment(c_ctxt, c_data)
74852  *     try:
74853  */
74854   __pyx_t_1 = (__pyx_v_context->_origSaxComment != NULL);
74855   if (__pyx_t_1) {
74856
74857     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":321
74858  *     context = <_SaxParserContext>c_ctxt._private
74859  *     if context._origSaxComment is not NULL:
74860  *         context._origSaxComment(c_ctxt, c_data)             # <<<<<<<<<<<<<<
74861  *     try:
74862  *         context._target._handleSaxComment(funicode(c_data))
74863  */
74864     __pyx_v_context->_origSaxComment(__pyx_v_c_ctxt, __pyx_v_c_data);
74865     goto __pyx_L4;
74866   }
74867   __pyx_L4:;
74868
74869   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":322
74870  *     if context._origSaxComment is not NULL:
74871  *         context._origSaxComment(c_ctxt, c_data)
74872  *     try:             # <<<<<<<<<<<<<<
74873  *         context._target._handleSaxComment(funicode(c_data))
74874  *     except:
74875  */
74876   {
74877     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
74878     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
74879     __Pyx_XGOTREF(__pyx_save_exc_type);
74880     __Pyx_XGOTREF(__pyx_save_exc_value);
74881     __Pyx_XGOTREF(__pyx_save_exc_tb);
74882     /*try:*/ {
74883
74884       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":323
74885  *         context._origSaxComment(c_ctxt, c_data)
74886  *     try:
74887  *         context._target._handleSaxComment(funicode(c_data))             # <<<<<<<<<<<<<<
74888  *     except:
74889  *         context._handleSaxException(c_ctxt)
74890  */
74891       __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
74892       __Pyx_GOTREF(__pyx_t_2);
74893       __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxComment(__pyx_v_context->_target, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
74894       __Pyx_GOTREF(__pyx_t_3);
74895       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
74896       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
74897     }
74898     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
74899     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
74900     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
74901     goto __pyx_L12_try_end;
74902     __pyx_L5_error:;
74903     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
74904     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
74905
74906     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":324
74907  *     try:
74908  *         context._target._handleSaxComment(funicode(c_data))
74909  *     except:             # <<<<<<<<<<<<<<
74910  *         context._handleSaxException(c_ctxt)
74911  * 
74912  */
74913     /*except:*/ {
74914       __Pyx_AddTraceback("lxml.etree._handleSaxComment");
74915       if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
74916       __Pyx_GOTREF(__pyx_t_3);
74917       __Pyx_GOTREF(__pyx_t_2);
74918       __Pyx_GOTREF(__pyx_t_4);
74919
74920       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":325
74921  *         context._target._handleSaxComment(funicode(c_data))
74922  *     except:
74923  *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<<
74924  * 
74925  * 
74926  */
74927       ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->_handleSaxException(__pyx_v_context, __pyx_v_c_ctxt);
74928       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
74929       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
74930       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
74931       goto __pyx_L6_exception_handled;
74932     }
74933     __pyx_L7_except_error:;
74934     __Pyx_XDECREF(__pyx_save_exc_type);
74935     __Pyx_XDECREF(__pyx_save_exc_value);
74936     __Pyx_XDECREF(__pyx_save_exc_tb);
74937     goto __pyx_L1_error;
74938     __pyx_L6_exception_handled:;
74939     __Pyx_XGIVEREF(__pyx_save_exc_type);
74940     __Pyx_XGIVEREF(__pyx_save_exc_value);
74941     __Pyx_XGIVEREF(__pyx_save_exc_tb);
74942     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
74943     __pyx_L12_try_end:;
74944   }
74945
74946   goto __pyx_L0;
74947   __pyx_L1_error:;
74948   __Pyx_XDECREF(__pyx_t_2);
74949   __Pyx_XDECREF(__pyx_t_3);
74950   __Pyx_XDECREF(__pyx_t_4);
74951   __Pyx_WriteUnraisable("lxml.etree._handleSaxComment");
74952   __pyx_L0:;
74953   __Pyx_DECREF((PyObject *)__pyx_v_context);
74954   __Pyx_FinishRefcountContext();
74955   PyGILState_Release(_save);
74956 }
74957
74958 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":346
74959  *     cdef bint _in_tail
74960  * 
74961  *     def __init__(self, *, element_factory=None, parser=None):             # <<<<<<<<<<<<<<
74962  *         self._sax_event_filter = \
74963  *             SAX_EVENT_START | SAX_EVENT_END | SAX_EVENT_DATA | \
74964  */
74965
74966 static int __pyx_pf_4lxml_5etree_11TreeBuilder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
74967 static int __pyx_pf_4lxml_5etree_11TreeBuilder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
74968   PyObject *__pyx_v_element_factory = 0;
74969   PyObject *__pyx_v_parser = 0;
74970   int __pyx_r;
74971   PyObject *__pyx_t_1 = NULL;
74972   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_element_factory,&__pyx_kp_parser,0};
74973   __Pyx_SetupRefcountContext("__init__");
74974   if (unlikely(__pyx_kwds)) {
74975     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
74976     PyObject* values[2] = {0,0};
74977     values[0] = Py_None;
74978     values[1] = Py_None;
74979     switch (PyTuple_GET_SIZE(__pyx_args)) {
74980       case  0: break;
74981       default: goto __pyx_L5_argtuple_error;
74982     }
74983     while (kw_args > 0) {
74984       PyObject* value;
74985       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_element_factory);
74986       if (value) { values[0] = value; if (!(--kw_args)) break; }
74987       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_parser);
74988       if (value) { values[1] = value; if (!(--kw_args)) break; }
74989       break;
74990     }
74991     if (unlikely(kw_args > 0)) {
74992       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, 0, "__init__") < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
74993     }
74994     __pyx_v_element_factory = values[0];
74995     __pyx_v_parser = values[1];
74996   } else if (PyTuple_GET_SIZE(__pyx_args) != 0) {
74997     goto __pyx_L5_argtuple_error;
74998   } else {
74999     __pyx_v_element_factory = Py_None;
75000     __pyx_v_parser = Py_None;
75001   }
75002   goto __pyx_L4_argument_unpacking_done;
75003   __pyx_L5_argtuple_error:;
75004   __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
75005   __pyx_L3_error:;
75006   __Pyx_AddTraceback("lxml.etree.TreeBuilder.__init__");
75007   return -1;
75008   __pyx_L4_argument_unpacking_done:;
75009
75010   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":347
75011  * 
75012  *     def __init__(self, *, element_factory=None, parser=None):
75013  *         self._sax_event_filter = \             # <<<<<<<<<<<<<<
75014  *             SAX_EVENT_START | SAX_EVENT_END | SAX_EVENT_DATA | \
75015  *             SAX_EVENT_PI | SAX_EVENT_COMMENT
75016  */
75017   ((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->__pyx_base._sax_event_filter = ((((__pyx_e_4lxml_5etree_SAX_EVENT_START | __pyx_e_4lxml_5etree_SAX_EVENT_END) | __pyx_e_4lxml_5etree_SAX_EVENT_DATA) | __pyx_e_4lxml_5etree_SAX_EVENT_PI) | __pyx_e_4lxml_5etree_SAX_EVENT_COMMENT);
75018
75019   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":350
75020  *             SAX_EVENT_START | SAX_EVENT_END | SAX_EVENT_DATA | \
75021  *             SAX_EVENT_PI | SAX_EVENT_COMMENT
75022  *         self._data = [] # data collector             # <<<<<<<<<<<<<<
75023  *         self._element_stack = [] # element stack
75024  *         self._element_stack_pop = self._element_stack.pop
75025  */
75026   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75027   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
75028   __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
75029   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_data);
75030   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_data));
75031   ((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_data = __pyx_t_1;
75032   __pyx_t_1 = 0;
75033
75034   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":351
75035  *             SAX_EVENT_PI | SAX_EVENT_COMMENT
75036  *         self._data = [] # data collector
75037  *         self._element_stack = [] # element stack             # <<<<<<<<<<<<<<
75038  *         self._element_stack_pop = self._element_stack.pop
75039  *         self._last = None # last element
75040  */
75041   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75042   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
75043   __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
75044   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_element_stack);
75045   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_element_stack));
75046   ((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_element_stack = __pyx_t_1;
75047   __pyx_t_1 = 0;
75048
75049   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":352
75050  *         self._data = [] # data collector
75051  *         self._element_stack = [] # element stack
75052  *         self._element_stack_pop = self._element_stack.pop             # <<<<<<<<<<<<<<
75053  *         self._last = None # last element
75054  *         self._in_tail = 0 # true if we're after an end tag
75055  */
75056   __pyx_t_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_element_stack), __pyx_kp_pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75057   __Pyx_GOTREF(__pyx_t_1);
75058   __Pyx_GIVEREF(__pyx_t_1);
75059   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_element_stack_pop);
75060   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_element_stack_pop);
75061   ((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_element_stack_pop = __pyx_t_1;
75062   __pyx_t_1 = 0;
75063
75064   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":353
75065  *         self._element_stack = [] # element stack
75066  *         self._element_stack_pop = self._element_stack.pop
75067  *         self._last = None # last element             # <<<<<<<<<<<<<<
75068  *         self._in_tail = 0 # true if we're after an end tag
75069  *         self._factory = element_factory
75070  */
75071   __Pyx_INCREF(Py_None);
75072   __Pyx_GIVEREF(Py_None);
75073   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_last);
75074   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_last));
75075   ((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_last = ((struct LxmlElement *)Py_None);
75076
75077   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":354
75078  *         self._element_stack_pop = self._element_stack.pop
75079  *         self._last = None # last element
75080  *         self._in_tail = 0 # true if we're after an end tag             # <<<<<<<<<<<<<<
75081  *         self._factory = element_factory
75082  *         self._parser = parser
75083  */
75084   ((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_in_tail = 0;
75085
75086   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":355
75087  *         self._last = None # last element
75088  *         self._in_tail = 0 # true if we're after an end tag
75089  *         self._factory = element_factory             # <<<<<<<<<<<<<<
75090  *         self._parser = parser
75091  * 
75092  */
75093   __Pyx_INCREF(__pyx_v_element_factory);
75094   __Pyx_GIVEREF(__pyx_v_element_factory);
75095   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_factory);
75096   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_factory);
75097   ((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_factory = __pyx_v_element_factory;
75098
75099   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":356
75100  *         self._in_tail = 0 # true if we're after an end tag
75101  *         self._factory = element_factory
75102  *         self._parser = parser             # <<<<<<<<<<<<<<
75103  * 
75104  *     cdef int _flush(self) except -1:
75105  */
75106   if (!(__Pyx_TypeTest(__pyx_v_parser, __pyx_ptype_4lxml_5etree__BaseParser))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75107   __Pyx_INCREF(__pyx_v_parser);
75108   __Pyx_GIVEREF(__pyx_v_parser);
75109   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_parser);
75110   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_parser));
75111   ((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser);
75112
75113   __pyx_r = 0;
75114   goto __pyx_L0;
75115   __pyx_L1_error:;
75116   __Pyx_XDECREF(__pyx_t_1);
75117   __Pyx_AddTraceback("lxml.etree.TreeBuilder.__init__");
75118   __pyx_r = -1;
75119   __pyx_L0:;
75120   __Pyx_FinishRefcountContext();
75121   return __pyx_r;
75122 }
75123
75124 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":358
75125  *         self._parser = parser
75126  * 
75127  *     cdef int _flush(self) except -1:             # <<<<<<<<<<<<<<
75128  *         if python.PyList_GET_SIZE(self._data) > 0:
75129  *             if self._last is not None:
75130  */
75131
75132 static  int __pyx_f_4lxml_5etree_11TreeBuilder__flush(struct __pyx_obj_4lxml_5etree_TreeBuilder *__pyx_v_self) {
75133   PyObject *__pyx_v_text;
75134   int __pyx_r;
75135   int __pyx_t_1;
75136   PyObject *__pyx_t_2 = NULL;
75137   PyObject *__pyx_t_3 = NULL;
75138   PyObject *__pyx_t_4 = NULL;
75139   __Pyx_SetupRefcountContext("_flush");
75140   __pyx_v_text = Py_None; __Pyx_INCREF(Py_None);
75141
75142   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":359
75143  * 
75144  *     cdef int _flush(self) except -1:
75145  *         if python.PyList_GET_SIZE(self._data) > 0:             # <<<<<<<<<<<<<<
75146  *             if self._last is not None:
75147  *                 text = u"".join(self._data)
75148  */
75149   __pyx_t_1 = (PyList_GET_SIZE(((PyObject *)__pyx_v_self->_data)) > 0);
75150   if (__pyx_t_1) {
75151
75152     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":360
75153  *     cdef int _flush(self) except -1:
75154  *         if python.PyList_GET_SIZE(self._data) > 0:
75155  *             if self._last is not None:             # <<<<<<<<<<<<<<
75156  *                 text = u"".join(self._data)
75157  *                 if self._in_tail:
75158  */
75159     __pyx_t_1 = (((PyObject *)__pyx_v_self->_last) != Py_None);
75160     if (__pyx_t_1) {
75161
75162       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":361
75163  *         if python.PyList_GET_SIZE(self._data) > 0:
75164  *             if self._last is not None:
75165  *                 text = u"".join(self._data)             # <<<<<<<<<<<<<<
75166  *                 if self._in_tail:
75167  *                     assert self._last.tail is None, u"internal error (tail)"
75168  */
75169       __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_kp_466), __pyx_kp_join); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75170       __Pyx_GOTREF(__pyx_t_2);
75171       __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75172       __Pyx_GOTREF(((PyObject *)__pyx_t_3));
75173       __Pyx_INCREF(((PyObject *)__pyx_v_self->_data));
75174       PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->_data));
75175       __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_data));
75176       __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75177       __Pyx_GOTREF(__pyx_t_4);
75178       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
75179       __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
75180       __Pyx_DECREF(__pyx_v_text);
75181       __pyx_v_text = __pyx_t_4;
75182       __pyx_t_4 = 0;
75183
75184       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":362
75185  *             if self._last is not None:
75186  *                 text = u"".join(self._data)
75187  *                 if self._in_tail:             # <<<<<<<<<<<<<<
75188  *                     assert self._last.tail is None, u"internal error (tail)"
75189  *                     self._last.tail = text
75190  */
75191       __pyx_t_1 = __pyx_v_self->_in_tail;
75192       if (__pyx_t_1) {
75193
75194         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":363
75195  *                 text = u"".join(self._data)
75196  *                 if self._in_tail:
75197  *                     assert self._last.tail is None, u"internal error (tail)"             # <<<<<<<<<<<<<<
75198  *                     self._last.tail = text
75199  *                 else:
75200  */
75201         #ifndef PYREX_WITHOUT_ASSERTIONS
75202         __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self->_last), __pyx_kp_tail); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75203         __Pyx_GOTREF(__pyx_t_4);
75204         __pyx_t_1 = (__pyx_t_4 == Py_None);
75205         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
75206         if (unlikely(!__pyx_t_1)) {
75207           PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_467));
75208           {__pyx_filename = __pyx_f[12]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75209         }
75210         #endif
75211
75212         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":364
75213  *                 if self._in_tail:
75214  *                     assert self._last.tail is None, u"internal error (tail)"
75215  *                     self._last.tail = text             # <<<<<<<<<<<<<<
75216  *                 else:
75217  *                     assert self._last.text is None, u"internal error (text)"
75218  */
75219         if (PyObject_SetAttr(((PyObject *)__pyx_v_self->_last), __pyx_kp_tail, __pyx_v_text) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75220         goto __pyx_L5;
75221       }
75222       /*else*/ {
75223
75224         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":366
75225  *                     self._last.tail = text
75226  *                 else:
75227  *                     assert self._last.text is None, u"internal error (text)"             # <<<<<<<<<<<<<<
75228  *                     self._last.text = text
75229  *             del self._data[:]
75230  */
75231         #ifndef PYREX_WITHOUT_ASSERTIONS
75232         __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self->_last), __pyx_kp_text); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75233         __Pyx_GOTREF(__pyx_t_4);
75234         __pyx_t_1 = (__pyx_t_4 == Py_None);
75235         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
75236         if (unlikely(!__pyx_t_1)) {
75237           PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_468));
75238           {__pyx_filename = __pyx_f[12]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75239         }
75240         #endif
75241
75242         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":367
75243  *                 else:
75244  *                     assert self._last.text is None, u"internal error (text)"
75245  *                     self._last.text = text             # <<<<<<<<<<<<<<
75246  *             del self._data[:]
75247  *         return 0
75248  */
75249         if (PyObject_SetAttr(((PyObject *)__pyx_v_self->_last), __pyx_kp_text, __pyx_v_text) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75250       }
75251       __pyx_L5:;
75252       goto __pyx_L4;
75253     }
75254     __pyx_L4:;
75255
75256     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":368
75257  *                     assert self._last.text is None, u"internal error (text)"
75258  *                     self._last.text = text
75259  *             del self._data[:]             # <<<<<<<<<<<<<<
75260  *         return 0
75261  * 
75262  */
75263     if (PySequence_DelSlice(((PyObject *)__pyx_v_self->_data), 0, PY_SSIZE_T_MAX) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75264     goto __pyx_L3;
75265   }
75266   __pyx_L3:;
75267
75268   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":369
75269  *                     self._last.text = text
75270  *             del self._data[:]
75271  *         return 0             # <<<<<<<<<<<<<<
75272  * 
75273  *     # Python level event handlers
75274  */
75275   __pyx_r = 0;
75276   goto __pyx_L0;
75277
75278   __pyx_r = 0;
75279   goto __pyx_L0;
75280   __pyx_L1_error:;
75281   __Pyx_XDECREF(__pyx_t_2);
75282   __Pyx_XDECREF(__pyx_t_3);
75283   __Pyx_XDECREF(__pyx_t_4);
75284   __Pyx_AddTraceback("lxml.etree.TreeBuilder._flush");
75285   __pyx_r = -1;
75286   __pyx_L0:;
75287   __Pyx_DECREF(__pyx_v_text);
75288   __Pyx_FinishRefcountContext();
75289   return __pyx_r;
75290 }
75291
75292 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":373
75293  *     # Python level event handlers
75294  * 
75295  *     def close(self):             # <<<<<<<<<<<<<<
75296  *         u"""close(self)
75297  * 
75298  */
75299
75300 static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_close(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
75301 static char __pyx_doc_4lxml_5etree_11TreeBuilder_close[] = "close(self)\n\n        Flushes the builder buffers, and returns the toplevel document\n        element.\n        ";
75302 static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_close(PyObject *__pyx_v_self, PyObject *unused) {
75303   PyObject *__pyx_r = NULL;
75304   int __pyx_t_1;
75305   __Pyx_SetupRefcountContext("close");
75306
75307   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":379
75308  *         element.
75309  *         """
75310  *         assert python.PyList_GET_SIZE(self._element_stack) == 0, u"missing end tags"             # <<<<<<<<<<<<<<
75311  *         assert self._last is not None, u"missing toplevel element"
75312  *         return self._last
75313  */
75314   #ifndef PYREX_WITHOUT_ASSERTIONS
75315   if (unlikely(!(PyList_GET_SIZE(((PyObject *)((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_element_stack)) == 0))) {
75316     PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_469));
75317     {__pyx_filename = __pyx_f[12]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75318   }
75319   #endif
75320
75321   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":380
75322  *         """
75323  *         assert python.PyList_GET_SIZE(self._element_stack) == 0, u"missing end tags"
75324  *         assert self._last is not None, u"missing toplevel element"             # <<<<<<<<<<<<<<
75325  *         return self._last
75326  * 
75327  */
75328   #ifndef PYREX_WITHOUT_ASSERTIONS
75329   __pyx_t_1 = (((PyObject *)((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_last) != Py_None);
75330   if (unlikely(!__pyx_t_1)) {
75331     PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_470));
75332     {__pyx_filename = __pyx_f[12]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75333   }
75334   #endif
75335
75336   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":381
75337  *         assert python.PyList_GET_SIZE(self._element_stack) == 0, u"missing end tags"
75338  *         assert self._last is not None, u"missing toplevel element"
75339  *         return self._last             # <<<<<<<<<<<<<<
75340  * 
75341  *     def data(self, data):
75342  */
75343   __Pyx_XDECREF(__pyx_r);
75344   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_last));
75345   __pyx_r = ((PyObject *)((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_last);
75346   goto __pyx_L0;
75347
75348   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
75349   goto __pyx_L0;
75350   __pyx_L1_error:;
75351   __Pyx_AddTraceback("lxml.etree.TreeBuilder.close");
75352   __pyx_r = NULL;
75353   __pyx_L0:;
75354   __Pyx_XGIVEREF(__pyx_r);
75355   __Pyx_FinishRefcountContext();
75356   return __pyx_r;
75357 }
75358
75359 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":383
75360  *         return self._last
75361  * 
75362  *     def data(self, data):             # <<<<<<<<<<<<<<
75363  *         u"""data(self, data)
75364  * 
75365  */
75366
75367 static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_data(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
75368 static char __pyx_doc_4lxml_5etree_11TreeBuilder_data[] = "data(self, data)\n\n        Adds text to the current element.  The value should be either an\n        8-bit string containing ASCII text, or a Unicode string.\n        ";
75369 static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_data(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
75370   PyObject *__pyx_r = NULL;
75371   int __pyx_t_1;
75372   __Pyx_SetupRefcountContext("data");
75373
75374   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":389
75375  *         8-bit string containing ASCII text, or a Unicode string.
75376  *         """
75377  *         self._handleSaxData(data)             # <<<<<<<<<<<<<<
75378  * 
75379  *     def start(self, tag, attrs, nsmap=None):
75380  */
75381   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree_TreeBuilder *)((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._handleSaxData(((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self), __pyx_v_data); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75382
75383   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
75384   goto __pyx_L0;
75385   __pyx_L1_error:;
75386   __Pyx_AddTraceback("lxml.etree.TreeBuilder.data");
75387   __pyx_r = NULL;
75388   __pyx_L0:;
75389   __Pyx_XGIVEREF(__pyx_r);
75390   __Pyx_FinishRefcountContext();
75391   return __pyx_r;
75392 }
75393
75394 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":391
75395  *         self._handleSaxData(data)
75396  * 
75397  *     def start(self, tag, attrs, nsmap=None):             # <<<<<<<<<<<<<<
75398  *         u"""start(self, tag, attrs, nsmap=None)
75399  * 
75400  */
75401
75402 static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
75403 static char __pyx_doc_4lxml_5etree_11TreeBuilder_start[] = "start(self, tag, attrs, nsmap=None)\n\n        Opens a new element.\n        ";
75404 static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
75405   PyObject *__pyx_v_tag = 0;
75406   PyObject *__pyx_v_attrs = 0;
75407   PyObject *__pyx_v_nsmap = 0;
75408   PyObject *__pyx_r = NULL;
75409   int __pyx_t_1;
75410   PyObject *__pyx_t_2 = NULL;
75411   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_tag,&__pyx_kp_attrs,&__pyx_kp_nsmap,0};
75412   __Pyx_SetupRefcountContext("start");
75413   if (unlikely(__pyx_kwds)) {
75414     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
75415     PyObject* values[3] = {0,0,0};
75416     values[2] = Py_None;
75417     switch (PyTuple_GET_SIZE(__pyx_args)) {
75418       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
75419       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
75420       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
75421       case  0: break;
75422       default: goto __pyx_L5_argtuple_error;
75423     }
75424     switch (PyTuple_GET_SIZE(__pyx_args)) {
75425       case  0:
75426       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_tag);
75427       if (likely(values[0])) kw_args--;
75428       else goto __pyx_L5_argtuple_error;
75429       case  1:
75430       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_attrs);
75431       if (likely(values[1])) kw_args--;
75432       else {
75433         __Pyx_RaiseArgtupleInvalid("start", 0, 2, 3, 1); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
75434       }
75435       case  2:
75436       if (kw_args > 1) {
75437         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_nsmap);
75438         if (unlikely(value)) { values[2] = value; kw_args--; }
75439       }
75440     }
75441     if (unlikely(kw_args > 0)) {
75442       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "start") < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
75443     }
75444     __pyx_v_tag = values[0];
75445     __pyx_v_attrs = values[1];
75446     __pyx_v_nsmap = values[2];
75447   } else {
75448     __pyx_v_nsmap = Py_None;
75449     switch (PyTuple_GET_SIZE(__pyx_args)) {
75450       case  3:
75451       __pyx_v_nsmap = PyTuple_GET_ITEM(__pyx_args, 2);
75452       case  2:
75453       __pyx_v_attrs = PyTuple_GET_ITEM(__pyx_args, 1);
75454       __pyx_v_tag = PyTuple_GET_ITEM(__pyx_args, 0);
75455       break;
75456       default: goto __pyx_L5_argtuple_error;
75457     }
75458   }
75459   goto __pyx_L4_argument_unpacking_done;
75460   __pyx_L5_argtuple_error:;
75461   __Pyx_RaiseArgtupleInvalid("start", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
75462   __pyx_L3_error:;
75463   __Pyx_AddTraceback("lxml.etree.TreeBuilder.start");
75464   return NULL;
75465   __pyx_L4_argument_unpacking_done:;
75466   __Pyx_INCREF(__pyx_v_nsmap);
75467
75468   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":396
75469  *         Opens a new element.
75470  *         """
75471  *         if nsmap is None:             # <<<<<<<<<<<<<<
75472  *             nsmap = EMPTY_READ_ONLY_DICT
75473  *         return self._handleSaxStart(tag, attrs, nsmap)
75474  */
75475   __pyx_t_1 = (__pyx_v_nsmap == Py_None);
75476   if (__pyx_t_1) {
75477
75478     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":397
75479  *         """
75480  *         if nsmap is None:
75481  *             nsmap = EMPTY_READ_ONLY_DICT             # <<<<<<<<<<<<<<
75482  *         return self._handleSaxStart(tag, attrs, nsmap)
75483  * 
75484  */
75485     __Pyx_INCREF(__pyx_v_4lxml_5etree_EMPTY_READ_ONLY_DICT);
75486     __Pyx_DECREF(__pyx_v_nsmap);
75487     __pyx_v_nsmap = __pyx_v_4lxml_5etree_EMPTY_READ_ONLY_DICT;
75488     goto __pyx_L6;
75489   }
75490   __pyx_L6:;
75491
75492   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":398
75493  *         if nsmap is None:
75494  *             nsmap = EMPTY_READ_ONLY_DICT
75495  *         return self._handleSaxStart(tag, attrs, nsmap)             # <<<<<<<<<<<<<<
75496  * 
75497  *     def end(self, tag):
75498  */
75499   __Pyx_XDECREF(__pyx_r);
75500   __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree_TreeBuilder *)((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._handleSaxStart(((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self), __pyx_v_tag, __pyx_v_attrs, __pyx_v_nsmap); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75501   __Pyx_GOTREF(__pyx_t_2);
75502   __pyx_r = __pyx_t_2;
75503   __pyx_t_2 = 0;
75504   goto __pyx_L0;
75505
75506   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
75507   goto __pyx_L0;
75508   __pyx_L1_error:;
75509   __Pyx_XDECREF(__pyx_t_2);
75510   __Pyx_AddTraceback("lxml.etree.TreeBuilder.start");
75511   __pyx_r = NULL;
75512   __pyx_L0:;
75513   __Pyx_DECREF(__pyx_v_nsmap);
75514   __Pyx_XGIVEREF(__pyx_r);
75515   __Pyx_FinishRefcountContext();
75516   return __pyx_r;
75517 }
75518
75519 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":400
75520  *         return self._handleSaxStart(tag, attrs, nsmap)
75521  * 
75522  *     def end(self, tag):             # <<<<<<<<<<<<<<
75523  *         u"""end(self, tag)
75524  * 
75525  */
75526
75527 static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_end(PyObject *__pyx_v_self, PyObject *__pyx_v_tag); /*proto*/
75528 static char __pyx_doc_4lxml_5etree_11TreeBuilder_end[] = "end(self, tag)\n\n        Closes the current element.\n        ";
75529 static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_end(PyObject *__pyx_v_self, PyObject *__pyx_v_tag) {
75530   PyObject *__pyx_v_element;
75531   PyObject *__pyx_r = NULL;
75532   PyObject *__pyx_t_1 = NULL;
75533   PyObject *__pyx_t_2 = NULL;
75534   int __pyx_t_3;
75535   __Pyx_SetupRefcountContext("end");
75536   __pyx_v_element = Py_None; __Pyx_INCREF(Py_None);
75537
75538   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":405
75539  *         Closes the current element.
75540  *         """
75541  *         element = self._handleSaxEnd(tag)             # <<<<<<<<<<<<<<
75542  *         assert self._last.tag == tag,\
75543  *                u"end tag mismatch (expected %s, got %s)" % (
75544  */
75545   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree_TreeBuilder *)((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._handleSaxEnd(((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self), __pyx_v_tag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75546   __Pyx_GOTREF(__pyx_t_1);
75547   __Pyx_DECREF(__pyx_v_element);
75548   __pyx_v_element = __pyx_t_1;
75549   __pyx_t_1 = 0;
75550
75551   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":406
75552  *         """
75553  *         element = self._handleSaxEnd(tag)
75554  *         assert self._last.tag == tag,\             # <<<<<<<<<<<<<<
75555  *                u"end tag mismatch (expected %s, got %s)" % (
75556  *                    self._last.tag, tag)
75557  */
75558   #ifndef PYREX_WITHOUT_ASSERTIONS
75559   __pyx_t_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_last), __pyx_kp_tag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75560   __Pyx_GOTREF(__pyx_t_1);
75561   __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_v_tag, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75562   __Pyx_GOTREF(__pyx_t_2);
75563   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
75564   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75565   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
75566   if (unlikely(!__pyx_t_3)) {
75567
75568     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":408
75569  *         assert self._last.tag == tag,\
75570  *                u"end tag mismatch (expected %s, got %s)" % (
75571  *                    self._last.tag, tag)             # <<<<<<<<<<<<<<
75572  *         return element
75573  * 
75574  */
75575     __pyx_t_2 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_last), __pyx_kp_tag); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75576     __Pyx_GOTREF(__pyx_t_2);
75577     __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75578     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
75579     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
75580     __Pyx_GIVEREF(__pyx_t_2);
75581     __Pyx_INCREF(__pyx_v_tag);
75582     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_tag);
75583     __Pyx_GIVEREF(__pyx_v_tag);
75584     __pyx_t_2 = 0;
75585     __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_471), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75586     __Pyx_GOTREF(__pyx_t_2);
75587     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
75588     PyErr_SetObject(PyExc_AssertionError, __pyx_t_2);
75589     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
75590     {__pyx_filename = __pyx_f[12]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75591   }
75592   #endif
75593
75594   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":409
75595  *                u"end tag mismatch (expected %s, got %s)" % (
75596  *                    self._last.tag, tag)
75597  *         return element             # <<<<<<<<<<<<<<
75598  * 
75599  *     def pi(self, target, data):
75600  */
75601   __Pyx_XDECREF(__pyx_r);
75602   __Pyx_INCREF(__pyx_v_element);
75603   __pyx_r = __pyx_v_element;
75604   goto __pyx_L0;
75605
75606   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
75607   goto __pyx_L0;
75608   __pyx_L1_error:;
75609   __Pyx_XDECREF(__pyx_t_1);
75610   __Pyx_XDECREF(__pyx_t_2);
75611   __Pyx_AddTraceback("lxml.etree.TreeBuilder.end");
75612   __pyx_r = NULL;
75613   __pyx_L0:;
75614   __Pyx_DECREF(__pyx_v_element);
75615   __Pyx_XGIVEREF(__pyx_r);
75616   __Pyx_FinishRefcountContext();
75617   return __pyx_r;
75618 }
75619
75620 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":411
75621  *         return element
75622  * 
75623  *     def pi(self, target, data):             # <<<<<<<<<<<<<<
75624  *         u"""pi(self, target, data)
75625  *         """
75626  */
75627
75628 static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_pi(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
75629 static char __pyx_doc_4lxml_5etree_11TreeBuilder_pi[] = "pi(self, target, data)\n        ";
75630 static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_pi(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
75631   PyObject *__pyx_v_target = 0;
75632   PyObject *__pyx_v_data = 0;
75633   PyObject *__pyx_r = NULL;
75634   PyObject *__pyx_t_1 = NULL;
75635   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_target,&__pyx_kp_data,0};
75636   __Pyx_SetupRefcountContext("pi");
75637   if (unlikely(__pyx_kwds)) {
75638     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
75639     PyObject* values[2] = {0,0};
75640     switch (PyTuple_GET_SIZE(__pyx_args)) {
75641       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
75642       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
75643       case  0: break;
75644       default: goto __pyx_L5_argtuple_error;
75645     }
75646     switch (PyTuple_GET_SIZE(__pyx_args)) {
75647       case  0:
75648       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_target);
75649       if (likely(values[0])) kw_args--;
75650       else goto __pyx_L5_argtuple_error;
75651       case  1:
75652       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_data);
75653       if (likely(values[1])) kw_args--;
75654       else {
75655         __Pyx_RaiseArgtupleInvalid("pi", 1, 2, 2, 1); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
75656       }
75657     }
75658     if (unlikely(kw_args > 0)) {
75659       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "pi") < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
75660     }
75661     __pyx_v_target = values[0];
75662     __pyx_v_data = values[1];
75663   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
75664     goto __pyx_L5_argtuple_error;
75665   } else {
75666     __pyx_v_target = PyTuple_GET_ITEM(__pyx_args, 0);
75667     __pyx_v_data = PyTuple_GET_ITEM(__pyx_args, 1);
75668   }
75669   goto __pyx_L4_argument_unpacking_done;
75670   __pyx_L5_argtuple_error:;
75671   __Pyx_RaiseArgtupleInvalid("pi", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[12]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
75672   __pyx_L3_error:;
75673   __Pyx_AddTraceback("lxml.etree.TreeBuilder.pi");
75674   return NULL;
75675   __pyx_L4_argument_unpacking_done:;
75676
75677   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":414
75678  *         u"""pi(self, target, data)
75679  *         """
75680  *         return self._handleSaxPi(target, data)             # <<<<<<<<<<<<<<
75681  * 
75682  *     def comment(self, comment):
75683  */
75684   __Pyx_XDECREF(__pyx_r);
75685   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree_TreeBuilder *)((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._handleSaxPi(((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self), __pyx_v_target, __pyx_v_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75686   __Pyx_GOTREF(__pyx_t_1);
75687   __pyx_r = __pyx_t_1;
75688   __pyx_t_1 = 0;
75689   goto __pyx_L0;
75690
75691   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
75692   goto __pyx_L0;
75693   __pyx_L1_error:;
75694   __Pyx_XDECREF(__pyx_t_1);
75695   __Pyx_AddTraceback("lxml.etree.TreeBuilder.pi");
75696   __pyx_r = NULL;
75697   __pyx_L0:;
75698   __Pyx_XGIVEREF(__pyx_r);
75699   __Pyx_FinishRefcountContext();
75700   return __pyx_r;
75701 }
75702
75703 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":416
75704  *         return self._handleSaxPi(target, data)
75705  * 
75706  *     def comment(self, comment):             # <<<<<<<<<<<<<<
75707  *         u"""comment(self, comment)
75708  *         """
75709  */
75710
75711 static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_comment(PyObject *__pyx_v_self, PyObject *__pyx_v_comment); /*proto*/
75712 static char __pyx_doc_4lxml_5etree_11TreeBuilder_comment[] = "comment(self, comment)\n        ";
75713 static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_comment(PyObject *__pyx_v_self, PyObject *__pyx_v_comment) {
75714   PyObject *__pyx_r = NULL;
75715   PyObject *__pyx_t_1 = NULL;
75716   __Pyx_SetupRefcountContext("comment");
75717
75718   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":419
75719  *         u"""comment(self, comment)
75720  *         """
75721  *         return self._handleSaxComment(comment)             # <<<<<<<<<<<<<<
75722  * 
75723  *     # internal SAX event handlers
75724  */
75725   __Pyx_XDECREF(__pyx_r);
75726   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree_TreeBuilder *)((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._handleSaxComment(((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self), __pyx_v_comment); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75727   __Pyx_GOTREF(__pyx_t_1);
75728   __pyx_r = __pyx_t_1;
75729   __pyx_t_1 = 0;
75730   goto __pyx_L0;
75731
75732   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
75733   goto __pyx_L0;
75734   __pyx_L1_error:;
75735   __Pyx_XDECREF(__pyx_t_1);
75736   __Pyx_AddTraceback("lxml.etree.TreeBuilder.comment");
75737   __pyx_r = NULL;
75738   __pyx_L0:;
75739   __Pyx_XGIVEREF(__pyx_r);
75740   __Pyx_FinishRefcountContext();
75741   return __pyx_r;
75742 }
75743
75744 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":423
75745  *     # internal SAX event handlers
75746  * 
75747  *     cdef _handleSaxStart(self, tag, attrib, nsmap):             # <<<<<<<<<<<<<<
75748  *         self._flush()
75749  *         if self._factory is not None:
75750  */
75751
75752 static  PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(struct __pyx_obj_4lxml_5etree_TreeBuilder *__pyx_v_self, PyObject *__pyx_v_tag, PyObject *__pyx_v_attrib, PyObject *__pyx_v_nsmap) {
75753   PyObject *__pyx_r = NULL;
75754   PyObject *__pyx_1 = 0;
75755   int __pyx_t_1;
75756   int __pyx_t_2;
75757   PyObject *__pyx_t_3 = NULL;
75758   PyObject *__pyx_t_4 = NULL;
75759   __Pyx_SetupRefcountContext("_handleSaxStart");
75760
75761   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":424
75762  * 
75763  *     cdef _handleSaxStart(self, tag, attrib, nsmap):
75764  *         self._flush()             # <<<<<<<<<<<<<<
75765  *         if self._factory is not None:
75766  *             self._last = self._factory(tag, attrib)
75767  */
75768   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree_TreeBuilder *)__pyx_v_self->__pyx_base.__pyx_vtab)->_flush(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75769
75770   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":425
75771  *     cdef _handleSaxStart(self, tag, attrib, nsmap):
75772  *         self._flush()
75773  *         if self._factory is not None:             # <<<<<<<<<<<<<<
75774  *             self._last = self._factory(tag, attrib)
75775  *             if python.PyList_GET_SIZE(self._element_stack) > 0:
75776  */
75777   __pyx_t_2 = (__pyx_v_self->_factory != Py_None);
75778   if (__pyx_t_2) {
75779
75780     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":426
75781  *         self._flush()
75782  *         if self._factory is not None:
75783  *             self._last = self._factory(tag, attrib)             # <<<<<<<<<<<<<<
75784  *             if python.PyList_GET_SIZE(self._element_stack) > 0:
75785  *                 _appendChild(self._element_stack[-1], self._last)
75786  */
75787     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75788     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
75789     __Pyx_INCREF(__pyx_v_tag);
75790     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_tag);
75791     __Pyx_GIVEREF(__pyx_v_tag);
75792     __Pyx_INCREF(__pyx_v_attrib);
75793     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_attrib);
75794     __Pyx_GIVEREF(__pyx_v_attrib);
75795     __pyx_t_4 = PyObject_Call(__pyx_v_self->_factory, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75796     __Pyx_GOTREF(__pyx_t_4);
75797     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
75798     if (!(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75799     __Pyx_GIVEREF(__pyx_t_4);
75800     __Pyx_GOTREF(__pyx_v_self->_last);
75801     __Pyx_DECREF(((PyObject *)__pyx_v_self->_last));
75802     __pyx_v_self->_last = ((struct LxmlElement *)__pyx_t_4);
75803     __pyx_t_4 = 0;
75804
75805     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":427
75806  *         if self._factory is not None:
75807  *             self._last = self._factory(tag, attrib)
75808  *             if python.PyList_GET_SIZE(self._element_stack) > 0:             # <<<<<<<<<<<<<<
75809  *                 _appendChild(self._element_stack[-1], self._last)
75810  *         elif python.PyList_GET_SIZE(self._element_stack) > 0:
75811  */
75812     __pyx_t_2 = (PyList_GET_SIZE(((PyObject *)__pyx_v_self->_element_stack)) > 0);
75813     if (__pyx_t_2) {
75814
75815       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":428
75816  *             self._last = self._factory(tag, attrib)
75817  *             if python.PyList_GET_SIZE(self._element_stack) > 0:
75818  *                 _appendChild(self._element_stack[-1], self._last)             # <<<<<<<<<<<<<<
75819  *         elif python.PyList_GET_SIZE(self._element_stack) > 0:
75820  *             self._last = _makeSubElement(
75821  */
75822       __pyx_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_self->_element_stack), -1, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75823       __Pyx_GOTREF(__pyx_1);
75824       if (!(__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75825       __pyx_t_1 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_1), __pyx_v_self->_last); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75826       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
75827       goto __pyx_L4;
75828     }
75829     __pyx_L4:;
75830     goto __pyx_L3;
75831   }
75832
75833   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":429
75834  *             if python.PyList_GET_SIZE(self._element_stack) > 0:
75835  *                 _appendChild(self._element_stack[-1], self._last)
75836  *         elif python.PyList_GET_SIZE(self._element_stack) > 0:             # <<<<<<<<<<<<<<
75837  *             self._last = _makeSubElement(
75838  *                 self._element_stack[-1], tag, None, None, attrib, nsmap, None)
75839  */
75840   __pyx_t_2 = (PyList_GET_SIZE(((PyObject *)__pyx_v_self->_element_stack)) > 0);
75841   if (__pyx_t_2) {
75842
75843     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":431
75844  *         elif python.PyList_GET_SIZE(self._element_stack) > 0:
75845  *             self._last = _makeSubElement(
75846  *                 self._element_stack[-1], tag, None, None, attrib, nsmap, None)             # <<<<<<<<<<<<<<
75847  *         else:
75848  *             self._last = _makeElement(
75849  */
75850     __pyx_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_self->_element_stack), -1, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75851     __Pyx_GOTREF(__pyx_1);
75852     if (!(__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75853     __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__makeSubElement(((struct LxmlElement *)__pyx_1), __pyx_v_tag, Py_None, Py_None, __pyx_v_attrib, __pyx_v_nsmap, Py_None)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75854     __Pyx_GOTREF(__pyx_t_4);
75855     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
75856
75857     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":430
75858  *                 _appendChild(self._element_stack[-1], self._last)
75859  *         elif python.PyList_GET_SIZE(self._element_stack) > 0:
75860  *             self._last = _makeSubElement(             # <<<<<<<<<<<<<<
75861  *                 self._element_stack[-1], tag, None, None, attrib, nsmap, None)
75862  *         else:
75863  */
75864     __Pyx_GIVEREF(__pyx_t_4);
75865     __Pyx_GOTREF(__pyx_v_self->_last);
75866     __Pyx_DECREF(((PyObject *)__pyx_v_self->_last));
75867     __pyx_v_self->_last = ((struct LxmlElement *)__pyx_t_4);
75868     __pyx_t_4 = 0;
75869     goto __pyx_L3;
75870   }
75871   /*else*/ {
75872
75873     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":434
75874  *         else:
75875  *             self._last = _makeElement(
75876  *                 tag, NULL, None, self._parser, None, None, attrib, nsmap, None)             # <<<<<<<<<<<<<<
75877  *         self._element_stack.append(self._last)
75878  *         self._in_tail = 0
75879  */
75880     __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__makeElement(__pyx_v_tag, NULL, ((struct LxmlDocument *)Py_None), __pyx_v_self->_parser, Py_None, Py_None, __pyx_v_attrib, __pyx_v_nsmap, Py_None)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75881     __Pyx_GOTREF(__pyx_t_4);
75882
75883     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":433
75884  *                 self._element_stack[-1], tag, None, None, attrib, nsmap, None)
75885  *         else:
75886  *             self._last = _makeElement(             # <<<<<<<<<<<<<<
75887  *                 tag, NULL, None, self._parser, None, None, attrib, nsmap, None)
75888  *         self._element_stack.append(self._last)
75889  */
75890     __Pyx_GIVEREF(__pyx_t_4);
75891     __Pyx_GOTREF(__pyx_v_self->_last);
75892     __Pyx_DECREF(((PyObject *)__pyx_v_self->_last));
75893     __pyx_v_self->_last = ((struct LxmlElement *)__pyx_t_4);
75894     __pyx_t_4 = 0;
75895   }
75896   __pyx_L3:;
75897
75898   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":435
75899  *             self._last = _makeElement(
75900  *                 tag, NULL, None, self._parser, None, None, attrib, nsmap, None)
75901  *         self._element_stack.append(self._last)             # <<<<<<<<<<<<<<
75902  *         self._in_tail = 0
75903  *         return self._last
75904  */
75905   __pyx_t_1 = PyList_Append(((PyObject *)__pyx_v_self->_element_stack), ((PyObject *)__pyx_v_self->_last)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75906
75907   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":436
75908  *                 tag, NULL, None, self._parser, None, None, attrib, nsmap, None)
75909  *         self._element_stack.append(self._last)
75910  *         self._in_tail = 0             # <<<<<<<<<<<<<<
75911  *         return self._last
75912  * 
75913  */
75914   __pyx_v_self->_in_tail = 0;
75915
75916   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":437
75917  *         self._element_stack.append(self._last)
75918  *         self._in_tail = 0
75919  *         return self._last             # <<<<<<<<<<<<<<
75920  * 
75921  *     cdef _handleSaxEnd(self, tag):
75922  */
75923   __Pyx_XDECREF(__pyx_r);
75924   __Pyx_INCREF(((PyObject *)__pyx_v_self->_last));
75925   __pyx_r = ((PyObject *)__pyx_v_self->_last);
75926   goto __pyx_L0;
75927
75928   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
75929   goto __pyx_L0;
75930   __pyx_L1_error:;
75931   __Pyx_XDECREF(__pyx_1);
75932   __Pyx_XDECREF(__pyx_t_3);
75933   __Pyx_XDECREF(__pyx_t_4);
75934   __Pyx_AddTraceback("lxml.etree.TreeBuilder._handleSaxStart");
75935   __pyx_r = 0;
75936   __pyx_L0:;
75937   __Pyx_XGIVEREF(__pyx_r);
75938   __Pyx_FinishRefcountContext();
75939   return __pyx_r;
75940 }
75941
75942 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":439
75943  *         return self._last
75944  * 
75945  *     cdef _handleSaxEnd(self, tag):             # <<<<<<<<<<<<<<
75946  *         self._flush()
75947  *         self._last = self._element_stack_pop()
75948  */
75949
75950 static  PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxEnd(struct __pyx_obj_4lxml_5etree_TreeBuilder *__pyx_v_self, PyObject *__pyx_v_tag) {
75951   PyObject *__pyx_r = NULL;
75952   int __pyx_t_1;
75953   PyObject *__pyx_t_2 = NULL;
75954   __Pyx_SetupRefcountContext("_handleSaxEnd");
75955
75956   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":440
75957  * 
75958  *     cdef _handleSaxEnd(self, tag):
75959  *         self._flush()             # <<<<<<<<<<<<<<
75960  *         self._last = self._element_stack_pop()
75961  *         self._in_tail = 1
75962  */
75963   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree_TreeBuilder *)__pyx_v_self->__pyx_base.__pyx_vtab)->_flush(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75964
75965   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":441
75966  *     cdef _handleSaxEnd(self, tag):
75967  *         self._flush()
75968  *         self._last = self._element_stack_pop()             # <<<<<<<<<<<<<<
75969  *         self._in_tail = 1
75970  *         return self._last
75971  */
75972   __pyx_t_2 = PyObject_Call(__pyx_v_self->_element_stack_pop, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75973   __Pyx_GOTREF(__pyx_t_2);
75974   if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
75975   __Pyx_GIVEREF(__pyx_t_2);
75976   __Pyx_GOTREF(__pyx_v_self->_last);
75977   __Pyx_DECREF(((PyObject *)__pyx_v_self->_last));
75978   __pyx_v_self->_last = ((struct LxmlElement *)__pyx_t_2);
75979   __pyx_t_2 = 0;
75980
75981   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":442
75982  *         self._flush()
75983  *         self._last = self._element_stack_pop()
75984  *         self._in_tail = 1             # <<<<<<<<<<<<<<
75985  *         return self._last
75986  * 
75987  */
75988   __pyx_v_self->_in_tail = 1;
75989
75990   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":443
75991  *         self._last = self._element_stack_pop()
75992  *         self._in_tail = 1
75993  *         return self._last             # <<<<<<<<<<<<<<
75994  * 
75995  *     cdef int _handleSaxData(self, data) except -1:
75996  */
75997   __Pyx_XDECREF(__pyx_r);
75998   __Pyx_INCREF(((PyObject *)__pyx_v_self->_last));
75999   __pyx_r = ((PyObject *)__pyx_v_self->_last);
76000   goto __pyx_L0;
76001
76002   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
76003   goto __pyx_L0;
76004   __pyx_L1_error:;
76005   __Pyx_XDECREF(__pyx_t_2);
76006   __Pyx_AddTraceback("lxml.etree.TreeBuilder._handleSaxEnd");
76007   __pyx_r = 0;
76008   __pyx_L0:;
76009   __Pyx_XGIVEREF(__pyx_r);
76010   __Pyx_FinishRefcountContext();
76011   return __pyx_r;
76012 }
76013
76014 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":445
76015  *         return self._last
76016  * 
76017  *     cdef int _handleSaxData(self, data) except -1:             # <<<<<<<<<<<<<<
76018  *         self._data.append(data)
76019  * 
76020  */
76021
76022 static  int __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxData(struct __pyx_obj_4lxml_5etree_TreeBuilder *__pyx_v_self, PyObject *__pyx_v_data) {
76023   int __pyx_r;
76024   int __pyx_t_1;
76025   __Pyx_SetupRefcountContext("_handleSaxData");
76026
76027   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":446
76028  * 
76029  *     cdef int _handleSaxData(self, data) except -1:
76030  *         self._data.append(data)             # <<<<<<<<<<<<<<
76031  * 
76032  *     cdef _handleSaxPi(self, target, data):
76033  */
76034   __pyx_t_1 = PyList_Append(((PyObject *)__pyx_v_self->_data), __pyx_v_data); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
76035
76036   __pyx_r = 0;
76037   goto __pyx_L0;
76038   __pyx_L1_error:;
76039   __Pyx_AddTraceback("lxml.etree.TreeBuilder._handleSaxData");
76040   __pyx_r = -1;
76041   __pyx_L0:;
76042   __Pyx_FinishRefcountContext();
76043   return __pyx_r;
76044 }
76045
76046 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":448
76047  *         self._data.append(data)
76048  * 
76049  *     cdef _handleSaxPi(self, target, data):             # <<<<<<<<<<<<<<
76050  *         self._flush()
76051  *         self._last = ProcessingInstruction(target, data)
76052  */
76053
76054 static  PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxPi(struct __pyx_obj_4lxml_5etree_TreeBuilder *__pyx_v_self, PyObject *__pyx_v_target, PyObject *__pyx_v_data) {
76055   PyObject *__pyx_r = NULL;
76056   PyObject *__pyx_1 = 0;
76057   int __pyx_t_1;
76058   PyObject *__pyx_t_2 = NULL;
76059   PyObject *__pyx_t_3 = NULL;
76060   int __pyx_t_4;
76061   __Pyx_SetupRefcountContext("_handleSaxPi");
76062
76063   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":449
76064  * 
76065  *     cdef _handleSaxPi(self, target, data):
76066  *         self._flush()             # <<<<<<<<<<<<<<
76067  *         self._last = ProcessingInstruction(target, data)
76068  *         if python.PyList_GET_SIZE(self._element_stack) > 0:
76069  */
76070   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree_TreeBuilder *)__pyx_v_self->__pyx_base.__pyx_vtab)->_flush(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
76071
76072   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":450
76073  *     cdef _handleSaxPi(self, target, data):
76074  *         self._flush()
76075  *         self._last = ProcessingInstruction(target, data)             # <<<<<<<<<<<<<<
76076  *         if python.PyList_GET_SIZE(self._element_stack) > 0:
76077  *             _appendChild(self._element_stack[-1], self._last)
76078  */
76079   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_101); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
76080   __Pyx_GOTREF(__pyx_1);
76081   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
76082   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
76083   __Pyx_INCREF(__pyx_v_target);
76084   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_target);
76085   __Pyx_GIVEREF(__pyx_v_target);
76086   __Pyx_INCREF(__pyx_v_data);
76087   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_data);
76088   __Pyx_GIVEREF(__pyx_v_data);
76089   __pyx_t_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
76090   __Pyx_GOTREF(__pyx_t_3);
76091   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
76092   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
76093   if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
76094   __Pyx_GIVEREF(__pyx_t_3);
76095   __Pyx_GOTREF(__pyx_v_self->_last);
76096   __Pyx_DECREF(((PyObject *)__pyx_v_self->_last));
76097   __pyx_v_self->_last = ((struct LxmlElement *)__pyx_t_3);
76098   __pyx_t_3 = 0;
76099
76100   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":451
76101  *         self._flush()
76102  *         self._last = ProcessingInstruction(target, data)
76103  *         if python.PyList_GET_SIZE(self._element_stack) > 0:             # <<<<<<<<<<<<<<
76104  *             _appendChild(self._element_stack[-1], self._last)
76105  *         self._in_tail = 1
76106  */
76107   __pyx_t_4 = (PyList_GET_SIZE(((PyObject *)__pyx_v_self->_element_stack)) > 0);
76108   if (__pyx_t_4) {
76109
76110     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":452
76111  *         self._last = ProcessingInstruction(target, data)
76112  *         if python.PyList_GET_SIZE(self._element_stack) > 0:
76113  *             _appendChild(self._element_stack[-1], self._last)             # <<<<<<<<<<<<<<
76114  *         self._in_tail = 1
76115  *         return self._last
76116  */
76117     __pyx_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_self->_element_stack), -1, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
76118     __Pyx_GOTREF(__pyx_1);
76119     if (!(__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
76120     __pyx_t_1 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_1), __pyx_v_self->_last); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
76121     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
76122     goto __pyx_L3;
76123   }
76124   __pyx_L3:;
76125
76126   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":453
76127  *         if python.PyList_GET_SIZE(self._element_stack) > 0:
76128  *             _appendChild(self._element_stack[-1], self._last)
76129  *         self._in_tail = 1             # <<<<<<<<<<<<<<
76130  *         return self._last
76131  * 
76132  */
76133   __pyx_v_self->_in_tail = 1;
76134
76135   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":454
76136  *             _appendChild(self._element_stack[-1], self._last)
76137  *         self._in_tail = 1
76138  *         return self._last             # <<<<<<<<<<<<<<
76139  * 
76140  *     cdef _handleSaxComment(self, comment):
76141  */
76142   __Pyx_XDECREF(__pyx_r);
76143   __Pyx_INCREF(((PyObject *)__pyx_v_self->_last));
76144   __pyx_r = ((PyObject *)__pyx_v_self->_last);
76145   goto __pyx_L0;
76146
76147   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
76148   goto __pyx_L0;
76149   __pyx_L1_error:;
76150   __Pyx_XDECREF(__pyx_1);
76151   __Pyx_XDECREF(__pyx_t_2);
76152   __Pyx_XDECREF(__pyx_t_3);
76153   __Pyx_AddTraceback("lxml.etree.TreeBuilder._handleSaxPi");
76154   __pyx_r = 0;
76155   __pyx_L0:;
76156   __Pyx_XGIVEREF(__pyx_r);
76157   __Pyx_FinishRefcountContext();
76158   return __pyx_r;
76159 }
76160
76161 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":456
76162  *         return self._last
76163  * 
76164  *     cdef _handleSaxComment(self, comment):             # <<<<<<<<<<<<<<
76165  *         self._flush()
76166  *         self._last = Comment(comment)
76167  */
76168
76169 static  PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxComment(struct __pyx_obj_4lxml_5etree_TreeBuilder *__pyx_v_self, PyObject *__pyx_v_comment) {
76170   PyObject *__pyx_r = NULL;
76171   PyObject *__pyx_1 = 0;
76172   int __pyx_t_1;
76173   PyObject *__pyx_t_2 = NULL;
76174   PyObject *__pyx_t_3 = NULL;
76175   int __pyx_t_4;
76176   __Pyx_SetupRefcountContext("_handleSaxComment");
76177
76178   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":457
76179  * 
76180  *     cdef _handleSaxComment(self, comment):
76181  *         self._flush()             # <<<<<<<<<<<<<<
76182  *         self._last = Comment(comment)
76183  *         if python.PyList_GET_SIZE(self._element_stack) > 0:
76184  */
76185   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree_TreeBuilder *)__pyx_v_self->__pyx_base.__pyx_vtab)->_flush(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
76186
76187   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":458
76188  *     cdef _handleSaxComment(self, comment):
76189  *         self._flush()
76190  *         self._last = Comment(comment)             # <<<<<<<<<<<<<<
76191  *         if python.PyList_GET_SIZE(self._element_stack) > 0:
76192  *             _appendChild(self._element_stack[-1], self._last)
76193  */
76194   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_Comment); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
76195   __Pyx_GOTREF(__pyx_1);
76196   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
76197   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
76198   __Pyx_INCREF(__pyx_v_comment);
76199   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_comment);
76200   __Pyx_GIVEREF(__pyx_v_comment);
76201   __pyx_t_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
76202   __Pyx_GOTREF(__pyx_t_3);
76203   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
76204   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
76205   if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
76206   __Pyx_GIVEREF(__pyx_t_3);
76207   __Pyx_GOTREF(__pyx_v_self->_last);
76208   __Pyx_DECREF(((PyObject *)__pyx_v_self->_last));
76209   __pyx_v_self->_last = ((struct LxmlElement *)__pyx_t_3);
76210   __pyx_t_3 = 0;
76211
76212   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":459
76213  *         self._flush()
76214  *         self._last = Comment(comment)
76215  *         if python.PyList_GET_SIZE(self._element_stack) > 0:             # <<<<<<<<<<<<<<
76216  *             _appendChild(self._element_stack[-1], self._last)
76217  *         self._in_tail = 1
76218  */
76219   __pyx_t_4 = (PyList_GET_SIZE(((PyObject *)__pyx_v_self->_element_stack)) > 0);
76220   if (__pyx_t_4) {
76221
76222     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":460
76223  *         self._last = Comment(comment)
76224  *         if python.PyList_GET_SIZE(self._element_stack) > 0:
76225  *             _appendChild(self._element_stack[-1], self._last)             # <<<<<<<<<<<<<<
76226  *         self._in_tail = 1
76227  *         return self._last
76228  */
76229     __pyx_1 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_self->_element_stack), -1, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
76230     __Pyx_GOTREF(__pyx_1);
76231     if (!(__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
76232     __pyx_t_1 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_1), __pyx_v_self->_last); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
76233     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
76234     goto __pyx_L3;
76235   }
76236   __pyx_L3:;
76237
76238   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":461
76239  *         if python.PyList_GET_SIZE(self._element_stack) > 0:
76240  *             _appendChild(self._element_stack[-1], self._last)
76241  *         self._in_tail = 1             # <<<<<<<<<<<<<<
76242  *         return self._last
76243  */
76244   __pyx_v_self->_in_tail = 1;
76245
76246   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/saxparser.pxi":462
76247  *             _appendChild(self._element_stack[-1], self._last)
76248  *         self._in_tail = 1
76249  *         return self._last             # <<<<<<<<<<<<<<
76250  */
76251   __Pyx_XDECREF(__pyx_r);
76252   __Pyx_INCREF(((PyObject *)__pyx_v_self->_last));
76253   __pyx_r = ((PyObject *)__pyx_v_self->_last);
76254   goto __pyx_L0;
76255
76256   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
76257   goto __pyx_L0;
76258   __pyx_L1_error:;
76259   __Pyx_XDECREF(__pyx_1);
76260   __Pyx_XDECREF(__pyx_t_2);
76261   __Pyx_XDECREF(__pyx_t_3);
76262   __Pyx_AddTraceback("lxml.etree.TreeBuilder._handleSaxComment");
76263   __pyx_r = 0;
76264   __pyx_L0:;
76265   __Pyx_XGIVEREF(__pyx_r);
76266   __Pyx_FinishRefcountContext();
76267   return __pyx_r;
76268 }
76269
76270 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":10
76271  *     # to push the Python level parser result through the parser
76272  *     # machinery towards the API level functions
76273  *     def __init__(self, result):             # <<<<<<<<<<<<<<
76274  *         self.result = result
76275  * 
76276  */
76277
76278 static PyObject *__pyx_pf_4lxml_5etree_19_TargetParserResult___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
76279 static PyMethodDef __pyx_mdef_4lxml_5etree_19_TargetParserResult___init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pf_4lxml_5etree_19_TargetParserResult___init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
76280 static PyObject *__pyx_pf_4lxml_5etree_19_TargetParserResult___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
76281   PyObject *__pyx_v_self = 0;
76282   PyObject *__pyx_v_result = 0;
76283   PyObject *__pyx_r = NULL;
76284   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_self,&__pyx_kp_result,0};
76285   __Pyx_SetupRefcountContext("__init__");
76286   __pyx_self = __pyx_self;
76287   if (unlikely(__pyx_kwds)) {
76288     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
76289     PyObject* values[2] = {0,0};
76290     switch (PyTuple_GET_SIZE(__pyx_args)) {
76291       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
76292       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
76293       case  0: break;
76294       default: goto __pyx_L5_argtuple_error;
76295     }
76296     switch (PyTuple_GET_SIZE(__pyx_args)) {
76297       case  0:
76298       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_self);
76299       if (likely(values[0])) kw_args--;
76300       else goto __pyx_L5_argtuple_error;
76301       case  1:
76302       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_result);
76303       if (likely(values[1])) kw_args--;
76304       else {
76305         __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[13]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
76306       }
76307     }
76308     if (unlikely(kw_args > 0)) {
76309       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
76310     }
76311     __pyx_v_self = values[0];
76312     __pyx_v_result = values[1];
76313   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
76314     goto __pyx_L5_argtuple_error;
76315   } else {
76316     __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
76317     __pyx_v_result = PyTuple_GET_ITEM(__pyx_args, 1);
76318   }
76319   goto __pyx_L4_argument_unpacking_done;
76320   __pyx_L5_argtuple_error:;
76321   __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[13]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
76322   __pyx_L3_error:;
76323   __Pyx_AddTraceback("lxml.etree._TargetParserResult.__init__");
76324   return NULL;
76325   __pyx_L4_argument_unpacking_done:;
76326
76327   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":11
76328  *     # machinery towards the API level functions
76329  *     def __init__(self, result):
76330  *         self.result = result             # <<<<<<<<<<<<<<
76331  * 
76332  * cdef class _PythonSaxParserTarget(_SaxParserTarget):
76333  */
76334   if (PyObject_SetAttr(__pyx_v_self, __pyx_kp_result, __pyx_v_result) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
76335
76336   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
76337   goto __pyx_L0;
76338   __pyx_L1_error:;
76339   __Pyx_AddTraceback("lxml.etree._TargetParserResult.__init__");
76340   __pyx_r = NULL;
76341   __pyx_L0:;
76342   __Pyx_XGIVEREF(__pyx_r);
76343   __Pyx_FinishRefcountContext();
76344   return __pyx_r;
76345 }
76346
76347 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":22
76348  *     cdef bint _start_takes_nsmap
76349  * 
76350  *     def __init__(self, target):             # <<<<<<<<<<<<<<
76351  *         cdef int event_filter
76352  *         event_filter = 0
76353  */
76354
76355 static int __pyx_pf_4lxml_5etree_22_PythonSaxParserTarget___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
76356 static int __pyx_pf_4lxml_5etree_22_PythonSaxParserTarget___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
76357   PyObject *__pyx_v_target = 0;
76358   int __pyx_v_event_filter;
76359   PyObject *__pyx_v_arguments;
76360   int __pyx_r;
76361   int __pyx_1;
76362   PyObject *__pyx_2 = 0;
76363   PyObject *__pyx_t_1 = NULL;
76364   int __pyx_t_2;
76365   PyObject *__pyx_t_3 = NULL;
76366   Py_ssize_t __pyx_t_4;
76367   int __pyx_t_5;
76368   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_target,0};
76369   __Pyx_SetupRefcountContext("__init__");
76370   if (unlikely(__pyx_kwds)) {
76371     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
76372     PyObject* values[1] = {0};
76373     switch (PyTuple_GET_SIZE(__pyx_args)) {
76374       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
76375       case  0: break;
76376       default: goto __pyx_L5_argtuple_error;
76377     }
76378     switch (PyTuple_GET_SIZE(__pyx_args)) {
76379       case  0:
76380       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_target);
76381       if (likely(values[0])) kw_args--;
76382       else goto __pyx_L5_argtuple_error;
76383     }
76384     if (unlikely(kw_args > 0)) {
76385       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
76386     }
76387     __pyx_v_target = values[0];
76388   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
76389     goto __pyx_L5_argtuple_error;
76390   } else {
76391     __pyx_v_target = PyTuple_GET_ITEM(__pyx_args, 0);
76392   }
76393   goto __pyx_L4_argument_unpacking_done;
76394   __pyx_L5_argtuple_error:;
76395   __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[13]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
76396   __pyx_L3_error:;
76397   __Pyx_AddTraceback("lxml.etree._PythonSaxParserTarget.__init__");
76398   return -1;
76399   __pyx_L4_argument_unpacking_done:;
76400   __pyx_v_arguments = Py_None; __Pyx_INCREF(Py_None);
76401
76402   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":24
76403  *     def __init__(self, target):
76404  *         cdef int event_filter
76405  *         event_filter = 0             # <<<<<<<<<<<<<<
76406  *         self._start_takes_nsmap = 0
76407  *         try:
76408  */
76409   __pyx_v_event_filter = 0;
76410
76411   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":25
76412  *         cdef int event_filter
76413  *         event_filter = 0
76414  *         self._start_takes_nsmap = 0             # <<<<<<<<<<<<<<
76415  *         try:
76416  *             self._target_start = target.start
76417  */
76418   ((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_start_takes_nsmap = 0;
76419
76420   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":26
76421  *         event_filter = 0
76422  *         self._start_takes_nsmap = 0
76423  *         try:             # <<<<<<<<<<<<<<
76424  *             self._target_start = target.start
76425  *             if self._target_start is not None:
76426  */
76427   {
76428     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
76429     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
76430     __Pyx_XGOTREF(__pyx_save_exc_type);
76431     __Pyx_XGOTREF(__pyx_save_exc_value);
76432     __Pyx_XGOTREF(__pyx_save_exc_tb);
76433     /*try:*/ {
76434
76435       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":27
76436  *         self._start_takes_nsmap = 0
76437  *         try:
76438  *             self._target_start = target.start             # <<<<<<<<<<<<<<
76439  *             if self._target_start is not None:
76440  *                 event_filter = event_filter | SAX_EVENT_START
76441  */
76442       __pyx_t_1 = PyObject_GetAttr(__pyx_v_target, __pyx_kp_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
76443       __Pyx_GOTREF(__pyx_t_1);
76444       __Pyx_GIVEREF(__pyx_t_1);
76445       __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_start);
76446       __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_start);
76447       ((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_start = __pyx_t_1;
76448       __pyx_t_1 = 0;
76449
76450       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":28
76451  *         try:
76452  *             self._target_start = target.start
76453  *             if self._target_start is not None:             # <<<<<<<<<<<<<<
76454  *                 event_filter = event_filter | SAX_EVENT_START
76455  *         except AttributeError:
76456  */
76457       __pyx_t_2 = (((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_start != Py_None);
76458       if (__pyx_t_2) {
76459
76460         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":29
76461  *             self._target_start = target.start
76462  *             if self._target_start is not None:
76463  *                 event_filter = event_filter | SAX_EVENT_START             # <<<<<<<<<<<<<<
76464  *         except AttributeError:
76465  *             pass
76466  */
76467         __pyx_v_event_filter = (__pyx_v_event_filter | __pyx_e_4lxml_5etree_SAX_EVENT_START);
76468         goto __pyx_L14;
76469       }
76470       __pyx_L14:;
76471     }
76472     /*else:*/ {
76473
76474       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":33
76475  *             pass
76476  *         else:
76477  *             try:             # <<<<<<<<<<<<<<
76478  *                 arguments = inspect_getargspec(self._target_start)
76479  *                 if len(arguments[0]) > 3 or arguments[1] is not None:
76480  */
76481       {
76482         PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
76483         __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
76484         __Pyx_XGOTREF(__pyx_save_exc_type);
76485         __Pyx_XGOTREF(__pyx_save_exc_value);
76486         __Pyx_XGOTREF(__pyx_save_exc_tb);
76487         /*try:*/ {
76488
76489           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":34
76490  *         else:
76491  *             try:
76492  *                 arguments = inspect_getargspec(self._target_start)             # <<<<<<<<<<<<<<
76493  *                 if len(arguments[0]) > 3 or arguments[1] is not None:
76494  *                     self._start_takes_nsmap = 1
76495  */
76496           __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
76497           __Pyx_GOTREF(((PyObject *)__pyx_t_1));
76498           __Pyx_INCREF(((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_start);
76499           PyTuple_SET_ITEM(__pyx_t_1, 0, ((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_start);
76500           __Pyx_GIVEREF(((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_start);
76501           __pyx_t_3 = PyObject_Call(__pyx_v_4lxml_5etree_inspect_getargspec, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
76502           __Pyx_GOTREF(__pyx_t_3);
76503           __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
76504           __Pyx_DECREF(__pyx_v_arguments);
76505           __pyx_v_arguments = __pyx_t_3;
76506           __pyx_t_3 = 0;
76507
76508           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":35
76509  *             try:
76510  *                 arguments = inspect_getargspec(self._target_start)
76511  *                 if len(arguments[0]) > 3 or arguments[1] is not None:             # <<<<<<<<<<<<<<
76512  *                     self._start_takes_nsmap = 1
76513  *             except TypeError:
76514  */
76515           __pyx_2 = __Pyx_GetItemInt(__pyx_v_arguments, 0, sizeof(long), PyInt_FromLong); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
76516           __Pyx_GOTREF(__pyx_2);
76517           __pyx_t_4 = PyObject_Length(__pyx_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
76518           __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
76519           if (!(__pyx_t_4 > 3)) {
76520             __pyx_2 = __Pyx_GetItemInt(__pyx_v_arguments, 1, sizeof(long), PyInt_FromLong); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
76521             __Pyx_GOTREF(__pyx_2);
76522             __pyx_t_2 = (__pyx_2 != Py_None);
76523             __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
76524             __pyx_t_5 = __pyx_t_2;
76525           } else {
76526             __pyx_t_5 = (__pyx_t_4 > 3);
76527           }
76528           if (__pyx_t_5) {
76529
76530             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":36
76531  *                 arguments = inspect_getargspec(self._target_start)
76532  *                 if len(arguments[0]) > 3 or arguments[1] is not None:
76533  *                     self._start_takes_nsmap = 1             # <<<<<<<<<<<<<<
76534  *             except TypeError:
76535  *                 pass
76536  */
76537             ((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_start_takes_nsmap = 1;
76538             goto __pyx_L23;
76539           }
76540           __pyx_L23:;
76541         }
76542         __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
76543         __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
76544         __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
76545         goto __pyx_L22_try_end;
76546         __pyx_L15_error:;
76547         __Pyx_XDECREF(__pyx_2); __pyx_2 = 0;
76548         __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
76549         __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
76550
76551         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":37
76552  *                 if len(arguments[0]) > 3 or arguments[1] is not None:
76553  *                     self._start_takes_nsmap = 1
76554  *             except TypeError:             # <<<<<<<<<<<<<<
76555  *                 pass
76556  *         try:
76557  */
76558         __pyx_1 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
76559         if (__pyx_1) {
76560           PyErr_Restore(0,0,0);
76561           goto __pyx_L16_exception_handled;
76562         }
76563         __Pyx_XDECREF(__pyx_save_exc_type);
76564         __Pyx_XDECREF(__pyx_save_exc_value);
76565         __Pyx_XDECREF(__pyx_save_exc_tb);
76566         goto __pyx_L8_except_error;
76567         __pyx_L16_exception_handled:;
76568         __Pyx_XGIVEREF(__pyx_save_exc_type);
76569         __Pyx_XGIVEREF(__pyx_save_exc_value);
76570         __Pyx_XGIVEREF(__pyx_save_exc_tb);
76571         __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
76572         __pyx_L22_try_end:;
76573       }
76574     }
76575     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
76576     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
76577     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
76578     goto __pyx_L13_try_end;
76579     __pyx_L6_error:;
76580     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
76581
76582     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":30
76583  *             if self._target_start is not None:
76584  *                 event_filter = event_filter | SAX_EVENT_START
76585  *         except AttributeError:             # <<<<<<<<<<<<<<
76586  *             pass
76587  *         else:
76588  */
76589     __pyx_1 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
76590     if (__pyx_1) {
76591       PyErr_Restore(0,0,0);
76592       goto __pyx_L7_exception_handled;
76593     }
76594     __pyx_L8_except_error:;
76595     __Pyx_XDECREF(__pyx_save_exc_type);
76596     __Pyx_XDECREF(__pyx_save_exc_value);
76597     __Pyx_XDECREF(__pyx_save_exc_tb);
76598     goto __pyx_L1_error;
76599     __pyx_L7_exception_handled:;
76600     __Pyx_XGIVEREF(__pyx_save_exc_type);
76601     __Pyx_XGIVEREF(__pyx_save_exc_value);
76602     __Pyx_XGIVEREF(__pyx_save_exc_tb);
76603     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
76604     __pyx_L13_try_end:;
76605   }
76606
76607   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":39
76608  *             except TypeError:
76609  *                 pass
76610  *         try:             # <<<<<<<<<<<<<<
76611  *             self._target_end = target.end
76612  *             if self._target_end is not None:
76613  */
76614   {
76615     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
76616     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
76617     __Pyx_XGOTREF(__pyx_save_exc_type);
76618     __Pyx_XGOTREF(__pyx_save_exc_value);
76619     __Pyx_XGOTREF(__pyx_save_exc_tb);
76620     /*try:*/ {
76621
76622       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":40
76623  *                 pass
76624  *         try:
76625  *             self._target_end = target.end             # <<<<<<<<<<<<<<
76626  *             if self._target_end is not None:
76627  *                 event_filter = event_filter | SAX_EVENT_END
76628  */
76629       __pyx_t_3 = PyObject_GetAttr(__pyx_v_target, __pyx_kp_end); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
76630       __Pyx_GOTREF(__pyx_t_3);
76631       __Pyx_GIVEREF(__pyx_t_3);
76632       __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_end);
76633       __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_end);
76634       ((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_end = __pyx_t_3;
76635       __pyx_t_3 = 0;
76636
76637       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":41
76638  *         try:
76639  *             self._target_end = target.end
76640  *             if self._target_end is not None:             # <<<<<<<<<<<<<<
76641  *                 event_filter = event_filter | SAX_EVENT_END
76642  *         except AttributeError:
76643  */
76644       __pyx_t_5 = (((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_end != Py_None);
76645       if (__pyx_t_5) {
76646
76647         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":42
76648  *             self._target_end = target.end
76649  *             if self._target_end is not None:
76650  *                 event_filter = event_filter | SAX_EVENT_END             # <<<<<<<<<<<<<<
76651  *         except AttributeError:
76652  *             pass
76653  */
76654         __pyx_v_event_filter = (__pyx_v_event_filter | __pyx_e_4lxml_5etree_SAX_EVENT_END);
76655         goto __pyx_L32;
76656       }
76657       __pyx_L32:;
76658     }
76659     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
76660     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
76661     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
76662     goto __pyx_L31_try_end;
76663     __pyx_L24_error:;
76664     __Pyx_XDECREF(__pyx_2); __pyx_2 = 0;
76665     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
76666     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
76667
76668     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":43
76669  *             if self._target_end is not None:
76670  *                 event_filter = event_filter | SAX_EVENT_END
76671  *         except AttributeError:             # <<<<<<<<<<<<<<
76672  *             pass
76673  *         try:
76674  */
76675     __pyx_1 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
76676     if (__pyx_1) {
76677       PyErr_Restore(0,0,0);
76678       goto __pyx_L25_exception_handled;
76679     }
76680     __Pyx_XDECREF(__pyx_save_exc_type);
76681     __Pyx_XDECREF(__pyx_save_exc_value);
76682     __Pyx_XDECREF(__pyx_save_exc_tb);
76683     goto __pyx_L1_error;
76684     __pyx_L25_exception_handled:;
76685     __Pyx_XGIVEREF(__pyx_save_exc_type);
76686     __Pyx_XGIVEREF(__pyx_save_exc_value);
76687     __Pyx_XGIVEREF(__pyx_save_exc_tb);
76688     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
76689     __pyx_L31_try_end:;
76690   }
76691
76692   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":45
76693  *         except AttributeError:
76694  *             pass
76695  *         try:             # <<<<<<<<<<<<<<
76696  *             self._target_data = target.data
76697  *             if self._target_data is not None:
76698  */
76699   {
76700     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
76701     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
76702     __Pyx_XGOTREF(__pyx_save_exc_type);
76703     __Pyx_XGOTREF(__pyx_save_exc_value);
76704     __Pyx_XGOTREF(__pyx_save_exc_tb);
76705     /*try:*/ {
76706
76707       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":46
76708  *             pass
76709  *         try:
76710  *             self._target_data = target.data             # <<<<<<<<<<<<<<
76711  *             if self._target_data is not None:
76712  *                 event_filter = event_filter | SAX_EVENT_DATA
76713  */
76714       __pyx_t_3 = PyObject_GetAttr(__pyx_v_target, __pyx_kp_data); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L33_error;}
76715       __Pyx_GOTREF(__pyx_t_3);
76716       __Pyx_GIVEREF(__pyx_t_3);
76717       __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_data);
76718       __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_data);
76719       ((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_data = __pyx_t_3;
76720       __pyx_t_3 = 0;
76721
76722       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":47
76723  *         try:
76724  *             self._target_data = target.data
76725  *             if self._target_data is not None:             # <<<<<<<<<<<<<<
76726  *                 event_filter = event_filter | SAX_EVENT_DATA
76727  *         except AttributeError:
76728  */
76729       __pyx_t_5 = (((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_data != Py_None);
76730       if (__pyx_t_5) {
76731
76732         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":48
76733  *             self._target_data = target.data
76734  *             if self._target_data is not None:
76735  *                 event_filter = event_filter | SAX_EVENT_DATA             # <<<<<<<<<<<<<<
76736  *         except AttributeError:
76737  *             pass
76738  */
76739         __pyx_v_event_filter = (__pyx_v_event_filter | __pyx_e_4lxml_5etree_SAX_EVENT_DATA);
76740         goto __pyx_L41;
76741       }
76742       __pyx_L41:;
76743     }
76744     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
76745     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
76746     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
76747     goto __pyx_L40_try_end;
76748     __pyx_L33_error:;
76749     __Pyx_XDECREF(__pyx_2); __pyx_2 = 0;
76750     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
76751     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
76752
76753     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":49
76754  *             if self._target_data is not None:
76755  *                 event_filter = event_filter | SAX_EVENT_DATA
76756  *         except AttributeError:             # <<<<<<<<<<<<<<
76757  *             pass
76758  *         try:
76759  */
76760     __pyx_1 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
76761     if (__pyx_1) {
76762       PyErr_Restore(0,0,0);
76763       goto __pyx_L34_exception_handled;
76764     }
76765     __Pyx_XDECREF(__pyx_save_exc_type);
76766     __Pyx_XDECREF(__pyx_save_exc_value);
76767     __Pyx_XDECREF(__pyx_save_exc_tb);
76768     goto __pyx_L1_error;
76769     __pyx_L34_exception_handled:;
76770     __Pyx_XGIVEREF(__pyx_save_exc_type);
76771     __Pyx_XGIVEREF(__pyx_save_exc_value);
76772     __Pyx_XGIVEREF(__pyx_save_exc_tb);
76773     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
76774     __pyx_L40_try_end:;
76775   }
76776
76777   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":51
76778  *         except AttributeError:
76779  *             pass
76780  *         try:             # <<<<<<<<<<<<<<
76781  *             self._target_doctype = target.doctype
76782  *             if self._target_doctype is not None:
76783  */
76784   {
76785     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
76786     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
76787     __Pyx_XGOTREF(__pyx_save_exc_type);
76788     __Pyx_XGOTREF(__pyx_save_exc_value);
76789     __Pyx_XGOTREF(__pyx_save_exc_tb);
76790     /*try:*/ {
76791
76792       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":52
76793  *             pass
76794  *         try:
76795  *             self._target_doctype = target.doctype             # <<<<<<<<<<<<<<
76796  *             if self._target_doctype is not None:
76797  *                 event_filter = event_filter | SAX_EVENT_DOCTYPE
76798  */
76799       __pyx_t_3 = PyObject_GetAttr(__pyx_v_target, __pyx_kp_doctype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L42_error;}
76800       __Pyx_GOTREF(__pyx_t_3);
76801       __Pyx_GIVEREF(__pyx_t_3);
76802       __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_doctype);
76803       __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_doctype);
76804       ((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_doctype = __pyx_t_3;
76805       __pyx_t_3 = 0;
76806
76807       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":53
76808  *         try:
76809  *             self._target_doctype = target.doctype
76810  *             if self._target_doctype is not None:             # <<<<<<<<<<<<<<
76811  *                 event_filter = event_filter | SAX_EVENT_DOCTYPE
76812  *         except AttributeError:
76813  */
76814       __pyx_t_5 = (((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_doctype != Py_None);
76815       if (__pyx_t_5) {
76816
76817         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":54
76818  *             self._target_doctype = target.doctype
76819  *             if self._target_doctype is not None:
76820  *                 event_filter = event_filter | SAX_EVENT_DOCTYPE             # <<<<<<<<<<<<<<
76821  *         except AttributeError:
76822  *             pass
76823  */
76824         __pyx_v_event_filter = (__pyx_v_event_filter | __pyx_e_4lxml_5etree_SAX_EVENT_DOCTYPE);
76825         goto __pyx_L50;
76826       }
76827       __pyx_L50:;
76828     }
76829     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
76830     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
76831     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
76832     goto __pyx_L49_try_end;
76833     __pyx_L42_error:;
76834     __Pyx_XDECREF(__pyx_2); __pyx_2 = 0;
76835     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
76836     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
76837
76838     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":55
76839  *             if self._target_doctype is not None:
76840  *                 event_filter = event_filter | SAX_EVENT_DOCTYPE
76841  *         except AttributeError:             # <<<<<<<<<<<<<<
76842  *             pass
76843  *         try:
76844  */
76845     __pyx_1 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
76846     if (__pyx_1) {
76847       PyErr_Restore(0,0,0);
76848       goto __pyx_L43_exception_handled;
76849     }
76850     __Pyx_XDECREF(__pyx_save_exc_type);
76851     __Pyx_XDECREF(__pyx_save_exc_value);
76852     __Pyx_XDECREF(__pyx_save_exc_tb);
76853     goto __pyx_L1_error;
76854     __pyx_L43_exception_handled:;
76855     __Pyx_XGIVEREF(__pyx_save_exc_type);
76856     __Pyx_XGIVEREF(__pyx_save_exc_value);
76857     __Pyx_XGIVEREF(__pyx_save_exc_tb);
76858     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
76859     __pyx_L49_try_end:;
76860   }
76861
76862   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":57
76863  *         except AttributeError:
76864  *             pass
76865  *         try:             # <<<<<<<<<<<<<<
76866  *             self._target_pi = target.pi
76867  *             if self._target_pi is not None:
76868  */
76869   {
76870     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
76871     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
76872     __Pyx_XGOTREF(__pyx_save_exc_type);
76873     __Pyx_XGOTREF(__pyx_save_exc_value);
76874     __Pyx_XGOTREF(__pyx_save_exc_tb);
76875     /*try:*/ {
76876
76877       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":58
76878  *             pass
76879  *         try:
76880  *             self._target_pi = target.pi             # <<<<<<<<<<<<<<
76881  *             if self._target_pi is not None:
76882  *                 event_filter = event_filter | SAX_EVENT_PI
76883  */
76884       __pyx_t_3 = PyObject_GetAttr(__pyx_v_target, __pyx_kp_pi); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L51_error;}
76885       __Pyx_GOTREF(__pyx_t_3);
76886       __Pyx_GIVEREF(__pyx_t_3);
76887       __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_pi);
76888       __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_pi);
76889       ((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_pi = __pyx_t_3;
76890       __pyx_t_3 = 0;
76891
76892       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":59
76893  *         try:
76894  *             self._target_pi = target.pi
76895  *             if self._target_pi is not None:             # <<<<<<<<<<<<<<
76896  *                 event_filter = event_filter | SAX_EVENT_PI
76897  *         except AttributeError:
76898  */
76899       __pyx_t_5 = (((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_pi != Py_None);
76900       if (__pyx_t_5) {
76901
76902         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":60
76903  *             self._target_pi = target.pi
76904  *             if self._target_pi is not None:
76905  *                 event_filter = event_filter | SAX_EVENT_PI             # <<<<<<<<<<<<<<
76906  *         except AttributeError:
76907  *             pass
76908  */
76909         __pyx_v_event_filter = (__pyx_v_event_filter | __pyx_e_4lxml_5etree_SAX_EVENT_PI);
76910         goto __pyx_L59;
76911       }
76912       __pyx_L59:;
76913     }
76914     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
76915     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
76916     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
76917     goto __pyx_L58_try_end;
76918     __pyx_L51_error:;
76919     __Pyx_XDECREF(__pyx_2); __pyx_2 = 0;
76920     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
76921     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
76922
76923     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":61
76924  *             if self._target_pi is not None:
76925  *                 event_filter = event_filter | SAX_EVENT_PI
76926  *         except AttributeError:             # <<<<<<<<<<<<<<
76927  *             pass
76928  *         try:
76929  */
76930     __pyx_1 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
76931     if (__pyx_1) {
76932       PyErr_Restore(0,0,0);
76933       goto __pyx_L52_exception_handled;
76934     }
76935     __Pyx_XDECREF(__pyx_save_exc_type);
76936     __Pyx_XDECREF(__pyx_save_exc_value);
76937     __Pyx_XDECREF(__pyx_save_exc_tb);
76938     goto __pyx_L1_error;
76939     __pyx_L52_exception_handled:;
76940     __Pyx_XGIVEREF(__pyx_save_exc_type);
76941     __Pyx_XGIVEREF(__pyx_save_exc_value);
76942     __Pyx_XGIVEREF(__pyx_save_exc_tb);
76943     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
76944     __pyx_L58_try_end:;
76945   }
76946
76947   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":63
76948  *         except AttributeError:
76949  *             pass
76950  *         try:             # <<<<<<<<<<<<<<
76951  *             self._target_comment = target.comment
76952  *             if self._target_comment is not None:
76953  */
76954   {
76955     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
76956     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
76957     __Pyx_XGOTREF(__pyx_save_exc_type);
76958     __Pyx_XGOTREF(__pyx_save_exc_value);
76959     __Pyx_XGOTREF(__pyx_save_exc_tb);
76960     /*try:*/ {
76961
76962       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":64
76963  *             pass
76964  *         try:
76965  *             self._target_comment = target.comment             # <<<<<<<<<<<<<<
76966  *             if self._target_comment is not None:
76967  *                 event_filter = event_filter | SAX_EVENT_COMMENT
76968  */
76969       __pyx_t_3 = PyObject_GetAttr(__pyx_v_target, __pyx_kp_comment); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L60_error;}
76970       __Pyx_GOTREF(__pyx_t_3);
76971       __Pyx_GIVEREF(__pyx_t_3);
76972       __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_comment);
76973       __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_comment);
76974       ((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_comment = __pyx_t_3;
76975       __pyx_t_3 = 0;
76976
76977       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":65
76978  *         try:
76979  *             self._target_comment = target.comment
76980  *             if self._target_comment is not None:             # <<<<<<<<<<<<<<
76981  *                 event_filter = event_filter | SAX_EVENT_COMMENT
76982  *         except AttributeError:
76983  */
76984       __pyx_t_5 = (((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_comment != Py_None);
76985       if (__pyx_t_5) {
76986
76987         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":66
76988  *             self._target_comment = target.comment
76989  *             if self._target_comment is not None:
76990  *                 event_filter = event_filter | SAX_EVENT_COMMENT             # <<<<<<<<<<<<<<
76991  *         except AttributeError:
76992  *             pass
76993  */
76994         __pyx_v_event_filter = (__pyx_v_event_filter | __pyx_e_4lxml_5etree_SAX_EVENT_COMMENT);
76995         goto __pyx_L68;
76996       }
76997       __pyx_L68:;
76998     }
76999     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
77000     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
77001     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
77002     goto __pyx_L67_try_end;
77003     __pyx_L60_error:;
77004     __Pyx_XDECREF(__pyx_2); __pyx_2 = 0;
77005     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
77006     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
77007
77008     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":67
77009  *             if self._target_comment is not None:
77010  *                 event_filter = event_filter | SAX_EVENT_COMMENT
77011  *         except AttributeError:             # <<<<<<<<<<<<<<
77012  *             pass
77013  *         self._sax_event_filter = event_filter
77014  */
77015     __pyx_1 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
77016     if (__pyx_1) {
77017       PyErr_Restore(0,0,0);
77018       goto __pyx_L61_exception_handled;
77019     }
77020     __Pyx_XDECREF(__pyx_save_exc_type);
77021     __Pyx_XDECREF(__pyx_save_exc_value);
77022     __Pyx_XDECREF(__pyx_save_exc_tb);
77023     goto __pyx_L1_error;
77024     __pyx_L61_exception_handled:;
77025     __Pyx_XGIVEREF(__pyx_save_exc_type);
77026     __Pyx_XGIVEREF(__pyx_save_exc_value);
77027     __Pyx_XGIVEREF(__pyx_save_exc_tb);
77028     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
77029     __pyx_L67_try_end:;
77030   }
77031
77032   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":69
77033  *         except AttributeError:
77034  *             pass
77035  *         self._sax_event_filter = event_filter             # <<<<<<<<<<<<<<
77036  * 
77037  *     cdef _handleSaxStart(self, tag, attrib, nsmap):
77038  */
77039   ((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->__pyx_base._sax_event_filter = __pyx_v_event_filter;
77040
77041   __pyx_r = 0;
77042   goto __pyx_L0;
77043   __pyx_L1_error:;
77044   __Pyx_XDECREF(__pyx_2);
77045   __Pyx_XDECREF(__pyx_t_1);
77046   __Pyx_XDECREF(__pyx_t_3);
77047   __Pyx_AddTraceback("lxml.etree._PythonSaxParserTarget.__init__");
77048   __pyx_r = -1;
77049   __pyx_L0:;
77050   __Pyx_DECREF(__pyx_v_arguments);
77051   __Pyx_FinishRefcountContext();
77052   return __pyx_r;
77053 }
77054
77055 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":71
77056  *         self._sax_event_filter = event_filter
77057  * 
77058  *     cdef _handleSaxStart(self, tag, attrib, nsmap):             # <<<<<<<<<<<<<<
77059  *         if self._start_takes_nsmap:
77060  *             return self._target_start(tag, attrib, nsmap)
77061  */
77062
77063 static  PyObject *__pyx_f_4lxml_5etree_22_PythonSaxParserTarget__handleSaxStart(struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *__pyx_v_self, PyObject *__pyx_v_tag, PyObject *__pyx_v_attrib, PyObject *__pyx_v_nsmap) {
77064   PyObject *__pyx_r = NULL;
77065   int __pyx_t_1;
77066   PyObject *__pyx_t_2 = NULL;
77067   PyObject *__pyx_t_3 = NULL;
77068   __Pyx_SetupRefcountContext("_handleSaxStart");
77069
77070   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":72
77071  * 
77072  *     cdef _handleSaxStart(self, tag, attrib, nsmap):
77073  *         if self._start_takes_nsmap:             # <<<<<<<<<<<<<<
77074  *             return self._target_start(tag, attrib, nsmap)
77075  *         else:
77076  */
77077   __pyx_t_1 = __pyx_v_self->_start_takes_nsmap;
77078   if (__pyx_t_1) {
77079
77080     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":73
77081  *     cdef _handleSaxStart(self, tag, attrib, nsmap):
77082  *         if self._start_takes_nsmap:
77083  *             return self._target_start(tag, attrib, nsmap)             # <<<<<<<<<<<<<<
77084  *         else:
77085  *             return self._target_start(tag, attrib)
77086  */
77087     __Pyx_XDECREF(__pyx_r);
77088     __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77089     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
77090     __Pyx_INCREF(__pyx_v_tag);
77091     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_tag);
77092     __Pyx_GIVEREF(__pyx_v_tag);
77093     __Pyx_INCREF(__pyx_v_attrib);
77094     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_attrib);
77095     __Pyx_GIVEREF(__pyx_v_attrib);
77096     __Pyx_INCREF(__pyx_v_nsmap);
77097     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_nsmap);
77098     __Pyx_GIVEREF(__pyx_v_nsmap);
77099     __pyx_t_3 = PyObject_Call(__pyx_v_self->_target_start, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77100     __Pyx_GOTREF(__pyx_t_3);
77101     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
77102     __pyx_r = __pyx_t_3;
77103     __pyx_t_3 = 0;
77104     goto __pyx_L0;
77105     goto __pyx_L3;
77106   }
77107   /*else*/ {
77108
77109     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":75
77110  *             return self._target_start(tag, attrib, nsmap)
77111  *         else:
77112  *             return self._target_start(tag, attrib)             # <<<<<<<<<<<<<<
77113  * 
77114  *     cdef _handleSaxEnd(self, tag):
77115  */
77116     __Pyx_XDECREF(__pyx_r);
77117     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77118     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
77119     __Pyx_INCREF(__pyx_v_tag);
77120     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_tag);
77121     __Pyx_GIVEREF(__pyx_v_tag);
77122     __Pyx_INCREF(__pyx_v_attrib);
77123     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_attrib);
77124     __Pyx_GIVEREF(__pyx_v_attrib);
77125     __pyx_t_2 = PyObject_Call(__pyx_v_self->_target_start, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77126     __Pyx_GOTREF(__pyx_t_2);
77127     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
77128     __pyx_r = __pyx_t_2;
77129     __pyx_t_2 = 0;
77130     goto __pyx_L0;
77131   }
77132   __pyx_L3:;
77133
77134   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
77135   goto __pyx_L0;
77136   __pyx_L1_error:;
77137   __Pyx_XDECREF(__pyx_t_2);
77138   __Pyx_XDECREF(__pyx_t_3);
77139   __Pyx_AddTraceback("lxml.etree._PythonSaxParserTarget._handleSaxStart");
77140   __pyx_r = 0;
77141   __pyx_L0:;
77142   __Pyx_XGIVEREF(__pyx_r);
77143   __Pyx_FinishRefcountContext();
77144   return __pyx_r;
77145 }
77146
77147 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":77
77148  *             return self._target_start(tag, attrib)
77149  * 
77150  *     cdef _handleSaxEnd(self, tag):             # <<<<<<<<<<<<<<
77151  *         return self._target_end(tag)
77152  * 
77153  */
77154
77155 static  PyObject *__pyx_f_4lxml_5etree_22_PythonSaxParserTarget__handleSaxEnd(struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *__pyx_v_self, PyObject *__pyx_v_tag) {
77156   PyObject *__pyx_r = NULL;
77157   PyObject *__pyx_t_1 = NULL;
77158   PyObject *__pyx_t_2 = NULL;
77159   __Pyx_SetupRefcountContext("_handleSaxEnd");
77160
77161   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":78
77162  * 
77163  *     cdef _handleSaxEnd(self, tag):
77164  *         return self._target_end(tag)             # <<<<<<<<<<<<<<
77165  * 
77166  *     cdef int _handleSaxData(self, data) except -1:
77167  */
77168   __Pyx_XDECREF(__pyx_r);
77169   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77170   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
77171   __Pyx_INCREF(__pyx_v_tag);
77172   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_tag);
77173   __Pyx_GIVEREF(__pyx_v_tag);
77174   __pyx_t_2 = PyObject_Call(__pyx_v_self->_target_end, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77175   __Pyx_GOTREF(__pyx_t_2);
77176   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
77177   __pyx_r = __pyx_t_2;
77178   __pyx_t_2 = 0;
77179   goto __pyx_L0;
77180
77181   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
77182   goto __pyx_L0;
77183   __pyx_L1_error:;
77184   __Pyx_XDECREF(__pyx_t_1);
77185   __Pyx_XDECREF(__pyx_t_2);
77186   __Pyx_AddTraceback("lxml.etree._PythonSaxParserTarget._handleSaxEnd");
77187   __pyx_r = 0;
77188   __pyx_L0:;
77189   __Pyx_XGIVEREF(__pyx_r);
77190   __Pyx_FinishRefcountContext();
77191   return __pyx_r;
77192 }
77193
77194 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":80
77195  *         return self._target_end(tag)
77196  * 
77197  *     cdef int _handleSaxData(self, data) except -1:             # <<<<<<<<<<<<<<
77198  *         self._target_data(data)
77199  * 
77200  */
77201
77202 static  int __pyx_f_4lxml_5etree_22_PythonSaxParserTarget__handleSaxData(struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *__pyx_v_self, PyObject *__pyx_v_data) {
77203   int __pyx_r;
77204   PyObject *__pyx_t_1 = NULL;
77205   PyObject *__pyx_t_2 = NULL;
77206   __Pyx_SetupRefcountContext("_handleSaxData");
77207
77208   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":81
77209  * 
77210  *     cdef int _handleSaxData(self, data) except -1:
77211  *         self._target_data(data)             # <<<<<<<<<<<<<<
77212  * 
77213  *     cdef int _handleSaxDoctype(self, root_tag, public_id, system_id) except -1:
77214  */
77215   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77216   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
77217   __Pyx_INCREF(__pyx_v_data);
77218   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_data);
77219   __Pyx_GIVEREF(__pyx_v_data);
77220   __pyx_t_2 = PyObject_Call(__pyx_v_self->_target_data, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77221   __Pyx_GOTREF(__pyx_t_2);
77222   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
77223   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
77224
77225   __pyx_r = 0;
77226   goto __pyx_L0;
77227   __pyx_L1_error:;
77228   __Pyx_XDECREF(__pyx_t_1);
77229   __Pyx_XDECREF(__pyx_t_2);
77230   __Pyx_AddTraceback("lxml.etree._PythonSaxParserTarget._handleSaxData");
77231   __pyx_r = -1;
77232   __pyx_L0:;
77233   __Pyx_FinishRefcountContext();
77234   return __pyx_r;
77235 }
77236
77237 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":83
77238  *         self._target_data(data)
77239  * 
77240  *     cdef int _handleSaxDoctype(self, root_tag, public_id, system_id) except -1:             # <<<<<<<<<<<<<<
77241  *         self._target_doctype(root_tag, public_id, system_id)
77242  * 
77243  */
77244
77245 static  int __pyx_f_4lxml_5etree_22_PythonSaxParserTarget__handleSaxDoctype(struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *__pyx_v_self, PyObject *__pyx_v_root_tag, PyObject *__pyx_v_public_id, PyObject *__pyx_v_system_id) {
77246   int __pyx_r;
77247   PyObject *__pyx_t_1 = NULL;
77248   PyObject *__pyx_t_2 = NULL;
77249   __Pyx_SetupRefcountContext("_handleSaxDoctype");
77250
77251   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":84
77252  * 
77253  *     cdef int _handleSaxDoctype(self, root_tag, public_id, system_id) except -1:
77254  *         self._target_doctype(root_tag, public_id, system_id)             # <<<<<<<<<<<<<<
77255  * 
77256  *     cdef _handleSaxPi(self, target, data):
77257  */
77258   __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77259   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
77260   __Pyx_INCREF(__pyx_v_root_tag);
77261   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_root_tag);
77262   __Pyx_GIVEREF(__pyx_v_root_tag);
77263   __Pyx_INCREF(__pyx_v_public_id);
77264   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_public_id);
77265   __Pyx_GIVEREF(__pyx_v_public_id);
77266   __Pyx_INCREF(__pyx_v_system_id);
77267   PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_system_id);
77268   __Pyx_GIVEREF(__pyx_v_system_id);
77269   __pyx_t_2 = PyObject_Call(__pyx_v_self->_target_doctype, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77270   __Pyx_GOTREF(__pyx_t_2);
77271   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
77272   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
77273
77274   __pyx_r = 0;
77275   goto __pyx_L0;
77276   __pyx_L1_error:;
77277   __Pyx_XDECREF(__pyx_t_1);
77278   __Pyx_XDECREF(__pyx_t_2);
77279   __Pyx_AddTraceback("lxml.etree._PythonSaxParserTarget._handleSaxDoctype");
77280   __pyx_r = -1;
77281   __pyx_L0:;
77282   __Pyx_FinishRefcountContext();
77283   return __pyx_r;
77284 }
77285
77286 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":86
77287  *         self._target_doctype(root_tag, public_id, system_id)
77288  * 
77289  *     cdef _handleSaxPi(self, target, data):             # <<<<<<<<<<<<<<
77290  *         return self._target_pi(target, data)
77291  * 
77292  */
77293
77294 static  PyObject *__pyx_f_4lxml_5etree_22_PythonSaxParserTarget__handleSaxPi(struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *__pyx_v_self, PyObject *__pyx_v_target, PyObject *__pyx_v_data) {
77295   PyObject *__pyx_r = NULL;
77296   PyObject *__pyx_t_1 = NULL;
77297   PyObject *__pyx_t_2 = NULL;
77298   __Pyx_SetupRefcountContext("_handleSaxPi");
77299
77300   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":87
77301  * 
77302  *     cdef _handleSaxPi(self, target, data):
77303  *         return self._target_pi(target, data)             # <<<<<<<<<<<<<<
77304  * 
77305  *     cdef _handleSaxComment(self, comment):
77306  */
77307   __Pyx_XDECREF(__pyx_r);
77308   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77309   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
77310   __Pyx_INCREF(__pyx_v_target);
77311   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_target);
77312   __Pyx_GIVEREF(__pyx_v_target);
77313   __Pyx_INCREF(__pyx_v_data);
77314   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_data);
77315   __Pyx_GIVEREF(__pyx_v_data);
77316   __pyx_t_2 = PyObject_Call(__pyx_v_self->_target_pi, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77317   __Pyx_GOTREF(__pyx_t_2);
77318   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
77319   __pyx_r = __pyx_t_2;
77320   __pyx_t_2 = 0;
77321   goto __pyx_L0;
77322
77323   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
77324   goto __pyx_L0;
77325   __pyx_L1_error:;
77326   __Pyx_XDECREF(__pyx_t_1);
77327   __Pyx_XDECREF(__pyx_t_2);
77328   __Pyx_AddTraceback("lxml.etree._PythonSaxParserTarget._handleSaxPi");
77329   __pyx_r = 0;
77330   __pyx_L0:;
77331   __Pyx_XGIVEREF(__pyx_r);
77332   __Pyx_FinishRefcountContext();
77333   return __pyx_r;
77334 }
77335
77336 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":89
77337  *         return self._target_pi(target, data)
77338  * 
77339  *     cdef _handleSaxComment(self, comment):             # <<<<<<<<<<<<<<
77340  *         return self._target_comment(comment)
77341  * 
77342  */
77343
77344 static  PyObject *__pyx_f_4lxml_5etree_22_PythonSaxParserTarget__handleSaxComment(struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *__pyx_v_self, PyObject *__pyx_v_comment) {
77345   PyObject *__pyx_r = NULL;
77346   PyObject *__pyx_t_1 = NULL;
77347   PyObject *__pyx_t_2 = NULL;
77348   __Pyx_SetupRefcountContext("_handleSaxComment");
77349
77350   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":90
77351  * 
77352  *     cdef _handleSaxComment(self, comment):
77353  *         return self._target_comment(comment)             # <<<<<<<<<<<<<<
77354  * 
77355  * 
77356  */
77357   __Pyx_XDECREF(__pyx_r);
77358   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77359   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
77360   __Pyx_INCREF(__pyx_v_comment);
77361   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_comment);
77362   __Pyx_GIVEREF(__pyx_v_comment);
77363   __pyx_t_2 = PyObject_Call(__pyx_v_self->_target_comment, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77364   __Pyx_GOTREF(__pyx_t_2);
77365   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
77366   __pyx_r = __pyx_t_2;
77367   __pyx_t_2 = 0;
77368   goto __pyx_L0;
77369
77370   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
77371   goto __pyx_L0;
77372   __pyx_L1_error:;
77373   __Pyx_XDECREF(__pyx_t_1);
77374   __Pyx_XDECREF(__pyx_t_2);
77375   __Pyx_AddTraceback("lxml.etree._PythonSaxParserTarget._handleSaxComment");
77376   __pyx_r = 0;
77377   __pyx_L0:;
77378   __Pyx_XGIVEREF(__pyx_r);
77379   __Pyx_FinishRefcountContext();
77380   return __pyx_r;
77381 }
77382
77383 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":97
77384  *     """
77385  *     cdef object _python_target
77386  *     cdef int _setTarget(self, target) except -1:             # <<<<<<<<<<<<<<
77387  *         self._python_target = target
77388  *         if not isinstance(target, _SaxParserTarget) or \
77389  */
77390
77391 static  int __pyx_f_4lxml_5etree_20_TargetParserContext__setTarget(struct __pyx_obj_4lxml_5etree__TargetParserContext *__pyx_v_self, PyObject *__pyx_v_target) {
77392   int __pyx_r;
77393   int __pyx_t_1;
77394   int __pyx_t_2;
77395   int __pyx_t_3;
77396   PyObject *__pyx_t_4 = NULL;
77397   PyObject *__pyx_t_5 = NULL;
77398   __Pyx_SetupRefcountContext("_setTarget");
77399   __Pyx_INCREF(__pyx_v_target);
77400
77401   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":98
77402  *     cdef object _python_target
77403  *     cdef int _setTarget(self, target) except -1:
77404  *         self._python_target = target             # <<<<<<<<<<<<<<
77405  *         if not isinstance(target, _SaxParserTarget) or \
77406  *                 hasattr(target, u'__dict__'):
77407  */
77408   __Pyx_INCREF(__pyx_v_target);
77409   __Pyx_GIVEREF(__pyx_v_target);
77410   __Pyx_GOTREF(__pyx_v_self->_python_target);
77411   __Pyx_DECREF(__pyx_v_self->_python_target);
77412   __pyx_v_self->_python_target = __pyx_v_target;
77413
77414   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":99
77415  *     cdef int _setTarget(self, target) except -1:
77416  *         self._python_target = target
77417  *         if not isinstance(target, _SaxParserTarget) or \             # <<<<<<<<<<<<<<
77418  *                 hasattr(target, u'__dict__'):
77419  *             target = _PythonSaxParserTarget(target)
77420  */
77421   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_target, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__SaxParserTarget))); 
77422   if (!(!__pyx_t_1)) {
77423
77424     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":100
77425  *         self._python_target = target
77426  *         if not isinstance(target, _SaxParserTarget) or \
77427  *                 hasattr(target, u'__dict__'):             # <<<<<<<<<<<<<<
77428  *             target = _PythonSaxParserTarget(target)
77429  *         self._setSaxParserTarget(target)
77430  */
77431     __pyx_t_2 = PyObject_HasAttr(__pyx_v_target, ((PyObject *)__pyx_kp_472)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77432     __pyx_t_3 = __pyx_t_2;
77433   } else {
77434     __pyx_t_3 = (!__pyx_t_1);
77435   }
77436   if (__pyx_t_3) {
77437
77438     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":101
77439  *         if not isinstance(target, _SaxParserTarget) or \
77440  *                 hasattr(target, u'__dict__'):
77441  *             target = _PythonSaxParserTarget(target)             # <<<<<<<<<<<<<<
77442  *         self._setSaxParserTarget(target)
77443  *         return 0
77444  */
77445     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77446     __Pyx_GOTREF(((PyObject *)__pyx_t_4));
77447     __Pyx_INCREF(__pyx_v_target);
77448     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_target);
77449     __Pyx_GIVEREF(__pyx_v_target);
77450     __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__PythonSaxParserTarget)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77451     __Pyx_GOTREF(__pyx_t_5);
77452     __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
77453     __Pyx_DECREF(__pyx_v_target);
77454     __pyx_v_target = __pyx_t_5;
77455     __pyx_t_5 = 0;
77456     goto __pyx_L3;
77457   }
77458   __pyx_L3:;
77459
77460   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":102
77461  *                 hasattr(target, u'__dict__'):
77462  *             target = _PythonSaxParserTarget(target)
77463  *         self._setSaxParserTarget(target)             # <<<<<<<<<<<<<<
77464  *         return 0
77465  * 
77466  */
77467   if (!(__Pyx_TypeTest(__pyx_v_target, __pyx_ptype_4lxml_5etree__SaxParserTarget))) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77468   ((struct __pyx_vtabstruct_4lxml_5etree__TargetParserContext *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base._setSaxParserTarget(((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_v_self), ((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_target));
77469
77470   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":103
77471  *             target = _PythonSaxParserTarget(target)
77472  *         self._setSaxParserTarget(target)
77473  *         return 0             # <<<<<<<<<<<<<<
77474  * 
77475  *     cdef _ParserContext _copy(self):
77476  */
77477   __pyx_r = 0;
77478   goto __pyx_L0;
77479
77480   __pyx_r = 0;
77481   goto __pyx_L0;
77482   __pyx_L1_error:;
77483   __Pyx_XDECREF(__pyx_t_4);
77484   __Pyx_XDECREF(__pyx_t_5);
77485   __Pyx_AddTraceback("lxml.etree._TargetParserContext._setTarget");
77486   __pyx_r = -1;
77487   __pyx_L0:;
77488   __Pyx_DECREF(__pyx_v_target);
77489   __Pyx_FinishRefcountContext();
77490   return __pyx_r;
77491 }
77492
77493 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":105
77494  *         return 0
77495  * 
77496  *     cdef _ParserContext _copy(self):             # <<<<<<<<<<<<<<
77497  *         cdef _TargetParserContext context
77498  *         context = _ParserContext._copy(self)
77499  */
77500
77501 static  struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_f_4lxml_5etree_20_TargetParserContext__copy(struct __pyx_obj_4lxml_5etree__TargetParserContext *__pyx_v_self) {
77502   struct __pyx_obj_4lxml_5etree__TargetParserContext *__pyx_v_context;
77503   struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_r = NULL;
77504   PyObject *__pyx_t_1 = NULL;
77505   int __pyx_t_2;
77506   __Pyx_SetupRefcountContext("_copy");
77507   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__TargetParserContext *)Py_None); __Pyx_INCREF(Py_None);
77508
77509   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":107
77510  *     cdef _ParserContext _copy(self):
77511  *         cdef _TargetParserContext context
77512  *         context = _ParserContext._copy(self)             # <<<<<<<<<<<<<<
77513  *         context._setTarget(self._python_target)
77514  *         return context
77515  */
77516   __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4lxml_5etree__ParserContext->_copy(((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77517   __Pyx_GOTREF(__pyx_t_1);
77518   if (!(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__TargetParserContext))) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77519   __Pyx_DECREF(((PyObject *)__pyx_v_context));
77520   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__TargetParserContext *)__pyx_t_1);
77521   __pyx_t_1 = 0;
77522
77523   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":108
77524  *         cdef _TargetParserContext context
77525  *         context = _ParserContext._copy(self)
77526  *         context._setTarget(self._python_target)             # <<<<<<<<<<<<<<
77527  *         return context
77528  * 
77529  */
77530   __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__TargetParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->_setTarget(__pyx_v_context, __pyx_v_self->_python_target); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77531
77532   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":109
77533  *         context = _ParserContext._copy(self)
77534  *         context._setTarget(self._python_target)
77535  *         return context             # <<<<<<<<<<<<<<
77536  * 
77537  *     cdef void _cleanupTargetParserContext(self, xmlDoc* result):
77538  */
77539   __Pyx_XDECREF(((PyObject *)__pyx_r));
77540   __Pyx_INCREF(((PyObject *)__pyx_v_context));
77541   __pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_v_context);
77542   goto __pyx_L0;
77543
77544   __pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); __Pyx_INCREF(Py_None);
77545   goto __pyx_L0;
77546   __pyx_L1_error:;
77547   __Pyx_XDECREF(__pyx_t_1);
77548   __Pyx_AddTraceback("lxml.etree._TargetParserContext._copy");
77549   __pyx_r = 0;
77550   __pyx_L0:;
77551   __Pyx_DECREF((PyObject *)__pyx_v_context);
77552   __Pyx_XGIVEREF((PyObject *)__pyx_r);
77553   __Pyx_FinishRefcountContext();
77554   return __pyx_r;
77555 }
77556
77557 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":111
77558  *         return context
77559  * 
77560  *     cdef void _cleanupTargetParserContext(self, xmlDoc* result):             # <<<<<<<<<<<<<<
77561  *         if self._c_ctxt.myDoc is not NULL:
77562  *             if self._c_ctxt.myDoc is not result and \
77563  */
77564
77565 static  void __pyx_f_4lxml_5etree_20_TargetParserContext__cleanupTargetParserContext(struct __pyx_obj_4lxml_5etree__TargetParserContext *__pyx_v_self, xmlDoc *__pyx_v_result) {
77566   int __pyx_t_1;
77567   __Pyx_SetupRefcountContext("_cleanupTargetParserContext");
77568
77569   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":112
77570  * 
77571  *     cdef void _cleanupTargetParserContext(self, xmlDoc* result):
77572  *         if self._c_ctxt.myDoc is not NULL:             # <<<<<<<<<<<<<<
77573  *             if self._c_ctxt.myDoc is not result and \
77574  *                     self._c_ctxt.myDoc._private is NULL:
77575  */
77576   __pyx_t_1 = (__pyx_v_self->__pyx_base.__pyx_base._c_ctxt->myDoc != NULL);
77577   if (__pyx_t_1) {
77578
77579     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":113
77580  *     cdef void _cleanupTargetParserContext(self, xmlDoc* result):
77581  *         if self._c_ctxt.myDoc is not NULL:
77582  *             if self._c_ctxt.myDoc is not result and \             # <<<<<<<<<<<<<<
77583  *                     self._c_ctxt.myDoc._private is NULL:
77584  *                 # no _Document proxy => orphen
77585  */
77586     if ((__pyx_v_self->__pyx_base.__pyx_base._c_ctxt->myDoc != __pyx_v_result)) {
77587
77588       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":114
77589  *         if self._c_ctxt.myDoc is not NULL:
77590  *             if self._c_ctxt.myDoc is not result and \
77591  *                     self._c_ctxt.myDoc._private is NULL:             # <<<<<<<<<<<<<<
77592  *                 # no _Document proxy => orphen
77593  *                 tree.xmlFreeDoc(self._c_ctxt.myDoc)
77594  */
77595       __pyx_t_1 = (__pyx_v_self->__pyx_base.__pyx_base._c_ctxt->myDoc->_private == NULL);
77596     } else {
77597       __pyx_t_1 = (__pyx_v_self->__pyx_base.__pyx_base._c_ctxt->myDoc != __pyx_v_result);
77598     }
77599     if (__pyx_t_1) {
77600
77601       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":116
77602  *                     self._c_ctxt.myDoc._private is NULL:
77603  *                 # no _Document proxy => orphen
77604  *                 tree.xmlFreeDoc(self._c_ctxt.myDoc)             # <<<<<<<<<<<<<<
77605  *             self._c_ctxt.myDoc = NULL
77606  * 
77607  */
77608       xmlFreeDoc(__pyx_v_self->__pyx_base.__pyx_base._c_ctxt->myDoc);
77609       goto __pyx_L4;
77610     }
77611     __pyx_L4:;
77612
77613     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":117
77614  *                 # no _Document proxy => orphen
77615  *                 tree.xmlFreeDoc(self._c_ctxt.myDoc)
77616  *             self._c_ctxt.myDoc = NULL             # <<<<<<<<<<<<<<
77617  * 
77618  *     cdef object _handleParseResult(self, _BaseParser parser, xmlDoc* result,
77619  */
77620     __pyx_v_self->__pyx_base.__pyx_base._c_ctxt->myDoc = NULL;
77621     goto __pyx_L3;
77622   }
77623   __pyx_L3:;
77624
77625   __Pyx_FinishRefcountContext();
77626 }
77627
77628 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":119
77629  *             self._c_ctxt.myDoc = NULL
77630  * 
77631  *     cdef object _handleParseResult(self, _BaseParser parser, xmlDoc* result,             # <<<<<<<<<<<<<<
77632  *                                    filename):
77633  *         cdef bint recover
77634  */
77635
77636 static  PyObject *__pyx_f_4lxml_5etree_20_TargetParserContext__handleParseResult(struct __pyx_obj_4lxml_5etree__TargetParserContext *__pyx_v_self, struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser, xmlDoc *__pyx_v_result, PyObject *__pyx_v_filename) {
77637   int __pyx_v_recover;
77638   PyObject *__pyx_r = NULL;
77639   int __pyx_t_1;
77640   int __pyx_t_2;
77641   PyObject *__pyx_t_3 = NULL;
77642   PyObject *__pyx_t_4 = NULL;
77643   __Pyx_SetupRefcountContext("_handleParseResult");
77644
77645   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":122
77646  *                                    filename):
77647  *         cdef bint recover
77648  *         recover = parser._parse_options & xmlparser.XML_PARSE_RECOVER             # <<<<<<<<<<<<<<
77649  *         if self._has_raised():
77650  *             self._cleanupTargetParserContext(result)
77651  */
77652   __pyx_v_recover = (__pyx_v_parser->_parse_options & XML_PARSE_RECOVER);
77653
77654   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":123
77655  *         cdef bint recover
77656  *         recover = parser._parse_options & xmlparser.XML_PARSE_RECOVER
77657  *         if self._has_raised():             # <<<<<<<<<<<<<<
77658  *             self._cleanupTargetParserContext(result)
77659  *             self._raise_if_stored()
77660  */
77661   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__TargetParserContext *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._has_raised(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_self));
77662   if (__pyx_t_1) {
77663
77664     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":124
77665  *         recover = parser._parse_options & xmlparser.XML_PARSE_RECOVER
77666  *         if self._has_raised():
77667  *             self._cleanupTargetParserContext(result)             # <<<<<<<<<<<<<<
77668  *             self._raise_if_stored()
77669  *         if not self._c_ctxt.wellFormed and not recover:
77670  */
77671     ((struct __pyx_vtabstruct_4lxml_5etree__TargetParserContext *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->_cleanupTargetParserContext(__pyx_v_self, __pyx_v_result);
77672
77673     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":125
77674  *         if self._has_raised():
77675  *             self._cleanupTargetParserContext(result)
77676  *             self._raise_if_stored()             # <<<<<<<<<<<<<<
77677  *         if not self._c_ctxt.wellFormed and not recover:
77678  *             _raiseParseError(self._c_ctxt, filename, self._error_log)
77679  */
77680     __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__TargetParserContext *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._raise_if_stored(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_self)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77681     goto __pyx_L3;
77682   }
77683   __pyx_L3:;
77684
77685   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":126
77686  *             self._cleanupTargetParserContext(result)
77687  *             self._raise_if_stored()
77688  *         if not self._c_ctxt.wellFormed and not recover:             # <<<<<<<<<<<<<<
77689  *             _raiseParseError(self._c_ctxt, filename, self._error_log)
77690  *         return self._python_target.close()
77691  */
77692   if ((!__pyx_v_self->__pyx_base.__pyx_base._c_ctxt->wellFormed)) {
77693     __pyx_t_1 = (!__pyx_v_recover);
77694   } else {
77695     __pyx_t_1 = (!__pyx_v_self->__pyx_base.__pyx_base._c_ctxt->wellFormed);
77696   }
77697   if (__pyx_t_1) {
77698
77699     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":127
77700  *             self._raise_if_stored()
77701  *         if not self._c_ctxt.wellFormed and not recover:
77702  *             _raiseParseError(self._c_ctxt, filename, self._error_log)             # <<<<<<<<<<<<<<
77703  *         return self._python_target.close()
77704  * 
77705  */
77706     __pyx_t_2 = __pyx_f_4lxml_5etree__raiseParseError(__pyx_v_self->__pyx_base.__pyx_base._c_ctxt, __pyx_v_filename, __pyx_v_self->__pyx_base.__pyx_base._error_log); if (unlikely(__pyx_t_2 == 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77707     goto __pyx_L4;
77708   }
77709   __pyx_L4:;
77710
77711   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":128
77712  *         if not self._c_ctxt.wellFormed and not recover:
77713  *             _raiseParseError(self._c_ctxt, filename, self._error_log)
77714  *         return self._python_target.close()             # <<<<<<<<<<<<<<
77715  * 
77716  *     cdef xmlDoc* _handleParseResultDoc(self, _BaseParser parser,
77717  */
77718   __Pyx_XDECREF(__pyx_r);
77719   __pyx_t_3 = PyObject_GetAttr(__pyx_v_self->_python_target, __pyx_kp_close); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77720   __Pyx_GOTREF(__pyx_t_3);
77721   __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77722   __Pyx_GOTREF(__pyx_t_4);
77723   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
77724   __pyx_r = __pyx_t_4;
77725   __pyx_t_4 = 0;
77726   goto __pyx_L0;
77727
77728   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
77729   goto __pyx_L0;
77730   __pyx_L1_error:;
77731   __Pyx_XDECREF(__pyx_t_3);
77732   __Pyx_XDECREF(__pyx_t_4);
77733   __Pyx_AddTraceback("lxml.etree._TargetParserContext._handleParseResult");
77734   __pyx_r = 0;
77735   __pyx_L0:;
77736   __Pyx_XGIVEREF(__pyx_r);
77737   __Pyx_FinishRefcountContext();
77738   return __pyx_r;
77739 }
77740
77741 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":130
77742  *         return self._python_target.close()
77743  * 
77744  *     cdef xmlDoc* _handleParseResultDoc(self, _BaseParser parser,             # <<<<<<<<<<<<<<
77745  *                                        xmlDoc* result, filename) except NULL:
77746  *         cdef bint recover
77747  */
77748
77749 static  xmlDoc *__pyx_f_4lxml_5etree_20_TargetParserContext__handleParseResultDoc(struct __pyx_obj_4lxml_5etree__TargetParserContext *__pyx_v_self, struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser, xmlDoc *__pyx_v_result, PyObject *__pyx_v_filename) {
77750   int __pyx_v_recover;
77751   xmlDoc *__pyx_r;
77752   PyObject *__pyx_1 = 0;
77753   int __pyx_t_1;
77754   int __pyx_t_2;
77755   PyObject *__pyx_t_3 = NULL;
77756   PyObject *__pyx_t_4 = NULL;
77757   __Pyx_SetupRefcountContext("_handleParseResultDoc");
77758
77759   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":133
77760  *                                        xmlDoc* result, filename) except NULL:
77761  *         cdef bint recover
77762  *         recover = parser._parse_options & xmlparser.XML_PARSE_RECOVER             # <<<<<<<<<<<<<<
77763  *         if result is not NULL and result._private is NULL:
77764  *             # no _Document proxy => orphen
77765  */
77766   __pyx_v_recover = (__pyx_v_parser->_parse_options & XML_PARSE_RECOVER);
77767
77768   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":134
77769  *         cdef bint recover
77770  *         recover = parser._parse_options & xmlparser.XML_PARSE_RECOVER
77771  *         if result is not NULL and result._private is NULL:             # <<<<<<<<<<<<<<
77772  *             # no _Document proxy => orphen
77773  *             tree.xmlFreeDoc(result)
77774  */
77775   if ((__pyx_v_result != NULL)) {
77776     __pyx_t_1 = (__pyx_v_result->_private == NULL);
77777   } else {
77778     __pyx_t_1 = (__pyx_v_result != NULL);
77779   }
77780   if (__pyx_t_1) {
77781
77782     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":136
77783  *         if result is not NULL and result._private is NULL:
77784  *             # no _Document proxy => orphen
77785  *             tree.xmlFreeDoc(result)             # <<<<<<<<<<<<<<
77786  *         self._cleanupTargetParserContext(result)
77787  *         self._raise_if_stored()
77788  */
77789     xmlFreeDoc(__pyx_v_result);
77790     goto __pyx_L3;
77791   }
77792   __pyx_L3:;
77793
77794   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":137
77795  *             # no _Document proxy => orphen
77796  *             tree.xmlFreeDoc(result)
77797  *         self._cleanupTargetParserContext(result)             # <<<<<<<<<<<<<<
77798  *         self._raise_if_stored()
77799  *         if not self._c_ctxt.wellFormed and not recover:
77800  */
77801   ((struct __pyx_vtabstruct_4lxml_5etree__TargetParserContext *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->_cleanupTargetParserContext(__pyx_v_self, __pyx_v_result);
77802
77803   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":138
77804  *             tree.xmlFreeDoc(result)
77805  *         self._cleanupTargetParserContext(result)
77806  *         self._raise_if_stored()             # <<<<<<<<<<<<<<
77807  *         if not self._c_ctxt.wellFormed and not recover:
77808  *             _raiseParseError(self._c_ctxt, filename, self._error_log)
77809  */
77810   __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__TargetParserContext *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._raise_if_stored(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_self)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77811
77812   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":139
77813  *         self._cleanupTargetParserContext(result)
77814  *         self._raise_if_stored()
77815  *         if not self._c_ctxt.wellFormed and not recover:             # <<<<<<<<<<<<<<
77816  *             _raiseParseError(self._c_ctxt, filename, self._error_log)
77817  *         raise _TargetParserResult(self._python_target.close())
77818  */
77819   if ((!__pyx_v_self->__pyx_base.__pyx_base._c_ctxt->wellFormed)) {
77820     __pyx_t_1 = (!__pyx_v_recover);
77821   } else {
77822     __pyx_t_1 = (!__pyx_v_self->__pyx_base.__pyx_base._c_ctxt->wellFormed);
77823   }
77824   if (__pyx_t_1) {
77825
77826     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":140
77827  *         self._raise_if_stored()
77828  *         if not self._c_ctxt.wellFormed and not recover:
77829  *             _raiseParseError(self._c_ctxt, filename, self._error_log)             # <<<<<<<<<<<<<<
77830  *         raise _TargetParserResult(self._python_target.close())
77831  */
77832     __pyx_t_2 = __pyx_f_4lxml_5etree__raiseParseError(__pyx_v_self->__pyx_base.__pyx_base._c_ctxt, __pyx_v_filename, __pyx_v_self->__pyx_base.__pyx_base._error_log); if (unlikely(__pyx_t_2 == 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77833     goto __pyx_L4;
77834   }
77835   __pyx_L4:;
77836
77837   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":141
77838  *         if not self._c_ctxt.wellFormed and not recover:
77839  *             _raiseParseError(self._c_ctxt, filename, self._error_log)
77840  *         raise _TargetParserResult(self._python_target.close())             # <<<<<<<<<<<<<<
77841  */
77842   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp__TargetParserResult); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77843   __Pyx_GOTREF(__pyx_1);
77844   __pyx_t_3 = PyObject_GetAttr(__pyx_v_self->_python_target, __pyx_kp_close); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77845   __Pyx_GOTREF(__pyx_t_3);
77846   __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77847   __Pyx_GOTREF(__pyx_t_4);
77848   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
77849   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77850   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
77851   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
77852   __Pyx_GIVEREF(__pyx_t_4);
77853   __pyx_t_4 = 0;
77854   __pyx_t_4 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77855   __Pyx_GOTREF(__pyx_t_4);
77856   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
77857   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
77858   __Pyx_Raise(__pyx_t_4, 0, 0);
77859   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
77860   {__pyx_filename = __pyx_f[13]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77861
77862   __pyx_r = 0;
77863   goto __pyx_L0;
77864   __pyx_L1_error:;
77865   __Pyx_XDECREF(__pyx_1);
77866   __Pyx_XDECREF(__pyx_t_3);
77867   __Pyx_XDECREF(__pyx_t_4);
77868   __Pyx_AddTraceback("lxml.etree._TargetParserContext._handleParseResultDoc");
77869   __pyx_r = NULL;
77870   __pyx_L0:;
77871   __Pyx_FinishRefcountContext();
77872   return __pyx_r;
77873 }
77874
77875 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":12
77876  *     OUTPUT_METHOD_TEXT
77877  * 
77878  * cdef int _findOutputMethod(method) except -1:             # <<<<<<<<<<<<<<
77879  *     if method is None:
77880  *         return OUTPUT_METHOD_XML
77881  */
77882
77883 static  int __pyx_f_4lxml_5etree__findOutputMethod(PyObject *__pyx_v_method) {
77884   int __pyx_r;
77885   int __pyx_t_1;
77886   PyObject *__pyx_t_2 = NULL;
77887   PyObject *__pyx_t_3 = NULL;
77888   __Pyx_SetupRefcountContext("_findOutputMethod");
77889   __Pyx_INCREF(__pyx_v_method);
77890
77891   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":13
77892  * 
77893  * cdef int _findOutputMethod(method) except -1:
77894  *     if method is None:             # <<<<<<<<<<<<<<
77895  *         return OUTPUT_METHOD_XML
77896  *     method = method.lower()
77897  */
77898   __pyx_t_1 = (__pyx_v_method == Py_None);
77899   if (__pyx_t_1) {
77900
77901     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":14
77902  * cdef int _findOutputMethod(method) except -1:
77903  *     if method is None:
77904  *         return OUTPUT_METHOD_XML             # <<<<<<<<<<<<<<
77905  *     method = method.lower()
77906  *     if method == u"xml":
77907  */
77908     __pyx_r = __pyx_e_4lxml_5etree_OUTPUT_METHOD_XML;
77909     goto __pyx_L0;
77910     goto __pyx_L3;
77911   }
77912   __pyx_L3:;
77913
77914   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":15
77915  *     if method is None:
77916  *         return OUTPUT_METHOD_XML
77917  *     method = method.lower()             # <<<<<<<<<<<<<<
77918  *     if method == u"xml":
77919  *         return OUTPUT_METHOD_XML
77920  */
77921   __pyx_t_2 = PyObject_GetAttr(__pyx_v_method, __pyx_kp_lower); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77922   __Pyx_GOTREF(__pyx_t_2);
77923   __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77924   __Pyx_GOTREF(__pyx_t_3);
77925   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
77926   __Pyx_DECREF(__pyx_v_method);
77927   __pyx_v_method = __pyx_t_3;
77928   __pyx_t_3 = 0;
77929
77930   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":16
77931  *         return OUTPUT_METHOD_XML
77932  *     method = method.lower()
77933  *     if method == u"xml":             # <<<<<<<<<<<<<<
77934  *         return OUTPUT_METHOD_XML
77935  *     if method == u"html":
77936  */
77937   __pyx_t_3 = PyObject_RichCompare(__pyx_v_method, ((PyObject *)__pyx_kp_473), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77938   __Pyx_GOTREF(__pyx_t_3);
77939   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77940   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
77941   if (__pyx_t_1) {
77942
77943     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":17
77944  *     method = method.lower()
77945  *     if method == u"xml":
77946  *         return OUTPUT_METHOD_XML             # <<<<<<<<<<<<<<
77947  *     if method == u"html":
77948  *         return OUTPUT_METHOD_HTML
77949  */
77950     __pyx_r = __pyx_e_4lxml_5etree_OUTPUT_METHOD_XML;
77951     goto __pyx_L0;
77952     goto __pyx_L4;
77953   }
77954   __pyx_L4:;
77955
77956   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":18
77957  *     if method == u"xml":
77958  *         return OUTPUT_METHOD_XML
77959  *     if method == u"html":             # <<<<<<<<<<<<<<
77960  *         return OUTPUT_METHOD_HTML
77961  *     if method == u"text":
77962  */
77963   __pyx_t_3 = PyObject_RichCompare(__pyx_v_method, ((PyObject *)__pyx_kp_474), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77964   __Pyx_GOTREF(__pyx_t_3);
77965   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77966   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
77967   if (__pyx_t_1) {
77968
77969     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":19
77970  *         return OUTPUT_METHOD_XML
77971  *     if method == u"html":
77972  *         return OUTPUT_METHOD_HTML             # <<<<<<<<<<<<<<
77973  *     if method == u"text":
77974  *         return OUTPUT_METHOD_TEXT
77975  */
77976     __pyx_r = __pyx_e_4lxml_5etree_OUTPUT_METHOD_HTML;
77977     goto __pyx_L0;
77978     goto __pyx_L5;
77979   }
77980   __pyx_L5:;
77981
77982   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":20
77983  *     if method == u"html":
77984  *         return OUTPUT_METHOD_HTML
77985  *     if method == u"text":             # <<<<<<<<<<<<<<
77986  *         return OUTPUT_METHOD_TEXT
77987  *     raise ValueError, u"unknown output method %r" % method
77988  */
77989   __pyx_t_3 = PyObject_RichCompare(__pyx_v_method, ((PyObject *)__pyx_kp_475), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77990   __Pyx_GOTREF(__pyx_t_3);
77991   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
77992   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
77993   if (__pyx_t_1) {
77994
77995     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":21
77996  *         return OUTPUT_METHOD_HTML
77997  *     if method == u"text":
77998  *         return OUTPUT_METHOD_TEXT             # <<<<<<<<<<<<<<
77999  *     raise ValueError, u"unknown output method %r" % method
78000  * 
78001  */
78002     __pyx_r = __pyx_e_4lxml_5etree_OUTPUT_METHOD_TEXT;
78003     goto __pyx_L0;
78004     goto __pyx_L6;
78005   }
78006   __pyx_L6:;
78007
78008   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":22
78009  *     if method == u"text":
78010  *         return OUTPUT_METHOD_TEXT
78011  *     raise ValueError, u"unknown output method %r" % method             # <<<<<<<<<<<<<<
78012  * 
78013  * cdef _textToString(xmlNode* c_node, encoding, bint with_tail):
78014  */
78015   __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_476), __pyx_v_method); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
78016   __Pyx_GOTREF(__pyx_t_3);
78017   __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_3, 0);
78018   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
78019   {__pyx_filename = __pyx_f[3]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
78020
78021   __pyx_r = 0;
78022   goto __pyx_L0;
78023   __pyx_L1_error:;
78024   __Pyx_XDECREF(__pyx_t_2);
78025   __Pyx_XDECREF(__pyx_t_3);
78026   __Pyx_AddTraceback("lxml.etree._findOutputMethod");
78027   __pyx_r = -1;
78028   __pyx_L0:;
78029   __Pyx_DECREF(__pyx_v_method);
78030   __Pyx_FinishRefcountContext();
78031   return __pyx_r;
78032 }
78033
78034 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":24
78035  *     raise ValueError, u"unknown output method %r" % method
78036  * 
78037  * cdef _textToString(xmlNode* c_node, encoding, bint with_tail):             # <<<<<<<<<<<<<<
78038  *     cdef bint needs_conversion
78039  *     cdef char* c_text
78040  */
78041
78042 static  PyObject *__pyx_f_4lxml_5etree__textToString(xmlNode *__pyx_v_c_node, PyObject *__pyx_v_encoding, int __pyx_v_with_tail) {
78043   int __pyx_v_needs_conversion;
78044   char *__pyx_v_c_text;
78045   xmlNode *__pyx_v_c_text_node;
78046   xmlBuffer *__pyx_v_c_buffer;
78047   int __pyx_v_error_result;
78048   PyObject *__pyx_v_text;
78049   PyObject *__pyx_r = NULL;
78050   PyObject *__pyx_1 = 0;
78051   int __pyx_t_1;
78052   PyObject *__pyx_t_2 = NULL;
78053   PyObject *__pyx_t_3 = NULL;
78054   int __pyx_t_4;
78055   char *__pyx_t_5;
78056   __Pyx_SetupRefcountContext("_textToString");
78057   __Pyx_INCREF(__pyx_v_encoding);
78058   __pyx_v_text = Py_None; __Pyx_INCREF(Py_None);
78059
78060   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":31
78061  *     cdef int error_result
78062  * 
78063  *     c_buffer = tree.xmlBufferCreate()             # <<<<<<<<<<<<<<
78064  *     if c_buffer is NULL:
78065  *         return python.PyErr_NoMemory()
78066  */
78067   __pyx_v_c_buffer = xmlBufferCreate();
78068
78069   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":32
78070  * 
78071  *     c_buffer = tree.xmlBufferCreate()
78072  *     if c_buffer is NULL:             # <<<<<<<<<<<<<<
78073  *         return python.PyErr_NoMemory()
78074  * 
78075  */
78076   __pyx_t_1 = (__pyx_v_c_buffer == NULL);
78077   if (__pyx_t_1) {
78078
78079     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":33
78080  *     c_buffer = tree.xmlBufferCreate()
78081  *     if c_buffer is NULL:
78082  *         return python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
78083  * 
78084  *     with nogil:
78085  */
78086     __Pyx_XDECREF(__pyx_r);
78087     __pyx_t_2 = PyErr_NoMemory(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
78088     __Pyx_GOTREF(__pyx_t_2);
78089     __pyx_r = __pyx_t_2;
78090     __pyx_t_2 = 0;
78091     goto __pyx_L0;
78092     goto __pyx_L3;
78093   }
78094   __pyx_L3:;
78095
78096   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":35
78097  *         return python.PyErr_NoMemory()
78098  * 
78099  *     with nogil:             # <<<<<<<<<<<<<<
78100  *         error_result = tree.xmlNodeBufGetContent(c_buffer, c_node)
78101  *         if with_tail:
78102  */
78103   { PyThreadState *_save;
78104     Py_UNBLOCK_THREADS
78105     /*try:*/ {
78106
78107       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":36
78108  * 
78109  *     with nogil:
78110  *         error_result = tree.xmlNodeBufGetContent(c_buffer, c_node)             # <<<<<<<<<<<<<<
78111  *         if with_tail:
78112  *             c_text_node = _textNodeOrSkip(c_node.next)
78113  */
78114       __pyx_v_error_result = xmlNodeBufGetContent(__pyx_v_c_buffer, __pyx_v_c_node);
78115
78116       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":37
78117  *     with nogil:
78118  *         error_result = tree.xmlNodeBufGetContent(c_buffer, c_node)
78119  *         if with_tail:             # <<<<<<<<<<<<<<
78120  *             c_text_node = _textNodeOrSkip(c_node.next)
78121  *             while c_text_node is not NULL:
78122  */
78123       __pyx_t_1 = __pyx_v_with_tail;
78124       if (__pyx_t_1) {
78125
78126         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":38
78127  *         error_result = tree.xmlNodeBufGetContent(c_buffer, c_node)
78128  *         if with_tail:
78129  *             c_text_node = _textNodeOrSkip(c_node.next)             # <<<<<<<<<<<<<<
78130  *             while c_text_node is not NULL:
78131  *                 tree.xmlBufferWriteChar(c_buffer, c_text_node.content)
78132  */
78133         __pyx_v_c_text_node = __pyx_f_4lxml_5etree__textNodeOrSkip(__pyx_v_c_node->next);
78134
78135         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":39
78136  *         if with_tail:
78137  *             c_text_node = _textNodeOrSkip(c_node.next)
78138  *             while c_text_node is not NULL:             # <<<<<<<<<<<<<<
78139  *                 tree.xmlBufferWriteChar(c_buffer, c_text_node.content)
78140  *                 c_text_node = _textNodeOrSkip(c_text_node.next)
78141  */
78142         while (1) {
78143           __pyx_t_1 = (__pyx_v_c_text_node != NULL);
78144           if (!__pyx_t_1) break;
78145
78146           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":40
78147  *             c_text_node = _textNodeOrSkip(c_node.next)
78148  *             while c_text_node is not NULL:
78149  *                 tree.xmlBufferWriteChar(c_buffer, c_text_node.content)             # <<<<<<<<<<<<<<
78150  *                 c_text_node = _textNodeOrSkip(c_text_node.next)
78151  *         c_text = tree.xmlBufferContent(c_buffer)
78152  */
78153           xmlBufferWriteChar(__pyx_v_c_buffer, __pyx_v_c_text_node->content);
78154
78155           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":41
78156  *             while c_text_node is not NULL:
78157  *                 tree.xmlBufferWriteChar(c_buffer, c_text_node.content)
78158  *                 c_text_node = _textNodeOrSkip(c_text_node.next)             # <<<<<<<<<<<<<<
78159  *         c_text = tree.xmlBufferContent(c_buffer)
78160  * 
78161  */
78162           __pyx_v_c_text_node = __pyx_f_4lxml_5etree__textNodeOrSkip(__pyx_v_c_text_node->next);
78163         }
78164         goto __pyx_L7;
78165       }
78166       __pyx_L7:;
78167
78168       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":42
78169  *                 tree.xmlBufferWriteChar(c_buffer, c_text_node.content)
78170  *                 c_text_node = _textNodeOrSkip(c_text_node.next)
78171  *         c_text = tree.xmlBufferContent(c_buffer)             # <<<<<<<<<<<<<<
78172  * 
78173  *     if error_result < 0 or c_text is NULL:
78174  */
78175       __pyx_v_c_text = xmlBufferContent(__pyx_v_c_buffer);
78176     }
78177     /*finally:*/ {
78178       Py_BLOCK_THREADS
78179     }
78180   }
78181
78182   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":44
78183  *         c_text = tree.xmlBufferContent(c_buffer)
78184  * 
78185  *     if error_result < 0 or c_text is NULL:             # <<<<<<<<<<<<<<
78186  *         tree.xmlBufferFree(c_buffer)
78187  *         raise SerialisationError, u"Error during serialisation (out of memory?)"
78188  */
78189   if (!(__pyx_v_error_result < 0)) {
78190     __pyx_t_1 = (__pyx_v_c_text == NULL);
78191   } else {
78192     __pyx_t_1 = (__pyx_v_error_result < 0);
78193   }
78194   if (__pyx_t_1) {
78195
78196     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":45
78197  * 
78198  *     if error_result < 0 or c_text is NULL:
78199  *         tree.xmlBufferFree(c_buffer)             # <<<<<<<<<<<<<<
78200  *         raise SerialisationError, u"Error during serialisation (out of memory?)"
78201  * 
78202  */
78203     xmlBufferFree(__pyx_v_c_buffer);
78204
78205     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":46
78206  *     if error_result < 0 or c_text is NULL:
78207  *         tree.xmlBufferFree(c_buffer)
78208  *         raise SerialisationError, u"Error during serialisation (out of memory?)"             # <<<<<<<<<<<<<<
78209  * 
78210  *     try:
78211  */
78212     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_SerialisationError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
78213     __Pyx_GOTREF(__pyx_1);
78214     __Pyx_Raise(__pyx_1, ((PyObject *)__pyx_kp_477), 0);
78215     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
78216     {__pyx_filename = __pyx_f[3]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
78217     goto __pyx_L10;
78218   }
78219   __pyx_L10:;
78220
78221   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":48
78222  *         raise SerialisationError, u"Error during serialisation (out of memory?)"
78223  * 
78224  *     try:             # <<<<<<<<<<<<<<
78225  *         needs_conversion = 0
78226  *         if encoding is _unicode:
78227  */
78228   /*try:*/ {
78229
78230     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":49
78231  * 
78232  *     try:
78233  *         needs_conversion = 0             # <<<<<<<<<<<<<<
78234  *         if encoding is _unicode:
78235  *             needs_conversion = 1
78236  */
78237     __pyx_v_needs_conversion = 0;
78238
78239     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":50
78240  *     try:
78241  *         needs_conversion = 0
78242  *         if encoding is _unicode:             # <<<<<<<<<<<<<<
78243  *             needs_conversion = 1
78244  *         elif encoding is not None:
78245  */
78246     __pyx_t_1 = (__pyx_v_encoding == __pyx_v_4lxml_5etree__unicode);
78247     if (__pyx_t_1) {
78248
78249       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":51
78250  *         needs_conversion = 0
78251  *         if encoding is _unicode:
78252  *             needs_conversion = 1             # <<<<<<<<<<<<<<
78253  *         elif encoding is not None:
78254  *             encoding = encoding.upper()
78255  */
78256       __pyx_v_needs_conversion = 1;
78257       goto __pyx_L14;
78258     }
78259
78260     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":52
78261  *         if encoding is _unicode:
78262  *             needs_conversion = 1
78263  *         elif encoding is not None:             # <<<<<<<<<<<<<<
78264  *             encoding = encoding.upper()
78265  *             if encoding != u'UTF-8':
78266  */
78267     __pyx_t_1 = (__pyx_v_encoding != Py_None);
78268     if (__pyx_t_1) {
78269
78270       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":53
78271  *             needs_conversion = 1
78272  *         elif encoding is not None:
78273  *             encoding = encoding.upper()             # <<<<<<<<<<<<<<
78274  *             if encoding != u'UTF-8':
78275  *                 if encoding == u'ASCII':
78276  */
78277       __pyx_t_2 = PyObject_GetAttr(__pyx_v_encoding, __pyx_kp_upper); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L12;}
78278       __Pyx_GOTREF(__pyx_t_2);
78279       __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L12;}
78280       __Pyx_GOTREF(__pyx_t_3);
78281       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
78282       __Pyx_DECREF(__pyx_v_encoding);
78283       __pyx_v_encoding = __pyx_t_3;
78284       __pyx_t_3 = 0;
78285
78286       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":54
78287  *         elif encoding is not None:
78288  *             encoding = encoding.upper()
78289  *             if encoding != u'UTF-8':             # <<<<<<<<<<<<<<
78290  *                 if encoding == u'ASCII':
78291  *                     if isutf8(c_text):
78292  */
78293       __pyx_t_3 = PyObject_RichCompare(__pyx_v_encoding, ((PyObject *)__pyx_kp_478), Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L12;}
78294       __Pyx_GOTREF(__pyx_t_3);
78295       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L12;}
78296       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
78297       if (__pyx_t_1) {
78298
78299         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":55
78300  *             encoding = encoding.upper()
78301  *             if encoding != u'UTF-8':
78302  *                 if encoding == u'ASCII':             # <<<<<<<<<<<<<<
78303  *                     if isutf8(c_text):
78304  *                         # will raise a decode error below
78305  */
78306         __pyx_t_3 = PyObject_RichCompare(__pyx_v_encoding, ((PyObject *)__pyx_kp_479), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L12;}
78307         __Pyx_GOTREF(__pyx_t_3);
78308         __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L12;}
78309         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
78310         if (__pyx_t_1) {
78311
78312           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":56
78313  *             if encoding != u'UTF-8':
78314  *                 if encoding == u'ASCII':
78315  *                     if isutf8(c_text):             # <<<<<<<<<<<<<<
78316  *                         # will raise a decode error below
78317  *                         needs_conversion = 1
78318  */
78319           __pyx_t_4 = __pyx_f_4lxml_5etree_isutf8(__pyx_v_c_text);
78320           if (__pyx_t_4) {
78321
78322             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":58
78323  *                     if isutf8(c_text):
78324  *                         # will raise a decode error below
78325  *                         needs_conversion = 1             # <<<<<<<<<<<<<<
78326  *                 else:
78327  *                     needs_conversion = 1
78328  */
78329             __pyx_v_needs_conversion = 1;
78330             goto __pyx_L17;
78331           }
78332           __pyx_L17:;
78333           goto __pyx_L16;
78334         }
78335         /*else*/ {
78336
78337           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":60
78338  *                         needs_conversion = 1
78339  *                 else:
78340  *                     needs_conversion = 1             # <<<<<<<<<<<<<<
78341  * 
78342  *         if needs_conversion:
78343  */
78344           __pyx_v_needs_conversion = 1;
78345         }
78346         __pyx_L16:;
78347         goto __pyx_L15;
78348       }
78349       __pyx_L15:;
78350       goto __pyx_L14;
78351     }
78352     __pyx_L14:;
78353
78354     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":62
78355  *                     needs_conversion = 1
78356  * 
78357  *         if needs_conversion:             # <<<<<<<<<<<<<<
78358  *             text = python.PyUnicode_DecodeUTF8(
78359  *                 c_text, tree.xmlBufferLength(c_buffer), 'strict')
78360  */
78361     __pyx_t_1 = __pyx_v_needs_conversion;
78362     if (__pyx_t_1) {
78363
78364       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":64
78365  *         if needs_conversion:
78366  *             text = python.PyUnicode_DecodeUTF8(
78367  *                 c_text, tree.xmlBufferLength(c_buffer), 'strict')             # <<<<<<<<<<<<<<
78368  *             if encoding is not _unicode:
78369  *                 encoding = _utf8(encoding)
78370  */
78371       __pyx_t_3 = PyUnicode_DecodeUTF8(__pyx_v_c_text, xmlBufferLength(__pyx_v_c_buffer), __pyx_k_480); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L12;}
78372       __Pyx_GOTREF(__pyx_t_3);
78373       __Pyx_DECREF(__pyx_v_text);
78374       __pyx_v_text = __pyx_t_3;
78375       __pyx_t_3 = 0;
78376
78377       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":65
78378  *             text = python.PyUnicode_DecodeUTF8(
78379  *                 c_text, tree.xmlBufferLength(c_buffer), 'strict')
78380  *             if encoding is not _unicode:             # <<<<<<<<<<<<<<
78381  *                 encoding = _utf8(encoding)
78382  *                 text = python.PyUnicode_AsEncodedString(
78383  */
78384       __pyx_t_1 = (__pyx_v_encoding != __pyx_v_4lxml_5etree__unicode);
78385       if (__pyx_t_1) {
78386
78387         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":66
78388  *                 c_text, tree.xmlBufferLength(c_buffer), 'strict')
78389  *             if encoding is not _unicode:
78390  *                 encoding = _utf8(encoding)             # <<<<<<<<<<<<<<
78391  *                 text = python.PyUnicode_AsEncodedString(
78392  *                     text, encoding, 'strict')
78393  */
78394         __pyx_t_3 = __pyx_f_4lxml_5etree__utf8(__pyx_v_encoding); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L12;}
78395         __Pyx_GOTREF(__pyx_t_3);
78396         __Pyx_DECREF(__pyx_v_encoding);
78397         __pyx_v_encoding = __pyx_t_3;
78398         __pyx_t_3 = 0;
78399
78400         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":68
78401  *                 encoding = _utf8(encoding)
78402  *                 text = python.PyUnicode_AsEncodedString(
78403  *                     text, encoding, 'strict')             # <<<<<<<<<<<<<<
78404  *         else:
78405  *             text = c_text
78406  */
78407         __pyx_t_5 = __Pyx_PyBytes_AsString(__pyx_v_encoding); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L12;}
78408         __pyx_t_3 = PyUnicode_AsEncodedString(__pyx_v_text, __pyx_t_5, __pyx_k_481); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L12;}
78409         __Pyx_GOTREF(__pyx_t_3);
78410         __Pyx_DECREF(__pyx_v_text);
78411         __pyx_v_text = __pyx_t_3;
78412         __pyx_t_3 = 0;
78413         goto __pyx_L19;
78414       }
78415       __pyx_L19:;
78416       goto __pyx_L18;
78417     }
78418     /*else*/ {
78419
78420       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":70
78421  *                     text, encoding, 'strict')
78422  *         else:
78423  *             text = c_text             # <<<<<<<<<<<<<<
78424  *     finally:
78425  *         tree.xmlBufferFree(c_buffer)
78426  */
78427       __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_c_text); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L12;}
78428       __Pyx_GOTREF(__pyx_t_3);
78429       __Pyx_DECREF(__pyx_v_text);
78430       __pyx_v_text = __pyx_t_3;
78431       __pyx_t_3 = 0;
78432     }
78433     __pyx_L18:;
78434   }
78435   /*finally:*/ {
78436     int __pyx_why;
78437     PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
78438     int __pyx_exc_lineno;
78439     __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
78440     __pyx_why = 0; goto __pyx_L13;
78441     __pyx_L12: {
78442       __pyx_why = 4;
78443       __Pyx_XDECREF(__pyx_1); __pyx_1 = 0;
78444       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
78445       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
78446       __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
78447       __pyx_exc_lineno = __pyx_lineno;
78448       goto __pyx_L13;
78449     }
78450     __pyx_L13:;
78451
78452     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":72
78453  *             text = c_text
78454  *     finally:
78455  *         tree.xmlBufferFree(c_buffer)             # <<<<<<<<<<<<<<
78456  *     return text
78457  * 
78458  */
78459     xmlBufferFree(__pyx_v_c_buffer);
78460     switch (__pyx_why) {
78461       case 4: {
78462         __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
78463         __pyx_lineno = __pyx_exc_lineno;
78464         __pyx_exc_type = 0;
78465         __pyx_exc_value = 0;
78466         __pyx_exc_tb = 0;
78467         goto __pyx_L1_error;
78468       }
78469     }
78470   }
78471
78472   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":73
78473  *     finally:
78474  *         tree.xmlBufferFree(c_buffer)
78475  *     return text             # <<<<<<<<<<<<<<
78476  * 
78477  * 
78478  */
78479   __Pyx_XDECREF(__pyx_r);
78480   __Pyx_INCREF(__pyx_v_text);
78481   __pyx_r = __pyx_v_text;
78482   goto __pyx_L0;
78483
78484   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
78485   goto __pyx_L0;
78486   __pyx_L1_error:;
78487   __Pyx_XDECREF(__pyx_1);
78488   __Pyx_XDECREF(__pyx_t_2);
78489   __Pyx_XDECREF(__pyx_t_3);
78490   __Pyx_AddTraceback("lxml.etree._textToString");
78491   __pyx_r = 0;
78492   __pyx_L0:;
78493   __Pyx_DECREF(__pyx_v_text);
78494   __Pyx_DECREF(__pyx_v_encoding);
78495   __Pyx_XGIVEREF(__pyx_r);
78496   __Pyx_FinishRefcountContext();
78497   return __pyx_r;
78498 }
78499
78500 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":76
78501  * 
78502  * 
78503  * cdef _tostring(_Element element, encoding, method,             # <<<<<<<<<<<<<<
78504  *                bint write_xml_declaration, bint write_complete_document,
78505  *                bint pretty_print, bint with_tail, int standalone):
78506  */
78507
78508 static  PyObject *__pyx_f_4lxml_5etree__tostring(struct LxmlElement *__pyx_v_element, PyObject *__pyx_v_encoding, PyObject *__pyx_v_method, int __pyx_v_write_xml_declaration, int __pyx_v_write_complete_document, int __pyx_v_pretty_print, int __pyx_v_with_tail, int __pyx_v_standalone) {
78509   xmlOutputBuffer *__pyx_v_c_buffer;
78510   xmlBuffer *__pyx_v_c_result_buffer;
78511   xmlCharEncodingHandler *__pyx_v_enchandler;
78512   char *__pyx_v_c_enc;
78513   int __pyx_v_c_method;
78514   int __pyx_v_error_result;
78515   PyObject *__pyx_v_result;
78516   PyObject *__pyx_r = NULL;
78517   int __pyx_t_1;
78518   int __pyx_t_2;
78519   PyObject *__pyx_t_3 = NULL;
78520   int __pyx_t_4;
78521   int __pyx_t_5;
78522   PyObject *__pyx_t_6 = NULL;
78523   PyObject *__pyx_t_7 = NULL;
78524   __Pyx_SetupRefcountContext("_tostring");
78525   __Pyx_INCREF(__pyx_v_encoding);
78526   __pyx_v_result = Py_None; __Pyx_INCREF(Py_None);
78527
78528   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":89
78529  *     cdef int c_method
78530  *     cdef int error_result
78531  *     if element is None:             # <<<<<<<<<<<<<<
78532  *         return None
78533  *     c_method = _findOutputMethod(method)
78534  */
78535   __pyx_t_1 = (((PyObject *)__pyx_v_element) == Py_None);
78536   if (__pyx_t_1) {
78537
78538     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":90
78539  *     cdef int error_result
78540  *     if element is None:
78541  *         return None             # <<<<<<<<<<<<<<
78542  *     c_method = _findOutputMethod(method)
78543  *     if c_method == OUTPUT_METHOD_TEXT:
78544  */
78545     __Pyx_XDECREF(__pyx_r);
78546     __Pyx_INCREF(Py_None);
78547     __pyx_r = Py_None;
78548     goto __pyx_L0;
78549     goto __pyx_L3;
78550   }
78551   __pyx_L3:;
78552
78553   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":91
78554  *     if element is None:
78555  *         return None
78556  *     c_method = _findOutputMethod(method)             # <<<<<<<<<<<<<<
78557  *     if c_method == OUTPUT_METHOD_TEXT:
78558  *         return _textToString(element._c_node, encoding, with_tail)
78559  */
78560   __pyx_t_2 = __pyx_f_4lxml_5etree__findOutputMethod(__pyx_v_method); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
78561   __pyx_v_c_method = __pyx_t_2;
78562
78563   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":92
78564  *         return None
78565  *     c_method = _findOutputMethod(method)
78566  *     if c_method == OUTPUT_METHOD_TEXT:             # <<<<<<<<<<<<<<
78567  *         return _textToString(element._c_node, encoding, with_tail)
78568  *     if encoding is None or encoding is _unicode:
78569  */
78570   __pyx_t_1 = (__pyx_v_c_method == __pyx_e_4lxml_5etree_OUTPUT_METHOD_TEXT);
78571   if (__pyx_t_1) {
78572
78573     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":93
78574  *     c_method = _findOutputMethod(method)
78575  *     if c_method == OUTPUT_METHOD_TEXT:
78576  *         return _textToString(element._c_node, encoding, with_tail)             # <<<<<<<<<<<<<<
78577  *     if encoding is None or encoding is _unicode:
78578  *         c_enc = NULL
78579  */
78580     __Pyx_XDECREF(__pyx_r);
78581     __pyx_t_3 = __pyx_f_4lxml_5etree__textToString(__pyx_v_element->_c_node, __pyx_v_encoding, __pyx_v_with_tail); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
78582     __Pyx_GOTREF(__pyx_t_3);
78583     __pyx_r = __pyx_t_3;
78584     __pyx_t_3 = 0;
78585     goto __pyx_L0;
78586     goto __pyx_L4;
78587   }
78588   __pyx_L4:;
78589
78590   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":94
78591  *     if c_method == OUTPUT_METHOD_TEXT:
78592  *         return _textToString(element._c_node, encoding, with_tail)
78593  *     if encoding is None or encoding is _unicode:             # <<<<<<<<<<<<<<
78594  *         c_enc = NULL
78595  *     else:
78596  */
78597   __pyx_t_1 = (__pyx_v_encoding == Py_None);
78598   if (!__pyx_t_1) {
78599     __pyx_t_4 = (__pyx_v_encoding == __pyx_v_4lxml_5etree__unicode);
78600     __pyx_t_5 = __pyx_t_4;
78601   } else {
78602     __pyx_t_5 = __pyx_t_1;
78603   }
78604   if (__pyx_t_5) {
78605
78606     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":95
78607  *         return _textToString(element._c_node, encoding, with_tail)
78608  *     if encoding is None or encoding is _unicode:
78609  *         c_enc = NULL             # <<<<<<<<<<<<<<
78610  *     else:
78611  *         encoding = _utf8(encoding)
78612  */
78613     __pyx_v_c_enc = NULL;
78614     goto __pyx_L5;
78615   }
78616   /*else*/ {
78617
78618     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":97
78619  *         c_enc = NULL
78620  *     else:
78621  *         encoding = _utf8(encoding)             # <<<<<<<<<<<<<<
78622  *         c_enc = _cstr(encoding)
78623  *     # it is necessary to *and* find the encoding handler *and* use
78624  */
78625     __pyx_t_3 = __pyx_f_4lxml_5etree__utf8(__pyx_v_encoding); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
78626     __Pyx_GOTREF(__pyx_t_3);
78627     __Pyx_DECREF(__pyx_v_encoding);
78628     __pyx_v_encoding = __pyx_t_3;
78629     __pyx_t_3 = 0;
78630
78631     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":98
78632  *     else:
78633  *         encoding = _utf8(encoding)
78634  *         c_enc = _cstr(encoding)             # <<<<<<<<<<<<<<
78635  *     # it is necessary to *and* find the encoding handler *and* use
78636  *     # encoding during output
78637  */
78638     __pyx_v_c_enc = PyString_AS_STRING(__pyx_v_encoding);
78639   }
78640   __pyx_L5:;
78641
78642   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":101
78643  *     # it is necessary to *and* find the encoding handler *and* use
78644  *     # encoding during output
78645  *     enchandler = tree.xmlFindCharEncodingHandler(c_enc)             # <<<<<<<<<<<<<<
78646  *     if enchandler is NULL and c_enc is not NULL:
78647  *         if encoding is not None:
78648  */
78649   __pyx_v_enchandler = xmlFindCharEncodingHandler(__pyx_v_c_enc);
78650
78651   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":102
78652  *     # encoding during output
78653  *     enchandler = tree.xmlFindCharEncodingHandler(c_enc)
78654  *     if enchandler is NULL and c_enc is not NULL:             # <<<<<<<<<<<<<<
78655  *         if encoding is not None:
78656  *             encoding = encoding.decode(u'UTF-8')
78657  */
78658   if ((__pyx_v_enchandler == NULL)) {
78659     __pyx_t_5 = (__pyx_v_c_enc != NULL);
78660   } else {
78661     __pyx_t_5 = (__pyx_v_enchandler == NULL);
78662   }
78663   if (__pyx_t_5) {
78664
78665     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":103
78666  *     enchandler = tree.xmlFindCharEncodingHandler(c_enc)
78667  *     if enchandler is NULL and c_enc is not NULL:
78668  *         if encoding is not None:             # <<<<<<<<<<<<<<
78669  *             encoding = encoding.decode(u'UTF-8')
78670  *         raise LookupError, u"unknown encoding: '%s'" % encoding
78671  */
78672     __pyx_t_5 = (__pyx_v_encoding != Py_None);
78673     if (__pyx_t_5) {
78674
78675       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":104
78676  *     if enchandler is NULL and c_enc is not NULL:
78677  *         if encoding is not None:
78678  *             encoding = encoding.decode(u'UTF-8')             # <<<<<<<<<<<<<<
78679  *         raise LookupError, u"unknown encoding: '%s'" % encoding
78680  *     c_buffer = tree.xmlAllocOutputBuffer(enchandler)
78681  */
78682       __pyx_t_3 = PyObject_GetAttr(__pyx_v_encoding, __pyx_kp_decode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
78683       __Pyx_GOTREF(__pyx_t_3);
78684       __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
78685       __Pyx_GOTREF(((PyObject *)__pyx_t_6));
78686       __Pyx_INCREF(((PyObject *)__pyx_kp_482));
78687       PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_482));
78688       __Pyx_GIVEREF(((PyObject *)__pyx_kp_482));
78689       __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
78690       __Pyx_GOTREF(__pyx_t_7);
78691       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
78692       __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
78693       __Pyx_DECREF(__pyx_v_encoding);
78694       __pyx_v_encoding = __pyx_t_7;
78695       __pyx_t_7 = 0;
78696       goto __pyx_L7;
78697     }
78698     __pyx_L7:;
78699
78700     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":105
78701  *         if encoding is not None:
78702  *             encoding = encoding.decode(u'UTF-8')
78703  *         raise LookupError, u"unknown encoding: '%s'" % encoding             # <<<<<<<<<<<<<<
78704  *     c_buffer = tree.xmlAllocOutputBuffer(enchandler)
78705  *     if c_buffer is NULL:
78706  */
78707     __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_483), __pyx_v_encoding); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
78708     __Pyx_GOTREF(__pyx_t_7);
78709     __Pyx_Raise(__pyx_builtin_LookupError, __pyx_t_7, 0);
78710     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
78711     {__pyx_filename = __pyx_f[3]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
78712     goto __pyx_L6;
78713   }
78714   __pyx_L6:;
78715
78716   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":106
78717  *             encoding = encoding.decode(u'UTF-8')
78718  *         raise LookupError, u"unknown encoding: '%s'" % encoding
78719  *     c_buffer = tree.xmlAllocOutputBuffer(enchandler)             # <<<<<<<<<<<<<<
78720  *     if c_buffer is NULL:
78721  *         tree.xmlCharEncCloseFunc(enchandler)
78722  */
78723   __pyx_v_c_buffer = xmlAllocOutputBuffer(__pyx_v_enchandler);
78724
78725   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":107
78726  *         raise LookupError, u"unknown encoding: '%s'" % encoding
78727  *     c_buffer = tree.xmlAllocOutputBuffer(enchandler)
78728  *     if c_buffer is NULL:             # <<<<<<<<<<<<<<
78729  *         tree.xmlCharEncCloseFunc(enchandler)
78730  *         return python.PyErr_NoMemory()
78731  */
78732   __pyx_t_5 = (__pyx_v_c_buffer == NULL);
78733   if (__pyx_t_5) {
78734
78735     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":108
78736  *     c_buffer = tree.xmlAllocOutputBuffer(enchandler)
78737  *     if c_buffer is NULL:
78738  *         tree.xmlCharEncCloseFunc(enchandler)             # <<<<<<<<<<<<<<
78739  *         return python.PyErr_NoMemory()
78740  * 
78741  */
78742     xmlCharEncCloseFunc(__pyx_v_enchandler);
78743
78744     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":109
78745  *     if c_buffer is NULL:
78746  *         tree.xmlCharEncCloseFunc(enchandler)
78747  *         return python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
78748  * 
78749  *     with nogil:
78750  */
78751     __Pyx_XDECREF(__pyx_r);
78752     __pyx_t_7 = PyErr_NoMemory(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
78753     __Pyx_GOTREF(__pyx_t_7);
78754     __pyx_r = __pyx_t_7;
78755     __pyx_t_7 = 0;
78756     goto __pyx_L0;
78757     goto __pyx_L8;
78758   }
78759   __pyx_L8:;
78760
78761   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":111
78762  *         return python.PyErr_NoMemory()
78763  * 
78764  *     with nogil:             # <<<<<<<<<<<<<<
78765  *         _writeNodeToBuffer(c_buffer, element._c_node, c_enc, c_method,
78766  *                            write_xml_declaration, write_complete_document,
78767  */
78768   { PyThreadState *_save;
78769     Py_UNBLOCK_THREADS
78770     /*try:*/ {
78771
78772       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":114
78773  *         _writeNodeToBuffer(c_buffer, element._c_node, c_enc, c_method,
78774  *                            write_xml_declaration, write_complete_document,
78775  *                            pretty_print, with_tail, standalone)             # <<<<<<<<<<<<<<
78776  *         tree.xmlOutputBufferFlush(c_buffer)
78777  *         if c_buffer.conv is not NULL:
78778  */
78779       __pyx_f_4lxml_5etree__writeNodeToBuffer(__pyx_v_c_buffer, __pyx_v_element->_c_node, __pyx_v_c_enc, __pyx_v_c_method, __pyx_v_write_xml_declaration, __pyx_v_write_complete_document, __pyx_v_pretty_print, __pyx_v_with_tail, __pyx_v_standalone);
78780
78781       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":115
78782  *                            write_xml_declaration, write_complete_document,
78783  *                            pretty_print, with_tail, standalone)
78784  *         tree.xmlOutputBufferFlush(c_buffer)             # <<<<<<<<<<<<<<
78785  *         if c_buffer.conv is not NULL:
78786  *             c_result_buffer = c_buffer.conv
78787  */
78788       xmlOutputBufferFlush(__pyx_v_c_buffer);
78789
78790       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":116
78791  *                            pretty_print, with_tail, standalone)
78792  *         tree.xmlOutputBufferFlush(c_buffer)
78793  *         if c_buffer.conv is not NULL:             # <<<<<<<<<<<<<<
78794  *             c_result_buffer = c_buffer.conv
78795  *         else:
78796  */
78797       __pyx_t_5 = (__pyx_v_c_buffer->conv != NULL);
78798       if (__pyx_t_5) {
78799
78800         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":117
78801  *         tree.xmlOutputBufferFlush(c_buffer)
78802  *         if c_buffer.conv is not NULL:
78803  *             c_result_buffer = c_buffer.conv             # <<<<<<<<<<<<<<
78804  *         else:
78805  *             c_result_buffer = c_buffer.buffer
78806  */
78807         __pyx_v_c_result_buffer = __pyx_v_c_buffer->conv;
78808         goto __pyx_L12;
78809       }
78810       /*else*/ {
78811
78812         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":119
78813  *             c_result_buffer = c_buffer.conv
78814  *         else:
78815  *             c_result_buffer = c_buffer.buffer             # <<<<<<<<<<<<<<
78816  * 
78817  *     error_result = c_buffer.error
78818  */
78819         __pyx_v_c_result_buffer = __pyx_v_c_buffer->buffer;
78820       }
78821       __pyx_L12:;
78822     }
78823     /*finally:*/ {
78824       Py_BLOCK_THREADS
78825     }
78826   }
78827
78828   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":121
78829  *             c_result_buffer = c_buffer.buffer
78830  * 
78831  *     error_result = c_buffer.error             # <<<<<<<<<<<<<<
78832  *     if error_result != xmlerror.XML_ERR_OK:
78833  *         tree.xmlOutputBufferClose(c_buffer)
78834  */
78835   __pyx_v_error_result = __pyx_v_c_buffer->error;
78836
78837   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":122
78838  * 
78839  *     error_result = c_buffer.error
78840  *     if error_result != xmlerror.XML_ERR_OK:             # <<<<<<<<<<<<<<
78841  *         tree.xmlOutputBufferClose(c_buffer)
78842  *         _raiseSerialisationError(error_result)
78843  */
78844   __pyx_t_5 = (__pyx_v_error_result != XML_ERR_OK);
78845   if (__pyx_t_5) {
78846
78847     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":123
78848  *     error_result = c_buffer.error
78849  *     if error_result != xmlerror.XML_ERR_OK:
78850  *         tree.xmlOutputBufferClose(c_buffer)             # <<<<<<<<<<<<<<
78851  *         _raiseSerialisationError(error_result)
78852  * 
78853  */
78854     xmlOutputBufferClose(__pyx_v_c_buffer);
78855
78856     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":124
78857  *     if error_result != xmlerror.XML_ERR_OK:
78858  *         tree.xmlOutputBufferClose(c_buffer)
78859  *         _raiseSerialisationError(error_result)             # <<<<<<<<<<<<<<
78860  * 
78861  *     try:
78862  */
78863     __pyx_t_7 = __pyx_f_4lxml_5etree__raiseSerialisationError(__pyx_v_error_result); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
78864     __Pyx_GOTREF(__pyx_t_7);
78865     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
78866     goto __pyx_L13;
78867   }
78868   __pyx_L13:;
78869
78870   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":126
78871  *         _raiseSerialisationError(error_result)
78872  * 
78873  *     try:             # <<<<<<<<<<<<<<
78874  *         if encoding is _unicode:
78875  *             result = python.PyUnicode_DecodeUTF8(
78876  */
78877   /*try:*/ {
78878
78879     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":127
78880  * 
78881  *     try:
78882  *         if encoding is _unicode:             # <<<<<<<<<<<<<<
78883  *             result = python.PyUnicode_DecodeUTF8(
78884  *                 tree.xmlBufferContent(c_result_buffer),
78885  */
78886     __pyx_t_5 = (__pyx_v_encoding == __pyx_v_4lxml_5etree__unicode);
78887     if (__pyx_t_5) {
78888
78889       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":131
78890  *                 tree.xmlBufferContent(c_result_buffer),
78891  *                 tree.xmlBufferLength(c_result_buffer),
78892  *                 'strict')             # <<<<<<<<<<<<<<
78893  *         else:
78894  *             result = python.PyString_FromStringAndSize(
78895  */
78896       __pyx_t_7 = PyUnicode_DecodeUTF8(xmlBufferContent(__pyx_v_c_result_buffer), xmlBufferLength(__pyx_v_c_result_buffer), __pyx_k_484); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L15;}
78897       __Pyx_GOTREF(__pyx_t_7);
78898       __Pyx_DECREF(__pyx_v_result);
78899       __pyx_v_result = __pyx_t_7;
78900       __pyx_t_7 = 0;
78901       goto __pyx_L17;
78902     }
78903     /*else*/ {
78904
78905       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":135
78906  *             result = python.PyString_FromStringAndSize(
78907  *                 tree.xmlBufferContent(c_result_buffer),
78908  *                 tree.xmlBufferLength(c_result_buffer))             # <<<<<<<<<<<<<<
78909  *     finally:
78910  *         error_result = tree.xmlOutputBufferClose(c_buffer)
78911  */
78912       __pyx_t_7 = PyString_FromStringAndSize(xmlBufferContent(__pyx_v_c_result_buffer), xmlBufferLength(__pyx_v_c_result_buffer)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L15;}
78913       __Pyx_GOTREF(__pyx_t_7);
78914       __Pyx_DECREF(__pyx_v_result);
78915       __pyx_v_result = __pyx_t_7;
78916       __pyx_t_7 = 0;
78917     }
78918     __pyx_L17:;
78919   }
78920   /*finally:*/ {
78921     int __pyx_why;
78922     PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
78923     int __pyx_exc_lineno;
78924     __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
78925     __pyx_why = 0; goto __pyx_L16;
78926     __pyx_L15: {
78927       __pyx_why = 4;
78928       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
78929       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
78930       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
78931       __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
78932       __pyx_exc_lineno = __pyx_lineno;
78933       goto __pyx_L16;
78934     }
78935     __pyx_L16:;
78936
78937     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":137
78938  *                 tree.xmlBufferLength(c_result_buffer))
78939  *     finally:
78940  *         error_result = tree.xmlOutputBufferClose(c_buffer)             # <<<<<<<<<<<<<<
78941  *     if error_result < 0:
78942  *         _raiseSerialisationError(error_result)
78943  */
78944     __pyx_v_error_result = xmlOutputBufferClose(__pyx_v_c_buffer);
78945     switch (__pyx_why) {
78946       case 4: {
78947         __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
78948         __pyx_lineno = __pyx_exc_lineno;
78949         __pyx_exc_type = 0;
78950         __pyx_exc_value = 0;
78951         __pyx_exc_tb = 0;
78952         goto __pyx_L1_error;
78953       }
78954     }
78955   }
78956
78957   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":138
78958  *     finally:
78959  *         error_result = tree.xmlOutputBufferClose(c_buffer)
78960  *     if error_result < 0:             # <<<<<<<<<<<<<<
78961  *         _raiseSerialisationError(error_result)
78962  *     return result
78963  */
78964   __pyx_t_5 = (__pyx_v_error_result < 0);
78965   if (__pyx_t_5) {
78966
78967     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":139
78968  *         error_result = tree.xmlOutputBufferClose(c_buffer)
78969  *     if error_result < 0:
78970  *         _raiseSerialisationError(error_result)             # <<<<<<<<<<<<<<
78971  *     return result
78972  * 
78973  */
78974     __pyx_t_7 = __pyx_f_4lxml_5etree__raiseSerialisationError(__pyx_v_error_result); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
78975     __Pyx_GOTREF(__pyx_t_7);
78976     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
78977     goto __pyx_L19;
78978   }
78979   __pyx_L19:;
78980
78981   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":140
78982  *     if error_result < 0:
78983  *         _raiseSerialisationError(error_result)
78984  *     return result             # <<<<<<<<<<<<<<
78985  * 
78986  * cdef _raiseSerialisationError(int error_result):
78987  */
78988   __Pyx_XDECREF(__pyx_r);
78989   __Pyx_INCREF(__pyx_v_result);
78990   __pyx_r = __pyx_v_result;
78991   goto __pyx_L0;
78992
78993   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
78994   goto __pyx_L0;
78995   __pyx_L1_error:;
78996   __Pyx_XDECREF(__pyx_t_3);
78997   __Pyx_XDECREF(__pyx_t_6);
78998   __Pyx_XDECREF(__pyx_t_7);
78999   __Pyx_AddTraceback("lxml.etree._tostring");
79000   __pyx_r = 0;
79001   __pyx_L0:;
79002   __Pyx_DECREF(__pyx_v_result);
79003   __Pyx_DECREF(__pyx_v_encoding);
79004   __Pyx_XGIVEREF(__pyx_r);
79005   __Pyx_FinishRefcountContext();
79006   return __pyx_r;
79007 }
79008
79009 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":142
79010  *     return result
79011  * 
79012  * cdef _raiseSerialisationError(int error_result):             # <<<<<<<<<<<<<<
79013  *     if error_result == xmlerror.XML_ERR_NO_MEMORY:
79014  *         return python.PyErr_NoMemory()
79015  */
79016
79017 static  PyObject *__pyx_f_4lxml_5etree__raiseSerialisationError(int __pyx_v_error_result) {
79018   PyObject *__pyx_v_message;
79019   PyObject *__pyx_r = NULL;
79020   PyObject *__pyx_1 = 0;
79021   int __pyx_t_1;
79022   PyObject *__pyx_t_2 = NULL;
79023   PyObject *__pyx_t_3 = NULL;
79024   PyObject *__pyx_t_4 = NULL;
79025   __Pyx_SetupRefcountContext("_raiseSerialisationError");
79026   __pyx_v_message = Py_None; __Pyx_INCREF(Py_None);
79027
79028   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":143
79029  * 
79030  * cdef _raiseSerialisationError(int error_result):
79031  *     if error_result == xmlerror.XML_ERR_NO_MEMORY:             # <<<<<<<<<<<<<<
79032  *         return python.PyErr_NoMemory()
79033  *     else:
79034  */
79035   __pyx_t_1 = (__pyx_v_error_result == XML_ERR_NO_MEMORY);
79036   if (__pyx_t_1) {
79037
79038     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":144
79039  * cdef _raiseSerialisationError(int error_result):
79040  *     if error_result == xmlerror.XML_ERR_NO_MEMORY:
79041  *         return python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
79042  *     else:
79043  *         message = ErrorTypes._getName(error_result)
79044  */
79045     __Pyx_XDECREF(__pyx_r);
79046     __pyx_t_2 = PyErr_NoMemory(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
79047     __Pyx_GOTREF(__pyx_t_2);
79048     __pyx_r = __pyx_t_2;
79049     __pyx_t_2 = 0;
79050     goto __pyx_L0;
79051     goto __pyx_L3;
79052   }
79053   /*else*/ {
79054
79055     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":146
79056  *         return python.PyErr_NoMemory()
79057  *     else:
79058  *         message = ErrorTypes._getName(error_result)             # <<<<<<<<<<<<<<
79059  *         if message is None:
79060  *             message = u"unknown error %d" % error_result
79061  */
79062     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ErrorTypes); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
79063     __Pyx_GOTREF(__pyx_1);
79064     __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp__getName); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
79065     __Pyx_GOTREF(__pyx_t_2);
79066     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
79067     __pyx_t_3 = PyInt_FromLong(__pyx_v_error_result); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
79068     __Pyx_GOTREF(__pyx_t_3);
79069     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
79070     __Pyx_GOTREF(((PyObject *)__pyx_t_4));
79071     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
79072     __Pyx_GIVEREF(__pyx_t_3);
79073     __pyx_t_3 = 0;
79074     __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
79075     __Pyx_GOTREF(__pyx_t_3);
79076     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
79077     __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
79078     __Pyx_DECREF(__pyx_v_message);
79079     __pyx_v_message = __pyx_t_3;
79080     __pyx_t_3 = 0;
79081
79082     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":147
79083  *     else:
79084  *         message = ErrorTypes._getName(error_result)
79085  *         if message is None:             # <<<<<<<<<<<<<<
79086  *             message = u"unknown error %d" % error_result
79087  *         raise SerialisationError, message
79088  */
79089     __pyx_t_1 = (__pyx_v_message == Py_None);
79090     if (__pyx_t_1) {
79091
79092       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":148
79093  *         message = ErrorTypes._getName(error_result)
79094  *         if message is None:
79095  *             message = u"unknown error %d" % error_result             # <<<<<<<<<<<<<<
79096  *         raise SerialisationError, message
79097  * 
79098  */
79099       __pyx_t_3 = PyInt_FromLong(__pyx_v_error_result); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
79100       __Pyx_GOTREF(__pyx_t_3);
79101       __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_485), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
79102       __Pyx_GOTREF(__pyx_t_4);
79103       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
79104       __Pyx_DECREF(__pyx_v_message);
79105       __pyx_v_message = __pyx_t_4;
79106       __pyx_t_4 = 0;
79107       goto __pyx_L4;
79108     }
79109     __pyx_L4:;
79110
79111     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":149
79112  *         if message is None:
79113  *             message = u"unknown error %d" % error_result
79114  *         raise SerialisationError, message             # <<<<<<<<<<<<<<
79115  * 
79116  * ############################################################
79117  */
79118     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_SerialisationError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
79119     __Pyx_GOTREF(__pyx_1);
79120     __Pyx_Raise(__pyx_1, __pyx_v_message, 0);
79121     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
79122     {__pyx_filename = __pyx_f[3]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
79123   }
79124   __pyx_L3:;
79125
79126   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
79127   goto __pyx_L0;
79128   __pyx_L1_error:;
79129   __Pyx_XDECREF(__pyx_1);
79130   __Pyx_XDECREF(__pyx_t_2);
79131   __Pyx_XDECREF(__pyx_t_3);
79132   __Pyx_XDECREF(__pyx_t_4);
79133   __Pyx_AddTraceback("lxml.etree._raiseSerialisationError");
79134   __pyx_r = 0;
79135   __pyx_L0:;
79136   __Pyx_DECREF(__pyx_v_message);
79137   __Pyx_XGIVEREF(__pyx_r);
79138   __Pyx_FinishRefcountContext();
79139   return __pyx_r;
79140 }
79141
79142 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":154
79143  * # low-level serialisation functions
79144  * 
79145  * cdef void _writeNodeToBuffer(tree.xmlOutputBuffer* c_buffer,             # <<<<<<<<<<<<<<
79146  *                              xmlNode* c_node, char* encoding, int c_method,
79147  *                              bint write_xml_declaration,
79148  */
79149
79150 static  void __pyx_f_4lxml_5etree__writeNodeToBuffer(xmlOutputBuffer *__pyx_v_c_buffer, xmlNode *__pyx_v_c_node, char *__pyx_v_encoding, int __pyx_v_c_method, int __pyx_v_write_xml_declaration, int __pyx_v_write_complete_document, int __pyx_v_pretty_print, int __pyx_v_with_tail, int __pyx_v_standalone) {
79151   xmlDoc *__pyx_v_c_doc;
79152   xmlNode *__pyx_v_c_nsdecl_node;
79153   int __pyx_t_1;
79154
79155   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":162
79156  *     cdef xmlDoc* c_doc
79157  *     cdef xmlNode* c_nsdecl_node
79158  *     c_doc = c_node.doc             # <<<<<<<<<<<<<<
79159  *     if write_xml_declaration and c_method == OUTPUT_METHOD_XML:
79160  *         _writeDeclarationToBuffer(c_buffer, c_doc.version, encoding, standalone)
79161  */
79162   __pyx_v_c_doc = __pyx_v_c_node->doc;
79163
79164   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":163
79165  *     cdef xmlNode* c_nsdecl_node
79166  *     c_doc = c_node.doc
79167  *     if write_xml_declaration and c_method == OUTPUT_METHOD_XML:             # <<<<<<<<<<<<<<
79168  *         _writeDeclarationToBuffer(c_buffer, c_doc.version, encoding, standalone)
79169  * 
79170  */
79171   if (__pyx_v_write_xml_declaration) {
79172     __pyx_t_1 = (__pyx_v_c_method == __pyx_e_4lxml_5etree_OUTPUT_METHOD_XML);
79173   } else {
79174     __pyx_t_1 = __pyx_v_write_xml_declaration;
79175   }
79176   if (__pyx_t_1) {
79177
79178     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":164
79179  *     c_doc = c_node.doc
79180  *     if write_xml_declaration and c_method == OUTPUT_METHOD_XML:
79181  *         _writeDeclarationToBuffer(c_buffer, c_doc.version, encoding, standalone)             # <<<<<<<<<<<<<<
79182  * 
79183  *     # write internal DTD subset, preceding PIs/comments, etc.
79184  */
79185     __pyx_f_4lxml_5etree__writeDeclarationToBuffer(__pyx_v_c_buffer, __pyx_v_c_doc->version, __pyx_v_encoding, __pyx_v_standalone);
79186     goto __pyx_L3;
79187   }
79188   __pyx_L3:;
79189
79190   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":167
79191  * 
79192  *     # write internal DTD subset, preceding PIs/comments, etc.
79193  *     if write_complete_document:             # <<<<<<<<<<<<<<
79194  *         _writeDtdToBuffer(c_buffer, c_doc, c_node.name, encoding)
79195  *         _writePrevSiblings(c_buffer, c_node, encoding, pretty_print)
79196  */
79197   __pyx_t_1 = __pyx_v_write_complete_document;
79198   if (__pyx_t_1) {
79199
79200     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":168
79201  *     # write internal DTD subset, preceding PIs/comments, etc.
79202  *     if write_complete_document:
79203  *         _writeDtdToBuffer(c_buffer, c_doc, c_node.name, encoding)             # <<<<<<<<<<<<<<
79204  *         _writePrevSiblings(c_buffer, c_node, encoding, pretty_print)
79205  * 
79206  */
79207     __pyx_f_4lxml_5etree__writeDtdToBuffer(__pyx_v_c_buffer, __pyx_v_c_doc, __pyx_v_c_node->name, __pyx_v_encoding);
79208
79209     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":169
79210  *     if write_complete_document:
79211  *         _writeDtdToBuffer(c_buffer, c_doc, c_node.name, encoding)
79212  *         _writePrevSiblings(c_buffer, c_node, encoding, pretty_print)             # <<<<<<<<<<<<<<
79213  * 
79214  *     c_nsdecl_node = c_node
79215  */
79216     __pyx_f_4lxml_5etree__writePrevSiblings(__pyx_v_c_buffer, __pyx_v_c_node, __pyx_v_encoding, __pyx_v_pretty_print);
79217     goto __pyx_L4;
79218   }
79219   __pyx_L4:;
79220
79221   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":171
79222  *         _writePrevSiblings(c_buffer, c_node, encoding, pretty_print)
79223  * 
79224  *     c_nsdecl_node = c_node             # <<<<<<<<<<<<<<
79225  *     if c_node.parent is NULL or c_node.parent.type != tree.XML_DOCUMENT_NODE:
79226  *         # copy the node and add namespaces from parents
79227  */
79228   __pyx_v_c_nsdecl_node = __pyx_v_c_node;
79229
79230   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":172
79231  * 
79232  *     c_nsdecl_node = c_node
79233  *     if c_node.parent is NULL or c_node.parent.type != tree.XML_DOCUMENT_NODE:             # <<<<<<<<<<<<<<
79234  *         # copy the node and add namespaces from parents
79235  *         # this is required to make libxml write them
79236  */
79237   if (!(__pyx_v_c_node->parent == NULL)) {
79238     __pyx_t_1 = (__pyx_v_c_node->parent->type != XML_DOCUMENT_NODE);
79239   } else {
79240     __pyx_t_1 = (__pyx_v_c_node->parent == NULL);
79241   }
79242   if (__pyx_t_1) {
79243
79244     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":175
79245  *         # copy the node and add namespaces from parents
79246  *         # this is required to make libxml write them
79247  *         c_nsdecl_node = tree.xmlCopyNode(c_node, 2)             # <<<<<<<<<<<<<<
79248  *         if c_nsdecl_node is NULL:
79249  *             c_buffer.error = xmlerror.XML_ERR_NO_MEMORY
79250  */
79251     __pyx_v_c_nsdecl_node = xmlCopyNode(__pyx_v_c_node, 2);
79252
79253     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":176
79254  *         # this is required to make libxml write them
79255  *         c_nsdecl_node = tree.xmlCopyNode(c_node, 2)
79256  *         if c_nsdecl_node is NULL:             # <<<<<<<<<<<<<<
79257  *             c_buffer.error = xmlerror.XML_ERR_NO_MEMORY
79258  *             return
79259  */
79260     __pyx_t_1 = (__pyx_v_c_nsdecl_node == NULL);
79261     if (__pyx_t_1) {
79262
79263       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":177
79264  *         c_nsdecl_node = tree.xmlCopyNode(c_node, 2)
79265  *         if c_nsdecl_node is NULL:
79266  *             c_buffer.error = xmlerror.XML_ERR_NO_MEMORY             # <<<<<<<<<<<<<<
79267  *             return
79268  *         _copyParentNamespaces(c_node, c_nsdecl_node)
79269  */
79270       __pyx_v_c_buffer->error = XML_ERR_NO_MEMORY;
79271
79272       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":178
79273  *         if c_nsdecl_node is NULL:
79274  *             c_buffer.error = xmlerror.XML_ERR_NO_MEMORY
79275  *             return             # <<<<<<<<<<<<<<
79276  *         _copyParentNamespaces(c_node, c_nsdecl_node)
79277  * 
79278  */
79279       goto __pyx_L0;
79280       goto __pyx_L6;
79281     }
79282     __pyx_L6:;
79283
79284     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":179
79285  *             c_buffer.error = xmlerror.XML_ERR_NO_MEMORY
79286  *             return
79287  *         _copyParentNamespaces(c_node, c_nsdecl_node)             # <<<<<<<<<<<<<<
79288  * 
79289  *         c_nsdecl_node.parent = c_node.parent
79290  */
79291     __pyx_f_4lxml_5etree__copyParentNamespaces(__pyx_v_c_node, __pyx_v_c_nsdecl_node);
79292
79293     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":181
79294  *         _copyParentNamespaces(c_node, c_nsdecl_node)
79295  * 
79296  *         c_nsdecl_node.parent = c_node.parent             # <<<<<<<<<<<<<<
79297  *         c_nsdecl_node.children = c_node.children
79298  *         c_nsdecl_node.last = c_node.last
79299  */
79300     __pyx_v_c_nsdecl_node->parent = __pyx_v_c_node->parent;
79301
79302     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":182
79303  * 
79304  *         c_nsdecl_node.parent = c_node.parent
79305  *         c_nsdecl_node.children = c_node.children             # <<<<<<<<<<<<<<
79306  *         c_nsdecl_node.last = c_node.last
79307  * 
79308  */
79309     __pyx_v_c_nsdecl_node->children = __pyx_v_c_node->children;
79310
79311     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":183
79312  *         c_nsdecl_node.parent = c_node.parent
79313  *         c_nsdecl_node.children = c_node.children
79314  *         c_nsdecl_node.last = c_node.last             # <<<<<<<<<<<<<<
79315  * 
79316  *     # write node
79317  */
79318     __pyx_v_c_nsdecl_node->last = __pyx_v_c_node->last;
79319     goto __pyx_L5;
79320   }
79321   __pyx_L5:;
79322
79323   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":186
79324  * 
79325  *     # write node
79326  *     if c_method == OUTPUT_METHOD_XML:             # <<<<<<<<<<<<<<
79327  *         tree.xmlNodeDumpOutput(
79328  *             c_buffer, c_doc, c_nsdecl_node, 0, pretty_print, encoding)
79329  */
79330   __pyx_t_1 = (__pyx_v_c_method == __pyx_e_4lxml_5etree_OUTPUT_METHOD_XML);
79331   if (__pyx_t_1) {
79332
79333     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":188
79334  *     if c_method == OUTPUT_METHOD_XML:
79335  *         tree.xmlNodeDumpOutput(
79336  *             c_buffer, c_doc, c_nsdecl_node, 0, pretty_print, encoding)             # <<<<<<<<<<<<<<
79337  *     else:
79338  *         tree.htmlNodeDumpFormatOutput(
79339  */
79340     xmlNodeDumpOutput(__pyx_v_c_buffer, __pyx_v_c_doc, __pyx_v_c_nsdecl_node, 0, __pyx_v_pretty_print, __pyx_v_encoding);
79341     goto __pyx_L7;
79342   }
79343   /*else*/ {
79344
79345     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":191
79346  *     else:
79347  *         tree.htmlNodeDumpFormatOutput(
79348  *             c_buffer, c_doc, c_nsdecl_node, encoding, pretty_print)             # <<<<<<<<<<<<<<
79349  * 
79350  *     if c_nsdecl_node is not c_node:
79351  */
79352     htmlNodeDumpFormatOutput(__pyx_v_c_buffer, __pyx_v_c_doc, __pyx_v_c_nsdecl_node, __pyx_v_encoding, __pyx_v_pretty_print);
79353   }
79354   __pyx_L7:;
79355
79356   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":193
79357  *             c_buffer, c_doc, c_nsdecl_node, encoding, pretty_print)
79358  * 
79359  *     if c_nsdecl_node is not c_node:             # <<<<<<<<<<<<<<
79360  *         # clean up
79361  *         c_nsdecl_node.children = c_nsdecl_node.last = NULL
79362  */
79363   __pyx_t_1 = (__pyx_v_c_nsdecl_node != __pyx_v_c_node);
79364   if (__pyx_t_1) {
79365
79366     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":195
79367  *     if c_nsdecl_node is not c_node:
79368  *         # clean up
79369  *         c_nsdecl_node.children = c_nsdecl_node.last = NULL             # <<<<<<<<<<<<<<
79370  *         tree.xmlFreeNode(c_nsdecl_node)
79371  * 
79372  */
79373     __pyx_v_c_nsdecl_node->children = NULL;
79374     __pyx_v_c_nsdecl_node->last = NULL;
79375
79376     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":196
79377  *         # clean up
79378  *         c_nsdecl_node.children = c_nsdecl_node.last = NULL
79379  *         tree.xmlFreeNode(c_nsdecl_node)             # <<<<<<<<<<<<<<
79380  * 
79381  *     # write tail, trailing comments, etc.
79382  */
79383     xmlFreeNode(__pyx_v_c_nsdecl_node);
79384     goto __pyx_L8;
79385   }
79386   __pyx_L8:;
79387
79388   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":199
79389  * 
79390  *     # write tail, trailing comments, etc.
79391  *     if with_tail:             # <<<<<<<<<<<<<<
79392  *         _writeTail(c_buffer, c_node, encoding, pretty_print)
79393  *     if write_complete_document:
79394  */
79395   __pyx_t_1 = __pyx_v_with_tail;
79396   if (__pyx_t_1) {
79397
79398     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":200
79399  *     # write tail, trailing comments, etc.
79400  *     if with_tail:
79401  *         _writeTail(c_buffer, c_node, encoding, pretty_print)             # <<<<<<<<<<<<<<
79402  *     if write_complete_document:
79403  *         _writeNextSiblings(c_buffer, c_node, encoding, pretty_print)
79404  */
79405     __pyx_f_4lxml_5etree__writeTail(__pyx_v_c_buffer, __pyx_v_c_node, __pyx_v_encoding, __pyx_v_pretty_print);
79406     goto __pyx_L9;
79407   }
79408   __pyx_L9:;
79409
79410   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":201
79411  *     if with_tail:
79412  *         _writeTail(c_buffer, c_node, encoding, pretty_print)
79413  *     if write_complete_document:             # <<<<<<<<<<<<<<
79414  *         _writeNextSiblings(c_buffer, c_node, encoding, pretty_print)
79415  *     if pretty_print:
79416  */
79417   __pyx_t_1 = __pyx_v_write_complete_document;
79418   if (__pyx_t_1) {
79419
79420     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":202
79421  *         _writeTail(c_buffer, c_node, encoding, pretty_print)
79422  *     if write_complete_document:
79423  *         _writeNextSiblings(c_buffer, c_node, encoding, pretty_print)             # <<<<<<<<<<<<<<
79424  *     if pretty_print:
79425  *         tree.xmlOutputBufferWrite(c_buffer, 1, "\n")
79426  */
79427     __pyx_f_4lxml_5etree__writeNextSiblings(__pyx_v_c_buffer, __pyx_v_c_node, __pyx_v_encoding, __pyx_v_pretty_print);
79428     goto __pyx_L10;
79429   }
79430   __pyx_L10:;
79431
79432   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":203
79433  *     if write_complete_document:
79434  *         _writeNextSiblings(c_buffer, c_node, encoding, pretty_print)
79435  *     if pretty_print:             # <<<<<<<<<<<<<<
79436  *         tree.xmlOutputBufferWrite(c_buffer, 1, "\n")
79437  * 
79438  */
79439   __pyx_t_1 = __pyx_v_pretty_print;
79440   if (__pyx_t_1) {
79441
79442     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":204
79443  *         _writeNextSiblings(c_buffer, c_node, encoding, pretty_print)
79444  *     if pretty_print:
79445  *         tree.xmlOutputBufferWrite(c_buffer, 1, "\n")             # <<<<<<<<<<<<<<
79446  * 
79447  * cdef void _writeDeclarationToBuffer(tree.xmlOutputBuffer* c_buffer,
79448  */
79449     xmlOutputBufferWrite(__pyx_v_c_buffer, 1, __pyx_k_486);
79450     goto __pyx_L11;
79451   }
79452   __pyx_L11:;
79453
79454   __pyx_L0:;
79455 }
79456
79457 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":206
79458  *         tree.xmlOutputBufferWrite(c_buffer, 1, "\n")
79459  * 
79460  * cdef void _writeDeclarationToBuffer(tree.xmlOutputBuffer* c_buffer,             # <<<<<<<<<<<<<<
79461  *                                     char* version, char* encoding,
79462  *                                     int standalone) nogil:
79463  */
79464
79465 static  void __pyx_f_4lxml_5etree__writeDeclarationToBuffer(xmlOutputBuffer *__pyx_v_c_buffer, char *__pyx_v_version, char *__pyx_v_encoding, int __pyx_v_standalone) {
79466   int __pyx_t_1;
79467
79468   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":209
79469  *                                     char* version, char* encoding,
79470  *                                     int standalone) nogil:
79471  *     if version is NULL:             # <<<<<<<<<<<<<<
79472  *         version = "1.0"
79473  *     tree.xmlOutputBufferWrite(c_buffer, 15, "<?xml version='")
79474  */
79475   __pyx_t_1 = (__pyx_v_version == NULL);
79476   if (__pyx_t_1) {
79477
79478     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":210
79479  *                                     int standalone) nogil:
79480  *     if version is NULL:
79481  *         version = "1.0"             # <<<<<<<<<<<<<<
79482  *     tree.xmlOutputBufferWrite(c_buffer, 15, "<?xml version='")
79483  *     tree.xmlOutputBufferWriteString(c_buffer, version)
79484  */
79485     __pyx_v_version = __pyx_k_487;
79486     goto __pyx_L3;
79487   }
79488   __pyx_L3:;
79489
79490   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":211
79491  *     if version is NULL:
79492  *         version = "1.0"
79493  *     tree.xmlOutputBufferWrite(c_buffer, 15, "<?xml version='")             # <<<<<<<<<<<<<<
79494  *     tree.xmlOutputBufferWriteString(c_buffer, version)
79495  *     tree.xmlOutputBufferWrite(c_buffer, 12, "' encoding='")
79496  */
79497   xmlOutputBufferWrite(__pyx_v_c_buffer, 15, __pyx_k_488);
79498
79499   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":212
79500  *         version = "1.0"
79501  *     tree.xmlOutputBufferWrite(c_buffer, 15, "<?xml version='")
79502  *     tree.xmlOutputBufferWriteString(c_buffer, version)             # <<<<<<<<<<<<<<
79503  *     tree.xmlOutputBufferWrite(c_buffer, 12, "' encoding='")
79504  *     tree.xmlOutputBufferWriteString(c_buffer, encoding)
79505  */
79506   xmlOutputBufferWriteString(__pyx_v_c_buffer, __pyx_v_version);
79507
79508   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":213
79509  *     tree.xmlOutputBufferWrite(c_buffer, 15, "<?xml version='")
79510  *     tree.xmlOutputBufferWriteString(c_buffer, version)
79511  *     tree.xmlOutputBufferWrite(c_buffer, 12, "' encoding='")             # <<<<<<<<<<<<<<
79512  *     tree.xmlOutputBufferWriteString(c_buffer, encoding)
79513  *     if standalone == 0:
79514  */
79515   xmlOutputBufferWrite(__pyx_v_c_buffer, 12, __pyx_k_489);
79516
79517   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":214
79518  *     tree.xmlOutputBufferWriteString(c_buffer, version)
79519  *     tree.xmlOutputBufferWrite(c_buffer, 12, "' encoding='")
79520  *     tree.xmlOutputBufferWriteString(c_buffer, encoding)             # <<<<<<<<<<<<<<
79521  *     if standalone == 0:
79522  *         tree.xmlOutputBufferWrite(c_buffer, 20, "' standalone='no'?>\n")
79523  */
79524   xmlOutputBufferWriteString(__pyx_v_c_buffer, __pyx_v_encoding);
79525
79526   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":215
79527  *     tree.xmlOutputBufferWrite(c_buffer, 12, "' encoding='")
79528  *     tree.xmlOutputBufferWriteString(c_buffer, encoding)
79529  *     if standalone == 0:             # <<<<<<<<<<<<<<
79530  *         tree.xmlOutputBufferWrite(c_buffer, 20, "' standalone='no'?>\n")
79531  *     elif standalone == 1:
79532  */
79533   switch (__pyx_v_standalone) {
79534     case 0:
79535
79536     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":216
79537  *     tree.xmlOutputBufferWriteString(c_buffer, encoding)
79538  *     if standalone == 0:
79539  *         tree.xmlOutputBufferWrite(c_buffer, 20, "' standalone='no'?>\n")             # <<<<<<<<<<<<<<
79540  *     elif standalone == 1:
79541  *         tree.xmlOutputBufferWrite(c_buffer, 21, "' standalone='yes'?>\n")
79542  */
79543     xmlOutputBufferWrite(__pyx_v_c_buffer, 20, __pyx_k_490);
79544     break;
79545
79546     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":217
79547  *     if standalone == 0:
79548  *         tree.xmlOutputBufferWrite(c_buffer, 20, "' standalone='no'?>\n")
79549  *     elif standalone == 1:             # <<<<<<<<<<<<<<
79550  *         tree.xmlOutputBufferWrite(c_buffer, 21, "' standalone='yes'?>\n")
79551  *     else:
79552  */
79553     case 1:
79554
79555     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":218
79556  *         tree.xmlOutputBufferWrite(c_buffer, 20, "' standalone='no'?>\n")
79557  *     elif standalone == 1:
79558  *         tree.xmlOutputBufferWrite(c_buffer, 21, "' standalone='yes'?>\n")             # <<<<<<<<<<<<<<
79559  *     else:
79560  *         tree.xmlOutputBufferWrite(c_buffer, 4, "'?>\n")
79561  */
79562     xmlOutputBufferWrite(__pyx_v_c_buffer, 21, __pyx_k_491);
79563     break;
79564     default:
79565
79566     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":220
79567  *         tree.xmlOutputBufferWrite(c_buffer, 21, "' standalone='yes'?>\n")
79568  *     else:
79569  *         tree.xmlOutputBufferWrite(c_buffer, 4, "'?>\n")             # <<<<<<<<<<<<<<
79570  * 
79571  * cdef void _writeDtdToBuffer(tree.xmlOutputBuffer* c_buffer,
79572  */
79573     xmlOutputBufferWrite(__pyx_v_c_buffer, 4, __pyx_k_492);
79574     break;
79575   }
79576
79577 }
79578
79579 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":222
79580  *         tree.xmlOutputBufferWrite(c_buffer, 4, "'?>\n")
79581  * 
79582  * cdef void _writeDtdToBuffer(tree.xmlOutputBuffer* c_buffer,             # <<<<<<<<<<<<<<
79583  *                             xmlDoc* c_doc, char* c_root_name,
79584  *                             char* encoding) nogil:
79585  */
79586
79587 static  void __pyx_f_4lxml_5etree__writeDtdToBuffer(xmlOutputBuffer *__pyx_v_c_buffer, xmlDoc *__pyx_v_c_doc, char *__pyx_v_c_root_name, char *__pyx_v_encoding) {
79588   xmlDtd *__pyx_v_c_dtd;
79589   xmlNode *__pyx_v_c_node;
79590   int __pyx_t_1;
79591   int __pyx_t_2;
79592
79593   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":227
79594  *     cdef tree.xmlDtd* c_dtd
79595  *     cdef xmlNode* c_node
79596  *     c_dtd = c_doc.intSubset             # <<<<<<<<<<<<<<
79597  *     if c_dtd is NULL or c_dtd.name is NULL:
79598  *         return
79599  */
79600   __pyx_v_c_dtd = __pyx_v_c_doc->intSubset;
79601
79602   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":228
79603  *     cdef xmlNode* c_node
79604  *     c_dtd = c_doc.intSubset
79605  *     if c_dtd is NULL or c_dtd.name is NULL:             # <<<<<<<<<<<<<<
79606  *         return
79607  *     if cstd.strcmp(c_root_name, c_dtd.name) != 0:
79608  */
79609   if (!(__pyx_v_c_dtd == NULL)) {
79610     __pyx_t_1 = (__pyx_v_c_dtd->name == NULL);
79611   } else {
79612     __pyx_t_1 = (__pyx_v_c_dtd == NULL);
79613   }
79614   if (__pyx_t_1) {
79615
79616     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":229
79617  *     c_dtd = c_doc.intSubset
79618  *     if c_dtd is NULL or c_dtd.name is NULL:
79619  *         return             # <<<<<<<<<<<<<<
79620  *     if cstd.strcmp(c_root_name, c_dtd.name) != 0:
79621  *         return
79622  */
79623     goto __pyx_L0;
79624     goto __pyx_L3;
79625   }
79626   __pyx_L3:;
79627
79628   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":230
79629  *     if c_dtd is NULL or c_dtd.name is NULL:
79630  *         return
79631  *     if cstd.strcmp(c_root_name, c_dtd.name) != 0:             # <<<<<<<<<<<<<<
79632  *         return
79633  *     tree.xmlOutputBufferWrite(c_buffer, 10, "<!DOCTYPE ")
79634  */
79635   __pyx_t_1 = (strcmp(__pyx_v_c_root_name, __pyx_v_c_dtd->name) != 0);
79636   if (__pyx_t_1) {
79637
79638     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":231
79639  *         return
79640  *     if cstd.strcmp(c_root_name, c_dtd.name) != 0:
79641  *         return             # <<<<<<<<<<<<<<
79642  *     tree.xmlOutputBufferWrite(c_buffer, 10, "<!DOCTYPE ")
79643  *     tree.xmlOutputBufferWriteString(c_buffer, c_dtd.name)
79644  */
79645     goto __pyx_L0;
79646     goto __pyx_L4;
79647   }
79648   __pyx_L4:;
79649
79650   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":232
79651  *     if cstd.strcmp(c_root_name, c_dtd.name) != 0:
79652  *         return
79653  *     tree.xmlOutputBufferWrite(c_buffer, 10, "<!DOCTYPE ")             # <<<<<<<<<<<<<<
79654  *     tree.xmlOutputBufferWriteString(c_buffer, c_dtd.name)
79655  *     if c_dtd.SystemID != NULL and c_dtd.SystemID[0] != c'\0':
79656  */
79657   xmlOutputBufferWrite(__pyx_v_c_buffer, 10, __pyx_k_493);
79658
79659   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":233
79660  *         return
79661  *     tree.xmlOutputBufferWrite(c_buffer, 10, "<!DOCTYPE ")
79662  *     tree.xmlOutputBufferWriteString(c_buffer, c_dtd.name)             # <<<<<<<<<<<<<<
79663  *     if c_dtd.SystemID != NULL and c_dtd.SystemID[0] != c'\0':
79664  *         if c_dtd.ExternalID != NULL and c_dtd.ExternalID[0] != c'\0':
79665  */
79666   xmlOutputBufferWriteString(__pyx_v_c_buffer, __pyx_v_c_dtd->name);
79667
79668   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":234
79669  *     tree.xmlOutputBufferWrite(c_buffer, 10, "<!DOCTYPE ")
79670  *     tree.xmlOutputBufferWriteString(c_buffer, c_dtd.name)
79671  *     if c_dtd.SystemID != NULL and c_dtd.SystemID[0] != c'\0':             # <<<<<<<<<<<<<<
79672  *         if c_dtd.ExternalID != NULL and c_dtd.ExternalID[0] != c'\0':
79673  *             tree.xmlOutputBufferWrite(c_buffer, 9, ' PUBLIC "')
79674  */
79675   if ((__pyx_v_c_dtd->SystemID != NULL)) {
79676     __pyx_t_1 = ((__pyx_v_c_dtd->SystemID[0]) != '\x00');
79677   } else {
79678     __pyx_t_1 = (__pyx_v_c_dtd->SystemID != NULL);
79679   }
79680   if (__pyx_t_1) {
79681
79682     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":235
79683  *     tree.xmlOutputBufferWriteString(c_buffer, c_dtd.name)
79684  *     if c_dtd.SystemID != NULL and c_dtd.SystemID[0] != c'\0':
79685  *         if c_dtd.ExternalID != NULL and c_dtd.ExternalID[0] != c'\0':             # <<<<<<<<<<<<<<
79686  *             tree.xmlOutputBufferWrite(c_buffer, 9, ' PUBLIC "')
79687  *             tree.xmlOutputBufferWriteString(c_buffer, c_dtd.ExternalID)
79688  */
79689     if ((__pyx_v_c_dtd->ExternalID != NULL)) {
79690       __pyx_t_1 = ((__pyx_v_c_dtd->ExternalID[0]) != '\x00');
79691     } else {
79692       __pyx_t_1 = (__pyx_v_c_dtd->ExternalID != NULL);
79693     }
79694     if (__pyx_t_1) {
79695
79696       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":236
79697  *     if c_dtd.SystemID != NULL and c_dtd.SystemID[0] != c'\0':
79698  *         if c_dtd.ExternalID != NULL and c_dtd.ExternalID[0] != c'\0':
79699  *             tree.xmlOutputBufferWrite(c_buffer, 9, ' PUBLIC "')             # <<<<<<<<<<<<<<
79700  *             tree.xmlOutputBufferWriteString(c_buffer, c_dtd.ExternalID)
79701  *             tree.xmlOutputBufferWrite(c_buffer, 3, '" "')
79702  */
79703       xmlOutputBufferWrite(__pyx_v_c_buffer, 9, __pyx_k_494);
79704
79705       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":237
79706  *         if c_dtd.ExternalID != NULL and c_dtd.ExternalID[0] != c'\0':
79707  *             tree.xmlOutputBufferWrite(c_buffer, 9, ' PUBLIC "')
79708  *             tree.xmlOutputBufferWriteString(c_buffer, c_dtd.ExternalID)             # <<<<<<<<<<<<<<
79709  *             tree.xmlOutputBufferWrite(c_buffer, 3, '" "')
79710  *         else:
79711  */
79712       xmlOutputBufferWriteString(__pyx_v_c_buffer, __pyx_v_c_dtd->ExternalID);
79713
79714       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":238
79715  *             tree.xmlOutputBufferWrite(c_buffer, 9, ' PUBLIC "')
79716  *             tree.xmlOutputBufferWriteString(c_buffer, c_dtd.ExternalID)
79717  *             tree.xmlOutputBufferWrite(c_buffer, 3, '" "')             # <<<<<<<<<<<<<<
79718  *         else:
79719  *             tree.xmlOutputBufferWrite(c_buffer, 9, ' SYSTEM "')
79720  */
79721       xmlOutputBufferWrite(__pyx_v_c_buffer, 3, __pyx_k_495);
79722       goto __pyx_L6;
79723     }
79724     /*else*/ {
79725
79726       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":240
79727  *             tree.xmlOutputBufferWrite(c_buffer, 3, '" "')
79728  *         else:
79729  *             tree.xmlOutputBufferWrite(c_buffer, 9, ' SYSTEM "')             # <<<<<<<<<<<<<<
79730  *         tree.xmlOutputBufferWriteString(c_buffer, c_dtd.SystemID)
79731  *         tree.xmlOutputBufferWrite(c_buffer, 1, '"')
79732  */
79733       xmlOutputBufferWrite(__pyx_v_c_buffer, 9, __pyx_k_496);
79734     }
79735     __pyx_L6:;
79736
79737     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":241
79738  *         else:
79739  *             tree.xmlOutputBufferWrite(c_buffer, 9, ' SYSTEM "')
79740  *         tree.xmlOutputBufferWriteString(c_buffer, c_dtd.SystemID)             # <<<<<<<<<<<<<<
79741  *         tree.xmlOutputBufferWrite(c_buffer, 1, '"')
79742  *     if c_dtd.entities == NULL and c_dtd.elements == NULL and \
79743  */
79744     xmlOutputBufferWriteString(__pyx_v_c_buffer, __pyx_v_c_dtd->SystemID);
79745
79746     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":242
79747  *             tree.xmlOutputBufferWrite(c_buffer, 9, ' SYSTEM "')
79748  *         tree.xmlOutputBufferWriteString(c_buffer, c_dtd.SystemID)
79749  *         tree.xmlOutputBufferWrite(c_buffer, 1, '"')             # <<<<<<<<<<<<<<
79750  *     if c_dtd.entities == NULL and c_dtd.elements == NULL and \
79751  *            c_dtd.attributes == NULL and c_dtd.notations == NULL and \
79752  */
79753     xmlOutputBufferWrite(__pyx_v_c_buffer, 1, __pyx_k_497);
79754     goto __pyx_L5;
79755   }
79756   __pyx_L5:;
79757
79758   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":243
79759  *         tree.xmlOutputBufferWriteString(c_buffer, c_dtd.SystemID)
79760  *         tree.xmlOutputBufferWrite(c_buffer, 1, '"')
79761  *     if c_dtd.entities == NULL and c_dtd.elements == NULL and \             # <<<<<<<<<<<<<<
79762  *            c_dtd.attributes == NULL and c_dtd.notations == NULL and \
79763  *            c_dtd.pentities == NULL:
79764  */
79765   if ((__pyx_v_c_dtd->entities == NULL)) {
79766     if ((__pyx_v_c_dtd->elements == NULL)) {
79767
79768       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":244
79769  *         tree.xmlOutputBufferWrite(c_buffer, 1, '"')
79770  *     if c_dtd.entities == NULL and c_dtd.elements == NULL and \
79771  *            c_dtd.attributes == NULL and c_dtd.notations == NULL and \             # <<<<<<<<<<<<<<
79772  *            c_dtd.pentities == NULL:
79773  *         tree.xmlOutputBufferWrite(c_buffer, 2, '>\n')
79774  */
79775       if ((__pyx_v_c_dtd->attributes == NULL)) {
79776         if ((__pyx_v_c_dtd->notations == NULL)) {
79777
79778           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":245
79779  *     if c_dtd.entities == NULL and c_dtd.elements == NULL and \
79780  *            c_dtd.attributes == NULL and c_dtd.notations == NULL and \
79781  *            c_dtd.pentities == NULL:             # <<<<<<<<<<<<<<
79782  *         tree.xmlOutputBufferWrite(c_buffer, 2, '>\n')
79783  *         return
79784  */
79785           __pyx_t_1 = (__pyx_v_c_dtd->pentities == NULL);
79786         } else {
79787           __pyx_t_1 = (__pyx_v_c_dtd->notations == NULL);
79788         }
79789         __pyx_t_2 = __pyx_t_1;
79790       } else {
79791         __pyx_t_2 = (__pyx_v_c_dtd->attributes == NULL);
79792       }
79793       __pyx_t_1 = __pyx_t_2;
79794     } else {
79795       __pyx_t_1 = (__pyx_v_c_dtd->elements == NULL);
79796     }
79797     __pyx_t_2 = __pyx_t_1;
79798   } else {
79799     __pyx_t_2 = (__pyx_v_c_dtd->entities == NULL);
79800   }
79801   if (__pyx_t_2) {
79802
79803     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":246
79804  *            c_dtd.attributes == NULL and c_dtd.notations == NULL and \
79805  *            c_dtd.pentities == NULL:
79806  *         tree.xmlOutputBufferWrite(c_buffer, 2, '>\n')             # <<<<<<<<<<<<<<
79807  *         return
79808  *     tree.xmlOutputBufferWrite(c_buffer, 3, ' [\n')
79809  */
79810     xmlOutputBufferWrite(__pyx_v_c_buffer, 2, __pyx_k_498);
79811
79812     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":247
79813  *            c_dtd.pentities == NULL:
79814  *         tree.xmlOutputBufferWrite(c_buffer, 2, '>\n')
79815  *         return             # <<<<<<<<<<<<<<
79816  *     tree.xmlOutputBufferWrite(c_buffer, 3, ' [\n')
79817  *     if c_dtd.notations != NULL:
79818  */
79819     goto __pyx_L0;
79820     goto __pyx_L7;
79821   }
79822   __pyx_L7:;
79823
79824   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":248
79825  *         tree.xmlOutputBufferWrite(c_buffer, 2, '>\n')
79826  *         return
79827  *     tree.xmlOutputBufferWrite(c_buffer, 3, ' [\n')             # <<<<<<<<<<<<<<
79828  *     if c_dtd.notations != NULL:
79829  *         tree.xmlDumpNotationTable(c_buffer.buffer,
79830  */
79831   xmlOutputBufferWrite(__pyx_v_c_buffer, 3, __pyx_k_499);
79832
79833   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":249
79834  *         return
79835  *     tree.xmlOutputBufferWrite(c_buffer, 3, ' [\n')
79836  *     if c_dtd.notations != NULL:             # <<<<<<<<<<<<<<
79837  *         tree.xmlDumpNotationTable(c_buffer.buffer,
79838  *                                   <tree.xmlNotationTable*>c_dtd.notations)
79839  */
79840   __pyx_t_2 = (__pyx_v_c_dtd->notations != NULL);
79841   if (__pyx_t_2) {
79842
79843     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":251
79844  *     if c_dtd.notations != NULL:
79845  *         tree.xmlDumpNotationTable(c_buffer.buffer,
79846  *                                   <tree.xmlNotationTable*>c_dtd.notations)             # <<<<<<<<<<<<<<
79847  *     c_node = c_dtd.children
79848  *     while c_node is not NULL:
79849  */
79850     xmlDumpNotationTable(__pyx_v_c_buffer->buffer, ((xmlNotationTable *)__pyx_v_c_dtd->notations));
79851     goto __pyx_L8;
79852   }
79853   __pyx_L8:;
79854
79855   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":252
79856  *         tree.xmlDumpNotationTable(c_buffer.buffer,
79857  *                                   <tree.xmlNotationTable*>c_dtd.notations)
79858  *     c_node = c_dtd.children             # <<<<<<<<<<<<<<
79859  *     while c_node is not NULL:
79860  *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0, 0, encoding)
79861  */
79862   __pyx_v_c_node = __pyx_v_c_dtd->children;
79863
79864   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":253
79865  *                                   <tree.xmlNotationTable*>c_dtd.notations)
79866  *     c_node = c_dtd.children
79867  *     while c_node is not NULL:             # <<<<<<<<<<<<<<
79868  *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0, 0, encoding)
79869  *         c_node = c_node.next
79870  */
79871   while (1) {
79872     __pyx_t_2 = (__pyx_v_c_node != NULL);
79873     if (!__pyx_t_2) break;
79874
79875     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":254
79876  *     c_node = c_dtd.children
79877  *     while c_node is not NULL:
79878  *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0, 0, encoding)             # <<<<<<<<<<<<<<
79879  *         c_node = c_node.next
79880  *     tree.xmlOutputBufferWrite(c_buffer, 3, "]>\n")
79881  */
79882     xmlNodeDumpOutput(__pyx_v_c_buffer, __pyx_v_c_node->doc, __pyx_v_c_node, 0, 0, __pyx_v_encoding);
79883
79884     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":255
79885  *     while c_node is not NULL:
79886  *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0, 0, encoding)
79887  *         c_node = c_node.next             # <<<<<<<<<<<<<<
79888  *     tree.xmlOutputBufferWrite(c_buffer, 3, "]>\n")
79889  * 
79890  */
79891     __pyx_v_c_node = __pyx_v_c_node->next;
79892   }
79893
79894   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":256
79895  *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0, 0, encoding)
79896  *         c_node = c_node.next
79897  *     tree.xmlOutputBufferWrite(c_buffer, 3, "]>\n")             # <<<<<<<<<<<<<<
79898  * 
79899  * cdef void _writeTail(tree.xmlOutputBuffer* c_buffer, xmlNode* c_node,
79900  */
79901   xmlOutputBufferWrite(__pyx_v_c_buffer, 3, __pyx_k_500);
79902
79903   __pyx_L0:;
79904 }
79905
79906 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":258
79907  *     tree.xmlOutputBufferWrite(c_buffer, 3, "]>\n")
79908  * 
79909  * cdef void _writeTail(tree.xmlOutputBuffer* c_buffer, xmlNode* c_node,             # <<<<<<<<<<<<<<
79910  *                      char* encoding, bint pretty_print) nogil:
79911  *     u"Write the element tail."
79912  */
79913
79914 static  void __pyx_f_4lxml_5etree__writeTail(xmlOutputBuffer *__pyx_v_c_buffer, xmlNode *__pyx_v_c_node, char *__pyx_v_encoding, int __pyx_v_pretty_print) {
79915   int __pyx_t_1;
79916
79917   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":261
79918  *                      char* encoding, bint pretty_print) nogil:
79919  *     u"Write the element tail."
79920  *     c_node = c_node.next             # <<<<<<<<<<<<<<
79921  *     while c_node is not NULL and c_node.type == tree.XML_TEXT_NODE:
79922  *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0,
79923  */
79924   __pyx_v_c_node = __pyx_v_c_node->next;
79925
79926   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":262
79927  *     u"Write the element tail."
79928  *     c_node = c_node.next
79929  *     while c_node is not NULL and c_node.type == tree.XML_TEXT_NODE:             # <<<<<<<<<<<<<<
79930  *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0,
79931  *                                pretty_print, encoding)
79932  */
79933   while (1) {
79934     if ((__pyx_v_c_node != NULL)) {
79935       __pyx_t_1 = (__pyx_v_c_node->type == XML_TEXT_NODE);
79936     } else {
79937       __pyx_t_1 = (__pyx_v_c_node != NULL);
79938     }
79939     if (!__pyx_t_1) break;
79940
79941     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":264
79942  *     while c_node is not NULL and c_node.type == tree.XML_TEXT_NODE:
79943  *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0,
79944  *                                pretty_print, encoding)             # <<<<<<<<<<<<<<
79945  *         c_node = c_node.next
79946  * 
79947  */
79948     xmlNodeDumpOutput(__pyx_v_c_buffer, __pyx_v_c_node->doc, __pyx_v_c_node, 0, __pyx_v_pretty_print, __pyx_v_encoding);
79949
79950     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":265
79951  *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0,
79952  *                                pretty_print, encoding)
79953  *         c_node = c_node.next             # <<<<<<<<<<<<<<
79954  * 
79955  * cdef void _writePrevSiblings(tree.xmlOutputBuffer* c_buffer, xmlNode* c_node,
79956  */
79957     __pyx_v_c_node = __pyx_v_c_node->next;
79958   }
79959
79960 }
79961
79962 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":267
79963  *         c_node = c_node.next
79964  * 
79965  * cdef void _writePrevSiblings(tree.xmlOutputBuffer* c_buffer, xmlNode* c_node,             # <<<<<<<<<<<<<<
79966  *                              char* encoding, bint pretty_print) nogil:
79967  *     cdef xmlNode* c_sibling
79968  */
79969
79970 static  void __pyx_f_4lxml_5etree__writePrevSiblings(xmlOutputBuffer *__pyx_v_c_buffer, xmlNode *__pyx_v_c_node, char *__pyx_v_encoding, int __pyx_v_pretty_print) {
79971   xmlNode *__pyx_v_c_sibling;
79972   int __pyx_t_1;
79973   int __pyx_t_2;
79974
79975   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":270
79976  *                              char* encoding, bint pretty_print) nogil:
79977  *     cdef xmlNode* c_sibling
79978  *     if c_node.parent is not NULL and _isElement(c_node.parent):             # <<<<<<<<<<<<<<
79979  *         return
79980  *     # we are at a root node, so add PI and comment siblings
79981  */
79982   if ((__pyx_v_c_node->parent != NULL)) {
79983     __pyx_t_1 = _isElement(__pyx_v_c_node->parent);
79984   } else {
79985     __pyx_t_1 = (__pyx_v_c_node->parent != NULL);
79986   }
79987   if (__pyx_t_1) {
79988
79989     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":271
79990  *     cdef xmlNode* c_sibling
79991  *     if c_node.parent is not NULL and _isElement(c_node.parent):
79992  *         return             # <<<<<<<<<<<<<<
79993  *     # we are at a root node, so add PI and comment siblings
79994  *     c_sibling = c_node
79995  */
79996     goto __pyx_L0;
79997     goto __pyx_L3;
79998   }
79999   __pyx_L3:;
80000
80001   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":273
80002  *         return
80003  *     # we are at a root node, so add PI and comment siblings
80004  *     c_sibling = c_node             # <<<<<<<<<<<<<<
80005  *     while c_sibling.prev != NULL and \
80006  *             (c_sibling.prev.type == tree.XML_PI_NODE or \
80007  */
80008   __pyx_v_c_sibling = __pyx_v_c_node;
80009
80010   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":274
80011  *     # we are at a root node, so add PI and comment siblings
80012  *     c_sibling = c_node
80013  *     while c_sibling.prev != NULL and \             # <<<<<<<<<<<<<<
80014  *             (c_sibling.prev.type == tree.XML_PI_NODE or \
80015  *                  c_sibling.prev.type == tree.XML_COMMENT_NODE):
80016  */
80017   while (1) {
80018     if ((__pyx_v_c_sibling->prev != NULL)) {
80019
80020       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":275
80021  *     c_sibling = c_node
80022  *     while c_sibling.prev != NULL and \
80023  *             (c_sibling.prev.type == tree.XML_PI_NODE or \             # <<<<<<<<<<<<<<
80024  *                  c_sibling.prev.type == tree.XML_COMMENT_NODE):
80025  *         c_sibling = c_sibling.prev
80026  */
80027       if (!(__pyx_v_c_sibling->prev->type == XML_PI_NODE)) {
80028
80029         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":276
80030  *     while c_sibling.prev != NULL and \
80031  *             (c_sibling.prev.type == tree.XML_PI_NODE or \
80032  *                  c_sibling.prev.type == tree.XML_COMMENT_NODE):             # <<<<<<<<<<<<<<
80033  *         c_sibling = c_sibling.prev
80034  *     while c_sibling != c_node:
80035  */
80036         __pyx_t_1 = (__pyx_v_c_sibling->prev->type == XML_COMMENT_NODE);
80037       } else {
80038         __pyx_t_1 = (__pyx_v_c_sibling->prev->type == XML_PI_NODE);
80039       }
80040       __pyx_t_2 = __pyx_t_1;
80041     } else {
80042       __pyx_t_2 = (__pyx_v_c_sibling->prev != NULL);
80043     }
80044     if (!__pyx_t_2) break;
80045
80046     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":277
80047  *             (c_sibling.prev.type == tree.XML_PI_NODE or \
80048  *                  c_sibling.prev.type == tree.XML_COMMENT_NODE):
80049  *         c_sibling = c_sibling.prev             # <<<<<<<<<<<<<<
80050  *     while c_sibling != c_node:
80051  *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_sibling, 0,
80052  */
80053     __pyx_v_c_sibling = __pyx_v_c_sibling->prev;
80054   }
80055
80056   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":278
80057  *                  c_sibling.prev.type == tree.XML_COMMENT_NODE):
80058  *         c_sibling = c_sibling.prev
80059  *     while c_sibling != c_node:             # <<<<<<<<<<<<<<
80060  *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_sibling, 0,
80061  *                                pretty_print, encoding)
80062  */
80063   while (1) {
80064     __pyx_t_2 = (__pyx_v_c_sibling != __pyx_v_c_node);
80065     if (!__pyx_t_2) break;
80066
80067     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":280
80068  *     while c_sibling != c_node:
80069  *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_sibling, 0,
80070  *                                pretty_print, encoding)             # <<<<<<<<<<<<<<
80071  *         if pretty_print:
80072  *             tree.xmlOutputBufferWriteString(c_buffer, "\n")
80073  */
80074     xmlNodeDumpOutput(__pyx_v_c_buffer, __pyx_v_c_node->doc, __pyx_v_c_sibling, 0, __pyx_v_pretty_print, __pyx_v_encoding);
80075
80076     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":281
80077  *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_sibling, 0,
80078  *                                pretty_print, encoding)
80079  *         if pretty_print:             # <<<<<<<<<<<<<<
80080  *             tree.xmlOutputBufferWriteString(c_buffer, "\n")
80081  *         c_sibling = c_sibling.next
80082  */
80083     __pyx_t_2 = __pyx_v_pretty_print;
80084     if (__pyx_t_2) {
80085
80086       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":282
80087  *                                pretty_print, encoding)
80088  *         if pretty_print:
80089  *             tree.xmlOutputBufferWriteString(c_buffer, "\n")             # <<<<<<<<<<<<<<
80090  *         c_sibling = c_sibling.next
80091  * 
80092  */
80093       xmlOutputBufferWriteString(__pyx_v_c_buffer, __pyx_k_501);
80094       goto __pyx_L8;
80095     }
80096     __pyx_L8:;
80097
80098     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":283
80099  *         if pretty_print:
80100  *             tree.xmlOutputBufferWriteString(c_buffer, "\n")
80101  *         c_sibling = c_sibling.next             # <<<<<<<<<<<<<<
80102  * 
80103  * cdef void _writeNextSiblings(tree.xmlOutputBuffer* c_buffer, xmlNode* c_node,
80104  */
80105     __pyx_v_c_sibling = __pyx_v_c_sibling->next;
80106   }
80107
80108   __pyx_L0:;
80109 }
80110
80111 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":285
80112  *         c_sibling = c_sibling.next
80113  * 
80114  * cdef void _writeNextSiblings(tree.xmlOutputBuffer* c_buffer, xmlNode* c_node,             # <<<<<<<<<<<<<<
80115  *                              char* encoding, bint pretty_print) nogil:
80116  *     cdef xmlNode* c_sibling
80117  */
80118
80119 static  void __pyx_f_4lxml_5etree__writeNextSiblings(xmlOutputBuffer *__pyx_v_c_buffer, xmlNode *__pyx_v_c_node, char *__pyx_v_encoding, int __pyx_v_pretty_print) {
80120   xmlNode *__pyx_v_c_sibling;
80121   int __pyx_t_1;
80122   int __pyx_t_2;
80123
80124   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":288
80125  *                              char* encoding, bint pretty_print) nogil:
80126  *     cdef xmlNode* c_sibling
80127  *     if c_node.parent is not NULL and _isElement(c_node.parent):             # <<<<<<<<<<<<<<
80128  *         return
80129  *     # we are at a root node, so add PI and comment siblings
80130  */
80131   if ((__pyx_v_c_node->parent != NULL)) {
80132     __pyx_t_1 = _isElement(__pyx_v_c_node->parent);
80133   } else {
80134     __pyx_t_1 = (__pyx_v_c_node->parent != NULL);
80135   }
80136   if (__pyx_t_1) {
80137
80138     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":289
80139  *     cdef xmlNode* c_sibling
80140  *     if c_node.parent is not NULL and _isElement(c_node.parent):
80141  *         return             # <<<<<<<<<<<<<<
80142  *     # we are at a root node, so add PI and comment siblings
80143  *     c_sibling = c_node.next
80144  */
80145     goto __pyx_L0;
80146     goto __pyx_L3;
80147   }
80148   __pyx_L3:;
80149
80150   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":291
80151  *         return
80152  *     # we are at a root node, so add PI and comment siblings
80153  *     c_sibling = c_node.next             # <<<<<<<<<<<<<<
80154  *     while c_sibling != NULL and \
80155  *             (c_sibling.type == tree.XML_PI_NODE or \
80156  */
80157   __pyx_v_c_sibling = __pyx_v_c_node->next;
80158
80159   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":292
80160  *     # we are at a root node, so add PI and comment siblings
80161  *     c_sibling = c_node.next
80162  *     while c_sibling != NULL and \             # <<<<<<<<<<<<<<
80163  *             (c_sibling.type == tree.XML_PI_NODE or \
80164  *                  c_sibling.type == tree.XML_COMMENT_NODE):
80165  */
80166   while (1) {
80167     if ((__pyx_v_c_sibling != NULL)) {
80168
80169       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":293
80170  *     c_sibling = c_node.next
80171  *     while c_sibling != NULL and \
80172  *             (c_sibling.type == tree.XML_PI_NODE or \             # <<<<<<<<<<<<<<
80173  *                  c_sibling.type == tree.XML_COMMENT_NODE):
80174  *         if pretty_print:
80175  */
80176       if (!(__pyx_v_c_sibling->type == XML_PI_NODE)) {
80177
80178         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":294
80179  *     while c_sibling != NULL and \
80180  *             (c_sibling.type == tree.XML_PI_NODE or \
80181  *                  c_sibling.type == tree.XML_COMMENT_NODE):             # <<<<<<<<<<<<<<
80182  *         if pretty_print:
80183  *             tree.xmlOutputBufferWriteString(c_buffer, "\n")
80184  */
80185         __pyx_t_1 = (__pyx_v_c_sibling->type == XML_COMMENT_NODE);
80186       } else {
80187         __pyx_t_1 = (__pyx_v_c_sibling->type == XML_PI_NODE);
80188       }
80189       __pyx_t_2 = __pyx_t_1;
80190     } else {
80191       __pyx_t_2 = (__pyx_v_c_sibling != NULL);
80192     }
80193     if (!__pyx_t_2) break;
80194
80195     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":295
80196  *             (c_sibling.type == tree.XML_PI_NODE or \
80197  *                  c_sibling.type == tree.XML_COMMENT_NODE):
80198  *         if pretty_print:             # <<<<<<<<<<<<<<
80199  *             tree.xmlOutputBufferWriteString(c_buffer, "\n")
80200  *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_sibling, 0,
80201  */
80202     __pyx_t_2 = __pyx_v_pretty_print;
80203     if (__pyx_t_2) {
80204
80205       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":296
80206  *                  c_sibling.type == tree.XML_COMMENT_NODE):
80207  *         if pretty_print:
80208  *             tree.xmlOutputBufferWriteString(c_buffer, "\n")             # <<<<<<<<<<<<<<
80209  *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_sibling, 0,
80210  *                                pretty_print, encoding)
80211  */
80212       xmlOutputBufferWriteString(__pyx_v_c_buffer, __pyx_k_502);
80213       goto __pyx_L6;
80214     }
80215     __pyx_L6:;
80216
80217     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":298
80218  *             tree.xmlOutputBufferWriteString(c_buffer, "\n")
80219  *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_sibling, 0,
80220  *                                pretty_print, encoding)             # <<<<<<<<<<<<<<
80221  *         c_sibling = c_sibling.next
80222  * 
80223  */
80224     xmlNodeDumpOutput(__pyx_v_c_buffer, __pyx_v_c_node->doc, __pyx_v_c_sibling, 0, __pyx_v_pretty_print, __pyx_v_encoding);
80225
80226     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":299
80227  *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_sibling, 0,
80228  *                                pretty_print, encoding)
80229  *         c_sibling = c_sibling.next             # <<<<<<<<<<<<<<
80230  * 
80231  * ############################################################
80232  */
80233     __pyx_v_c_sibling = __pyx_v_c_sibling->next;
80234   }
80235
80236   __pyx_L0:;
80237 }
80238
80239 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":309
80240  *     cdef _ExceptionContext _exc_context
80241  *     cdef _ErrorLog error_log
80242  *     def __init__(self, filelike, exc_context=None, compression=None):             # <<<<<<<<<<<<<<
80243  *         if compression is not None and compression > 0:
80244  *             filelike = gzip.GzipFile(
80245  */
80246
80247 static int __pyx_pf_4lxml_5etree_15_FilelikeWriter___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
80248 static int __pyx_pf_4lxml_5etree_15_FilelikeWriter___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
80249   PyObject *__pyx_v_filelike = 0;
80250   PyObject *__pyx_v_exc_context = 0;
80251   PyObject *__pyx_v_compression = 0;
80252   int __pyx_r;
80253   PyObject *__pyx_1 = 0;
80254   int __pyx_t_1;
80255   PyObject *__pyx_t_2 = NULL;
80256   int __pyx_t_3;
80257   int __pyx_t_4;
80258   PyObject *__pyx_t_5 = NULL;
80259   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_filelike,&__pyx_kp_exc_context,&__pyx_kp_compression,0};
80260   __Pyx_SetupRefcountContext("__init__");
80261   if (unlikely(__pyx_kwds)) {
80262     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
80263     PyObject* values[3] = {0,0,0};
80264     values[1] = Py_None;
80265     values[2] = Py_None;
80266     switch (PyTuple_GET_SIZE(__pyx_args)) {
80267       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
80268       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
80269       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
80270       case  0: break;
80271       default: goto __pyx_L5_argtuple_error;
80272     }
80273     switch (PyTuple_GET_SIZE(__pyx_args)) {
80274       case  0:
80275       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_filelike);
80276       if (likely(values[0])) kw_args--;
80277       else goto __pyx_L5_argtuple_error;
80278       case  1:
80279       if (kw_args > 1) {
80280         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_exc_context);
80281         if (unlikely(value)) { values[1] = value; kw_args--; }
80282       }
80283       case  2:
80284       if (kw_args > 1) {
80285         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_compression);
80286         if (unlikely(value)) { values[2] = value; kw_args--; }
80287       }
80288     }
80289     if (unlikely(kw_args > 0)) {
80290       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
80291     }
80292     __pyx_v_filelike = values[0];
80293     __pyx_v_exc_context = values[1];
80294     __pyx_v_compression = values[2];
80295   } else {
80296     __pyx_v_exc_context = Py_None;
80297     __pyx_v_compression = Py_None;
80298     switch (PyTuple_GET_SIZE(__pyx_args)) {
80299       case  3: __pyx_v_compression = PyTuple_GET_ITEM(__pyx_args, 2);
80300       case  2: __pyx_v_exc_context = PyTuple_GET_ITEM(__pyx_args, 1);
80301       case  1: __pyx_v_filelike = PyTuple_GET_ITEM(__pyx_args, 0);
80302       break;
80303       default: goto __pyx_L5_argtuple_error;
80304     }
80305   }
80306   goto __pyx_L4_argument_unpacking_done;
80307   __pyx_L5_argtuple_error:;
80308   __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
80309   __pyx_L3_error:;
80310   __Pyx_AddTraceback("lxml.etree._FilelikeWriter.__init__");
80311   return -1;
80312   __pyx_L4_argument_unpacking_done:;
80313   __Pyx_INCREF(__pyx_v_filelike);
80314
80315   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":310
80316  *     cdef _ErrorLog error_log
80317  *     def __init__(self, filelike, exc_context=None, compression=None):
80318  *         if compression is not None and compression > 0:             # <<<<<<<<<<<<<<
80319  *             filelike = gzip.GzipFile(
80320  *                 fileobj=filelike, mode=u'wb', compresslevel=compression)
80321  */
80322   __pyx_t_1 = (__pyx_v_compression != Py_None);
80323   if (__pyx_t_1) {
80324     __pyx_t_2 = PyObject_RichCompare(__pyx_v_compression, __pyx_int_0, Py_GT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
80325     __Pyx_GOTREF(__pyx_t_2);
80326     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
80327     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
80328     __pyx_t_4 = __pyx_t_3;
80329   } else {
80330     __pyx_t_4 = __pyx_t_1;
80331   }
80332   if (__pyx_t_4) {
80333
80334     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":311
80335  *     def __init__(self, filelike, exc_context=None, compression=None):
80336  *         if compression is not None and compression > 0:
80337  *             filelike = gzip.GzipFile(             # <<<<<<<<<<<<<<
80338  *                 fileobj=filelike, mode=u'wb', compresslevel=compression)
80339  *             self._close_filelike = filelike.close
80340  */
80341     __pyx_t_2 = PyObject_GetAttr(__pyx_v_4lxml_5etree_gzip, __pyx_kp_GzipFile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
80342     __Pyx_GOTREF(__pyx_t_2);
80343     __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
80344     __Pyx_GOTREF(((PyObject *)__pyx_1));
80345
80346     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":312
80347  *         if compression is not None and compression > 0:
80348  *             filelike = gzip.GzipFile(
80349  *                 fileobj=filelike, mode=u'wb', compresslevel=compression)             # <<<<<<<<<<<<<<
80350  *             self._close_filelike = filelike.close
80351  *         self._filelike = filelike
80352  */
80353     if (PyDict_SetItem(__pyx_1, __pyx_kp_fileobj, __pyx_v_filelike) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
80354     if (PyDict_SetItem(__pyx_1, __pyx_kp_mode, ((PyObject *)__pyx_kp_503)) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
80355     if (PyDict_SetItem(__pyx_1, __pyx_kp_compresslevel, __pyx_v_compression) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
80356     __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
80357     __Pyx_GOTREF(__pyx_t_5);
80358     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
80359     __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
80360     __Pyx_DECREF(__pyx_v_filelike);
80361     __pyx_v_filelike = __pyx_t_5;
80362     __pyx_t_5 = 0;
80363
80364     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":313
80365  *             filelike = gzip.GzipFile(
80366  *                 fileobj=filelike, mode=u'wb', compresslevel=compression)
80367  *             self._close_filelike = filelike.close             # <<<<<<<<<<<<<<
80368  *         self._filelike = filelike
80369  *         if exc_context is None:
80370  */
80371     __pyx_t_5 = PyObject_GetAttr(__pyx_v_filelike, __pyx_kp_close); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
80372     __Pyx_GOTREF(__pyx_t_5);
80373     __Pyx_GIVEREF(__pyx_t_5);
80374     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_v_self)->_close_filelike);
80375     __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_v_self)->_close_filelike);
80376     ((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_v_self)->_close_filelike = __pyx_t_5;
80377     __pyx_t_5 = 0;
80378     goto __pyx_L6;
80379   }
80380   __pyx_L6:;
80381
80382   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":314
80383  *                 fileobj=filelike, mode=u'wb', compresslevel=compression)
80384  *             self._close_filelike = filelike.close
80385  *         self._filelike = filelike             # <<<<<<<<<<<<<<
80386  *         if exc_context is None:
80387  *             self._exc_context = _ExceptionContext()
80388  */
80389   __Pyx_INCREF(__pyx_v_filelike);
80390   __Pyx_GIVEREF(__pyx_v_filelike);
80391   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_v_self)->_filelike);
80392   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_v_self)->_filelike);
80393   ((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_v_self)->_filelike = __pyx_v_filelike;
80394
80395   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":315
80396  *             self._close_filelike = filelike.close
80397  *         self._filelike = filelike
80398  *         if exc_context is None:             # <<<<<<<<<<<<<<
80399  *             self._exc_context = _ExceptionContext()
80400  *         else:
80401  */
80402   __pyx_t_4 = (__pyx_v_exc_context == Py_None);
80403   if (__pyx_t_4) {
80404
80405     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":316
80406  *         self._filelike = filelike
80407  *         if exc_context is None:
80408  *             self._exc_context = _ExceptionContext()             # <<<<<<<<<<<<<<
80409  *         else:
80410  *             self._exc_context = exc_context
80411  */
80412     __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ExceptionContext)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
80413     __Pyx_GOTREF(__pyx_t_5);
80414     if (!(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_4lxml_5etree__ExceptionContext))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
80415     __Pyx_GIVEREF(__pyx_t_5);
80416     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_v_self)->_exc_context);
80417     __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_v_self)->_exc_context));
80418     ((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_v_self)->_exc_context = ((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_t_5);
80419     __pyx_t_5 = 0;
80420     goto __pyx_L7;
80421   }
80422   /*else*/ {
80423
80424     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":318
80425  *             self._exc_context = _ExceptionContext()
80426  *         else:
80427  *             self._exc_context = exc_context             # <<<<<<<<<<<<<<
80428  *         self.error_log = _ErrorLog()
80429  * 
80430  */
80431     if (!(__Pyx_TypeTest(__pyx_v_exc_context, __pyx_ptype_4lxml_5etree__ExceptionContext))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
80432     __Pyx_INCREF(__pyx_v_exc_context);
80433     __Pyx_GIVEREF(__pyx_v_exc_context);
80434     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_v_self)->_exc_context);
80435     __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_v_self)->_exc_context));
80436     ((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_v_self)->_exc_context = ((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_exc_context);
80437   }
80438   __pyx_L7:;
80439
80440   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":319
80441  *         else:
80442  *             self._exc_context = exc_context
80443  *         self.error_log = _ErrorLog()             # <<<<<<<<<<<<<<
80444  * 
80445  *     cdef tree.xmlOutputBuffer* _createOutputBuffer(
80446  */
80447   __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ErrorLog)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
80448   __Pyx_GOTREF(__pyx_t_5);
80449   if (!(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_4lxml_5etree__ErrorLog))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
80450   __Pyx_GIVEREF(__pyx_t_5);
80451   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_v_self)->error_log);
80452   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_v_self)->error_log));
80453   ((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_v_self)->error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_t_5);
80454   __pyx_t_5 = 0;
80455
80456   __pyx_r = 0;
80457   goto __pyx_L0;
80458   __pyx_L1_error:;
80459   __Pyx_XDECREF(__pyx_1);
80460   __Pyx_XDECREF(__pyx_t_2);
80461   __Pyx_XDECREF(__pyx_t_5);
80462   __Pyx_AddTraceback("lxml.etree._FilelikeWriter.__init__");
80463   __pyx_r = -1;
80464   __pyx_L0:;
80465   __Pyx_DECREF(__pyx_v_filelike);
80466   __Pyx_FinishRefcountContext();
80467   return __pyx_r;
80468 }
80469
80470 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":321
80471  *         self.error_log = _ErrorLog()
80472  * 
80473  *     cdef tree.xmlOutputBuffer* _createOutputBuffer(             # <<<<<<<<<<<<<<
80474  *         self, tree.xmlCharEncodingHandler* enchandler) except NULL:
80475  *         cdef tree.xmlOutputBuffer* c_buffer
80476  */
80477
80478 static  xmlOutputBuffer *__pyx_f_4lxml_5etree_15_FilelikeWriter__createOutputBuffer(struct __pyx_obj_4lxml_5etree__FilelikeWriter *__pyx_v_self, xmlCharEncodingHandler *__pyx_v_enchandler) {
80479   xmlOutputBuffer *__pyx_v_c_buffer;
80480   xmlOutputBuffer *__pyx_r;
80481   int __pyx_t_1;
80482   __Pyx_SetupRefcountContext("_createOutputBuffer");
80483
80484   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":326
80485  *         c_buffer = tree.xmlOutputBufferCreateIO(
80486  *             _writeFilelikeWriter, _closeFilelikeWriter,
80487  *             <python.PyObject*>self, enchandler)             # <<<<<<<<<<<<<<
80488  *         if c_buffer is NULL:
80489  *             raise IOError, u"Could not create I/O writer context."
80490  */
80491   __pyx_v_c_buffer = xmlOutputBufferCreateIO(__pyx_f_4lxml_5etree__writeFilelikeWriter, __pyx_f_4lxml_5etree__closeFilelikeWriter, ((PyObject *)__pyx_v_self), __pyx_v_enchandler);
80492
80493   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":327
80494  *             _writeFilelikeWriter, _closeFilelikeWriter,
80495  *             <python.PyObject*>self, enchandler)
80496  *         if c_buffer is NULL:             # <<<<<<<<<<<<<<
80497  *             raise IOError, u"Could not create I/O writer context."
80498  *         return c_buffer
80499  */
80500   __pyx_t_1 = (__pyx_v_c_buffer == NULL);
80501   if (__pyx_t_1) {
80502
80503     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":328
80504  *             <python.PyObject*>self, enchandler)
80505  *         if c_buffer is NULL:
80506  *             raise IOError, u"Could not create I/O writer context."             # <<<<<<<<<<<<<<
80507  *         return c_buffer
80508  * 
80509  */
80510     __Pyx_Raise(__pyx_builtin_IOError, ((PyObject *)__pyx_kp_504), 0);
80511     {__pyx_filename = __pyx_f[3]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
80512     goto __pyx_L3;
80513   }
80514   __pyx_L3:;
80515
80516   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":329
80517  *         if c_buffer is NULL:
80518  *             raise IOError, u"Could not create I/O writer context."
80519  *         return c_buffer             # <<<<<<<<<<<<<<
80520  * 
80521  *     cdef int write(self, char* c_buffer, int size):
80522  */
80523   __pyx_r = __pyx_v_c_buffer;
80524   goto __pyx_L0;
80525
80526   __pyx_r = 0;
80527   goto __pyx_L0;
80528   __pyx_L1_error:;
80529   __Pyx_AddTraceback("lxml.etree._FilelikeWriter._createOutputBuffer");
80530   __pyx_r = NULL;
80531   __pyx_L0:;
80532   __Pyx_FinishRefcountContext();
80533   return __pyx_r;
80534 }
80535
80536 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":331
80537  *         return c_buffer
80538  * 
80539  *     cdef int write(self, char* c_buffer, int size):             # <<<<<<<<<<<<<<
80540  *         try:
80541  *             if self._filelike is None:
80542  */
80543
80544 static  int __pyx_f_4lxml_5etree_15_FilelikeWriter_write(struct __pyx_obj_4lxml_5etree__FilelikeWriter *__pyx_v_self, char *__pyx_v_c_buffer, int __pyx_v_size) {
80545   PyObject *__pyx_v_py_buffer;
80546   int __pyx_r;
80547   int __pyx_t_1;
80548   PyObject *__pyx_t_2 = NULL;
80549   PyObject *__pyx_t_3 = NULL;
80550   PyObject *__pyx_t_4 = NULL;
80551   __Pyx_SetupRefcountContext("write");
80552   __pyx_v_py_buffer = Py_None; __Pyx_INCREF(Py_None);
80553
80554   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":332
80555  * 
80556  *     cdef int write(self, char* c_buffer, int size):
80557  *         try:             # <<<<<<<<<<<<<<
80558  *             if self._filelike is None:
80559  *                 raise IOError, u"File is already closed"
80560  */
80561   {
80562     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
80563     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
80564     __Pyx_XGOTREF(__pyx_save_exc_type);
80565     __Pyx_XGOTREF(__pyx_save_exc_value);
80566     __Pyx_XGOTREF(__pyx_save_exc_tb);
80567     /*try:*/ {
80568
80569       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":333
80570  *     cdef int write(self, char* c_buffer, int size):
80571  *         try:
80572  *             if self._filelike is None:             # <<<<<<<<<<<<<<
80573  *                 raise IOError, u"File is already closed"
80574  *             py_buffer = python.PyString_FromStringAndSize(c_buffer, size)
80575  */
80576       __pyx_t_1 = (__pyx_v_self->_filelike == Py_None);
80577       if (__pyx_t_1) {
80578
80579         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":334
80580  *         try:
80581  *             if self._filelike is None:
80582  *                 raise IOError, u"File is already closed"             # <<<<<<<<<<<<<<
80583  *             py_buffer = python.PyString_FromStringAndSize(c_buffer, size)
80584  *             self._filelike.write(py_buffer)
80585  */
80586         __Pyx_Raise(__pyx_builtin_IOError, ((PyObject *)__pyx_kp_505), 0);
80587         {__pyx_filename = __pyx_f[3]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
80588         goto __pyx_L11;
80589       }
80590       __pyx_L11:;
80591
80592       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":335
80593  *             if self._filelike is None:
80594  *                 raise IOError, u"File is already closed"
80595  *             py_buffer = python.PyString_FromStringAndSize(c_buffer, size)             # <<<<<<<<<<<<<<
80596  *             self._filelike.write(py_buffer)
80597  *             return size
80598  */
80599       __pyx_t_2 = PyString_FromStringAndSize(__pyx_v_c_buffer, __pyx_v_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
80600       __Pyx_GOTREF(__pyx_t_2);
80601       __Pyx_DECREF(__pyx_v_py_buffer);
80602       __pyx_v_py_buffer = __pyx_t_2;
80603       __pyx_t_2 = 0;
80604
80605       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":336
80606  *                 raise IOError, u"File is already closed"
80607  *             py_buffer = python.PyString_FromStringAndSize(c_buffer, size)
80608  *             self._filelike.write(py_buffer)             # <<<<<<<<<<<<<<
80609  *             return size
80610  *         except:
80611  */
80612       __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->_filelike, __pyx_kp_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
80613       __Pyx_GOTREF(__pyx_t_2);
80614       __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
80615       __Pyx_GOTREF(((PyObject *)__pyx_t_3));
80616       __Pyx_INCREF(__pyx_v_py_buffer);
80617       PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_py_buffer);
80618       __Pyx_GIVEREF(__pyx_v_py_buffer);
80619       __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
80620       __Pyx_GOTREF(__pyx_t_4);
80621       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
80622       __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
80623       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
80624
80625       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":337
80626  *             py_buffer = python.PyString_FromStringAndSize(c_buffer, size)
80627  *             self._filelike.write(py_buffer)
80628  *             return size             # <<<<<<<<<<<<<<
80629  *         except:
80630  *             self._exc_context._store_raised()
80631  */
80632       __pyx_r = __pyx_v_size;
80633       goto __pyx_L7_try_return;
80634     }
80635     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
80636     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
80637     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
80638     goto __pyx_L10_try_end;
80639     __pyx_L7_try_return:;
80640     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
80641     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
80642     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
80643     goto __pyx_L0;
80644     __pyx_L3_error:;
80645     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
80646     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
80647     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
80648
80649     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":338
80650  *             self._filelike.write(py_buffer)
80651  *             return size
80652  *         except:             # <<<<<<<<<<<<<<
80653  *             self._exc_context._store_raised()
80654  *             return -1
80655  */
80656     /*except:*/ {
80657       __Pyx_AddTraceback("lxml.etree.write");
80658       if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
80659       __Pyx_GOTREF(__pyx_t_4);
80660       __Pyx_GOTREF(__pyx_t_3);
80661       __Pyx_GOTREF(__pyx_t_2);
80662
80663       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":339
80664  *             return size
80665  *         except:
80666  *             self._exc_context._store_raised()             # <<<<<<<<<<<<<<
80667  *             return -1
80668  * 
80669  */
80670       ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_self->_exc_context->__pyx_vtab)->_store_raised(__pyx_v_self->_exc_context);
80671
80672       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":340
80673  *         except:
80674  *             self._exc_context._store_raised()
80675  *             return -1             # <<<<<<<<<<<<<<
80676  * 
80677  *     cdef int close(self):
80678  */
80679       __pyx_r = -1;
80680       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
80681       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
80682       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
80683       goto __pyx_L6_except_return;
80684       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
80685       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
80686       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
80687       goto __pyx_L4_exception_handled;
80688     }
80689     __pyx_L5_except_error:;
80690     __Pyx_XDECREF(__pyx_save_exc_type);
80691     __Pyx_XDECREF(__pyx_save_exc_value);
80692     __Pyx_XDECREF(__pyx_save_exc_tb);
80693     goto __pyx_L1_error;
80694     __pyx_L6_except_return:;
80695     __Pyx_XGIVEREF(__pyx_save_exc_type);
80696     __Pyx_XGIVEREF(__pyx_save_exc_value);
80697     __Pyx_XGIVEREF(__pyx_save_exc_tb);
80698     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
80699     goto __pyx_L0;
80700     __pyx_L4_exception_handled:;
80701     __Pyx_XGIVEREF(__pyx_save_exc_type);
80702     __Pyx_XGIVEREF(__pyx_save_exc_value);
80703     __Pyx_XGIVEREF(__pyx_save_exc_tb);
80704     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
80705     __pyx_L10_try_end:;
80706   }
80707
80708   __pyx_r = 0;
80709   goto __pyx_L0;
80710   __pyx_L1_error:;
80711   __Pyx_XDECREF(__pyx_t_2);
80712   __Pyx_XDECREF(__pyx_t_3);
80713   __Pyx_XDECREF(__pyx_t_4);
80714   __Pyx_WriteUnraisable("lxml.etree._FilelikeWriter.write");
80715   __pyx_r = 0;
80716   __pyx_L0:;
80717   __Pyx_DECREF(__pyx_v_py_buffer);
80718   __Pyx_FinishRefcountContext();
80719   return __pyx_r;
80720 }
80721
80722 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":342
80723  *             return -1
80724  * 
80725  *     cdef int close(self):             # <<<<<<<<<<<<<<
80726  *         try:
80727  *             if self._close_filelike is not None:
80728  */
80729
80730 static  int __pyx_f_4lxml_5etree_15_FilelikeWriter_close(struct __pyx_obj_4lxml_5etree__FilelikeWriter *__pyx_v_self) {
80731   int __pyx_r;
80732   int __pyx_t_1;
80733   PyObject *__pyx_t_2 = NULL;
80734   PyObject *__pyx_t_3 = NULL;
80735   PyObject *__pyx_t_4 = NULL;
80736   __Pyx_SetupRefcountContext("close");
80737
80738   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":343
80739  * 
80740  *     cdef int close(self):
80741  *         try:             # <<<<<<<<<<<<<<
80742  *             if self._close_filelike is not None:
80743  *                 self._close_filelike()
80744  */
80745   {
80746     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
80747     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
80748     __Pyx_XGOTREF(__pyx_save_exc_type);
80749     __Pyx_XGOTREF(__pyx_save_exc_value);
80750     __Pyx_XGOTREF(__pyx_save_exc_tb);
80751     /*try:*/ {
80752
80753       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":344
80754  *     cdef int close(self):
80755  *         try:
80756  *             if self._close_filelike is not None:             # <<<<<<<<<<<<<<
80757  *                 self._close_filelike()
80758  *             # we should not close the file here as we didn't open it
80759  */
80760       __pyx_t_1 = (__pyx_v_self->_close_filelike != Py_None);
80761       if (__pyx_t_1) {
80762
80763         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":345
80764  *         try:
80765  *             if self._close_filelike is not None:
80766  *                 self._close_filelike()             # <<<<<<<<<<<<<<
80767  *             # we should not close the file here as we didn't open it
80768  *             self._filelike = None
80769  */
80770         __pyx_t_2 = PyObject_Call(__pyx_v_self->_close_filelike, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
80771         __Pyx_GOTREF(__pyx_t_2);
80772         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
80773         goto __pyx_L11;
80774       }
80775       __pyx_L11:;
80776
80777       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":347
80778  *                 self._close_filelike()
80779  *             # we should not close the file here as we didn't open it
80780  *             self._filelike = None             # <<<<<<<<<<<<<<
80781  *             return 0
80782  *         except:
80783  */
80784       __Pyx_INCREF(Py_None);
80785       __Pyx_GIVEREF(Py_None);
80786       __Pyx_GOTREF(__pyx_v_self->_filelike);
80787       __Pyx_DECREF(__pyx_v_self->_filelike);
80788       __pyx_v_self->_filelike = Py_None;
80789
80790       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":348
80791  *             # we should not close the file here as we didn't open it
80792  *             self._filelike = None
80793  *             return 0             # <<<<<<<<<<<<<<
80794  *         except:
80795  *             self._exc_context._store_raised()
80796  */
80797       __pyx_r = 0;
80798       goto __pyx_L7_try_return;
80799     }
80800     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
80801     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
80802     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
80803     goto __pyx_L10_try_end;
80804     __pyx_L7_try_return:;
80805     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
80806     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
80807     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
80808     goto __pyx_L0;
80809     __pyx_L3_error:;
80810     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
80811
80812     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":349
80813  *             self._filelike = None
80814  *             return 0
80815  *         except:             # <<<<<<<<<<<<<<
80816  *             self._exc_context._store_raised()
80817  *             return -1
80818  */
80819     /*except:*/ {
80820       __Pyx_AddTraceback("lxml.etree.close");
80821       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
80822       __Pyx_GOTREF(__pyx_t_2);
80823       __Pyx_GOTREF(__pyx_t_3);
80824       __Pyx_GOTREF(__pyx_t_4);
80825
80826       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":350
80827  *             return 0
80828  *         except:
80829  *             self._exc_context._store_raised()             # <<<<<<<<<<<<<<
80830  *             return -1
80831  * 
80832  */
80833       ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_self->_exc_context->__pyx_vtab)->_store_raised(__pyx_v_self->_exc_context);
80834
80835       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":351
80836  *         except:
80837  *             self._exc_context._store_raised()
80838  *             return -1             # <<<<<<<<<<<<<<
80839  * 
80840  * cdef int _writeFilelikeWriter(void* ctxt, char* c_buffer, int len):
80841  */
80842       __pyx_r = -1;
80843       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
80844       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
80845       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
80846       goto __pyx_L6_except_return;
80847       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
80848       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
80849       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
80850       goto __pyx_L4_exception_handled;
80851     }
80852     __pyx_L5_except_error:;
80853     __Pyx_XDECREF(__pyx_save_exc_type);
80854     __Pyx_XDECREF(__pyx_save_exc_value);
80855     __Pyx_XDECREF(__pyx_save_exc_tb);
80856     goto __pyx_L1_error;
80857     __pyx_L6_except_return:;
80858     __Pyx_XGIVEREF(__pyx_save_exc_type);
80859     __Pyx_XGIVEREF(__pyx_save_exc_value);
80860     __Pyx_XGIVEREF(__pyx_save_exc_tb);
80861     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
80862     goto __pyx_L0;
80863     __pyx_L4_exception_handled:;
80864     __Pyx_XGIVEREF(__pyx_save_exc_type);
80865     __Pyx_XGIVEREF(__pyx_save_exc_value);
80866     __Pyx_XGIVEREF(__pyx_save_exc_tb);
80867     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
80868     __pyx_L10_try_end:;
80869   }
80870
80871   __pyx_r = 0;
80872   goto __pyx_L0;
80873   __pyx_L1_error:;
80874   __Pyx_XDECREF(__pyx_t_2);
80875   __Pyx_XDECREF(__pyx_t_3);
80876   __Pyx_XDECREF(__pyx_t_4);
80877   __Pyx_WriteUnraisable("lxml.etree._FilelikeWriter.close");
80878   __pyx_r = 0;
80879   __pyx_L0:;
80880   __Pyx_FinishRefcountContext();
80881   return __pyx_r;
80882 }
80883
80884 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":353
80885  *             return -1
80886  * 
80887  * cdef int _writeFilelikeWriter(void* ctxt, char* c_buffer, int len):             # <<<<<<<<<<<<<<
80888  *     return (<_FilelikeWriter>ctxt).write(c_buffer, len)
80889  * 
80890  */
80891
80892 static  int __pyx_f_4lxml_5etree__writeFilelikeWriter(void *__pyx_v_ctxt, char *__pyx_v_c_buffer, int __pyx_v_len) {
80893   int __pyx_r;
80894   __Pyx_SetupRefcountContext("_writeFilelikeWriter");
80895
80896   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":354
80897  * 
80898  * cdef int _writeFilelikeWriter(void* ctxt, char* c_buffer, int len):
80899  *     return (<_FilelikeWriter>ctxt).write(c_buffer, len)             # <<<<<<<<<<<<<<
80900  * 
80901  * cdef int _closeFilelikeWriter(void* ctxt):
80902  */
80903   __pyx_r = ((struct __pyx_vtabstruct_4lxml_5etree__FilelikeWriter *)((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_v_ctxt)->__pyx_vtab)->write(((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_v_ctxt), __pyx_v_c_buffer, __pyx_v_len);
80904   goto __pyx_L0;
80905
80906   __pyx_r = 0;
80907   __pyx_L0:;
80908   __Pyx_FinishRefcountContext();
80909   return __pyx_r;
80910 }
80911
80912 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":356
80913  *     return (<_FilelikeWriter>ctxt).write(c_buffer, len)
80914  * 
80915  * cdef int _closeFilelikeWriter(void* ctxt):             # <<<<<<<<<<<<<<
80916  *     return (<_FilelikeWriter>ctxt).close()
80917  * 
80918  */
80919
80920 static  int __pyx_f_4lxml_5etree__closeFilelikeWriter(void *__pyx_v_ctxt) {
80921   int __pyx_r;
80922   __Pyx_SetupRefcountContext("_closeFilelikeWriter");
80923
80924   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":357
80925  * 
80926  * cdef int _closeFilelikeWriter(void* ctxt):
80927  *     return (<_FilelikeWriter>ctxt).close()             # <<<<<<<<<<<<<<
80928  * 
80929  * cdef _tofilelike(f, _Element element, encoding, method,
80930  */
80931   __pyx_r = ((struct __pyx_vtabstruct_4lxml_5etree__FilelikeWriter *)((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_v_ctxt)->__pyx_vtab)->close(((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_v_ctxt));
80932   goto __pyx_L0;
80933
80934   __pyx_r = 0;
80935   __pyx_L0:;
80936   __Pyx_FinishRefcountContext();
80937   return __pyx_r;
80938 }
80939
80940 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":359
80941  *     return (<_FilelikeWriter>ctxt).close()
80942  * 
80943  * cdef _tofilelike(f, _Element element, encoding, method,             # <<<<<<<<<<<<<<
80944  *                  bint write_xml_declaration, bint write_doctype,
80945  *                  bint pretty_print, bint with_tail, int standalone,
80946  */
80947
80948 static  PyObject *__pyx_f_4lxml_5etree__tofilelike(PyObject *__pyx_v_f, struct LxmlElement *__pyx_v_element, PyObject *__pyx_v_encoding, PyObject *__pyx_v_method, int __pyx_v_write_xml_declaration, int __pyx_v_write_doctype, int __pyx_v_pretty_print, int __pyx_v_with_tail, int __pyx_v_standalone, int __pyx_v_compression) {
80949   PyThreadState *__pyx_v_state;
80950   struct __pyx_obj_4lxml_5etree__FilelikeWriter *__pyx_v_writer;
80951   xmlOutputBuffer *__pyx_v_c_buffer;
80952   xmlCharEncodingHandler *__pyx_v_enchandler;
80953   char *__pyx_v_c_enc;
80954   int __pyx_v_error_result;
80955   PyObject *__pyx_v_c_method;
80956   PyObject *__pyx_v_data;
80957   PyObject *__pyx_v_bytes_out;
80958   PyObject *__pyx_v_gzip_file;
80959   PyObject *__pyx_v_filename8;
80960   PyObject *__pyx_r = NULL;
80961   PyObject *__pyx_1 = 0;
80962   int __pyx_t_1;
80963   PyObject *__pyx_t_2 = NULL;
80964   int __pyx_t_3;
80965   PyObject *__pyx_t_4 = NULL;
80966   PyObject *__pyx_t_5 = NULL;
80967   xmlOutputBuffer *__pyx_t_6;
80968   __Pyx_SetupRefcountContext("_tofilelike");
80969   __Pyx_INCREF(__pyx_v_f);
80970   __Pyx_INCREF(__pyx_v_encoding);
80971   __pyx_v_writer = ((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)Py_None); __Pyx_INCREF(Py_None);
80972   __pyx_v_c_method = Py_None; __Pyx_INCREF(Py_None);
80973   __pyx_v_data = Py_None; __Pyx_INCREF(Py_None);
80974   __pyx_v_bytes_out = Py_None; __Pyx_INCREF(Py_None);
80975   __pyx_v_gzip_file = Py_None; __Pyx_INCREF(Py_None);
80976   __pyx_v_filename8 = Py_None; __Pyx_INCREF(Py_None);
80977
80978   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":363
80979  *                  bint pretty_print, bint with_tail, int standalone,
80980  *                  int compression):
80981  *     cdef python.PyThreadState* state = NULL             # <<<<<<<<<<<<<<
80982  *     cdef _FilelikeWriter writer
80983  *     cdef tree.xmlOutputBuffer* c_buffer
80984  */
80985   __pyx_v_state = NULL;
80986
80987   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":369
80988  *     cdef char* c_enc
80989  *     cdef int error_result
80990  *     if encoding is None:             # <<<<<<<<<<<<<<
80991  *         c_enc = NULL
80992  *     else:
80993  */
80994   __pyx_t_1 = (__pyx_v_encoding == Py_None);
80995   if (__pyx_t_1) {
80996
80997     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":370
80998  *     cdef int error_result
80999  *     if encoding is None:
81000  *         c_enc = NULL             # <<<<<<<<<<<<<<
81001  *     else:
81002  *         encoding = _utf8(encoding)
81003  */
81004     __pyx_v_c_enc = NULL;
81005     goto __pyx_L3;
81006   }
81007   /*else*/ {
81008
81009     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":372
81010  *         c_enc = NULL
81011  *     else:
81012  *         encoding = _utf8(encoding)             # <<<<<<<<<<<<<<
81013  *         c_enc = _cstr(encoding)
81014  *     c_method = _findOutputMethod(method)
81015  */
81016     __pyx_t_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_encoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81017     __Pyx_GOTREF(__pyx_t_2);
81018     __Pyx_DECREF(__pyx_v_encoding);
81019     __pyx_v_encoding = __pyx_t_2;
81020     __pyx_t_2 = 0;
81021
81022     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":373
81023  *     else:
81024  *         encoding = _utf8(encoding)
81025  *         c_enc = _cstr(encoding)             # <<<<<<<<<<<<<<
81026  *     c_method = _findOutputMethod(method)
81027  *     if c_method == OUTPUT_METHOD_TEXT:
81028  */
81029     __pyx_v_c_enc = PyString_AS_STRING(__pyx_v_encoding);
81030   }
81031   __pyx_L3:;
81032
81033   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":374
81034  *         encoding = _utf8(encoding)
81035  *         c_enc = _cstr(encoding)
81036  *     c_method = _findOutputMethod(method)             # <<<<<<<<<<<<<<
81037  *     if c_method == OUTPUT_METHOD_TEXT:
81038  *         data = _textToString(element._c_node, encoding, with_tail)
81039  */
81040   __pyx_t_3 = __pyx_f_4lxml_5etree__findOutputMethod(__pyx_v_method); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81041   __pyx_t_2 = PyInt_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81042   __Pyx_GOTREF(__pyx_t_2);
81043   __Pyx_DECREF(__pyx_v_c_method);
81044   __pyx_v_c_method = __pyx_t_2;
81045   __pyx_t_2 = 0;
81046
81047   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":375
81048  *         c_enc = _cstr(encoding)
81049  *     c_method = _findOutputMethod(method)
81050  *     if c_method == OUTPUT_METHOD_TEXT:             # <<<<<<<<<<<<<<
81051  *         data = _textToString(element._c_node, encoding, with_tail)
81052  *         if compression:
81053  */
81054   __pyx_t_2 = PyInt_FromLong(__pyx_e_4lxml_5etree_OUTPUT_METHOD_TEXT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81055   __Pyx_GOTREF(__pyx_t_2);
81056   __pyx_t_4 = PyObject_RichCompare(__pyx_v_c_method, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81057   __Pyx_GOTREF(__pyx_t_4);
81058   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
81059   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81060   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
81061   if (__pyx_t_1) {
81062
81063     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":376
81064  *     c_method = _findOutputMethod(method)
81065  *     if c_method == OUTPUT_METHOD_TEXT:
81066  *         data = _textToString(element._c_node, encoding, with_tail)             # <<<<<<<<<<<<<<
81067  *         if compression:
81068  *             bytes_out = BytesIO()
81069  */
81070     __pyx_t_4 = __pyx_f_4lxml_5etree__textToString(__pyx_v_element->_c_node, __pyx_v_encoding, __pyx_v_with_tail); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81071     __Pyx_GOTREF(__pyx_t_4);
81072     __Pyx_DECREF(__pyx_v_data);
81073     __pyx_v_data = __pyx_t_4;
81074     __pyx_t_4 = 0;
81075
81076     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":377
81077  *     if c_method == OUTPUT_METHOD_TEXT:
81078  *         data = _textToString(element._c_node, encoding, with_tail)
81079  *         if compression:             # <<<<<<<<<<<<<<
81080  *             bytes_out = BytesIO()
81081  *             gzip_file = gzip.GzipFile(
81082  */
81083     __pyx_t_3 = __pyx_v_compression;
81084     if (__pyx_t_3) {
81085
81086       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":378
81087  *         data = _textToString(element._c_node, encoding, with_tail)
81088  *         if compression:
81089  *             bytes_out = BytesIO()             # <<<<<<<<<<<<<<
81090  *             gzip_file = gzip.GzipFile(
81091  *                 fileobj=bytes_out, mode=u'wb', compresslevel=compression)
81092  */
81093       __pyx_t_4 = PyObject_Call(__pyx_v_4lxml_5etree_BytesIO, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81094       __Pyx_GOTREF(__pyx_t_4);
81095       __Pyx_DECREF(__pyx_v_bytes_out);
81096       __pyx_v_bytes_out = __pyx_t_4;
81097       __pyx_t_4 = 0;
81098
81099       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":379
81100  *         if compression:
81101  *             bytes_out = BytesIO()
81102  *             gzip_file = gzip.GzipFile(             # <<<<<<<<<<<<<<
81103  *                 fileobj=bytes_out, mode=u'wb', compresslevel=compression)
81104  *             try:
81105  */
81106       __pyx_t_4 = PyObject_GetAttr(__pyx_v_4lxml_5etree_gzip, __pyx_kp_GzipFile); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81107       __Pyx_GOTREF(__pyx_t_4);
81108       __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81109       __Pyx_GOTREF(((PyObject *)__pyx_1));
81110
81111       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":380
81112  *             bytes_out = BytesIO()
81113  *             gzip_file = gzip.GzipFile(
81114  *                 fileobj=bytes_out, mode=u'wb', compresslevel=compression)             # <<<<<<<<<<<<<<
81115  *             try:
81116  *                 gzip_file.write(data)
81117  */
81118       if (PyDict_SetItem(__pyx_1, __pyx_kp_fileobj, __pyx_v_bytes_out) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81119       if (PyDict_SetItem(__pyx_1, __pyx_kp_mode, ((PyObject *)__pyx_kp_506)) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81120       __pyx_t_2 = PyInt_FromLong(__pyx_v_compression); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81121       __Pyx_GOTREF(__pyx_t_2);
81122       if (PyDict_SetItem(__pyx_1, __pyx_kp_compresslevel, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81123       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
81124       __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81125       __Pyx_GOTREF(__pyx_t_2);
81126       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
81127       __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
81128       __Pyx_DECREF(__pyx_v_gzip_file);
81129       __pyx_v_gzip_file = __pyx_t_2;
81130       __pyx_t_2 = 0;
81131
81132       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":381
81133  *             gzip_file = gzip.GzipFile(
81134  *                 fileobj=bytes_out, mode=u'wb', compresslevel=compression)
81135  *             try:             # <<<<<<<<<<<<<<
81136  *                 gzip_file.write(data)
81137  *             finally:
81138  */
81139       /*try:*/ {
81140
81141         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":382
81142  *                 fileobj=bytes_out, mode=u'wb', compresslevel=compression)
81143  *             try:
81144  *                 gzip_file.write(data)             # <<<<<<<<<<<<<<
81145  *             finally:
81146  *                 gzip_file.close()
81147  */
81148         __pyx_t_2 = PyObject_GetAttr(__pyx_v_gzip_file, __pyx_kp_write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L7;}
81149         __Pyx_GOTREF(__pyx_t_2);
81150         __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L7;}
81151         __Pyx_GOTREF(((PyObject *)__pyx_t_4));
81152         __Pyx_INCREF(__pyx_v_data);
81153         PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_data);
81154         __Pyx_GIVEREF(__pyx_v_data);
81155         __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L7;}
81156         __Pyx_GOTREF(__pyx_t_5);
81157         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
81158         __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
81159         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
81160       }
81161       /*finally:*/ {
81162         int __pyx_why;
81163         PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
81164         int __pyx_exc_lineno;
81165         __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
81166         __pyx_why = 0; goto __pyx_L8;
81167         __pyx_L7: {
81168           __pyx_why = 4;
81169           __Pyx_XDECREF(__pyx_1); __pyx_1 = 0;
81170           __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
81171           __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
81172           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
81173           __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
81174           __pyx_exc_lineno = __pyx_lineno;
81175           goto __pyx_L8;
81176         }
81177         __pyx_L8:;
81178
81179         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":384
81180  *                 gzip_file.write(data)
81181  *             finally:
81182  *                 gzip_file.close()             # <<<<<<<<<<<<<<
81183  *             data = bytes_out
81184  *         if _isString(f):
81185  */
81186         __pyx_t_5 = PyObject_GetAttr(__pyx_v_gzip_file, __pyx_kp_close); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
81187         __Pyx_GOTREF(__pyx_t_5);
81188         __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
81189         __Pyx_GOTREF(__pyx_t_4);
81190         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
81191         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
81192         goto __pyx_L10;
81193         __pyx_L9_error:;
81194         if (__pyx_why == 4) {
81195           Py_XDECREF(__pyx_exc_type);
81196           Py_XDECREF(__pyx_exc_value);
81197           Py_XDECREF(__pyx_exc_tb);
81198         }
81199         goto __pyx_L1_error;
81200         __pyx_L10:;
81201         switch (__pyx_why) {
81202           case 4: {
81203             __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
81204             __pyx_lineno = __pyx_exc_lineno;
81205             __pyx_exc_type = 0;
81206             __pyx_exc_value = 0;
81207             __pyx_exc_tb = 0;
81208             goto __pyx_L1_error;
81209           }
81210         }
81211       }
81212
81213       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":385
81214  *             finally:
81215  *                 gzip_file.close()
81216  *             data = bytes_out             # <<<<<<<<<<<<<<
81217  *         if _isString(f):
81218  *             filename8 = _encodeFilename(f)
81219  */
81220       __Pyx_INCREF(__pyx_v_bytes_out);
81221       __Pyx_DECREF(__pyx_v_data);
81222       __pyx_v_data = __pyx_v_bytes_out;
81223       goto __pyx_L5;
81224     }
81225     __pyx_L5:;
81226
81227     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":386
81228  *                 gzip_file.close()
81229  *             data = bytes_out
81230  *         if _isString(f):             # <<<<<<<<<<<<<<
81231  *             filename8 = _encodeFilename(f)
81232  *             f = open(filename8, u'wb')
81233  */
81234     __pyx_t_1 = _isString(__pyx_v_f);
81235     if (__pyx_t_1) {
81236
81237       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":387
81238  *             data = bytes_out
81239  *         if _isString(f):
81240  *             filename8 = _encodeFilename(f)             # <<<<<<<<<<<<<<
81241  *             f = open(filename8, u'wb')
81242  *             try:
81243  */
81244       __pyx_t_4 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_f); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81245       __Pyx_GOTREF(__pyx_t_4);
81246       __Pyx_DECREF(__pyx_v_filename8);
81247       __pyx_v_filename8 = __pyx_t_4;
81248       __pyx_t_4 = 0;
81249
81250       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":388
81251  *         if _isString(f):
81252  *             filename8 = _encodeFilename(f)
81253  *             f = open(filename8, u'wb')             # <<<<<<<<<<<<<<
81254  *             try:
81255  *                 f.write(data)
81256  */
81257       __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81258       __Pyx_GOTREF(((PyObject *)__pyx_t_4));
81259       __Pyx_INCREF(__pyx_v_filename8);
81260       PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_filename8);
81261       __Pyx_GIVEREF(__pyx_v_filename8);
81262       __Pyx_INCREF(((PyObject *)__pyx_kp_507));
81263       PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_kp_507));
81264       __Pyx_GIVEREF(((PyObject *)__pyx_kp_507));
81265       __pyx_t_5 = PyObject_Call(__pyx_builtin_open, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81266       __Pyx_GOTREF(__pyx_t_5);
81267       __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
81268       __Pyx_DECREF(__pyx_v_f);
81269       __pyx_v_f = __pyx_t_5;
81270       __pyx_t_5 = 0;
81271
81272       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":389
81273  *             filename8 = _encodeFilename(f)
81274  *             f = open(filename8, u'wb')
81275  *             try:             # <<<<<<<<<<<<<<
81276  *                 f.write(data)
81277  *             finally:
81278  */
81279       /*try:*/ {
81280
81281         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":390
81282  *             f = open(filename8, u'wb')
81283  *             try:
81284  *                 f.write(data)             # <<<<<<<<<<<<<<
81285  *             finally:
81286  *                 f.close()
81287  */
81288         __pyx_t_5 = PyObject_GetAttr(__pyx_v_f, __pyx_kp_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L13;}
81289         __Pyx_GOTREF(__pyx_t_5);
81290         __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L13;}
81291         __Pyx_GOTREF(((PyObject *)__pyx_t_4));
81292         __Pyx_INCREF(__pyx_v_data);
81293         PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_data);
81294         __Pyx_GIVEREF(__pyx_v_data);
81295         __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L13;}
81296         __Pyx_GOTREF(__pyx_t_2);
81297         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
81298         __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
81299         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
81300       }
81301       /*finally:*/ {
81302         int __pyx_why;
81303         PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
81304         int __pyx_exc_lineno;
81305         __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
81306         __pyx_why = 0; goto __pyx_L14;
81307         __pyx_L13: {
81308           __pyx_why = 4;
81309           __Pyx_XDECREF(__pyx_1); __pyx_1 = 0;
81310           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
81311           __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
81312           __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
81313           __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
81314           __pyx_exc_lineno = __pyx_lineno;
81315           goto __pyx_L14;
81316         }
81317         __pyx_L14:;
81318
81319         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":392
81320  *                 f.write(data)
81321  *             finally:
81322  *                 f.close()             # <<<<<<<<<<<<<<
81323  *         else:
81324  *             f.write(data)
81325  */
81326         __pyx_t_2 = PyObject_GetAttr(__pyx_v_f, __pyx_kp_close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
81327         __Pyx_GOTREF(__pyx_t_2);
81328         __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
81329         __Pyx_GOTREF(__pyx_t_4);
81330         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
81331         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
81332         goto __pyx_L16;
81333         __pyx_L15_error:;
81334         if (__pyx_why == 4) {
81335           Py_XDECREF(__pyx_exc_type);
81336           Py_XDECREF(__pyx_exc_value);
81337           Py_XDECREF(__pyx_exc_tb);
81338         }
81339         goto __pyx_L1_error;
81340         __pyx_L16:;
81341         switch (__pyx_why) {
81342           case 4: {
81343             __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
81344             __pyx_lineno = __pyx_exc_lineno;
81345             __pyx_exc_type = 0;
81346             __pyx_exc_value = 0;
81347             __pyx_exc_tb = 0;
81348             goto __pyx_L1_error;
81349           }
81350         }
81351       }
81352       goto __pyx_L11;
81353     }
81354     /*else*/ {
81355
81356       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":394
81357  *                 f.close()
81358  *         else:
81359  *             f.write(data)             # <<<<<<<<<<<<<<
81360  *         return
81361  *     enchandler = tree.xmlFindCharEncodingHandler(c_enc)
81362  */
81363       __pyx_t_4 = PyObject_GetAttr(__pyx_v_f, __pyx_kp_write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81364       __Pyx_GOTREF(__pyx_t_4);
81365       __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81366       __Pyx_GOTREF(((PyObject *)__pyx_t_2));
81367       __Pyx_INCREF(__pyx_v_data);
81368       PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data);
81369       __Pyx_GIVEREF(__pyx_v_data);
81370       __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81371       __Pyx_GOTREF(__pyx_t_5);
81372       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
81373       __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
81374       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
81375     }
81376     __pyx_L11:;
81377
81378     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":395
81379  *         else:
81380  *             f.write(data)
81381  *         return             # <<<<<<<<<<<<<<
81382  *     enchandler = tree.xmlFindCharEncodingHandler(c_enc)
81383  *     if enchandler is NULL:
81384  */
81385     __Pyx_XDECREF(__pyx_r);
81386     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
81387     goto __pyx_L0;
81388     goto __pyx_L4;
81389   }
81390   __pyx_L4:;
81391
81392   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":396
81393  *             f.write(data)
81394  *         return
81395  *     enchandler = tree.xmlFindCharEncodingHandler(c_enc)             # <<<<<<<<<<<<<<
81396  *     if enchandler is NULL:
81397  *         if encoding is not None:
81398  */
81399   __pyx_v_enchandler = xmlFindCharEncodingHandler(__pyx_v_c_enc);
81400
81401   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":397
81402  *         return
81403  *     enchandler = tree.xmlFindCharEncodingHandler(c_enc)
81404  *     if enchandler is NULL:             # <<<<<<<<<<<<<<
81405  *         if encoding is not None:
81406  *             encoding = encoding.decode(u'UTF-8')
81407  */
81408   __pyx_t_1 = (__pyx_v_enchandler == NULL);
81409   if (__pyx_t_1) {
81410
81411     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":398
81412  *     enchandler = tree.xmlFindCharEncodingHandler(c_enc)
81413  *     if enchandler is NULL:
81414  *         if encoding is not None:             # <<<<<<<<<<<<<<
81415  *             encoding = encoding.decode(u'UTF-8')
81416  *         raise LookupError, u"unknown encoding: '%s'" % encoding
81417  */
81418     __pyx_t_1 = (__pyx_v_encoding != Py_None);
81419     if (__pyx_t_1) {
81420
81421       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":399
81422  *     if enchandler is NULL:
81423  *         if encoding is not None:
81424  *             encoding = encoding.decode(u'UTF-8')             # <<<<<<<<<<<<<<
81425  *         raise LookupError, u"unknown encoding: '%s'" % encoding
81426  * 
81427  */
81428       __pyx_t_5 = PyObject_GetAttr(__pyx_v_encoding, __pyx_kp_decode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81429       __Pyx_GOTREF(__pyx_t_5);
81430       __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81431       __Pyx_GOTREF(((PyObject *)__pyx_t_2));
81432       __Pyx_INCREF(((PyObject *)__pyx_kp_508));
81433       PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_508));
81434       __Pyx_GIVEREF(((PyObject *)__pyx_kp_508));
81435       __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81436       __Pyx_GOTREF(__pyx_t_4);
81437       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
81438       __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
81439       __Pyx_DECREF(__pyx_v_encoding);
81440       __pyx_v_encoding = __pyx_t_4;
81441       __pyx_t_4 = 0;
81442       goto __pyx_L18;
81443     }
81444     __pyx_L18:;
81445
81446     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":400
81447  *         if encoding is not None:
81448  *             encoding = encoding.decode(u'UTF-8')
81449  *         raise LookupError, u"unknown encoding: '%s'" % encoding             # <<<<<<<<<<<<<<
81450  * 
81451  *     if _isString(f):
81452  */
81453     __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_509), __pyx_v_encoding); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81454     __Pyx_GOTREF(__pyx_t_4);
81455     __Pyx_Raise(__pyx_builtin_LookupError, __pyx_t_4, 0);
81456     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
81457     {__pyx_filename = __pyx_f[3]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81458     goto __pyx_L17;
81459   }
81460   __pyx_L17:;
81461
81462   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":402
81463  *         raise LookupError, u"unknown encoding: '%s'" % encoding
81464  * 
81465  *     if _isString(f):             # <<<<<<<<<<<<<<
81466  *         filename8 = _encodeFilename(f)
81467  *         c_buffer = tree.xmlOutputBufferCreateFilename(
81468  */
81469   __pyx_t_1 = _isString(__pyx_v_f);
81470   if (__pyx_t_1) {
81471
81472     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":403
81473  * 
81474  *     if _isString(f):
81475  *         filename8 = _encodeFilename(f)             # <<<<<<<<<<<<<<
81476  *         c_buffer = tree.xmlOutputBufferCreateFilename(
81477  *             _cstr(filename8), enchandler, compression)
81478  */
81479     __pyx_t_4 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_f); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81480     __Pyx_GOTREF(__pyx_t_4);
81481     __Pyx_DECREF(__pyx_v_filename8);
81482     __pyx_v_filename8 = __pyx_t_4;
81483     __pyx_t_4 = 0;
81484
81485     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":405
81486  *         filename8 = _encodeFilename(f)
81487  *         c_buffer = tree.xmlOutputBufferCreateFilename(
81488  *             _cstr(filename8), enchandler, compression)             # <<<<<<<<<<<<<<
81489  *         if c_buffer is NULL:
81490  *             return python.PyErr_SetFromErrno(IOError)
81491  */
81492     __pyx_v_c_buffer = xmlOutputBufferCreateFilename(PyString_AS_STRING(__pyx_v_filename8), __pyx_v_enchandler, __pyx_v_compression);
81493
81494     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":406
81495  *         c_buffer = tree.xmlOutputBufferCreateFilename(
81496  *             _cstr(filename8), enchandler, compression)
81497  *         if c_buffer is NULL:             # <<<<<<<<<<<<<<
81498  *             return python.PyErr_SetFromErrno(IOError)
81499  *         state = python.PyEval_SaveThread()
81500  */
81501     __pyx_t_1 = (__pyx_v_c_buffer == NULL);
81502     if (__pyx_t_1) {
81503
81504       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":407
81505  *             _cstr(filename8), enchandler, compression)
81506  *         if c_buffer is NULL:
81507  *             return python.PyErr_SetFromErrno(IOError)             # <<<<<<<<<<<<<<
81508  *         state = python.PyEval_SaveThread()
81509  *     elif hasattr(f, u'write'):
81510  */
81511       __Pyx_XDECREF(__pyx_r);
81512       __pyx_t_4 = PyErr_SetFromErrno(__pyx_builtin_IOError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81513       __Pyx_GOTREF(__pyx_t_4);
81514       __pyx_r = __pyx_t_4;
81515       __pyx_t_4 = 0;
81516       goto __pyx_L0;
81517       goto __pyx_L20;
81518     }
81519     __pyx_L20:;
81520
81521     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":408
81522  *         if c_buffer is NULL:
81523  *             return python.PyErr_SetFromErrno(IOError)
81524  *         state = python.PyEval_SaveThread()             # <<<<<<<<<<<<<<
81525  *     elif hasattr(f, u'write'):
81526  *         writer   = _FilelikeWriter(f, compression=compression)
81527  */
81528     __pyx_v_state = PyEval_SaveThread();
81529     goto __pyx_L19;
81530   }
81531
81532   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":409
81533  *             return python.PyErr_SetFromErrno(IOError)
81534  *         state = python.PyEval_SaveThread()
81535  *     elif hasattr(f, u'write'):             # <<<<<<<<<<<<<<
81536  *         writer   = _FilelikeWriter(f, compression=compression)
81537  *         c_buffer = writer._createOutputBuffer(enchandler)
81538  */
81539   __pyx_t_1 = PyObject_HasAttr(__pyx_v_f, ((PyObject *)__pyx_kp_510)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81540   if (__pyx_t_1) {
81541
81542     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":410
81543  *         state = python.PyEval_SaveThread()
81544  *     elif hasattr(f, u'write'):
81545  *         writer   = _FilelikeWriter(f, compression=compression)             # <<<<<<<<<<<<<<
81546  *         c_buffer = writer._createOutputBuffer(enchandler)
81547  *     else:
81548  */
81549     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81550     __Pyx_GOTREF(((PyObject *)__pyx_t_4));
81551     __Pyx_INCREF(__pyx_v_f);
81552     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_f);
81553     __Pyx_GIVEREF(__pyx_v_f);
81554     __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81555     __Pyx_GOTREF(((PyObject *)__pyx_1));
81556     __pyx_t_2 = PyInt_FromLong(__pyx_v_compression); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81557     __Pyx_GOTREF(__pyx_t_2);
81558     if (PyDict_SetItem(__pyx_1, __pyx_kp_compression, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81559     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
81560     __pyx_t_2 = PyEval_CallObjectWithKeywords(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__FilelikeWriter)), ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81561     __Pyx_GOTREF(__pyx_t_2);
81562     __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
81563     __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
81564     if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__FilelikeWriter))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81565     __Pyx_DECREF(((PyObject *)__pyx_v_writer));
81566     __pyx_v_writer = ((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_t_2);
81567     __pyx_t_2 = 0;
81568
81569     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":411
81570  *     elif hasattr(f, u'write'):
81571  *         writer   = _FilelikeWriter(f, compression=compression)
81572  *         c_buffer = writer._createOutputBuffer(enchandler)             # <<<<<<<<<<<<<<
81573  *     else:
81574  *         tree.xmlCharEncCloseFunc(enchandler)
81575  */
81576     __pyx_t_6 = ((struct __pyx_vtabstruct_4lxml_5etree__FilelikeWriter *)__pyx_v_writer->__pyx_vtab)->_createOutputBuffer(__pyx_v_writer, __pyx_v_enchandler); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81577     __pyx_v_c_buffer = __pyx_t_6;
81578     goto __pyx_L19;
81579   }
81580   /*else*/ {
81581
81582     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":413
81583  *         c_buffer = writer._createOutputBuffer(enchandler)
81584  *     else:
81585  *         tree.xmlCharEncCloseFunc(enchandler)             # <<<<<<<<<<<<<<
81586  *         raise TypeError, \
81587  *             u"File or filename expected, got '%s'" % funicode(python._fqtypename(f))
81588  */
81589     xmlCharEncCloseFunc(__pyx_v_enchandler);
81590
81591     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":415
81592  *         tree.xmlCharEncCloseFunc(enchandler)
81593  *         raise TypeError, \
81594  *             u"File or filename expected, got '%s'" % funicode(python._fqtypename(f))             # <<<<<<<<<<<<<<
81595  * 
81596  *     _writeNodeToBuffer(c_buffer, element._c_node, c_enc, c_method,
81597  */
81598     __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(_fqtypename(__pyx_v_f)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81599     __Pyx_GOTREF(__pyx_t_2);
81600     __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_511), __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81601     __Pyx_GOTREF(__pyx_t_4);
81602     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
81603     __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_4, 0);
81604     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
81605     {__pyx_filename = __pyx_f[3]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81606   }
81607   __pyx_L19:;
81608
81609   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":417
81610  *             u"File or filename expected, got '%s'" % funicode(python._fqtypename(f))
81611  * 
81612  *     _writeNodeToBuffer(c_buffer, element._c_node, c_enc, c_method,             # <<<<<<<<<<<<<<
81613  *                        write_xml_declaration, write_doctype,
81614  *                        pretty_print, with_tail, standalone)
81615  */
81616   __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_v_c_method); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81617
81618   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":419
81619  *     _writeNodeToBuffer(c_buffer, element._c_node, c_enc, c_method,
81620  *                        write_xml_declaration, write_doctype,
81621  *                        pretty_print, with_tail, standalone)             # <<<<<<<<<<<<<<
81622  *     error_result = c_buffer.error
81623  *     if error_result == xmlerror.XML_ERR_OK:
81624  */
81625   __pyx_f_4lxml_5etree__writeNodeToBuffer(__pyx_v_c_buffer, __pyx_v_element->_c_node, __pyx_v_c_enc, __pyx_t_3, __pyx_v_write_xml_declaration, __pyx_v_write_doctype, __pyx_v_pretty_print, __pyx_v_with_tail, __pyx_v_standalone);
81626
81627   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":420
81628  *                        write_xml_declaration, write_doctype,
81629  *                        pretty_print, with_tail, standalone)
81630  *     error_result = c_buffer.error             # <<<<<<<<<<<<<<
81631  *     if error_result == xmlerror.XML_ERR_OK:
81632  *         error_result = tree.xmlOutputBufferClose(c_buffer)
81633  */
81634   __pyx_v_error_result = __pyx_v_c_buffer->error;
81635
81636   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":421
81637  *                        pretty_print, with_tail, standalone)
81638  *     error_result = c_buffer.error
81639  *     if error_result == xmlerror.XML_ERR_OK:             # <<<<<<<<<<<<<<
81640  *         error_result = tree.xmlOutputBufferClose(c_buffer)
81641  *         if error_result > 0:
81642  */
81643   __pyx_t_1 = (__pyx_v_error_result == XML_ERR_OK);
81644   if (__pyx_t_1) {
81645
81646     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":422
81647  *     error_result = c_buffer.error
81648  *     if error_result == xmlerror.XML_ERR_OK:
81649  *         error_result = tree.xmlOutputBufferClose(c_buffer)             # <<<<<<<<<<<<<<
81650  *         if error_result > 0:
81651  *             error_result = xmlerror.XML_ERR_OK
81652  */
81653     __pyx_v_error_result = xmlOutputBufferClose(__pyx_v_c_buffer);
81654
81655     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":423
81656  *     if error_result == xmlerror.XML_ERR_OK:
81657  *         error_result = tree.xmlOutputBufferClose(c_buffer)
81658  *         if error_result > 0:             # <<<<<<<<<<<<<<
81659  *             error_result = xmlerror.XML_ERR_OK
81660  *     else:
81661  */
81662     __pyx_t_1 = (__pyx_v_error_result > 0);
81663     if (__pyx_t_1) {
81664
81665       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":424
81666  *         error_result = tree.xmlOutputBufferClose(c_buffer)
81667  *         if error_result > 0:
81668  *             error_result = xmlerror.XML_ERR_OK             # <<<<<<<<<<<<<<
81669  *     else:
81670  *         tree.xmlOutputBufferClose(c_buffer)
81671  */
81672       __pyx_v_error_result = XML_ERR_OK;
81673       goto __pyx_L22;
81674     }
81675     __pyx_L22:;
81676     goto __pyx_L21;
81677   }
81678   /*else*/ {
81679
81680     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":426
81681  *             error_result = xmlerror.XML_ERR_OK
81682  *     else:
81683  *         tree.xmlOutputBufferClose(c_buffer)             # <<<<<<<<<<<<<<
81684  *     if writer is None:
81685  *         python.PyEval_RestoreThread(state)
81686  */
81687     xmlOutputBufferClose(__pyx_v_c_buffer);
81688   }
81689   __pyx_L21:;
81690
81691   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":427
81692  *     else:
81693  *         tree.xmlOutputBufferClose(c_buffer)
81694  *     if writer is None:             # <<<<<<<<<<<<<<
81695  *         python.PyEval_RestoreThread(state)
81696  *     else:
81697  */
81698   __pyx_t_1 = (((PyObject *)__pyx_v_writer) == Py_None);
81699   if (__pyx_t_1) {
81700
81701     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":428
81702  *         tree.xmlOutputBufferClose(c_buffer)
81703  *     if writer is None:
81704  *         python.PyEval_RestoreThread(state)             # <<<<<<<<<<<<<<
81705  *     else:
81706  *         writer._exc_context._raise_if_stored()
81707  */
81708     PyEval_RestoreThread(__pyx_v_state);
81709     goto __pyx_L23;
81710   }
81711   /*else*/ {
81712
81713     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":430
81714  *         python.PyEval_RestoreThread(state)
81715  *     else:
81716  *         writer._exc_context._raise_if_stored()             # <<<<<<<<<<<<<<
81717  *     if error_result != xmlerror.XML_ERR_OK:
81718  *         _raiseSerialisationError(error_result)
81719  */
81720     __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_writer->_exc_context->__pyx_vtab)->_raise_if_stored(__pyx_v_writer->_exc_context); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81721   }
81722   __pyx_L23:;
81723
81724   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":431
81725  *     else:
81726  *         writer._exc_context._raise_if_stored()
81727  *     if error_result != xmlerror.XML_ERR_OK:             # <<<<<<<<<<<<<<
81728  *         _raiseSerialisationError(error_result)
81729  * 
81730  */
81731   __pyx_t_1 = (__pyx_v_error_result != XML_ERR_OK);
81732   if (__pyx_t_1) {
81733
81734     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":432
81735  *         writer._exc_context._raise_if_stored()
81736  *     if error_result != xmlerror.XML_ERR_OK:
81737  *         _raiseSerialisationError(error_result)             # <<<<<<<<<<<<<<
81738  * 
81739  * cdef _tofilelikeC14N(f, _Element element, bint exclusive, bint with_comments,
81740  */
81741     __pyx_t_4 = __pyx_f_4lxml_5etree__raiseSerialisationError(__pyx_v_error_result); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81742     __Pyx_GOTREF(__pyx_t_4);
81743     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
81744     goto __pyx_L24;
81745   }
81746   __pyx_L24:;
81747
81748   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
81749   goto __pyx_L0;
81750   __pyx_L1_error:;
81751   __Pyx_XDECREF(__pyx_1);
81752   __Pyx_XDECREF(__pyx_t_2);
81753   __Pyx_XDECREF(__pyx_t_4);
81754   __Pyx_XDECREF(__pyx_t_5);
81755   __Pyx_AddTraceback("lxml.etree._tofilelike");
81756   __pyx_r = 0;
81757   __pyx_L0:;
81758   __Pyx_DECREF((PyObject *)__pyx_v_writer);
81759   __Pyx_DECREF(__pyx_v_c_method);
81760   __Pyx_DECREF(__pyx_v_data);
81761   __Pyx_DECREF(__pyx_v_bytes_out);
81762   __Pyx_DECREF(__pyx_v_gzip_file);
81763   __Pyx_DECREF(__pyx_v_filename8);
81764   __Pyx_DECREF(__pyx_v_f);
81765   __Pyx_DECREF(__pyx_v_encoding);
81766   __Pyx_XGIVEREF(__pyx_r);
81767   __Pyx_FinishRefcountContext();
81768   return __pyx_r;
81769 }
81770
81771 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":434
81772  *         _raiseSerialisationError(error_result)
81773  * 
81774  * cdef _tofilelikeC14N(f, _Element element, bint exclusive, bint with_comments,             # <<<<<<<<<<<<<<
81775  *                      int compression):
81776  *     cdef _FilelikeWriter writer
81777  */
81778
81779 static  PyObject *__pyx_f_4lxml_5etree__tofilelikeC14N(PyObject *__pyx_v_f, struct LxmlElement *__pyx_v_element, int __pyx_v_exclusive, int __pyx_v_with_comments, int __pyx_v_compression) {
81780   struct __pyx_obj_4lxml_5etree__FilelikeWriter *__pyx_v_writer;
81781   xmlOutputBuffer *__pyx_v_c_buffer;
81782   char *__pyx_v_c_filename;
81783   xmlDoc *__pyx_v_c_base_doc;
81784   xmlDoc *__pyx_v_c_doc;
81785   int __pyx_v_bytes;
81786   PyObject *__pyx_v_filename8;
81787   PyObject *__pyx_v_message;
81788   PyObject *__pyx_v_errors;
81789   PyObject *__pyx_r = NULL;
81790   PyObject *__pyx_1 = 0;
81791   xmlDoc *__pyx_t_1;
81792   int __pyx_t_2;
81793   PyObject *__pyx_t_3 = NULL;
81794   PyObject *__pyx_t_4 = NULL;
81795   xmlOutputBuffer *__pyx_t_5;
81796   int __pyx_t_6;
81797   Py_ssize_t __pyx_t_7;
81798   __Pyx_SetupRefcountContext("_tofilelikeC14N");
81799   __pyx_v_writer = ((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)Py_None); __Pyx_INCREF(Py_None);
81800   __pyx_v_filename8 = Py_None; __Pyx_INCREF(Py_None);
81801   __pyx_v_message = Py_None; __Pyx_INCREF(Py_None);
81802   __pyx_v_errors = Py_None; __Pyx_INCREF(Py_None);
81803
81804   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":441
81805  *     cdef xmlDoc* c_base_doc
81806  *     cdef xmlDoc* c_doc
81807  *     cdef int bytes = -1             # <<<<<<<<<<<<<<
81808  * 
81809  *     c_base_doc = element._c_node.doc
81810  */
81811   __pyx_v_bytes = -1;
81812
81813   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":443
81814  *     cdef int bytes = -1
81815  * 
81816  *     c_base_doc = element._c_node.doc             # <<<<<<<<<<<<<<
81817  *     c_doc = _fakeRootDoc(c_base_doc, element._c_node)
81818  *     try:
81819  */
81820   __pyx_v_c_base_doc = __pyx_v_element->_c_node->doc;
81821
81822   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":444
81823  * 
81824  *     c_base_doc = element._c_node.doc
81825  *     c_doc = _fakeRootDoc(c_base_doc, element._c_node)             # <<<<<<<<<<<<<<
81826  *     try:
81827  *         if _isString(f):
81828  */
81829   __pyx_t_1 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_c_base_doc, __pyx_v_element->_c_node); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
81830   __pyx_v_c_doc = __pyx_t_1;
81831
81832   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":445
81833  *     c_base_doc = element._c_node.doc
81834  *     c_doc = _fakeRootDoc(c_base_doc, element._c_node)
81835  *     try:             # <<<<<<<<<<<<<<
81836  *         if _isString(f):
81837  *             filename8 = _encodeFilename(f)
81838  */
81839   /*try:*/ {
81840
81841     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":446
81842  *     c_doc = _fakeRootDoc(c_base_doc, element._c_node)
81843  *     try:
81844  *         if _isString(f):             # <<<<<<<<<<<<<<
81845  *             filename8 = _encodeFilename(f)
81846  *             c_filename = _cstr(filename8)
81847  */
81848     __pyx_t_2 = _isString(__pyx_v_f);
81849     if (__pyx_t_2) {
81850
81851       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":447
81852  *     try:
81853  *         if _isString(f):
81854  *             filename8 = _encodeFilename(f)             # <<<<<<<<<<<<<<
81855  *             c_filename = _cstr(filename8)
81856  *             with nogil:
81857  */
81858       __pyx_t_3 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_f); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L4;}
81859       __Pyx_GOTREF(__pyx_t_3);
81860       __Pyx_DECREF(__pyx_v_filename8);
81861       __pyx_v_filename8 = __pyx_t_3;
81862       __pyx_t_3 = 0;
81863
81864       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":448
81865  *         if _isString(f):
81866  *             filename8 = _encodeFilename(f)
81867  *             c_filename = _cstr(filename8)             # <<<<<<<<<<<<<<
81868  *             with nogil:
81869  *                 bytes = c14n.xmlC14NDocSave(c_doc, NULL, exclusive, NULL,
81870  */
81871       __pyx_v_c_filename = PyString_AS_STRING(__pyx_v_filename8);
81872
81873       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":449
81874  *             filename8 = _encodeFilename(f)
81875  *             c_filename = _cstr(filename8)
81876  *             with nogil:             # <<<<<<<<<<<<<<
81877  *                 bytes = c14n.xmlC14NDocSave(c_doc, NULL, exclusive, NULL,
81878  *                                             with_comments, c_filename, compression)
81879  */
81880       { PyThreadState *_save;
81881         Py_UNBLOCK_THREADS
81882         /*try:*/ {
81883
81884           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":451
81885  *             with nogil:
81886  *                 bytes = c14n.xmlC14NDocSave(c_doc, NULL, exclusive, NULL,
81887  *                                             with_comments, c_filename, compression)             # <<<<<<<<<<<<<<
81888  *         elif hasattr(f, u'write'):
81889  *             writer   = _FilelikeWriter(f, compression=compression)
81890  */
81891           __pyx_v_bytes = xmlC14NDocSave(__pyx_v_c_doc, NULL, __pyx_v_exclusive, NULL, __pyx_v_with_comments, __pyx_v_c_filename, __pyx_v_compression);
81892         }
81893         /*finally:*/ {
81894           Py_BLOCK_THREADS
81895         }
81896       }
81897       goto __pyx_L6;
81898     }
81899
81900     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":452
81901  *                 bytes = c14n.xmlC14NDocSave(c_doc, NULL, exclusive, NULL,
81902  *                                             with_comments, c_filename, compression)
81903  *         elif hasattr(f, u'write'):             # <<<<<<<<<<<<<<
81904  *             writer   = _FilelikeWriter(f, compression=compression)
81905  *             c_buffer = writer._createOutputBuffer(NULL)
81906  */
81907     __pyx_t_2 = PyObject_HasAttr(__pyx_v_f, ((PyObject *)__pyx_kp_512)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L4;}
81908     if (__pyx_t_2) {
81909
81910       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":453
81911  *                                             with_comments, c_filename, compression)
81912  *         elif hasattr(f, u'write'):
81913  *             writer   = _FilelikeWriter(f, compression=compression)             # <<<<<<<<<<<<<<
81914  *             c_buffer = writer._createOutputBuffer(NULL)
81915  *             writer.error_log.connect()
81916  */
81917       __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L4;}
81918       __Pyx_GOTREF(((PyObject *)__pyx_t_3));
81919       __Pyx_INCREF(__pyx_v_f);
81920       PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_f);
81921       __Pyx_GIVEREF(__pyx_v_f);
81922       __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L4;}
81923       __Pyx_GOTREF(((PyObject *)__pyx_1));
81924       __pyx_t_4 = PyInt_FromLong(__pyx_v_compression); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L4;}
81925       __Pyx_GOTREF(__pyx_t_4);
81926       if (PyDict_SetItem(__pyx_1, __pyx_kp_compression, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L4;}
81927       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
81928       __pyx_t_4 = PyEval_CallObjectWithKeywords(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__FilelikeWriter)), ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L4;}
81929       __Pyx_GOTREF(__pyx_t_4);
81930       __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
81931       __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
81932       if (!(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__FilelikeWriter))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L4;}
81933       __Pyx_DECREF(((PyObject *)__pyx_v_writer));
81934       __pyx_v_writer = ((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_t_4);
81935       __pyx_t_4 = 0;
81936
81937       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":454
81938  *         elif hasattr(f, u'write'):
81939  *             writer   = _FilelikeWriter(f, compression=compression)
81940  *             c_buffer = writer._createOutputBuffer(NULL)             # <<<<<<<<<<<<<<
81941  *             writer.error_log.connect()
81942  *             bytes = c14n.xmlC14NDocSaveTo(c_doc, NULL, exclusive, NULL,
81943  */
81944       __pyx_t_5 = ((struct __pyx_vtabstruct_4lxml_5etree__FilelikeWriter *)__pyx_v_writer->__pyx_vtab)->_createOutputBuffer(__pyx_v_writer, NULL); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L4;}
81945       __pyx_v_c_buffer = __pyx_t_5;
81946
81947       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":455
81948  *             writer   = _FilelikeWriter(f, compression=compression)
81949  *             c_buffer = writer._createOutputBuffer(NULL)
81950  *             writer.error_log.connect()             # <<<<<<<<<<<<<<
81951  *             bytes = c14n.xmlC14NDocSaveTo(c_doc, NULL, exclusive, NULL,
81952  *                                           with_comments, c_buffer)
81953  */
81954       ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)__pyx_v_writer->error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(__pyx_v_writer->error_log);
81955
81956       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":457
81957  *             writer.error_log.connect()
81958  *             bytes = c14n.xmlC14NDocSaveTo(c_doc, NULL, exclusive, NULL,
81959  *                                           with_comments, c_buffer)             # <<<<<<<<<<<<<<
81960  *             writer.error_log.disconnect()
81961  *             if bytes >= 0:
81962  */
81963       __pyx_v_bytes = xmlC14NDocSaveTo(__pyx_v_c_doc, NULL, __pyx_v_exclusive, NULL, __pyx_v_with_comments, __pyx_v_c_buffer);
81964
81965       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":458
81966  *             bytes = c14n.xmlC14NDocSaveTo(c_doc, NULL, exclusive, NULL,
81967  *                                           with_comments, c_buffer)
81968  *             writer.error_log.disconnect()             # <<<<<<<<<<<<<<
81969  *             if bytes >= 0:
81970  *                 bytes = tree.xmlOutputBufferClose(c_buffer)
81971  */
81972       ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)__pyx_v_writer->error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(__pyx_v_writer->error_log);
81973
81974       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":459
81975  *                                           with_comments, c_buffer)
81976  *             writer.error_log.disconnect()
81977  *             if bytes >= 0:             # <<<<<<<<<<<<<<
81978  *                 bytes = tree.xmlOutputBufferClose(c_buffer)
81979  *             else:
81980  */
81981       __pyx_t_2 = (__pyx_v_bytes >= 0);
81982       if (__pyx_t_2) {
81983
81984         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":460
81985  *             writer.error_log.disconnect()
81986  *             if bytes >= 0:
81987  *                 bytes = tree.xmlOutputBufferClose(c_buffer)             # <<<<<<<<<<<<<<
81988  *             else:
81989  *                 tree.xmlOutputBufferClose(c_buffer)
81990  */
81991         __pyx_v_bytes = xmlOutputBufferClose(__pyx_v_c_buffer);
81992         goto __pyx_L10;
81993       }
81994       /*else*/ {
81995
81996         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":462
81997  *                 bytes = tree.xmlOutputBufferClose(c_buffer)
81998  *             else:
81999  *                 tree.xmlOutputBufferClose(c_buffer)             # <<<<<<<<<<<<<<
82000  *         else:
82001  *             raise TypeError, \
82002  */
82003         xmlOutputBufferClose(__pyx_v_c_buffer);
82004       }
82005       __pyx_L10:;
82006       goto __pyx_L6;
82007     }
82008     /*else*/ {
82009
82010       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":465
82011  *         else:
82012  *             raise TypeError, \
82013  *                 u"File or filename expected, got '%s'" % funicode(python._fqtypename(f))             # <<<<<<<<<<<<<<
82014  *     finally:
82015  *         _destroyFakeDoc(c_base_doc, c_doc)
82016  */
82017       __pyx_t_4 = __pyx_f_4lxml_5etree_funicode(_fqtypename(__pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L4;}
82018       __Pyx_GOTREF(__pyx_t_4);
82019       __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_513), __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L4;}
82020       __Pyx_GOTREF(__pyx_t_3);
82021       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
82022       __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_3, 0);
82023       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
82024       {__pyx_filename = __pyx_f[3]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L4;}
82025     }
82026     __pyx_L6:;
82027   }
82028   /*finally:*/ {
82029     int __pyx_why;
82030     PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
82031     int __pyx_exc_lineno;
82032     __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
82033     __pyx_why = 0; goto __pyx_L5;
82034     __pyx_L4: {
82035       __pyx_why = 4;
82036       __Pyx_XDECREF(__pyx_1); __pyx_1 = 0;
82037       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
82038       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
82039       __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
82040       __pyx_exc_lineno = __pyx_lineno;
82041       goto __pyx_L5;
82042     }
82043     __pyx_L5:;
82044
82045     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":467
82046  *                 u"File or filename expected, got '%s'" % funicode(python._fqtypename(f))
82047  *     finally:
82048  *         _destroyFakeDoc(c_base_doc, c_doc)             # <<<<<<<<<<<<<<
82049  * 
82050  *     if writer is not None:
82051  */
82052     __pyx_f_4lxml_5etree__destroyFakeDoc(__pyx_v_c_base_doc, __pyx_v_c_doc);
82053     switch (__pyx_why) {
82054       case 4: {
82055         __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
82056         __pyx_lineno = __pyx_exc_lineno;
82057         __pyx_exc_type = 0;
82058         __pyx_exc_value = 0;
82059         __pyx_exc_tb = 0;
82060         goto __pyx_L1_error;
82061       }
82062     }
82063   }
82064
82065   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":469
82066  *         _destroyFakeDoc(c_base_doc, c_doc)
82067  * 
82068  *     if writer is not None:             # <<<<<<<<<<<<<<
82069  *         writer._exc_context._raise_if_stored()
82070  * 
82071  */
82072   __pyx_t_2 = (((PyObject *)__pyx_v_writer) != Py_None);
82073   if (__pyx_t_2) {
82074
82075     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":470
82076  * 
82077  *     if writer is not None:
82078  *         writer._exc_context._raise_if_stored()             # <<<<<<<<<<<<<<
82079  * 
82080  *     if bytes < 0:
82081  */
82082     __pyx_t_6 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_writer->_exc_context->__pyx_vtab)->_raise_if_stored(__pyx_v_writer->_exc_context); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82083     goto __pyx_L12;
82084   }
82085   __pyx_L12:;
82086
82087   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":472
82088  *         writer._exc_context._raise_if_stored()
82089  * 
82090  *     if bytes < 0:             # <<<<<<<<<<<<<<
82091  *         message = u"C14N failed"
82092  *         if writer is not None:
82093  */
82094   __pyx_t_2 = (__pyx_v_bytes < 0);
82095   if (__pyx_t_2) {
82096
82097     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":473
82098  * 
82099  *     if bytes < 0:
82100  *         message = u"C14N failed"             # <<<<<<<<<<<<<<
82101  *         if writer is not None:
82102  *             errors = writer.error_log
82103  */
82104     __Pyx_INCREF(((PyObject *)__pyx_kp_514));
82105     __Pyx_DECREF(__pyx_v_message);
82106     __pyx_v_message = ((PyObject *)__pyx_kp_514);
82107
82108     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":474
82109  *     if bytes < 0:
82110  *         message = u"C14N failed"
82111  *         if writer is not None:             # <<<<<<<<<<<<<<
82112  *             errors = writer.error_log
82113  *             if len(errors):
82114  */
82115     __pyx_t_2 = (((PyObject *)__pyx_v_writer) != Py_None);
82116     if (__pyx_t_2) {
82117
82118       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":475
82119  *         message = u"C14N failed"
82120  *         if writer is not None:
82121  *             errors = writer.error_log             # <<<<<<<<<<<<<<
82122  *             if len(errors):
82123  *                 message = errors[0].message
82124  */
82125       __Pyx_INCREF(((PyObject *)__pyx_v_writer->error_log));
82126       __Pyx_DECREF(__pyx_v_errors);
82127       __pyx_v_errors = ((PyObject *)__pyx_v_writer->error_log);
82128
82129       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":476
82130  *         if writer is not None:
82131  *             errors = writer.error_log
82132  *             if len(errors):             # <<<<<<<<<<<<<<
82133  *                 message = errors[0].message
82134  *         raise C14NError, message
82135  */
82136       __pyx_t_7 = PyObject_Length(__pyx_v_errors); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82137       if (__pyx_t_7) {
82138
82139         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":477
82140  *             errors = writer.error_log
82141  *             if len(errors):
82142  *                 message = errors[0].message             # <<<<<<<<<<<<<<
82143  *         raise C14NError, message
82144  * 
82145  */
82146         __pyx_1 = __Pyx_GetItemInt(__pyx_v_errors, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82147         __Pyx_GOTREF(__pyx_1);
82148         __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_message); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82149         __Pyx_GOTREF(__pyx_t_3);
82150         __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
82151         __Pyx_DECREF(__pyx_v_message);
82152         __pyx_v_message = __pyx_t_3;
82153         __pyx_t_3 = 0;
82154         goto __pyx_L15;
82155       }
82156       __pyx_L15:;
82157       goto __pyx_L14;
82158     }
82159     __pyx_L14:;
82160
82161     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":478
82162  *             if len(errors):
82163  *                 message = errors[0].message
82164  *         raise C14NError, message             # <<<<<<<<<<<<<<
82165  * 
82166  * # dump node to file (mainly for debug)
82167  */
82168     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_60); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82169     __Pyx_GOTREF(__pyx_1);
82170     __Pyx_Raise(__pyx_1, __pyx_v_message, 0);
82171     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
82172     {__pyx_filename = __pyx_f[3]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82173     goto __pyx_L13;
82174   }
82175   __pyx_L13:;
82176
82177   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
82178   goto __pyx_L0;
82179   __pyx_L1_error:;
82180   __Pyx_XDECREF(__pyx_1);
82181   __Pyx_XDECREF(__pyx_t_3);
82182   __Pyx_XDECREF(__pyx_t_4);
82183   __Pyx_AddTraceback("lxml.etree._tofilelikeC14N");
82184   __pyx_r = 0;
82185   __pyx_L0:;
82186   __Pyx_DECREF((PyObject *)__pyx_v_writer);
82187   __Pyx_DECREF(__pyx_v_filename8);
82188   __Pyx_DECREF(__pyx_v_message);
82189   __Pyx_DECREF(__pyx_v_errors);
82190   __Pyx_XGIVEREF(__pyx_r);
82191   __Pyx_FinishRefcountContext();
82192   return __pyx_r;
82193 }
82194
82195 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":482
82196  * # dump node to file (mainly for debug)
82197  * 
82198  * cdef _dumpToFile(f, xmlNode* c_node, bint pretty_print, bint with_tail):             # <<<<<<<<<<<<<<
82199  *     cdef tree.xmlOutputBuffer* c_buffer
82200  *     cdef cstd.FILE* c_file
82201  */
82202
82203 static  PyObject *__pyx_f_4lxml_5etree__dumpToFile(PyObject *__pyx_v_f, xmlNode *__pyx_v_c_node, int __pyx_v_pretty_print, int __pyx_v_with_tail) {
82204   xmlOutputBuffer *__pyx_v_c_buffer;
82205   FILE *__pyx_v_c_file;
82206   PyObject *__pyx_r = NULL;
82207   int __pyx_t_1;
82208   __Pyx_SetupRefcountContext("_dumpToFile");
82209
82210   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":485
82211  *     cdef tree.xmlOutputBuffer* c_buffer
82212  *     cdef cstd.FILE* c_file
82213  *     c_file = python.PyFile_AsFile(f)             # <<<<<<<<<<<<<<
82214  *     if c_file is NULL:
82215  *         raise ValueError, u"not a file"
82216  */
82217   __pyx_v_c_file = PyFile_AsFile(__pyx_v_f);
82218
82219   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":486
82220  *     cdef cstd.FILE* c_file
82221  *     c_file = python.PyFile_AsFile(f)
82222  *     if c_file is NULL:             # <<<<<<<<<<<<<<
82223  *         raise ValueError, u"not a file"
82224  *     c_buffer = tree.xmlOutputBufferCreateFile(c_file, NULL)
82225  */
82226   __pyx_t_1 = (__pyx_v_c_file == NULL);
82227   if (__pyx_t_1) {
82228
82229     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":487
82230  *     c_file = python.PyFile_AsFile(f)
82231  *     if c_file is NULL:
82232  *         raise ValueError, u"not a file"             # <<<<<<<<<<<<<<
82233  *     c_buffer = tree.xmlOutputBufferCreateFile(c_file, NULL)
82234  *     tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0, pretty_print, NULL)
82235  */
82236     __Pyx_Raise(__pyx_builtin_ValueError, ((PyObject *)__pyx_kp_515), 0);
82237     {__pyx_filename = __pyx_f[3]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82238     goto __pyx_L3;
82239   }
82240   __pyx_L3:;
82241
82242   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":488
82243  *     if c_file is NULL:
82244  *         raise ValueError, u"not a file"
82245  *     c_buffer = tree.xmlOutputBufferCreateFile(c_file, NULL)             # <<<<<<<<<<<<<<
82246  *     tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0, pretty_print, NULL)
82247  *     if with_tail:
82248  */
82249   __pyx_v_c_buffer = xmlOutputBufferCreateFile(__pyx_v_c_file, NULL);
82250
82251   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":489
82252  *         raise ValueError, u"not a file"
82253  *     c_buffer = tree.xmlOutputBufferCreateFile(c_file, NULL)
82254  *     tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0, pretty_print, NULL)             # <<<<<<<<<<<<<<
82255  *     if with_tail:
82256  *         _writeTail(c_buffer, c_node, NULL, 0)
82257  */
82258   xmlNodeDumpOutput(__pyx_v_c_buffer, __pyx_v_c_node->doc, __pyx_v_c_node, 0, __pyx_v_pretty_print, NULL);
82259
82260   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":490
82261  *     c_buffer = tree.xmlOutputBufferCreateFile(c_file, NULL)
82262  *     tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0, pretty_print, NULL)
82263  *     if with_tail:             # <<<<<<<<<<<<<<
82264  *         _writeTail(c_buffer, c_node, NULL, 0)
82265  *     if not pretty_print:
82266  */
82267   __pyx_t_1 = __pyx_v_with_tail;
82268   if (__pyx_t_1) {
82269
82270     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":491
82271  *     tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0, pretty_print, NULL)
82272  *     if with_tail:
82273  *         _writeTail(c_buffer, c_node, NULL, 0)             # <<<<<<<<<<<<<<
82274  *     if not pretty_print:
82275  *         # not written yet
82276  */
82277     __pyx_f_4lxml_5etree__writeTail(__pyx_v_c_buffer, __pyx_v_c_node, NULL, 0);
82278     goto __pyx_L4;
82279   }
82280   __pyx_L4:;
82281
82282   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":492
82283  *     if with_tail:
82284  *         _writeTail(c_buffer, c_node, NULL, 0)
82285  *     if not pretty_print:             # <<<<<<<<<<<<<<
82286  *         # not written yet
82287  *         tree.xmlOutputBufferWriteString(c_buffer, '\n')
82288  */
82289   __pyx_t_1 = (!__pyx_v_pretty_print);
82290   if (__pyx_t_1) {
82291
82292     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":494
82293  *     if not pretty_print:
82294  *         # not written yet
82295  *         tree.xmlOutputBufferWriteString(c_buffer, '\n')             # <<<<<<<<<<<<<<
82296  *     tree.xmlOutputBufferFlush(c_buffer)
82297  */
82298     xmlOutputBufferWriteString(__pyx_v_c_buffer, __pyx_k_516);
82299     goto __pyx_L5;
82300   }
82301   __pyx_L5:;
82302
82303   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":495
82304  *         # not written yet
82305  *         tree.xmlOutputBufferWriteString(c_buffer, '\n')
82306  *     tree.xmlOutputBufferFlush(c_buffer)             # <<<<<<<<<<<<<<
82307  */
82308   xmlOutputBufferFlush(__pyx_v_c_buffer);
82309
82310   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
82311   goto __pyx_L0;
82312   __pyx_L1_error:;
82313   __Pyx_AddTraceback("lxml.etree._dumpToFile");
82314   __pyx_r = 0;
82315   __pyx_L0:;
82316   __Pyx_XGIVEREF(__pyx_r);
82317   __Pyx_FinishRefcountContext();
82318   return __pyx_r;
82319 }
82320
82321 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":13
82322  *     ITERPARSE_FILTER_PI        = 32
82323  * 
82324  * cdef int _buildIterparseEventFilter(events) except -1:             # <<<<<<<<<<<<<<
82325  *     cdef int event_filter
82326  *     event_filter = 0
82327  */
82328
82329 static  int __pyx_f_4lxml_5etree__buildIterparseEventFilter(PyObject *__pyx_v_events) {
82330   int __pyx_v_event_filter;
82331   PyObject *__pyx_v_event;
82332   int __pyx_r;
82333   Py_ssize_t __pyx_t_1;
82334   PyObject *__pyx_t_2 = NULL;
82335   PyObject *__pyx_t_3 = NULL;
82336   int __pyx_t_4;
82337   __Pyx_SetupRefcountContext("_buildIterparseEventFilter");
82338   __pyx_v_event = Py_None; __Pyx_INCREF(Py_None);
82339
82340   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":15
82341  * cdef int _buildIterparseEventFilter(events) except -1:
82342  *     cdef int event_filter
82343  *     event_filter = 0             # <<<<<<<<<<<<<<
82344  *     for event in events:
82345  *         if event == u'start':
82346  */
82347   __pyx_v_event_filter = 0;
82348
82349   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":16
82350  *     cdef int event_filter
82351  *     event_filter = 0
82352  *     for event in events:             # <<<<<<<<<<<<<<
82353  *         if event == u'start':
82354  *             event_filter |= ITERPARSE_FILTER_START
82355  */
82356   if (PyList_CheckExact(__pyx_v_events) || PyTuple_CheckExact(__pyx_v_events)) {
82357     __pyx_t_1 = 0; __pyx_t_2 = __pyx_v_events; __Pyx_INCREF(__pyx_t_2);
82358   } else {
82359     __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_events); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82360     __Pyx_GOTREF(__pyx_t_2);
82361   }
82362   for (;;) {
82363     if (likely(PyList_CheckExact(__pyx_t_2))) {
82364       if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break;
82365       __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
82366     } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
82367       if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
82368       __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
82369     } else {
82370       __pyx_t_3 = PyIter_Next(__pyx_t_2);
82371       if (!__pyx_t_3) {
82372         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82373         break;
82374       }
82375       __Pyx_GOTREF(__pyx_t_3);
82376     }
82377     __Pyx_DECREF(__pyx_v_event);
82378     __pyx_v_event = __pyx_t_3;
82379     __pyx_t_3 = 0;
82380
82381     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":17
82382  *     event_filter = 0
82383  *     for event in events:
82384  *         if event == u'start':             # <<<<<<<<<<<<<<
82385  *             event_filter |= ITERPARSE_FILTER_START
82386  *         elif event == u'end':
82387  */
82388     __pyx_t_3 = PyObject_RichCompare(__pyx_v_event, ((PyObject *)__pyx_kp_517), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82389     __Pyx_GOTREF(__pyx_t_3);
82390     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82391     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
82392     if (__pyx_t_4) {
82393
82394       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":18
82395  *     for event in events:
82396  *         if event == u'start':
82397  *             event_filter |= ITERPARSE_FILTER_START             # <<<<<<<<<<<<<<
82398  *         elif event == u'end':
82399  *             event_filter |= ITERPARSE_FILTER_END
82400  */
82401       __pyx_v_event_filter |= __pyx_e_4lxml_5etree_ITERPARSE_FILTER_START;
82402       goto __pyx_L5;
82403     }
82404
82405     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":19
82406  *         if event == u'start':
82407  *             event_filter |= ITERPARSE_FILTER_START
82408  *         elif event == u'end':             # <<<<<<<<<<<<<<
82409  *             event_filter |= ITERPARSE_FILTER_END
82410  *         elif event == u'start-ns':
82411  */
82412     __pyx_t_3 = PyObject_RichCompare(__pyx_v_event, ((PyObject *)__pyx_kp_518), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82413     __Pyx_GOTREF(__pyx_t_3);
82414     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82415     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
82416     if (__pyx_t_4) {
82417
82418       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":20
82419  *             event_filter |= ITERPARSE_FILTER_START
82420  *         elif event == u'end':
82421  *             event_filter |= ITERPARSE_FILTER_END             # <<<<<<<<<<<<<<
82422  *         elif event == u'start-ns':
82423  *             event_filter |= ITERPARSE_FILTER_START_NS
82424  */
82425       __pyx_v_event_filter |= __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END;
82426       goto __pyx_L5;
82427     }
82428
82429     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":21
82430  *         elif event == u'end':
82431  *             event_filter |= ITERPARSE_FILTER_END
82432  *         elif event == u'start-ns':             # <<<<<<<<<<<<<<
82433  *             event_filter |= ITERPARSE_FILTER_START_NS
82434  *         elif event == u'end-ns':
82435  */
82436     __pyx_t_3 = PyObject_RichCompare(__pyx_v_event, ((PyObject *)__pyx_kp_519), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82437     __Pyx_GOTREF(__pyx_t_3);
82438     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82439     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
82440     if (__pyx_t_4) {
82441
82442       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":22
82443  *             event_filter |= ITERPARSE_FILTER_END
82444  *         elif event == u'start-ns':
82445  *             event_filter |= ITERPARSE_FILTER_START_NS             # <<<<<<<<<<<<<<
82446  *         elif event == u'end-ns':
82447  *             event_filter |= ITERPARSE_FILTER_END_NS
82448  */
82449       __pyx_v_event_filter |= __pyx_e_4lxml_5etree_ITERPARSE_FILTER_START_NS;
82450       goto __pyx_L5;
82451     }
82452
82453     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":23
82454  *         elif event == u'start-ns':
82455  *             event_filter |= ITERPARSE_FILTER_START_NS
82456  *         elif event == u'end-ns':             # <<<<<<<<<<<<<<
82457  *             event_filter |= ITERPARSE_FILTER_END_NS
82458  *         elif event == u'comment':
82459  */
82460     __pyx_t_3 = PyObject_RichCompare(__pyx_v_event, ((PyObject *)__pyx_kp_520), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82461     __Pyx_GOTREF(__pyx_t_3);
82462     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82463     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
82464     if (__pyx_t_4) {
82465
82466       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":24
82467  *             event_filter |= ITERPARSE_FILTER_START_NS
82468  *         elif event == u'end-ns':
82469  *             event_filter |= ITERPARSE_FILTER_END_NS             # <<<<<<<<<<<<<<
82470  *         elif event == u'comment':
82471  *             event_filter |= ITERPARSE_FILTER_COMMENT
82472  */
82473       __pyx_v_event_filter |= __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END_NS;
82474       goto __pyx_L5;
82475     }
82476
82477     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":25
82478  *         elif event == u'end-ns':
82479  *             event_filter |= ITERPARSE_FILTER_END_NS
82480  *         elif event == u'comment':             # <<<<<<<<<<<<<<
82481  *             event_filter |= ITERPARSE_FILTER_COMMENT
82482  *         elif event == u'pi':
82483  */
82484     __pyx_t_3 = PyObject_RichCompare(__pyx_v_event, ((PyObject *)__pyx_kp_521), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82485     __Pyx_GOTREF(__pyx_t_3);
82486     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82487     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
82488     if (__pyx_t_4) {
82489
82490       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":26
82491  *             event_filter |= ITERPARSE_FILTER_END_NS
82492  *         elif event == u'comment':
82493  *             event_filter |= ITERPARSE_FILTER_COMMENT             # <<<<<<<<<<<<<<
82494  *         elif event == u'pi':
82495  *             event_filter |= ITERPARSE_FILTER_PI
82496  */
82497       __pyx_v_event_filter |= __pyx_e_4lxml_5etree_ITERPARSE_FILTER_COMMENT;
82498       goto __pyx_L5;
82499     }
82500
82501     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":27
82502  *         elif event == u'comment':
82503  *             event_filter |= ITERPARSE_FILTER_COMMENT
82504  *         elif event == u'pi':             # <<<<<<<<<<<<<<
82505  *             event_filter |= ITERPARSE_FILTER_PI
82506  *         else:
82507  */
82508     __pyx_t_3 = PyObject_RichCompare(__pyx_v_event, ((PyObject *)__pyx_kp_522), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82509     __Pyx_GOTREF(__pyx_t_3);
82510     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82511     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
82512     if (__pyx_t_4) {
82513
82514       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":28
82515  *             event_filter |= ITERPARSE_FILTER_COMMENT
82516  *         elif event == u'pi':
82517  *             event_filter |= ITERPARSE_FILTER_PI             # <<<<<<<<<<<<<<
82518  *         else:
82519  *             raise ValueError, u"invalid event name '%s'" % event
82520  */
82521       __pyx_v_event_filter |= __pyx_e_4lxml_5etree_ITERPARSE_FILTER_PI;
82522       goto __pyx_L5;
82523     }
82524     /*else*/ {
82525
82526       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":30
82527  *             event_filter |= ITERPARSE_FILTER_PI
82528  *         else:
82529  *             raise ValueError, u"invalid event name '%s'" % event             # <<<<<<<<<<<<<<
82530  *     return event_filter
82531  * 
82532  */
82533       __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_523), __pyx_v_event); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82534       __Pyx_GOTREF(__pyx_t_3);
82535       __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_3, 0);
82536       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
82537       {__pyx_filename = __pyx_f[14]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82538     }
82539     __pyx_L5:;
82540   }
82541   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
82542
82543   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":31
82544  *         else:
82545  *             raise ValueError, u"invalid event name '%s'" % event
82546  *     return event_filter             # <<<<<<<<<<<<<<
82547  * 
82548  * cdef int _countNsDefs(xmlNode* c_node):
82549  */
82550   __pyx_r = __pyx_v_event_filter;
82551   goto __pyx_L0;
82552
82553   __pyx_r = 0;
82554   goto __pyx_L0;
82555   __pyx_L1_error:;
82556   __Pyx_XDECREF(__pyx_t_2);
82557   __Pyx_XDECREF(__pyx_t_3);
82558   __Pyx_AddTraceback("lxml.etree._buildIterparseEventFilter");
82559   __pyx_r = -1;
82560   __pyx_L0:;
82561   __Pyx_DECREF(__pyx_v_event);
82562   __Pyx_FinishRefcountContext();
82563   return __pyx_r;
82564 }
82565
82566 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":33
82567  *     return event_filter
82568  * 
82569  * cdef int _countNsDefs(xmlNode* c_node):             # <<<<<<<<<<<<<<
82570  *     cdef xmlNs* c_ns
82571  *     cdef int count
82572  */
82573
82574 static  int __pyx_f_4lxml_5etree__countNsDefs(xmlNode *__pyx_v_c_node) {
82575   xmlNs *__pyx_v_c_ns;
82576   int __pyx_v_count;
82577   int __pyx_r;
82578   int __pyx_t_1;
82579   __Pyx_SetupRefcountContext("_countNsDefs");
82580
82581   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":36
82582  *     cdef xmlNs* c_ns
82583  *     cdef int count
82584  *     count = 0             # <<<<<<<<<<<<<<
82585  *     c_ns = c_node.nsDef
82586  *     while c_ns is not NULL:
82587  */
82588   __pyx_v_count = 0;
82589
82590   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":37
82591  *     cdef int count
82592  *     count = 0
82593  *     c_ns = c_node.nsDef             # <<<<<<<<<<<<<<
82594  *     while c_ns is not NULL:
82595  *         count = count + 1
82596  */
82597   __pyx_v_c_ns = __pyx_v_c_node->nsDef;
82598
82599   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":38
82600  *     count = 0
82601  *     c_ns = c_node.nsDef
82602  *     while c_ns is not NULL:             # <<<<<<<<<<<<<<
82603  *         count = count + 1
82604  *         c_ns = c_ns.next
82605  */
82606   while (1) {
82607     __pyx_t_1 = (__pyx_v_c_ns != NULL);
82608     if (!__pyx_t_1) break;
82609
82610     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":39
82611  *     c_ns = c_node.nsDef
82612  *     while c_ns is not NULL:
82613  *         count = count + 1             # <<<<<<<<<<<<<<
82614  *         c_ns = c_ns.next
82615  *     return count
82616  */
82617     __pyx_v_count = (__pyx_v_count + 1);
82618
82619     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":40
82620  *     while c_ns is not NULL:
82621  *         count = count + 1
82622  *         c_ns = c_ns.next             # <<<<<<<<<<<<<<
82623  *     return count
82624  * 
82625  */
82626     __pyx_v_c_ns = __pyx_v_c_ns->next;
82627   }
82628
82629   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":41
82630  *         count = count + 1
82631  *         c_ns = c_ns.next
82632  *     return count             # <<<<<<<<<<<<<<
82633  * 
82634  * cdef int _appendStartNsEvents(xmlNode* c_node, list event_list):
82635  */
82636   __pyx_r = __pyx_v_count;
82637   goto __pyx_L0;
82638
82639   __pyx_r = 0;
82640   __pyx_L0:;
82641   __Pyx_FinishRefcountContext();
82642   return __pyx_r;
82643 }
82644
82645 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":43
82646  *     return count
82647  * 
82648  * cdef int _appendStartNsEvents(xmlNode* c_node, list event_list):             # <<<<<<<<<<<<<<
82649  *     cdef xmlNs* c_ns
82650  *     cdef int count
82651  */
82652
82653 static  int __pyx_f_4lxml_5etree__appendStartNsEvents(xmlNode *__pyx_v_c_node, PyObject *__pyx_v_event_list) {
82654   xmlNs *__pyx_v_c_ns;
82655   int __pyx_v_count;
82656   PyObject *__pyx_v_prefix;
82657   PyObject *__pyx_v_ns_tuple;
82658   int __pyx_r;
82659   int __pyx_t_1;
82660   PyObject *__pyx_t_2 = NULL;
82661   PyObject *__pyx_t_3 = NULL;
82662   int __pyx_t_4;
82663   __Pyx_SetupRefcountContext("_appendStartNsEvents");
82664   __pyx_v_prefix = Py_None; __Pyx_INCREF(Py_None);
82665   __pyx_v_ns_tuple = Py_None; __Pyx_INCREF(Py_None);
82666
82667   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":46
82668  *     cdef xmlNs* c_ns
82669  *     cdef int count
82670  *     count = 0             # <<<<<<<<<<<<<<
82671  *     c_ns = c_node.nsDef
82672  *     while c_ns is not NULL:
82673  */
82674   __pyx_v_count = 0;
82675
82676   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":47
82677  *     cdef int count
82678  *     count = 0
82679  *     c_ns = c_node.nsDef             # <<<<<<<<<<<<<<
82680  *     while c_ns is not NULL:
82681  *         if c_ns.prefix is NULL:
82682  */
82683   __pyx_v_c_ns = __pyx_v_c_node->nsDef;
82684
82685   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":48
82686  *     count = 0
82687  *     c_ns = c_node.nsDef
82688  *     while c_ns is not NULL:             # <<<<<<<<<<<<<<
82689  *         if c_ns.prefix is NULL:
82690  *             if python.IS_PYTHON3:
82691  */
82692   while (1) {
82693     __pyx_t_1 = (__pyx_v_c_ns != NULL);
82694     if (!__pyx_t_1) break;
82695
82696     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":49
82697  *     c_ns = c_node.nsDef
82698  *     while c_ns is not NULL:
82699  *         if c_ns.prefix is NULL:             # <<<<<<<<<<<<<<
82700  *             if python.IS_PYTHON3:
82701  *                 prefix = u''
82702  */
82703     __pyx_t_1 = (__pyx_v_c_ns->prefix == NULL);
82704     if (__pyx_t_1) {
82705
82706       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":50
82707  *     while c_ns is not NULL:
82708  *         if c_ns.prefix is NULL:
82709  *             if python.IS_PYTHON3:             # <<<<<<<<<<<<<<
82710  *                 prefix = u''
82711  *             else:
82712  */
82713       __pyx_t_1 = IS_PYTHON3;
82714       if (__pyx_t_1) {
82715
82716         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":51
82717  *         if c_ns.prefix is NULL:
82718  *             if python.IS_PYTHON3:
82719  *                 prefix = u''             # <<<<<<<<<<<<<<
82720  *             else:
82721  *                 prefix = ''
82722  */
82723         __Pyx_INCREF(((PyObject *)__pyx_kp_524));
82724         __Pyx_DECREF(__pyx_v_prefix);
82725         __pyx_v_prefix = ((PyObject *)__pyx_kp_524);
82726         goto __pyx_L6;
82727       }
82728       /*else*/ {
82729
82730         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":53
82731  *                 prefix = u''
82732  *             else:
82733  *                 prefix = ''             # <<<<<<<<<<<<<<
82734  *         else:
82735  *             prefix = funicode(c_ns.prefix)
82736  */
82737         __Pyx_INCREF(__pyx_kp_525);
82738         __Pyx_DECREF(__pyx_v_prefix);
82739         __pyx_v_prefix = __pyx_kp_525;
82740       }
82741       __pyx_L6:;
82742       goto __pyx_L5;
82743     }
82744     /*else*/ {
82745
82746       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":55
82747  *                 prefix = ''
82748  *         else:
82749  *             prefix = funicode(c_ns.prefix)             # <<<<<<<<<<<<<<
82750  *         ns_tuple = (prefix, funicode(c_ns.href))
82751  *         event_list.append( (u"start-ns", ns_tuple) )
82752  */
82753       __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_ns->prefix); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82754       __Pyx_GOTREF(__pyx_t_2);
82755       __Pyx_DECREF(__pyx_v_prefix);
82756       __pyx_v_prefix = __pyx_t_2;
82757       __pyx_t_2 = 0;
82758     }
82759     __pyx_L5:;
82760
82761     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":56
82762  *         else:
82763  *             prefix = funicode(c_ns.prefix)
82764  *         ns_tuple = (prefix, funicode(c_ns.href))             # <<<<<<<<<<<<<<
82765  *         event_list.append( (u"start-ns", ns_tuple) )
82766  *         count = count + 1
82767  */
82768     __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_ns->href); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82769     __Pyx_GOTREF(__pyx_t_2);
82770     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82771     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
82772     __Pyx_INCREF(__pyx_v_prefix);
82773     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_prefix);
82774     __Pyx_GIVEREF(__pyx_v_prefix);
82775     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
82776     __Pyx_GIVEREF(__pyx_t_2);
82777     __pyx_t_2 = 0;
82778     __Pyx_DECREF(__pyx_v_ns_tuple);
82779     __pyx_v_ns_tuple = ((PyObject *)__pyx_t_3);
82780     __pyx_t_3 = 0;
82781
82782     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":57
82783  *             prefix = funicode(c_ns.prefix)
82784  *         ns_tuple = (prefix, funicode(c_ns.href))
82785  *         event_list.append( (u"start-ns", ns_tuple) )             # <<<<<<<<<<<<<<
82786  *         count = count + 1
82787  *         c_ns = c_ns.next
82788  */
82789     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82790     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
82791     __Pyx_INCREF(((PyObject *)__pyx_kp_526));
82792     PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_526));
82793     __Pyx_GIVEREF(((PyObject *)__pyx_kp_526));
82794     __Pyx_INCREF(__pyx_v_ns_tuple);
82795     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_ns_tuple);
82796     __Pyx_GIVEREF(__pyx_v_ns_tuple);
82797     __pyx_t_4 = PyList_Append(((PyObject *)__pyx_v_event_list), ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82798     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
82799
82800     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":58
82801  *         ns_tuple = (prefix, funicode(c_ns.href))
82802  *         event_list.append( (u"start-ns", ns_tuple) )
82803  *         count = count + 1             # <<<<<<<<<<<<<<
82804  *         c_ns = c_ns.next
82805  *     return count
82806  */
82807     __pyx_v_count = (__pyx_v_count + 1);
82808
82809     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":59
82810  *         event_list.append( (u"start-ns", ns_tuple) )
82811  *         count = count + 1
82812  *         c_ns = c_ns.next             # <<<<<<<<<<<<<<
82813  *     return count
82814  * 
82815  */
82816     __pyx_v_c_ns = __pyx_v_c_ns->next;
82817   }
82818
82819   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":60
82820  *         count = count + 1
82821  *         c_ns = c_ns.next
82822  *     return count             # <<<<<<<<<<<<<<
82823  * 
82824  * cdef class _IterparseContext(_ParserContext):
82825  */
82826   __pyx_r = __pyx_v_count;
82827   goto __pyx_L0;
82828
82829   __pyx_r = 0;
82830   goto __pyx_L0;
82831   __pyx_L1_error:;
82832   __Pyx_XDECREF(__pyx_t_2);
82833   __Pyx_XDECREF(__pyx_t_3);
82834   __Pyx_WriteUnraisable("lxml.etree._appendStartNsEvents");
82835   __pyx_r = 0;
82836   __pyx_L0:;
82837   __Pyx_DECREF(__pyx_v_prefix);
82838   __Pyx_DECREF(__pyx_v_ns_tuple);
82839   __Pyx_FinishRefcountContext();
82840   return __pyx_r;
82841 }
82842
82843 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":82
82844  *     cdef char*  _tag_name
82845  * 
82846  *     def __init__(self):             # <<<<<<<<<<<<<<
82847  *         self._ns_stack = []
82848  *         self._pop_ns = self._ns_stack.pop
82849  */
82850
82851 static int __pyx_pf_4lxml_5etree_17_IterparseContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
82852 static int __pyx_pf_4lxml_5etree_17_IterparseContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
82853   int __pyx_r;
82854   PyObject *__pyx_t_1 = NULL;
82855   __Pyx_SetupRefcountContext("__init__");
82856   if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
82857     __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
82858   if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
82859
82860   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":83
82861  * 
82862  *     def __init__(self):
82863  *         self._ns_stack = []             # <<<<<<<<<<<<<<
82864  *         self._pop_ns = self._ns_stack.pop
82865  *         self._node_stack = []
82866  */
82867   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82868   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
82869   __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
82870   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_ns_stack);
82871   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_ns_stack));
82872   ((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_ns_stack = __pyx_t_1;
82873   __pyx_t_1 = 0;
82874
82875   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":84
82876  *     def __init__(self):
82877  *         self._ns_stack = []
82878  *         self._pop_ns = self._ns_stack.pop             # <<<<<<<<<<<<<<
82879  *         self._node_stack = []
82880  *         self._pop_node = self._node_stack.pop
82881  */
82882   __pyx_t_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_ns_stack), __pyx_kp_pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82883   __Pyx_GOTREF(__pyx_t_1);
82884   __Pyx_GIVEREF(__pyx_t_1);
82885   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_pop_ns);
82886   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_pop_ns);
82887   ((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_pop_ns = __pyx_t_1;
82888   __pyx_t_1 = 0;
82889
82890   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":85
82891  *         self._ns_stack = []
82892  *         self._pop_ns = self._ns_stack.pop
82893  *         self._node_stack = []             # <<<<<<<<<<<<<<
82894  *         self._pop_node = self._node_stack.pop
82895  *         self._events = []
82896  */
82897   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82898   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
82899   __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
82900   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_node_stack);
82901   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_node_stack));
82902   ((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_node_stack = __pyx_t_1;
82903   __pyx_t_1 = 0;
82904
82905   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":86
82906  *         self._pop_ns = self._ns_stack.pop
82907  *         self._node_stack = []
82908  *         self._pop_node = self._node_stack.pop             # <<<<<<<<<<<<<<
82909  *         self._events = []
82910  *         self._event_index = 0
82911  */
82912   __pyx_t_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_node_stack), __pyx_kp_pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82913   __Pyx_GOTREF(__pyx_t_1);
82914   __Pyx_GIVEREF(__pyx_t_1);
82915   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_pop_node);
82916   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_pop_node);
82917   ((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_pop_node = __pyx_t_1;
82918   __pyx_t_1 = 0;
82919
82920   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":87
82921  *         self._node_stack = []
82922  *         self._pop_node = self._node_stack.pop
82923  *         self._events = []             # <<<<<<<<<<<<<<
82924  *         self._event_index = 0
82925  * 
82926  */
82927   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
82928   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
82929   __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
82930   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_events);
82931   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_events));
82932   ((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_events = __pyx_t_1;
82933   __pyx_t_1 = 0;
82934
82935   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":88
82936  *         self._pop_node = self._node_stack.pop
82937  *         self._events = []
82938  *         self._event_index = 0             # <<<<<<<<<<<<<<
82939  * 
82940  *     cdef void _initParserContext(self, xmlparser.xmlParserCtxt* c_ctxt):
82941  */
82942   ((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_event_index = 0;
82943
82944   __pyx_r = 0;
82945   goto __pyx_L0;
82946   __pyx_L1_error:;
82947   __Pyx_XDECREF(__pyx_t_1);
82948   __Pyx_AddTraceback("lxml.etree._IterparseContext.__init__");
82949   __pyx_r = -1;
82950   __pyx_L0:;
82951   __Pyx_FinishRefcountContext();
82952   return __pyx_r;
82953 }
82954
82955 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":90
82956  *         self._event_index = 0
82957  * 
82958  *     cdef void _initParserContext(self, xmlparser.xmlParserCtxt* c_ctxt):             # <<<<<<<<<<<<<<
82959  *         u"wrap original SAX2 callbacks"
82960  *         cdef xmlparser.xmlSAXHandler* sax
82961  */
82962
82963 static  void __pyx_f_4lxml_5etree_17_IterparseContext__initParserContext(struct __pyx_obj_4lxml_5etree__IterparseContext *__pyx_v_self, xmlParserCtxt *__pyx_v_c_ctxt) {
82964   xmlSAXHandler *__pyx_v_sax;
82965   int __pyx_t_1;
82966   int __pyx_t_2;
82967   __Pyx_SetupRefcountContext("_initParserContext");
82968
82969   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":93
82970  *         u"wrap original SAX2 callbacks"
82971  *         cdef xmlparser.xmlSAXHandler* sax
82972  *         _ParserContext._initParserContext(self, c_ctxt)             # <<<<<<<<<<<<<<
82973  *         sax = c_ctxt.sax
82974  *         self._origSaxStart = sax.startElementNs
82975  */
82976   __pyx_vtabptr_4lxml_5etree__ParserContext->_initParserContext(((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_v_self), __pyx_v_c_ctxt);
82977
82978   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":94
82979  *         cdef xmlparser.xmlSAXHandler* sax
82980  *         _ParserContext._initParserContext(self, c_ctxt)
82981  *         sax = c_ctxt.sax             # <<<<<<<<<<<<<<
82982  *         self._origSaxStart = sax.startElementNs
82983  *         self._origSaxStartNoNs = sax.startElement
82984  */
82985   __pyx_v_sax = __pyx_v_c_ctxt->sax;
82986
82987   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":95
82988  *         _ParserContext._initParserContext(self, c_ctxt)
82989  *         sax = c_ctxt.sax
82990  *         self._origSaxStart = sax.startElementNs             # <<<<<<<<<<<<<<
82991  *         self._origSaxStartNoNs = sax.startElement
82992  *         # only override start event handler if needed
82993  */
82994   __pyx_v_self->_origSaxStart = __pyx_v_sax->startElementNs;
82995
82996   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":96
82997  *         sax = c_ctxt.sax
82998  *         self._origSaxStart = sax.startElementNs
82999  *         self._origSaxStartNoNs = sax.startElement             # <<<<<<<<<<<<<<
83000  *         # only override start event handler if needed
83001  *         if self._event_filter == 0 or \
83002  */
83003   __pyx_v_self->_origSaxStartNoNs = __pyx_v_sax->startElement;
83004
83005   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":98
83006  *         self._origSaxStartNoNs = sax.startElement
83007  *         # only override start event handler if needed
83008  *         if self._event_filter == 0 or \             # <<<<<<<<<<<<<<
83009  *                self._event_filter & (ITERPARSE_FILTER_START | \
83010  *                                      ITERPARSE_FILTER_START_NS | \
83011  */
83012   if (!(__pyx_v_self->_event_filter == 0)) {
83013
83014     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":101
83015  *                self._event_filter & (ITERPARSE_FILTER_START | \
83016  *                                      ITERPARSE_FILTER_START_NS | \
83017  *                                      ITERPARSE_FILTER_END_NS):             # <<<<<<<<<<<<<<
83018  *             sax.startElementNs = _iterparseSaxStart
83019  *             sax.startElement = _iterparseSaxStartNoNs
83020  */
83021     __pyx_t_1 = (__pyx_v_self->_event_filter & ((__pyx_e_4lxml_5etree_ITERPARSE_FILTER_START | __pyx_e_4lxml_5etree_ITERPARSE_FILTER_START_NS) | __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END_NS));
83022   } else {
83023     __pyx_t_1 = (__pyx_v_self->_event_filter == 0);
83024   }
83025   if (__pyx_t_1) {
83026
83027     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":102
83028  *                                      ITERPARSE_FILTER_START_NS | \
83029  *                                      ITERPARSE_FILTER_END_NS):
83030  *             sax.startElementNs = _iterparseSaxStart             # <<<<<<<<<<<<<<
83031  *             sax.startElement = _iterparseSaxStartNoNs
83032  * 
83033  */
83034     __pyx_v_sax->startElementNs = __pyx_f_4lxml_5etree__iterparseSaxStart;
83035
83036     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":103
83037  *                                      ITERPARSE_FILTER_END_NS):
83038  *             sax.startElementNs = _iterparseSaxStart
83039  *             sax.startElement = _iterparseSaxStartNoNs             # <<<<<<<<<<<<<<
83040  * 
83041  *         self._origSaxEnd = sax.endElementNs
83042  */
83043     __pyx_v_sax->startElement = __pyx_f_4lxml_5etree__iterparseSaxStartNoNs;
83044     goto __pyx_L3;
83045   }
83046   __pyx_L3:;
83047
83048   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":105
83049  *             sax.startElement = _iterparseSaxStartNoNs
83050  * 
83051  *         self._origSaxEnd = sax.endElementNs             # <<<<<<<<<<<<<<
83052  *         self._origSaxEndNoNs = sax.endElement
83053  *         # only override end event handler if needed
83054  */
83055   __pyx_v_self->_origSaxEnd = __pyx_v_sax->endElementNs;
83056
83057   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":106
83058  * 
83059  *         self._origSaxEnd = sax.endElementNs
83060  *         self._origSaxEndNoNs = sax.endElement             # <<<<<<<<<<<<<<
83061  *         # only override end event handler if needed
83062  *         if self._event_filter == 0 or \
83063  */
83064   __pyx_v_self->_origSaxEndNoNs = __pyx_v_sax->endElement;
83065
83066   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":108
83067  *         self._origSaxEndNoNs = sax.endElement
83068  *         # only override end event handler if needed
83069  *         if self._event_filter == 0 or \             # <<<<<<<<<<<<<<
83070  *                self._event_filter & (ITERPARSE_FILTER_END | \
83071  *                                      ITERPARSE_FILTER_END_NS):
83072  */
83073   if (!(__pyx_v_self->_event_filter == 0)) {
83074
83075     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":110
83076  *         if self._event_filter == 0 or \
83077  *                self._event_filter & (ITERPARSE_FILTER_END | \
83078  *                                      ITERPARSE_FILTER_END_NS):             # <<<<<<<<<<<<<<
83079  *             sax.endElementNs = _iterparseSaxEnd
83080  *             sax.endElement = _iterparseSaxEndNoNs
83081  */
83082     __pyx_t_1 = (__pyx_v_self->_event_filter & (__pyx_e_4lxml_5etree_ITERPARSE_FILTER_END | __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END_NS));
83083   } else {
83084     __pyx_t_1 = (__pyx_v_self->_event_filter == 0);
83085   }
83086   if (__pyx_t_1) {
83087
83088     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":111
83089  *                self._event_filter & (ITERPARSE_FILTER_END | \
83090  *                                      ITERPARSE_FILTER_END_NS):
83091  *             sax.endElementNs = _iterparseSaxEnd             # <<<<<<<<<<<<<<
83092  *             sax.endElement = _iterparseSaxEndNoNs
83093  * 
83094  */
83095     __pyx_v_sax->endElementNs = __pyx_f_4lxml_5etree__iterparseSaxEnd;
83096
83097     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":112
83098  *                                      ITERPARSE_FILTER_END_NS):
83099  *             sax.endElementNs = _iterparseSaxEnd
83100  *             sax.endElement = _iterparseSaxEndNoNs             # <<<<<<<<<<<<<<
83101  * 
83102  *         self._origSaxComment = sax.comment
83103  */
83104     __pyx_v_sax->endElement = __pyx_f_4lxml_5etree__iterparseSaxEndNoNs;
83105     goto __pyx_L4;
83106   }
83107   __pyx_L4:;
83108
83109   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":114
83110  *             sax.endElement = _iterparseSaxEndNoNs
83111  * 
83112  *         self._origSaxComment = sax.comment             # <<<<<<<<<<<<<<
83113  *         if self._event_filter & ITERPARSE_FILTER_COMMENT:
83114  *             sax.comment = _iterparseSaxComment
83115  */
83116   __pyx_v_self->_origSaxComment = __pyx_v_sax->comment;
83117
83118   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":115
83119  * 
83120  *         self._origSaxComment = sax.comment
83121  *         if self._event_filter & ITERPARSE_FILTER_COMMENT:             # <<<<<<<<<<<<<<
83122  *             sax.comment = _iterparseSaxComment
83123  * 
83124  */
83125   __pyx_t_2 = (__pyx_v_self->_event_filter & __pyx_e_4lxml_5etree_ITERPARSE_FILTER_COMMENT);
83126   if (__pyx_t_2) {
83127
83128     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":116
83129  *         self._origSaxComment = sax.comment
83130  *         if self._event_filter & ITERPARSE_FILTER_COMMENT:
83131  *             sax.comment = _iterparseSaxComment             # <<<<<<<<<<<<<<
83132  * 
83133  *         self._origSaxPI = sax.processingInstruction
83134  */
83135     __pyx_v_sax->comment = __pyx_f_4lxml_5etree__iterparseSaxComment;
83136     goto __pyx_L5;
83137   }
83138   __pyx_L5:;
83139
83140   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":118
83141  *             sax.comment = _iterparseSaxComment
83142  * 
83143  *         self._origSaxPI = sax.processingInstruction             # <<<<<<<<<<<<<<
83144  *         if self._event_filter & ITERPARSE_FILTER_PI:
83145  *             sax.processingInstruction = _iterparseSaxPI
83146  */
83147   __pyx_v_self->_origSaxPI = __pyx_v_sax->processingInstruction;
83148
83149   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":119
83150  * 
83151  *         self._origSaxPI = sax.processingInstruction
83152  *         if self._event_filter & ITERPARSE_FILTER_PI:             # <<<<<<<<<<<<<<
83153  *             sax.processingInstruction = _iterparseSaxPI
83154  * 
83155  */
83156   __pyx_t_2 = (__pyx_v_self->_event_filter & __pyx_e_4lxml_5etree_ITERPARSE_FILTER_PI);
83157   if (__pyx_t_2) {
83158
83159     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":120
83160  *         self._origSaxPI = sax.processingInstruction
83161  *         if self._event_filter & ITERPARSE_FILTER_PI:
83162  *             sax.processingInstruction = _iterparseSaxPI             # <<<<<<<<<<<<<<
83163  * 
83164  *     cdef _setEventFilter(self, events, tag):
83165  */
83166     __pyx_v_sax->processingInstruction = __pyx_f_4lxml_5etree__iterparseSaxPI;
83167     goto __pyx_L6;
83168   }
83169   __pyx_L6:;
83170
83171   __Pyx_FinishRefcountContext();
83172 }
83173
83174 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":122
83175  *             sax.processingInstruction = _iterparseSaxPI
83176  * 
83177  *     cdef _setEventFilter(self, events, tag):             # <<<<<<<<<<<<<<
83178  *         self._event_filter = _buildIterparseEventFilter(events)
83179  *         if tag is None or tag == u'*':
83180  */
83181
83182 static  PyObject *__pyx_f_4lxml_5etree_17_IterparseContext__setEventFilter(struct __pyx_obj_4lxml_5etree__IterparseContext *__pyx_v_self, PyObject *__pyx_v_events, PyObject *__pyx_v_tag) {
83183   PyObject *__pyx_v_href;
83184   PyObject *__pyx_v_name;
83185   PyObject *__pyx_r = NULL;
83186   PyObject *__pyx_1 = 0;
83187   PyObject *__pyx_2 = 0;
83188   PyObject *__pyx_3 = 0;
83189   int __pyx_t_1;
83190   int __pyx_t_2;
83191   PyObject *__pyx_t_3 = NULL;
83192   int __pyx_t_4;
83193   int __pyx_t_5;
83194   __Pyx_SetupRefcountContext("_setEventFilter");
83195   __pyx_v_href = Py_None; __Pyx_INCREF(Py_None);
83196   __pyx_v_name = Py_None; __Pyx_INCREF(Py_None);
83197
83198   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":123
83199  * 
83200  *     cdef _setEventFilter(self, events, tag):
83201  *         self._event_filter = _buildIterparseEventFilter(events)             # <<<<<<<<<<<<<<
83202  *         if tag is None or tag == u'*':
83203  *             self._tag_href  = NULL
83204  */
83205   __pyx_t_1 = __pyx_f_4lxml_5etree__buildIterparseEventFilter(__pyx_v_events); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83206   __pyx_v_self->_event_filter = __pyx_t_1;
83207
83208   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":124
83209  *     cdef _setEventFilter(self, events, tag):
83210  *         self._event_filter = _buildIterparseEventFilter(events)
83211  *         if tag is None or tag == u'*':             # <<<<<<<<<<<<<<
83212  *             self._tag_href  = NULL
83213  *             self._tag_name  = NULL
83214  */
83215   __pyx_t_2 = (__pyx_v_tag == Py_None);
83216   if (!__pyx_t_2) {
83217     __pyx_t_3 = PyObject_RichCompare(__pyx_v_tag, ((PyObject *)__pyx_kp_527), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83218     __Pyx_GOTREF(__pyx_t_3);
83219     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83220     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
83221     __pyx_t_5 = __pyx_t_4;
83222   } else {
83223     __pyx_t_5 = __pyx_t_2;
83224   }
83225   if (__pyx_t_5) {
83226
83227     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":125
83228  *         self._event_filter = _buildIterparseEventFilter(events)
83229  *         if tag is None or tag == u'*':
83230  *             self._tag_href  = NULL             # <<<<<<<<<<<<<<
83231  *             self._tag_name  = NULL
83232  *         else:
83233  */
83234     __pyx_v_self->_tag_href = NULL;
83235
83236     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":126
83237  *         if tag is None or tag == u'*':
83238  *             self._tag_href  = NULL
83239  *             self._tag_name  = NULL             # <<<<<<<<<<<<<<
83240  *         else:
83241  *             self._tag_tuple = _getNsTag(tag)
83242  */
83243     __pyx_v_self->_tag_name = NULL;
83244     goto __pyx_L3;
83245   }
83246   /*else*/ {
83247
83248     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":128
83249  *             self._tag_name  = NULL
83250  *         else:
83251  *             self._tag_tuple = _getNsTag(tag)             # <<<<<<<<<<<<<<
83252  *             href, name = self._tag_tuple
83253  *             if href is None or href == '*':
83254  */
83255     __pyx_t_3 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_tag); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83256     __Pyx_GOTREF(__pyx_t_3);
83257     if (!(likely(PyTuple_CheckExact(__pyx_t_3)) || (__pyx_t_3) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected tuple, got %s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83258     __Pyx_GIVEREF(__pyx_t_3);
83259     __Pyx_GOTREF(__pyx_v_self->_tag_tuple);
83260     __Pyx_DECREF(((PyObject *)__pyx_v_self->_tag_tuple));
83261     __pyx_v_self->_tag_tuple = ((PyObject *)__pyx_t_3);
83262     __pyx_t_3 = 0;
83263
83264     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":129
83265  *         else:
83266  *             self._tag_tuple = _getNsTag(tag)
83267  *             href, name = self._tag_tuple             # <<<<<<<<<<<<<<
83268  *             if href is None or href == '*':
83269  *                 self._tag_href = NULL
83270  */
83271     if (likely(((PyObject *)__pyx_v_self->_tag_tuple) != Py_None) && likely(PyTuple_GET_SIZE(((PyObject *)__pyx_v_self->_tag_tuple)) == 2)) {
83272       PyObject* tuple = ((PyObject *)__pyx_v_self->_tag_tuple);
83273       __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
83274       __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
83275       __Pyx_DECREF(__pyx_v_href);
83276       __pyx_v_href = __pyx_2;
83277       __pyx_2 = 0;
83278       __Pyx_DECREF(__pyx_v_name);
83279       __pyx_v_name = __pyx_3;
83280       __pyx_3 = 0;
83281     } else {
83282       __Pyx_UnpackTupleError(((PyObject *)__pyx_v_self->_tag_tuple), 2);
83283       {__pyx_filename = __pyx_f[14]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83284     }
83285
83286     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":130
83287  *             self._tag_tuple = _getNsTag(tag)
83288  *             href, name = self._tag_tuple
83289  *             if href is None or href == '*':             # <<<<<<<<<<<<<<
83290  *                 self._tag_href = NULL
83291  *             else:
83292  */
83293     __pyx_t_5 = (__pyx_v_href == Py_None);
83294     if (!__pyx_t_5) {
83295       __pyx_t_3 = PyObject_RichCompare(__pyx_v_href, __pyx_kp_528, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83296       __Pyx_GOTREF(__pyx_t_3);
83297       __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83298       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
83299       __pyx_t_4 = __pyx_t_2;
83300     } else {
83301       __pyx_t_4 = __pyx_t_5;
83302     }
83303     if (__pyx_t_4) {
83304
83305       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":131
83306  *             href, name = self._tag_tuple
83307  *             if href is None or href == '*':
83308  *                 self._tag_href = NULL             # <<<<<<<<<<<<<<
83309  *             else:
83310  *                 self._tag_href = _cstr(href)
83311  */
83312       __pyx_v_self->_tag_href = NULL;
83313       goto __pyx_L4;
83314     }
83315     /*else*/ {
83316
83317       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":133
83318  *                 self._tag_href = NULL
83319  *             else:
83320  *                 self._tag_href = _cstr(href)             # <<<<<<<<<<<<<<
83321  *             if name is None or name == '*':
83322  *                 self._tag_name = NULL
83323  */
83324       __pyx_v_self->_tag_href = PyString_AS_STRING(__pyx_v_href);
83325     }
83326     __pyx_L4:;
83327
83328     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":134
83329  *             else:
83330  *                 self._tag_href = _cstr(href)
83331  *             if name is None or name == '*':             # <<<<<<<<<<<<<<
83332  *                 self._tag_name = NULL
83333  *             else:
83334  */
83335     __pyx_t_4 = (__pyx_v_name == Py_None);
83336     if (!__pyx_t_4) {
83337       __pyx_t_3 = PyObject_RichCompare(__pyx_v_name, __pyx_kp_529, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83338       __Pyx_GOTREF(__pyx_t_3);
83339       __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83340       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
83341       __pyx_t_2 = __pyx_t_5;
83342     } else {
83343       __pyx_t_2 = __pyx_t_4;
83344     }
83345     if (__pyx_t_2) {
83346
83347       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":135
83348  *                 self._tag_href = _cstr(href)
83349  *             if name is None or name == '*':
83350  *                 self._tag_name = NULL             # <<<<<<<<<<<<<<
83351  *             else:
83352  *                 self._tag_name = _cstr(name)
83353  */
83354       __pyx_v_self->_tag_name = NULL;
83355       goto __pyx_L5;
83356     }
83357     /*else*/ {
83358
83359       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":137
83360  *                 self._tag_name = NULL
83361  *             else:
83362  *                 self._tag_name = _cstr(name)             # <<<<<<<<<<<<<<
83363  *             if self._tag_href is NULL and self._tag_name is NULL:
83364  *                 self._tag_tuple = None
83365  */
83366       __pyx_v_self->_tag_name = PyString_AS_STRING(__pyx_v_name);
83367     }
83368     __pyx_L5:;
83369
83370     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":138
83371  *             else:
83372  *                 self._tag_name = _cstr(name)
83373  *             if self._tag_href is NULL and self._tag_name is NULL:             # <<<<<<<<<<<<<<
83374  *                 self._tag_tuple = None
83375  * 
83376  */
83377     if ((__pyx_v_self->_tag_href == NULL)) {
83378       __pyx_t_2 = (__pyx_v_self->_tag_name == NULL);
83379     } else {
83380       __pyx_t_2 = (__pyx_v_self->_tag_href == NULL);
83381     }
83382     if (__pyx_t_2) {
83383
83384       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":139
83385  *                 self._tag_name = _cstr(name)
83386  *             if self._tag_href is NULL and self._tag_name is NULL:
83387  *                 self._tag_tuple = None             # <<<<<<<<<<<<<<
83388  * 
83389  *     cdef int startNode(self, xmlNode* c_node) except -1:
83390  */
83391       __Pyx_INCREF(Py_None);
83392       __Pyx_GIVEREF(Py_None);
83393       __Pyx_GOTREF(__pyx_v_self->_tag_tuple);
83394       __Pyx_DECREF(((PyObject *)__pyx_v_self->_tag_tuple));
83395       __pyx_v_self->_tag_tuple = ((PyObject *)Py_None);
83396       goto __pyx_L6;
83397     }
83398     __pyx_L6:;
83399   }
83400   __pyx_L3:;
83401
83402   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
83403   goto __pyx_L0;
83404   __pyx_L1_error:;
83405   __Pyx_XDECREF(__pyx_1);
83406   __Pyx_XDECREF(__pyx_2);
83407   __Pyx_XDECREF(__pyx_3);
83408   __Pyx_XDECREF(__pyx_t_3);
83409   __Pyx_AddTraceback("lxml.etree._IterparseContext._setEventFilter");
83410   __pyx_r = 0;
83411   __pyx_L0:;
83412   __Pyx_DECREF(__pyx_v_href);
83413   __Pyx_DECREF(__pyx_v_name);
83414   __Pyx_XGIVEREF(__pyx_r);
83415   __Pyx_FinishRefcountContext();
83416   return __pyx_r;
83417 }
83418
83419 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":141
83420  *                 self._tag_tuple = None
83421  * 
83422  *     cdef int startNode(self, xmlNode* c_node) except -1:             # <<<<<<<<<<<<<<
83423  *         cdef xmlNs* c_ns
83424  *         cdef int ns_count
83425  */
83426
83427 static  int __pyx_f_4lxml_5etree_17_IterparseContext_startNode(struct __pyx_obj_4lxml_5etree__IterparseContext *__pyx_v_self, xmlNode *__pyx_v_c_node) {
83428   int __pyx_v_ns_count;
83429   PyObject *__pyx_v_node;
83430   int __pyx_r;
83431   int __pyx_t_1;
83432   PyObject *__pyx_t_2 = NULL;
83433   int __pyx_t_3;
83434   int __pyx_t_4;
83435   __Pyx_SetupRefcountContext("startNode");
83436   __pyx_v_node = Py_None; __Pyx_INCREF(Py_None);
83437
83438   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":144
83439  *         cdef xmlNs* c_ns
83440  *         cdef int ns_count
83441  *         if self._event_filter & ITERPARSE_FILTER_START_NS:             # <<<<<<<<<<<<<<
83442  *             ns_count = _appendStartNsEvents(c_node, self._events)
83443  *         elif self._event_filter & ITERPARSE_FILTER_END_NS:
83444  */
83445   __pyx_t_1 = (__pyx_v_self->_event_filter & __pyx_e_4lxml_5etree_ITERPARSE_FILTER_START_NS);
83446   if (__pyx_t_1) {
83447
83448     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":145
83449  *         cdef int ns_count
83450  *         if self._event_filter & ITERPARSE_FILTER_START_NS:
83451  *             ns_count = _appendStartNsEvents(c_node, self._events)             # <<<<<<<<<<<<<<
83452  *         elif self._event_filter & ITERPARSE_FILTER_END_NS:
83453  *             ns_count = _countNsDefs(c_node)
83454  */
83455     __pyx_v_ns_count = __pyx_f_4lxml_5etree__appendStartNsEvents(__pyx_v_c_node, __pyx_v_self->_events);
83456     goto __pyx_L3;
83457   }
83458
83459   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":146
83460  *         if self._event_filter & ITERPARSE_FILTER_START_NS:
83461  *             ns_count = _appendStartNsEvents(c_node, self._events)
83462  *         elif self._event_filter & ITERPARSE_FILTER_END_NS:             # <<<<<<<<<<<<<<
83463  *             ns_count = _countNsDefs(c_node)
83464  *         if self._event_filter & ITERPARSE_FILTER_END_NS:
83465  */
83466   __pyx_t_1 = (__pyx_v_self->_event_filter & __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END_NS);
83467   if (__pyx_t_1) {
83468
83469     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":147
83470  *             ns_count = _appendStartNsEvents(c_node, self._events)
83471  *         elif self._event_filter & ITERPARSE_FILTER_END_NS:
83472  *             ns_count = _countNsDefs(c_node)             # <<<<<<<<<<<<<<
83473  *         if self._event_filter & ITERPARSE_FILTER_END_NS:
83474  *             self._ns_stack.append(ns_count)
83475  */
83476     __pyx_v_ns_count = __pyx_f_4lxml_5etree__countNsDefs(__pyx_v_c_node);
83477     goto __pyx_L3;
83478   }
83479   __pyx_L3:;
83480
83481   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":148
83482  *         elif self._event_filter & ITERPARSE_FILTER_END_NS:
83483  *             ns_count = _countNsDefs(c_node)
83484  *         if self._event_filter & ITERPARSE_FILTER_END_NS:             # <<<<<<<<<<<<<<
83485  *             self._ns_stack.append(ns_count)
83486  *         if self._root is None:
83487  */
83488   __pyx_t_1 = (__pyx_v_self->_event_filter & __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END_NS);
83489   if (__pyx_t_1) {
83490
83491     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":149
83492  *             ns_count = _countNsDefs(c_node)
83493  *         if self._event_filter & ITERPARSE_FILTER_END_NS:
83494  *             self._ns_stack.append(ns_count)             # <<<<<<<<<<<<<<
83495  *         if self._root is None:
83496  *             if self._doc is None:
83497  */
83498     __pyx_t_2 = PyInt_FromLong(__pyx_v_ns_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83499     __Pyx_GOTREF(__pyx_t_2);
83500     __pyx_t_1 = PyList_Append(((PyObject *)__pyx_v_self->_ns_stack), __pyx_t_2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83501     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
83502     goto __pyx_L4;
83503   }
83504   __pyx_L4:;
83505
83506   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":150
83507  *         if self._event_filter & ITERPARSE_FILTER_END_NS:
83508  *             self._ns_stack.append(ns_count)
83509  *         if self._root is None:             # <<<<<<<<<<<<<<
83510  *             if self._doc is None:
83511  *                 self._doc = _documentFactory(c_node.doc, None)
83512  */
83513   __pyx_t_3 = (((PyObject *)__pyx_v_self->_root) == Py_None);
83514   if (__pyx_t_3) {
83515
83516     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":151
83517  *             self._ns_stack.append(ns_count)
83518  *         if self._root is None:
83519  *             if self._doc is None:             # <<<<<<<<<<<<<<
83520  *                 self._doc = _documentFactory(c_node.doc, None)
83521  *             self._root = self._doc.getroot()
83522  */
83523     __pyx_t_3 = (((PyObject *)__pyx_v_self->_doc) == Py_None);
83524     if (__pyx_t_3) {
83525
83526       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":152
83527  *         if self._root is None:
83528  *             if self._doc is None:
83529  *                 self._doc = _documentFactory(c_node.doc, None)             # <<<<<<<<<<<<<<
83530  *             self._root = self._doc.getroot()
83531  *         if self._tag_tuple is None or \
83532  */
83533       __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_node->doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83534       __Pyx_GOTREF(__pyx_t_2);
83535       __Pyx_GIVEREF(__pyx_t_2);
83536       __Pyx_GOTREF(__pyx_v_self->_doc);
83537       __Pyx_DECREF(((PyObject *)__pyx_v_self->_doc));
83538       __pyx_v_self->_doc = ((struct LxmlDocument *)__pyx_t_2);
83539       __pyx_t_2 = 0;
83540       goto __pyx_L6;
83541     }
83542     __pyx_L6:;
83543
83544     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":153
83545  *             if self._doc is None:
83546  *                 self._doc = _documentFactory(c_node.doc, None)
83547  *             self._root = self._doc.getroot()             # <<<<<<<<<<<<<<
83548  *         if self._tag_tuple is None or \
83549  *                _tagMatches(c_node, self._tag_href, self._tag_name):
83550  */
83551     __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_self->_doc->__pyx_vtab)->getroot(__pyx_v_self->_doc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83552     __Pyx_GOTREF(__pyx_t_2);
83553     if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83554     __Pyx_GIVEREF(__pyx_t_2);
83555     __Pyx_GOTREF(__pyx_v_self->_root);
83556     __Pyx_DECREF(((PyObject *)__pyx_v_self->_root));
83557     __pyx_v_self->_root = ((struct LxmlElement *)__pyx_t_2);
83558     __pyx_t_2 = 0;
83559     goto __pyx_L5;
83560   }
83561   __pyx_L5:;
83562
83563   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":154
83564  *                 self._doc = _documentFactory(c_node.doc, None)
83565  *             self._root = self._doc.getroot()
83566  *         if self._tag_tuple is None or \             # <<<<<<<<<<<<<<
83567  *                _tagMatches(c_node, self._tag_href, self._tag_name):
83568  *             node = _elementFactory(self._doc, c_node)
83569  */
83570   __pyx_t_3 = (__pyx_v_self->_tag_tuple == ((PyObject *)Py_None));
83571   if (!__pyx_t_3) {
83572
83573     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":155
83574  *             self._root = self._doc.getroot()
83575  *         if self._tag_tuple is None or \
83576  *                _tagMatches(c_node, self._tag_href, self._tag_name):             # <<<<<<<<<<<<<<
83577  *             node = _elementFactory(self._doc, c_node)
83578  *             if self._event_filter & ITERPARSE_FILTER_END:
83579  */
83580     __pyx_t_4 = __pyx_f_4lxml_5etree__tagMatches(__pyx_v_c_node, __pyx_v_self->_tag_href, __pyx_v_self->_tag_name);
83581   } else {
83582     __pyx_t_4 = __pyx_t_3;
83583   }
83584   if (__pyx_t_4) {
83585
83586     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":156
83587  *         if self._tag_tuple is None or \
83588  *                _tagMatches(c_node, self._tag_href, self._tag_name):
83589  *             node = _elementFactory(self._doc, c_node)             # <<<<<<<<<<<<<<
83590  *             if self._event_filter & ITERPARSE_FILTER_END:
83591  *                 self._node_stack.append(node)
83592  */
83593     __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_self->_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83594     __Pyx_GOTREF(__pyx_t_2);
83595     __Pyx_DECREF(__pyx_v_node);
83596     __pyx_v_node = __pyx_t_2;
83597     __pyx_t_2 = 0;
83598
83599     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":157
83600  *                _tagMatches(c_node, self._tag_href, self._tag_name):
83601  *             node = _elementFactory(self._doc, c_node)
83602  *             if self._event_filter & ITERPARSE_FILTER_END:             # <<<<<<<<<<<<<<
83603  *                 self._node_stack.append(node)
83604  *             if self._event_filter & ITERPARSE_FILTER_START:
83605  */
83606     __pyx_t_1 = (__pyx_v_self->_event_filter & __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END);
83607     if (__pyx_t_1) {
83608
83609       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":158
83610  *             node = _elementFactory(self._doc, c_node)
83611  *             if self._event_filter & ITERPARSE_FILTER_END:
83612  *                 self._node_stack.append(node)             # <<<<<<<<<<<<<<
83613  *             if self._event_filter & ITERPARSE_FILTER_START:
83614  *                 self._events.append( (u"start", node) )
83615  */
83616       __pyx_t_1 = PyList_Append(((PyObject *)__pyx_v_self->_node_stack), __pyx_v_node); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83617       goto __pyx_L8;
83618     }
83619     __pyx_L8:;
83620
83621     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":159
83622  *             if self._event_filter & ITERPARSE_FILTER_END:
83623  *                 self._node_stack.append(node)
83624  *             if self._event_filter & ITERPARSE_FILTER_START:             # <<<<<<<<<<<<<<
83625  *                 self._events.append( (u"start", node) )
83626  *         return 0
83627  */
83628     __pyx_t_1 = (__pyx_v_self->_event_filter & __pyx_e_4lxml_5etree_ITERPARSE_FILTER_START);
83629     if (__pyx_t_1) {
83630
83631       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":160
83632  *                 self._node_stack.append(node)
83633  *             if self._event_filter & ITERPARSE_FILTER_START:
83634  *                 self._events.append( (u"start", node) )             # <<<<<<<<<<<<<<
83635  *         return 0
83636  * 
83637  */
83638       __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83639       __Pyx_GOTREF(((PyObject *)__pyx_t_2));
83640       __Pyx_INCREF(((PyObject *)__pyx_kp_530));
83641       PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_530));
83642       __Pyx_GIVEREF(((PyObject *)__pyx_kp_530));
83643       __Pyx_INCREF(__pyx_v_node);
83644       PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_node);
83645       __Pyx_GIVEREF(__pyx_v_node);
83646       __pyx_t_1 = PyList_Append(((PyObject *)__pyx_v_self->_events), ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83647       __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
83648       goto __pyx_L9;
83649     }
83650     __pyx_L9:;
83651     goto __pyx_L7;
83652   }
83653   __pyx_L7:;
83654
83655   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":161
83656  *             if self._event_filter & ITERPARSE_FILTER_START:
83657  *                 self._events.append( (u"start", node) )
83658  *         return 0             # <<<<<<<<<<<<<<
83659  * 
83660  *     cdef int endNode(self, xmlNode* c_node) except -1:
83661  */
83662   __pyx_r = 0;
83663   goto __pyx_L0;
83664
83665   __pyx_r = 0;
83666   goto __pyx_L0;
83667   __pyx_L1_error:;
83668   __Pyx_XDECREF(__pyx_t_2);
83669   __Pyx_AddTraceback("lxml.etree._IterparseContext.startNode");
83670   __pyx_r = -1;
83671   __pyx_L0:;
83672   __Pyx_DECREF(__pyx_v_node);
83673   __Pyx_FinishRefcountContext();
83674   return __pyx_r;
83675 }
83676
83677 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":163
83678  *         return 0
83679  * 
83680  *     cdef int endNode(self, xmlNode* c_node) except -1:             # <<<<<<<<<<<<<<
83681  *         cdef xmlNs* c_ns
83682  *         cdef int ns_count
83683  */
83684
83685 static  int __pyx_f_4lxml_5etree_17_IterparseContext_endNode(struct __pyx_obj_4lxml_5etree__IterparseContext *__pyx_v_self, xmlNode *__pyx_v_c_node) {
83686   int __pyx_v_ns_count;
83687   PyObject *__pyx_v_node;
83688   PyObject *__pyx_v_event;
83689   PyObject *__pyx_v_i;
83690   int __pyx_r;
83691   long __pyx_1;
83692   int __pyx_t_1;
83693   int __pyx_t_2;
83694   int __pyx_t_3;
83695   PyObject *__pyx_t_4 = NULL;
83696   int __pyx_t_5;
83697   __Pyx_SetupRefcountContext("endNode");
83698   __pyx_v_node = Py_None; __Pyx_INCREF(Py_None);
83699   __pyx_v_event = Py_None; __Pyx_INCREF(Py_None);
83700   __pyx_v_i = Py_None; __Pyx_INCREF(Py_None);
83701
83702   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":166
83703  *         cdef xmlNs* c_ns
83704  *         cdef int ns_count
83705  *         if self._event_filter & ITERPARSE_FILTER_END:             # <<<<<<<<<<<<<<
83706  *             if self._tag_tuple is None or \
83707  *                    _tagMatches(c_node, self._tag_href, self._tag_name):
83708  */
83709   __pyx_t_1 = (__pyx_v_self->_event_filter & __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END);
83710   if (__pyx_t_1) {
83711
83712     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":167
83713  *         cdef int ns_count
83714  *         if self._event_filter & ITERPARSE_FILTER_END:
83715  *             if self._tag_tuple is None or \             # <<<<<<<<<<<<<<
83716  *                    _tagMatches(c_node, self._tag_href, self._tag_name):
83717  *                 if self._event_filter & (ITERPARSE_FILTER_START | \
83718  */
83719     __pyx_t_2 = (__pyx_v_self->_tag_tuple == ((PyObject *)Py_None));
83720     if (!__pyx_t_2) {
83721
83722       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":168
83723  *         if self._event_filter & ITERPARSE_FILTER_END:
83724  *             if self._tag_tuple is None or \
83725  *                    _tagMatches(c_node, self._tag_href, self._tag_name):             # <<<<<<<<<<<<<<
83726  *                 if self._event_filter & (ITERPARSE_FILTER_START | \
83727  *                                          ITERPARSE_FILTER_START_NS | \
83728  */
83729       __pyx_t_3 = __pyx_f_4lxml_5etree__tagMatches(__pyx_v_c_node, __pyx_v_self->_tag_href, __pyx_v_self->_tag_name);
83730     } else {
83731       __pyx_t_3 = __pyx_t_2;
83732     }
83733     if (__pyx_t_3) {
83734
83735       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":171
83736  *                 if self._event_filter & (ITERPARSE_FILTER_START | \
83737  *                                          ITERPARSE_FILTER_START_NS | \
83738  *                                          ITERPARSE_FILTER_END_NS):             # <<<<<<<<<<<<<<
83739  *                     node = self._pop_node()
83740  *                 else:
83741  */
83742       __pyx_t_1 = (__pyx_v_self->_event_filter & ((__pyx_e_4lxml_5etree_ITERPARSE_FILTER_START | __pyx_e_4lxml_5etree_ITERPARSE_FILTER_START_NS) | __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END_NS));
83743       if (__pyx_t_1) {
83744
83745         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":172
83746  *                                          ITERPARSE_FILTER_START_NS | \
83747  *                                          ITERPARSE_FILTER_END_NS):
83748  *                     node = self._pop_node()             # <<<<<<<<<<<<<<
83749  *                 else:
83750  *                     if self._root is None:
83751  */
83752         __pyx_t_4 = PyObject_Call(__pyx_v_self->_pop_node, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83753         __Pyx_GOTREF(__pyx_t_4);
83754         __Pyx_DECREF(__pyx_v_node);
83755         __pyx_v_node = __pyx_t_4;
83756         __pyx_t_4 = 0;
83757         goto __pyx_L5;
83758       }
83759       /*else*/ {
83760
83761         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":174
83762  *                     node = self._pop_node()
83763  *                 else:
83764  *                     if self._root is None:             # <<<<<<<<<<<<<<
83765  *                         if self._doc is None:
83766  *                             self._doc = _documentFactory(c_node.doc, None)
83767  */
83768         __pyx_t_3 = (((PyObject *)__pyx_v_self->_root) == Py_None);
83769         if (__pyx_t_3) {
83770
83771           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":175
83772  *                 else:
83773  *                     if self._root is None:
83774  *                         if self._doc is None:             # <<<<<<<<<<<<<<
83775  *                             self._doc = _documentFactory(c_node.doc, None)
83776  *                         self._root = self._doc.getroot()
83777  */
83778           __pyx_t_3 = (((PyObject *)__pyx_v_self->_doc) == Py_None);
83779           if (__pyx_t_3) {
83780
83781             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":176
83782  *                     if self._root is None:
83783  *                         if self._doc is None:
83784  *                             self._doc = _documentFactory(c_node.doc, None)             # <<<<<<<<<<<<<<
83785  *                         self._root = self._doc.getroot()
83786  *                     node = _elementFactory(self._doc, c_node)
83787  */
83788             __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_node->doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83789             __Pyx_GOTREF(__pyx_t_4);
83790             __Pyx_GIVEREF(__pyx_t_4);
83791             __Pyx_GOTREF(__pyx_v_self->_doc);
83792             __Pyx_DECREF(((PyObject *)__pyx_v_self->_doc));
83793             __pyx_v_self->_doc = ((struct LxmlDocument *)__pyx_t_4);
83794             __pyx_t_4 = 0;
83795             goto __pyx_L7;
83796           }
83797           __pyx_L7:;
83798
83799           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":177
83800  *                         if self._doc is None:
83801  *                             self._doc = _documentFactory(c_node.doc, None)
83802  *                         self._root = self._doc.getroot()             # <<<<<<<<<<<<<<
83803  *                     node = _elementFactory(self._doc, c_node)
83804  *                 self._events.append( (u"end", node) )
83805  */
83806           __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_self->_doc->__pyx_vtab)->getroot(__pyx_v_self->_doc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83807           __Pyx_GOTREF(__pyx_t_4);
83808           if (!(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83809           __Pyx_GIVEREF(__pyx_t_4);
83810           __Pyx_GOTREF(__pyx_v_self->_root);
83811           __Pyx_DECREF(((PyObject *)__pyx_v_self->_root));
83812           __pyx_v_self->_root = ((struct LxmlElement *)__pyx_t_4);
83813           __pyx_t_4 = 0;
83814           goto __pyx_L6;
83815         }
83816         __pyx_L6:;
83817
83818         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":178
83819  *                             self._doc = _documentFactory(c_node.doc, None)
83820  *                         self._root = self._doc.getroot()
83821  *                     node = _elementFactory(self._doc, c_node)             # <<<<<<<<<<<<<<
83822  *                 self._events.append( (u"end", node) )
83823  * 
83824  */
83825         __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_self->_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83826         __Pyx_GOTREF(__pyx_t_4);
83827         __Pyx_DECREF(__pyx_v_node);
83828         __pyx_v_node = __pyx_t_4;
83829         __pyx_t_4 = 0;
83830       }
83831       __pyx_L5:;
83832
83833       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":179
83834  *                         self._root = self._doc.getroot()
83835  *                     node = _elementFactory(self._doc, c_node)
83836  *                 self._events.append( (u"end", node) )             # <<<<<<<<<<<<<<
83837  * 
83838  *         if self._event_filter & ITERPARSE_FILTER_END_NS:
83839  */
83840       __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83841       __Pyx_GOTREF(((PyObject *)__pyx_t_4));
83842       __Pyx_INCREF(((PyObject *)__pyx_kp_531));
83843       PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_531));
83844       __Pyx_GIVEREF(((PyObject *)__pyx_kp_531));
83845       __Pyx_INCREF(__pyx_v_node);
83846       PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_node);
83847       __Pyx_GIVEREF(__pyx_v_node);
83848       __pyx_t_1 = PyList_Append(((PyObject *)__pyx_v_self->_events), ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83849       __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
83850       goto __pyx_L4;
83851     }
83852     __pyx_L4:;
83853     goto __pyx_L3;
83854   }
83855   __pyx_L3:;
83856
83857   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":181
83858  *                 self._events.append( (u"end", node) )
83859  * 
83860  *         if self._event_filter & ITERPARSE_FILTER_END_NS:             # <<<<<<<<<<<<<<
83861  *             ns_count = self._pop_ns()
83862  *             if ns_count > 0:
83863  */
83864   __pyx_t_1 = (__pyx_v_self->_event_filter & __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END_NS);
83865   if (__pyx_t_1) {
83866
83867     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":182
83868  * 
83869  *         if self._event_filter & ITERPARSE_FILTER_END_NS:
83870  *             ns_count = self._pop_ns()             # <<<<<<<<<<<<<<
83871  *             if ns_count > 0:
83872  *                 event = (u"end-ns", None)
83873  */
83874     __pyx_t_4 = PyObject_Call(__pyx_v_self->_pop_ns, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83875     __Pyx_GOTREF(__pyx_t_4);
83876     __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83877     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
83878     __pyx_v_ns_count = __pyx_t_1;
83879
83880     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":183
83881  *         if self._event_filter & ITERPARSE_FILTER_END_NS:
83882  *             ns_count = self._pop_ns()
83883  *             if ns_count > 0:             # <<<<<<<<<<<<<<
83884  *                 event = (u"end-ns", None)
83885  *                 for i from 0 <= i < ns_count:
83886  */
83887     __pyx_t_3 = (__pyx_v_ns_count > 0);
83888     if (__pyx_t_3) {
83889
83890       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":184
83891  *             ns_count = self._pop_ns()
83892  *             if ns_count > 0:
83893  *                 event = (u"end-ns", None)             # <<<<<<<<<<<<<<
83894  *                 for i from 0 <= i < ns_count:
83895  *                     self._events.append(event)
83896  */
83897       __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83898       __Pyx_GOTREF(((PyObject *)__pyx_t_4));
83899       __Pyx_INCREF(((PyObject *)__pyx_kp_532));
83900       PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_532));
83901       __Pyx_GIVEREF(((PyObject *)__pyx_kp_532));
83902       __Pyx_INCREF(Py_None);
83903       PyTuple_SET_ITEM(__pyx_t_4, 1, Py_None);
83904       __Pyx_GIVEREF(Py_None);
83905       __Pyx_DECREF(__pyx_v_event);
83906       __pyx_v_event = ((PyObject *)__pyx_t_4);
83907       __pyx_t_4 = 0;
83908
83909       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":185
83910  *             if ns_count > 0:
83911  *                 event = (u"end-ns", None)
83912  *                 for i from 0 <= i < ns_count:             # <<<<<<<<<<<<<<
83913  *                     self._events.append(event)
83914  *         return 0
83915  */
83916       __pyx_t_1 = __pyx_v_ns_count;
83917       for (__pyx_1 = 0; __pyx_1 < __pyx_t_1; __pyx_1++) {
83918         __pyx_t_4 = PyInt_FromLong(__pyx_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83919         __Pyx_GOTREF(__pyx_t_4);
83920         __Pyx_DECREF(__pyx_v_i);
83921         __pyx_v_i = __pyx_t_4;
83922         __pyx_t_4 = 0;
83923
83924         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":186
83925  *                 event = (u"end-ns", None)
83926  *                 for i from 0 <= i < ns_count:
83927  *                     self._events.append(event)             # <<<<<<<<<<<<<<
83928  *         return 0
83929  * 
83930  */
83931         __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_self->_events), __pyx_v_event); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83932         __pyx_1 = __Pyx_PyInt_AsLong(__pyx_v_i); if (unlikely((__pyx_1 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83933       }
83934
83935       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":185
83936  *             if ns_count > 0:
83937  *                 event = (u"end-ns", None)
83938  *                 for i from 0 <= i < ns_count:             # <<<<<<<<<<<<<<
83939  *                     self._events.append(event)
83940  *         return 0
83941  */
83942       __pyx_t_4 = PyInt_FromLong(__pyx_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
83943       __Pyx_GOTREF(__pyx_t_4);
83944       __Pyx_DECREF(__pyx_v_i);
83945       __pyx_v_i = __pyx_t_4;
83946       __pyx_t_4 = 0;
83947       goto __pyx_L9;
83948     }
83949     __pyx_L9:;
83950     goto __pyx_L8;
83951   }
83952   __pyx_L8:;
83953
83954   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":187
83955  *                 for i from 0 <= i < ns_count:
83956  *                     self._events.append(event)
83957  *         return 0             # <<<<<<<<<<<<<<
83958  * 
83959  *     cdef int pushEvent(self, event, xmlNode* c_node) except -1:
83960  */
83961   __pyx_r = 0;
83962   goto __pyx_L0;
83963
83964   __pyx_r = 0;
83965   goto __pyx_L0;
83966   __pyx_L1_error:;
83967   __Pyx_XDECREF(__pyx_t_4);
83968   __Pyx_AddTraceback("lxml.etree._IterparseContext.endNode");
83969   __pyx_r = -1;
83970   __pyx_L0:;
83971   __Pyx_DECREF(__pyx_v_node);
83972   __Pyx_DECREF(__pyx_v_event);
83973   __Pyx_DECREF(__pyx_v_i);
83974   __Pyx_FinishRefcountContext();
83975   return __pyx_r;
83976 }
83977
83978 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":189
83979  *         return 0
83980  * 
83981  *     cdef int pushEvent(self, event, xmlNode* c_node) except -1:             # <<<<<<<<<<<<<<
83982  *         cdef _Element root
83983  *         if self._doc is None:
83984  */
83985
83986 static  int __pyx_f_4lxml_5etree_17_IterparseContext_pushEvent(struct __pyx_obj_4lxml_5etree__IterparseContext *__pyx_v_self, PyObject *__pyx_v_event, xmlNode *__pyx_v_c_node) {
83987   struct LxmlElement *__pyx_v_root;
83988   PyObject *__pyx_v_node;
83989   int __pyx_r;
83990   int __pyx_t_1;
83991   PyObject *__pyx_t_2 = NULL;
83992   int __pyx_t_3;
83993   int __pyx_t_4;
83994   __Pyx_SetupRefcountContext("pushEvent");
83995   __pyx_v_root = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
83996   __pyx_v_node = Py_None; __Pyx_INCREF(Py_None);
83997
83998   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":191
83999  *     cdef int pushEvent(self, event, xmlNode* c_node) except -1:
84000  *         cdef _Element root
84001  *         if self._doc is None:             # <<<<<<<<<<<<<<
84002  *             self._doc = _documentFactory(c_node.doc, None)
84003  *             root = self._doc.getroot()
84004  */
84005   __pyx_t_1 = (((PyObject *)__pyx_v_self->_doc) == Py_None);
84006   if (__pyx_t_1) {
84007
84008     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":192
84009  *         cdef _Element root
84010  *         if self._doc is None:
84011  *             self._doc = _documentFactory(c_node.doc, None)             # <<<<<<<<<<<<<<
84012  *             root = self._doc.getroot()
84013  *             if root is not None and root._c_node.type == tree.XML_ELEMENT_NODE:
84014  */
84015     __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_node->doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
84016     __Pyx_GOTREF(__pyx_t_2);
84017     __Pyx_GIVEREF(__pyx_t_2);
84018     __Pyx_GOTREF(__pyx_v_self->_doc);
84019     __Pyx_DECREF(((PyObject *)__pyx_v_self->_doc));
84020     __pyx_v_self->_doc = ((struct LxmlDocument *)__pyx_t_2);
84021     __pyx_t_2 = 0;
84022
84023     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":193
84024  *         if self._doc is None:
84025  *             self._doc = _documentFactory(c_node.doc, None)
84026  *             root = self._doc.getroot()             # <<<<<<<<<<<<<<
84027  *             if root is not None and root._c_node.type == tree.XML_ELEMENT_NODE:
84028  *                 self._root = root
84029  */
84030     __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_self->_doc->__pyx_vtab)->getroot(__pyx_v_self->_doc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
84031     __Pyx_GOTREF(__pyx_t_2);
84032     if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
84033     __Pyx_DECREF(((PyObject *)__pyx_v_root));
84034     __pyx_v_root = ((struct LxmlElement *)__pyx_t_2);
84035     __pyx_t_2 = 0;
84036
84037     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":194
84038  *             self._doc = _documentFactory(c_node.doc, None)
84039  *             root = self._doc.getroot()
84040  *             if root is not None and root._c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
84041  *                 self._root = root
84042  *         node = _elementFactory(self._doc, c_node)
84043  */
84044     __pyx_t_1 = (((PyObject *)__pyx_v_root) != Py_None);
84045     if (__pyx_t_1) {
84046       __pyx_t_3 = (__pyx_v_root->_c_node->type == XML_ELEMENT_NODE);
84047     } else {
84048       __pyx_t_3 = __pyx_t_1;
84049     }
84050     if (__pyx_t_3) {
84051
84052       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":195
84053  *             root = self._doc.getroot()
84054  *             if root is not None and root._c_node.type == tree.XML_ELEMENT_NODE:
84055  *                 self._root = root             # <<<<<<<<<<<<<<
84056  *         node = _elementFactory(self._doc, c_node)
84057  *         self._events.append( (event, node) )
84058  */
84059       __Pyx_INCREF(((PyObject *)__pyx_v_root));
84060       __Pyx_GIVEREF(((PyObject *)__pyx_v_root));
84061       __Pyx_GOTREF(__pyx_v_self->_root);
84062       __Pyx_DECREF(((PyObject *)__pyx_v_self->_root));
84063       __pyx_v_self->_root = __pyx_v_root;
84064       goto __pyx_L4;
84065     }
84066     __pyx_L4:;
84067     goto __pyx_L3;
84068   }
84069   __pyx_L3:;
84070
84071   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":196
84072  *             if root is not None and root._c_node.type == tree.XML_ELEMENT_NODE:
84073  *                 self._root = root
84074  *         node = _elementFactory(self._doc, c_node)             # <<<<<<<<<<<<<<
84075  *         self._events.append( (event, node) )
84076  *         return 0
84077  */
84078   __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_self->_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
84079   __Pyx_GOTREF(__pyx_t_2);
84080   __Pyx_DECREF(__pyx_v_node);
84081   __pyx_v_node = __pyx_t_2;
84082   __pyx_t_2 = 0;
84083
84084   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":197
84085  *                 self._root = root
84086  *         node = _elementFactory(self._doc, c_node)
84087  *         self._events.append( (event, node) )             # <<<<<<<<<<<<<<
84088  *         return 0
84089  * 
84090  */
84091   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
84092   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
84093   __Pyx_INCREF(__pyx_v_event);
84094   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_event);
84095   __Pyx_GIVEREF(__pyx_v_event);
84096   __Pyx_INCREF(__pyx_v_node);
84097   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_node);
84098   __Pyx_GIVEREF(__pyx_v_node);
84099   __pyx_t_4 = PyList_Append(((PyObject *)__pyx_v_self->_events), ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
84100   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
84101
84102   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":198
84103  *         node = _elementFactory(self._doc, c_node)
84104  *         self._events.append( (event, node) )
84105  *         return 0             # <<<<<<<<<<<<<<
84106  * 
84107  *     cdef void _assureDocGetsFreed(self):
84108  */
84109   __pyx_r = 0;
84110   goto __pyx_L0;
84111
84112   __pyx_r = 0;
84113   goto __pyx_L0;
84114   __pyx_L1_error:;
84115   __Pyx_XDECREF(__pyx_t_2);
84116   __Pyx_AddTraceback("lxml.etree._IterparseContext.pushEvent");
84117   __pyx_r = -1;
84118   __pyx_L0:;
84119   __Pyx_DECREF((PyObject *)__pyx_v_root);
84120   __Pyx_DECREF(__pyx_v_node);
84121   __Pyx_FinishRefcountContext();
84122   return __pyx_r;
84123 }
84124
84125 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":200
84126  *         return 0
84127  * 
84128  *     cdef void _assureDocGetsFreed(self):             # <<<<<<<<<<<<<<
84129  *         if self._c_ctxt.myDoc is not NULL and self._doc is None:
84130  *             tree.xmlFreeDoc(self._c_ctxt.myDoc)
84131  */
84132
84133 static  void __pyx_f_4lxml_5etree_17_IterparseContext__assureDocGetsFreed(struct __pyx_obj_4lxml_5etree__IterparseContext *__pyx_v_self) {
84134   int __pyx_t_1;
84135   int __pyx_t_2;
84136   __Pyx_SetupRefcountContext("_assureDocGetsFreed");
84137
84138   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":201
84139  * 
84140  *     cdef void _assureDocGetsFreed(self):
84141  *         if self._c_ctxt.myDoc is not NULL and self._doc is None:             # <<<<<<<<<<<<<<
84142  *             tree.xmlFreeDoc(self._c_ctxt.myDoc)
84143  *             self._c_ctxt.myDoc = NULL
84144  */
84145   if ((__pyx_v_self->__pyx_base._c_ctxt->myDoc != NULL)) {
84146     __pyx_t_1 = (((PyObject *)__pyx_v_self->_doc) == Py_None);
84147     __pyx_t_2 = __pyx_t_1;
84148   } else {
84149     __pyx_t_2 = (__pyx_v_self->__pyx_base._c_ctxt->myDoc != NULL);
84150   }
84151   if (__pyx_t_2) {
84152
84153     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":202
84154  *     cdef void _assureDocGetsFreed(self):
84155  *         if self._c_ctxt.myDoc is not NULL and self._doc is None:
84156  *             tree.xmlFreeDoc(self._c_ctxt.myDoc)             # <<<<<<<<<<<<<<
84157  *             self._c_ctxt.myDoc = NULL
84158  * 
84159  */
84160     xmlFreeDoc(__pyx_v_self->__pyx_base._c_ctxt->myDoc);
84161
84162     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":203
84163  *         if self._c_ctxt.myDoc is not NULL and self._doc is None:
84164  *             tree.xmlFreeDoc(self._c_ctxt.myDoc)
84165  *             self._c_ctxt.myDoc = NULL             # <<<<<<<<<<<<<<
84166  * 
84167  * 
84168  */
84169     __pyx_v_self->__pyx_base._c_ctxt->myDoc = NULL;
84170     goto __pyx_L3;
84171   }
84172   __pyx_L3:;
84173
84174   __Pyx_FinishRefcountContext();
84175 }
84176
84177 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":206
84178  * 
84179  * 
84180  * cdef inline void _pushSaxStartEvent(_IterparseContext context,             # <<<<<<<<<<<<<<
84181  *                                     xmlNode* c_node):
84182  *     try:
84183  */
84184
84185 static INLINE void __pyx_f_4lxml_5etree__pushSaxStartEvent(struct __pyx_obj_4lxml_5etree__IterparseContext *__pyx_v_context, xmlNode *__pyx_v_c_node) {
84186   int __pyx_t_1;
84187   int __pyx_t_2;
84188   PyObject *__pyx_t_3 = NULL;
84189   PyObject *__pyx_t_4 = NULL;
84190   PyObject *__pyx_t_5 = NULL;
84191   __Pyx_SetupRefcountContext("_pushSaxStartEvent");
84192
84193   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":208
84194  * cdef inline void _pushSaxStartEvent(_IterparseContext context,
84195  *                                     xmlNode* c_node):
84196  *     try:             # <<<<<<<<<<<<<<
84197  *         if context._c_ctxt.html:
84198  *             _fixHtmlDictNodeNames(context._c_ctxt.dict, c_node)
84199  */
84200   {
84201     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
84202     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
84203     __Pyx_XGOTREF(__pyx_save_exc_type);
84204     __Pyx_XGOTREF(__pyx_save_exc_value);
84205     __Pyx_XGOTREF(__pyx_save_exc_tb);
84206     /*try:*/ {
84207
84208       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":209
84209  *                                     xmlNode* c_node):
84210  *     try:
84211  *         if context._c_ctxt.html:             # <<<<<<<<<<<<<<
84212  *             _fixHtmlDictNodeNames(context._c_ctxt.dict, c_node)
84213  *         context.startNode(c_node)
84214  */
84215       __pyx_t_1 = __pyx_v_context->__pyx_base._c_ctxt->html;
84216       if (__pyx_t_1) {
84217
84218         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":210
84219  *     try:
84220  *         if context._c_ctxt.html:
84221  *             _fixHtmlDictNodeNames(context._c_ctxt.dict, c_node)             # <<<<<<<<<<<<<<
84222  *         context.startNode(c_node)
84223  *     except:
84224  */
84225         __pyx_f_4lxml_5etree__fixHtmlDictNodeNames(__pyx_v_context->__pyx_base._c_ctxt->dict, __pyx_v_c_node);
84226         goto __pyx_L11;
84227       }
84228       __pyx_L11:;
84229
84230       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":211
84231  *         if context._c_ctxt.html:
84232  *             _fixHtmlDictNodeNames(context._c_ctxt.dict, c_node)
84233  *         context.startNode(c_node)             # <<<<<<<<<<<<<<
84234  *     except:
84235  *         if context._c_ctxt.errNo == xmlerror.XML_ERR_OK:
84236  */
84237       __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__IterparseContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->startNode(__pyx_v_context, __pyx_v_c_node); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
84238     }
84239     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
84240     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
84241     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
84242     goto __pyx_L10_try_end;
84243     __pyx_L3_error:;
84244
84245     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":212
84246  *             _fixHtmlDictNodeNames(context._c_ctxt.dict, c_node)
84247  *         context.startNode(c_node)
84248  *     except:             # <<<<<<<<<<<<<<
84249  *         if context._c_ctxt.errNo == xmlerror.XML_ERR_OK:
84250  *             context._c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR
84251  */
84252     /*except:*/ {
84253       __Pyx_AddTraceback("lxml.etree._pushSaxStartEvent");
84254       if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
84255       __Pyx_GOTREF(__pyx_t_3);
84256       __Pyx_GOTREF(__pyx_t_4);
84257       __Pyx_GOTREF(__pyx_t_5);
84258
84259       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":213
84260  *         context.startNode(c_node)
84261  *     except:
84262  *         if context._c_ctxt.errNo == xmlerror.XML_ERR_OK:             # <<<<<<<<<<<<<<
84263  *             context._c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR
84264  *         context._c_ctxt.disableSAX = 1
84265  */
84266       __pyx_t_1 = (__pyx_v_context->__pyx_base._c_ctxt->errNo == XML_ERR_OK);
84267       if (__pyx_t_1) {
84268
84269         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":214
84270  *     except:
84271  *         if context._c_ctxt.errNo == xmlerror.XML_ERR_OK:
84272  *             context._c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR             # <<<<<<<<<<<<<<
84273  *         context._c_ctxt.disableSAX = 1
84274  *         context._store_raised()
84275  */
84276         __pyx_v_context->__pyx_base._c_ctxt->errNo = XML_ERR_INTERNAL_ERROR;
84277         goto __pyx_L14;
84278       }
84279       __pyx_L14:;
84280
84281       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":215
84282  *         if context._c_ctxt.errNo == xmlerror.XML_ERR_OK:
84283  *             context._c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR
84284  *         context._c_ctxt.disableSAX = 1             # <<<<<<<<<<<<<<
84285  *         context._store_raised()
84286  * 
84287  */
84288       __pyx_v_context->__pyx_base._c_ctxt->disableSAX = 1;
84289
84290       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":216
84291  *             context._c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR
84292  *         context._c_ctxt.disableSAX = 1
84293  *         context._store_raised()             # <<<<<<<<<<<<<<
84294  * 
84295  * cdef inline void _pushSaxEndEvent(_IterparseContext context,
84296  */
84297       ((struct __pyx_vtabstruct_4lxml_5etree__IterparseContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.__pyx_base._store_raised(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_context));
84298       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
84299       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
84300       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
84301       goto __pyx_L4_exception_handled;
84302     }
84303     __pyx_L5_except_error:;
84304     __Pyx_XDECREF(__pyx_save_exc_type);
84305     __Pyx_XDECREF(__pyx_save_exc_value);
84306     __Pyx_XDECREF(__pyx_save_exc_tb);
84307     goto __pyx_L1_error;
84308     __pyx_L4_exception_handled:;
84309     __Pyx_XGIVEREF(__pyx_save_exc_type);
84310     __Pyx_XGIVEREF(__pyx_save_exc_value);
84311     __Pyx_XGIVEREF(__pyx_save_exc_tb);
84312     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
84313     __pyx_L10_try_end:;
84314   }
84315
84316   goto __pyx_L0;
84317   __pyx_L1_error:;
84318   __Pyx_XDECREF(__pyx_t_3);
84319   __Pyx_XDECREF(__pyx_t_4);
84320   __Pyx_XDECREF(__pyx_t_5);
84321   __Pyx_WriteUnraisable("lxml.etree._pushSaxStartEvent");
84322   __pyx_L0:;
84323   __Pyx_FinishRefcountContext();
84324 }
84325
84326 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":218
84327  *         context._store_raised()
84328  * 
84329  * cdef inline void _pushSaxEndEvent(_IterparseContext context,             # <<<<<<<<<<<<<<
84330  *                                   xmlNode* c_node):
84331  *     try:
84332  */
84333
84334 static INLINE void __pyx_f_4lxml_5etree__pushSaxEndEvent(struct __pyx_obj_4lxml_5etree__IterparseContext *__pyx_v_context, xmlNode *__pyx_v_c_node) {
84335   int __pyx_t_1;
84336   PyObject *__pyx_t_2 = NULL;
84337   PyObject *__pyx_t_3 = NULL;
84338   PyObject *__pyx_t_4 = NULL;
84339   int __pyx_t_5;
84340   __Pyx_SetupRefcountContext("_pushSaxEndEvent");
84341
84342   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":220
84343  * cdef inline void _pushSaxEndEvent(_IterparseContext context,
84344  *                                   xmlNode* c_node):
84345  *     try:             # <<<<<<<<<<<<<<
84346  *         context.endNode(c_node)
84347  *     except:
84348  */
84349   {
84350     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
84351     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
84352     __Pyx_XGOTREF(__pyx_save_exc_type);
84353     __Pyx_XGOTREF(__pyx_save_exc_value);
84354     __Pyx_XGOTREF(__pyx_save_exc_tb);
84355     /*try:*/ {
84356
84357       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":221
84358  *                                   xmlNode* c_node):
84359  *     try:
84360  *         context.endNode(c_node)             # <<<<<<<<<<<<<<
84361  *     except:
84362  *         if context._c_ctxt.errNo == xmlerror.XML_ERR_OK:
84363  */
84364       __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__IterparseContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->endNode(__pyx_v_context, __pyx_v_c_node); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
84365     }
84366     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
84367     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
84368     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
84369     goto __pyx_L10_try_end;
84370     __pyx_L3_error:;
84371
84372     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":222
84373  *     try:
84374  *         context.endNode(c_node)
84375  *     except:             # <<<<<<<<<<<<<<
84376  *         if context._c_ctxt.errNo == xmlerror.XML_ERR_OK:
84377  *             context._c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR
84378  */
84379     /*except:*/ {
84380       __Pyx_AddTraceback("lxml.etree._pushSaxEndEvent");
84381       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
84382       __Pyx_GOTREF(__pyx_t_2);
84383       __Pyx_GOTREF(__pyx_t_3);
84384       __Pyx_GOTREF(__pyx_t_4);
84385
84386       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":223
84387  *         context.endNode(c_node)
84388  *     except:
84389  *         if context._c_ctxt.errNo == xmlerror.XML_ERR_OK:             # <<<<<<<<<<<<<<
84390  *             context._c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR
84391  *         context._c_ctxt.disableSAX = 1
84392  */
84393       __pyx_t_5 = (__pyx_v_context->__pyx_base._c_ctxt->errNo == XML_ERR_OK);
84394       if (__pyx_t_5) {
84395
84396         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":224
84397  *     except:
84398  *         if context._c_ctxt.errNo == xmlerror.XML_ERR_OK:
84399  *             context._c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR             # <<<<<<<<<<<<<<
84400  *         context._c_ctxt.disableSAX = 1
84401  *         context._store_raised()
84402  */
84403         __pyx_v_context->__pyx_base._c_ctxt->errNo = XML_ERR_INTERNAL_ERROR;
84404         goto __pyx_L13;
84405       }
84406       __pyx_L13:;
84407
84408       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":225
84409  *         if context._c_ctxt.errNo == xmlerror.XML_ERR_OK:
84410  *             context._c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR
84411  *         context._c_ctxt.disableSAX = 1             # <<<<<<<<<<<<<<
84412  *         context._store_raised()
84413  * 
84414  */
84415       __pyx_v_context->__pyx_base._c_ctxt->disableSAX = 1;
84416
84417       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":226
84418  *             context._c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR
84419  *         context._c_ctxt.disableSAX = 1
84420  *         context._store_raised()             # <<<<<<<<<<<<<<
84421  * 
84422  * cdef inline void _pushSaxEvent(_IterparseContext context,
84423  */
84424       ((struct __pyx_vtabstruct_4lxml_5etree__IterparseContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.__pyx_base._store_raised(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_context));
84425       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
84426       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
84427       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
84428       goto __pyx_L4_exception_handled;
84429     }
84430     __pyx_L5_except_error:;
84431     __Pyx_XDECREF(__pyx_save_exc_type);
84432     __Pyx_XDECREF(__pyx_save_exc_value);
84433     __Pyx_XDECREF(__pyx_save_exc_tb);
84434     goto __pyx_L1_error;
84435     __pyx_L4_exception_handled:;
84436     __Pyx_XGIVEREF(__pyx_save_exc_type);
84437     __Pyx_XGIVEREF(__pyx_save_exc_value);
84438     __Pyx_XGIVEREF(__pyx_save_exc_tb);
84439     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
84440     __pyx_L10_try_end:;
84441   }
84442
84443   goto __pyx_L0;
84444   __pyx_L1_error:;
84445   __Pyx_XDECREF(__pyx_t_2);
84446   __Pyx_XDECREF(__pyx_t_3);
84447   __Pyx_XDECREF(__pyx_t_4);
84448   __Pyx_WriteUnraisable("lxml.etree._pushSaxEndEvent");
84449   __pyx_L0:;
84450   __Pyx_FinishRefcountContext();
84451 }
84452
84453 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":228
84454  *         context._store_raised()
84455  * 
84456  * cdef inline void _pushSaxEvent(_IterparseContext context,             # <<<<<<<<<<<<<<
84457  *                                event, xmlNode* c_node):
84458  *     try:
84459  */
84460
84461 static INLINE void __pyx_f_4lxml_5etree__pushSaxEvent(struct __pyx_obj_4lxml_5etree__IterparseContext *__pyx_v_context, PyObject *__pyx_v_event, xmlNode *__pyx_v_c_node) {
84462   int __pyx_t_1;
84463   PyObject *__pyx_t_2 = NULL;
84464   PyObject *__pyx_t_3 = NULL;
84465   PyObject *__pyx_t_4 = NULL;
84466   int __pyx_t_5;
84467   __Pyx_SetupRefcountContext("_pushSaxEvent");
84468
84469   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":230
84470  * cdef inline void _pushSaxEvent(_IterparseContext context,
84471  *                                event, xmlNode* c_node):
84472  *     try:             # <<<<<<<<<<<<<<
84473  *         context.pushEvent(event, c_node)
84474  *     except:
84475  */
84476   {
84477     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
84478     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
84479     __Pyx_XGOTREF(__pyx_save_exc_type);
84480     __Pyx_XGOTREF(__pyx_save_exc_value);
84481     __Pyx_XGOTREF(__pyx_save_exc_tb);
84482     /*try:*/ {
84483
84484       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":231
84485  *                                event, xmlNode* c_node):
84486  *     try:
84487  *         context.pushEvent(event, c_node)             # <<<<<<<<<<<<<<
84488  *     except:
84489  *         if context._c_ctxt.errNo == xmlerror.XML_ERR_OK:
84490  */
84491       __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__IterparseContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->pushEvent(__pyx_v_context, __pyx_v_event, __pyx_v_c_node); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
84492     }
84493     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
84494     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
84495     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
84496     goto __pyx_L10_try_end;
84497     __pyx_L3_error:;
84498
84499     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":232
84500  *     try:
84501  *         context.pushEvent(event, c_node)
84502  *     except:             # <<<<<<<<<<<<<<
84503  *         if context._c_ctxt.errNo == xmlerror.XML_ERR_OK:
84504  *             context._c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR
84505  */
84506     /*except:*/ {
84507       __Pyx_AddTraceback("lxml.etree._pushSaxEvent");
84508       if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
84509       __Pyx_GOTREF(__pyx_t_2);
84510       __Pyx_GOTREF(__pyx_t_3);
84511       __Pyx_GOTREF(__pyx_t_4);
84512
84513       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":233
84514  *         context.pushEvent(event, c_node)
84515  *     except:
84516  *         if context._c_ctxt.errNo == xmlerror.XML_ERR_OK:             # <<<<<<<<<<<<<<
84517  *             context._c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR
84518  *         context._c_ctxt.disableSAX = 1
84519  */
84520       __pyx_t_5 = (__pyx_v_context->__pyx_base._c_ctxt->errNo == XML_ERR_OK);
84521       if (__pyx_t_5) {
84522
84523         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":234
84524  *     except:
84525  *         if context._c_ctxt.errNo == xmlerror.XML_ERR_OK:
84526  *             context._c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR             # <<<<<<<<<<<<<<
84527  *         context._c_ctxt.disableSAX = 1
84528  *         context._store_raised()
84529  */
84530         __pyx_v_context->__pyx_base._c_ctxt->errNo = XML_ERR_INTERNAL_ERROR;
84531         goto __pyx_L13;
84532       }
84533       __pyx_L13:;
84534
84535       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":235
84536  *         if context._c_ctxt.errNo == xmlerror.XML_ERR_OK:
84537  *             context._c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR
84538  *         context._c_ctxt.disableSAX = 1             # <<<<<<<<<<<<<<
84539  *         context._store_raised()
84540  * 
84541  */
84542       __pyx_v_context->__pyx_base._c_ctxt->disableSAX = 1;
84543
84544       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":236
84545  *             context._c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR
84546  *         context._c_ctxt.disableSAX = 1
84547  *         context._store_raised()             # <<<<<<<<<<<<<<
84548  * 
84549  * cdef void _iterparseSaxStart(void* ctxt, char* localname, char* prefix,
84550  */
84551       ((struct __pyx_vtabstruct_4lxml_5etree__IterparseContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.__pyx_base._store_raised(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_context));
84552       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
84553       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
84554       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
84555       goto __pyx_L4_exception_handled;
84556     }
84557     __pyx_L5_except_error:;
84558     __Pyx_XDECREF(__pyx_save_exc_type);
84559     __Pyx_XDECREF(__pyx_save_exc_value);
84560     __Pyx_XDECREF(__pyx_save_exc_tb);
84561     goto __pyx_L1_error;
84562     __pyx_L4_exception_handled:;
84563     __Pyx_XGIVEREF(__pyx_save_exc_type);
84564     __Pyx_XGIVEREF(__pyx_save_exc_value);
84565     __Pyx_XGIVEREF(__pyx_save_exc_tb);
84566     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
84567     __pyx_L10_try_end:;
84568   }
84569
84570   goto __pyx_L0;
84571   __pyx_L1_error:;
84572   __Pyx_XDECREF(__pyx_t_2);
84573   __Pyx_XDECREF(__pyx_t_3);
84574   __Pyx_XDECREF(__pyx_t_4);
84575   __Pyx_WriteUnraisable("lxml.etree._pushSaxEvent");
84576   __pyx_L0:;
84577   __Pyx_FinishRefcountContext();
84578 }
84579
84580 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":238
84581  *         context._store_raised()
84582  * 
84583  * cdef void _iterparseSaxStart(void* ctxt, char* localname, char* prefix,             # <<<<<<<<<<<<<<
84584  *                              char* URI, int nb_namespaces, char** namespaces,
84585  *                              int nb_attributes, int nb_defaulted,
84586  */
84587
84588 static  void __pyx_f_4lxml_5etree__iterparseSaxStart(void *__pyx_v_ctxt, char *__pyx_v_localname, char *__pyx_v_prefix, char *__pyx_v_URI, int __pyx_v_nb_namespaces, char **__pyx_v_namespaces, int __pyx_v_nb_attributes, int __pyx_v_nb_defaulted, char **__pyx_v_attributes) {
84589   xmlParserCtxt *__pyx_v_c_ctxt;
84590   struct __pyx_obj_4lxml_5etree__IterparseContext *__pyx_v_context;
84591   __Pyx_SetupRefcountContext("_iterparseSaxStart");
84592   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)Py_None); __Pyx_INCREF(Py_None);
84593
84594   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":244
84595  *     cdef xmlparser.xmlParserCtxt* c_ctxt
84596  *     cdef _IterparseContext context
84597  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<<
84598  *     context = <_IterparseContext>c_ctxt._private
84599  *     context._origSaxStart(
84600  */
84601   __pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);
84602
84603   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":245
84604  *     cdef _IterparseContext context
84605  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
84606  *     context = <_IterparseContext>c_ctxt._private             # <<<<<<<<<<<<<<
84607  *     context._origSaxStart(
84608  *         ctxt, localname, prefix, URI,
84609  */
84610   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_c_ctxt->_private)));
84611   __Pyx_DECREF(((PyObject *)__pyx_v_context));
84612   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_c_ctxt->_private);
84613
84614   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":249
84615  *         ctxt, localname, prefix, URI,
84616  *         nb_namespaces, namespaces,
84617  *         nb_attributes, nb_defaulted, attributes)             # <<<<<<<<<<<<<<
84618  *     _pushSaxStartEvent(context, c_ctxt.node)
84619  * 
84620  */
84621   __pyx_v_context->_origSaxStart(__pyx_v_ctxt, __pyx_v_localname, __pyx_v_prefix, __pyx_v_URI, __pyx_v_nb_namespaces, __pyx_v_namespaces, __pyx_v_nb_attributes, __pyx_v_nb_defaulted, __pyx_v_attributes);
84622
84623   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":250
84624  *         nb_namespaces, namespaces,
84625  *         nb_attributes, nb_defaulted, attributes)
84626  *     _pushSaxStartEvent(context, c_ctxt.node)             # <<<<<<<<<<<<<<
84627  * 
84628  * cdef void _iterparseSaxEnd(void* ctxt, char* localname, char* prefix, char* URI):
84629  */
84630   __pyx_f_4lxml_5etree__pushSaxStartEvent(__pyx_v_context, __pyx_v_c_ctxt->node);
84631
84632   __Pyx_DECREF((PyObject *)__pyx_v_context);
84633   __Pyx_FinishRefcountContext();
84634 }
84635
84636 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":252
84637  *     _pushSaxStartEvent(context, c_ctxt.node)
84638  * 
84639  * cdef void _iterparseSaxEnd(void* ctxt, char* localname, char* prefix, char* URI):             # <<<<<<<<<<<<<<
84640  *     cdef xmlparser.xmlParserCtxt* c_ctxt
84641  *     cdef _IterparseContext context
84642  */
84643
84644 static  void __pyx_f_4lxml_5etree__iterparseSaxEnd(void *__pyx_v_ctxt, char *__pyx_v_localname, char *__pyx_v_prefix, char *__pyx_v_URI) {
84645   xmlParserCtxt *__pyx_v_c_ctxt;
84646   struct __pyx_obj_4lxml_5etree__IterparseContext *__pyx_v_context;
84647   __Pyx_SetupRefcountContext("_iterparseSaxEnd");
84648   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)Py_None); __Pyx_INCREF(Py_None);
84649
84650   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":255
84651  *     cdef xmlparser.xmlParserCtxt* c_ctxt
84652  *     cdef _IterparseContext context
84653  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<<
84654  *     context = <_IterparseContext>c_ctxt._private
84655  *     _pushSaxEndEvent(context, c_ctxt.node)
84656  */
84657   __pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);
84658
84659   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":256
84660  *     cdef _IterparseContext context
84661  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
84662  *     context = <_IterparseContext>c_ctxt._private             # <<<<<<<<<<<<<<
84663  *     _pushSaxEndEvent(context, c_ctxt.node)
84664  *     context._origSaxEnd(ctxt, localname, prefix, URI)
84665  */
84666   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_c_ctxt->_private)));
84667   __Pyx_DECREF(((PyObject *)__pyx_v_context));
84668   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_c_ctxt->_private);
84669
84670   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":257
84671  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
84672  *     context = <_IterparseContext>c_ctxt._private
84673  *     _pushSaxEndEvent(context, c_ctxt.node)             # <<<<<<<<<<<<<<
84674  *     context._origSaxEnd(ctxt, localname, prefix, URI)
84675  * 
84676  */
84677   __pyx_f_4lxml_5etree__pushSaxEndEvent(__pyx_v_context, __pyx_v_c_ctxt->node);
84678
84679   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":258
84680  *     context = <_IterparseContext>c_ctxt._private
84681  *     _pushSaxEndEvent(context, c_ctxt.node)
84682  *     context._origSaxEnd(ctxt, localname, prefix, URI)             # <<<<<<<<<<<<<<
84683  * 
84684  * cdef void _iterparseSaxStartNoNs(void* ctxt, char* name, char** attributes):
84685  */
84686   __pyx_v_context->_origSaxEnd(__pyx_v_ctxt, __pyx_v_localname, __pyx_v_prefix, __pyx_v_URI);
84687
84688   __Pyx_DECREF((PyObject *)__pyx_v_context);
84689   __Pyx_FinishRefcountContext();
84690 }
84691
84692 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":260
84693  *     context._origSaxEnd(ctxt, localname, prefix, URI)
84694  * 
84695  * cdef void _iterparseSaxStartNoNs(void* ctxt, char* name, char** attributes):             # <<<<<<<<<<<<<<
84696  *     cdef xmlparser.xmlParserCtxt* c_ctxt
84697  *     cdef _IterparseContext context
84698  */
84699
84700 static  void __pyx_f_4lxml_5etree__iterparseSaxStartNoNs(void *__pyx_v_ctxt, char *__pyx_v_name, char **__pyx_v_attributes) {
84701   xmlParserCtxt *__pyx_v_c_ctxt;
84702   struct __pyx_obj_4lxml_5etree__IterparseContext *__pyx_v_context;
84703   __Pyx_SetupRefcountContext("_iterparseSaxStartNoNs");
84704   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)Py_None); __Pyx_INCREF(Py_None);
84705
84706   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":263
84707  *     cdef xmlparser.xmlParserCtxt* c_ctxt
84708  *     cdef _IterparseContext context
84709  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<<
84710  *     context = <_IterparseContext>c_ctxt._private
84711  *     context._origSaxStartNoNs(ctxt, name, attributes)
84712  */
84713   __pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);
84714
84715   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":264
84716  *     cdef _IterparseContext context
84717  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
84718  *     context = <_IterparseContext>c_ctxt._private             # <<<<<<<<<<<<<<
84719  *     context._origSaxStartNoNs(ctxt, name, attributes)
84720  *     _pushSaxStartEvent(context, c_ctxt.node)
84721  */
84722   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_c_ctxt->_private)));
84723   __Pyx_DECREF(((PyObject *)__pyx_v_context));
84724   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_c_ctxt->_private);
84725
84726   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":265
84727  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
84728  *     context = <_IterparseContext>c_ctxt._private
84729  *     context._origSaxStartNoNs(ctxt, name, attributes)             # <<<<<<<<<<<<<<
84730  *     _pushSaxStartEvent(context, c_ctxt.node)
84731  * 
84732  */
84733   __pyx_v_context->_origSaxStartNoNs(__pyx_v_ctxt, __pyx_v_name, __pyx_v_attributes);
84734
84735   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":266
84736  *     context = <_IterparseContext>c_ctxt._private
84737  *     context._origSaxStartNoNs(ctxt, name, attributes)
84738  *     _pushSaxStartEvent(context, c_ctxt.node)             # <<<<<<<<<<<<<<
84739  * 
84740  * cdef void _iterparseSaxEndNoNs(void* ctxt, char* name):
84741  */
84742   __pyx_f_4lxml_5etree__pushSaxStartEvent(__pyx_v_context, __pyx_v_c_ctxt->node);
84743
84744   __Pyx_DECREF((PyObject *)__pyx_v_context);
84745   __Pyx_FinishRefcountContext();
84746 }
84747
84748 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":268
84749  *     _pushSaxStartEvent(context, c_ctxt.node)
84750  * 
84751  * cdef void _iterparseSaxEndNoNs(void* ctxt, char* name):             # <<<<<<<<<<<<<<
84752  *     cdef xmlparser.xmlParserCtxt* c_ctxt
84753  *     cdef _IterparseContext context
84754  */
84755
84756 static  void __pyx_f_4lxml_5etree__iterparseSaxEndNoNs(void *__pyx_v_ctxt, char *__pyx_v_name) {
84757   xmlParserCtxt *__pyx_v_c_ctxt;
84758   struct __pyx_obj_4lxml_5etree__IterparseContext *__pyx_v_context;
84759   __Pyx_SetupRefcountContext("_iterparseSaxEndNoNs");
84760   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)Py_None); __Pyx_INCREF(Py_None);
84761
84762   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":271
84763  *     cdef xmlparser.xmlParserCtxt* c_ctxt
84764  *     cdef _IterparseContext context
84765  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<<
84766  *     context = <_IterparseContext>c_ctxt._private
84767  *     _pushSaxEndEvent(context, c_ctxt.node)
84768  */
84769   __pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);
84770
84771   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":272
84772  *     cdef _IterparseContext context
84773  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
84774  *     context = <_IterparseContext>c_ctxt._private             # <<<<<<<<<<<<<<
84775  *     _pushSaxEndEvent(context, c_ctxt.node)
84776  *     context._origSaxEndNoNs(ctxt, name)
84777  */
84778   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_c_ctxt->_private)));
84779   __Pyx_DECREF(((PyObject *)__pyx_v_context));
84780   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_c_ctxt->_private);
84781
84782   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":273
84783  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
84784  *     context = <_IterparseContext>c_ctxt._private
84785  *     _pushSaxEndEvent(context, c_ctxt.node)             # <<<<<<<<<<<<<<
84786  *     context._origSaxEndNoNs(ctxt, name)
84787  * 
84788  */
84789   __pyx_f_4lxml_5etree__pushSaxEndEvent(__pyx_v_context, __pyx_v_c_ctxt->node);
84790
84791   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":274
84792  *     context = <_IterparseContext>c_ctxt._private
84793  *     _pushSaxEndEvent(context, c_ctxt.node)
84794  *     context._origSaxEndNoNs(ctxt, name)             # <<<<<<<<<<<<<<
84795  * 
84796  * cdef void _iterparseSaxComment(void* ctxt, char* text):
84797  */
84798   __pyx_v_context->_origSaxEndNoNs(__pyx_v_ctxt, __pyx_v_name);
84799
84800   __Pyx_DECREF((PyObject *)__pyx_v_context);
84801   __Pyx_FinishRefcountContext();
84802 }
84803
84804 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":276
84805  *     context._origSaxEndNoNs(ctxt, name)
84806  * 
84807  * cdef void _iterparseSaxComment(void* ctxt, char* text):             # <<<<<<<<<<<<<<
84808  *     cdef xmlNode* c_node
84809  *     cdef xmlparser.xmlParserCtxt* c_ctxt
84810  */
84811
84812 static  void __pyx_f_4lxml_5etree__iterparseSaxComment(void *__pyx_v_ctxt, char *__pyx_v_text) {
84813   xmlNode *__pyx_v_c_node;
84814   xmlParserCtxt *__pyx_v_c_ctxt;
84815   struct __pyx_obj_4lxml_5etree__IterparseContext *__pyx_v_context;
84816   int __pyx_t_1;
84817   __Pyx_SetupRefcountContext("_iterparseSaxComment");
84818   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)Py_None); __Pyx_INCREF(Py_None);
84819
84820   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":280
84821  *     cdef xmlparser.xmlParserCtxt* c_ctxt
84822  *     cdef _IterparseContext context
84823  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<<
84824  *     context = <_IterparseContext>c_ctxt._private
84825  *     context._origSaxComment(ctxt, text)
84826  */
84827   __pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);
84828
84829   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":281
84830  *     cdef _IterparseContext context
84831  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
84832  *     context = <_IterparseContext>c_ctxt._private             # <<<<<<<<<<<<<<
84833  *     context._origSaxComment(ctxt, text)
84834  *     c_node = _iterparseFindLastNode(c_ctxt)
84835  */
84836   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_c_ctxt->_private)));
84837   __Pyx_DECREF(((PyObject *)__pyx_v_context));
84838   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_c_ctxt->_private);
84839
84840   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":282
84841  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
84842  *     context = <_IterparseContext>c_ctxt._private
84843  *     context._origSaxComment(ctxt, text)             # <<<<<<<<<<<<<<
84844  *     c_node = _iterparseFindLastNode(c_ctxt)
84845  *     if c_node is not NULL:
84846  */
84847   __pyx_v_context->_origSaxComment(__pyx_v_ctxt, __pyx_v_text);
84848
84849   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":283
84850  *     context = <_IterparseContext>c_ctxt._private
84851  *     context._origSaxComment(ctxt, text)
84852  *     c_node = _iterparseFindLastNode(c_ctxt)             # <<<<<<<<<<<<<<
84853  *     if c_node is not NULL:
84854  *         _pushSaxEvent(context, u"comment", c_node)
84855  */
84856   __pyx_v_c_node = __pyx_f_4lxml_5etree__iterparseFindLastNode(__pyx_v_c_ctxt);
84857
84858   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":284
84859  *     context._origSaxComment(ctxt, text)
84860  *     c_node = _iterparseFindLastNode(c_ctxt)
84861  *     if c_node is not NULL:             # <<<<<<<<<<<<<<
84862  *         _pushSaxEvent(context, u"comment", c_node)
84863  * 
84864  */
84865   __pyx_t_1 = (__pyx_v_c_node != NULL);
84866   if (__pyx_t_1) {
84867
84868     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":285
84869  *     c_node = _iterparseFindLastNode(c_ctxt)
84870  *     if c_node is not NULL:
84871  *         _pushSaxEvent(context, u"comment", c_node)             # <<<<<<<<<<<<<<
84872  * 
84873  * cdef void _iterparseSaxPI(void* ctxt, char* target, char* data):
84874  */
84875     __pyx_f_4lxml_5etree__pushSaxEvent(__pyx_v_context, ((PyObject *)__pyx_kp_533), __pyx_v_c_node);
84876     goto __pyx_L3;
84877   }
84878   __pyx_L3:;
84879
84880   __Pyx_DECREF((PyObject *)__pyx_v_context);
84881   __Pyx_FinishRefcountContext();
84882 }
84883
84884 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":287
84885  *         _pushSaxEvent(context, u"comment", c_node)
84886  * 
84887  * cdef void _iterparseSaxPI(void* ctxt, char* target, char* data):             # <<<<<<<<<<<<<<
84888  *     cdef xmlNode* c_node
84889  *     cdef xmlparser.xmlParserCtxt* c_ctxt
84890  */
84891
84892 static  void __pyx_f_4lxml_5etree__iterparseSaxPI(void *__pyx_v_ctxt, char *__pyx_v_target, char *__pyx_v_data) {
84893   xmlNode *__pyx_v_c_node;
84894   xmlParserCtxt *__pyx_v_c_ctxt;
84895   struct __pyx_obj_4lxml_5etree__IterparseContext *__pyx_v_context;
84896   int __pyx_t_1;
84897   __Pyx_SetupRefcountContext("_iterparseSaxPI");
84898   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)Py_None); __Pyx_INCREF(Py_None);
84899
84900   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":291
84901  *     cdef xmlparser.xmlParserCtxt* c_ctxt
84902  *     cdef _IterparseContext context
84903  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<<
84904  *     context = <_IterparseContext>c_ctxt._private
84905  *     context._origSaxPI(ctxt, target, data)
84906  */
84907   __pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);
84908
84909   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":292
84910  *     cdef _IterparseContext context
84911  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
84912  *     context = <_IterparseContext>c_ctxt._private             # <<<<<<<<<<<<<<
84913  *     context._origSaxPI(ctxt, target, data)
84914  *     c_node = _iterparseFindLastNode(c_ctxt)
84915  */
84916   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_c_ctxt->_private)));
84917   __Pyx_DECREF(((PyObject *)__pyx_v_context));
84918   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_c_ctxt->_private);
84919
84920   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":293
84921  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
84922  *     context = <_IterparseContext>c_ctxt._private
84923  *     context._origSaxPI(ctxt, target, data)             # <<<<<<<<<<<<<<
84924  *     c_node = _iterparseFindLastNode(c_ctxt)
84925  *     if c_node is not NULL:
84926  */
84927   __pyx_v_context->_origSaxPI(__pyx_v_ctxt, __pyx_v_target, __pyx_v_data);
84928
84929   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":294
84930  *     context = <_IterparseContext>c_ctxt._private
84931  *     context._origSaxPI(ctxt, target, data)
84932  *     c_node = _iterparseFindLastNode(c_ctxt)             # <<<<<<<<<<<<<<
84933  *     if c_node is not NULL:
84934  *         _pushSaxEvent(context, u"pi", c_node)
84935  */
84936   __pyx_v_c_node = __pyx_f_4lxml_5etree__iterparseFindLastNode(__pyx_v_c_ctxt);
84937
84938   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":295
84939  *     context._origSaxPI(ctxt, target, data)
84940  *     c_node = _iterparseFindLastNode(c_ctxt)
84941  *     if c_node is not NULL:             # <<<<<<<<<<<<<<
84942  *         _pushSaxEvent(context, u"pi", c_node)
84943  * 
84944  */
84945   __pyx_t_1 = (__pyx_v_c_node != NULL);
84946   if (__pyx_t_1) {
84947
84948     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":296
84949  *     c_node = _iterparseFindLastNode(c_ctxt)
84950  *     if c_node is not NULL:
84951  *         _pushSaxEvent(context, u"pi", c_node)             # <<<<<<<<<<<<<<
84952  * 
84953  * cdef inline xmlNode* _iterparseFindLastNode(xmlparser.xmlParserCtxt* c_ctxt):
84954  */
84955     __pyx_f_4lxml_5etree__pushSaxEvent(__pyx_v_context, ((PyObject *)__pyx_kp_534), __pyx_v_c_node);
84956     goto __pyx_L3;
84957   }
84958   __pyx_L3:;
84959
84960   __Pyx_DECREF((PyObject *)__pyx_v_context);
84961   __Pyx_FinishRefcountContext();
84962 }
84963
84964 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":298
84965  *         _pushSaxEvent(context, u"pi", c_node)
84966  * 
84967  * cdef inline xmlNode* _iterparseFindLastNode(xmlparser.xmlParserCtxt* c_ctxt):             # <<<<<<<<<<<<<<
84968  *     # this mimics what libxml2 creates for comments/PIs
84969  *     if c_ctxt.inSubset == 1:
84970  */
84971
84972 static INLINE xmlNode *__pyx_f_4lxml_5etree__iterparseFindLastNode(xmlParserCtxt *__pyx_v_c_ctxt) {
84973   xmlNode *__pyx_r;
84974   int __pyx_t_1;
84975   __Pyx_SetupRefcountContext("_iterparseFindLastNode");
84976
84977   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":300
84978  * cdef inline xmlNode* _iterparseFindLastNode(xmlparser.xmlParserCtxt* c_ctxt):
84979  *     # this mimics what libxml2 creates for comments/PIs
84980  *     if c_ctxt.inSubset == 1:             # <<<<<<<<<<<<<<
84981  *         return c_ctxt.myDoc.intSubset.last
84982  *     elif c_ctxt.inSubset == 2:
84983  */
84984   __pyx_t_1 = (__pyx_v_c_ctxt->inSubset == 1);
84985   if (__pyx_t_1) {
84986
84987     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":301
84988  *     # this mimics what libxml2 creates for comments/PIs
84989  *     if c_ctxt.inSubset == 1:
84990  *         return c_ctxt.myDoc.intSubset.last             # <<<<<<<<<<<<<<
84991  *     elif c_ctxt.inSubset == 2:
84992  *         return c_ctxt.myDoc.extSubset.last
84993  */
84994     __pyx_r = __pyx_v_c_ctxt->myDoc->intSubset->last;
84995     goto __pyx_L0;
84996     goto __pyx_L3;
84997   }
84998
84999   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":302
85000  *     if c_ctxt.inSubset == 1:
85001  *         return c_ctxt.myDoc.intSubset.last
85002  *     elif c_ctxt.inSubset == 2:             # <<<<<<<<<<<<<<
85003  *         return c_ctxt.myDoc.extSubset.last
85004  *     elif c_ctxt.node is NULL:
85005  */
85006   __pyx_t_1 = (__pyx_v_c_ctxt->inSubset == 2);
85007   if (__pyx_t_1) {
85008
85009     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":303
85010  *         return c_ctxt.myDoc.intSubset.last
85011  *     elif c_ctxt.inSubset == 2:
85012  *         return c_ctxt.myDoc.extSubset.last             # <<<<<<<<<<<<<<
85013  *     elif c_ctxt.node is NULL:
85014  *         return c_ctxt.myDoc.last
85015  */
85016     __pyx_r = __pyx_v_c_ctxt->myDoc->extSubset->last;
85017     goto __pyx_L0;
85018     goto __pyx_L3;
85019   }
85020
85021   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":304
85022  *     elif c_ctxt.inSubset == 2:
85023  *         return c_ctxt.myDoc.extSubset.last
85024  *     elif c_ctxt.node is NULL:             # <<<<<<<<<<<<<<
85025  *         return c_ctxt.myDoc.last
85026  *     elif c_ctxt.node.type == tree.XML_ELEMENT_NODE:
85027  */
85028   __pyx_t_1 = (__pyx_v_c_ctxt->node == NULL);
85029   if (__pyx_t_1) {
85030
85031     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":305
85032  *         return c_ctxt.myDoc.extSubset.last
85033  *     elif c_ctxt.node is NULL:
85034  *         return c_ctxt.myDoc.last             # <<<<<<<<<<<<<<
85035  *     elif c_ctxt.node.type == tree.XML_ELEMENT_NODE:
85036  *         return c_ctxt.node.last
85037  */
85038     __pyx_r = __pyx_v_c_ctxt->myDoc->last;
85039     goto __pyx_L0;
85040     goto __pyx_L3;
85041   }
85042
85043   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":306
85044  *     elif c_ctxt.node is NULL:
85045  *         return c_ctxt.myDoc.last
85046  *     elif c_ctxt.node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
85047  *         return c_ctxt.node.last
85048  *     else:
85049  */
85050   __pyx_t_1 = (__pyx_v_c_ctxt->node->type == XML_ELEMENT_NODE);
85051   if (__pyx_t_1) {
85052
85053     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":307
85054  *         return c_ctxt.myDoc.last
85055  *     elif c_ctxt.node.type == tree.XML_ELEMENT_NODE:
85056  *         return c_ctxt.node.last             # <<<<<<<<<<<<<<
85057  *     else:
85058  *         return c_ctxt.node.next
85059  */
85060     __pyx_r = __pyx_v_c_ctxt->node->last;
85061     goto __pyx_L0;
85062     goto __pyx_L3;
85063   }
85064   /*else*/ {
85065
85066     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":309
85067  *         return c_ctxt.node.last
85068  *     else:
85069  *         return c_ctxt.node.next             # <<<<<<<<<<<<<<
85070  * 
85071  * cdef class iterparse(_BaseParser):
85072  */
85073     __pyx_r = __pyx_v_c_ctxt->node->next;
85074     goto __pyx_L0;
85075   }
85076   __pyx_L3:;
85077
85078   __pyx_r = 0;
85079   __pyx_L0:;
85080   __Pyx_FinishRefcountContext();
85081   return __pyx_r;
85082 }
85083
85084 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":363
85085  *     cdef int (*_parse_chunk)(xmlparser.xmlParserCtxt* ctxt,
85086  *                              char* chunk, int size, int terminate) nogil
85087  *     def __init__(self, source, events=(u"end",), *, tag=None,             # <<<<<<<<<<<<<<
85088  *                  attribute_defaults=False, dtd_validation=False,
85089  *                  load_dtd=False, no_network=True, remove_blank_text=False,
85090  */
85091
85092 static int __pyx_pf_4lxml_5etree_9iterparse___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
85093 static int __pyx_pf_4lxml_5etree_9iterparse___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
85094   PyObject *__pyx_v_source = 0;
85095   PyObject *__pyx_v_events = 0;
85096   PyObject *__pyx_v_tag = 0;
85097   PyObject *__pyx_v_attribute_defaults = 0;
85098   PyObject *__pyx_v_dtd_validation = 0;
85099   PyObject *__pyx_v_load_dtd = 0;
85100   PyObject *__pyx_v_no_network = 0;
85101   PyObject *__pyx_v_remove_blank_text = 0;
85102   PyObject *__pyx_v_compact = 0;
85103   PyObject *__pyx_v_resolve_entities = 0;
85104   PyObject *__pyx_v_remove_comments = 0;
85105   PyObject *__pyx_v_remove_pis = 0;
85106   PyObject *__pyx_v_strip_cdata = 0;
85107   PyObject *__pyx_v_encoding = 0;
85108   PyObject *__pyx_v_html = 0;
85109   PyObject *__pyx_v_huge_tree = 0;
85110   struct __pyx_obj_4lxml_5etree_XMLSchema *__pyx_v_schema = 0;
85111   struct __pyx_obj_4lxml_5etree__IterparseContext *__pyx_v_context;
85112   int __pyx_v_parse_options;
85113   PyObject *__pyx_v_filename;
85114   PyObject *__pyx_v_error;
85115   PyObject *__pyx_v_event;
85116   int __pyx_r;
85117   int __pyx_t_1;
85118   int __pyx_t_2;
85119   PyObject *__pyx_t_3 = NULL;
85120   PyObject *__pyx_t_4 = NULL;
85121   Py_ssize_t __pyx_t_5;
85122   PyObject *__pyx_t_6 = NULL;
85123   int __pyx_t_7;
85124   int __pyx_t_8;
85125   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_source,&__pyx_kp_events,&__pyx_kp_tag,&__pyx_kp_attribute_defaults,&__pyx_kp_dtd_validation,&__pyx_kp_load_dtd,&__pyx_kp_no_network,&__pyx_kp_remove_blank_text,&__pyx_kp_compact,&__pyx_kp_resolve_entities,&__pyx_kp_remove_comments,&__pyx_kp_remove_pis,&__pyx_kp_strip_cdata,&__pyx_kp_encoding,&__pyx_kp_html,&__pyx_kp_huge_tree,&__pyx_kp_schema,0};
85126   __Pyx_SetupRefcountContext("__init__");
85127   if (unlikely(__pyx_kwds)) {
85128     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
85129     PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
85130     values[1] = __pyx_k_152;
85131     values[2] = Py_None;
85132     values[3] = __pyx_k_153;
85133     values[4] = __pyx_k_154;
85134     values[5] = __pyx_k_155;
85135     values[6] = __pyx_k_156;
85136     values[7] = __pyx_k_157;
85137     values[8] = __pyx_k_158;
85138     values[9] = __pyx_k_159;
85139     values[10] = __pyx_k_160;
85140     values[11] = __pyx_k_161;
85141     values[12] = __pyx_k_162;
85142     values[13] = Py_None;
85143     values[14] = __pyx_k_163;
85144     values[15] = __pyx_k_164;
85145     values[16] = (PyObject*)((struct __pyx_obj_4lxml_5etree_XMLSchema *)Py_None);
85146     switch (PyTuple_GET_SIZE(__pyx_args)) {
85147       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
85148       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
85149       case  0: break;
85150       default: goto __pyx_L5_argtuple_error;
85151     }
85152     switch (PyTuple_GET_SIZE(__pyx_args)) {
85153       case  0:
85154       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_source);
85155       if (likely(values[0])) kw_args--;
85156       else goto __pyx_L5_argtuple_error;
85157       case  1:
85158       if (kw_args > 1) {
85159         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_events);
85160         if (unlikely(value)) { values[1] = value; kw_args--; }
85161       }
85162     }
85163     while (kw_args > 0) {
85164       PyObject* value;
85165       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_tag);
85166       if (value) { values[2] = value; if (!(--kw_args)) break; }
85167       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_attribute_defaults);
85168       if (value) { values[3] = value; if (!(--kw_args)) break; }
85169       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_dtd_validation);
85170       if (value) { values[4] = value; if (!(--kw_args)) break; }
85171       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_load_dtd);
85172       if (value) { values[5] = value; if (!(--kw_args)) break; }
85173       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_no_network);
85174       if (value) { values[6] = value; if (!(--kw_args)) break; }
85175       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_remove_blank_text);
85176       if (value) { values[7] = value; if (!(--kw_args)) break; }
85177       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_compact);
85178       if (value) { values[8] = value; if (!(--kw_args)) break; }
85179       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_resolve_entities);
85180       if (value) { values[9] = value; if (!(--kw_args)) break; }
85181       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_remove_comments);
85182       if (value) { values[10] = value; if (!(--kw_args)) break; }
85183       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_remove_pis);
85184       if (value) { values[11] = value; if (!(--kw_args)) break; }
85185       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_strip_cdata);
85186       if (value) { values[12] = value; if (!(--kw_args)) break; }
85187       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_encoding);
85188       if (value) { values[13] = value; if (!(--kw_args)) break; }
85189       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_html);
85190       if (value) { values[14] = value; if (!(--kw_args)) break; }
85191       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_huge_tree);
85192       if (value) { values[15] = value; if (!(--kw_args)) break; }
85193       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_schema);
85194       if (value) { values[16] = value; if (!(--kw_args)) break; }
85195       break;
85196     }
85197     if (unlikely(kw_args > 0)) {
85198       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
85199     }
85200     __pyx_v_source = values[0];
85201     __pyx_v_events = values[1];
85202     __pyx_v_tag = values[2];
85203     __pyx_v_attribute_defaults = values[3];
85204     __pyx_v_dtd_validation = values[4];
85205     __pyx_v_load_dtd = values[5];
85206     __pyx_v_no_network = values[6];
85207     __pyx_v_remove_blank_text = values[7];
85208     __pyx_v_compact = values[8];
85209     __pyx_v_resolve_entities = values[9];
85210     __pyx_v_remove_comments = values[10];
85211     __pyx_v_remove_pis = values[11];
85212     __pyx_v_strip_cdata = values[12];
85213     __pyx_v_encoding = values[13];
85214     __pyx_v_html = values[14];
85215     __pyx_v_huge_tree = values[15];
85216     __pyx_v_schema = ((struct __pyx_obj_4lxml_5etree_XMLSchema *)values[16]);
85217   } else {
85218     __pyx_v_events = __pyx_k_152;
85219     __pyx_v_tag = Py_None;
85220     __pyx_v_attribute_defaults = __pyx_k_153;
85221     __pyx_v_dtd_validation = __pyx_k_154;
85222     __pyx_v_load_dtd = __pyx_k_155;
85223     __pyx_v_no_network = __pyx_k_156;
85224     __pyx_v_remove_blank_text = __pyx_k_157;
85225     __pyx_v_compact = __pyx_k_158;
85226     __pyx_v_resolve_entities = __pyx_k_159;
85227     __pyx_v_remove_comments = __pyx_k_160;
85228     __pyx_v_remove_pis = __pyx_k_161;
85229     __pyx_v_strip_cdata = __pyx_k_162;
85230     __pyx_v_encoding = Py_None;
85231     __pyx_v_html = __pyx_k_163;
85232     __pyx_v_huge_tree = __pyx_k_164;
85233     __pyx_v_schema = ((struct __pyx_obj_4lxml_5etree_XMLSchema *)Py_None);
85234     switch (PyTuple_GET_SIZE(__pyx_args)) {
85235       case  2: __pyx_v_events = PyTuple_GET_ITEM(__pyx_args, 1);
85236       case  1: __pyx_v_source = PyTuple_GET_ITEM(__pyx_args, 0);
85237       break;
85238       default: goto __pyx_L5_argtuple_error;
85239     }
85240   }
85241   goto __pyx_L4_argument_unpacking_done;
85242   __pyx_L5_argtuple_error:;
85243   __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[14]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
85244   __pyx_L3_error:;
85245   __Pyx_AddTraceback("lxml.etree.iterparse.__init__");
85246   return -1;
85247   __pyx_L4_argument_unpacking_done:;
85248   __Pyx_INCREF(__pyx_v_source);
85249   __Pyx_INCREF(__pyx_v_events);
85250   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)Py_None); __Pyx_INCREF(Py_None);
85251   __pyx_v_filename = Py_None; __Pyx_INCREF(Py_None);
85252   __pyx_v_error = Py_None; __Pyx_INCREF(Py_None);
85253   __pyx_v_event = Py_None; __Pyx_INCREF(Py_None);
85254   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_schema), __pyx_ptype_4lxml_5etree_XMLSchema, 1, "schema", 0))) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85255
85256   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":372
85257  *         cdef char* c_encoding
85258  *         cdef int parse_options
85259  *         if not hasattr(source, u'read'):             # <<<<<<<<<<<<<<
85260  *             filename = _encodeFilename(source)
85261  *             if not python.IS_PYTHON3:
85262  */
85263   __pyx_t_1 = PyObject_HasAttr(__pyx_v_source, ((PyObject *)__pyx_kp_535)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85264   __pyx_t_2 = (!__pyx_t_1);
85265   if (__pyx_t_2) {
85266
85267     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":373
85268  *         cdef int parse_options
85269  *         if not hasattr(source, u'read'):
85270  *             filename = _encodeFilename(source)             # <<<<<<<<<<<<<<
85271  *             if not python.IS_PYTHON3:
85272  *                 source = filename
85273  */
85274     __pyx_t_3 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_source); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85275     __Pyx_GOTREF(__pyx_t_3);
85276     __Pyx_DECREF(__pyx_v_filename);
85277     __pyx_v_filename = __pyx_t_3;
85278     __pyx_t_3 = 0;
85279
85280     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":374
85281  *         if not hasattr(source, u'read'):
85282  *             filename = _encodeFilename(source)
85283  *             if not python.IS_PYTHON3:             # <<<<<<<<<<<<<<
85284  *                 source = filename
85285  *             source = open(source, u'rb')
85286  */
85287     __pyx_t_2 = (!IS_PYTHON3);
85288     if (__pyx_t_2) {
85289
85290       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":375
85291  *             filename = _encodeFilename(source)
85292  *             if not python.IS_PYTHON3:
85293  *                 source = filename             # <<<<<<<<<<<<<<
85294  *             source = open(source, u'rb')
85295  *         else:
85296  */
85297       __Pyx_INCREF(__pyx_v_filename);
85298       __Pyx_DECREF(__pyx_v_source);
85299       __pyx_v_source = __pyx_v_filename;
85300       goto __pyx_L7;
85301     }
85302     __pyx_L7:;
85303
85304     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":376
85305  *             if not python.IS_PYTHON3:
85306  *                 source = filename
85307  *             source = open(source, u'rb')             # <<<<<<<<<<<<<<
85308  *         else:
85309  *             filename = _encodeFilename(_getFilenameForFile(source))
85310  */
85311     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85312     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
85313     __Pyx_INCREF(__pyx_v_source);
85314     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_source);
85315     __Pyx_GIVEREF(__pyx_v_source);
85316     __Pyx_INCREF(((PyObject *)__pyx_kp_536));
85317     PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_kp_536));
85318     __Pyx_GIVEREF(((PyObject *)__pyx_kp_536));
85319     __pyx_t_4 = PyObject_Call(__pyx_builtin_open, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85320     __Pyx_GOTREF(__pyx_t_4);
85321     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
85322     __Pyx_DECREF(__pyx_v_source);
85323     __pyx_v_source = __pyx_t_4;
85324     __pyx_t_4 = 0;
85325     goto __pyx_L6;
85326   }
85327   /*else*/ {
85328
85329     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":378
85330  *             source = open(source, u'rb')
85331  *         else:
85332  *             filename = _encodeFilename(_getFilenameForFile(source))             # <<<<<<<<<<<<<<
85333  * 
85334  *         self._source = source
85335  */
85336     __pyx_t_4 = __pyx_f_4lxml_5etree__getFilenameForFile(__pyx_v_source); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85337     __Pyx_GOTREF(__pyx_t_4);
85338     __pyx_t_3 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85339     __Pyx_GOTREF(__pyx_t_3);
85340     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
85341     __Pyx_DECREF(__pyx_v_filename);
85342     __pyx_v_filename = __pyx_t_3;
85343     __pyx_t_3 = 0;
85344   }
85345   __pyx_L6:;
85346
85347   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":380
85348  *             filename = _encodeFilename(_getFilenameForFile(source))
85349  * 
85350  *         self._source = source             # <<<<<<<<<<<<<<
85351  *         if html:
85352  *             # make sure we're not looking for namespaces
85353  */
85354   __Pyx_INCREF(__pyx_v_source);
85355   __Pyx_GIVEREF(__pyx_v_source);
85356   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_source);
85357   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_source);
85358   ((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_source = __pyx_v_source;
85359
85360   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":381
85361  * 
85362  *         self._source = source
85363  *         if html:             # <<<<<<<<<<<<<<
85364  *             # make sure we're not looking for namespaces
85365  *             events = tuple([ event for event in events
85366  */
85367   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_html); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85368   if (__pyx_t_2) {
85369
85370     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":383
85371  *         if html:
85372  *             # make sure we're not looking for namespaces
85373  *             events = tuple([ event for event in events             # <<<<<<<<<<<<<<
85374  *                              if event != u'start-ns' and event != u'end-ns' ])
85375  * 
85376  */
85377     __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85378     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
85379
85380     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":384
85381  *             # make sure we're not looking for namespaces
85382  *             events = tuple([ event for event in events
85383  *                              if event != u'start-ns' and event != u'end-ns' ])             # <<<<<<<<<<<<<<
85384  * 
85385  *         self._events = events
85386  */
85387     if (PyList_CheckExact(__pyx_v_events) || PyTuple_CheckExact(__pyx_v_events)) {
85388       __pyx_t_5 = 0; __pyx_t_4 = __pyx_v_events; __Pyx_INCREF(__pyx_t_4);
85389     } else {
85390       __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_events); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85391       __Pyx_GOTREF(__pyx_t_4);
85392     }
85393     for (;;) {
85394
85395       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":383
85396  *         if html:
85397  *             # make sure we're not looking for namespaces
85398  *             events = tuple([ event for event in events             # <<<<<<<<<<<<<<
85399  *                              if event != u'start-ns' and event != u'end-ns' ])
85400  * 
85401  */
85402       if (likely(PyList_CheckExact(__pyx_t_4))) {
85403         if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
85404         __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++;
85405       } else if (likely(PyTuple_CheckExact(__pyx_t_4))) {
85406         if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
85407         __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++;
85408       } else {
85409         __pyx_t_6 = PyIter_Next(__pyx_t_4);
85410         if (!__pyx_t_6) {
85411           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85412           break;
85413         }
85414         __Pyx_GOTREF(__pyx_t_6);
85415       }
85416       __Pyx_DECREF(__pyx_v_event);
85417       __pyx_v_event = __pyx_t_6;
85418       __pyx_t_6 = 0;
85419
85420       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":384
85421  *             # make sure we're not looking for namespaces
85422  *             events = tuple([ event for event in events
85423  *                              if event != u'start-ns' and event != u'end-ns' ])             # <<<<<<<<<<<<<<
85424  * 
85425  *         self._events = events
85426  */
85427       __pyx_t_6 = PyObject_RichCompare(__pyx_v_event, ((PyObject *)__pyx_kp_537), Py_NE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85428       __Pyx_GOTREF(__pyx_t_6);
85429       __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85430       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
85431       if (__pyx_t_2) {
85432         __pyx_t_6 = PyObject_RichCompare(__pyx_v_event, ((PyObject *)__pyx_kp_538), Py_NE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85433         __Pyx_GOTREF(__pyx_t_6);
85434         __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85435         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
85436         __pyx_t_7 = __pyx_t_1;
85437       } else {
85438         __pyx_t_7 = __pyx_t_2;
85439       }
85440       if (__pyx_t_7) {
85441
85442         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":383
85443  *         if html:
85444  *             # make sure we're not looking for namespaces
85445  *             events = tuple([ event for event in events             # <<<<<<<<<<<<<<
85446  *                              if event != u'start-ns' and event != u'end-ns' ])
85447  * 
85448  */
85449         __pyx_t_8 = PyList_Append(__pyx_t_3, (PyObject*)__pyx_v_event); if (unlikely(__pyx_t_8)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85450         goto __pyx_L11;
85451       }
85452       __pyx_L11:;
85453     }
85454     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
85455     __pyx_t_4 = ((PyObject *)PyList_AsTuple(__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85456     __Pyx_GOTREF(((PyObject *)__pyx_t_4));
85457     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
85458     __Pyx_DECREF(__pyx_v_events);
85459     __pyx_v_events = ((PyObject *)__pyx_t_4);
85460     __pyx_t_4 = 0;
85461     goto __pyx_L8;
85462   }
85463   __pyx_L8:;
85464
85465   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":386
85466  *                              if event != u'start-ns' and event != u'end-ns' ])
85467  * 
85468  *         self._events = events             # <<<<<<<<<<<<<<
85469  *         self._tag = tag
85470  * 
85471  */
85472   __Pyx_INCREF(__pyx_v_events);
85473   __Pyx_GIVEREF(__pyx_v_events);
85474   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_events);
85475   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_events);
85476   ((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_events = __pyx_v_events;
85477
85478   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":387
85479  * 
85480  *         self._events = events
85481  *         self._tag = tag             # <<<<<<<<<<<<<<
85482  * 
85483  *         parse_options = _XML_DEFAULT_PARSE_OPTIONS
85484  */
85485   __Pyx_INCREF(__pyx_v_tag);
85486   __Pyx_GIVEREF(__pyx_v_tag);
85487   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_tag);
85488   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_tag);
85489   ((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_tag = __pyx_v_tag;
85490
85491   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":389
85492  *         self._tag = tag
85493  * 
85494  *         parse_options = _XML_DEFAULT_PARSE_OPTIONS             # <<<<<<<<<<<<<<
85495  *         if load_dtd:
85496  *             parse_options = parse_options | xmlparser.XML_PARSE_DTDLOAD
85497  */
85498   __pyx_v_parse_options = __pyx_v_4lxml_5etree__XML_DEFAULT_PARSE_OPTIONS;
85499
85500   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":390
85501  * 
85502  *         parse_options = _XML_DEFAULT_PARSE_OPTIONS
85503  *         if load_dtd:             # <<<<<<<<<<<<<<
85504  *             parse_options = parse_options | xmlparser.XML_PARSE_DTDLOAD
85505  *         if dtd_validation:
85506  */
85507   __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_load_dtd); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85508   if (__pyx_t_7) {
85509
85510     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":391
85511  *         parse_options = _XML_DEFAULT_PARSE_OPTIONS
85512  *         if load_dtd:
85513  *             parse_options = parse_options | xmlparser.XML_PARSE_DTDLOAD             # <<<<<<<<<<<<<<
85514  *         if dtd_validation:
85515  *             parse_options = parse_options | xmlparser.XML_PARSE_DTDVALID | \
85516  */
85517     __pyx_v_parse_options = (__pyx_v_parse_options | XML_PARSE_DTDLOAD);
85518     goto __pyx_L12;
85519   }
85520   __pyx_L12:;
85521
85522   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":392
85523  *         if load_dtd:
85524  *             parse_options = parse_options | xmlparser.XML_PARSE_DTDLOAD
85525  *         if dtd_validation:             # <<<<<<<<<<<<<<
85526  *             parse_options = parse_options | xmlparser.XML_PARSE_DTDVALID | \
85527  *                             xmlparser.XML_PARSE_DTDLOAD
85528  */
85529   __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_dtd_validation); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85530   if (__pyx_t_7) {
85531
85532     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":394
85533  *         if dtd_validation:
85534  *             parse_options = parse_options | xmlparser.XML_PARSE_DTDVALID | \
85535  *                             xmlparser.XML_PARSE_DTDLOAD             # <<<<<<<<<<<<<<
85536  *         if attribute_defaults:
85537  *             parse_options = parse_options | xmlparser.XML_PARSE_DTDATTR | \
85538  */
85539     __pyx_v_parse_options = ((__pyx_v_parse_options | XML_PARSE_DTDVALID) | XML_PARSE_DTDLOAD);
85540     goto __pyx_L13;
85541   }
85542   __pyx_L13:;
85543
85544   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":395
85545  *             parse_options = parse_options | xmlparser.XML_PARSE_DTDVALID | \
85546  *                             xmlparser.XML_PARSE_DTDLOAD
85547  *         if attribute_defaults:             # <<<<<<<<<<<<<<
85548  *             parse_options = parse_options | xmlparser.XML_PARSE_DTDATTR | \
85549  *                             xmlparser.XML_PARSE_DTDLOAD
85550  */
85551   __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_attribute_defaults); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85552   if (__pyx_t_7) {
85553
85554     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":397
85555  *         if attribute_defaults:
85556  *             parse_options = parse_options | xmlparser.XML_PARSE_DTDATTR | \
85557  *                             xmlparser.XML_PARSE_DTDLOAD             # <<<<<<<<<<<<<<
85558  *         if remove_blank_text:
85559  *             parse_options = parse_options | xmlparser.XML_PARSE_NOBLANKS
85560  */
85561     __pyx_v_parse_options = ((__pyx_v_parse_options | XML_PARSE_DTDATTR) | XML_PARSE_DTDLOAD);
85562     goto __pyx_L14;
85563   }
85564   __pyx_L14:;
85565
85566   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":398
85567  *             parse_options = parse_options | xmlparser.XML_PARSE_DTDATTR | \
85568  *                             xmlparser.XML_PARSE_DTDLOAD
85569  *         if remove_blank_text:             # <<<<<<<<<<<<<<
85570  *             parse_options = parse_options | xmlparser.XML_PARSE_NOBLANKS
85571  *         if huge_tree:
85572  */
85573   __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_remove_blank_text); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85574   if (__pyx_t_7) {
85575
85576     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":399
85577  *                             xmlparser.XML_PARSE_DTDLOAD
85578  *         if remove_blank_text:
85579  *             parse_options = parse_options | xmlparser.XML_PARSE_NOBLANKS             # <<<<<<<<<<<<<<
85580  *         if huge_tree:
85581  *             parse_options = parse_options | xmlparser.XML_PARSE_HUGE
85582  */
85583     __pyx_v_parse_options = (__pyx_v_parse_options | XML_PARSE_NOBLANKS);
85584     goto __pyx_L15;
85585   }
85586   __pyx_L15:;
85587
85588   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":400
85589  *         if remove_blank_text:
85590  *             parse_options = parse_options | xmlparser.XML_PARSE_NOBLANKS
85591  *         if huge_tree:             # <<<<<<<<<<<<<<
85592  *             parse_options = parse_options | xmlparser.XML_PARSE_HUGE
85593  *         if not no_network:
85594  */
85595   __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_huge_tree); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85596   if (__pyx_t_7) {
85597
85598     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":401
85599  *             parse_options = parse_options | xmlparser.XML_PARSE_NOBLANKS
85600  *         if huge_tree:
85601  *             parse_options = parse_options | xmlparser.XML_PARSE_HUGE             # <<<<<<<<<<<<<<
85602  *         if not no_network:
85603  *             parse_options = parse_options ^ xmlparser.XML_PARSE_NONET
85604  */
85605     __pyx_v_parse_options = (__pyx_v_parse_options | XML_PARSE_HUGE);
85606     goto __pyx_L16;
85607   }
85608   __pyx_L16:;
85609
85610   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":402
85611  *         if huge_tree:
85612  *             parse_options = parse_options | xmlparser.XML_PARSE_HUGE
85613  *         if not no_network:             # <<<<<<<<<<<<<<
85614  *             parse_options = parse_options ^ xmlparser.XML_PARSE_NONET
85615  *         if not compact:
85616  */
85617   __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_no_network); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85618   __pyx_t_2 = (!__pyx_t_7);
85619   if (__pyx_t_2) {
85620
85621     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":403
85622  *             parse_options = parse_options | xmlparser.XML_PARSE_HUGE
85623  *         if not no_network:
85624  *             parse_options = parse_options ^ xmlparser.XML_PARSE_NONET             # <<<<<<<<<<<<<<
85625  *         if not compact:
85626  *             parse_options = parse_options ^ xmlparser.XML_PARSE_COMPACT
85627  */
85628     __pyx_v_parse_options = (__pyx_v_parse_options ^ XML_PARSE_NONET);
85629     goto __pyx_L17;
85630   }
85631   __pyx_L17:;
85632
85633   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":404
85634  *         if not no_network:
85635  *             parse_options = parse_options ^ xmlparser.XML_PARSE_NONET
85636  *         if not compact:             # <<<<<<<<<<<<<<
85637  *             parse_options = parse_options ^ xmlparser.XML_PARSE_COMPACT
85638  *         if not resolve_entities:
85639  */
85640   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_compact); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85641   __pyx_t_7 = (!__pyx_t_2);
85642   if (__pyx_t_7) {
85643
85644     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":405
85645  *             parse_options = parse_options ^ xmlparser.XML_PARSE_NONET
85646  *         if not compact:
85647  *             parse_options = parse_options ^ xmlparser.XML_PARSE_COMPACT             # <<<<<<<<<<<<<<
85648  *         if not resolve_entities:
85649  *             parse_options = parse_options ^ xmlparser.XML_PARSE_NOENT
85650  */
85651     __pyx_v_parse_options = (__pyx_v_parse_options ^ XML_PARSE_COMPACT);
85652     goto __pyx_L18;
85653   }
85654   __pyx_L18:;
85655
85656   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":406
85657  *         if not compact:
85658  *             parse_options = parse_options ^ xmlparser.XML_PARSE_COMPACT
85659  *         if not resolve_entities:             # <<<<<<<<<<<<<<
85660  *             parse_options = parse_options ^ xmlparser.XML_PARSE_NOENT
85661  *         if not strip_cdata:
85662  */
85663   __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_resolve_entities); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85664   __pyx_t_2 = (!__pyx_t_7);
85665   if (__pyx_t_2) {
85666
85667     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":407
85668  *             parse_options = parse_options ^ xmlparser.XML_PARSE_COMPACT
85669  *         if not resolve_entities:
85670  *             parse_options = parse_options ^ xmlparser.XML_PARSE_NOENT             # <<<<<<<<<<<<<<
85671  *         if not strip_cdata:
85672  *             parse_options = parse_options ^ xmlparser.XML_PARSE_NOCDATA
85673  */
85674     __pyx_v_parse_options = (__pyx_v_parse_options ^ XML_PARSE_NOENT);
85675     goto __pyx_L19;
85676   }
85677   __pyx_L19:;
85678
85679   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":408
85680  *         if not resolve_entities:
85681  *             parse_options = parse_options ^ xmlparser.XML_PARSE_NOENT
85682  *         if not strip_cdata:             # <<<<<<<<<<<<<<
85683  *             parse_options = parse_options ^ xmlparser.XML_PARSE_NOCDATA
85684  * 
85685  */
85686   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_strip_cdata); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85687   __pyx_t_7 = (!__pyx_t_2);
85688   if (__pyx_t_7) {
85689
85690     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":409
85691  *             parse_options = parse_options ^ xmlparser.XML_PARSE_NOENT
85692  *         if not strip_cdata:
85693  *             parse_options = parse_options ^ xmlparser.XML_PARSE_NOCDATA             # <<<<<<<<<<<<<<
85694  * 
85695  *         _BaseParser.__init__(self, parse_options, html, schema,
85696  */
85697     __pyx_v_parse_options = (__pyx_v_parse_options ^ XML_PARSE_NOCDATA);
85698     goto __pyx_L20;
85699   }
85700   __pyx_L20:;
85701
85702   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":411
85703  *             parse_options = parse_options ^ xmlparser.XML_PARSE_NOCDATA
85704  * 
85705  *         _BaseParser.__init__(self, parse_options, html, schema,             # <<<<<<<<<<<<<<
85706  *                              remove_comments, remove_pis, strip_cdata,
85707  *                              None, filename, encoding)
85708  */
85709   __pyx_t_4 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__BaseParser)), __pyx_kp___init__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85710   __Pyx_GOTREF(__pyx_t_4);
85711   __pyx_t_3 = PyInt_FromLong(__pyx_v_parse_options); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85712   __Pyx_GOTREF(__pyx_t_3);
85713
85714   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":413
85715  *         _BaseParser.__init__(self, parse_options, html, schema,
85716  *                              remove_comments, remove_pis, strip_cdata,
85717  *                              None, filename, encoding)             # <<<<<<<<<<<<<<
85718  * 
85719  *         if self._for_html:
85720  */
85721   __pyx_t_6 = PyTuple_New(10); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85722   __Pyx_GOTREF(((PyObject *)__pyx_t_6));
85723   __Pyx_INCREF(__pyx_v_self);
85724   PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_self);
85725   __Pyx_GIVEREF(__pyx_v_self);
85726   PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3);
85727   __Pyx_GIVEREF(__pyx_t_3);
85728   __Pyx_INCREF(__pyx_v_html);
85729   PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_html);
85730   __Pyx_GIVEREF(__pyx_v_html);
85731   __Pyx_INCREF(((PyObject *)__pyx_v_schema));
85732   PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_v_schema));
85733   __Pyx_GIVEREF(((PyObject *)__pyx_v_schema));
85734   __Pyx_INCREF(__pyx_v_remove_comments);
85735   PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_v_remove_comments);
85736   __Pyx_GIVEREF(__pyx_v_remove_comments);
85737   __Pyx_INCREF(__pyx_v_remove_pis);
85738   PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_v_remove_pis);
85739   __Pyx_GIVEREF(__pyx_v_remove_pis);
85740   __Pyx_INCREF(__pyx_v_strip_cdata);
85741   PyTuple_SET_ITEM(__pyx_t_6, 6, __pyx_v_strip_cdata);
85742   __Pyx_GIVEREF(__pyx_v_strip_cdata);
85743   __Pyx_INCREF(Py_None);
85744   PyTuple_SET_ITEM(__pyx_t_6, 7, Py_None);
85745   __Pyx_GIVEREF(Py_None);
85746   __Pyx_INCREF(__pyx_v_filename);
85747   PyTuple_SET_ITEM(__pyx_t_6, 8, __pyx_v_filename);
85748   __Pyx_GIVEREF(__pyx_v_filename);
85749   __Pyx_INCREF(__pyx_v_encoding);
85750   PyTuple_SET_ITEM(__pyx_t_6, 9, __pyx_v_encoding);
85751   __Pyx_GIVEREF(__pyx_v_encoding);
85752   __pyx_t_3 = 0;
85753   __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85754   __Pyx_GOTREF(__pyx_t_3);
85755   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
85756   __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
85757   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
85758
85759   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":415
85760  *                              None, filename, encoding)
85761  * 
85762  *         if self._for_html:             # <<<<<<<<<<<<<<
85763  *             self._parse_chunk = htmlparser.htmlParseChunk
85764  *         else:
85765  */
85766   __pyx_t_7 = ((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->__pyx_base._for_html;
85767   if (__pyx_t_7) {
85768
85769     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":416
85770  * 
85771  *         if self._for_html:
85772  *             self._parse_chunk = htmlparser.htmlParseChunk             # <<<<<<<<<<<<<<
85773  *         else:
85774  *             self._parse_chunk = xmlparser.xmlParseChunk
85775  */
85776     ((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_parse_chunk = htmlParseChunk;
85777     goto __pyx_L21;
85778   }
85779   /*else*/ {
85780
85781     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":418
85782  *             self._parse_chunk = htmlparser.htmlParseChunk
85783  *         else:
85784  *             self._parse_chunk = xmlparser.xmlParseChunk             # <<<<<<<<<<<<<<
85785  * 
85786  *         context = <_IterparseContext>self._getPushParserContext()
85787  */
85788     ((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_parse_chunk = xmlParseChunk;
85789   }
85790   __pyx_L21:;
85791
85792   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":420
85793  *             self._parse_chunk = xmlparser.xmlParseChunk
85794  * 
85795  *         context = <_IterparseContext>self._getPushParserContext()             # <<<<<<<<<<<<<<
85796  *         __GLOBAL_PARSER_CONTEXT.initParserDict(context._c_ctxt)
85797  * 
85798  */
85799   __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree_iterparse *)((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._getPushParserContext(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85800   __Pyx_GOTREF(__pyx_t_3);
85801   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_t_3)));
85802   __Pyx_DECREF(((PyObject *)__pyx_v_context));
85803   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_t_3);
85804   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
85805
85806   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":421
85807  * 
85808  *         context = <_IterparseContext>self._getPushParserContext()
85809  *         __GLOBAL_PARSER_CONTEXT.initParserDict(context._c_ctxt)             # <<<<<<<<<<<<<<
85810  * 
85811  *         if self._default_encoding is not None:
85812  */
85813   ((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initParserDict(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT, __pyx_v_context->__pyx_base._c_ctxt);
85814
85815   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":423
85816  *         __GLOBAL_PARSER_CONTEXT.initParserDict(context._c_ctxt)
85817  * 
85818  *         if self._default_encoding is not None:             # <<<<<<<<<<<<<<
85819  *             if self._for_html:
85820  *                 error = _htmlCtxtResetPush(
85821  */
85822   __pyx_t_7 = (((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->__pyx_base._default_encoding != Py_None);
85823   if (__pyx_t_7) {
85824
85825     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":424
85826  * 
85827  *         if self._default_encoding is not None:
85828  *             if self._for_html:             # <<<<<<<<<<<<<<
85829  *                 error = _htmlCtxtResetPush(
85830  *                     context._c_ctxt, NULL, 0,
85831  */
85832     __pyx_t_7 = ((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->__pyx_base._for_html;
85833     if (__pyx_t_7) {
85834
85835       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":427
85836  *                 error = _htmlCtxtResetPush(
85837  *                     context._c_ctxt, NULL, 0,
85838  *                     _cstr(self._default_encoding), self._parse_options)             # <<<<<<<<<<<<<<
85839  *             else:
85840  *                 xmlparser.xmlCtxtUseOptions(
85841  */
85842       __pyx_t_8 = __pyx_f_4lxml_5etree__htmlCtxtResetPush(__pyx_v_context->__pyx_base._c_ctxt, NULL, 0, PyString_AS_STRING(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->__pyx_base._default_encoding), ((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->__pyx_base._parse_options); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85843       __pyx_t_3 = PyInt_FromLong(__pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85844       __Pyx_GOTREF(__pyx_t_3);
85845       __Pyx_DECREF(__pyx_v_error);
85846       __pyx_v_error = __pyx_t_3;
85847       __pyx_t_3 = 0;
85848       goto __pyx_L23;
85849     }
85850     /*else*/ {
85851
85852       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":430
85853  *             else:
85854  *                 xmlparser.xmlCtxtUseOptions(
85855  *                     context._c_ctxt, self._parse_options)             # <<<<<<<<<<<<<<
85856  *                 error = xmlparser.xmlCtxtResetPush(
85857  *                     context._c_ctxt, NULL, 0, NULL,
85858  */
85859       xmlCtxtUseOptions(__pyx_v_context->__pyx_base._c_ctxt, ((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->__pyx_base._parse_options);
85860
85861       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":433
85862  *                 error = xmlparser.xmlCtxtResetPush(
85863  *                     context._c_ctxt, NULL, 0, NULL,
85864  *                     _cstr(self._default_encoding))             # <<<<<<<<<<<<<<
85865  * 
85866  *         context.prepare()
85867  */
85868       __pyx_t_3 = PyInt_FromLong(xmlCtxtResetPush(__pyx_v_context->__pyx_base._c_ctxt, NULL, 0, NULL, PyString_AS_STRING(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->__pyx_base._default_encoding))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85869       __Pyx_GOTREF(__pyx_t_3);
85870       __Pyx_DECREF(__pyx_v_error);
85871       __pyx_v_error = __pyx_t_3;
85872       __pyx_t_3 = 0;
85873     }
85874     __pyx_L23:;
85875     goto __pyx_L22;
85876   }
85877   __pyx_L22:;
85878
85879   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":435
85880  *                     _cstr(self._default_encoding))
85881  * 
85882  *         context.prepare()             # <<<<<<<<<<<<<<
85883  *         # parser will not be unlocked - no other methods supported
85884  * 
85885  */
85886   __pyx_t_8 = ((struct __pyx_vtabstruct_4lxml_5etree__IterparseContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.prepare(((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_v_context)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85887
85888   __pyx_r = 0;
85889   goto __pyx_L0;
85890   __pyx_L1_error:;
85891   __Pyx_XDECREF(__pyx_t_3);
85892   __Pyx_XDECREF(__pyx_t_4);
85893   __Pyx_XDECREF(__pyx_t_6);
85894   __Pyx_AddTraceback("lxml.etree.iterparse.__init__");
85895   __pyx_r = -1;
85896   __pyx_L0:;
85897   __Pyx_DECREF((PyObject *)__pyx_v_context);
85898   __Pyx_DECREF(__pyx_v_filename);
85899   __Pyx_DECREF(__pyx_v_error);
85900   __Pyx_DECREF(__pyx_v_event);
85901   __Pyx_DECREF(__pyx_v_source);
85902   __Pyx_DECREF(__pyx_v_events);
85903   __Pyx_FinishRefcountContext();
85904   return __pyx_r;
85905 }
85906
85907 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":441
85908  *         u"""The error log of the last (or current) parser run.
85909  *         """
85910  *         def __get__(self):             # <<<<<<<<<<<<<<
85911  *             cdef _ParserContext context
85912  *             context = self._getPushParserContext()
85913  */
85914
85915 static PyObject *__pyx_pf_4lxml_5etree_9iterparse_9error_log___get__(PyObject *__pyx_v_self); /*proto*/
85916 static PyObject *__pyx_pf_4lxml_5etree_9iterparse_9error_log___get__(PyObject *__pyx_v_self) {
85917   struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_context;
85918   PyObject *__pyx_r = NULL;
85919   PyObject *__pyx_t_1 = NULL;
85920   PyObject *__pyx_t_2 = NULL;
85921   __Pyx_SetupRefcountContext("__get__");
85922   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); __Pyx_INCREF(Py_None);
85923
85924   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":443
85925  *         def __get__(self):
85926  *             cdef _ParserContext context
85927  *             context = self._getPushParserContext()             # <<<<<<<<<<<<<<
85928  *             return context._error_log.copy()
85929  * 
85930  */
85931   __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree_iterparse *)((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._getPushParserContext(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85932   __Pyx_GOTREF(__pyx_t_1);
85933   __Pyx_DECREF(((PyObject *)__pyx_v_context));
85934   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_t_1);
85935   __pyx_t_1 = 0;
85936
85937   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":444
85938  *             cdef _ParserContext context
85939  *             context = self._getPushParserContext()
85940  *             return context._error_log.copy()             # <<<<<<<<<<<<<<
85941  * 
85942  *     cdef _ParserContext _createContext(self, target):
85943  */
85944   __Pyx_XDECREF(__pyx_r);
85945   __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_context->_error_log), __pyx_kp_copy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85946   __Pyx_GOTREF(__pyx_t_1);
85947   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85948   __Pyx_GOTREF(__pyx_t_2);
85949   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
85950   __pyx_r = __pyx_t_2;
85951   __pyx_t_2 = 0;
85952   goto __pyx_L0;
85953
85954   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
85955   goto __pyx_L0;
85956   __pyx_L1_error:;
85957   __Pyx_XDECREF(__pyx_t_1);
85958   __Pyx_XDECREF(__pyx_t_2);
85959   __Pyx_AddTraceback("lxml.etree.iterparse.error_log.__get__");
85960   __pyx_r = NULL;
85961   __pyx_L0:;
85962   __Pyx_DECREF((PyObject *)__pyx_v_context);
85963   __Pyx_XGIVEREF(__pyx_r);
85964   __Pyx_FinishRefcountContext();
85965   return __pyx_r;
85966 }
85967
85968 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":446
85969  *             return context._error_log.copy()
85970  * 
85971  *     cdef _ParserContext _createContext(self, target):             # <<<<<<<<<<<<<<
85972  *         cdef _IterparseContext context
85973  *         context = _IterparseContext()
85974  */
85975
85976 static  struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_f_4lxml_5etree_9iterparse__createContext(struct __pyx_obj_4lxml_5etree_iterparse *__pyx_v_self, PyObject *__pyx_v_target) {
85977   struct __pyx_obj_4lxml_5etree__IterparseContext *__pyx_v_context;
85978   struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_r = NULL;
85979   PyObject *__pyx_t_1 = NULL;
85980   __Pyx_SetupRefcountContext("_createContext");
85981   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)Py_None); __Pyx_INCREF(Py_None);
85982
85983   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":448
85984  *     cdef _ParserContext _createContext(self, target):
85985  *         cdef _IterparseContext context
85986  *         context = _IterparseContext()             # <<<<<<<<<<<<<<
85987  *         context._setEventFilter(self._events, self._tag)
85988  *         return context
85989  */
85990   __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__IterparseContext)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85991   __Pyx_GOTREF(__pyx_t_1);
85992   if (!(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__IterparseContext))) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
85993   __Pyx_DECREF(((PyObject *)__pyx_v_context));
85994   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_t_1);
85995   __pyx_t_1 = 0;
85996
85997   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":449
85998  *         cdef _IterparseContext context
85999  *         context = _IterparseContext()
86000  *         context._setEventFilter(self._events, self._tag)             # <<<<<<<<<<<<<<
86001  *         return context
86002  * 
86003  */
86004   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__IterparseContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->_setEventFilter(__pyx_v_context, __pyx_v_self->_events, __pyx_v_self->_tag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
86005   __Pyx_GOTREF(__pyx_t_1);
86006   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
86007
86008   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":450
86009  *         context = _IterparseContext()
86010  *         context._setEventFilter(self._events, self._tag)
86011  *         return context             # <<<<<<<<<<<<<<
86012  * 
86013  *     def copy(self):
86014  */
86015   __Pyx_XDECREF(((PyObject *)__pyx_r));
86016   __Pyx_INCREF(((PyObject *)__pyx_v_context));
86017   __pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_v_context);
86018   goto __pyx_L0;
86019
86020   __pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); __Pyx_INCREF(Py_None);
86021   goto __pyx_L0;
86022   __pyx_L1_error:;
86023   __Pyx_XDECREF(__pyx_t_1);
86024   __Pyx_AddTraceback("lxml.etree.iterparse._createContext");
86025   __pyx_r = 0;
86026   __pyx_L0:;
86027   __Pyx_DECREF((PyObject *)__pyx_v_context);
86028   __Pyx_XGIVEREF((PyObject *)__pyx_r);
86029   __Pyx_FinishRefcountContext();
86030   return __pyx_r;
86031 }
86032
86033 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":452
86034  *         return context
86035  * 
86036  *     def copy(self):             # <<<<<<<<<<<<<<
86037  *         raise TypeError, u"iterparse parsers cannot be copied"
86038  * 
86039  */
86040
86041 static PyObject *__pyx_pf_4lxml_5etree_9iterparse_copy(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
86042 static PyObject *__pyx_pf_4lxml_5etree_9iterparse_copy(PyObject *__pyx_v_self, PyObject *unused) {
86043   PyObject *__pyx_r = NULL;
86044   __Pyx_SetupRefcountContext("copy");
86045
86046   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":453
86047  * 
86048  *     def copy(self):
86049  *         raise TypeError, u"iterparse parsers cannot be copied"             # <<<<<<<<<<<<<<
86050  * 
86051  *     def __iter__(self):
86052  */
86053   __Pyx_Raise(__pyx_builtin_TypeError, ((PyObject *)__pyx_kp_539), 0);
86054   {__pyx_filename = __pyx_f[14]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
86055
86056   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
86057   goto __pyx_L0;
86058   __pyx_L1_error:;
86059   __Pyx_AddTraceback("lxml.etree.iterparse.copy");
86060   __pyx_r = NULL;
86061   __pyx_L0:;
86062   __Pyx_XGIVEREF(__pyx_r);
86063   __Pyx_FinishRefcountContext();
86064   return __pyx_r;
86065 }
86066
86067 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":455
86068  *         raise TypeError, u"iterparse parsers cannot be copied"
86069  * 
86070  *     def __iter__(self):             # <<<<<<<<<<<<<<
86071  *         return self
86072  * 
86073  */
86074
86075 static PyObject *__pyx_pf_4lxml_5etree_9iterparse___iter__(PyObject *__pyx_v_self); /*proto*/
86076 static PyObject *__pyx_pf_4lxml_5etree_9iterparse___iter__(PyObject *__pyx_v_self) {
86077   PyObject *__pyx_r = NULL;
86078   __Pyx_SetupRefcountContext("__iter__");
86079
86080   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":456
86081  * 
86082  *     def __iter__(self):
86083  *         return self             # <<<<<<<<<<<<<<
86084  * 
86085  *     def __next__(self):
86086  */
86087   __Pyx_XDECREF(__pyx_r);
86088   __Pyx_INCREF(__pyx_v_self);
86089   __pyx_r = __pyx_v_self;
86090   goto __pyx_L0;
86091
86092   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
86093   __pyx_L0:;
86094   __Pyx_XGIVEREF(__pyx_r);
86095   __Pyx_FinishRefcountContext();
86096   return __pyx_r;
86097 }
86098
86099 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":458
86100  *         return self
86101  * 
86102  *     def __next__(self):             # <<<<<<<<<<<<<<
86103  *         cdef _IterparseContext context
86104  *         cdef xmlparser.xmlParserCtxt* pctxt
86105  */
86106
86107 static PyObject *__pyx_pf_4lxml_5etree_9iterparse___next__(PyObject *__pyx_v_self); /*proto*/
86108 static PyObject *__pyx_pf_4lxml_5etree_9iterparse___next__(PyObject *__pyx_v_self) {
86109   struct __pyx_obj_4lxml_5etree__IterparseContext *__pyx_v_context;
86110   xmlParserCtxt *__pyx_v_pctxt;
86111   FILE *__pyx_v_c_stream;
86112   char *__pyx_v_c_data;
86113   Py_ssize_t __pyx_v_c_data_len;
86114   int __pyx_v_error;
86115   int __pyx_v_done;
86116   PyObject *__pyx_v_item;
86117   PyObject *__pyx_v_data;
86118   PyObject *__pyx_v_element;
86119   PyObject *__pyx_r = NULL;
86120   int __pyx_t_1;
86121   PyObject *__pyx_t_2 = NULL;
86122   PyObject *__pyx_t_3 = NULL;
86123   PyObject *__pyx_t_4 = NULL;
86124   int __pyx_t_5;
86125   int __pyx_t_6;
86126   __Pyx_SetupRefcountContext("__next__");
86127   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)Py_None); __Pyx_INCREF(Py_None);
86128   __pyx_v_item = Py_None; __Pyx_INCREF(Py_None);
86129   __pyx_v_data = Py_None; __Pyx_INCREF(Py_None);
86130   __pyx_v_element = Py_None; __Pyx_INCREF(Py_None);
86131
86132   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":465
86133  *         cdef Py_ssize_t c_data_len
86134  *         cdef int error, done
86135  *         if self._source is None:             # <<<<<<<<<<<<<<
86136  *             raise StopIteration
86137  * 
86138  */
86139   __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_source == Py_None);
86140   if (__pyx_t_1) {
86141
86142     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":466
86143  *         cdef int error, done
86144  *         if self._source is None:
86145  *             raise StopIteration             # <<<<<<<<<<<<<<
86146  * 
86147  *         context = <_IterparseContext>self._push_parser_context
86148  */
86149     __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
86150     {__pyx_filename = __pyx_f[14]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
86151     goto __pyx_L5;
86152   }
86153   __pyx_L5:;
86154
86155   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":468
86156  *             raise StopIteration
86157  * 
86158  *         context = <_IterparseContext>self._push_parser_context             # <<<<<<<<<<<<<<
86159  *         if python.PyList_GET_SIZE(context._events) > context._event_index:
86160  *             item = python.PyList_GET_ITEM(context._events, context._event_index)
86161  */
86162   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__IterparseContext *)((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->__pyx_base._push_parser_context)));
86163   __Pyx_DECREF(((PyObject *)__pyx_v_context));
86164   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->__pyx_base._push_parser_context);
86165
86166   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":469
86167  * 
86168  *         context = <_IterparseContext>self._push_parser_context
86169  *         if python.PyList_GET_SIZE(context._events) > context._event_index:             # <<<<<<<<<<<<<<
86170  *             item = python.PyList_GET_ITEM(context._events, context._event_index)
86171  *             python.Py_INCREF(item) # 'borrowed reference' from PyList_GET_ITEM
86172  */
86173   __pyx_t_1 = (PyList_GET_SIZE(((PyObject *)__pyx_v_context->_events)) > __pyx_v_context->_event_index);
86174   if (__pyx_t_1) {
86175
86176     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":470
86177  *         context = <_IterparseContext>self._push_parser_context
86178  *         if python.PyList_GET_SIZE(context._events) > context._event_index:
86179  *             item = python.PyList_GET_ITEM(context._events, context._event_index)             # <<<<<<<<<<<<<<
86180  *             python.Py_INCREF(item) # 'borrowed reference' from PyList_GET_ITEM
86181  *             context._event_index += 1
86182  */
86183     __pyx_t_2 = PyList_GET_ITEM(((PyObject *)__pyx_v_context->_events), __pyx_v_context->_event_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
86184     __Pyx_GOTREF(__pyx_t_2);
86185     __Pyx_DECREF(__pyx_v_item);
86186     __pyx_v_item = __pyx_t_2;
86187     __pyx_t_2 = 0;
86188
86189     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":471
86190  *         if python.PyList_GET_SIZE(context._events) > context._event_index:
86191  *             item = python.PyList_GET_ITEM(context._events, context._event_index)
86192  *             python.Py_INCREF(item) # 'borrowed reference' from PyList_GET_ITEM             # <<<<<<<<<<<<<<
86193  *             context._event_index += 1
86194  *             return item
86195  */
86196     Py_INCREF(__pyx_v_item);
86197
86198     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":472
86199  *             item = python.PyList_GET_ITEM(context._events, context._event_index)
86200  *             python.Py_INCREF(item) # 'borrowed reference' from PyList_GET_ITEM
86201  *             context._event_index += 1             # <<<<<<<<<<<<<<
86202  *             return item
86203  * 
86204  */
86205     __pyx_v_context->_event_index += 1;
86206
86207     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":473
86208  *             python.Py_INCREF(item) # 'borrowed reference' from PyList_GET_ITEM
86209  *             context._event_index += 1
86210  *             return item             # <<<<<<<<<<<<<<
86211  * 
86212  *         del context._events[:]
86213  */
86214     __Pyx_XDECREF(__pyx_r);
86215     __Pyx_INCREF(__pyx_v_item);
86216     __pyx_r = __pyx_v_item;
86217     goto __pyx_L0;
86218     goto __pyx_L6;
86219   }
86220   __pyx_L6:;
86221
86222   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":475
86223  *             return item
86224  * 
86225  *         del context._events[:]             # <<<<<<<<<<<<<<
86226  *         pctxt = context._c_ctxt
86227  *         error = done = 0
86228  */
86229   if (PySequence_DelSlice(((PyObject *)__pyx_v_context->_events), 0, PY_SSIZE_T_MAX) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
86230
86231   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":476
86232  * 
86233  *         del context._events[:]
86234  *         pctxt = context._c_ctxt             # <<<<<<<<<<<<<<
86235  *         error = done = 0
86236  *         c_stream = python.PyFile_AsFile(self._source)
86237  */
86238   __pyx_v_pctxt = __pyx_v_context->__pyx_base._c_ctxt;
86239
86240   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":477
86241  *         del context._events[:]
86242  *         pctxt = context._c_ctxt
86243  *         error = done = 0             # <<<<<<<<<<<<<<
86244  *         c_stream = python.PyFile_AsFile(self._source)
86245  *         while python.PyList_GET_SIZE(context._events) == 0:
86246  */
86247   __pyx_v_error = 0;
86248   __pyx_v_done = 0;
86249
86250   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":478
86251  *         pctxt = context._c_ctxt
86252  *         error = done = 0
86253  *         c_stream = python.PyFile_AsFile(self._source)             # <<<<<<<<<<<<<<
86254  *         while python.PyList_GET_SIZE(context._events) == 0:
86255  *             if c_stream is NULL:
86256  */
86257   __pyx_v_c_stream = PyFile_AsFile(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_source);
86258
86259   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":479
86260  *         error = done = 0
86261  *         c_stream = python.PyFile_AsFile(self._source)
86262  *         while python.PyList_GET_SIZE(context._events) == 0:             # <<<<<<<<<<<<<<
86263  *             if c_stream is NULL:
86264  *                 data = self._source.read(__ITERPARSE_CHUNK_SIZE)
86265  */
86266   while (1) {
86267     __pyx_t_1 = (PyList_GET_SIZE(((PyObject *)__pyx_v_context->_events)) == 0);
86268     if (!__pyx_t_1) break;
86269
86270     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":480
86271  *         c_stream = python.PyFile_AsFile(self._source)
86272  *         while python.PyList_GET_SIZE(context._events) == 0:
86273  *             if c_stream is NULL:             # <<<<<<<<<<<<<<
86274  *                 data = self._source.read(__ITERPARSE_CHUNK_SIZE)
86275  *                 if not python.PyString_Check(data):
86276  */
86277     __pyx_t_1 = (__pyx_v_c_stream == NULL);
86278     if (__pyx_t_1) {
86279
86280       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":481
86281  *         while python.PyList_GET_SIZE(context._events) == 0:
86282  *             if c_stream is NULL:
86283  *                 data = self._source.read(__ITERPARSE_CHUNK_SIZE)             # <<<<<<<<<<<<<<
86284  *                 if not python.PyString_Check(data):
86285  *                     self._source = None
86286  */
86287       __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_source, __pyx_kp_read); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
86288       __Pyx_GOTREF(__pyx_t_2);
86289       __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
86290       __Pyx_GOTREF(((PyObject *)__pyx_t_3));
86291       __Pyx_INCREF(__pyx_int_32768);
86292       PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_32768);
86293       __Pyx_GIVEREF(__pyx_int_32768);
86294       __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
86295       __Pyx_GOTREF(__pyx_t_4);
86296       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
86297       __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
86298       __Pyx_DECREF(__pyx_v_data);
86299       __pyx_v_data = __pyx_t_4;
86300       __pyx_t_4 = 0;
86301
86302       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":482
86303  *             if c_stream is NULL:
86304  *                 data = self._source.read(__ITERPARSE_CHUNK_SIZE)
86305  *                 if not python.PyString_Check(data):             # <<<<<<<<<<<<<<
86306  *                     self._source = None
86307  *                     raise TypeError, u"reading file objects must return plain strings"
86308  */
86309       __pyx_t_1 = (!PyString_Check(__pyx_v_data));
86310       if (__pyx_t_1) {
86311
86312         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":483
86313  *                 data = self._source.read(__ITERPARSE_CHUNK_SIZE)
86314  *                 if not python.PyString_Check(data):
86315  *                     self._source = None             # <<<<<<<<<<<<<<
86316  *                     raise TypeError, u"reading file objects must return plain strings"
86317  *                 c_data_len = python.PyString_GET_SIZE(data)
86318  */
86319         __Pyx_INCREF(Py_None);
86320         __Pyx_GIVEREF(Py_None);
86321         __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_source);
86322         __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_source);
86323         ((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_source = Py_None;
86324
86325         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":484
86326  *                 if not python.PyString_Check(data):
86327  *                     self._source = None
86328  *                     raise TypeError, u"reading file objects must return plain strings"             # <<<<<<<<<<<<<<
86329  *                 c_data_len = python.PyString_GET_SIZE(data)
86330  *                 c_data = _cstr(data)
86331  */
86332         __Pyx_Raise(__pyx_builtin_TypeError, ((PyObject *)__pyx_kp_540), 0);
86333         {__pyx_filename = __pyx_f[14]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
86334         goto __pyx_L10;
86335       }
86336       __pyx_L10:;
86337
86338       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":485
86339  *                     self._source = None
86340  *                     raise TypeError, u"reading file objects must return plain strings"
86341  *                 c_data_len = python.PyString_GET_SIZE(data)             # <<<<<<<<<<<<<<
86342  *                 c_data = _cstr(data)
86343  *                 done = (c_data_len == 0)
86344  */
86345       __pyx_v_c_data_len = PyString_GET_SIZE(__pyx_v_data);
86346
86347       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":486
86348  *                     raise TypeError, u"reading file objects must return plain strings"
86349  *                 c_data_len = python.PyString_GET_SIZE(data)
86350  *                 c_data = _cstr(data)             # <<<<<<<<<<<<<<
86351  *                 done = (c_data_len == 0)
86352  *                 error = self._parse_chunk(pctxt, c_data, c_data_len, done)
86353  */
86354       __pyx_v_c_data = PyString_AS_STRING(__pyx_v_data);
86355
86356       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":487
86357  *                 c_data_len = python.PyString_GET_SIZE(data)
86358  *                 c_data = _cstr(data)
86359  *                 done = (c_data_len == 0)             # <<<<<<<<<<<<<<
86360  *                 error = self._parse_chunk(pctxt, c_data, c_data_len, done)
86361  *             else:
86362  */
86363       __pyx_v_done = (__pyx_v_c_data_len == 0);
86364
86365       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":488
86366  *                 c_data = _cstr(data)
86367  *                 done = (c_data_len == 0)
86368  *                 error = self._parse_chunk(pctxt, c_data, c_data_len, done)             # <<<<<<<<<<<<<<
86369  *             else:
86370  *                 if self._buffer is None:
86371  */
86372       __pyx_v_error = ((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_parse_chunk(__pyx_v_pctxt, __pyx_v_c_data, __pyx_v_c_data_len, __pyx_v_done);
86373       goto __pyx_L9;
86374     }
86375     /*else*/ {
86376
86377       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":490
86378  *                 error = self._parse_chunk(pctxt, c_data, c_data_len, done)
86379  *             else:
86380  *                 if self._buffer is None:             # <<<<<<<<<<<<<<
86381  *                     self._buffer = python.PyString_FromStringAndSize(
86382  *                         NULL, __ITERPARSE_CHUNK_SIZE)
86383  */
86384       __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_buffer == Py_None);
86385       if (__pyx_t_1) {
86386
86387         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":492
86388  *                 if self._buffer is None:
86389  *                     self._buffer = python.PyString_FromStringAndSize(
86390  *                         NULL, __ITERPARSE_CHUNK_SIZE)             # <<<<<<<<<<<<<<
86391  *                 c_data = _cstr(self._buffer)
86392  *                 with nogil:
86393  */
86394         __pyx_t_4 = PyString_FromStringAndSize(NULL, 32768); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
86395         __Pyx_GOTREF(__pyx_t_4);
86396
86397         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":491
86398  *             else:
86399  *                 if self._buffer is None:
86400  *                     self._buffer = python.PyString_FromStringAndSize(             # <<<<<<<<<<<<<<
86401  *                         NULL, __ITERPARSE_CHUNK_SIZE)
86402  *                 c_data = _cstr(self._buffer)
86403  */
86404         __Pyx_GIVEREF(__pyx_t_4);
86405         __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_buffer);
86406         __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_buffer);
86407         ((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_buffer = __pyx_t_4;
86408         __pyx_t_4 = 0;
86409         goto __pyx_L11;
86410       }
86411       __pyx_L11:;
86412
86413       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":493
86414  *                     self._buffer = python.PyString_FromStringAndSize(
86415  *                         NULL, __ITERPARSE_CHUNK_SIZE)
86416  *                 c_data = _cstr(self._buffer)             # <<<<<<<<<<<<<<
86417  *                 with nogil:
86418  *                     c_data_len = cstd.fread(
86419  */
86420       __pyx_v_c_data = PyString_AS_STRING(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_buffer);
86421
86422       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":494
86423  *                         NULL, __ITERPARSE_CHUNK_SIZE)
86424  *                 c_data = _cstr(self._buffer)
86425  *                 with nogil:             # <<<<<<<<<<<<<<
86426  *                     c_data_len = cstd.fread(
86427  *                         c_data, 1, __ITERPARSE_CHUNK_SIZE, c_stream)
86428  */
86429       { PyThreadState *_save;
86430         Py_UNBLOCK_THREADS
86431         /*try:*/ {
86432
86433           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":496
86434  *                 with nogil:
86435  *                     c_data_len = cstd.fread(
86436  *                         c_data, 1, __ITERPARSE_CHUNK_SIZE, c_stream)             # <<<<<<<<<<<<<<
86437  *                     if c_data_len < __ITERPARSE_CHUNK_SIZE:
86438  *                         if cstd.ferror(c_stream):
86439  */
86440           __pyx_v_c_data_len = fread(__pyx_v_c_data, 1, 32768, __pyx_v_c_stream);
86441
86442           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":497
86443  *                     c_data_len = cstd.fread(
86444  *                         c_data, 1, __ITERPARSE_CHUNK_SIZE, c_stream)
86445  *                     if c_data_len < __ITERPARSE_CHUNK_SIZE:             # <<<<<<<<<<<<<<
86446  *                         if cstd.ferror(c_stream):
86447  *                             error = 1
86448  */
86449           __pyx_t_1 = (__pyx_v_c_data_len < 32768);
86450           if (__pyx_t_1) {
86451
86452             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":498
86453  *                         c_data, 1, __ITERPARSE_CHUNK_SIZE, c_stream)
86454  *                     if c_data_len < __ITERPARSE_CHUNK_SIZE:
86455  *                         if cstd.ferror(c_stream):             # <<<<<<<<<<<<<<
86456  *                             error = 1
86457  *                         elif cstd.feof(c_stream):
86458  */
86459             __pyx_t_5 = ferror(__pyx_v_c_stream);
86460             if (__pyx_t_5) {
86461
86462               /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":499
86463  *                     if c_data_len < __ITERPARSE_CHUNK_SIZE:
86464  *                         if cstd.ferror(c_stream):
86465  *                             error = 1             # <<<<<<<<<<<<<<
86466  *                         elif cstd.feof(c_stream):
86467  *                             done = 1
86468  */
86469               __pyx_v_error = 1;
86470               goto __pyx_L18;
86471             }
86472
86473             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":500
86474  *                         if cstd.ferror(c_stream):
86475  *                             error = 1
86476  *                         elif cstd.feof(c_stream):             # <<<<<<<<<<<<<<
86477  *                             done = 1
86478  *                 if not error:
86479  */
86480             __pyx_t_5 = feof(__pyx_v_c_stream);
86481             if (__pyx_t_5) {
86482
86483               /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":501
86484  *                             error = 1
86485  *                         elif cstd.feof(c_stream):
86486  *                             done = 1             # <<<<<<<<<<<<<<
86487  *                 if not error:
86488  *                     error = self._parse_chunk(
86489  */
86490               __pyx_v_done = 1;
86491               goto __pyx_L18;
86492             }
86493             __pyx_L18:;
86494             goto __pyx_L17;
86495           }
86496           __pyx_L17:;
86497         }
86498         /*finally:*/ {
86499           Py_BLOCK_THREADS
86500         }
86501       }
86502
86503       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":502
86504  *                         elif cstd.feof(c_stream):
86505  *                             done = 1
86506  *                 if not error:             # <<<<<<<<<<<<<<
86507  *                     error = self._parse_chunk(
86508  *                         pctxt, c_data, c_data_len, done)
86509  */
86510       __pyx_t_1 = (!__pyx_v_error);
86511       if (__pyx_t_1) {
86512
86513         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":504
86514  *                 if not error:
86515  *                     error = self._parse_chunk(
86516  *                         pctxt, c_data, c_data_len, done)             # <<<<<<<<<<<<<<
86517  *             if error or done:
86518  *                 self._buffer = None
86519  */
86520         __pyx_v_error = ((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_parse_chunk(__pyx_v_pctxt, __pyx_v_c_data, __pyx_v_c_data_len, __pyx_v_done);
86521         goto __pyx_L19;
86522       }
86523       __pyx_L19:;
86524     }
86525     __pyx_L9:;
86526
86527     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":505
86528  *                     error = self._parse_chunk(
86529  *                         pctxt, c_data, c_data_len, done)
86530  *             if error or done:             # <<<<<<<<<<<<<<
86531  *                 self._buffer = None
86532  *                 break
86533  */
86534     if (!__pyx_v_error) {
86535       __pyx_t_1 = __pyx_v_done;
86536     } else {
86537       __pyx_t_1 = __pyx_v_error;
86538     }
86539     if (__pyx_t_1) {
86540
86541       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":506
86542  *                         pctxt, c_data, c_data_len, done)
86543  *             if error or done:
86544  *                 self._buffer = None             # <<<<<<<<<<<<<<
86545  *                 break
86546  * 
86547  */
86548       __Pyx_INCREF(Py_None);
86549       __Pyx_GIVEREF(Py_None);
86550       __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_buffer);
86551       __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_buffer);
86552       ((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_buffer = Py_None;
86553
86554       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":507
86555  *             if error or done:
86556  *                 self._buffer = None
86557  *                 break             # <<<<<<<<<<<<<<
86558  * 
86559  *         if not error and context._validator is not None:
86560  */
86561       goto __pyx_L8_break;
86562       goto __pyx_L20;
86563     }
86564     __pyx_L20:;
86565   }
86566   __pyx_L8_break:;
86567
86568   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":509
86569  *                 break
86570  * 
86571  *         if not error and context._validator is not None:             # <<<<<<<<<<<<<<
86572  *             error = not context._validator.isvalid()
86573  *         if error:
86574  */
86575   if ((!__pyx_v_error)) {
86576     __pyx_t_1 = (((PyObject *)__pyx_v_context->__pyx_base._validator) != Py_None);
86577     __pyx_t_6 = __pyx_t_1;
86578   } else {
86579     __pyx_t_6 = (!__pyx_v_error);
86580   }
86581   if (__pyx_t_6) {
86582
86583     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":510
86584  * 
86585  *         if not error and context._validator is not None:
86586  *             error = not context._validator.isvalid()             # <<<<<<<<<<<<<<
86587  *         if error:
86588  *             self._source = None
86589  */
86590     __pyx_v_error = (!((struct __pyx_vtabstruct_4lxml_5etree__ParserSchemaValidationContext *)__pyx_v_context->__pyx_base._validator->__pyx_vtab)->isvalid(__pyx_v_context->__pyx_base._validator));
86591     goto __pyx_L21;
86592   }
86593   __pyx_L21:;
86594
86595   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":511
86596  *         if not error and context._validator is not None:
86597  *             error = not context._validator.isvalid()
86598  *         if error:             # <<<<<<<<<<<<<<
86599  *             self._source = None
86600  *             del context._events[:]
86601  */
86602   __pyx_t_5 = __pyx_v_error;
86603   if (__pyx_t_5) {
86604
86605     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":512
86606  *             error = not context._validator.isvalid()
86607  *         if error:
86608  *             self._source = None             # <<<<<<<<<<<<<<
86609  *             del context._events[:]
86610  *             context._assureDocGetsFreed()
86611  */
86612     __Pyx_INCREF(Py_None);
86613     __Pyx_GIVEREF(Py_None);
86614     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_source);
86615     __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_source);
86616     ((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_source = Py_None;
86617
86618     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":513
86619  *         if error:
86620  *             self._source = None
86621  *             del context._events[:]             # <<<<<<<<<<<<<<
86622  *             context._assureDocGetsFreed()
86623  *             _raiseParseError(pctxt, self._filename, context._error_log)
86624  */
86625     if (PySequence_DelSlice(((PyObject *)__pyx_v_context->_events), 0, PY_SSIZE_T_MAX) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
86626
86627     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":514
86628  *             self._source = None
86629  *             del context._events[:]
86630  *             context._assureDocGetsFreed()             # <<<<<<<<<<<<<<
86631  *             _raiseParseError(pctxt, self._filename, context._error_log)
86632  *         if python.PyList_GET_SIZE(context._events) == 0:
86633  */
86634     ((struct __pyx_vtabstruct_4lxml_5etree__IterparseContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->_assureDocGetsFreed(__pyx_v_context);
86635
86636     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":515
86637  *             del context._events[:]
86638  *             context._assureDocGetsFreed()
86639  *             _raiseParseError(pctxt, self._filename, context._error_log)             # <<<<<<<<<<<<<<
86640  *         if python.PyList_GET_SIZE(context._events) == 0:
86641  *             self.root = context._root
86642  */
86643     __pyx_t_5 = __pyx_f_4lxml_5etree__raiseParseError(__pyx_v_pctxt, ((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->__pyx_base._filename, __pyx_v_context->__pyx_base._error_log); if (unlikely(__pyx_t_5 == 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
86644     goto __pyx_L22;
86645   }
86646   __pyx_L22:;
86647
86648   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":516
86649  *             context._assureDocGetsFreed()
86650  *             _raiseParseError(pctxt, self._filename, context._error_log)
86651  *         if python.PyList_GET_SIZE(context._events) == 0:             # <<<<<<<<<<<<<<
86652  *             self.root = context._root
86653  *             self._source = None
86654  */
86655   __pyx_t_6 = (PyList_GET_SIZE(((PyObject *)__pyx_v_context->_events)) == 0);
86656   if (__pyx_t_6) {
86657
86658     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":517
86659  *             _raiseParseError(pctxt, self._filename, context._error_log)
86660  *         if python.PyList_GET_SIZE(context._events) == 0:
86661  *             self.root = context._root             # <<<<<<<<<<<<<<
86662  *             self._source = None
86663  *             raise StopIteration
86664  */
86665     __Pyx_INCREF(((PyObject *)__pyx_v_context->_root));
86666     __Pyx_GIVEREF(((PyObject *)__pyx_v_context->_root));
86667     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->root);
86668     __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->root);
86669     ((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->root = ((PyObject *)__pyx_v_context->_root);
86670
86671     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":518
86672  *         if python.PyList_GET_SIZE(context._events) == 0:
86673  *             self.root = context._root
86674  *             self._source = None             # <<<<<<<<<<<<<<
86675  *             raise StopIteration
86676  * 
86677  */
86678     __Pyx_INCREF(Py_None);
86679     __Pyx_GIVEREF(Py_None);
86680     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_source);
86681     __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_source);
86682     ((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_source = Py_None;
86683
86684     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":519
86685  *             self.root = context._root
86686  *             self._source = None
86687  *             raise StopIteration             # <<<<<<<<<<<<<<
86688  * 
86689  *         context._event_index = 1
86690  */
86691     __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
86692     {__pyx_filename = __pyx_f[14]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
86693     goto __pyx_L23;
86694   }
86695   __pyx_L23:;
86696
86697   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":521
86698  *             raise StopIteration
86699  * 
86700  *         context._event_index = 1             # <<<<<<<<<<<<<<
86701  *         element = python.PyList_GET_ITEM(context._events, 0)
86702  *         python.Py_INCREF(element) # 'borrowed reference' from PyList_GET_ITEM
86703  */
86704   __pyx_v_context->_event_index = 1;
86705
86706   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":522
86707  * 
86708  *         context._event_index = 1
86709  *         element = python.PyList_GET_ITEM(context._events, 0)             # <<<<<<<<<<<<<<
86710  *         python.Py_INCREF(element) # 'borrowed reference' from PyList_GET_ITEM
86711  *         return element
86712  */
86713   __pyx_t_4 = PyList_GET_ITEM(((PyObject *)__pyx_v_context->_events), 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
86714   __Pyx_GOTREF(__pyx_t_4);
86715   __Pyx_DECREF(__pyx_v_element);
86716   __pyx_v_element = __pyx_t_4;
86717   __pyx_t_4 = 0;
86718
86719   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":523
86720  *         context._event_index = 1
86721  *         element = python.PyList_GET_ITEM(context._events, 0)
86722  *         python.Py_INCREF(element) # 'borrowed reference' from PyList_GET_ITEM             # <<<<<<<<<<<<<<
86723  *         return element
86724  * 
86725  */
86726   Py_INCREF(__pyx_v_element);
86727
86728   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":524
86729  *         element = python.PyList_GET_ITEM(context._events, 0)
86730  *         python.Py_INCREF(element) # 'borrowed reference' from PyList_GET_ITEM
86731  *         return element             # <<<<<<<<<<<<<<
86732  * 
86733  * 
86734  */
86735   __Pyx_XDECREF(__pyx_r);
86736   __Pyx_INCREF(__pyx_v_element);
86737   __pyx_r = __pyx_v_element;
86738   goto __pyx_L0;
86739
86740   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
86741   goto __pyx_L0;
86742   __pyx_L1_error:;
86743   __Pyx_XDECREF(__pyx_t_2);
86744   __Pyx_XDECREF(__pyx_t_3);
86745   __Pyx_XDECREF(__pyx_t_4);
86746   __Pyx_AddTraceback("lxml.etree.iterparse.__next__");
86747   __pyx_r = NULL;
86748   __pyx_L0:;
86749   __Pyx_DECREF((PyObject *)__pyx_v_context);
86750   __Pyx_DECREF(__pyx_v_item);
86751   __Pyx_DECREF(__pyx_v_data);
86752   __Pyx_DECREF(__pyx_v_element);
86753   __Pyx_XGIVEREF(__pyx_r);
86754   __Pyx_FinishRefcountContext();
86755   return __pyx_r;
86756 }
86757
86758 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":543
86759  *     cdef char*  _tag_name
86760  * 
86761  *     def __init__(self, element_or_tree, events=(u"end",), tag=None):             # <<<<<<<<<<<<<<
86762  *         cdef _Element root
86763  *         cdef int ns_count
86764  */
86765
86766 static int __pyx_pf_4lxml_5etree_8iterwalk___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
86767 static int __pyx_pf_4lxml_5etree_8iterwalk___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
86768   PyObject *__pyx_v_element_or_tree = 0;
86769   PyObject *__pyx_v_events = 0;
86770   PyObject *__pyx_v_tag = 0;
86771   struct LxmlElement *__pyx_v_root;
86772   int __pyx_v_ns_count;
86773   int __pyx_r;
86774   PyObject *__pyx_t_1 = NULL;
86775   int __pyx_t_2;
86776   int __pyx_t_3;
86777   PyObject *__pyx_t_4 = NULL;
86778   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_element_or_tree,&__pyx_kp_events,&__pyx_kp_tag,0};
86779   __Pyx_SetupRefcountContext("__init__");
86780   if (unlikely(__pyx_kwds)) {
86781     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
86782     PyObject* values[3] = {0,0,0};
86783     values[1] = __pyx_k_166;
86784     values[2] = Py_None;
86785     switch (PyTuple_GET_SIZE(__pyx_args)) {
86786       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
86787       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
86788       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
86789       case  0: break;
86790       default: goto __pyx_L5_argtuple_error;
86791     }
86792     switch (PyTuple_GET_SIZE(__pyx_args)) {
86793       case  0:
86794       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_element_or_tree);
86795       if (likely(values[0])) kw_args--;
86796       else goto __pyx_L5_argtuple_error;
86797       case  1:
86798       if (kw_args > 1) {
86799         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_events);
86800         if (unlikely(value)) { values[1] = value; kw_args--; }
86801       }
86802       case  2:
86803       if (kw_args > 1) {
86804         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_tag);
86805         if (unlikely(value)) { values[2] = value; kw_args--; }
86806       }
86807     }
86808     if (unlikely(kw_args > 0)) {
86809       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
86810     }
86811     __pyx_v_element_or_tree = values[0];
86812     __pyx_v_events = values[1];
86813     __pyx_v_tag = values[2];
86814   } else {
86815     __pyx_v_events = __pyx_k_166;
86816     __pyx_v_tag = Py_None;
86817     switch (PyTuple_GET_SIZE(__pyx_args)) {
86818       case  3: __pyx_v_tag = PyTuple_GET_ITEM(__pyx_args, 2);
86819       case  2: __pyx_v_events = PyTuple_GET_ITEM(__pyx_args, 1);
86820       case  1: __pyx_v_element_or_tree = PyTuple_GET_ITEM(__pyx_args, 0);
86821       break;
86822       default: goto __pyx_L5_argtuple_error;
86823     }
86824   }
86825   goto __pyx_L4_argument_unpacking_done;
86826   __pyx_L5_argtuple_error:;
86827   __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[14]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
86828   __pyx_L3_error:;
86829   __Pyx_AddTraceback("lxml.etree.iterwalk.__init__");
86830   return -1;
86831   __pyx_L4_argument_unpacking_done:;
86832   __pyx_v_root = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
86833
86834   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":546
86835  *         cdef _Element root
86836  *         cdef int ns_count
86837  *         root = _rootNodeOrRaise(element_or_tree)             # <<<<<<<<<<<<<<
86838  *         self._event_filter = _buildIterparseEventFilter(events)
86839  *         self._setTagFilter(tag)
86840  */
86841   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v_element_or_tree)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
86842   __Pyx_GOTREF(__pyx_t_1);
86843   __Pyx_DECREF(((PyObject *)__pyx_v_root));
86844   __pyx_v_root = ((struct LxmlElement *)__pyx_t_1);
86845   __pyx_t_1 = 0;
86846
86847   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":547
86848  *         cdef int ns_count
86849  *         root = _rootNodeOrRaise(element_or_tree)
86850  *         self._event_filter = _buildIterparseEventFilter(events)             # <<<<<<<<<<<<<<
86851  *         self._setTagFilter(tag)
86852  *         self._node_stack  = []
86853  */
86854   __pyx_t_2 = __pyx_f_4lxml_5etree__buildIterparseEventFilter(__pyx_v_events); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
86855   ((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_event_filter = __pyx_t_2;
86856
86857   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":548
86858  *         root = _rootNodeOrRaise(element_or_tree)
86859  *         self._event_filter = _buildIterparseEventFilter(events)
86860  *         self._setTagFilter(tag)             # <<<<<<<<<<<<<<
86861  *         self._node_stack  = []
86862  *         self._pop_node = self._node_stack.pop
86863  */
86864   ((struct __pyx_vtabstruct_4lxml_5etree_iterwalk *)((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->__pyx_vtab)->_setTagFilter(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self), __pyx_v_tag);
86865
86866   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":549
86867  *         self._event_filter = _buildIterparseEventFilter(events)
86868  *         self._setTagFilter(tag)
86869  *         self._node_stack  = []             # <<<<<<<<<<<<<<
86870  *         self._pop_node = self._node_stack.pop
86871  *         self._events = []
86872  */
86873   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
86874   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
86875   __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
86876   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_node_stack);
86877   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_node_stack));
86878   ((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_node_stack = __pyx_t_1;
86879   __pyx_t_1 = 0;
86880
86881   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":550
86882  *         self._setTagFilter(tag)
86883  *         self._node_stack  = []
86884  *         self._pop_node = self._node_stack.pop             # <<<<<<<<<<<<<<
86885  *         self._events = []
86886  *         self._pop_event = self._events.pop
86887  */
86888   __pyx_t_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_node_stack), __pyx_kp_pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
86889   __Pyx_GOTREF(__pyx_t_1);
86890   __Pyx_GIVEREF(__pyx_t_1);
86891   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_pop_node);
86892   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_pop_node);
86893   ((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_pop_node = __pyx_t_1;
86894   __pyx_t_1 = 0;
86895
86896   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":551
86897  *         self._node_stack  = []
86898  *         self._pop_node = self._node_stack.pop
86899  *         self._events = []             # <<<<<<<<<<<<<<
86900  *         self._pop_event = self._events.pop
86901  * 
86902  */
86903   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
86904   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
86905   __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
86906   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_events);
86907   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_events));
86908   ((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_events = __pyx_t_1;
86909   __pyx_t_1 = 0;
86910
86911   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":552
86912  *         self._pop_node = self._node_stack.pop
86913  *         self._events = []
86914  *         self._pop_event = self._events.pop             # <<<<<<<<<<<<<<
86915  * 
86916  *         if self._event_filter != 0:
86917  */
86918   __pyx_t_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_events), __pyx_kp_pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
86919   __Pyx_GOTREF(__pyx_t_1);
86920   __Pyx_GIVEREF(__pyx_t_1);
86921   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_pop_event);
86922   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_pop_event);
86923   ((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_pop_event = __pyx_t_1;
86924   __pyx_t_1 = 0;
86925
86926   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":554
86927  *         self._pop_event = self._events.pop
86928  * 
86929  *         if self._event_filter != 0:             # <<<<<<<<<<<<<<
86930  *             self._index = 0
86931  *             ns_count = self._start_node(root)
86932  */
86933   __pyx_t_3 = (((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_event_filter != 0);
86934   if (__pyx_t_3) {
86935
86936     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":555
86937  * 
86938  *         if self._event_filter != 0:
86939  *             self._index = 0             # <<<<<<<<<<<<<<
86940  *             ns_count = self._start_node(root)
86941  *             self._node_stack.append( (root, ns_count) )
86942  */
86943     ((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_index = 0;
86944
86945     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":556
86946  *         if self._event_filter != 0:
86947  *             self._index = 0
86948  *             ns_count = self._start_node(root)             # <<<<<<<<<<<<<<
86949  *             self._node_stack.append( (root, ns_count) )
86950  *         else:
86951  */
86952     __pyx_v_ns_count = ((struct __pyx_vtabstruct_4lxml_5etree_iterwalk *)((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->__pyx_vtab)->_start_node(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self), __pyx_v_root);
86953
86954     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":557
86955  *             self._index = 0
86956  *             ns_count = self._start_node(root)
86957  *             self._node_stack.append( (root, ns_count) )             # <<<<<<<<<<<<<<
86958  *         else:
86959  *             self._index = -1
86960  */
86961     __pyx_t_1 = PyInt_FromLong(__pyx_v_ns_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
86962     __Pyx_GOTREF(__pyx_t_1);
86963     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
86964     __Pyx_GOTREF(((PyObject *)__pyx_t_4));
86965     __Pyx_INCREF(((PyObject *)__pyx_v_root));
86966     PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_root));
86967     __Pyx_GIVEREF(((PyObject *)__pyx_v_root));
86968     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
86969     __Pyx_GIVEREF(__pyx_t_1);
86970     __pyx_t_1 = 0;
86971     __pyx_t_2 = PyList_Append(((PyObject *)((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_node_stack), ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
86972     __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
86973     goto __pyx_L6;
86974   }
86975   /*else*/ {
86976
86977     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":559
86978  *             self._node_stack.append( (root, ns_count) )
86979  *         else:
86980  *             self._index = -1             # <<<<<<<<<<<<<<
86981  * 
86982  *     cdef void _setTagFilter(self, tag):
86983  */
86984     ((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_index = -1;
86985   }
86986   __pyx_L6:;
86987
86988   __pyx_r = 0;
86989   goto __pyx_L0;
86990   __pyx_L1_error:;
86991   __Pyx_XDECREF(__pyx_t_1);
86992   __Pyx_XDECREF(__pyx_t_4);
86993   __Pyx_AddTraceback("lxml.etree.iterwalk.__init__");
86994   __pyx_r = -1;
86995   __pyx_L0:;
86996   __Pyx_DECREF((PyObject *)__pyx_v_root);
86997   __Pyx_FinishRefcountContext();
86998   return __pyx_r;
86999 }
87000
87001 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":561
87002  *             self._index = -1
87003  * 
87004  *     cdef void _setTagFilter(self, tag):             # <<<<<<<<<<<<<<
87005  *         if tag is None or tag == u'*':
87006  *             self._tag_href  = NULL
87007  */
87008
87009 static  void __pyx_f_4lxml_5etree_8iterwalk__setTagFilter(struct __pyx_obj_4lxml_5etree_iterwalk *__pyx_v_self, PyObject *__pyx_v_tag) {
87010   PyObject *__pyx_v_href;
87011   PyObject *__pyx_v_name;
87012   PyObject *__pyx_1 = 0;
87013   PyObject *__pyx_2 = 0;
87014   PyObject *__pyx_3 = 0;
87015   int __pyx_t_1;
87016   PyObject *__pyx_t_2 = NULL;
87017   int __pyx_t_3;
87018   int __pyx_t_4;
87019   __Pyx_SetupRefcountContext("_setTagFilter");
87020   __pyx_v_href = Py_None; __Pyx_INCREF(Py_None);
87021   __pyx_v_name = Py_None; __Pyx_INCREF(Py_None);
87022
87023   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":562
87024  * 
87025  *     cdef void _setTagFilter(self, tag):
87026  *         if tag is None or tag == u'*':             # <<<<<<<<<<<<<<
87027  *             self._tag_href  = NULL
87028  *             self._tag_name  = NULL
87029  */
87030   __pyx_t_1 = (__pyx_v_tag == Py_None);
87031   if (!__pyx_t_1) {
87032     __pyx_t_2 = PyObject_RichCompare(__pyx_v_tag, ((PyObject *)__pyx_kp_541), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87033     __Pyx_GOTREF(__pyx_t_2);
87034     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87035     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
87036     __pyx_t_4 = __pyx_t_3;
87037   } else {
87038     __pyx_t_4 = __pyx_t_1;
87039   }
87040   if (__pyx_t_4) {
87041
87042     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":563
87043  *     cdef void _setTagFilter(self, tag):
87044  *         if tag is None or tag == u'*':
87045  *             self._tag_href  = NULL             # <<<<<<<<<<<<<<
87046  *             self._tag_name  = NULL
87047  *         else:
87048  */
87049     __pyx_v_self->_tag_href = NULL;
87050
87051     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":564
87052  *         if tag is None or tag == u'*':
87053  *             self._tag_href  = NULL
87054  *             self._tag_name  = NULL             # <<<<<<<<<<<<<<
87055  *         else:
87056  *             self._tag_tuple = _getNsTag(tag)
87057  */
87058     __pyx_v_self->_tag_name = NULL;
87059     goto __pyx_L3;
87060   }
87061   /*else*/ {
87062
87063     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":566
87064  *             self._tag_name  = NULL
87065  *         else:
87066  *             self._tag_tuple = _getNsTag(tag)             # <<<<<<<<<<<<<<
87067  *             href, name = self._tag_tuple
87068  *             if href is None or href == u'*':
87069  */
87070     __pyx_t_2 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_tag); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87071     __Pyx_GOTREF(__pyx_t_2);
87072     if (!(likely(PyTuple_CheckExact(__pyx_t_2)) || (__pyx_t_2) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected tuple, got %s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87073     __Pyx_GIVEREF(__pyx_t_2);
87074     __Pyx_GOTREF(__pyx_v_self->_tag_tuple);
87075     __Pyx_DECREF(((PyObject *)__pyx_v_self->_tag_tuple));
87076     __pyx_v_self->_tag_tuple = ((PyObject *)__pyx_t_2);
87077     __pyx_t_2 = 0;
87078
87079     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":567
87080  *         else:
87081  *             self._tag_tuple = _getNsTag(tag)
87082  *             href, name = self._tag_tuple             # <<<<<<<<<<<<<<
87083  *             if href is None or href == u'*':
87084  *                 self._tag_href = NULL
87085  */
87086     if (likely(((PyObject *)__pyx_v_self->_tag_tuple) != Py_None) && likely(PyTuple_GET_SIZE(((PyObject *)__pyx_v_self->_tag_tuple)) == 2)) {
87087       PyObject* tuple = ((PyObject *)__pyx_v_self->_tag_tuple);
87088       __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
87089       __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
87090       __Pyx_DECREF(__pyx_v_href);
87091       __pyx_v_href = __pyx_2;
87092       __pyx_2 = 0;
87093       __Pyx_DECREF(__pyx_v_name);
87094       __pyx_v_name = __pyx_3;
87095       __pyx_3 = 0;
87096     } else {
87097       __Pyx_UnpackTupleError(((PyObject *)__pyx_v_self->_tag_tuple), 2);
87098       {__pyx_filename = __pyx_f[14]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87099     }
87100
87101     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":568
87102  *             self._tag_tuple = _getNsTag(tag)
87103  *             href, name = self._tag_tuple
87104  *             if href is None or href == u'*':             # <<<<<<<<<<<<<<
87105  *                 self._tag_href = NULL
87106  *             else:
87107  */
87108     __pyx_t_4 = (__pyx_v_href == Py_None);
87109     if (!__pyx_t_4) {
87110       __pyx_t_2 = PyObject_RichCompare(__pyx_v_href, ((PyObject *)__pyx_kp_542), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87111       __Pyx_GOTREF(__pyx_t_2);
87112       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87113       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
87114       __pyx_t_3 = __pyx_t_1;
87115     } else {
87116       __pyx_t_3 = __pyx_t_4;
87117     }
87118     if (__pyx_t_3) {
87119
87120       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":569
87121  *             href, name = self._tag_tuple
87122  *             if href is None or href == u'*':
87123  *                 self._tag_href = NULL             # <<<<<<<<<<<<<<
87124  *             else:
87125  *                 self._tag_href = _cstr(href)
87126  */
87127       __pyx_v_self->_tag_href = NULL;
87128       goto __pyx_L4;
87129     }
87130     /*else*/ {
87131
87132       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":571
87133  *                 self._tag_href = NULL
87134  *             else:
87135  *                 self._tag_href = _cstr(href)             # <<<<<<<<<<<<<<
87136  *             if name is None or name == u'*':
87137  *                 self._tag_name = NULL
87138  */
87139       __pyx_v_self->_tag_href = PyString_AS_STRING(__pyx_v_href);
87140     }
87141     __pyx_L4:;
87142
87143     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":572
87144  *             else:
87145  *                 self._tag_href = _cstr(href)
87146  *             if name is None or name == u'*':             # <<<<<<<<<<<<<<
87147  *                 self._tag_name = NULL
87148  *             else:
87149  */
87150     __pyx_t_3 = (__pyx_v_name == Py_None);
87151     if (!__pyx_t_3) {
87152       __pyx_t_2 = PyObject_RichCompare(__pyx_v_name, ((PyObject *)__pyx_kp_543), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87153       __Pyx_GOTREF(__pyx_t_2);
87154       __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87155       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
87156       __pyx_t_1 = __pyx_t_4;
87157     } else {
87158       __pyx_t_1 = __pyx_t_3;
87159     }
87160     if (__pyx_t_1) {
87161
87162       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":573
87163  *                 self._tag_href = _cstr(href)
87164  *             if name is None or name == u'*':
87165  *                 self._tag_name = NULL             # <<<<<<<<<<<<<<
87166  *             else:
87167  *                 self._tag_name = _cstr(name)
87168  */
87169       __pyx_v_self->_tag_name = NULL;
87170       goto __pyx_L5;
87171     }
87172     /*else*/ {
87173
87174       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":575
87175  *                 self._tag_name = NULL
87176  *             else:
87177  *                 self._tag_name = _cstr(name)             # <<<<<<<<<<<<<<
87178  *             if self._tag_href is NULL and self._tag_name is NULL:
87179  *                 self._tag_tuple = None
87180  */
87181       __pyx_v_self->_tag_name = PyString_AS_STRING(__pyx_v_name);
87182     }
87183     __pyx_L5:;
87184
87185     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":576
87186  *             else:
87187  *                 self._tag_name = _cstr(name)
87188  *             if self._tag_href is NULL and self._tag_name is NULL:             # <<<<<<<<<<<<<<
87189  *                 self._tag_tuple = None
87190  * 
87191  */
87192     if ((__pyx_v_self->_tag_href == NULL)) {
87193       __pyx_t_1 = (__pyx_v_self->_tag_name == NULL);
87194     } else {
87195       __pyx_t_1 = (__pyx_v_self->_tag_href == NULL);
87196     }
87197     if (__pyx_t_1) {
87198
87199       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":577
87200  *                 self._tag_name = _cstr(name)
87201  *             if self._tag_href is NULL and self._tag_name is NULL:
87202  *                 self._tag_tuple = None             # <<<<<<<<<<<<<<
87203  * 
87204  *     def __iter__(self):
87205  */
87206       __Pyx_INCREF(Py_None);
87207       __Pyx_GIVEREF(Py_None);
87208       __Pyx_GOTREF(__pyx_v_self->_tag_tuple);
87209       __Pyx_DECREF(((PyObject *)__pyx_v_self->_tag_tuple));
87210       __pyx_v_self->_tag_tuple = ((PyObject *)Py_None);
87211       goto __pyx_L6;
87212     }
87213     __pyx_L6:;
87214   }
87215   __pyx_L3:;
87216
87217   goto __pyx_L0;
87218   __pyx_L1_error:;
87219   __Pyx_XDECREF(__pyx_1);
87220   __Pyx_XDECREF(__pyx_2);
87221   __Pyx_XDECREF(__pyx_3);
87222   __Pyx_XDECREF(__pyx_t_2);
87223   __Pyx_WriteUnraisable("lxml.etree.iterwalk._setTagFilter");
87224   __pyx_L0:;
87225   __Pyx_DECREF(__pyx_v_href);
87226   __Pyx_DECREF(__pyx_v_name);
87227   __Pyx_FinishRefcountContext();
87228 }
87229
87230 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":579
87231  *                 self._tag_tuple = None
87232  * 
87233  *     def __iter__(self):             # <<<<<<<<<<<<<<
87234  *         return self
87235  * 
87236  */
87237
87238 static PyObject *__pyx_pf_4lxml_5etree_8iterwalk___iter__(PyObject *__pyx_v_self); /*proto*/
87239 static PyObject *__pyx_pf_4lxml_5etree_8iterwalk___iter__(PyObject *__pyx_v_self) {
87240   PyObject *__pyx_r = NULL;
87241   __Pyx_SetupRefcountContext("__iter__");
87242
87243   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":580
87244  * 
87245  *     def __iter__(self):
87246  *         return self             # <<<<<<<<<<<<<<
87247  * 
87248  *     def __next__(self):
87249  */
87250   __Pyx_XDECREF(__pyx_r);
87251   __Pyx_INCREF(__pyx_v_self);
87252   __pyx_r = __pyx_v_self;
87253   goto __pyx_L0;
87254
87255   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
87256   __pyx_L0:;
87257   __Pyx_XGIVEREF(__pyx_r);
87258   __Pyx_FinishRefcountContext();
87259   return __pyx_r;
87260 }
87261
87262 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":582
87263  *         return self
87264  * 
87265  *     def __next__(self):             # <<<<<<<<<<<<<<
87266  *         cdef xmlNode* c_child
87267  *         cdef _Element node
87268  */
87269
87270 static PyObject *__pyx_pf_4lxml_5etree_8iterwalk___next__(PyObject *__pyx_v_self); /*proto*/
87271 static PyObject *__pyx_pf_4lxml_5etree_8iterwalk___next__(PyObject *__pyx_v_self) {
87272   xmlNode *__pyx_v_c_child;
87273   struct LxmlElement *__pyx_v_node;
87274   struct LxmlElement *__pyx_v_next_node;
87275   int __pyx_v_ns_count;
87276   PyObject *__pyx_r = NULL;
87277   PyObject *__pyx_1 = 0;
87278   PyObject *__pyx_2 = 0;
87279   Py_ssize_t __pyx_t_1;
87280   PyObject *__pyx_t_2 = NULL;
87281   PyObject *__pyx_t_3 = NULL;
87282   int __pyx_t_4;
87283   int __pyx_t_5;
87284   __Pyx_SetupRefcountContext("__next__");
87285   __pyx_v_node = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
87286   __pyx_v_next_node = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
87287
87288   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":587
87289  *         cdef _Element next_node
87290  *         cdef int ns_count
87291  *         if python.PyList_GET_SIZE(self._events):             # <<<<<<<<<<<<<<
87292  *             return self._pop_event(0)
87293  *         ns_count = 0
87294  */
87295   __pyx_t_1 = PyList_GET_SIZE(((PyObject *)((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_events));
87296   if (__pyx_t_1) {
87297
87298     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":588
87299  *         cdef int ns_count
87300  *         if python.PyList_GET_SIZE(self._events):
87301  *             return self._pop_event(0)             # <<<<<<<<<<<<<<
87302  *         ns_count = 0
87303  *         # find next node
87304  */
87305     __Pyx_XDECREF(__pyx_r);
87306     __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87307     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
87308     __Pyx_INCREF(__pyx_int_0);
87309     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
87310     __Pyx_GIVEREF(__pyx_int_0);
87311     __pyx_t_3 = PyObject_Call(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_pop_event, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87312     __Pyx_GOTREF(__pyx_t_3);
87313     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
87314     __pyx_r = __pyx_t_3;
87315     __pyx_t_3 = 0;
87316     goto __pyx_L0;
87317     goto __pyx_L5;
87318   }
87319   __pyx_L5:;
87320
87321   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":589
87322  *         if python.PyList_GET_SIZE(self._events):
87323  *             return self._pop_event(0)
87324  *         ns_count = 0             # <<<<<<<<<<<<<<
87325  *         # find next node
87326  *         while self._index >= 0:
87327  */
87328   __pyx_v_ns_count = 0;
87329
87330   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":591
87331  *         ns_count = 0
87332  *         # find next node
87333  *         while self._index >= 0:             # <<<<<<<<<<<<<<
87334  *             node = self._node_stack[self._index][0]
87335  * 
87336  */
87337   while (1) {
87338     __pyx_t_4 = (((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_index >= 0);
87339     if (!__pyx_t_4) break;
87340
87341     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":592
87342  *         # find next node
87343  *         while self._index >= 0:
87344  *             node = self._node_stack[self._index][0]             # <<<<<<<<<<<<<<
87345  * 
87346  *             c_child = _findChildForwards(node._c_node, 0)
87347  */
87348     __pyx_1 = __Pyx_GetItemInt_List(((PyObject *)((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_node_stack), ((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_index, sizeof(int), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87349     __Pyx_GOTREF(__pyx_1);
87350     __pyx_2 = __Pyx_GetItemInt(__pyx_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_2) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87351     __Pyx_GOTREF(__pyx_2);
87352     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
87353     if (!(__Pyx_TypeTest(__pyx_2, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87354     __Pyx_DECREF(((PyObject *)__pyx_v_node));
87355     __pyx_v_node = ((struct LxmlElement *)__pyx_2);
87356     __pyx_2 = 0;
87357
87358     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":594
87359  *             node = self._node_stack[self._index][0]
87360  * 
87361  *             c_child = _findChildForwards(node._c_node, 0)             # <<<<<<<<<<<<<<
87362  *             if c_child is not NULL:
87363  *                 # try children
87364  */
87365     __pyx_v_c_child = __pyx_f_4lxml_5etree__findChildForwards(__pyx_v_node->_c_node, 0);
87366
87367     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":595
87368  * 
87369  *             c_child = _findChildForwards(node._c_node, 0)
87370  *             if c_child is not NULL:             # <<<<<<<<<<<<<<
87371  *                 # try children
87372  *                 next_node = _elementFactory(node._doc, c_child)
87373  */
87374     __pyx_t_4 = (__pyx_v_c_child != NULL);
87375     if (__pyx_t_4) {
87376
87377       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":597
87378  *             if c_child is not NULL:
87379  *                 # try children
87380  *                 next_node = _elementFactory(node._doc, c_child)             # <<<<<<<<<<<<<<
87381  *             else:
87382  *                 # back off
87383  */
87384       __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_node->_doc, __pyx_v_c_child)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87385       __Pyx_GOTREF(__pyx_t_3);
87386       __Pyx_DECREF(((PyObject *)__pyx_v_next_node));
87387       __pyx_v_next_node = ((struct LxmlElement *)__pyx_t_3);
87388       __pyx_t_3 = 0;
87389       goto __pyx_L8;
87390     }
87391     /*else*/ {
87392
87393       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":600
87394  *             else:
87395  *                 # back off
87396  *                 next_node = None             # <<<<<<<<<<<<<<
87397  *                 while next_node is None:
87398  *                     # back off through parents
87399  */
87400       __Pyx_INCREF(Py_None);
87401       __Pyx_DECREF(((PyObject *)__pyx_v_next_node));
87402       __pyx_v_next_node = ((struct LxmlElement *)Py_None);
87403
87404       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":601
87405  *                 # back off
87406  *                 next_node = None
87407  *                 while next_node is None:             # <<<<<<<<<<<<<<
87408  *                     # back off through parents
87409  *                     self._index = self._index - 1
87410  */
87411       while (1) {
87412         __pyx_t_4 = (((PyObject *)__pyx_v_next_node) == Py_None);
87413         if (!__pyx_t_4) break;
87414
87415         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":603
87416  *                 while next_node is None:
87417  *                     # back off through parents
87418  *                     self._index = self._index - 1             # <<<<<<<<<<<<<<
87419  *                     node = self._end_node()
87420  *                     if self._index < 0:
87421  */
87422         ((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_index = (((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_index - 1);
87423
87424         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":604
87425  *                     # back off through parents
87426  *                     self._index = self._index - 1
87427  *                     node = self._end_node()             # <<<<<<<<<<<<<<
87428  *                     if self._index < 0:
87429  *                         break
87430  */
87431         __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree_iterwalk *)((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->__pyx_vtab)->_end_node(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87432         __Pyx_GOTREF(__pyx_t_3);
87433         __Pyx_DECREF(((PyObject *)__pyx_v_node));
87434         __pyx_v_node = ((struct LxmlElement *)__pyx_t_3);
87435         __pyx_t_3 = 0;
87436
87437         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":605
87438  *                     self._index = self._index - 1
87439  *                     node = self._end_node()
87440  *                     if self._index < 0:             # <<<<<<<<<<<<<<
87441  *                         break
87442  *                     next_node = node.getnext()
87443  */
87444         __pyx_t_4 = (((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_index < 0);
87445         if (__pyx_t_4) {
87446
87447           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":606
87448  *                     node = self._end_node()
87449  *                     if self._index < 0:
87450  *                         break             # <<<<<<<<<<<<<<
87451  *                     next_node = node.getnext()
87452  *             if next_node is not None:
87453  */
87454           goto __pyx_L10_break;
87455           goto __pyx_L11;
87456         }
87457         __pyx_L11:;
87458
87459         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":607
87460  *                     if self._index < 0:
87461  *                         break
87462  *                     next_node = node.getnext()             # <<<<<<<<<<<<<<
87463  *             if next_node is not None:
87464  *                 if self._event_filter & (ITERPARSE_FILTER_START | \
87465  */
87466         __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_node), __pyx_kp_getnext); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87467         __Pyx_GOTREF(__pyx_t_3);
87468         __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87469         __Pyx_GOTREF(__pyx_t_2);
87470         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
87471         if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87472         __Pyx_DECREF(((PyObject *)__pyx_v_next_node));
87473         __pyx_v_next_node = ((struct LxmlElement *)__pyx_t_2);
87474         __pyx_t_2 = 0;
87475       }
87476       __pyx_L10_break:;
87477     }
87478     __pyx_L8:;
87479
87480     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":608
87481  *                         break
87482  *                     next_node = node.getnext()
87483  *             if next_node is not None:             # <<<<<<<<<<<<<<
87484  *                 if self._event_filter & (ITERPARSE_FILTER_START | \
87485  *                                          ITERPARSE_FILTER_START_NS):
87486  */
87487     __pyx_t_4 = (((PyObject *)__pyx_v_next_node) != Py_None);
87488     if (__pyx_t_4) {
87489
87490       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":610
87491  *             if next_node is not None:
87492  *                 if self._event_filter & (ITERPARSE_FILTER_START | \
87493  *                                          ITERPARSE_FILTER_START_NS):             # <<<<<<<<<<<<<<
87494  *                     ns_count = self._start_node(next_node)
87495  *                 elif self._event_filter & ITERPARSE_FILTER_END_NS:
87496  */
87497       __pyx_t_5 = (((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_event_filter & (__pyx_e_4lxml_5etree_ITERPARSE_FILTER_START | __pyx_e_4lxml_5etree_ITERPARSE_FILTER_START_NS));
87498       if (__pyx_t_5) {
87499
87500         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":611
87501  *                 if self._event_filter & (ITERPARSE_FILTER_START | \
87502  *                                          ITERPARSE_FILTER_START_NS):
87503  *                     ns_count = self._start_node(next_node)             # <<<<<<<<<<<<<<
87504  *                 elif self._event_filter & ITERPARSE_FILTER_END_NS:
87505  *                     ns_count = _countNsDefs(next_node._c_node)
87506  */
87507         __pyx_v_ns_count = ((struct __pyx_vtabstruct_4lxml_5etree_iterwalk *)((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->__pyx_vtab)->_start_node(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self), __pyx_v_next_node);
87508         goto __pyx_L13;
87509       }
87510
87511       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":612
87512  *                                          ITERPARSE_FILTER_START_NS):
87513  *                     ns_count = self._start_node(next_node)
87514  *                 elif self._event_filter & ITERPARSE_FILTER_END_NS:             # <<<<<<<<<<<<<<
87515  *                     ns_count = _countNsDefs(next_node._c_node)
87516  *                 self._node_stack.append( (next_node, ns_count) )
87517  */
87518       __pyx_t_5 = (((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_event_filter & __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END_NS);
87519       if (__pyx_t_5) {
87520
87521         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":613
87522  *                     ns_count = self._start_node(next_node)
87523  *                 elif self._event_filter & ITERPARSE_FILTER_END_NS:
87524  *                     ns_count = _countNsDefs(next_node._c_node)             # <<<<<<<<<<<<<<
87525  *                 self._node_stack.append( (next_node, ns_count) )
87526  *                 self._index = self._index + 1
87527  */
87528         __pyx_v_ns_count = __pyx_f_4lxml_5etree__countNsDefs(__pyx_v_next_node->_c_node);
87529         goto __pyx_L13;
87530       }
87531       __pyx_L13:;
87532
87533       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":614
87534  *                 elif self._event_filter & ITERPARSE_FILTER_END_NS:
87535  *                     ns_count = _countNsDefs(next_node._c_node)
87536  *                 self._node_stack.append( (next_node, ns_count) )             # <<<<<<<<<<<<<<
87537  *                 self._index = self._index + 1
87538  *             if python.PyList_GET_SIZE(self._events):
87539  */
87540       __pyx_t_2 = PyInt_FromLong(__pyx_v_ns_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87541       __Pyx_GOTREF(__pyx_t_2);
87542       __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87543       __Pyx_GOTREF(((PyObject *)__pyx_t_3));
87544       __Pyx_INCREF(((PyObject *)__pyx_v_next_node));
87545       PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_next_node));
87546       __Pyx_GIVEREF(((PyObject *)__pyx_v_next_node));
87547       PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
87548       __Pyx_GIVEREF(__pyx_t_2);
87549       __pyx_t_2 = 0;
87550       __pyx_t_5 = PyList_Append(((PyObject *)((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_node_stack), ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87551       __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
87552
87553       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":615
87554  *                     ns_count = _countNsDefs(next_node._c_node)
87555  *                 self._node_stack.append( (next_node, ns_count) )
87556  *                 self._index = self._index + 1             # <<<<<<<<<<<<<<
87557  *             if python.PyList_GET_SIZE(self._events):
87558  *                 return self._pop_event(0)
87559  */
87560       ((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_index = (((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_index + 1);
87561       goto __pyx_L12;
87562     }
87563     __pyx_L12:;
87564
87565     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":616
87566  *                 self._node_stack.append( (next_node, ns_count) )
87567  *                 self._index = self._index + 1
87568  *             if python.PyList_GET_SIZE(self._events):             # <<<<<<<<<<<<<<
87569  *                 return self._pop_event(0)
87570  *         raise StopIteration
87571  */
87572     __pyx_t_1 = PyList_GET_SIZE(((PyObject *)((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_events));
87573     if (__pyx_t_1) {
87574
87575       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":617
87576  *                 self._index = self._index + 1
87577  *             if python.PyList_GET_SIZE(self._events):
87578  *                 return self._pop_event(0)             # <<<<<<<<<<<<<<
87579  *         raise StopIteration
87580  * 
87581  */
87582       __Pyx_XDECREF(__pyx_r);
87583       __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87584       __Pyx_GOTREF(((PyObject *)__pyx_t_3));
87585       __Pyx_INCREF(__pyx_int_0);
87586       PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_0);
87587       __Pyx_GIVEREF(__pyx_int_0);
87588       __pyx_t_2 = PyObject_Call(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_pop_event, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87589       __Pyx_GOTREF(__pyx_t_2);
87590       __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
87591       __pyx_r = __pyx_t_2;
87592       __pyx_t_2 = 0;
87593       goto __pyx_L0;
87594       goto __pyx_L14;
87595     }
87596     __pyx_L14:;
87597   }
87598
87599   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":618
87600  *             if python.PyList_GET_SIZE(self._events):
87601  *                 return self._pop_event(0)
87602  *         raise StopIteration             # <<<<<<<<<<<<<<
87603  * 
87604  *     cdef int _start_node(self, _Element node):
87605  */
87606   __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
87607   {__pyx_filename = __pyx_f[14]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87608
87609   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
87610   goto __pyx_L0;
87611   __pyx_L1_error:;
87612   __Pyx_XDECREF(__pyx_1);
87613   __Pyx_XDECREF(__pyx_2);
87614   __Pyx_XDECREF(__pyx_t_2);
87615   __Pyx_XDECREF(__pyx_t_3);
87616   __Pyx_AddTraceback("lxml.etree.iterwalk.__next__");
87617   __pyx_r = NULL;
87618   __pyx_L0:;
87619   __Pyx_DECREF((PyObject *)__pyx_v_node);
87620   __Pyx_DECREF((PyObject *)__pyx_v_next_node);
87621   __Pyx_XGIVEREF(__pyx_r);
87622   __Pyx_FinishRefcountContext();
87623   return __pyx_r;
87624 }
87625
87626 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":620
87627  *         raise StopIteration
87628  * 
87629  *     cdef int _start_node(self, _Element node):             # <<<<<<<<<<<<<<
87630  *         cdef int ns_count
87631  *         if self._event_filter & ITERPARSE_FILTER_START_NS:
87632  */
87633
87634 static  int __pyx_f_4lxml_5etree_8iterwalk__start_node(struct __pyx_obj_4lxml_5etree_iterwalk *__pyx_v_self, struct LxmlElement *__pyx_v_node) {
87635   int __pyx_v_ns_count;
87636   int __pyx_r;
87637   int __pyx_t_1;
87638   int __pyx_t_2;
87639   int __pyx_t_3;
87640   PyObject *__pyx_t_4 = NULL;
87641   __Pyx_SetupRefcountContext("_start_node");
87642
87643   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":622
87644  *     cdef int _start_node(self, _Element node):
87645  *         cdef int ns_count
87646  *         if self._event_filter & ITERPARSE_FILTER_START_NS:             # <<<<<<<<<<<<<<
87647  *             ns_count = _appendStartNsEvents(node._c_node, self._events)
87648  *         elif self._event_filter & ITERPARSE_FILTER_END_NS:
87649  */
87650   __pyx_t_1 = (__pyx_v_self->_event_filter & __pyx_e_4lxml_5etree_ITERPARSE_FILTER_START_NS);
87651   if (__pyx_t_1) {
87652
87653     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":623
87654  *         cdef int ns_count
87655  *         if self._event_filter & ITERPARSE_FILTER_START_NS:
87656  *             ns_count = _appendStartNsEvents(node._c_node, self._events)             # <<<<<<<<<<<<<<
87657  *         elif self._event_filter & ITERPARSE_FILTER_END_NS:
87658  *             ns_count = _countNsDefs(node._c_node)
87659  */
87660     __pyx_v_ns_count = __pyx_f_4lxml_5etree__appendStartNsEvents(__pyx_v_node->_c_node, __pyx_v_self->_events);
87661     goto __pyx_L3;
87662   }
87663
87664   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":624
87665  *         if self._event_filter & ITERPARSE_FILTER_START_NS:
87666  *             ns_count = _appendStartNsEvents(node._c_node, self._events)
87667  *         elif self._event_filter & ITERPARSE_FILTER_END_NS:             # <<<<<<<<<<<<<<
87668  *             ns_count = _countNsDefs(node._c_node)
87669  *         else:
87670  */
87671   __pyx_t_1 = (__pyx_v_self->_event_filter & __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END_NS);
87672   if (__pyx_t_1) {
87673
87674     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":625
87675  *             ns_count = _appendStartNsEvents(node._c_node, self._events)
87676  *         elif self._event_filter & ITERPARSE_FILTER_END_NS:
87677  *             ns_count = _countNsDefs(node._c_node)             # <<<<<<<<<<<<<<
87678  *         else:
87679  *             ns_count = 0
87680  */
87681     __pyx_v_ns_count = __pyx_f_4lxml_5etree__countNsDefs(__pyx_v_node->_c_node);
87682     goto __pyx_L3;
87683   }
87684   /*else*/ {
87685
87686     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":627
87687  *             ns_count = _countNsDefs(node._c_node)
87688  *         else:
87689  *             ns_count = 0             # <<<<<<<<<<<<<<
87690  *         if self._event_filter & ITERPARSE_FILTER_START:
87691  *             if self._tag_tuple is None or \
87692  */
87693     __pyx_v_ns_count = 0;
87694   }
87695   __pyx_L3:;
87696
87697   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":628
87698  *         else:
87699  *             ns_count = 0
87700  *         if self._event_filter & ITERPARSE_FILTER_START:             # <<<<<<<<<<<<<<
87701  *             if self._tag_tuple is None or \
87702  *                    _tagMatches(node._c_node, self._tag_href, self._tag_name):
87703  */
87704   __pyx_t_1 = (__pyx_v_self->_event_filter & __pyx_e_4lxml_5etree_ITERPARSE_FILTER_START);
87705   if (__pyx_t_1) {
87706
87707     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":629
87708  *             ns_count = 0
87709  *         if self._event_filter & ITERPARSE_FILTER_START:
87710  *             if self._tag_tuple is None or \             # <<<<<<<<<<<<<<
87711  *                    _tagMatches(node._c_node, self._tag_href, self._tag_name):
87712  *                 self._events.append( (u"start", node) )
87713  */
87714     __pyx_t_2 = (__pyx_v_self->_tag_tuple == ((PyObject *)Py_None));
87715     if (!__pyx_t_2) {
87716
87717       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":630
87718  *         if self._event_filter & ITERPARSE_FILTER_START:
87719  *             if self._tag_tuple is None or \
87720  *                    _tagMatches(node._c_node, self._tag_href, self._tag_name):             # <<<<<<<<<<<<<<
87721  *                 self._events.append( (u"start", node) )
87722  *         return ns_count
87723  */
87724       __pyx_t_3 = __pyx_f_4lxml_5etree__tagMatches(__pyx_v_node->_c_node, __pyx_v_self->_tag_href, __pyx_v_self->_tag_name);
87725     } else {
87726       __pyx_t_3 = __pyx_t_2;
87727     }
87728     if (__pyx_t_3) {
87729
87730       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":631
87731  *             if self._tag_tuple is None or \
87732  *                    _tagMatches(node._c_node, self._tag_href, self._tag_name):
87733  *                 self._events.append( (u"start", node) )             # <<<<<<<<<<<<<<
87734  *         return ns_count
87735  * 
87736  */
87737       __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87738       __Pyx_GOTREF(((PyObject *)__pyx_t_4));
87739       __Pyx_INCREF(((PyObject *)__pyx_kp_544));
87740       PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_544));
87741       __Pyx_GIVEREF(((PyObject *)__pyx_kp_544));
87742       __Pyx_INCREF(((PyObject *)__pyx_v_node));
87743       PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_node));
87744       __Pyx_GIVEREF(((PyObject *)__pyx_v_node));
87745       __pyx_t_1 = PyList_Append(((PyObject *)__pyx_v_self->_events), ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 631; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87746       __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
87747       goto __pyx_L5;
87748     }
87749     __pyx_L5:;
87750     goto __pyx_L4;
87751   }
87752   __pyx_L4:;
87753
87754   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":632
87755  *                    _tagMatches(node._c_node, self._tag_href, self._tag_name):
87756  *                 self._events.append( (u"start", node) )
87757  *         return ns_count             # <<<<<<<<<<<<<<
87758  * 
87759  *     cdef _Element _end_node(self):
87760  */
87761   __pyx_r = __pyx_v_ns_count;
87762   goto __pyx_L0;
87763
87764   __pyx_r = 0;
87765   goto __pyx_L0;
87766   __pyx_L1_error:;
87767   __Pyx_XDECREF(__pyx_t_4);
87768   __Pyx_WriteUnraisable("lxml.etree.iterwalk._start_node");
87769   __pyx_r = 0;
87770   __pyx_L0:;
87771   __Pyx_FinishRefcountContext();
87772   return __pyx_r;
87773 }
87774
87775 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":634
87776  *         return ns_count
87777  * 
87778  *     cdef _Element _end_node(self):             # <<<<<<<<<<<<<<
87779  *         cdef _Element node
87780  *         cdef int i, ns_count
87781  */
87782
87783 static  struct LxmlElement *__pyx_f_4lxml_5etree_8iterwalk__end_node(struct __pyx_obj_4lxml_5etree_iterwalk *__pyx_v_self) {
87784   struct LxmlElement *__pyx_v_node;
87785   int __pyx_v_i;
87786   int __pyx_v_ns_count;
87787   PyObject *__pyx_v_event;
87788   struct LxmlElement *__pyx_r = NULL;
87789   PyObject *__pyx_1 = 0;
87790   PyObject *__pyx_2 = 0;
87791   PyObject *__pyx_3 = 0;
87792   PyObject *__pyx_t_1 = NULL;
87793   int __pyx_t_2;
87794   int __pyx_t_3;
87795   int __pyx_t_4;
87796   int __pyx_t_5;
87797   __Pyx_SetupRefcountContext("_end_node");
87798   __pyx_v_node = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
87799   __pyx_v_event = Py_None; __Pyx_INCREF(Py_None);
87800
87801   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":637
87802  *         cdef _Element node
87803  *         cdef int i, ns_count
87804  *         node, ns_count = self._pop_node()             # <<<<<<<<<<<<<<
87805  *         if self._event_filter & ITERPARSE_FILTER_END:
87806  *             if self._tag_tuple is None or \
87807  */
87808   __pyx_t_1 = PyObject_Call(__pyx_v_self->_pop_node, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87809   __Pyx_GOTREF(__pyx_t_1);
87810   if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 2)) {
87811     PyObject* tuple = __pyx_t_1;
87812     __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
87813     if (!(__Pyx_TypeTest(__pyx_2, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87814     __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
87815     __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_3); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87816     __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
87817     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
87818     __Pyx_DECREF(((PyObject *)__pyx_v_node));
87819     __pyx_v_node = ((struct LxmlElement *)__pyx_2);
87820     __pyx_2 = 0;
87821     __pyx_v_ns_count = __pyx_t_2;
87822   } else {
87823     __pyx_1 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87824     __Pyx_GOTREF(__pyx_1);
87825     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
87826     __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87827     __Pyx_GOTREF(__pyx_2);
87828     if (!(__Pyx_TypeTest(__pyx_2, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87829     __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87830     __Pyx_GOTREF(__pyx_3);
87831     __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_3); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87832     __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
87833     if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87834     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
87835     __Pyx_DECREF(((PyObject *)__pyx_v_node));
87836     __pyx_v_node = ((struct LxmlElement *)__pyx_2);
87837     __pyx_2 = 0;
87838     __pyx_v_ns_count = __pyx_t_2;
87839   }
87840
87841   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":638
87842  *         cdef int i, ns_count
87843  *         node, ns_count = self._pop_node()
87844  *         if self._event_filter & ITERPARSE_FILTER_END:             # <<<<<<<<<<<<<<
87845  *             if self._tag_tuple is None or \
87846  *                    _tagMatches(node._c_node, self._tag_href, self._tag_name):
87847  */
87848   __pyx_t_2 = (__pyx_v_self->_event_filter & __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END);
87849   if (__pyx_t_2) {
87850
87851     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":639
87852  *         node, ns_count = self._pop_node()
87853  *         if self._event_filter & ITERPARSE_FILTER_END:
87854  *             if self._tag_tuple is None or \             # <<<<<<<<<<<<<<
87855  *                    _tagMatches(node._c_node, self._tag_href, self._tag_name):
87856  *                 self._events.append( (u"end", node) )
87857  */
87858     __pyx_t_3 = (__pyx_v_self->_tag_tuple == ((PyObject *)Py_None));
87859     if (!__pyx_t_3) {
87860
87861       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":640
87862  *         if self._event_filter & ITERPARSE_FILTER_END:
87863  *             if self._tag_tuple is None or \
87864  *                    _tagMatches(node._c_node, self._tag_href, self._tag_name):             # <<<<<<<<<<<<<<
87865  *                 self._events.append( (u"end", node) )
87866  *         if self._event_filter & ITERPARSE_FILTER_END_NS:
87867  */
87868       __pyx_t_4 = __pyx_f_4lxml_5etree__tagMatches(__pyx_v_node->_c_node, __pyx_v_self->_tag_href, __pyx_v_self->_tag_name);
87869     } else {
87870       __pyx_t_4 = __pyx_t_3;
87871     }
87872     if (__pyx_t_4) {
87873
87874       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":641
87875  *             if self._tag_tuple is None or \
87876  *                    _tagMatches(node._c_node, self._tag_href, self._tag_name):
87877  *                 self._events.append( (u"end", node) )             # <<<<<<<<<<<<<<
87878  *         if self._event_filter & ITERPARSE_FILTER_END_NS:
87879  *             event = (u"end-ns", None)
87880  */
87881       __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87882       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
87883       __Pyx_INCREF(((PyObject *)__pyx_kp_545));
87884       PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_545));
87885       __Pyx_GIVEREF(((PyObject *)__pyx_kp_545));
87886       __Pyx_INCREF(((PyObject *)__pyx_v_node));
87887       PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_node));
87888       __Pyx_GIVEREF(((PyObject *)__pyx_v_node));
87889       __pyx_t_2 = PyList_Append(((PyObject *)__pyx_v_self->_events), ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87890       __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
87891       goto __pyx_L4;
87892     }
87893     __pyx_L4:;
87894     goto __pyx_L3;
87895   }
87896   __pyx_L3:;
87897
87898   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":642
87899  *                    _tagMatches(node._c_node, self._tag_href, self._tag_name):
87900  *                 self._events.append( (u"end", node) )
87901  *         if self._event_filter & ITERPARSE_FILTER_END_NS:             # <<<<<<<<<<<<<<
87902  *             event = (u"end-ns", None)
87903  *             for i from 0 <= i < ns_count:
87904  */
87905   __pyx_t_2 = (__pyx_v_self->_event_filter & __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END_NS);
87906   if (__pyx_t_2) {
87907
87908     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":643
87909  *                 self._events.append( (u"end", node) )
87910  *         if self._event_filter & ITERPARSE_FILTER_END_NS:
87911  *             event = (u"end-ns", None)             # <<<<<<<<<<<<<<
87912  *             for i from 0 <= i < ns_count:
87913  *                 self._events.append(event)
87914  */
87915     __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87916     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
87917     __Pyx_INCREF(((PyObject *)__pyx_kp_546));
87918     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_546));
87919     __Pyx_GIVEREF(((PyObject *)__pyx_kp_546));
87920     __Pyx_INCREF(Py_None);
87921     PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
87922     __Pyx_GIVEREF(Py_None);
87923     __Pyx_DECREF(__pyx_v_event);
87924     __pyx_v_event = ((PyObject *)__pyx_t_1);
87925     __pyx_t_1 = 0;
87926
87927     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":644
87928  *         if self._event_filter & ITERPARSE_FILTER_END_NS:
87929  *             event = (u"end-ns", None)
87930  *             for i from 0 <= i < ns_count:             # <<<<<<<<<<<<<<
87931  *                 self._events.append(event)
87932  *         return node
87933  */
87934     __pyx_t_2 = __pyx_v_ns_count;
87935     for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
87936
87937       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":645
87938  *             event = (u"end-ns", None)
87939  *             for i from 0 <= i < ns_count:
87940  *                 self._events.append(event)             # <<<<<<<<<<<<<<
87941  *         return node
87942  */
87943       __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_self->_events), __pyx_v_event); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
87944     }
87945     goto __pyx_L5;
87946   }
87947   __pyx_L5:;
87948
87949   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":646
87950  *             for i from 0 <= i < ns_count:
87951  *                 self._events.append(event)
87952  *         return node             # <<<<<<<<<<<<<<
87953  */
87954   __Pyx_XDECREF(((PyObject *)__pyx_r));
87955   __Pyx_INCREF(((PyObject *)__pyx_v_node));
87956   __pyx_r = __pyx_v_node;
87957   goto __pyx_L0;
87958
87959   __pyx_r = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
87960   goto __pyx_L0;
87961   __pyx_L1_error:;
87962   __Pyx_XDECREF(__pyx_1);
87963   __Pyx_XDECREF(__pyx_2);
87964   __Pyx_XDECREF(__pyx_3);
87965   __Pyx_XDECREF(__pyx_t_1);
87966   __Pyx_AddTraceback("lxml.etree.iterwalk._end_node");
87967   __pyx_r = 0;
87968   __pyx_L0:;
87969   __Pyx_DECREF((PyObject *)__pyx_v_node);
87970   __Pyx_DECREF(__pyx_v_event);
87971   __Pyx_XGIVEREF((PyObject *)__pyx_r);
87972   __Pyx_FinishRefcountContext();
87973   return __pyx_r;
87974 }
87975
87976 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":3
87977  * cdef object _find_id_attributes
87978  * 
87979  * def XMLID(text):             # <<<<<<<<<<<<<<
87980  *     u"""XMLID(text)
87981  * 
87982  */
87983
87984 static PyObject *__pyx_pf_4lxml_5etree_XMLID(PyObject *__pyx_self, PyObject *__pyx_v_text); /*proto*/
87985 static char __pyx_doc_4lxml_5etree_XMLID[] = "XMLID(text)\n\n    Parse the text and return a tuple (root node, ID dictionary).  The root\n    node is the same as returned by the XML() function.  The dictionary\n    contains string-element pairs.  The dictionary keys are the values of 'id'\n    attributes.  The elements referenced by the ID are stored as dictionary\n    values.\n    ";
87986 static PyObject *__pyx_pf_4lxml_5etree_XMLID(PyObject *__pyx_self, PyObject *__pyx_v_text) {
87987   PyObject *__pyx_v_dic;
87988   PyObject *__pyx_v_root;
87989   PyObject *__pyx_v_elem;
87990   PyObject *__pyx_r = NULL;
87991   PyObject *__pyx_1 = 0;
87992   int __pyx_t_1;
87993   PyObject *__pyx_t_2 = NULL;
87994   PyObject *__pyx_t_3 = NULL;
87995   Py_ssize_t __pyx_t_4;
87996   PyObject *__pyx_t_5 = NULL;
87997   PyObject *__pyx_t_6 = NULL;
87998   __Pyx_SetupRefcountContext("XMLID");
87999   __pyx_self = __pyx_self;
88000   __pyx_v_dic = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
88001   __pyx_v_root = Py_None; __Pyx_INCREF(Py_None);
88002   __pyx_v_elem = Py_None; __Pyx_INCREF(Py_None);
88003
88004   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":14
88005  *     cdef dict dic
88006  *     global _find_id_attributes
88007  *     if _find_id_attributes is None:             # <<<<<<<<<<<<<<
88008  *         _find_id_attributes = XPath(u'//[inserted by cython to avoid comment start]*[string(@id)]')
88009  * 
88010  */
88011   __pyx_t_1 = (__pyx_v_4lxml_5etree__find_id_attributes == Py_None);
88012   if (__pyx_t_1) {
88013
88014     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":15
88015  *     global _find_id_attributes
88016  *     if _find_id_attributes is None:
88017  *         _find_id_attributes = XPath(u'//[inserted by cython to avoid comment start]*[string(@id)]')             # <<<<<<<<<<<<<<
88018  * 
88019  *     # ElementTree compatible implementation: parse and look for 'id' attributes
88020  */
88021     __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88022     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
88023     __Pyx_INCREF(((PyObject *)__pyx_kp_547));
88024     PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_547));
88025     __Pyx_GIVEREF(((PyObject *)__pyx_kp_547));
88026     __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_XPath)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88027     __Pyx_GOTREF(__pyx_t_3);
88028     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
88029     __Pyx_GOTREF(__pyx_v_4lxml_5etree__find_id_attributes);
88030     __Pyx_DECREF(__pyx_v_4lxml_5etree__find_id_attributes);
88031     __Pyx_GIVEREF(__pyx_t_3);
88032     __pyx_v_4lxml_5etree__find_id_attributes = __pyx_t_3;
88033     __pyx_t_3 = 0;
88034     goto __pyx_L5;
88035   }
88036   __pyx_L5:;
88037
88038   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":18
88039  * 
88040  *     # ElementTree compatible implementation: parse and look for 'id' attributes
88041  *     root = XML(text)             # <<<<<<<<<<<<<<
88042  *     dic = {}
88043  *     for elem in _find_id_attributes(root):
88044  */
88045   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XML); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88046   __Pyx_GOTREF(__pyx_1);
88047   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88048   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
88049   __Pyx_INCREF(__pyx_v_text);
88050   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_text);
88051   __Pyx_GIVEREF(__pyx_v_text);
88052   __pyx_t_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88053   __Pyx_GOTREF(__pyx_t_2);
88054   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
88055   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
88056   __Pyx_DECREF(__pyx_v_root);
88057   __pyx_v_root = __pyx_t_2;
88058   __pyx_t_2 = 0;
88059
88060   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":19
88061  *     # ElementTree compatible implementation: parse and look for 'id' attributes
88062  *     root = XML(text)
88063  *     dic = {}             # <<<<<<<<<<<<<<
88064  *     for elem in _find_id_attributes(root):
88065  *         dic[elem.get(u'id')] = elem
88066  */
88067   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88068   __Pyx_GOTREF(((PyObject *)__pyx_1));
88069   __Pyx_DECREF(((PyObject *)__pyx_v_dic));
88070   __pyx_v_dic = __pyx_1;
88071   __pyx_1 = 0;
88072
88073   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":20
88074  *     root = XML(text)
88075  *     dic = {}
88076  *     for elem in _find_id_attributes(root):             # <<<<<<<<<<<<<<
88077  *         dic[elem.get(u'id')] = elem
88078  *     return (root, dic)
88079  */
88080   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88081   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
88082   __Pyx_INCREF(__pyx_v_root);
88083   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_root);
88084   __Pyx_GIVEREF(__pyx_v_root);
88085   __pyx_t_3 = PyObject_Call(__pyx_v_4lxml_5etree__find_id_attributes, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88086   __Pyx_GOTREF(__pyx_t_3);
88087   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
88088   if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
88089     __pyx_t_4 = 0; __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2);
88090   } else {
88091     __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88092     __Pyx_GOTREF(__pyx_t_2);
88093   }
88094   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
88095   for (;;) {
88096     if (likely(PyList_CheckExact(__pyx_t_2))) {
88097       if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
88098       __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++;
88099     } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
88100       if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
88101       __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++;
88102     } else {
88103       __pyx_t_3 = PyIter_Next(__pyx_t_2);
88104       if (!__pyx_t_3) {
88105         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88106         break;
88107       }
88108       __Pyx_GOTREF(__pyx_t_3);
88109     }
88110     __Pyx_DECREF(__pyx_v_elem);
88111     __pyx_v_elem = __pyx_t_3;
88112     __pyx_t_3 = 0;
88113
88114     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":21
88115  *     dic = {}
88116  *     for elem in _find_id_attributes(root):
88117  *         dic[elem.get(u'id')] = elem             # <<<<<<<<<<<<<<
88118  *     return (root, dic)
88119  * 
88120  */
88121     __pyx_t_3 = PyObject_GetAttr(__pyx_v_elem, __pyx_kp_get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88122     __Pyx_GOTREF(__pyx_t_3);
88123     __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88124     __Pyx_GOTREF(((PyObject *)__pyx_t_5));
88125     __Pyx_INCREF(((PyObject *)__pyx_kp_548));
88126     PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_548));
88127     __Pyx_GIVEREF(((PyObject *)__pyx_kp_548));
88128     __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88129     __Pyx_GOTREF(__pyx_t_6);
88130     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
88131     __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
88132     if (PyDict_SetItem(((PyObject *)__pyx_v_dic), __pyx_t_6, __pyx_v_elem) < 0) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88133     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
88134   }
88135   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
88136
88137   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":22
88138  *     for elem in _find_id_attributes(root):
88139  *         dic[elem.get(u'id')] = elem
88140  *     return (root, dic)             # <<<<<<<<<<<<<<
88141  * 
88142  * def XMLDTDID(text):
88143  */
88144   __Pyx_XDECREF(__pyx_r);
88145   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88146   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
88147   __Pyx_INCREF(__pyx_v_root);
88148   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_root);
88149   __Pyx_GIVEREF(__pyx_v_root);
88150   __Pyx_INCREF(((PyObject *)__pyx_v_dic));
88151   PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_dic));
88152   __Pyx_GIVEREF(((PyObject *)__pyx_v_dic));
88153   __pyx_r = ((PyObject *)__pyx_t_2);
88154   __pyx_t_2 = 0;
88155   goto __pyx_L0;
88156
88157   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
88158   goto __pyx_L0;
88159   __pyx_L1_error:;
88160   __Pyx_XDECREF(__pyx_1);
88161   __Pyx_XDECREF(__pyx_t_2);
88162   __Pyx_XDECREF(__pyx_t_3);
88163   __Pyx_XDECREF(__pyx_t_5);
88164   __Pyx_XDECREF(__pyx_t_6);
88165   __Pyx_AddTraceback("lxml.etree.XMLID");
88166   __pyx_r = NULL;
88167   __pyx_L0:;
88168   __Pyx_DECREF(__pyx_v_dic);
88169   __Pyx_DECREF(__pyx_v_root);
88170   __Pyx_DECREF(__pyx_v_elem);
88171   __Pyx_XGIVEREF(__pyx_r);
88172   __Pyx_FinishRefcountContext();
88173   return __pyx_r;
88174 }
88175
88176 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":24
88177  *     return (root, dic)
88178  * 
88179  * def XMLDTDID(text):             # <<<<<<<<<<<<<<
88180  *     u"""XMLDTDID(text)
88181  * 
88182  */
88183
88184 static PyObject *__pyx_pf_4lxml_5etree_XMLDTDID(PyObject *__pyx_self, PyObject *__pyx_v_text); /*proto*/
88185 static char __pyx_doc_4lxml_5etree_XMLDTDID[] = "XMLDTDID(text)\n\n    Parse the text and return a tuple (root node, ID dictionary).  The root\n    node is the same as returned by the XML() function.  The dictionary\n    contains string-element pairs.  The dictionary keys are the values of ID\n    attributes as defined by the DTD.  The elements referenced by the ID are\n    stored as dictionary values.\n\n    Note that you must not modify the XML tree if you use the ID dictionary.\n    The results are undefined.\n    ";
88186 static PyObject *__pyx_pf_4lxml_5etree_XMLDTDID(PyObject *__pyx_self, PyObject *__pyx_v_text) {
88187   struct LxmlElement *__pyx_v_root;
88188   PyObject *__pyx_r = NULL;
88189   PyObject *__pyx_1 = 0;
88190   PyObject *__pyx_t_1 = NULL;
88191   PyObject *__pyx_t_2 = NULL;
88192   int __pyx_t_3;
88193   __Pyx_SetupRefcountContext("XMLDTDID");
88194   __pyx_self = __pyx_self;
88195   __pyx_v_root = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
88196
88197   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":37
88198  *     """
88199  *     cdef _Element root
88200  *     root = XML(text)             # <<<<<<<<<<<<<<
88201  *     # xml:id spec compatible implementation: use DTD ID attributes from libxml2
88202  *     if root._doc._c_doc.ids is NULL:
88203  */
88204   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XML); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88205   __Pyx_GOTREF(__pyx_1);
88206   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88207   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
88208   __Pyx_INCREF(__pyx_v_text);
88209   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_text);
88210   __Pyx_GIVEREF(__pyx_v_text);
88211   __pyx_t_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88212   __Pyx_GOTREF(__pyx_t_2);
88213   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
88214   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
88215   if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88216   __Pyx_DECREF(((PyObject *)__pyx_v_root));
88217   __pyx_v_root = ((struct LxmlElement *)__pyx_t_2);
88218   __pyx_t_2 = 0;
88219
88220   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":39
88221  *     root = XML(text)
88222  *     # xml:id spec compatible implementation: use DTD ID attributes from libxml2
88223  *     if root._doc._c_doc.ids is NULL:             # <<<<<<<<<<<<<<
88224  *         return (root, {})
88225  *     else:
88226  */
88227   __pyx_t_3 = (__pyx_v_root->_doc->_c_doc->ids == NULL);
88228   if (__pyx_t_3) {
88229
88230     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":40
88231  *     # xml:id spec compatible implementation: use DTD ID attributes from libxml2
88232  *     if root._doc._c_doc.ids is NULL:
88233  *         return (root, {})             # <<<<<<<<<<<<<<
88234  *     else:
88235  *         return (root, _IDDict(root))
88236  */
88237     __Pyx_XDECREF(__pyx_r);
88238     __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88239     __Pyx_GOTREF(((PyObject *)__pyx_1));
88240     __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88241     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
88242     __Pyx_INCREF(((PyObject *)__pyx_v_root));
88243     PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_root));
88244     __Pyx_GIVEREF(((PyObject *)__pyx_v_root));
88245     PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_1));
88246     __Pyx_GIVEREF(((PyObject *)__pyx_1));
88247     __pyx_1 = 0;
88248     __pyx_r = ((PyObject *)__pyx_t_2);
88249     __pyx_t_2 = 0;
88250     goto __pyx_L0;
88251     goto __pyx_L5;
88252   }
88253   /*else*/ {
88254
88255     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":42
88256  *         return (root, {})
88257  *     else:
88258  *         return (root, _IDDict(root))             # <<<<<<<<<<<<<<
88259  * 
88260  * def parseid(source, parser=None, *, base_url=None):
88261  */
88262     __Pyx_XDECREF(__pyx_r);
88263     __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88264     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
88265     __Pyx_INCREF(((PyObject *)__pyx_v_root));
88266     PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_root));
88267     __Pyx_GIVEREF(((PyObject *)__pyx_v_root));
88268     __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__IDDict)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88269     __Pyx_GOTREF(__pyx_t_1);
88270     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
88271     __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88272     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
88273     __Pyx_INCREF(((PyObject *)__pyx_v_root));
88274     PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_root));
88275     __Pyx_GIVEREF(((PyObject *)__pyx_v_root));
88276     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
88277     __Pyx_GIVEREF(__pyx_t_1);
88278     __pyx_t_1 = 0;
88279     __pyx_r = ((PyObject *)__pyx_t_2);
88280     __pyx_t_2 = 0;
88281     goto __pyx_L0;
88282   }
88283   __pyx_L5:;
88284
88285   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
88286   goto __pyx_L0;
88287   __pyx_L1_error:;
88288   __Pyx_XDECREF(__pyx_1);
88289   __Pyx_XDECREF(__pyx_t_1);
88290   __Pyx_XDECREF(__pyx_t_2);
88291   __Pyx_AddTraceback("lxml.etree.XMLDTDID");
88292   __pyx_r = NULL;
88293   __pyx_L0:;
88294   __Pyx_DECREF((PyObject *)__pyx_v_root);
88295   __Pyx_XGIVEREF(__pyx_r);
88296   __Pyx_FinishRefcountContext();
88297   return __pyx_r;
88298 }
88299
88300 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":44
88301  *         return (root, _IDDict(root))
88302  * 
88303  * def parseid(source, parser=None, *, base_url=None):             # <<<<<<<<<<<<<<
88304  *     u"""parseid(source, parser=None)
88305  * 
88306  */
88307
88308 static PyObject *__pyx_pf_4lxml_5etree_parseid(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
88309 static char __pyx_doc_4lxml_5etree_parseid[] = "parseid(source, parser=None)\n\n    Parses the source into a tuple containing an ElementTree object and an\n    ID dictionary.  If no parser is provided as second argument, the default\n    parser is used.\n\n    Note that you must not modify the XML tree if you use the ID dictionary.\n    The results are undefined.\n    ";
88310 static PyObject *__pyx_pf_4lxml_5etree_parseid(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
88311   PyObject *__pyx_v_source = 0;
88312   PyObject *__pyx_v_parser = 0;
88313   PyObject *__pyx_v_base_url = 0;
88314   struct LxmlDocument *__pyx_v_doc;
88315   PyObject *__pyx_r = NULL;
88316   PyObject *__pyx_t_1 = NULL;
88317   PyObject *__pyx_t_2 = NULL;
88318   PyObject *__pyx_t_3 = NULL;
88319   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_source,&__pyx_kp_parser,&__pyx_kp_base_url,0};
88320   __Pyx_SetupRefcountContext("parseid");
88321   __pyx_self = __pyx_self;
88322   if (unlikely(__pyx_kwds)) {
88323     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
88324     PyObject* values[3] = {0,0,0};
88325     values[1] = Py_None;
88326     values[2] = Py_None;
88327     switch (PyTuple_GET_SIZE(__pyx_args)) {
88328       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
88329       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
88330       case  0: break;
88331       default: goto __pyx_L5_argtuple_error;
88332     }
88333     switch (PyTuple_GET_SIZE(__pyx_args)) {
88334       case  0:
88335       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_source);
88336       if (likely(values[0])) kw_args--;
88337       else goto __pyx_L5_argtuple_error;
88338       case  1:
88339       if (kw_args > 0) {
88340         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_parser);
88341         if (unlikely(value)) { values[1] = value; kw_args--; }
88342       }
88343     }
88344     while (kw_args > 0) {
88345       PyObject* value;
88346       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_base_url);
88347       if (value) { values[2] = value; if (!(--kw_args)) break; }
88348       break;
88349     }
88350     if (unlikely(kw_args > 0)) {
88351       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "parseid") < 0)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
88352     }
88353     __pyx_v_source = values[0];
88354     __pyx_v_parser = values[1];
88355     __pyx_v_base_url = values[2];
88356   } else {
88357     __pyx_v_parser = Py_None;
88358     __pyx_v_base_url = Py_None;
88359     switch (PyTuple_GET_SIZE(__pyx_args)) {
88360       case  2: __pyx_v_parser = PyTuple_GET_ITEM(__pyx_args, 1);
88361       case  1: __pyx_v_source = PyTuple_GET_ITEM(__pyx_args, 0);
88362       break;
88363       default: goto __pyx_L5_argtuple_error;
88364     }
88365   }
88366   goto __pyx_L4_argument_unpacking_done;
88367   __pyx_L5_argtuple_error:;
88368   __Pyx_RaiseArgtupleInvalid("parseid", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[15]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
88369   __pyx_L3_error:;
88370   __Pyx_AddTraceback("lxml.etree.parseid");
88371   return NULL;
88372   __pyx_L4_argument_unpacking_done:;
88373   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
88374
88375   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":55
88376  *     """
88377  *     cdef _Document doc
88378  *     doc = _parseDocument(source, parser, base_url)             # <<<<<<<<<<<<<<
88379  *     return (_elementTreeFactory(doc, None), _IDDict(doc))
88380  * 
88381  */
88382   if (!(__Pyx_TypeTest(__pyx_v_parser, __pyx_ptype_4lxml_5etree__BaseParser))) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88383   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__parseDocument(__pyx_v_source, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser), __pyx_v_base_url)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88384   __Pyx_GOTREF(__pyx_t_1);
88385   __Pyx_DECREF(((PyObject *)__pyx_v_doc));
88386   __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_1);
88387   __pyx_t_1 = 0;
88388
88389   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":56
88390  *     cdef _Document doc
88391  *     doc = _parseDocument(source, parser, base_url)
88392  *     return (_elementTreeFactory(doc, None), _IDDict(doc))             # <<<<<<<<<<<<<<
88393  * 
88394  * cdef class _IDDict:
88395  */
88396   __Pyx_XDECREF(__pyx_r);
88397   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(__pyx_v_doc, ((struct LxmlElement *)Py_None))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88398   __Pyx_GOTREF(__pyx_t_1);
88399   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88400   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
88401   __Pyx_INCREF(((PyObject *)__pyx_v_doc));
88402   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_doc));
88403   __Pyx_GIVEREF(((PyObject *)__pyx_v_doc));
88404   __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__IDDict)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88405   __Pyx_GOTREF(__pyx_t_3);
88406   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
88407   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88408   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
88409   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
88410   __Pyx_GIVEREF(__pyx_t_1);
88411   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
88412   __Pyx_GIVEREF(__pyx_t_3);
88413   __pyx_t_1 = 0;
88414   __pyx_t_3 = 0;
88415   __pyx_r = ((PyObject *)__pyx_t_2);
88416   __pyx_t_2 = 0;
88417   goto __pyx_L0;
88418
88419   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
88420   goto __pyx_L0;
88421   __pyx_L1_error:;
88422   __Pyx_XDECREF(__pyx_t_1);
88423   __Pyx_XDECREF(__pyx_t_2);
88424   __Pyx_XDECREF(__pyx_t_3);
88425   __Pyx_AddTraceback("lxml.etree.parseid");
88426   __pyx_r = NULL;
88427   __pyx_L0:;
88428   __Pyx_DECREF((PyObject *)__pyx_v_doc);
88429   __Pyx_XGIVEREF(__pyx_r);
88430   __Pyx_FinishRefcountContext();
88431   return __pyx_r;
88432 }
88433
88434 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":69
88435  *     cdef object _keys
88436  *     cdef object _items
88437  *     def __init__(self, etree):             # <<<<<<<<<<<<<<
88438  *         cdef _Document doc
88439  *         doc = _documentOrRaise(etree)
88440  */
88441
88442 static int __pyx_pf_4lxml_5etree_7_IDDict___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
88443 static int __pyx_pf_4lxml_5etree_7_IDDict___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
88444   PyObject *__pyx_v_etree = 0;
88445   struct LxmlDocument *__pyx_v_doc;
88446   int __pyx_r;
88447   PyObject *__pyx_t_1 = NULL;
88448   int __pyx_t_2;
88449   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_etree,0};
88450   __Pyx_SetupRefcountContext("__init__");
88451   if (unlikely(__pyx_kwds)) {
88452     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
88453     PyObject* values[1] = {0};
88454     switch (PyTuple_GET_SIZE(__pyx_args)) {
88455       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
88456       case  0: break;
88457       default: goto __pyx_L5_argtuple_error;
88458     }
88459     switch (PyTuple_GET_SIZE(__pyx_args)) {
88460       case  0:
88461       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_etree);
88462       if (likely(values[0])) kw_args--;
88463       else goto __pyx_L5_argtuple_error;
88464     }
88465     if (unlikely(kw_args > 0)) {
88466       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
88467     }
88468     __pyx_v_etree = values[0];
88469   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
88470     goto __pyx_L5_argtuple_error;
88471   } else {
88472     __pyx_v_etree = PyTuple_GET_ITEM(__pyx_args, 0);
88473   }
88474   goto __pyx_L4_argument_unpacking_done;
88475   __pyx_L5_argtuple_error:;
88476   __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[15]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
88477   __pyx_L3_error:;
88478   __Pyx_AddTraceback("lxml.etree._IDDict.__init__");
88479   return -1;
88480   __pyx_L4_argument_unpacking_done:;
88481   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
88482
88483   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":71
88484  *     def __init__(self, etree):
88485  *         cdef _Document doc
88486  *         doc = _documentOrRaise(etree)             # <<<<<<<<<<<<<<
88487  *         if doc._c_doc.ids is NULL:
88488  *             raise ValueError, u"No ID dictionary available."
88489  */
88490   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88491   __Pyx_GOTREF(__pyx_t_1);
88492   __Pyx_DECREF(((PyObject *)__pyx_v_doc));
88493   __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_1);
88494   __pyx_t_1 = 0;
88495
88496   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":72
88497  *         cdef _Document doc
88498  *         doc = _documentOrRaise(etree)
88499  *         if doc._c_doc.ids is NULL:             # <<<<<<<<<<<<<<
88500  *             raise ValueError, u"No ID dictionary available."
88501  *         self._doc = doc
88502  */
88503   __pyx_t_2 = (__pyx_v_doc->_c_doc->ids == NULL);
88504   if (__pyx_t_2) {
88505
88506     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":73
88507  *         doc = _documentOrRaise(etree)
88508  *         if doc._c_doc.ids is NULL:
88509  *             raise ValueError, u"No ID dictionary available."             # <<<<<<<<<<<<<<
88510  *         self._doc = doc
88511  *         self._keys  = None
88512  */
88513     __Pyx_Raise(__pyx_builtin_ValueError, ((PyObject *)__pyx_kp_549), 0);
88514     {__pyx_filename = __pyx_f[15]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88515     goto __pyx_L6;
88516   }
88517   __pyx_L6:;
88518
88519   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":74
88520  *         if doc._c_doc.ids is NULL:
88521  *             raise ValueError, u"No ID dictionary available."
88522  *         self._doc = doc             # <<<<<<<<<<<<<<
88523  *         self._keys  = None
88524  *         self._items = None
88525  */
88526   __Pyx_INCREF(((PyObject *)__pyx_v_doc));
88527   __Pyx_GIVEREF(((PyObject *)__pyx_v_doc));
88528   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_doc);
88529   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_doc));
88530   ((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_doc = __pyx_v_doc;
88531
88532   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":75
88533  *             raise ValueError, u"No ID dictionary available."
88534  *         self._doc = doc
88535  *         self._keys  = None             # <<<<<<<<<<<<<<
88536  *         self._items = None
88537  * 
88538  */
88539   __Pyx_INCREF(Py_None);
88540   __Pyx_GIVEREF(Py_None);
88541   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys);
88542   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys);
88543   ((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys = Py_None;
88544
88545   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":76
88546  *         self._doc = doc
88547  *         self._keys  = None
88548  *         self._items = None             # <<<<<<<<<<<<<<
88549  * 
88550  *     def copy(self):
88551  */
88552   __Pyx_INCREF(Py_None);
88553   __Pyx_GIVEREF(Py_None);
88554   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items);
88555   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items);
88556   ((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items = Py_None;
88557
88558   __pyx_r = 0;
88559   goto __pyx_L0;
88560   __pyx_L1_error:;
88561   __Pyx_XDECREF(__pyx_t_1);
88562   __Pyx_AddTraceback("lxml.etree._IDDict.__init__");
88563   __pyx_r = -1;
88564   __pyx_L0:;
88565   __Pyx_DECREF((PyObject *)__pyx_v_doc);
88566   __Pyx_FinishRefcountContext();
88567   return __pyx_r;
88568 }
88569
88570 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":78
88571  *         self._items = None
88572  * 
88573  *     def copy(self):             # <<<<<<<<<<<<<<
88574  *         return _IDDict(self._doc)
88575  * 
88576  */
88577
88578 static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_copy(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
88579 static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_copy(PyObject *__pyx_v_self, PyObject *unused) {
88580   PyObject *__pyx_r = NULL;
88581   PyObject *__pyx_t_1 = NULL;
88582   PyObject *__pyx_t_2 = NULL;
88583   __Pyx_SetupRefcountContext("copy");
88584
88585   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":79
88586  * 
88587  *     def copy(self):
88588  *         return _IDDict(self._doc)             # <<<<<<<<<<<<<<
88589  * 
88590  *     def __getitem__(self, id_name):
88591  */
88592   __Pyx_XDECREF(__pyx_r);
88593   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88594   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
88595   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_doc));
88596   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_doc));
88597   __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_doc));
88598   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__IDDict)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88599   __Pyx_GOTREF(__pyx_t_2);
88600   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
88601   __pyx_r = __pyx_t_2;
88602   __pyx_t_2 = 0;
88603   goto __pyx_L0;
88604
88605   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
88606   goto __pyx_L0;
88607   __pyx_L1_error:;
88608   __Pyx_XDECREF(__pyx_t_1);
88609   __Pyx_XDECREF(__pyx_t_2);
88610   __Pyx_AddTraceback("lxml.etree._IDDict.copy");
88611   __pyx_r = NULL;
88612   __pyx_L0:;
88613   __Pyx_XGIVEREF(__pyx_r);
88614   __Pyx_FinishRefcountContext();
88615   return __pyx_r;
88616 }
88617
88618 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":81
88619  *         return _IDDict(self._doc)
88620  * 
88621  *     def __getitem__(self, id_name):             # <<<<<<<<<<<<<<
88622  *         cdef tree.xmlHashTable* c_ids
88623  *         cdef tree.xmlID* c_id
88624  */
88625
88626 static PyObject *__pyx_pf_4lxml_5etree_7_IDDict___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_id_name); /*proto*/
88627 static PyObject *__pyx_pf_4lxml_5etree_7_IDDict___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_id_name) {
88628   xmlHashTable *__pyx_v_c_ids;
88629   xmlID *__pyx_v_c_id;
88630   xmlAttr *__pyx_v_c_attr;
88631   PyObject *__pyx_v_id_utf;
88632   PyObject *__pyx_r = NULL;
88633   PyObject *__pyx_t_1 = NULL;
88634   int __pyx_t_2;
88635   __Pyx_SetupRefcountContext("__getitem__");
88636   __pyx_v_id_utf = Py_None; __Pyx_INCREF(Py_None);
88637
88638   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":85
88639  *         cdef tree.xmlID* c_id
88640  *         cdef xmlAttr* c_attr
88641  *         c_ids = self._doc._c_doc.ids             # <<<<<<<<<<<<<<
88642  *         id_utf = _utf8(id_name)
88643  *         c_id = <tree.xmlID*>tree.xmlHashLookup(c_ids, _cstr(id_utf))
88644  */
88645   __pyx_v_c_ids = ((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_doc->_c_doc->ids;
88646
88647   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":86
88648  *         cdef xmlAttr* c_attr
88649  *         c_ids = self._doc._c_doc.ids
88650  *         id_utf = _utf8(id_name)             # <<<<<<<<<<<<<<
88651  *         c_id = <tree.xmlID*>tree.xmlHashLookup(c_ids, _cstr(id_utf))
88652  *         if c_id is NULL:
88653  */
88654   __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_id_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88655   __Pyx_GOTREF(__pyx_t_1);
88656   __Pyx_DECREF(__pyx_v_id_utf);
88657   __pyx_v_id_utf = __pyx_t_1;
88658   __pyx_t_1 = 0;
88659
88660   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":87
88661  *         c_ids = self._doc._c_doc.ids
88662  *         id_utf = _utf8(id_name)
88663  *         c_id = <tree.xmlID*>tree.xmlHashLookup(c_ids, _cstr(id_utf))             # <<<<<<<<<<<<<<
88664  *         if c_id is NULL:
88665  *             raise KeyError, u"key not found."
88666  */
88667   __pyx_v_c_id = ((xmlID *)xmlHashLookup(__pyx_v_c_ids, PyString_AS_STRING(__pyx_v_id_utf)));
88668
88669   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":88
88670  *         id_utf = _utf8(id_name)
88671  *         c_id = <tree.xmlID*>tree.xmlHashLookup(c_ids, _cstr(id_utf))
88672  *         if c_id is NULL:             # <<<<<<<<<<<<<<
88673  *             raise KeyError, u"key not found."
88674  *         c_attr = c_id.attr
88675  */
88676   __pyx_t_2 = (__pyx_v_c_id == NULL);
88677   if (__pyx_t_2) {
88678
88679     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":89
88680  *         c_id = <tree.xmlID*>tree.xmlHashLookup(c_ids, _cstr(id_utf))
88681  *         if c_id is NULL:
88682  *             raise KeyError, u"key not found."             # <<<<<<<<<<<<<<
88683  *         c_attr = c_id.attr
88684  *         if c_attr is NULL or c_attr.parent is NULL:
88685  */
88686     __Pyx_Raise(__pyx_builtin_KeyError, ((PyObject *)__pyx_kp_550), 0);
88687     {__pyx_filename = __pyx_f[15]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88688     goto __pyx_L5;
88689   }
88690   __pyx_L5:;
88691
88692   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":90
88693  *         if c_id is NULL:
88694  *             raise KeyError, u"key not found."
88695  *         c_attr = c_id.attr             # <<<<<<<<<<<<<<
88696  *         if c_attr is NULL or c_attr.parent is NULL:
88697  *             raise KeyError, u"ID attribute not found."
88698  */
88699   __pyx_v_c_attr = __pyx_v_c_id->attr;
88700
88701   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":91
88702  *             raise KeyError, u"key not found."
88703  *         c_attr = c_id.attr
88704  *         if c_attr is NULL or c_attr.parent is NULL:             # <<<<<<<<<<<<<<
88705  *             raise KeyError, u"ID attribute not found."
88706  *         return _elementFactory(self._doc, c_attr.parent)
88707  */
88708   if (!(__pyx_v_c_attr == NULL)) {
88709     __pyx_t_2 = (__pyx_v_c_attr->parent == NULL);
88710   } else {
88711     __pyx_t_2 = (__pyx_v_c_attr == NULL);
88712   }
88713   if (__pyx_t_2) {
88714
88715     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":92
88716  *         c_attr = c_id.attr
88717  *         if c_attr is NULL or c_attr.parent is NULL:
88718  *             raise KeyError, u"ID attribute not found."             # <<<<<<<<<<<<<<
88719  *         return _elementFactory(self._doc, c_attr.parent)
88720  * 
88721  */
88722     __Pyx_Raise(__pyx_builtin_KeyError, ((PyObject *)__pyx_kp_551), 0);
88723     {__pyx_filename = __pyx_f[15]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88724     goto __pyx_L6;
88725   }
88726   __pyx_L6:;
88727
88728   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":93
88729  *         if c_attr is NULL or c_attr.parent is NULL:
88730  *             raise KeyError, u"ID attribute not found."
88731  *         return _elementFactory(self._doc, c_attr.parent)             # <<<<<<<<<<<<<<
88732  * 
88733  *     def get(self, id_name):
88734  */
88735   __Pyx_XDECREF(__pyx_r);
88736   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_doc, __pyx_v_c_attr->parent)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88737   __Pyx_GOTREF(__pyx_t_1);
88738   __pyx_r = __pyx_t_1;
88739   __pyx_t_1 = 0;
88740   goto __pyx_L0;
88741
88742   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
88743   goto __pyx_L0;
88744   __pyx_L1_error:;
88745   __Pyx_XDECREF(__pyx_t_1);
88746   __Pyx_AddTraceback("lxml.etree._IDDict.__getitem__");
88747   __pyx_r = NULL;
88748   __pyx_L0:;
88749   __Pyx_DECREF(__pyx_v_id_utf);
88750   __Pyx_XGIVEREF(__pyx_r);
88751   __Pyx_FinishRefcountContext();
88752   return __pyx_r;
88753 }
88754
88755 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":95
88756  *         return _elementFactory(self._doc, c_attr.parent)
88757  * 
88758  *     def get(self, id_name):             # <<<<<<<<<<<<<<
88759  *         return self[id_name]
88760  * 
88761  */
88762
88763 static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_get(PyObject *__pyx_v_self, PyObject *__pyx_v_id_name); /*proto*/
88764 static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_get(PyObject *__pyx_v_self, PyObject *__pyx_v_id_name) {
88765   PyObject *__pyx_r = NULL;
88766   PyObject *__pyx_1 = 0;
88767   __Pyx_SetupRefcountContext("get");
88768
88769   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":96
88770  * 
88771  *     def get(self, id_name):
88772  *         return self[id_name]             # <<<<<<<<<<<<<<
88773  * 
88774  *     def __contains__(self, id_name):
88775  */
88776   __Pyx_XDECREF(__pyx_r);
88777   __pyx_1 = PyObject_GetItem(__pyx_v_self, __pyx_v_id_name); if (!__pyx_1) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88778   __Pyx_GOTREF(__pyx_1);
88779   __pyx_r = __pyx_1;
88780   __pyx_1 = 0;
88781   goto __pyx_L0;
88782
88783   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
88784   goto __pyx_L0;
88785   __pyx_L1_error:;
88786   __Pyx_XDECREF(__pyx_1);
88787   __Pyx_AddTraceback("lxml.etree._IDDict.get");
88788   __pyx_r = NULL;
88789   __pyx_L0:;
88790   __Pyx_XGIVEREF(__pyx_r);
88791   __Pyx_FinishRefcountContext();
88792   return __pyx_r;
88793 }
88794
88795 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":98
88796  *         return self[id_name]
88797  * 
88798  *     def __contains__(self, id_name):             # <<<<<<<<<<<<<<
88799  *         cdef tree.xmlID* c_id
88800  *         id_utf = _utf8(id_name)
88801  */
88802
88803 static int __pyx_pf_4lxml_5etree_7_IDDict___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_id_name); /*proto*/
88804 static int __pyx_pf_4lxml_5etree_7_IDDict___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_id_name) {
88805   xmlID *__pyx_v_c_id;
88806   PyObject *__pyx_v_id_utf;
88807   int __pyx_r;
88808   PyObject *__pyx_t_1 = NULL;
88809   __Pyx_SetupRefcountContext("__contains__");
88810   __pyx_v_id_utf = Py_None; __Pyx_INCREF(Py_None);
88811
88812   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":100
88813  *     def __contains__(self, id_name):
88814  *         cdef tree.xmlID* c_id
88815  *         id_utf = _utf8(id_name)             # <<<<<<<<<<<<<<
88816  *         c_id = <tree.xmlID*>tree.xmlHashLookup(
88817  *             self._doc._c_doc.ids, _cstr(id_utf))
88818  */
88819   __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_id_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88820   __Pyx_GOTREF(__pyx_t_1);
88821   __Pyx_DECREF(__pyx_v_id_utf);
88822   __pyx_v_id_utf = __pyx_t_1;
88823   __pyx_t_1 = 0;
88824
88825   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":102
88826  *         id_utf = _utf8(id_name)
88827  *         c_id = <tree.xmlID*>tree.xmlHashLookup(
88828  *             self._doc._c_doc.ids, _cstr(id_utf))             # <<<<<<<<<<<<<<
88829  *         return c_id is not NULL
88830  * 
88831  */
88832   __pyx_v_c_id = ((xmlID *)xmlHashLookup(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_doc->_c_doc->ids, PyString_AS_STRING(__pyx_v_id_utf)));
88833
88834   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":103
88835  *         c_id = <tree.xmlID*>tree.xmlHashLookup(
88836  *             self._doc._c_doc.ids, _cstr(id_utf))
88837  *         return c_id is not NULL             # <<<<<<<<<<<<<<
88838  * 
88839  *     def has_key(self, id_name):
88840  */
88841   __pyx_r = (__pyx_v_c_id != NULL);
88842   goto __pyx_L0;
88843
88844   __pyx_r = 0;
88845   goto __pyx_L0;
88846   __pyx_L1_error:;
88847   __Pyx_XDECREF(__pyx_t_1);
88848   __Pyx_AddTraceback("lxml.etree._IDDict.__contains__");
88849   __pyx_r = -1;
88850   __pyx_L0:;
88851   __Pyx_DECREF(__pyx_v_id_utf);
88852   __Pyx_FinishRefcountContext();
88853   return __pyx_r;
88854 }
88855
88856 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":105
88857  *         return c_id is not NULL
88858  * 
88859  *     def has_key(self, id_name):             # <<<<<<<<<<<<<<
88860  *         return id_name in self
88861  * 
88862  */
88863
88864 static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_has_key(PyObject *__pyx_v_self, PyObject *__pyx_v_id_name); /*proto*/
88865 static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_has_key(PyObject *__pyx_v_self, PyObject *__pyx_v_id_name) {
88866   PyObject *__pyx_r = NULL;
88867   int __pyx_t_1;
88868   PyObject *__pyx_t_2 = NULL;
88869   __Pyx_SetupRefcountContext("has_key");
88870
88871   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":106
88872  * 
88873  *     def has_key(self, id_name):
88874  *         return id_name in self             # <<<<<<<<<<<<<<
88875  * 
88876  *     def __repr__(self):
88877  */
88878   __Pyx_XDECREF(__pyx_r);
88879   __pyx_t_1 = (PySequence_Contains(__pyx_v_self, __pyx_v_id_name)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88880   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88881   __Pyx_GOTREF(__pyx_t_2);
88882   __pyx_r = __pyx_t_2;
88883   __pyx_t_2 = 0;
88884   goto __pyx_L0;
88885
88886   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
88887   goto __pyx_L0;
88888   __pyx_L1_error:;
88889   __Pyx_XDECREF(__pyx_t_2);
88890   __Pyx_AddTraceback("lxml.etree._IDDict.has_key");
88891   __pyx_r = NULL;
88892   __pyx_L0:;
88893   __Pyx_XGIVEREF(__pyx_r);
88894   __Pyx_FinishRefcountContext();
88895   return __pyx_r;
88896 }
88897
88898 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":108
88899  *         return id_name in self
88900  * 
88901  *     def __repr__(self):             # <<<<<<<<<<<<<<
88902  *         return repr(dict(self))
88903  * 
88904  */
88905
88906 static PyObject *__pyx_pf_4lxml_5etree_7_IDDict___repr__(PyObject *__pyx_v_self); /*proto*/
88907 static PyObject *__pyx_pf_4lxml_5etree_7_IDDict___repr__(PyObject *__pyx_v_self) {
88908   PyObject *__pyx_r = NULL;
88909   PyObject *__pyx_t_1 = NULL;
88910   PyObject *__pyx_t_2 = NULL;
88911   __Pyx_SetupRefcountContext("__repr__");
88912
88913   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":109
88914  * 
88915  *     def __repr__(self):
88916  *         return repr(dict(self))             # <<<<<<<<<<<<<<
88917  * 
88918  *     def keys(self):
88919  */
88920   __Pyx_XDECREF(__pyx_r);
88921   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88922   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
88923   __Pyx_INCREF(__pyx_v_self);
88924   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
88925   __Pyx_GIVEREF(__pyx_v_self);
88926   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyDict_Type)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88927   __Pyx_GOTREF(__pyx_t_2);
88928   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
88929   __pyx_t_1 = PyObject_Repr(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88930   __Pyx_GOTREF(__pyx_t_1);
88931   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
88932   __pyx_r = __pyx_t_1;
88933   __pyx_t_1 = 0;
88934   goto __pyx_L0;
88935
88936   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
88937   goto __pyx_L0;
88938   __pyx_L1_error:;
88939   __Pyx_XDECREF(__pyx_t_1);
88940   __Pyx_XDECREF(__pyx_t_2);
88941   __Pyx_AddTraceback("lxml.etree._IDDict.__repr__");
88942   __pyx_r = NULL;
88943   __pyx_L0:;
88944   __Pyx_XGIVEREF(__pyx_r);
88945   __Pyx_FinishRefcountContext();
88946   return __pyx_r;
88947 }
88948
88949 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":111
88950  *         return repr(dict(self))
88951  * 
88952  *     def keys(self):             # <<<<<<<<<<<<<<
88953  *         if self._keys is None:
88954  *             self._keys = self._build_keys()
88955  */
88956
88957 static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_keys(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
88958 static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_keys(PyObject *__pyx_v_self, PyObject *unused) {
88959   PyObject *__pyx_r = NULL;
88960   PyObject *__pyx_1 = 0;
88961   int __pyx_t_1;
88962   PyObject *__pyx_t_2 = NULL;
88963   __Pyx_SetupRefcountContext("keys");
88964
88965   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":112
88966  * 
88967  *     def keys(self):
88968  *         if self._keys is None:             # <<<<<<<<<<<<<<
88969  *             self._keys = self._build_keys()
88970  *         return self._keys[:]
88971  */
88972   __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys == Py_None);
88973   if (__pyx_t_1) {
88974
88975     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":113
88976  *     def keys(self):
88977  *         if self._keys is None:
88978  *             self._keys = self._build_keys()             # <<<<<<<<<<<<<<
88979  *         return self._keys[:]
88980  * 
88981  */
88982     __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__IDDict *)((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->__pyx_vtab)->_build_keys(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
88983     __Pyx_GOTREF(__pyx_t_2);
88984     __Pyx_GIVEREF(__pyx_t_2);
88985     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys);
88986     __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys);
88987     ((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys = __pyx_t_2;
88988     __pyx_t_2 = 0;
88989     goto __pyx_L5;
88990   }
88991   __pyx_L5:;
88992
88993   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":114
88994  *         if self._keys is None:
88995  *             self._keys = self._build_keys()
88996  *         return self._keys[:]             # <<<<<<<<<<<<<<
88997  * 
88998  *     def __iter__(self):
88999  */
89000   __Pyx_XDECREF(__pyx_r);
89001   __pyx_1 = PySequence_GetSlice(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89002   __Pyx_GOTREF(__pyx_1);
89003   __pyx_r = __pyx_1;
89004   __pyx_1 = 0;
89005   goto __pyx_L0;
89006
89007   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
89008   goto __pyx_L0;
89009   __pyx_L1_error:;
89010   __Pyx_XDECREF(__pyx_1);
89011   __Pyx_XDECREF(__pyx_t_2);
89012   __Pyx_AddTraceback("lxml.etree._IDDict.keys");
89013   __pyx_r = NULL;
89014   __pyx_L0:;
89015   __Pyx_XGIVEREF(__pyx_r);
89016   __Pyx_FinishRefcountContext();
89017   return __pyx_r;
89018 }
89019
89020 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":116
89021  *         return self._keys[:]
89022  * 
89023  *     def __iter__(self):             # <<<<<<<<<<<<<<
89024  *         if self._keys is None:
89025  *             self._keys = self._build_keys()
89026  */
89027
89028 static PyObject *__pyx_pf_4lxml_5etree_7_IDDict___iter__(PyObject *__pyx_v_self); /*proto*/
89029 static PyObject *__pyx_pf_4lxml_5etree_7_IDDict___iter__(PyObject *__pyx_v_self) {
89030   PyObject *__pyx_r = NULL;
89031   int __pyx_t_1;
89032   PyObject *__pyx_t_2 = NULL;
89033   __Pyx_SetupRefcountContext("__iter__");
89034
89035   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":117
89036  * 
89037  *     def __iter__(self):
89038  *         if self._keys is None:             # <<<<<<<<<<<<<<
89039  *             self._keys = self._build_keys()
89040  *         return iter(self._keys)
89041  */
89042   __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys == Py_None);
89043   if (__pyx_t_1) {
89044
89045     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":118
89046  *     def __iter__(self):
89047  *         if self._keys is None:
89048  *             self._keys = self._build_keys()             # <<<<<<<<<<<<<<
89049  *         return iter(self._keys)
89050  * 
89051  */
89052     __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__IDDict *)((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->__pyx_vtab)->_build_keys(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89053     __Pyx_GOTREF(__pyx_t_2);
89054     __Pyx_GIVEREF(__pyx_t_2);
89055     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys);
89056     __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys);
89057     ((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys = __pyx_t_2;
89058     __pyx_t_2 = 0;
89059     goto __pyx_L5;
89060   }
89061   __pyx_L5:;
89062
89063   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":119
89064  *         if self._keys is None:
89065  *             self._keys = self._build_keys()
89066  *         return iter(self._keys)             # <<<<<<<<<<<<<<
89067  * 
89068  *     def iterkeys(self):
89069  */
89070   __Pyx_XDECREF(__pyx_r);
89071   __pyx_t_2 = PyObject_GetIter(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89072   __Pyx_GOTREF(__pyx_t_2);
89073   __pyx_r = __pyx_t_2;
89074   __pyx_t_2 = 0;
89075   goto __pyx_L0;
89076
89077   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
89078   goto __pyx_L0;
89079   __pyx_L1_error:;
89080   __Pyx_XDECREF(__pyx_t_2);
89081   __Pyx_AddTraceback("lxml.etree._IDDict.__iter__");
89082   __pyx_r = NULL;
89083   __pyx_L0:;
89084   __Pyx_XGIVEREF(__pyx_r);
89085   __Pyx_FinishRefcountContext();
89086   return __pyx_r;
89087 }
89088
89089 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":121
89090  *         return iter(self._keys)
89091  * 
89092  *     def iterkeys(self):             # <<<<<<<<<<<<<<
89093  *         return self
89094  * 
89095  */
89096
89097 static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_iterkeys(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
89098 static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_iterkeys(PyObject *__pyx_v_self, PyObject *unused) {
89099   PyObject *__pyx_r = NULL;
89100   __Pyx_SetupRefcountContext("iterkeys");
89101
89102   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":122
89103  * 
89104  *     def iterkeys(self):
89105  *         return self             # <<<<<<<<<<<<<<
89106  * 
89107  *     def __len__(self):
89108  */
89109   __Pyx_XDECREF(__pyx_r);
89110   __Pyx_INCREF(__pyx_v_self);
89111   __pyx_r = __pyx_v_self;
89112   goto __pyx_L0;
89113
89114   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
89115   __pyx_L0:;
89116   __Pyx_XGIVEREF(__pyx_r);
89117   __Pyx_FinishRefcountContext();
89118   return __pyx_r;
89119 }
89120
89121 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":124
89122  *         return self
89123  * 
89124  *     def __len__(self):             # <<<<<<<<<<<<<<
89125  *         if self._keys is None:
89126  *             self._keys = self._build_keys()
89127  */
89128
89129 static Py_ssize_t __pyx_pf_4lxml_5etree_7_IDDict___len__(PyObject *__pyx_v_self); /*proto*/
89130 static Py_ssize_t __pyx_pf_4lxml_5etree_7_IDDict___len__(PyObject *__pyx_v_self) {
89131   Py_ssize_t __pyx_r;
89132   int __pyx_t_1;
89133   PyObject *__pyx_t_2 = NULL;
89134   Py_ssize_t __pyx_t_3;
89135   __Pyx_SetupRefcountContext("__len__");
89136
89137   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":125
89138  * 
89139  *     def __len__(self):
89140  *         if self._keys is None:             # <<<<<<<<<<<<<<
89141  *             self._keys = self._build_keys()
89142  *         return len(self._keys)
89143  */
89144   __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys == Py_None);
89145   if (__pyx_t_1) {
89146
89147     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":126
89148  *     def __len__(self):
89149  *         if self._keys is None:
89150  *             self._keys = self._build_keys()             # <<<<<<<<<<<<<<
89151  *         return len(self._keys)
89152  * 
89153  */
89154     __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__IDDict *)((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->__pyx_vtab)->_build_keys(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89155     __Pyx_GOTREF(__pyx_t_2);
89156     __Pyx_GIVEREF(__pyx_t_2);
89157     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys);
89158     __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys);
89159     ((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys = __pyx_t_2;
89160     __pyx_t_2 = 0;
89161     goto __pyx_L5;
89162   }
89163   __pyx_L5:;
89164
89165   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":127
89166  *         if self._keys is None:
89167  *             self._keys = self._build_keys()
89168  *         return len(self._keys)             # <<<<<<<<<<<<<<
89169  * 
89170  *     def items(self):
89171  */
89172   __pyx_t_3 = PyObject_Length(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89173   __pyx_r = __pyx_t_3;
89174   goto __pyx_L0;
89175
89176   __pyx_r = 0;
89177   goto __pyx_L0;
89178   __pyx_L1_error:;
89179   __Pyx_XDECREF(__pyx_t_2);
89180   __Pyx_AddTraceback("lxml.etree._IDDict.__len__");
89181   __pyx_r = -1;
89182   __pyx_L0:;
89183   __Pyx_FinishRefcountContext();
89184   return __pyx_r;
89185 }
89186
89187 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":129
89188  *         return len(self._keys)
89189  * 
89190  *     def items(self):             # <<<<<<<<<<<<<<
89191  *         if self._items is None:
89192  *             self._items = self._build_items()
89193  */
89194
89195 static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_items(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
89196 static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_items(PyObject *__pyx_v_self, PyObject *unused) {
89197   PyObject *__pyx_r = NULL;
89198   PyObject *__pyx_1 = 0;
89199   int __pyx_t_1;
89200   PyObject *__pyx_t_2 = NULL;
89201   __Pyx_SetupRefcountContext("items");
89202
89203   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":130
89204  * 
89205  *     def items(self):
89206  *         if self._items is None:             # <<<<<<<<<<<<<<
89207  *             self._items = self._build_items()
89208  *         return self._items[:]
89209  */
89210   __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items == Py_None);
89211   if (__pyx_t_1) {
89212
89213     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":131
89214  *     def items(self):
89215  *         if self._items is None:
89216  *             self._items = self._build_items()             # <<<<<<<<<<<<<<
89217  *         return self._items[:]
89218  * 
89219  */
89220     __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__IDDict *)((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->__pyx_vtab)->_build_items(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89221     __Pyx_GOTREF(__pyx_t_2);
89222     __Pyx_GIVEREF(__pyx_t_2);
89223     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items);
89224     __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items);
89225     ((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items = __pyx_t_2;
89226     __pyx_t_2 = 0;
89227     goto __pyx_L5;
89228   }
89229   __pyx_L5:;
89230
89231   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":132
89232  *         if self._items is None:
89233  *             self._items = self._build_items()
89234  *         return self._items[:]             # <<<<<<<<<<<<<<
89235  * 
89236  *     def iteritems(self):
89237  */
89238   __Pyx_XDECREF(__pyx_r);
89239   __pyx_1 = PySequence_GetSlice(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89240   __Pyx_GOTREF(__pyx_1);
89241   __pyx_r = __pyx_1;
89242   __pyx_1 = 0;
89243   goto __pyx_L0;
89244
89245   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
89246   goto __pyx_L0;
89247   __pyx_L1_error:;
89248   __Pyx_XDECREF(__pyx_1);
89249   __Pyx_XDECREF(__pyx_t_2);
89250   __Pyx_AddTraceback("lxml.etree._IDDict.items");
89251   __pyx_r = NULL;
89252   __pyx_L0:;
89253   __Pyx_XGIVEREF(__pyx_r);
89254   __Pyx_FinishRefcountContext();
89255   return __pyx_r;
89256 }
89257
89258 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":134
89259  *         return self._items[:]
89260  * 
89261  *     def iteritems(self):             # <<<<<<<<<<<<<<
89262  *         if self._items is None:
89263  *             self._items = self._build_items()
89264  */
89265
89266 static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_iteritems(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
89267 static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_iteritems(PyObject *__pyx_v_self, PyObject *unused) {
89268   PyObject *__pyx_r = NULL;
89269   int __pyx_t_1;
89270   PyObject *__pyx_t_2 = NULL;
89271   __Pyx_SetupRefcountContext("iteritems");
89272
89273   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":135
89274  * 
89275  *     def iteritems(self):
89276  *         if self._items is None:             # <<<<<<<<<<<<<<
89277  *             self._items = self._build_items()
89278  *         return iter(self._items)
89279  */
89280   __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items == Py_None);
89281   if (__pyx_t_1) {
89282
89283     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":136
89284  *     def iteritems(self):
89285  *         if self._items is None:
89286  *             self._items = self._build_items()             # <<<<<<<<<<<<<<
89287  *         return iter(self._items)
89288  * 
89289  */
89290     __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__IDDict *)((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->__pyx_vtab)->_build_items(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89291     __Pyx_GOTREF(__pyx_t_2);
89292     __Pyx_GIVEREF(__pyx_t_2);
89293     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items);
89294     __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items);
89295     ((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items = __pyx_t_2;
89296     __pyx_t_2 = 0;
89297     goto __pyx_L5;
89298   }
89299   __pyx_L5:;
89300
89301   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":137
89302  *         if self._items is None:
89303  *             self._items = self._build_items()
89304  *         return iter(self._items)             # <<<<<<<<<<<<<<
89305  * 
89306  *     def values(self):
89307  */
89308   __Pyx_XDECREF(__pyx_r);
89309   __pyx_t_2 = PyObject_GetIter(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89310   __Pyx_GOTREF(__pyx_t_2);
89311   __pyx_r = __pyx_t_2;
89312   __pyx_t_2 = 0;
89313   goto __pyx_L0;
89314
89315   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
89316   goto __pyx_L0;
89317   __pyx_L1_error:;
89318   __Pyx_XDECREF(__pyx_t_2);
89319   __Pyx_AddTraceback("lxml.etree._IDDict.iteritems");
89320   __pyx_r = NULL;
89321   __pyx_L0:;
89322   __Pyx_XGIVEREF(__pyx_r);
89323   __Pyx_FinishRefcountContext();
89324   return __pyx_r;
89325 }
89326
89327 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":139
89328  *         return iter(self._items)
89329  * 
89330  *     def values(self):             # <<<<<<<<<<<<<<
89331  *         cdef list values = []
89332  *         if self._items is None:
89333  */
89334
89335 static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_values(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
89336 static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_values(PyObject *__pyx_v_self, PyObject *unused) {
89337   PyObject *__pyx_v_values = 0;
89338   PyObject *__pyx_v_item;
89339   PyObject *__pyx_v_value;
89340   PyObject *__pyx_r = NULL;
89341   PyObject *__pyx_t_1 = NULL;
89342   int __pyx_t_2;
89343   Py_ssize_t __pyx_t_3;
89344   PyObject *__pyx_t_4 = NULL;
89345   int __pyx_t_5;
89346   __Pyx_SetupRefcountContext("values");
89347   __pyx_v_item = Py_None; __Pyx_INCREF(Py_None);
89348   __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);
89349
89350   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":140
89351  * 
89352  *     def values(self):
89353  *         cdef list values = []             # <<<<<<<<<<<<<<
89354  *         if self._items is None:
89355  *             self._items = self._build_items()
89356  */
89357   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89358   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
89359   __pyx_v_values = __pyx_t_1;
89360   __pyx_t_1 = 0;
89361
89362   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":141
89363  *     def values(self):
89364  *         cdef list values = []
89365  *         if self._items is None:             # <<<<<<<<<<<<<<
89366  *             self._items = self._build_items()
89367  *         for item in self._items:
89368  */
89369   __pyx_t_2 = (((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items == Py_None);
89370   if (__pyx_t_2) {
89371
89372     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":142
89373  *         cdef list values = []
89374  *         if self._items is None:
89375  *             self._items = self._build_items()             # <<<<<<<<<<<<<<
89376  *         for item in self._items:
89377  *             value = python.PyTuple_GET_ITEM(item, 1)
89378  */
89379     __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__IDDict *)((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->__pyx_vtab)->_build_items(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89380     __Pyx_GOTREF(__pyx_t_1);
89381     __Pyx_GIVEREF(__pyx_t_1);
89382     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items);
89383     __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items);
89384     ((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items = __pyx_t_1;
89385     __pyx_t_1 = 0;
89386     goto __pyx_L5;
89387   }
89388   __pyx_L5:;
89389
89390   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":143
89391  *         if self._items is None:
89392  *             self._items = self._build_items()
89393  *         for item in self._items:             # <<<<<<<<<<<<<<
89394  *             value = python.PyTuple_GET_ITEM(item, 1)
89395  *             python.Py_INCREF(value)
89396  */
89397   if (PyList_CheckExact(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items) || PyTuple_CheckExact(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items)) {
89398     __pyx_t_3 = 0; __pyx_t_1 = ((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items; __Pyx_INCREF(__pyx_t_1);
89399   } else {
89400     __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89401     __Pyx_GOTREF(__pyx_t_1);
89402   }
89403   for (;;) {
89404     if (likely(PyList_CheckExact(__pyx_t_1))) {
89405       if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
89406       __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++;
89407     } else if (likely(PyTuple_CheckExact(__pyx_t_1))) {
89408       if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
89409       __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++;
89410     } else {
89411       __pyx_t_4 = PyIter_Next(__pyx_t_1);
89412       if (!__pyx_t_4) {
89413         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89414         break;
89415       }
89416       __Pyx_GOTREF(__pyx_t_4);
89417     }
89418     __Pyx_DECREF(__pyx_v_item);
89419     __pyx_v_item = __pyx_t_4;
89420     __pyx_t_4 = 0;
89421
89422     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":144
89423  *             self._items = self._build_items()
89424  *         for item in self._items:
89425  *             value = python.PyTuple_GET_ITEM(item, 1)             # <<<<<<<<<<<<<<
89426  *             python.Py_INCREF(value)
89427  *             values.append(value)
89428  */
89429     __pyx_t_4 = PyTuple_GET_ITEM(__pyx_v_item, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89430     __Pyx_GOTREF(__pyx_t_4);
89431     __Pyx_DECREF(__pyx_v_value);
89432     __pyx_v_value = __pyx_t_4;
89433     __pyx_t_4 = 0;
89434
89435     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":145
89436  *         for item in self._items:
89437  *             value = python.PyTuple_GET_ITEM(item, 1)
89438  *             python.Py_INCREF(value)             # <<<<<<<<<<<<<<
89439  *             values.append(value)
89440  *         return values
89441  */
89442     Py_INCREF(__pyx_v_value);
89443
89444     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":146
89445  *             value = python.PyTuple_GET_ITEM(item, 1)
89446  *             python.Py_INCREF(value)
89447  *             values.append(value)             # <<<<<<<<<<<<<<
89448  *         return values
89449  * 
89450  */
89451     __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_values), __pyx_v_value); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89452   }
89453   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
89454
89455   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":147
89456  *             python.Py_INCREF(value)
89457  *             values.append(value)
89458  *         return values             # <<<<<<<<<<<<<<
89459  * 
89460  *     def itervalues(self):
89461  */
89462   __Pyx_XDECREF(__pyx_r);
89463   __Pyx_INCREF(((PyObject *)__pyx_v_values));
89464   __pyx_r = ((PyObject *)__pyx_v_values);
89465   goto __pyx_L0;
89466
89467   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
89468   goto __pyx_L0;
89469   __pyx_L1_error:;
89470   __Pyx_XDECREF(__pyx_t_1);
89471   __Pyx_XDECREF(__pyx_t_4);
89472   __Pyx_AddTraceback("lxml.etree._IDDict.values");
89473   __pyx_r = NULL;
89474   __pyx_L0:;
89475   __Pyx_XDECREF(__pyx_v_values);
89476   __Pyx_DECREF(__pyx_v_item);
89477   __Pyx_DECREF(__pyx_v_value);
89478   __Pyx_XGIVEREF(__pyx_r);
89479   __Pyx_FinishRefcountContext();
89480   return __pyx_r;
89481 }
89482
89483 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":149
89484  *         return values
89485  * 
89486  *     def itervalues(self):             # <<<<<<<<<<<<<<
89487  *         return iter(self.values())
89488  * 
89489  */
89490
89491 static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_itervalues(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
89492 static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_itervalues(PyObject *__pyx_v_self, PyObject *unused) {
89493   PyObject *__pyx_r = NULL;
89494   PyObject *__pyx_t_1 = NULL;
89495   PyObject *__pyx_t_2 = NULL;
89496   __Pyx_SetupRefcountContext("itervalues");
89497
89498   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":150
89499  * 
89500  *     def itervalues(self):
89501  *         return iter(self.values())             # <<<<<<<<<<<<<<
89502  * 
89503  *     cdef object _build_keys(self):
89504  */
89505   __Pyx_XDECREF(__pyx_r);
89506   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_values); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89507   __Pyx_GOTREF(__pyx_t_1);
89508   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89509   __Pyx_GOTREF(__pyx_t_2);
89510   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
89511   __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89512   __Pyx_GOTREF(__pyx_t_1);
89513   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
89514   __pyx_r = __pyx_t_1;
89515   __pyx_t_1 = 0;
89516   goto __pyx_L0;
89517
89518   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
89519   goto __pyx_L0;
89520   __pyx_L1_error:;
89521   __Pyx_XDECREF(__pyx_t_1);
89522   __Pyx_XDECREF(__pyx_t_2);
89523   __Pyx_AddTraceback("lxml.etree._IDDict.itervalues");
89524   __pyx_r = NULL;
89525   __pyx_L0:;
89526   __Pyx_XGIVEREF(__pyx_r);
89527   __Pyx_FinishRefcountContext();
89528   return __pyx_r;
89529 }
89530
89531 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":152
89532  *         return iter(self.values())
89533  * 
89534  *     cdef object _build_keys(self):             # <<<<<<<<<<<<<<
89535  *         keys = []
89536  *         tree.xmlHashScan(<tree.xmlHashTable*>self._doc._c_doc.ids,
89537  */
89538
89539 static  PyObject *__pyx_f_4lxml_5etree_7_IDDict__build_keys(struct __pyx_obj_4lxml_5etree__IDDict *__pyx_v_self) {
89540   PyObject *__pyx_v_keys;
89541   PyObject *__pyx_r = NULL;
89542   PyObject *__pyx_t_1 = NULL;
89543   __Pyx_SetupRefcountContext("_build_keys");
89544   __pyx_v_keys = Py_None; __Pyx_INCREF(Py_None);
89545
89546   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":153
89547  * 
89548  *     cdef object _build_keys(self):
89549  *         keys = []             # <<<<<<<<<<<<<<
89550  *         tree.xmlHashScan(<tree.xmlHashTable*>self._doc._c_doc.ids,
89551  *                          _collectIdHashKeys, <python.PyObject*>keys)
89552  */
89553   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89554   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
89555   __Pyx_DECREF(__pyx_v_keys);
89556   __pyx_v_keys = ((PyObject *)__pyx_t_1);
89557   __pyx_t_1 = 0;
89558
89559   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":155
89560  *         keys = []
89561  *         tree.xmlHashScan(<tree.xmlHashTable*>self._doc._c_doc.ids,
89562  *                          _collectIdHashKeys, <python.PyObject*>keys)             # <<<<<<<<<<<<<<
89563  *         return keys
89564  * 
89565  */
89566   xmlHashScan(((xmlHashTable *)__pyx_v_self->_doc->_c_doc->ids), __pyx_f_4lxml_5etree__collectIdHashKeys, ((PyObject *)__pyx_v_keys));
89567
89568   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":156
89569  *         tree.xmlHashScan(<tree.xmlHashTable*>self._doc._c_doc.ids,
89570  *                          _collectIdHashKeys, <python.PyObject*>keys)
89571  *         return keys             # <<<<<<<<<<<<<<
89572  * 
89573  *     cdef object _build_items(self):
89574  */
89575   __Pyx_XDECREF(__pyx_r);
89576   __Pyx_INCREF(__pyx_v_keys);
89577   __pyx_r = __pyx_v_keys;
89578   goto __pyx_L0;
89579
89580   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
89581   goto __pyx_L0;
89582   __pyx_L1_error:;
89583   __Pyx_XDECREF(__pyx_t_1);
89584   __Pyx_AddTraceback("lxml.etree._IDDict._build_keys");
89585   __pyx_r = 0;
89586   __pyx_L0:;
89587   __Pyx_DECREF(__pyx_v_keys);
89588   __Pyx_XGIVEREF(__pyx_r);
89589   __Pyx_FinishRefcountContext();
89590   return __pyx_r;
89591 }
89592
89593 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":158
89594  *         return keys
89595  * 
89596  *     cdef object _build_items(self):             # <<<<<<<<<<<<<<
89597  *         items = []
89598  *         context = (items, self._doc)
89599  */
89600
89601 static  PyObject *__pyx_f_4lxml_5etree_7_IDDict__build_items(struct __pyx_obj_4lxml_5etree__IDDict *__pyx_v_self) {
89602   PyObject *__pyx_v_items;
89603   PyObject *__pyx_v_context;
89604   PyObject *__pyx_r = NULL;
89605   PyObject *__pyx_t_1 = NULL;
89606   __Pyx_SetupRefcountContext("_build_items");
89607   __pyx_v_items = Py_None; __Pyx_INCREF(Py_None);
89608   __pyx_v_context = Py_None; __Pyx_INCREF(Py_None);
89609
89610   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":159
89611  * 
89612  *     cdef object _build_items(self):
89613  *         items = []             # <<<<<<<<<<<<<<
89614  *         context = (items, self._doc)
89615  *         tree.xmlHashScan(<tree.xmlHashTable*>self._doc._c_doc.ids,
89616  */
89617   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89618   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
89619   __Pyx_DECREF(__pyx_v_items);
89620   __pyx_v_items = ((PyObject *)__pyx_t_1);
89621   __pyx_t_1 = 0;
89622
89623   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":160
89624  *     cdef object _build_items(self):
89625  *         items = []
89626  *         context = (items, self._doc)             # <<<<<<<<<<<<<<
89627  *         tree.xmlHashScan(<tree.xmlHashTable*>self._doc._c_doc.ids,
89628  *                          _collectIdHashItemList, <python.PyObject*>context)
89629  */
89630   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89631   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
89632   __Pyx_INCREF(__pyx_v_items);
89633   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_items);
89634   __Pyx_GIVEREF(__pyx_v_items);
89635   __Pyx_INCREF(((PyObject *)__pyx_v_self->_doc));
89636   PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self->_doc));
89637   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_doc));
89638   __Pyx_DECREF(__pyx_v_context);
89639   __pyx_v_context = ((PyObject *)__pyx_t_1);
89640   __pyx_t_1 = 0;
89641
89642   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":162
89643  *         context = (items, self._doc)
89644  *         tree.xmlHashScan(<tree.xmlHashTable*>self._doc._c_doc.ids,
89645  *                          _collectIdHashItemList, <python.PyObject*>context)             # <<<<<<<<<<<<<<
89646  *         return items
89647  * 
89648  */
89649   xmlHashScan(((xmlHashTable *)__pyx_v_self->_doc->_c_doc->ids), __pyx_f_4lxml_5etree__collectIdHashItemList, ((PyObject *)__pyx_v_context));
89650
89651   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":163
89652  *         tree.xmlHashScan(<tree.xmlHashTable*>self._doc._c_doc.ids,
89653  *                          _collectIdHashItemList, <python.PyObject*>context)
89654  *         return items             # <<<<<<<<<<<<<<
89655  * 
89656  * cdef void _collectIdHashItemDict(void* payload, void* context, char* name):
89657  */
89658   __Pyx_XDECREF(__pyx_r);
89659   __Pyx_INCREF(__pyx_v_items);
89660   __pyx_r = __pyx_v_items;
89661   goto __pyx_L0;
89662
89663   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
89664   goto __pyx_L0;
89665   __pyx_L1_error:;
89666   __Pyx_XDECREF(__pyx_t_1);
89667   __Pyx_AddTraceback("lxml.etree._IDDict._build_items");
89668   __pyx_r = 0;
89669   __pyx_L0:;
89670   __Pyx_DECREF(__pyx_v_items);
89671   __Pyx_DECREF(__pyx_v_context);
89672   __Pyx_XGIVEREF(__pyx_r);
89673   __Pyx_FinishRefcountContext();
89674   return __pyx_r;
89675 }
89676
89677 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":165
89678  *         return items
89679  * 
89680  * cdef void _collectIdHashItemDict(void* payload, void* context, char* name):             # <<<<<<<<<<<<<<
89681  *     # collect elements from ID attribute hash table
89682  *     cdef tree.xmlID* c_id
89683  */
89684
89685 static  void __pyx_f_4lxml_5etree__collectIdHashItemDict(void *__pyx_v_payload, void *__pyx_v_context, char *__pyx_v_name) {
89686   xmlID *__pyx_v_c_id;
89687   PyObject *__pyx_v_dic;
89688   PyObject *__pyx_v_doc;
89689   PyObject *__pyx_v_element;
89690   PyObject *__pyx_1 = 0;
89691   PyObject *__pyx_2 = 0;
89692   PyObject *__pyx_3 = 0;
89693   int __pyx_t_1;
89694   int __pyx_t_2;
89695   PyObject *__pyx_t_3 = NULL;
89696   __Pyx_SetupRefcountContext("_collectIdHashItemDict");
89697   __pyx_v_dic = Py_None; __Pyx_INCREF(Py_None);
89698   __pyx_v_doc = Py_None; __Pyx_INCREF(Py_None);
89699   __pyx_v_element = Py_None; __Pyx_INCREF(Py_None);
89700
89701   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":168
89702  *     # collect elements from ID attribute hash table
89703  *     cdef tree.xmlID* c_id
89704  *     c_id = <tree.xmlID*>payload             # <<<<<<<<<<<<<<
89705  *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:
89706  *         return
89707  */
89708   __pyx_v_c_id = ((xmlID *)__pyx_v_payload);
89709
89710   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":169
89711  *     cdef tree.xmlID* c_id
89712  *     c_id = <tree.xmlID*>payload
89713  *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:             # <<<<<<<<<<<<<<
89714  *         return
89715  *     dic, doc = <tuple>context
89716  */
89717   if (!(__pyx_v_c_id == NULL)) {
89718     if (!(__pyx_v_c_id->attr == NULL)) {
89719       __pyx_t_1 = (__pyx_v_c_id->attr->parent == NULL);
89720     } else {
89721       __pyx_t_1 = (__pyx_v_c_id->attr == NULL);
89722     }
89723     __pyx_t_2 = __pyx_t_1;
89724   } else {
89725     __pyx_t_2 = (__pyx_v_c_id == NULL);
89726   }
89727   if (__pyx_t_2) {
89728
89729     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":170
89730  *     c_id = <tree.xmlID*>payload
89731  *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:
89732  *         return             # <<<<<<<<<<<<<<
89733  *     dic, doc = <tuple>context
89734  *     element = _elementFactory(doc, c_id.attr.parent)
89735  */
89736     goto __pyx_L0;
89737     goto __pyx_L3;
89738   }
89739   __pyx_L3:;
89740
89741   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":171
89742  *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:
89743  *         return
89744  *     dic, doc = <tuple>context             # <<<<<<<<<<<<<<
89745  *     element = _elementFactory(doc, c_id.attr.parent)
89746  *     dic[funicode(name)] = element
89747  */
89748   if (likely(((PyObject *)__pyx_v_context) != Py_None) && likely(PyTuple_GET_SIZE(((PyObject *)__pyx_v_context)) == 2)) {
89749     PyObject* tuple = ((PyObject *)__pyx_v_context);
89750     __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
89751     __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
89752     __Pyx_DECREF(__pyx_v_dic);
89753     __pyx_v_dic = __pyx_2;
89754     __pyx_2 = 0;
89755     __Pyx_DECREF(__pyx_v_doc);
89756     __pyx_v_doc = __pyx_3;
89757     __pyx_3 = 0;
89758   } else {
89759     __Pyx_UnpackTupleError(((PyObject *)__pyx_v_context), 2);
89760     {__pyx_filename = __pyx_f[15]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89761   }
89762
89763   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":172
89764  *         return
89765  *     dic, doc = <tuple>context
89766  *     element = _elementFactory(doc, c_id.attr.parent)             # <<<<<<<<<<<<<<
89767  *     dic[funicode(name)] = element
89768  * 
89769  */
89770   if (!(__Pyx_TypeTest(__pyx_v_doc, __pyx_ptype_4lxml_5etree__Document))) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89771   __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_v_doc), __pyx_v_c_id->attr->parent)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89772   __Pyx_GOTREF(__pyx_t_3);
89773   __Pyx_DECREF(__pyx_v_element);
89774   __pyx_v_element = __pyx_t_3;
89775   __pyx_t_3 = 0;
89776
89777   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":173
89778  *     dic, doc = <tuple>context
89779  *     element = _elementFactory(doc, c_id.attr.parent)
89780  *     dic[funicode(name)] = element             # <<<<<<<<<<<<<<
89781  * 
89782  * cdef void _collectIdHashItemList(void* payload, void* context, char* name):
89783  */
89784   __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89785   __Pyx_GOTREF(__pyx_t_3);
89786   if (PyObject_SetItem(__pyx_v_dic, __pyx_t_3, __pyx_v_element) < 0) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89787   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
89788
89789   goto __pyx_L0;
89790   __pyx_L1_error:;
89791   __Pyx_XDECREF(__pyx_1);
89792   __Pyx_XDECREF(__pyx_2);
89793   __Pyx_XDECREF(__pyx_3);
89794   __Pyx_XDECREF(__pyx_t_3);
89795   __Pyx_WriteUnraisable("lxml.etree._collectIdHashItemDict");
89796   __pyx_L0:;
89797   __Pyx_DECREF(__pyx_v_dic);
89798   __Pyx_DECREF(__pyx_v_doc);
89799   __Pyx_DECREF(__pyx_v_element);
89800   __Pyx_FinishRefcountContext();
89801 }
89802
89803 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":175
89804  *     dic[funicode(name)] = element
89805  * 
89806  * cdef void _collectIdHashItemList(void* payload, void* context, char* name):             # <<<<<<<<<<<<<<
89807  *     # collect elements from ID attribute hash table
89808  *     cdef tree.xmlID* c_id
89809  */
89810
89811 static  void __pyx_f_4lxml_5etree__collectIdHashItemList(void *__pyx_v_payload, void *__pyx_v_context, char *__pyx_v_name) {
89812   xmlID *__pyx_v_c_id;
89813   PyObject *__pyx_v_lst;
89814   PyObject *__pyx_v_doc;
89815   PyObject *__pyx_v_element;
89816   PyObject *__pyx_1 = 0;
89817   PyObject *__pyx_2 = 0;
89818   PyObject *__pyx_3 = 0;
89819   int __pyx_t_1;
89820   int __pyx_t_2;
89821   PyObject *__pyx_t_3 = NULL;
89822   PyObject *__pyx_t_4 = NULL;
89823   int __pyx_t_5;
89824   __Pyx_SetupRefcountContext("_collectIdHashItemList");
89825   __pyx_v_lst = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
89826   __pyx_v_doc = Py_None; __Pyx_INCREF(Py_None);
89827   __pyx_v_element = Py_None; __Pyx_INCREF(Py_None);
89828
89829   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":179
89830  *     cdef tree.xmlID* c_id
89831  *     cdef list lst
89832  *     c_id = <tree.xmlID*>payload             # <<<<<<<<<<<<<<
89833  *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:
89834  *         return
89835  */
89836   __pyx_v_c_id = ((xmlID *)__pyx_v_payload);
89837
89838   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":180
89839  *     cdef list lst
89840  *     c_id = <tree.xmlID*>payload
89841  *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:             # <<<<<<<<<<<<<<
89842  *         return
89843  *     lst, doc = <tuple>context
89844  */
89845   if (!(__pyx_v_c_id == NULL)) {
89846     if (!(__pyx_v_c_id->attr == NULL)) {
89847       __pyx_t_1 = (__pyx_v_c_id->attr->parent == NULL);
89848     } else {
89849       __pyx_t_1 = (__pyx_v_c_id->attr == NULL);
89850     }
89851     __pyx_t_2 = __pyx_t_1;
89852   } else {
89853     __pyx_t_2 = (__pyx_v_c_id == NULL);
89854   }
89855   if (__pyx_t_2) {
89856
89857     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":181
89858  *     c_id = <tree.xmlID*>payload
89859  *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:
89860  *         return             # <<<<<<<<<<<<<<
89861  *     lst, doc = <tuple>context
89862  *     element = _elementFactory(doc, c_id.attr.parent)
89863  */
89864     goto __pyx_L0;
89865     goto __pyx_L3;
89866   }
89867   __pyx_L3:;
89868
89869   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":182
89870  *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:
89871  *         return
89872  *     lst, doc = <tuple>context             # <<<<<<<<<<<<<<
89873  *     element = _elementFactory(doc, c_id.attr.parent)
89874  *     lst.append( (funicode(name), element) )
89875  */
89876   if (likely(((PyObject *)__pyx_v_context) != Py_None) && likely(PyTuple_GET_SIZE(((PyObject *)__pyx_v_context)) == 2)) {
89877     PyObject* tuple = ((PyObject *)__pyx_v_context);
89878     __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
89879     if (!(likely(PyList_CheckExact(__pyx_2)) || (__pyx_2) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected list, got %s", Py_TYPE(__pyx_2)->tp_name), 0))) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89880     __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
89881     __Pyx_DECREF(((PyObject *)__pyx_v_lst));
89882     __pyx_v_lst = ((PyObject *)__pyx_2);
89883     __pyx_2 = 0;
89884     __Pyx_DECREF(__pyx_v_doc);
89885     __pyx_v_doc = __pyx_3;
89886     __pyx_3 = 0;
89887   } else {
89888     __Pyx_UnpackTupleError(((PyObject *)__pyx_v_context), 2);
89889     {__pyx_filename = __pyx_f[15]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89890   }
89891
89892   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":183
89893  *         return
89894  *     lst, doc = <tuple>context
89895  *     element = _elementFactory(doc, c_id.attr.parent)             # <<<<<<<<<<<<<<
89896  *     lst.append( (funicode(name), element) )
89897  * 
89898  */
89899   if (!(__Pyx_TypeTest(__pyx_v_doc, __pyx_ptype_4lxml_5etree__Document))) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89900   __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_v_doc), __pyx_v_c_id->attr->parent)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89901   __Pyx_GOTREF(__pyx_t_3);
89902   __Pyx_DECREF(__pyx_v_element);
89903   __pyx_v_element = __pyx_t_3;
89904   __pyx_t_3 = 0;
89905
89906   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":184
89907  *     lst, doc = <tuple>context
89908  *     element = _elementFactory(doc, c_id.attr.parent)
89909  *     lst.append( (funicode(name), element) )             # <<<<<<<<<<<<<<
89910  * 
89911  * cdef void _collectIdHashKeys(void* payload, void* collect_list, char* name):
89912  */
89913   __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89914   __Pyx_GOTREF(__pyx_t_3);
89915   __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89916   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
89917   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
89918   __Pyx_GIVEREF(__pyx_t_3);
89919   __Pyx_INCREF(__pyx_v_element);
89920   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_element);
89921   __Pyx_GIVEREF(__pyx_v_element);
89922   __pyx_t_3 = 0;
89923   __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_lst), ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
89924   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
89925
89926   goto __pyx_L0;
89927   __pyx_L1_error:;
89928   __Pyx_XDECREF(__pyx_1);
89929   __Pyx_XDECREF(__pyx_2);
89930   __Pyx_XDECREF(__pyx_3);
89931   __Pyx_XDECREF(__pyx_t_3);
89932   __Pyx_XDECREF(__pyx_t_4);
89933   __Pyx_WriteUnraisable("lxml.etree._collectIdHashItemList");
89934   __pyx_L0:;
89935   __Pyx_DECREF(__pyx_v_lst);
89936   __Pyx_DECREF(__pyx_v_doc);
89937   __Pyx_DECREF(__pyx_v_element);
89938   __Pyx_FinishRefcountContext();
89939 }
89940
89941 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":186
89942  *     lst.append( (funicode(name), element) )
89943  * 
89944  * cdef void _collectIdHashKeys(void* payload, void* collect_list, char* name):             # <<<<<<<<<<<<<<
89945  *     cdef tree.xmlID* c_id
89946  *     c_id = <tree.xmlID*>payload
89947  */
89948
89949 static  void __pyx_f_4lxml_5etree__collectIdHashKeys(void *__pyx_v_payload, void *__pyx_v_collect_list, char *__pyx_v_name) {
89950   xmlID *__pyx_v_c_id;
89951   int __pyx_t_1;
89952   int __pyx_t_2;
89953   PyObject *__pyx_t_3 = NULL;
89954   int __pyx_t_4;
89955   __Pyx_SetupRefcountContext("_collectIdHashKeys");
89956
89957   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":188
89958  * cdef void _collectIdHashKeys(void* payload, void* collect_list, char* name):
89959  *     cdef tree.xmlID* c_id
89960  *     c_id = <tree.xmlID*>payload             # <<<<<<<<<<<<<<
89961  *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:
89962  *         return
89963  */
89964   __pyx_v_c_id = ((xmlID *)__pyx_v_payload);
89965
89966   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":189
89967  *     cdef tree.xmlID* c_id
89968  *     c_id = <tree.xmlID*>payload
89969  *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:             # <<<<<<<<<<<<<<
89970  *         return
89971  *     (<list>collect_list).append(funicode(name))
89972  */
89973   if (!(__pyx_v_c_id == NULL)) {
89974     if (!(__pyx_v_c_id->attr == NULL)) {
89975       __pyx_t_1 = (__pyx_v_c_id->attr->parent == NULL);
89976     } else {
89977       __pyx_t_1 = (__pyx_v_c_id->attr == NULL);
89978     }
89979     __pyx_t_2 = __pyx_t_1;
89980   } else {
89981     __pyx_t_2 = (__pyx_v_c_id == NULL);
89982   }
89983   if (__pyx_t_2) {
89984
89985     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":190
89986  *     c_id = <tree.xmlID*>payload
89987  *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:
89988  *         return             # <<<<<<<<<<<<<<
89989  *     (<list>collect_list).append(funicode(name))
89990  */
89991     goto __pyx_L0;
89992     goto __pyx_L3;
89993   }
89994   __pyx_L3:;
89995
89996   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlid.pxi":191
89997  *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:
89998  *         return
89999  *     (<list>collect_list).append(funicode(name))             # <<<<<<<<<<<<<<
90000  */
90001   __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90002   __Pyx_GOTREF(__pyx_t_3);
90003   __pyx_t_4 = PyList_Append(((PyObject *)((PyObject *)__pyx_v_collect_list)), __pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90004   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
90005
90006   goto __pyx_L0;
90007   __pyx_L1_error:;
90008   __Pyx_XDECREF(__pyx_t_3);
90009   __Pyx_WriteUnraisable("lxml.etree._collectIdHashKeys");
90010   __pyx_L0:;
90011   __Pyx_FinishRefcountContext();
90012 }
90013
90014 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xinclude.pxi":18
90015  *     """
90016  *     cdef _ErrorLog _error_log
90017  *     def __init__(self):             # <<<<<<<<<<<<<<
90018  *         self._error_log = _ErrorLog()
90019  * 
90020  */
90021
90022 static int __pyx_pf_4lxml_5etree_8XInclude___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
90023 static int __pyx_pf_4lxml_5etree_8XInclude___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
90024   int __pyx_r;
90025   PyObject *__pyx_t_1 = NULL;
90026   __Pyx_SetupRefcountContext("__init__");
90027   if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
90028     __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
90029   if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
90030
90031   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xinclude.pxi":19
90032  *     cdef _ErrorLog _error_log
90033  *     def __init__(self):
90034  *         self._error_log = _ErrorLog()             # <<<<<<<<<<<<<<
90035  * 
90036  *     property error_log:
90037  */
90038   __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ErrorLog)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90039   __Pyx_GOTREF(__pyx_t_1);
90040   if (!(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__ErrorLog))) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90041   __Pyx_GIVEREF(__pyx_t_1);
90042   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_XInclude *)__pyx_v_self)->_error_log);
90043   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_XInclude *)__pyx_v_self)->_error_log));
90044   ((struct __pyx_obj_4lxml_5etree_XInclude *)__pyx_v_self)->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_t_1);
90045   __pyx_t_1 = 0;
90046
90047   __pyx_r = 0;
90048   goto __pyx_L0;
90049   __pyx_L1_error:;
90050   __Pyx_XDECREF(__pyx_t_1);
90051   __Pyx_AddTraceback("lxml.etree.XInclude.__init__");
90052   __pyx_r = -1;
90053   __pyx_L0:;
90054   __Pyx_FinishRefcountContext();
90055   return __pyx_r;
90056 }
90057
90058 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xinclude.pxi":22
90059  * 
90060  *     property error_log:
90061  *         def __get__(self):             # <<<<<<<<<<<<<<
90062  *             return self._error_log.copy()
90063  * 
90064  */
90065
90066 static PyObject *__pyx_pf_4lxml_5etree_8XInclude_9error_log___get__(PyObject *__pyx_v_self); /*proto*/
90067 static PyObject *__pyx_pf_4lxml_5etree_8XInclude_9error_log___get__(PyObject *__pyx_v_self) {
90068   PyObject *__pyx_r = NULL;
90069   PyObject *__pyx_t_1 = NULL;
90070   PyObject *__pyx_t_2 = NULL;
90071   __Pyx_SetupRefcountContext("__get__");
90072
90073   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xinclude.pxi":23
90074  *     property error_log:
90075  *         def __get__(self):
90076  *             return self._error_log.copy()             # <<<<<<<<<<<<<<
90077  * 
90078  *     def __call__(self, _Element node not None):
90079  */
90080   __Pyx_XDECREF(__pyx_r);
90081   __pyx_t_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_4lxml_5etree_XInclude *)__pyx_v_self)->_error_log), __pyx_kp_copy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90082   __Pyx_GOTREF(__pyx_t_1);
90083   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90084   __Pyx_GOTREF(__pyx_t_2);
90085   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
90086   __pyx_r = __pyx_t_2;
90087   __pyx_t_2 = 0;
90088   goto __pyx_L0;
90089
90090   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
90091   goto __pyx_L0;
90092   __pyx_L1_error:;
90093   __Pyx_XDECREF(__pyx_t_1);
90094   __Pyx_XDECREF(__pyx_t_2);
90095   __Pyx_AddTraceback("lxml.etree.XInclude.error_log.__get__");
90096   __pyx_r = NULL;
90097   __pyx_L0:;
90098   __Pyx_XGIVEREF(__pyx_r);
90099   __Pyx_FinishRefcountContext();
90100   return __pyx_r;
90101 }
90102
90103 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xinclude.pxi":25
90104  *             return self._error_log.copy()
90105  * 
90106  *     def __call__(self, _Element node not None):             # <<<<<<<<<<<<<<
90107  *         u"__call__(self, node)"
90108  *         # We cannot pass the XML_PARSE_NOXINCNODE option as this would free
90109  */
90110
90111 static PyObject *__pyx_pf_4lxml_5etree_8XInclude___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
90112 static char __pyx_doc_4lxml_5etree_8XInclude___call__[] = "__call__(self, node)";
90113 static PyObject *__pyx_pf_4lxml_5etree_8XInclude___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
90114   struct LxmlElement *__pyx_v_node = 0;
90115   int __pyx_v_result;
90116   PyObject *__pyx_r = NULL;
90117   PyObject *__pyx_1 = 0;
90118   int __pyx_t_1;
90119   PyObject *__pyx_t_2 = NULL;
90120   PyObject *__pyx_t_3 = NULL;
90121   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_node,0};
90122   __Pyx_SetupRefcountContext("__call__");
90123   if (unlikely(__pyx_kwds)) {
90124     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
90125     PyObject* values[1] = {0};
90126     switch (PyTuple_GET_SIZE(__pyx_args)) {
90127       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
90128       case  0: break;
90129       default: goto __pyx_L5_argtuple_error;
90130     }
90131     switch (PyTuple_GET_SIZE(__pyx_args)) {
90132       case  0:
90133       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_node);
90134       if (likely(values[0])) kw_args--;
90135       else goto __pyx_L5_argtuple_error;
90136     }
90137     if (unlikely(kw_args > 0)) {
90138       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__call__") < 0)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
90139     }
90140     __pyx_v_node = ((struct LxmlElement *)values[0]);
90141   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
90142     goto __pyx_L5_argtuple_error;
90143   } else {
90144     __pyx_v_node = ((struct LxmlElement *)PyTuple_GET_ITEM(__pyx_args, 0));
90145   }
90146   goto __pyx_L4_argument_unpacking_done;
90147   __pyx_L5_argtuple_error:;
90148   __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[16]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
90149   __pyx_L3_error:;
90150   __Pyx_AddTraceback("lxml.etree.XInclude.__call__");
90151   return NULL;
90152   __pyx_L4_argument_unpacking_done:;
90153   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_node), __pyx_ptype_4lxml_5etree__Element, 0, "node", 0))) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90154
90155   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xinclude.pxi":35
90156  *         # i.e. as a sibling, which does not conflict with traversal.
90157  *         cdef int result
90158  *         self._error_log.connect()             # <<<<<<<<<<<<<<
90159  *         __GLOBAL_PARSER_CONTEXT.pushImpliedContextFromParser(
90160  *             node._doc._parser)
90161  */
90162   ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_XInclude *)__pyx_v_self)->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(((struct __pyx_obj_4lxml_5etree_XInclude *)__pyx_v_self)->_error_log);
90163
90164   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xinclude.pxi":37
90165  *         self._error_log.connect()
90166  *         __GLOBAL_PARSER_CONTEXT.pushImpliedContextFromParser(
90167  *             node._doc._parser)             # <<<<<<<<<<<<<<
90168  *         with nogil:
90169  *             if node._doc._parser is not None:
90170  */
90171   ((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->pushImpliedContextFromParser(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT, __pyx_v_node->_doc->_parser);
90172
90173   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xinclude.pxi":38
90174  *         __GLOBAL_PARSER_CONTEXT.pushImpliedContextFromParser(
90175  *             node._doc._parser)
90176  *         with nogil:             # <<<<<<<<<<<<<<
90177  *             if node._doc._parser is not None:
90178  *                 result = xinclude.xmlXIncludeProcessTreeFlags(
90179  */
90180   { PyThreadState *_save;
90181     Py_UNBLOCK_THREADS
90182     /*try:*/ {
90183
90184       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xinclude.pxi":39
90185  *             node._doc._parser)
90186  *         with nogil:
90187  *             if node._doc._parser is not None:             # <<<<<<<<<<<<<<
90188  *                 result = xinclude.xmlXIncludeProcessTreeFlags(
90189  *                     node._c_node, node._doc._parser._parse_options)
90190  */
90191       __pyx_t_1 = (((PyObject *)__pyx_v_node->_doc->_parser) != Py_None);
90192       if (__pyx_t_1) {
90193
90194         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xinclude.pxi":41
90195  *             if node._doc._parser is not None:
90196  *                 result = xinclude.xmlXIncludeProcessTreeFlags(
90197  *                     node._c_node, node._doc._parser._parse_options)             # <<<<<<<<<<<<<<
90198  *             else:
90199  *                 result = xinclude.xmlXIncludeProcessTree(node._c_node)
90200  */
90201         __pyx_v_result = xmlXIncludeProcessTreeFlags(__pyx_v_node->_c_node, __pyx_v_node->_doc->_parser->_parse_options);
90202         goto __pyx_L9;
90203       }
90204       /*else*/ {
90205
90206         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xinclude.pxi":43
90207  *                     node._c_node, node._doc._parser._parse_options)
90208  *             else:
90209  *                 result = xinclude.xmlXIncludeProcessTree(node._c_node)             # <<<<<<<<<<<<<<
90210  *         __GLOBAL_PARSER_CONTEXT.popImpliedContext()
90211  *         self._error_log.disconnect()
90212  */
90213         __pyx_v_result = xmlXIncludeProcessTree(__pyx_v_node->_c_node);
90214       }
90215       __pyx_L9:;
90216     }
90217     /*finally:*/ {
90218       Py_BLOCK_THREADS
90219     }
90220   }
90221
90222   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xinclude.pxi":44
90223  *             else:
90224  *                 result = xinclude.xmlXIncludeProcessTree(node._c_node)
90225  *         __GLOBAL_PARSER_CONTEXT.popImpliedContext()             # <<<<<<<<<<<<<<
90226  *         self._error_log.disconnect()
90227  * 
90228  */
90229   ((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->popImpliedContext(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT);
90230
90231   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xinclude.pxi":45
90232  *                 result = xinclude.xmlXIncludeProcessTree(node._c_node)
90233  *         __GLOBAL_PARSER_CONTEXT.popImpliedContext()
90234  *         self._error_log.disconnect()             # <<<<<<<<<<<<<<
90235  * 
90236  *         if result == -1:
90237  */
90238   ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_XInclude *)__pyx_v_self)->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(((struct __pyx_obj_4lxml_5etree_XInclude *)__pyx_v_self)->_error_log);
90239
90240   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xinclude.pxi":47
90241  *         self._error_log.disconnect()
90242  * 
90243  *         if result == -1:             # <<<<<<<<<<<<<<
90244  *             raise XIncludeError(
90245  *                 self._error_log._buildExceptionMessage(
90246  */
90247   __pyx_t_1 = (__pyx_v_result == -1);
90248   if (__pyx_t_1) {
90249
90250     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xinclude.pxi":48
90251  * 
90252  *         if result == -1:
90253  *             raise XIncludeError(             # <<<<<<<<<<<<<<
90254  *                 self._error_log._buildExceptionMessage(
90255  *                     u"XInclude processing failed"),
90256  */
90257     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XIncludeError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90258     __Pyx_GOTREF(__pyx_1);
90259
90260     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xinclude.pxi":50
90261  *             raise XIncludeError(
90262  *                 self._error_log._buildExceptionMessage(
90263  *                     u"XInclude processing failed"),             # <<<<<<<<<<<<<<
90264  *                 self._error_log)
90265  */
90266     __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_XInclude *)__pyx_v_self)->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._buildExceptionMessage(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)((struct __pyx_obj_4lxml_5etree_XInclude *)__pyx_v_self)->_error_log), ((PyObject *)__pyx_kp_552)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90267     __Pyx_GOTREF(__pyx_t_2);
90268
90269     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xinclude.pxi":51
90270  *                 self._error_log._buildExceptionMessage(
90271  *                     u"XInclude processing failed"),
90272  *                 self._error_log)             # <<<<<<<<<<<<<<
90273  */
90274     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90275     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
90276     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
90277     __Pyx_GIVEREF(__pyx_t_2);
90278     __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_XInclude *)__pyx_v_self)->_error_log));
90279     PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)((struct __pyx_obj_4lxml_5etree_XInclude *)__pyx_v_self)->_error_log));
90280     __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_XInclude *)__pyx_v_self)->_error_log));
90281     __pyx_t_2 = 0;
90282     __pyx_t_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90283     __Pyx_GOTREF(__pyx_t_2);
90284     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
90285     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
90286     __Pyx_Raise(__pyx_t_2, 0, 0);
90287     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
90288     {__pyx_filename = __pyx_f[16]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90289     goto __pyx_L10;
90290   }
90291   __pyx_L10:;
90292
90293   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
90294   goto __pyx_L0;
90295   __pyx_L1_error:;
90296   __Pyx_XDECREF(__pyx_1);
90297   __Pyx_XDECREF(__pyx_t_2);
90298   __Pyx_XDECREF(__pyx_t_3);
90299   __Pyx_AddTraceback("lxml.etree.XInclude.__call__");
90300   __pyx_r = NULL;
90301   __pyx_L0:;
90302   __Pyx_XGIVEREF(__pyx_r);
90303   __Pyx_FinishRefcountContext();
90304   return __pyx_r;
90305 }
90306
90307 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":3
90308  * # functions for tree cleanup and removing elements from subtrees
90309  * 
90310  * def cleanup_namespaces(tree_or_element):             # <<<<<<<<<<<<<<
90311  *     u"""cleanup_namespaces(tree_or_element)
90312  * 
90313  */
90314
90315 static PyObject *__pyx_pf_4lxml_5etree_cleanup_namespaces(PyObject *__pyx_self, PyObject *__pyx_v_tree_or_element); /*proto*/
90316 static char __pyx_doc_4lxml_5etree_cleanup_namespaces[] = "cleanup_namespaces(tree_or_element)\n\n    Remove all namespace declarations from a subtree that are not used\n    by any of the elements or attributes in that tree.\n    ";
90317 static PyObject *__pyx_pf_4lxml_5etree_cleanup_namespaces(PyObject *__pyx_self, PyObject *__pyx_v_tree_or_element) {
90318   struct LxmlElement *__pyx_v_element;
90319   PyObject *__pyx_r = NULL;
90320   PyObject *__pyx_t_1 = NULL;
90321   int __pyx_t_2;
90322   __Pyx_SetupRefcountContext("cleanup_namespaces");
90323   __pyx_self = __pyx_self;
90324   __pyx_v_element = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
90325
90326   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":10
90327  *     """
90328  *     cdef _Element element
90329  *     element = _rootNodeOrRaise(tree_or_element)             # <<<<<<<<<<<<<<
90330  *     _removeUnusedNamespaceDeclarations(element._c_node)
90331  * 
90332  */
90333   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v_tree_or_element)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90334   __Pyx_GOTREF(__pyx_t_1);
90335   __Pyx_DECREF(((PyObject *)__pyx_v_element));
90336   __pyx_v_element = ((struct LxmlElement *)__pyx_t_1);
90337   __pyx_t_1 = 0;
90338
90339   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":11
90340  *     cdef _Element element
90341  *     element = _rootNodeOrRaise(tree_or_element)
90342  *     _removeUnusedNamespaceDeclarations(element._c_node)             # <<<<<<<<<<<<<<
90343  * 
90344  * def strip_attributes(tree_or_element, *attribute_names):
90345  */
90346   __pyx_t_2 = __pyx_f_4lxml_5etree__removeUnusedNamespaceDeclarations(__pyx_v_element->_c_node); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90347
90348   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
90349   goto __pyx_L0;
90350   __pyx_L1_error:;
90351   __Pyx_XDECREF(__pyx_t_1);
90352   __Pyx_AddTraceback("lxml.etree.cleanup_namespaces");
90353   __pyx_r = NULL;
90354   __pyx_L0:;
90355   __Pyx_DECREF((PyObject *)__pyx_v_element);
90356   __Pyx_XGIVEREF(__pyx_r);
90357   __Pyx_FinishRefcountContext();
90358   return __pyx_r;
90359 }
90360
90361 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":13
90362  *     _removeUnusedNamespaceDeclarations(element._c_node)
90363  * 
90364  * def strip_attributes(tree_or_element, *attribute_names):             # <<<<<<<<<<<<<<
90365  *     u"""strip_attributes(tree_or_element, *attribute_names)
90366  * 
90367  */
90368
90369 static PyObject *__pyx_pf_4lxml_5etree_strip_attributes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
90370 static char __pyx_doc_4lxml_5etree_strip_attributes[] = "strip_attributes(tree_or_element, *attribute_names)\n\n    Delete all attributes with the provided attribute names from an\n    Element (or ElementTree) and its descendants.\n\n    Example usage::\n\n        strip_attributes(root_element,\n                         'simpleattr',\n                         '{http://some/ns}attrname')\n    ";
90371 static PyObject *__pyx_pf_4lxml_5etree_strip_attributes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
90372   PyObject *__pyx_v_tree_or_element = 0;
90373   PyObject *__pyx_v_attribute_names = 0;
90374   xmlNode *__pyx_v_c_node;
90375   xmlAttr *__pyx_v_c_attr;
90376   struct LxmlElement *__pyx_v_element;
90377   PyObject *__pyx_v_ns_tags;
90378   char *__pyx_v_c_name;
90379   PyObject *__pyx_v_ns;
90380   PyObject *__pyx_v_tag;
90381   PyObject *__pyx_v_attr;
90382   PyObject *__pyx_r = NULL;
90383   PyObject *__pyx_1 = 0;
90384   PyObject *__pyx_2 = 0;
90385   PyObject *__pyx_3 = 0;
90386   void *__pyx_4;
90387   PyObject *__pyx_t_1 = NULL;
90388   int __pyx_t_2;
90389   int __pyx_t_3;
90390   Py_ssize_t __pyx_t_4;
90391   PyObject *__pyx_t_5 = NULL;
90392   PyObject *__pyx_t_6 = NULL;
90393   int __pyx_t_7;
90394   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_tree_or_element,0};
90395   __Pyx_SetupRefcountContext("strip_attributes");
90396   __pyx_self = __pyx_self;
90397   if (PyTuple_GET_SIZE(__pyx_args) > 1) {
90398     __pyx_v_attribute_names = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); __Pyx_GOTREF(__pyx_v_attribute_names);
90399     if (unlikely(!__pyx_v_attribute_names)) return NULL;
90400   } else {
90401     __pyx_v_attribute_names = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
90402   }
90403   if (unlikely(__pyx_kwds)) {
90404     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
90405     PyObject* values[1] = {0};
90406     switch (PyTuple_GET_SIZE(__pyx_args)) {
90407       default:
90408       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
90409       case  0: break;
90410     }
90411     switch (PyTuple_GET_SIZE(__pyx_args)) {
90412       case  0:
90413       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_tree_or_element);
90414       if (likely(values[0])) kw_args--;
90415       else goto __pyx_L5_argtuple_error;
90416     }
90417     if (unlikely(kw_args > 0)) {
90418       const Py_ssize_t used_pos_args = (PyTuple_GET_SIZE(__pyx_args) < 1) ? PyTuple_GET_SIZE(__pyx_args) : 1;
90419       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "strip_attributes") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
90420     }
90421     __pyx_v_tree_or_element = values[0];
90422   } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
90423     goto __pyx_L5_argtuple_error;
90424   } else {
90425     __pyx_v_tree_or_element = PyTuple_GET_ITEM(__pyx_args, 0);
90426   }
90427   goto __pyx_L4_argument_unpacking_done;
90428   __pyx_L5_argtuple_error:;
90429   __Pyx_RaiseArgtupleInvalid("strip_attributes", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
90430   __pyx_L3_error:;
90431   __Pyx_DECREF(__pyx_v_attribute_names);
90432   __Pyx_AddTraceback("lxml.etree.strip_attributes");
90433   return NULL;
90434   __pyx_L4_argument_unpacking_done:;
90435   __pyx_v_element = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
90436   __pyx_v_ns_tags = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
90437   __pyx_v_ns = Py_None; __Pyx_INCREF(Py_None);
90438   __pyx_v_tag = Py_None; __Pyx_INCREF(Py_None);
90439   __pyx_v_attr = Py_None; __Pyx_INCREF(Py_None);
90440
90441   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":31
90442  *     cdef char* c_name
90443  * 
90444  *     element = _rootNodeOrRaise(tree_or_element)             # <<<<<<<<<<<<<<
90445  *     if not attribute_names: return
90446  * 
90447  */
90448   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v_tree_or_element)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90449   __Pyx_GOTREF(__pyx_t_1);
90450   __Pyx_DECREF(((PyObject *)__pyx_v_element));
90451   __pyx_v_element = ((struct LxmlElement *)__pyx_t_1);
90452   __pyx_t_1 = 0;
90453
90454   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":32
90455  * 
90456  *     element = _rootNodeOrRaise(tree_or_element)
90457  *     if not attribute_names: return             # <<<<<<<<<<<<<<
90458  * 
90459  *     ns_tags = _sortedTagList([ _getNsTag(attr)
90460  */
90461   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_attribute_names); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90462   __pyx_t_3 = (!__pyx_t_2);
90463   if (__pyx_t_3) {
90464     __Pyx_XDECREF(__pyx_r);
90465     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
90466     goto __pyx_L0;
90467     goto __pyx_L6;
90468   }
90469   __pyx_L6:;
90470
90471   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":34
90472  *     if not attribute_names: return
90473  * 
90474  *     ns_tags = _sortedTagList([ _getNsTag(attr)             # <<<<<<<<<<<<<<
90475  *                                for attr in <tuple>attribute_names ])
90476  *     ns_tags = [ (ns, tag if tag != '*' else None)
90477  */
90478   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90479   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
90480
90481   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":35
90482  * 
90483  *     ns_tags = _sortedTagList([ _getNsTag(attr)
90484  *                                for attr in <tuple>attribute_names ])             # <<<<<<<<<<<<<<
90485  *     ns_tags = [ (ns, tag if tag != '*' else None)
90486  *                 for ns, tag in ns_tags ]
90487  */
90488   if (likely(__pyx_v_attribute_names != Py_None)) {
90489     __pyx_t_4 = 0; __pyx_t_5 = __pyx_v_attribute_names; __Pyx_INCREF(__pyx_t_5);
90490   } else {
90491     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90492   }
90493   for (;;) {
90494     if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
90495     __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++;
90496     __Pyx_DECREF(__pyx_v_attr);
90497     __pyx_v_attr = __pyx_t_6;
90498     __pyx_t_6 = 0;
90499
90500     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":34
90501  *     if not attribute_names: return
90502  * 
90503  *     ns_tags = _sortedTagList([ _getNsTag(attr)             # <<<<<<<<<<<<<<
90504  *                                for attr in <tuple>attribute_names ])
90505  *     ns_tags = [ (ns, tag if tag != '*' else None)
90506  */
90507     __pyx_t_6 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_attr); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90508     __Pyx_GOTREF(__pyx_t_6);
90509     __pyx_t_7 = PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_6); if (unlikely(__pyx_t_7)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90510     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
90511   }
90512   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
90513   __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__sortedTagList(__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90514   __Pyx_GOTREF(__pyx_t_5);
90515   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
90516   __Pyx_DECREF(((PyObject *)__pyx_v_ns_tags));
90517   __pyx_v_ns_tags = ((PyObject *)__pyx_t_5);
90518   __pyx_t_5 = 0;
90519
90520   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":36
90521  *     ns_tags = _sortedTagList([ _getNsTag(attr)
90522  *                                for attr in <tuple>attribute_names ])
90523  *     ns_tags = [ (ns, tag if tag != '*' else None)             # <<<<<<<<<<<<<<
90524  *                 for ns, tag in ns_tags ]
90525  * 
90526  */
90527   __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90528   __Pyx_GOTREF(((PyObject *)__pyx_t_5));
90529
90530   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":37
90531  *                                for attr in <tuple>attribute_names ])
90532  *     ns_tags = [ (ns, tag if tag != '*' else None)
90533  *                 for ns, tag in ns_tags ]             # <<<<<<<<<<<<<<
90534  * 
90535  *     c_node = element._c_node
90536  */
90537   if (likely(((PyObject *)__pyx_v_ns_tags) != Py_None)) {
90538     __pyx_t_4 = 0; __pyx_t_1 = ((PyObject *)__pyx_v_ns_tags); __Pyx_INCREF(__pyx_t_1);
90539   } else {
90540     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90541   }
90542   for (;;) {
90543     if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
90544     __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++;
90545     if (PyTuple_CheckExact(__pyx_t_6) && likely(PyTuple_GET_SIZE(__pyx_t_6) == 2)) {
90546       PyObject* tuple = __pyx_t_6;
90547       __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
90548       __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
90549       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
90550       __Pyx_DECREF(__pyx_v_ns);
90551       __pyx_v_ns = __pyx_2;
90552       __pyx_2 = 0;
90553       __Pyx_DECREF(__pyx_v_tag);
90554       __pyx_v_tag = __pyx_3;
90555       __pyx_3 = 0;
90556     } else {
90557       __pyx_1 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90558       __Pyx_GOTREF(__pyx_1);
90559       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
90560       __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90561       __Pyx_GOTREF(__pyx_2);
90562       __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90563       __Pyx_GOTREF(__pyx_3);
90564       if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90565       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
90566       __Pyx_DECREF(__pyx_v_ns);
90567       __pyx_v_ns = __pyx_2;
90568       __pyx_2 = 0;
90569       __Pyx_DECREF(__pyx_v_tag);
90570       __pyx_v_tag = __pyx_3;
90571       __pyx_3 = 0;
90572     }
90573
90574     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":36
90575  *     ns_tags = _sortedTagList([ _getNsTag(attr)
90576  *                                for attr in <tuple>attribute_names ])
90577  *     ns_tags = [ (ns, tag if tag != '*' else None)             # <<<<<<<<<<<<<<
90578  *                 for ns, tag in ns_tags ]
90579  * 
90580  */
90581     __pyx_t_6 = PyObject_RichCompare(__pyx_v_tag, __pyx_kp_553, Py_NE); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90582     __Pyx_GOTREF(__pyx_t_6);
90583     __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90584     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
90585     if (__pyx_t_3) {
90586       __Pyx_INCREF(__pyx_v_tag);
90587       __pyx_1 = __pyx_v_tag;
90588     } else {
90589       __Pyx_INCREF(Py_None);
90590       __pyx_1 = Py_None;
90591     }
90592     __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90593     __Pyx_GOTREF(((PyObject *)__pyx_t_6));
90594     __Pyx_INCREF(__pyx_v_ns);
90595     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_ns);
90596     __Pyx_GIVEREF(__pyx_v_ns);
90597     PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_1);
90598     __Pyx_GIVEREF(__pyx_1);
90599     __pyx_1 = 0;
90600     __pyx_t_7 = PyList_Append(__pyx_t_5, (PyObject*)__pyx_t_6); if (unlikely(__pyx_t_7)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90601     __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
90602   }
90603   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
90604   __Pyx_INCREF(((PyObject *)__pyx_t_5));
90605   __Pyx_DECREF(((PyObject *)__pyx_v_ns_tags));
90606   __pyx_v_ns_tags = __pyx_t_5;
90607   __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
90608
90609   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":39
90610  *                 for ns, tag in ns_tags ]
90611  * 
90612  *     c_node = element._c_node             # <<<<<<<<<<<<<<
90613  *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_node, c_node, 1)
90614  *     if c_node.type == tree.XML_ELEMENT_NODE:
90615  */
90616   __pyx_v_c_node = __pyx_v_element->_c_node;
90617
90618   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":40
90619  * 
90620  *     c_node = element._c_node
90621  *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_node, c_node, 1)             # <<<<<<<<<<<<<<
90622  *     if c_node.type == tree.XML_ELEMENT_NODE:
90623  *         if c_node.properties is not NULL:
90624  */
90625   BEGIN_FOR_EACH_ELEMENT_FROM(__pyx_v_c_node, __pyx_v_c_node, 1);
90626
90627   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":41
90628  *     c_node = element._c_node
90629  *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_node, c_node, 1)
90630  *     if c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
90631  *         if c_node.properties is not NULL:
90632  *             for ns, tag in ns_tags:
90633  */
90634   __pyx_t_3 = (__pyx_v_c_node->type == XML_ELEMENT_NODE);
90635   if (__pyx_t_3) {
90636
90637     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":42
90638  *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_node, c_node, 1)
90639  *     if c_node.type == tree.XML_ELEMENT_NODE:
90640  *         if c_node.properties is not NULL:             # <<<<<<<<<<<<<<
90641  *             for ns, tag in ns_tags:
90642  *                 # must search attributes manually to make sure we only
90643  */
90644     __pyx_t_3 = (__pyx_v_c_node->properties != NULL);
90645     if (__pyx_t_3) {
90646
90647       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":43
90648  *     if c_node.type == tree.XML_ELEMENT_NODE:
90649  *         if c_node.properties is not NULL:
90650  *             for ns, tag in ns_tags:             # <<<<<<<<<<<<<<
90651  *                 # must search attributes manually to make sure we only
90652  *                 # match on blank tag names if there is no namespace
90653  */
90654       if (likely(((PyObject *)__pyx_v_ns_tags) != Py_None)) {
90655         __pyx_t_4 = 0; __pyx_t_5 = ((PyObject *)__pyx_v_ns_tags); __Pyx_INCREF(__pyx_t_5);
90656       } else {
90657         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90658       }
90659       for (;;) {
90660         if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_5)) break;
90661         __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
90662         if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 2)) {
90663           PyObject* tuple = __pyx_t_1;
90664           __pyx_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_3);
90665           __pyx_1 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_1);
90666           __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
90667           __Pyx_DECREF(__pyx_v_ns);
90668           __pyx_v_ns = __pyx_3;
90669           __pyx_3 = 0;
90670           __Pyx_DECREF(__pyx_v_tag);
90671           __pyx_v_tag = __pyx_1;
90672           __pyx_1 = 0;
90673         } else {
90674           __pyx_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90675           __Pyx_GOTREF(__pyx_2);
90676           __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
90677           __pyx_3 = __Pyx_UnpackItem(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90678           __Pyx_GOTREF(__pyx_3);
90679           __pyx_1 = __Pyx_UnpackItem(__pyx_2, 1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90680           __Pyx_GOTREF(__pyx_1);
90681           if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
90682           __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
90683           __Pyx_DECREF(__pyx_v_ns);
90684           __pyx_v_ns = __pyx_3;
90685           __pyx_3 = 0;
90686           __Pyx_DECREF(__pyx_v_tag);
90687           __pyx_v_tag = __pyx_1;
90688           __pyx_1 = 0;
90689         }
90690
90691         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":46
90692  *                 # must search attributes manually to make sure we only
90693  *                 # match on blank tag names if there is no namespace
90694  *                 c_name = NULL if tag is None else _cstr(tag)             # <<<<<<<<<<<<<<
90695  *                 c_attr = c_node.properties
90696  *                 while c_attr is not NULL:
90697  */
90698         __pyx_t_3 = (__pyx_v_tag == Py_None);
90699         if (__pyx_t_3) {
90700           __pyx_4 = NULL;
90701         } else {
90702           __pyx_4 = PyString_AS_STRING(__pyx_v_tag);
90703         }
90704         __pyx_v_c_name = __pyx_4;
90705
90706         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":47
90707  *                 # match on blank tag names if there is no namespace
90708  *                 c_name = NULL if tag is None else _cstr(tag)
90709  *                 c_attr = c_node.properties             # <<<<<<<<<<<<<<
90710  *                 while c_attr is not NULL:
90711  *                     if ns is None:
90712  */
90713         __pyx_v_c_attr = __pyx_v_c_node->properties;
90714
90715         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":48
90716  *                 c_name = NULL if tag is None else _cstr(tag)
90717  *                 c_attr = c_node.properties
90718  *                 while c_attr is not NULL:             # <<<<<<<<<<<<<<
90719  *                     if ns is None:
90720  *                         if c_attr.ns is NULL or c_attr.ns.href is NULL:
90721  */
90722         while (1) {
90723           __pyx_t_3 = (__pyx_v_c_attr != NULL);
90724           if (!__pyx_t_3) break;
90725
90726           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":49
90727  *                 c_attr = c_node.properties
90728  *                 while c_attr is not NULL:
90729  *                     if ns is None:             # <<<<<<<<<<<<<<
90730  *                         if c_attr.ns is NULL or c_attr.ns.href is NULL:
90731  *                             if c_name is NULL or \
90732  */
90733           __pyx_t_3 = (__pyx_v_ns == Py_None);
90734           if (__pyx_t_3) {
90735
90736             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":50
90737  *                 while c_attr is not NULL:
90738  *                     if ns is None:
90739  *                         if c_attr.ns is NULL or c_attr.ns.href is NULL:             # <<<<<<<<<<<<<<
90740  *                             if c_name is NULL or \
90741  *                                    cstd.strcmp(c_attr.name, c_name) == 0:
90742  */
90743             if (!(__pyx_v_c_attr->ns == NULL)) {
90744               __pyx_t_3 = (__pyx_v_c_attr->ns->href == NULL);
90745             } else {
90746               __pyx_t_3 = (__pyx_v_c_attr->ns == NULL);
90747             }
90748             if (__pyx_t_3) {
90749
90750               /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":51
90751  *                     if ns is None:
90752  *                         if c_attr.ns is NULL or c_attr.ns.href is NULL:
90753  *                             if c_name is NULL or \             # <<<<<<<<<<<<<<
90754  *                                    cstd.strcmp(c_attr.name, c_name) == 0:
90755  *                                 tree.xmlRemoveProp(c_attr)
90756  */
90757               if (!(__pyx_v_c_name == NULL)) {
90758
90759                 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":52
90760  *                         if c_attr.ns is NULL or c_attr.ns.href is NULL:
90761  *                             if c_name is NULL or \
90762  *                                    cstd.strcmp(c_attr.name, c_name) == 0:             # <<<<<<<<<<<<<<
90763  *                                 tree.xmlRemoveProp(c_attr)
90764  *                                 break
90765  */
90766                 __pyx_t_3 = (strcmp(__pyx_v_c_attr->name, __pyx_v_c_name) == 0);
90767               } else {
90768                 __pyx_t_3 = (__pyx_v_c_name == NULL);
90769               }
90770               if (__pyx_t_3) {
90771
90772                 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":53
90773  *                             if c_name is NULL or \
90774  *                                    cstd.strcmp(c_attr.name, c_name) == 0:
90775  *                                 tree.xmlRemoveProp(c_attr)             # <<<<<<<<<<<<<<
90776  *                                 break
90777  *                     elif c_attr.ns is not NULL and c_attr.ns.href is not NULL:
90778  */
90779                 xmlRemoveProp(__pyx_v_c_attr);
90780
90781                 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":54
90782  *                                    cstd.strcmp(c_attr.name, c_name) == 0:
90783  *                                 tree.xmlRemoveProp(c_attr)
90784  *                                 break             # <<<<<<<<<<<<<<
90785  *                     elif c_attr.ns is not NULL and c_attr.ns.href is not NULL:
90786  *                         if cstd.strcmp(c_attr.ns.href, _cstr(ns)) == 0:
90787  */
90788                 goto __pyx_L16_break;
90789                 goto __pyx_L19;
90790               }
90791               __pyx_L19:;
90792               goto __pyx_L18;
90793             }
90794             __pyx_L18:;
90795             goto __pyx_L17;
90796           }
90797
90798           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":55
90799  *                                 tree.xmlRemoveProp(c_attr)
90800  *                                 break
90801  *                     elif c_attr.ns is not NULL and c_attr.ns.href is not NULL:             # <<<<<<<<<<<<<<
90802  *                         if cstd.strcmp(c_attr.ns.href, _cstr(ns)) == 0:
90803  *                             if c_name is NULL or \
90804  */
90805           if ((__pyx_v_c_attr->ns != NULL)) {
90806             __pyx_t_3 = (__pyx_v_c_attr->ns->href != NULL);
90807           } else {
90808             __pyx_t_3 = (__pyx_v_c_attr->ns != NULL);
90809           }
90810           if (__pyx_t_3) {
90811
90812             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":56
90813  *                                 break
90814  *                     elif c_attr.ns is not NULL and c_attr.ns.href is not NULL:
90815  *                         if cstd.strcmp(c_attr.ns.href, _cstr(ns)) == 0:             # <<<<<<<<<<<<<<
90816  *                             if c_name is NULL or \
90817  *                                    cstd.strcmp(c_attr.name, c_name) == 0:
90818  */
90819             __pyx_t_3 = (strcmp(__pyx_v_c_attr->ns->href, PyString_AS_STRING(__pyx_v_ns)) == 0);
90820             if (__pyx_t_3) {
90821
90822               /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":57
90823  *                     elif c_attr.ns is not NULL and c_attr.ns.href is not NULL:
90824  *                         if cstd.strcmp(c_attr.ns.href, _cstr(ns)) == 0:
90825  *                             if c_name is NULL or \             # <<<<<<<<<<<<<<
90826  *                                    cstd.strcmp(c_attr.name, c_name) == 0:
90827  *                                 tree.xmlRemoveProp(c_attr)
90828  */
90829               if (!(__pyx_v_c_name == NULL)) {
90830
90831                 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":58
90832  *                         if cstd.strcmp(c_attr.ns.href, _cstr(ns)) == 0:
90833  *                             if c_name is NULL or \
90834  *                                    cstd.strcmp(c_attr.name, c_name) == 0:             # <<<<<<<<<<<<<<
90835  *                                 tree.xmlRemoveProp(c_attr)
90836  *                                 break
90837  */
90838                 __pyx_t_3 = (strcmp(__pyx_v_c_attr->name, __pyx_v_c_name) == 0);
90839               } else {
90840                 __pyx_t_3 = (__pyx_v_c_name == NULL);
90841               }
90842               if (__pyx_t_3) {
90843
90844                 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":59
90845  *                             if c_name is NULL or \
90846  *                                    cstd.strcmp(c_attr.name, c_name) == 0:
90847  *                                 tree.xmlRemoveProp(c_attr)             # <<<<<<<<<<<<<<
90848  *                                 break
90849  *                     c_attr = c_attr.next
90850  */
90851                 xmlRemoveProp(__pyx_v_c_attr);
90852
90853                 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":60
90854  *                                    cstd.strcmp(c_attr.name, c_name) == 0:
90855  *                                 tree.xmlRemoveProp(c_attr)
90856  *                                 break             # <<<<<<<<<<<<<<
90857  *                     c_attr = c_attr.next
90858  *     tree.END_FOR_EACH_ELEMENT_FROM(c_node)
90859  */
90860                 goto __pyx_L16_break;
90861                 goto __pyx_L21;
90862               }
90863               __pyx_L21:;
90864               goto __pyx_L20;
90865             }
90866             __pyx_L20:;
90867             goto __pyx_L17;
90868           }
90869           __pyx_L17:;
90870
90871           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":61
90872  *                                 tree.xmlRemoveProp(c_attr)
90873  *                                 break
90874  *                     c_attr = c_attr.next             # <<<<<<<<<<<<<<
90875  *     tree.END_FOR_EACH_ELEMENT_FROM(c_node)
90876  * 
90877  */
90878           __pyx_v_c_attr = __pyx_v_c_attr->next;
90879         }
90880         __pyx_L16_break:;
90881       }
90882       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
90883       goto __pyx_L12;
90884     }
90885     __pyx_L12:;
90886     goto __pyx_L11;
90887   }
90888   __pyx_L11:;
90889
90890   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":62
90891  *                                 break
90892  *                     c_attr = c_attr.next
90893  *     tree.END_FOR_EACH_ELEMENT_FROM(c_node)             # <<<<<<<<<<<<<<
90894  * 
90895  * def strip_elements(tree_or_element, *tag_names, bint with_tail=True):
90896  */
90897   END_FOR_EACH_ELEMENT_FROM(__pyx_v_c_node);
90898
90899   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
90900   goto __pyx_L0;
90901   __pyx_L1_error:;
90902   __Pyx_XDECREF(__pyx_1);
90903   __Pyx_XDECREF(__pyx_2);
90904   __Pyx_XDECREF(__pyx_3);
90905   __Pyx_XDECREF(__pyx_t_1);
90906   __Pyx_XDECREF(__pyx_t_5);
90907   __Pyx_XDECREF(__pyx_t_6);
90908   __Pyx_AddTraceback("lxml.etree.strip_attributes");
90909   __pyx_r = NULL;
90910   __pyx_L0:;
90911   __Pyx_DECREF(__pyx_v_attribute_names);
90912   __Pyx_DECREF((PyObject *)__pyx_v_element);
90913   __Pyx_DECREF(__pyx_v_ns_tags);
90914   __Pyx_DECREF(__pyx_v_ns);
90915   __Pyx_DECREF(__pyx_v_tag);
90916   __Pyx_DECREF(__pyx_v_attr);
90917   __Pyx_XGIVEREF(__pyx_r);
90918   __Pyx_FinishRefcountContext();
90919   return __pyx_r;
90920 }
90921
90922 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":64
90923  *     tree.END_FOR_EACH_ELEMENT_FROM(c_node)
90924  * 
90925  * def strip_elements(tree_or_element, *tag_names, bint with_tail=True):             # <<<<<<<<<<<<<<
90926  *     u"""strip_elements(tree_or_element, *tag_names, with_tail=True)
90927  * 
90928  */
90929
90930 static PyObject *__pyx_pf_4lxml_5etree_strip_elements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
90931 static char __pyx_doc_4lxml_5etree_strip_elements[] = "strip_elements(tree_or_element, *tag_names, with_tail=True)\n\n    Delete all elements with the provided tag names from a tree or\n    subtree.  This will remove the elements and their entire subtree,\n    including all their attributes, text content and descendants.  It\n    will also remove the tail text of the element unless you\n    explicitly set the ``with_tail`` option to False.\n\n    Note that this will not delete the element (or ElementTree root\n    element) that you passed even if it matches.  It will only treat\n    its descendants.  If you want to include the root element, check\n    its tag name directly before even calling this function.\n\n    Example usage::\n\n        strip_elements(some_element,\n            'simpletagname',             # non-namespaced tag\n            '{http://some/ns}tagname',   # namespaced tag\n            '{http://some/other/ns}*'    # any tag from a namespace\n            Comment                      # comments\n            )\n    ";
90932 static PyObject *__pyx_pf_4lxml_5etree_strip_elements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
90933   PyObject *__pyx_v_tree_or_element = 0;
90934   int __pyx_v_with_tail;
90935   PyObject *__pyx_v_tag_names = 0;
90936   xmlNode *__pyx_v_c_node;
90937   xmlNode *__pyx_v_c_child;
90938   xmlNode *__pyx_v_c_next;
90939   char *__pyx_v_c_href;
90940   char *__pyx_v_c_name;
90941   struct LxmlElement *__pyx_v_element;
90942   struct LxmlDocument *__pyx_v_doc;
90943   PyObject *__pyx_v_ns_tags;
90944   int __pyx_v_strip_comments;
90945   int __pyx_v_strip_pis;
90946   int __pyx_v_strip_entities;
90947   PyObject *__pyx_v_ns;
90948   PyObject *__pyx_v_tag;
90949   PyObject *__pyx_r = NULL;
90950   PyObject *__pyx_1 = 0;
90951   PyObject *__pyx_2 = 0;
90952   PyObject *__pyx_3 = 0;
90953   void *__pyx_4;
90954   PyObject *__pyx_t_1 = NULL;
90955   int __pyx_t_2;
90956   int __pyx_t_3;
90957   Py_ssize_t __pyx_t_4;
90958   PyObject *__pyx_t_5 = NULL;
90959   int __pyx_t_6;
90960   int __pyx_t_7;
90961   int __pyx_t_8;
90962   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_tree_or_element,&__pyx_kp_with_tail,0};
90963   __Pyx_SetupRefcountContext("strip_elements");
90964   __pyx_self = __pyx_self;
90965   if (PyTuple_GET_SIZE(__pyx_args) > 1) {
90966     __pyx_v_tag_names = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); __Pyx_GOTREF(__pyx_v_tag_names);
90967     if (unlikely(!__pyx_v_tag_names)) return NULL;
90968   } else {
90969     __pyx_v_tag_names = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
90970   }
90971   if (unlikely(__pyx_kwds)) {
90972     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
90973     PyObject* values[2] = {0,0};
90974     switch (PyTuple_GET_SIZE(__pyx_args)) {
90975       default:
90976       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
90977       case  0: break;
90978     }
90979     switch (PyTuple_GET_SIZE(__pyx_args)) {
90980       case  0:
90981       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_tree_or_element);
90982       if (likely(values[0])) kw_args--;
90983       else goto __pyx_L5_argtuple_error;
90984     }
90985     while (kw_args > 0) {
90986       PyObject* value;
90987       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_with_tail);
90988       if (value) { values[1] = value; if (!(--kw_args)) break; }
90989       break;
90990     }
90991     if (unlikely(kw_args > 0)) {
90992       const Py_ssize_t used_pos_args = (PyTuple_GET_SIZE(__pyx_args) < 1) ? PyTuple_GET_SIZE(__pyx_args) : 1;
90993       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "strip_elements") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
90994     }
90995     __pyx_v_tree_or_element = values[0];
90996     if (values[1]) {
90997       __pyx_v_with_tail = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_with_tail == (int)-1))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
90998     } else {
90999       __pyx_v_with_tail = 1;
91000     }
91001   } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
91002     goto __pyx_L5_argtuple_error;
91003   } else {
91004     __pyx_v_tree_or_element = PyTuple_GET_ITEM(__pyx_args, 0);
91005     __pyx_v_with_tail = 1;
91006   }
91007   goto __pyx_L4_argument_unpacking_done;
91008   __pyx_L5_argtuple_error:;
91009   __Pyx_RaiseArgtupleInvalid("strip_elements", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
91010   __pyx_L3_error:;
91011   __Pyx_DECREF(__pyx_v_tag_names);
91012   __Pyx_AddTraceback("lxml.etree.strip_elements");
91013   return NULL;
91014   __pyx_L4_argument_unpacking_done:;
91015   __pyx_v_element = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
91016   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
91017   __pyx_v_ns_tags = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
91018   __pyx_v_ns = Py_None; __Pyx_INCREF(Py_None);
91019   __pyx_v_tag = Py_None; __Pyx_INCREF(Py_None);
91020
91021   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":97
91022  *     cdef bint strip_comments, strip_pis, strip_entities
91023  * 
91024  *     doc = _documentOrRaise(tree_or_element)             # <<<<<<<<<<<<<<
91025  *     element = _rootNodeOrRaise(tree_or_element)
91026  *     if not tag_names: return
91027  */
91028   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v_tree_or_element)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
91029   __Pyx_GOTREF(__pyx_t_1);
91030   __Pyx_DECREF(((PyObject *)__pyx_v_doc));
91031   __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_1);
91032   __pyx_t_1 = 0;
91033
91034   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":98
91035  * 
91036  *     doc = _documentOrRaise(tree_or_element)
91037  *     element = _rootNodeOrRaise(tree_or_element)             # <<<<<<<<<<<<<<
91038  *     if not tag_names: return
91039  * 
91040  */
91041   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v_tree_or_element)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
91042   __Pyx_GOTREF(__pyx_t_1);
91043   __Pyx_DECREF(((PyObject *)__pyx_v_element));
91044   __pyx_v_element = ((struct LxmlElement *)__pyx_t_1);
91045   __pyx_t_1 = 0;
91046
91047   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":99
91048  *     doc = _documentOrRaise(tree_or_element)
91049  *     element = _rootNodeOrRaise(tree_or_element)
91050  *     if not tag_names: return             # <<<<<<<<<<<<<<
91051  * 
91052  *     ns_tags = _filterSpecialTagNames(
91053  */
91054   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_tag_names); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
91055   __pyx_t_3 = (!__pyx_t_2);
91056   if (__pyx_t_3) {
91057     __Pyx_XDECREF(__pyx_r);
91058     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
91059     goto __pyx_L0;
91060     goto __pyx_L6;
91061   }
91062   __pyx_L6:;
91063
91064   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":102
91065  * 
91066  *     ns_tags = _filterSpecialTagNames(
91067  *         tag_names, &strip_comments, &strip_pis, &strip_entities)             # <<<<<<<<<<<<<<
91068  * 
91069  *     c_node = element._c_node
91070  */
91071   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__filterSpecialTagNames(__pyx_v_tag_names, (&__pyx_v_strip_comments), (&__pyx_v_strip_pis), (&__pyx_v_strip_entities))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
91072   __Pyx_GOTREF(__pyx_t_1);
91073   __Pyx_DECREF(((PyObject *)__pyx_v_ns_tags));
91074   __pyx_v_ns_tags = ((PyObject *)__pyx_t_1);
91075   __pyx_t_1 = 0;
91076
91077   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":104
91078  *         tag_names, &strip_comments, &strip_pis, &strip_entities)
91079  * 
91080  *     c_node = element._c_node             # <<<<<<<<<<<<<<
91081  *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_node, c_node, 1)
91082  *     if c_node.type == tree.XML_ELEMENT_NODE:
91083  */
91084   __pyx_v_c_node = __pyx_v_element->_c_node;
91085
91086   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":105
91087  * 
91088  *     c_node = element._c_node
91089  *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_node, c_node, 1)             # <<<<<<<<<<<<<<
91090  *     if c_node.type == tree.XML_ELEMENT_NODE:
91091  *         # we run through the children here to prevent any problems
91092  */
91093   BEGIN_FOR_EACH_ELEMENT_FROM(__pyx_v_c_node, __pyx_v_c_node, 1);
91094
91095   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":106
91096  *     c_node = element._c_node
91097  *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_node, c_node, 1)
91098  *     if c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
91099  *         # we run through the children here to prevent any problems
91100  *         # with the tree iteration which would occur if we unlinked the
91101  */
91102   __pyx_t_3 = (__pyx_v_c_node->type == XML_ELEMENT_NODE);
91103   if (__pyx_t_3) {
91104
91105     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":110
91106  *         # with the tree iteration which would occur if we unlinked the
91107  *         # c_node itself
91108  *         c_child = _findChildForwards(c_node, 0)             # <<<<<<<<<<<<<<
91109  *         while c_child is not NULL:
91110  *             if c_child.type == tree.XML_ELEMENT_NODE:
91111  */
91112     __pyx_v_c_child = __pyx_f_4lxml_5etree__findChildForwards(__pyx_v_c_node, 0);
91113
91114     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":111
91115  *         # c_node itself
91116  *         c_child = _findChildForwards(c_node, 0)
91117  *         while c_child is not NULL:             # <<<<<<<<<<<<<<
91118  *             if c_child.type == tree.XML_ELEMENT_NODE:
91119  *                 for ns, tag in ns_tags:
91120  */
91121     while (1) {
91122       __pyx_t_3 = (__pyx_v_c_child != NULL);
91123       if (!__pyx_t_3) break;
91124
91125       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":112
91126  *         c_child = _findChildForwards(c_node, 0)
91127  *         while c_child is not NULL:
91128  *             if c_child.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
91129  *                 for ns, tag in ns_tags:
91130  *                     if ns is None:
91131  */
91132       __pyx_t_3 = (__pyx_v_c_child->type == XML_ELEMENT_NODE);
91133       if (__pyx_t_3) {
91134
91135         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":113
91136  *         while c_child is not NULL:
91137  *             if c_child.type == tree.XML_ELEMENT_NODE:
91138  *                 for ns, tag in ns_tags:             # <<<<<<<<<<<<<<
91139  *                     if ns is None:
91140  *                         # _tagMatches() considers NULL a wildcard
91141  */
91142         if (likely(((PyObject *)__pyx_v_ns_tags) != Py_None)) {
91143           __pyx_t_4 = 0; __pyx_t_1 = ((PyObject *)__pyx_v_ns_tags); __Pyx_INCREF(__pyx_t_1);
91144         } else {
91145           PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
91146         }
91147         for (;;) {
91148           if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
91149           __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
91150           if (PyTuple_CheckExact(__pyx_t_5) && likely(PyTuple_GET_SIZE(__pyx_t_5) == 2)) {
91151             PyObject* tuple = __pyx_t_5;
91152             __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
91153             __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
91154             __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
91155             __Pyx_DECREF(__pyx_v_ns);
91156             __pyx_v_ns = __pyx_2;
91157             __pyx_2 = 0;
91158             __Pyx_DECREF(__pyx_v_tag);
91159             __pyx_v_tag = __pyx_3;
91160             __pyx_3 = 0;
91161           } else {
91162             __pyx_1 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
91163             __Pyx_GOTREF(__pyx_1);
91164             __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
91165             __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
91166             __Pyx_GOTREF(__pyx_2);
91167             __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
91168             __Pyx_GOTREF(__pyx_3);
91169             if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
91170             __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
91171             __Pyx_DECREF(__pyx_v_ns);
91172             __pyx_v_ns = __pyx_2;
91173             __pyx_2 = 0;
91174             __Pyx_DECREF(__pyx_v_tag);
91175             __pyx_v_tag = __pyx_3;
91176             __pyx_3 = 0;
91177           }
91178
91179           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":114
91180  *             if c_child.type == tree.XML_ELEMENT_NODE:
91181  *                 for ns, tag in ns_tags:
91182  *                     if ns is None:             # <<<<<<<<<<<<<<
91183  *                         # _tagMatches() considers NULL a wildcard
91184  *                         # match but we don't
91185  */
91186           __pyx_t_3 = (__pyx_v_ns == Py_None);
91187           if (__pyx_t_3) {
91188
91189             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":117
91190  *                         # _tagMatches() considers NULL a wildcard
91191  *                         # match but we don't
91192  *                         if c_child.ns is not NULL and c_child.ns.href is not NULL:             # <<<<<<<<<<<<<<
91193  *                             continue
91194  *                         c_href = NULL
91195  */
91196             if ((__pyx_v_c_child->ns != NULL)) {
91197               __pyx_t_3 = (__pyx_v_c_child->ns->href != NULL);
91198             } else {
91199               __pyx_t_3 = (__pyx_v_c_child->ns != NULL);
91200             }
91201             if (__pyx_t_3) {
91202
91203               /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":118
91204  *                         # match but we don't
91205  *                         if c_child.ns is not NULL and c_child.ns.href is not NULL:
91206  *                             continue             # <<<<<<<<<<<<<<
91207  *                         c_href = NULL
91208  *                     else:
91209  */
91210               goto __pyx_L11_continue;
91211               goto __pyx_L14;
91212             }
91213             __pyx_L14:;
91214
91215             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":119
91216  *                         if c_child.ns is not NULL and c_child.ns.href is not NULL:
91217  *                             continue
91218  *                         c_href = NULL             # <<<<<<<<<<<<<<
91219  *                     else:
91220  *                         c_href = _cstr(ns)
91221  */
91222             __pyx_v_c_href = NULL;
91223             goto __pyx_L13;
91224           }
91225           /*else*/ {
91226
91227             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":121
91228  *                         c_href = NULL
91229  *                     else:
91230  *                         c_href = _cstr(ns)             # <<<<<<<<<<<<<<
91231  *                     c_name = NULL if tag is None else _cstr(tag)
91232  *                     if _tagMatches(c_child, c_href, c_name):
91233  */
91234             __pyx_v_c_href = PyString_AS_STRING(__pyx_v_ns);
91235           }
91236           __pyx_L13:;
91237
91238           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":122
91239  *                     else:
91240  *                         c_href = _cstr(ns)
91241  *                     c_name = NULL if tag is None else _cstr(tag)             # <<<<<<<<<<<<<<
91242  *                     if _tagMatches(c_child, c_href, c_name):
91243  *                         c_next = _nextElement(c_child)
91244  */
91245           __pyx_t_3 = (__pyx_v_tag == Py_None);
91246           if (__pyx_t_3) {
91247             __pyx_4 = NULL;
91248           } else {
91249             __pyx_4 = PyString_AS_STRING(__pyx_v_tag);
91250           }
91251           __pyx_v_c_name = __pyx_4;
91252
91253           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":123
91254  *                         c_href = _cstr(ns)
91255  *                     c_name = NULL if tag is None else _cstr(tag)
91256  *                     if _tagMatches(c_child, c_href, c_name):             # <<<<<<<<<<<<<<
91257  *                         c_next = _nextElement(c_child)
91258  *                         if not with_tail:
91259  */
91260           __pyx_t_3 = __pyx_f_4lxml_5etree__tagMatches(__pyx_v_c_child, __pyx_v_c_href, __pyx_v_c_name);
91261           if (__pyx_t_3) {
91262
91263             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":124
91264  *                     c_name = NULL if tag is None else _cstr(tag)
91265  *                     if _tagMatches(c_child, c_href, c_name):
91266  *                         c_next = _nextElement(c_child)             # <<<<<<<<<<<<<<
91267  *                         if not with_tail:
91268  *                             tree.xmlUnlinkNode(c_child)
91269  */
91270             __pyx_v_c_next = __pyx_f_4lxml_5etree__nextElement(__pyx_v_c_child);
91271
91272             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":125
91273  *                     if _tagMatches(c_child, c_href, c_name):
91274  *                         c_next = _nextElement(c_child)
91275  *                         if not with_tail:             # <<<<<<<<<<<<<<
91276  *                             tree.xmlUnlinkNode(c_child)
91277  *                         _removeNode(doc, c_child)
91278  */
91279             __pyx_t_3 = (!__pyx_v_with_tail);
91280             if (__pyx_t_3) {
91281
91282               /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":126
91283  *                         c_next = _nextElement(c_child)
91284  *                         if not with_tail:
91285  *                             tree.xmlUnlinkNode(c_child)             # <<<<<<<<<<<<<<
91286  *                         _removeNode(doc, c_child)
91287  *                         c_child = c_next
91288  */
91289               xmlUnlinkNode(__pyx_v_c_child);
91290               goto __pyx_L16;
91291             }
91292             __pyx_L16:;
91293
91294             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":127
91295  *                         if not with_tail:
91296  *                             tree.xmlUnlinkNode(c_child)
91297  *                         _removeNode(doc, c_child)             # <<<<<<<<<<<<<<
91298  *                         c_child = c_next
91299  *                         break
91300  */
91301             __pyx_t_6 = __pyx_f_4lxml_5etree__removeNode(__pyx_v_doc, __pyx_v_c_child); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
91302
91303             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":128
91304  *                             tree.xmlUnlinkNode(c_child)
91305  *                         _removeNode(doc, c_child)
91306  *                         c_child = c_next             # <<<<<<<<<<<<<<
91307  *                         break
91308  *                 else:
91309  */
91310             __pyx_v_c_child = __pyx_v_c_next;
91311
91312             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":129
91313  *                         _removeNode(doc, c_child)
91314  *                         c_child = c_next
91315  *                         break             # <<<<<<<<<<<<<<
91316  *                 else:
91317  *                     c_child = _nextElement(c_child)
91318  */
91319             goto __pyx_L12_break;
91320             goto __pyx_L15;
91321           }
91322           __pyx_L15:;
91323           __pyx_L11_continue:;
91324         }
91325         /*else*/ {
91326
91327           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":131
91328  *                         break
91329  *                 else:
91330  *                     c_child = _nextElement(c_child)             # <<<<<<<<<<<<<<
91331  *             elif strip_comments and c_child.type == tree.XML_COMMENT_NODE or \
91332  *                      strip_pis and c_child.type == tree.XML_PI_NODE or \
91333  */
91334           __pyx_v_c_child = __pyx_f_4lxml_5etree__nextElement(__pyx_v_c_child);
91335         }
91336         __pyx_L12_break:;
91337         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
91338         goto __pyx_L10;
91339       }
91340
91341       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":132
91342  *                 else:
91343  *                     c_child = _nextElement(c_child)
91344  *             elif strip_comments and c_child.type == tree.XML_COMMENT_NODE or \             # <<<<<<<<<<<<<<
91345  *                      strip_pis and c_child.type == tree.XML_PI_NODE or \
91346  *                      strip_entities and c_child.type == tree.XML_ENTITY_REF_NODE:
91347  */
91348       if (__pyx_v_strip_comments) {
91349         __pyx_t_3 = (__pyx_v_c_child->type == XML_COMMENT_NODE);
91350       } else {
91351         __pyx_t_3 = __pyx_v_strip_comments;
91352       }
91353       if (!__pyx_t_3) {
91354
91355         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":133
91356  *                     c_child = _nextElement(c_child)
91357  *             elif strip_comments and c_child.type == tree.XML_COMMENT_NODE or \
91358  *                      strip_pis and c_child.type == tree.XML_PI_NODE or \             # <<<<<<<<<<<<<<
91359  *                      strip_entities and c_child.type == tree.XML_ENTITY_REF_NODE:
91360  *                 c_next = _nextElement(c_child)
91361  */
91362         if (__pyx_v_strip_pis) {
91363           __pyx_t_2 = (__pyx_v_c_child->type == XML_PI_NODE);
91364         } else {
91365           __pyx_t_2 = __pyx_v_strip_pis;
91366         }
91367         if (!__pyx_t_2) {
91368
91369           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":134
91370  *             elif strip_comments and c_child.type == tree.XML_COMMENT_NODE or \
91371  *                      strip_pis and c_child.type == tree.XML_PI_NODE or \
91372  *                      strip_entities and c_child.type == tree.XML_ENTITY_REF_NODE:             # <<<<<<<<<<<<<<
91373  *                 c_next = _nextElement(c_child)
91374  *                 if with_tail:
91375  */
91376           if (__pyx_v_strip_entities) {
91377             __pyx_t_7 = (__pyx_v_c_child->type == XML_ENTITY_REF_NODE);
91378           } else {
91379             __pyx_t_7 = __pyx_v_strip_entities;
91380           }
91381           __pyx_t_8 = __pyx_t_7;
91382         } else {
91383           __pyx_t_8 = __pyx_t_2;
91384         }
91385         __pyx_t_2 = __pyx_t_8;
91386       } else {
91387         __pyx_t_2 = __pyx_t_3;
91388       }
91389       if (__pyx_t_2) {
91390
91391         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":135
91392  *                      strip_pis and c_child.type == tree.XML_PI_NODE or \
91393  *                      strip_entities and c_child.type == tree.XML_ENTITY_REF_NODE:
91394  *                 c_next = _nextElement(c_child)             # <<<<<<<<<<<<<<
91395  *                 if with_tail:
91396  *                     _removeText(c_next)
91397  */
91398         __pyx_v_c_next = __pyx_f_4lxml_5etree__nextElement(__pyx_v_c_child);
91399
91400         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":136
91401  *                      strip_entities and c_child.type == tree.XML_ENTITY_REF_NODE:
91402  *                 c_next = _nextElement(c_child)
91403  *                 if with_tail:             # <<<<<<<<<<<<<<
91404  *                     _removeText(c_next)
91405  *                 tree.xmlUnlinkNode(c_child)
91406  */
91407         __pyx_t_2 = __pyx_v_with_tail;
91408         if (__pyx_t_2) {
91409
91410           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":137
91411  *                 c_next = _nextElement(c_child)
91412  *                 if with_tail:
91413  *                     _removeText(c_next)             # <<<<<<<<<<<<<<
91414  *                 tree.xmlUnlinkNode(c_child)
91415  *                 attemptDeallocation(c_child)
91416  */
91417           __pyx_f_4lxml_5etree__removeText(__pyx_v_c_next);
91418           goto __pyx_L17;
91419         }
91420         __pyx_L17:;
91421
91422         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":138
91423  *                 if with_tail:
91424  *                     _removeText(c_next)
91425  *                 tree.xmlUnlinkNode(c_child)             # <<<<<<<<<<<<<<
91426  *                 attemptDeallocation(c_child)
91427  *                 c_child = c_next
91428  */
91429         xmlUnlinkNode(__pyx_v_c_child);
91430
91431         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":139
91432  *                     _removeText(c_next)
91433  *                 tree.xmlUnlinkNode(c_child)
91434  *                 attemptDeallocation(c_child)             # <<<<<<<<<<<<<<
91435  *                 c_child = c_next
91436  *             else:
91437  */
91438         __pyx_f_4lxml_5etree_attemptDeallocation(__pyx_v_c_child);
91439
91440         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":140
91441  *                 tree.xmlUnlinkNode(c_child)
91442  *                 attemptDeallocation(c_child)
91443  *                 c_child = c_next             # <<<<<<<<<<<<<<
91444  *             else:
91445  *                 c_child = _nextElement(c_child)
91446  */
91447         __pyx_v_c_child = __pyx_v_c_next;
91448         goto __pyx_L10;
91449       }
91450       /*else*/ {
91451
91452         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":142
91453  *                 c_child = c_next
91454  *             else:
91455  *                 c_child = _nextElement(c_child)             # <<<<<<<<<<<<<<
91456  *     tree.END_FOR_EACH_ELEMENT_FROM(c_node)
91457  * 
91458  */
91459         __pyx_v_c_child = __pyx_f_4lxml_5etree__nextElement(__pyx_v_c_child);
91460       }
91461       __pyx_L10:;
91462     }
91463     goto __pyx_L7;
91464   }
91465   __pyx_L7:;
91466
91467   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":143
91468  *             else:
91469  *                 c_child = _nextElement(c_child)
91470  *     tree.END_FOR_EACH_ELEMENT_FROM(c_node)             # <<<<<<<<<<<<<<
91471  * 
91472  * def strip_tags(tree_or_element, *tag_names):
91473  */
91474   END_FOR_EACH_ELEMENT_FROM(__pyx_v_c_node);
91475
91476   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
91477   goto __pyx_L0;
91478   __pyx_L1_error:;
91479   __Pyx_XDECREF(__pyx_1);
91480   __Pyx_XDECREF(__pyx_2);
91481   __Pyx_XDECREF(__pyx_3);
91482   __Pyx_XDECREF(__pyx_t_1);
91483   __Pyx_XDECREF(__pyx_t_5);
91484   __Pyx_AddTraceback("lxml.etree.strip_elements");
91485   __pyx_r = NULL;
91486   __pyx_L0:;
91487   __Pyx_DECREF(__pyx_v_tag_names);
91488   __Pyx_DECREF((PyObject *)__pyx_v_element);
91489   __Pyx_DECREF((PyObject *)__pyx_v_doc);
91490   __Pyx_DECREF(__pyx_v_ns_tags);
91491   __Pyx_DECREF(__pyx_v_ns);
91492   __Pyx_DECREF(__pyx_v_tag);
91493   __Pyx_XGIVEREF(__pyx_r);
91494   __Pyx_FinishRefcountContext();
91495   return __pyx_r;
91496 }
91497
91498 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":145
91499  *     tree.END_FOR_EACH_ELEMENT_FROM(c_node)
91500  * 
91501  * def strip_tags(tree_or_element, *tag_names):             # <<<<<<<<<<<<<<
91502  *     u"""strip_tags(tree_or_element, *tag_names)
91503  * 
91504  */
91505
91506 static PyObject *__pyx_pf_4lxml_5etree_strip_tags(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
91507 static char __pyx_doc_4lxml_5etree_strip_tags[] = "strip_tags(tree_or_element, *tag_names)\n\n    Delete all elements with the provided tag names from a tree or\n    subtree.  This will remove the elements and their attributes, but\n    *not* their text/tail content or descendants.  Instead, it will\n    merge the text content and children of the element into its\n    parent.\n\n    Note that this will not delete the element (or ElementTree root\n    element) that you passed even if it matches.  It will only treat\n    its descendants.\n\n    Example usage::\n\n        strip_tags(some_element,\n            'simpletagname',             # non-namespaced tag\n            '{http://some/ns}tagname',   # namespaced tag\n            '{http://some/other/ns}*'    # any tag from a namespace\n            Comment                      # comments (including their text!)\n            )\n    ";
91508 static PyObject *__pyx_pf_4lxml_5etree_strip_tags(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
91509   PyObject *__pyx_v_tree_or_element = 0;
91510   PyObject *__pyx_v_tag_names = 0;
91511   xmlNode *__pyx_v_c_node;
91512   xmlNode *__pyx_v_c_child;
91513   xmlNode *__pyx_v_c_next;
91514   char *__pyx_v_c_href;
91515   char *__pyx_v_c_name;
91516   struct LxmlElement *__pyx_v_element;
91517   struct LxmlDocument *__pyx_v_doc;
91518   PyObject *__pyx_v_ns_tags;
91519   int __pyx_v_strip_comments;
91520   int __pyx_v_strip_pis;
91521   int __pyx_v_strip_entities;
91522   PyObject *__pyx_v_ns;
91523   PyObject *__pyx_v_tag;
91524   PyObject *__pyx_r = NULL;
91525   PyObject *__pyx_1 = 0;
91526   PyObject *__pyx_2 = 0;
91527   PyObject *__pyx_3 = 0;
91528   void *__pyx_4;
91529   PyObject *__pyx_t_1 = NULL;
91530   int __pyx_t_2;
91531   int __pyx_t_3;
91532   Py_ssize_t __pyx_t_4;
91533   PyObject *__pyx_t_5 = NULL;
91534   int __pyx_t_6;
91535   int __pyx_t_7;
91536   int __pyx_t_8;
91537   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_tree_or_element,0};
91538   __Pyx_SetupRefcountContext("strip_tags");
91539   __pyx_self = __pyx_self;
91540   if (PyTuple_GET_SIZE(__pyx_args) > 1) {
91541     __pyx_v_tag_names = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); __Pyx_GOTREF(__pyx_v_tag_names);
91542     if (unlikely(!__pyx_v_tag_names)) return NULL;
91543   } else {
91544     __pyx_v_tag_names = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
91545   }
91546   if (unlikely(__pyx_kwds)) {
91547     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
91548     PyObject* values[1] = {0};
91549     switch (PyTuple_GET_SIZE(__pyx_args)) {
91550       default:
91551       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
91552       case  0: break;
91553     }
91554     switch (PyTuple_GET_SIZE(__pyx_args)) {
91555       case  0:
91556       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_tree_or_element);
91557       if (likely(values[0])) kw_args--;
91558       else goto __pyx_L5_argtuple_error;
91559     }
91560     if (unlikely(kw_args > 0)) {
91561       const Py_ssize_t used_pos_args = (PyTuple_GET_SIZE(__pyx_args) < 1) ? PyTuple_GET_SIZE(__pyx_args) : 1;
91562       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "strip_tags") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
91563     }
91564     __pyx_v_tree_or_element = values[0];
91565   } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
91566     goto __pyx_L5_argtuple_error;
91567   } else {
91568     __pyx_v_tree_or_element = PyTuple_GET_ITEM(__pyx_args, 0);
91569   }
91570   goto __pyx_L4_argument_unpacking_done;
91571   __pyx_L5_argtuple_error:;
91572   __Pyx_RaiseArgtupleInvalid("strip_tags", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
91573   __pyx_L3_error:;
91574   __Pyx_DECREF(__pyx_v_tag_names);
91575   __Pyx_AddTraceback("lxml.etree.strip_tags");
91576   return NULL;
91577   __pyx_L4_argument_unpacking_done:;
91578   __pyx_v_element = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
91579   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
91580   __pyx_v_ns_tags = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
91581   __pyx_v_ns = Py_None; __Pyx_INCREF(Py_None);
91582   __pyx_v_tag = Py_None; __Pyx_INCREF(Py_None);
91583
91584   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":177
91585  *     cdef bint strip_comments, strip_pis, strip_entities
91586  * 
91587  *     doc = _documentOrRaise(tree_or_element)             # <<<<<<<<<<<<<<
91588  *     element = _rootNodeOrRaise(tree_or_element)
91589  *     if not tag_names: return
91590  */
91591   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v_tree_or_element)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
91592   __Pyx_GOTREF(__pyx_t_1);
91593   __Pyx_DECREF(((PyObject *)__pyx_v_doc));
91594   __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_1);
91595   __pyx_t_1 = 0;
91596
91597   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":178
91598  * 
91599  *     doc = _documentOrRaise(tree_or_element)
91600  *     element = _rootNodeOrRaise(tree_or_element)             # <<<<<<<<<<<<<<
91601  *     if not tag_names: return
91602  * 
91603  */
91604   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v_tree_or_element)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
91605   __Pyx_GOTREF(__pyx_t_1);
91606   __Pyx_DECREF(((PyObject *)__pyx_v_element));
91607   __pyx_v_element = ((struct LxmlElement *)__pyx_t_1);
91608   __pyx_t_1 = 0;
91609
91610   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":179
91611  *     doc = _documentOrRaise(tree_or_element)
91612  *     element = _rootNodeOrRaise(tree_or_element)
91613  *     if not tag_names: return             # <<<<<<<<<<<<<<
91614  * 
91615  *     ns_tags = _filterSpecialTagNames(
91616  */
91617   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_tag_names); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
91618   __pyx_t_3 = (!__pyx_t_2);
91619   if (__pyx_t_3) {
91620     __Pyx_XDECREF(__pyx_r);
91621     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
91622     goto __pyx_L0;
91623     goto __pyx_L6;
91624   }
91625   __pyx_L6:;
91626
91627   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":182
91628  * 
91629  *     ns_tags = _filterSpecialTagNames(
91630  *         tag_names, &strip_comments, &strip_pis, &strip_entities)             # <<<<<<<<<<<<<<
91631  * 
91632  *     c_node = element._c_node
91633  */
91634   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__filterSpecialTagNames(__pyx_v_tag_names, (&__pyx_v_strip_comments), (&__pyx_v_strip_pis), (&__pyx_v_strip_entities))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
91635   __Pyx_GOTREF(__pyx_t_1);
91636   __Pyx_DECREF(((PyObject *)__pyx_v_ns_tags));
91637   __pyx_v_ns_tags = ((PyObject *)__pyx_t_1);
91638   __pyx_t_1 = 0;
91639
91640   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":184
91641  *         tag_names, &strip_comments, &strip_pis, &strip_entities)
91642  * 
91643  *     c_node = element._c_node             # <<<<<<<<<<<<<<
91644  *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_node, c_node, 1)
91645  *     if c_node.type == tree.XML_ELEMENT_NODE:
91646  */
91647   __pyx_v_c_node = __pyx_v_element->_c_node;
91648
91649   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":185
91650  * 
91651  *     c_node = element._c_node
91652  *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_node, c_node, 1)             # <<<<<<<<<<<<<<
91653  *     if c_node.type == tree.XML_ELEMENT_NODE:
91654  *         # we run through the children here to prevent any problems
91655  */
91656   BEGIN_FOR_EACH_ELEMENT_FROM(__pyx_v_c_node, __pyx_v_c_node, 1);
91657
91658   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":186
91659  *     c_node = element._c_node
91660  *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_node, c_node, 1)
91661  *     if c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
91662  *         # we run through the children here to prevent any problems
91663  *         # with the tree iteration which would occur if we unlinked the
91664  */
91665   __pyx_t_3 = (__pyx_v_c_node->type == XML_ELEMENT_NODE);
91666   if (__pyx_t_3) {
91667
91668     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":190
91669  *         # with the tree iteration which would occur if we unlinked the
91670  *         # c_node itself
91671  *         c_child = _findChildForwards(c_node, 0)             # <<<<<<<<<<<<<<
91672  *         while c_child is not NULL:
91673  *             if c_child.type == tree.XML_ELEMENT_NODE:
91674  */
91675     __pyx_v_c_child = __pyx_f_4lxml_5etree__findChildForwards(__pyx_v_c_node, 0);
91676
91677     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":191
91678  *         # c_node itself
91679  *         c_child = _findChildForwards(c_node, 0)
91680  *         while c_child is not NULL:             # <<<<<<<<<<<<<<
91681  *             if c_child.type == tree.XML_ELEMENT_NODE:
91682  *                 for ns, tag in ns_tags:
91683  */
91684     while (1) {
91685       __pyx_t_3 = (__pyx_v_c_child != NULL);
91686       if (!__pyx_t_3) break;
91687
91688       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":192
91689  *         c_child = _findChildForwards(c_node, 0)
91690  *         while c_child is not NULL:
91691  *             if c_child.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
91692  *                 for ns, tag in ns_tags:
91693  *                     if ns is None:
91694  */
91695       __pyx_t_3 = (__pyx_v_c_child->type == XML_ELEMENT_NODE);
91696       if (__pyx_t_3) {
91697
91698         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":193
91699  *         while c_child is not NULL:
91700  *             if c_child.type == tree.XML_ELEMENT_NODE:
91701  *                 for ns, tag in ns_tags:             # <<<<<<<<<<<<<<
91702  *                     if ns is None:
91703  *                         # _tagMatches() considers NULL a wildcard
91704  */
91705         if (likely(((PyObject *)__pyx_v_ns_tags) != Py_None)) {
91706           __pyx_t_4 = 0; __pyx_t_1 = ((PyObject *)__pyx_v_ns_tags); __Pyx_INCREF(__pyx_t_1);
91707         } else {
91708           PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
91709         }
91710         for (;;) {
91711           if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
91712           __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
91713           if (PyTuple_CheckExact(__pyx_t_5) && likely(PyTuple_GET_SIZE(__pyx_t_5) == 2)) {
91714             PyObject* tuple = __pyx_t_5;
91715             __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
91716             __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
91717             __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
91718             __Pyx_DECREF(__pyx_v_ns);
91719             __pyx_v_ns = __pyx_2;
91720             __pyx_2 = 0;
91721             __Pyx_DECREF(__pyx_v_tag);
91722             __pyx_v_tag = __pyx_3;
91723             __pyx_3 = 0;
91724           } else {
91725             __pyx_1 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
91726             __Pyx_GOTREF(__pyx_1);
91727             __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
91728             __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
91729             __Pyx_GOTREF(__pyx_2);
91730             __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
91731             __Pyx_GOTREF(__pyx_3);
91732             if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
91733             __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
91734             __Pyx_DECREF(__pyx_v_ns);
91735             __pyx_v_ns = __pyx_2;
91736             __pyx_2 = 0;
91737             __Pyx_DECREF(__pyx_v_tag);
91738             __pyx_v_tag = __pyx_3;
91739             __pyx_3 = 0;
91740           }
91741
91742           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":194
91743  *             if c_child.type == tree.XML_ELEMENT_NODE:
91744  *                 for ns, tag in ns_tags:
91745  *                     if ns is None:             # <<<<<<<<<<<<<<
91746  *                         # _tagMatches() considers NULL a wildcard
91747  *                         # match but we don't
91748  */
91749           __pyx_t_3 = (__pyx_v_ns == Py_None);
91750           if (__pyx_t_3) {
91751
91752             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":197
91753  *                         # _tagMatches() considers NULL a wildcard
91754  *                         # match but we don't
91755  *                         if c_child.ns is not NULL and c_child.ns.href is not NULL:             # <<<<<<<<<<<<<<
91756  *                             continue
91757  *                         c_href = NULL
91758  */
91759             if ((__pyx_v_c_child->ns != NULL)) {
91760               __pyx_t_3 = (__pyx_v_c_child->ns->href != NULL);
91761             } else {
91762               __pyx_t_3 = (__pyx_v_c_child->ns != NULL);
91763             }
91764             if (__pyx_t_3) {
91765
91766               /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":198
91767  *                         # match but we don't
91768  *                         if c_child.ns is not NULL and c_child.ns.href is not NULL:
91769  *                             continue             # <<<<<<<<<<<<<<
91770  *                         c_href = NULL
91771  *                     else:
91772  */
91773               goto __pyx_L11_continue;
91774               goto __pyx_L14;
91775             }
91776             __pyx_L14:;
91777
91778             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":199
91779  *                         if c_child.ns is not NULL and c_child.ns.href is not NULL:
91780  *                             continue
91781  *                         c_href = NULL             # <<<<<<<<<<<<<<
91782  *                     else:
91783  *                         c_href = _cstr(ns)
91784  */
91785             __pyx_v_c_href = NULL;
91786             goto __pyx_L13;
91787           }
91788           /*else*/ {
91789
91790             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":201
91791  *                         c_href = NULL
91792  *                     else:
91793  *                         c_href = _cstr(ns)             # <<<<<<<<<<<<<<
91794  *                     c_name = NULL if tag is None else _cstr(tag)
91795  *                     if _tagMatches(c_child, c_href, c_name):
91796  */
91797             __pyx_v_c_href = PyString_AS_STRING(__pyx_v_ns);
91798           }
91799           __pyx_L13:;
91800
91801           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":202
91802  *                     else:
91803  *                         c_href = _cstr(ns)
91804  *                     c_name = NULL if tag is None else _cstr(tag)             # <<<<<<<<<<<<<<
91805  *                     if _tagMatches(c_child, c_href, c_name):
91806  *                         if c_child.children is not NULL:
91807  */
91808           __pyx_t_3 = (__pyx_v_tag == Py_None);
91809           if (__pyx_t_3) {
91810             __pyx_4 = NULL;
91811           } else {
91812             __pyx_4 = PyString_AS_STRING(__pyx_v_tag);
91813           }
91814           __pyx_v_c_name = __pyx_4;
91815
91816           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":203
91817  *                         c_href = _cstr(ns)
91818  *                     c_name = NULL if tag is None else _cstr(tag)
91819  *                     if _tagMatches(c_child, c_href, c_name):             # <<<<<<<<<<<<<<
91820  *                         if c_child.children is not NULL:
91821  *                             c_next = _findChildForwards(c_child, 0)
91822  */
91823           __pyx_t_3 = __pyx_f_4lxml_5etree__tagMatches(__pyx_v_c_child, __pyx_v_c_href, __pyx_v_c_name);
91824           if (__pyx_t_3) {
91825
91826             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":204
91827  *                     c_name = NULL if tag is None else _cstr(tag)
91828  *                     if _tagMatches(c_child, c_href, c_name):
91829  *                         if c_child.children is not NULL:             # <<<<<<<<<<<<<<
91830  *                             c_next = _findChildForwards(c_child, 0)
91831  *                         else:
91832  */
91833             __pyx_t_3 = (__pyx_v_c_child->children != NULL);
91834             if (__pyx_t_3) {
91835
91836               /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":205
91837  *                     if _tagMatches(c_child, c_href, c_name):
91838  *                         if c_child.children is not NULL:
91839  *                             c_next = _findChildForwards(c_child, 0)             # <<<<<<<<<<<<<<
91840  *                         else:
91841  *                             c_next = _nextElement(c_child)
91842  */
91843               __pyx_v_c_next = __pyx_f_4lxml_5etree__findChildForwards(__pyx_v_c_child, 0);
91844               goto __pyx_L16;
91845             }
91846             /*else*/ {
91847
91848               /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":207
91849  *                             c_next = _findChildForwards(c_child, 0)
91850  *                         else:
91851  *                             c_next = _nextElement(c_child)             # <<<<<<<<<<<<<<
91852  *                         _replaceNodeByChildren(doc, c_child)
91853  *                         if not attemptDeallocation(c_child):
91854  */
91855               __pyx_v_c_next = __pyx_f_4lxml_5etree__nextElement(__pyx_v_c_child);
91856             }
91857             __pyx_L16:;
91858
91859             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":208
91860  *                         else:
91861  *                             c_next = _nextElement(c_child)
91862  *                         _replaceNodeByChildren(doc, c_child)             # <<<<<<<<<<<<<<
91863  *                         if not attemptDeallocation(c_child):
91864  *                             if c_child.ns is not NULL:
91865  */
91866             __pyx_t_6 = __pyx_f_4lxml_5etree__replaceNodeByChildren(__pyx_v_doc, __pyx_v_c_child); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
91867
91868             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":209
91869  *                             c_next = _nextElement(c_child)
91870  *                         _replaceNodeByChildren(doc, c_child)
91871  *                         if not attemptDeallocation(c_child):             # <<<<<<<<<<<<<<
91872  *                             if c_child.ns is not NULL:
91873  *                                 # make namespaces absolute
91874  */
91875             __pyx_t_3 = (!__pyx_f_4lxml_5etree_attemptDeallocation(__pyx_v_c_child));
91876             if (__pyx_t_3) {
91877
91878               /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":210
91879  *                         _replaceNodeByChildren(doc, c_child)
91880  *                         if not attemptDeallocation(c_child):
91881  *                             if c_child.ns is not NULL:             # <<<<<<<<<<<<<<
91882  *                                 # make namespaces absolute
91883  *                                 moveNodeToDocument(doc, doc._c_doc, c_child)
91884  */
91885               __pyx_t_3 = (__pyx_v_c_child->ns != NULL);
91886               if (__pyx_t_3) {
91887
91888                 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":212
91889  *                             if c_child.ns is not NULL:
91890  *                                 # make namespaces absolute
91891  *                                 moveNodeToDocument(doc, doc._c_doc, c_child)             # <<<<<<<<<<<<<<
91892  *                         c_child = c_next
91893  *                         break
91894  */
91895                 __pyx_t_6 = __pyx_f_4lxml_5etree_moveNodeToDocument(__pyx_v_doc, __pyx_v_doc->_c_doc, __pyx_v_c_child); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
91896                 goto __pyx_L18;
91897               }
91898               __pyx_L18:;
91899               goto __pyx_L17;
91900             }
91901             __pyx_L17:;
91902
91903             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":213
91904  *                                 # make namespaces absolute
91905  *                                 moveNodeToDocument(doc, doc._c_doc, c_child)
91906  *                         c_child = c_next             # <<<<<<<<<<<<<<
91907  *                         break
91908  *                 else:
91909  */
91910             __pyx_v_c_child = __pyx_v_c_next;
91911
91912             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":214
91913  *                                 moveNodeToDocument(doc, doc._c_doc, c_child)
91914  *                         c_child = c_next
91915  *                         break             # <<<<<<<<<<<<<<
91916  *                 else:
91917  *                     c_child = c_child.next
91918  */
91919             goto __pyx_L12_break;
91920             goto __pyx_L15;
91921           }
91922           __pyx_L15:;
91923           __pyx_L11_continue:;
91924         }
91925         /*else*/ {
91926
91927           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":216
91928  *                         break
91929  *                 else:
91930  *                     c_child = c_child.next             # <<<<<<<<<<<<<<
91931  *             elif strip_comments and c_child.type == tree.XML_COMMENT_NODE or \
91932  *                      strip_pis and c_child.type == tree.XML_PI_NODE or \
91933  */
91934           __pyx_v_c_child = __pyx_v_c_child->next;
91935         }
91936         __pyx_L12_break:;
91937         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
91938         goto __pyx_L10;
91939       }
91940
91941       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":217
91942  *                 else:
91943  *                     c_child = c_child.next
91944  *             elif strip_comments and c_child.type == tree.XML_COMMENT_NODE or \             # <<<<<<<<<<<<<<
91945  *                      strip_pis and c_child.type == tree.XML_PI_NODE or \
91946  *                      strip_entities and c_child.type == tree.XML_ENTITY_REF_NODE:
91947  */
91948       if (__pyx_v_strip_comments) {
91949         __pyx_t_3 = (__pyx_v_c_child->type == XML_COMMENT_NODE);
91950       } else {
91951         __pyx_t_3 = __pyx_v_strip_comments;
91952       }
91953       if (!__pyx_t_3) {
91954
91955         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":218
91956  *                     c_child = c_child.next
91957  *             elif strip_comments and c_child.type == tree.XML_COMMENT_NODE or \
91958  *                      strip_pis and c_child.type == tree.XML_PI_NODE or \             # <<<<<<<<<<<<<<
91959  *                      strip_entities and c_child.type == tree.XML_ENTITY_REF_NODE:
91960  *                 c_next = _nextElement(c_child)
91961  */
91962         if (__pyx_v_strip_pis) {
91963           __pyx_t_2 = (__pyx_v_c_child->type == XML_PI_NODE);
91964         } else {
91965           __pyx_t_2 = __pyx_v_strip_pis;
91966         }
91967         if (!__pyx_t_2) {
91968
91969           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":219
91970  *             elif strip_comments and c_child.type == tree.XML_COMMENT_NODE or \
91971  *                      strip_pis and c_child.type == tree.XML_PI_NODE or \
91972  *                      strip_entities and c_child.type == tree.XML_ENTITY_REF_NODE:             # <<<<<<<<<<<<<<
91973  *                 c_next = _nextElement(c_child)
91974  *                 tree.xmlUnlinkNode(c_child)
91975  */
91976           if (__pyx_v_strip_entities) {
91977             __pyx_t_7 = (__pyx_v_c_child->type == XML_ENTITY_REF_NODE);
91978           } else {
91979             __pyx_t_7 = __pyx_v_strip_entities;
91980           }
91981           __pyx_t_8 = __pyx_t_7;
91982         } else {
91983           __pyx_t_8 = __pyx_t_2;
91984         }
91985         __pyx_t_2 = __pyx_t_8;
91986       } else {
91987         __pyx_t_2 = __pyx_t_3;
91988       }
91989       if (__pyx_t_2) {
91990
91991         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":220
91992  *                      strip_pis and c_child.type == tree.XML_PI_NODE or \
91993  *                      strip_entities and c_child.type == tree.XML_ENTITY_REF_NODE:
91994  *                 c_next = _nextElement(c_child)             # <<<<<<<<<<<<<<
91995  *                 tree.xmlUnlinkNode(c_child)
91996  *                 attemptDeallocation(c_child)
91997  */
91998         __pyx_v_c_next = __pyx_f_4lxml_5etree__nextElement(__pyx_v_c_child);
91999
92000         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":221
92001  *                      strip_entities and c_child.type == tree.XML_ENTITY_REF_NODE:
92002  *                 c_next = _nextElement(c_child)
92003  *                 tree.xmlUnlinkNode(c_child)             # <<<<<<<<<<<<<<
92004  *                 attemptDeallocation(c_child)
92005  *                 c_child = c_next
92006  */
92007         xmlUnlinkNode(__pyx_v_c_child);
92008
92009         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":222
92010  *                 c_next = _nextElement(c_child)
92011  *                 tree.xmlUnlinkNode(c_child)
92012  *                 attemptDeallocation(c_child)             # <<<<<<<<<<<<<<
92013  *                 c_child = c_next
92014  *             else:
92015  */
92016         __pyx_f_4lxml_5etree_attemptDeallocation(__pyx_v_c_child);
92017
92018         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":223
92019  *                 tree.xmlUnlinkNode(c_child)
92020  *                 attemptDeallocation(c_child)
92021  *                 c_child = c_next             # <<<<<<<<<<<<<<
92022  *             else:
92023  *                 c_child = _nextElement(c_child)
92024  */
92025         __pyx_v_c_child = __pyx_v_c_next;
92026         goto __pyx_L10;
92027       }
92028       /*else*/ {
92029
92030         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":225
92031  *                 c_child = c_next
92032  *             else:
92033  *                 c_child = _nextElement(c_child)             # <<<<<<<<<<<<<<
92034  *     tree.END_FOR_EACH_ELEMENT_FROM(c_node)
92035  * 
92036  */
92037         __pyx_v_c_child = __pyx_f_4lxml_5etree__nextElement(__pyx_v_c_child);
92038       }
92039       __pyx_L10:;
92040     }
92041     goto __pyx_L7;
92042   }
92043   __pyx_L7:;
92044
92045   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":226
92046  *             else:
92047  *                 c_child = _nextElement(c_child)
92048  *     tree.END_FOR_EACH_ELEMENT_FROM(c_node)             # <<<<<<<<<<<<<<
92049  * 
92050  * 
92051  */
92052   END_FOR_EACH_ELEMENT_FROM(__pyx_v_c_node);
92053
92054   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
92055   goto __pyx_L0;
92056   __pyx_L1_error:;
92057   __Pyx_XDECREF(__pyx_1);
92058   __Pyx_XDECREF(__pyx_2);
92059   __Pyx_XDECREF(__pyx_3);
92060   __Pyx_XDECREF(__pyx_t_1);
92061   __Pyx_XDECREF(__pyx_t_5);
92062   __Pyx_AddTraceback("lxml.etree.strip_tags");
92063   __pyx_r = NULL;
92064   __pyx_L0:;
92065   __Pyx_DECREF(__pyx_v_tag_names);
92066   __Pyx_DECREF((PyObject *)__pyx_v_element);
92067   __Pyx_DECREF((PyObject *)__pyx_v_doc);
92068   __Pyx_DECREF(__pyx_v_ns_tags);
92069   __Pyx_DECREF(__pyx_v_ns);
92070   __Pyx_DECREF(__pyx_v_tag);
92071   __Pyx_XGIVEREF(__pyx_r);
92072   __Pyx_FinishRefcountContext();
92073   return __pyx_r;
92074 }
92075
92076 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":231
92077  * # helper functions
92078  * 
92079  * cdef list _sortedTagList(list l):             # <<<<<<<<<<<<<<
92080  *     # This is required since the namespace may be None (which Py3
92081  *     # can't compare to strings).  A bit of overhead, but at least
92082  */
92083
92084 static  PyObject *__pyx_f_4lxml_5etree__sortedTagList(PyObject *__pyx_v_l) {
92085   PyObject *__pyx_v_decorated_list;
92086   PyObject *__pyx_v_ns_tag;
92087   Py_ssize_t __pyx_v_i;
92088   PyObject *__pyx_v_item;
92089   PyObject *__pyx_r = NULL;
92090   PyObject *__pyx_1 = 0;
92091   PyObject *__pyx_2 = 0;
92092   PyObject *__pyx_t_1 = NULL;
92093   Py_ssize_t __pyx_t_2;
92094   PyObject *__pyx_t_3 = NULL;
92095   PyObject *__pyx_t_4 = NULL;
92096   Py_ssize_t __pyx_t_5;
92097   int __pyx_t_6;
92098   PyObject *__pyx_t_7 = NULL;
92099   PyObject *__pyx_t_8 = NULL;
92100   int __pyx_t_9;
92101   __Pyx_SetupRefcountContext("_sortedTagList");
92102   __pyx_v_decorated_list = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
92103   __pyx_v_ns_tag = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
92104   __pyx_v_item = Py_None; __Pyx_INCREF(Py_None);
92105
92106   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":238
92107  *     cdef tuple ns_tag
92108  *     cdef Py_ssize_t i
92109  *     decorated_list = [ (ns_tag[0] or '', ns_tag[1], i, ns_tag)             # <<<<<<<<<<<<<<
92110  *                        for i, ns_tag in enumerate(l) ]
92111  *     decorated_list.sort()
92112  */
92113   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92114   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
92115
92116   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":239
92117  *     cdef Py_ssize_t i
92118  *     decorated_list = [ (ns_tag[0] or '', ns_tag[1], i, ns_tag)
92119  *                        for i, ns_tag in enumerate(l) ]             # <<<<<<<<<<<<<<
92120  *     decorated_list.sort()
92121  *     return [ item[-1] for item in decorated_list ]
92122  */
92123   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92124   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
92125   __Pyx_INCREF(((PyObject *)__pyx_v_l));
92126   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_l));
92127   __Pyx_GIVEREF(((PyObject *)__pyx_v_l));
92128   __pyx_t_4 = PyObject_Call(__pyx_builtin_enumerate, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92129   __Pyx_GOTREF(__pyx_t_4);
92130   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
92131   if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
92132     __pyx_t_2 = 0; __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3);
92133   } else {
92134     __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92135     __Pyx_GOTREF(__pyx_t_3);
92136   }
92137   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
92138   for (;;) {
92139     if (likely(PyList_CheckExact(__pyx_t_3))) {
92140       if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
92141       __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
92142     } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
92143       if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
92144       __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
92145     } else {
92146       __pyx_t_4 = PyIter_Next(__pyx_t_3);
92147       if (!__pyx_t_4) {
92148         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92149         break;
92150       }
92151       __Pyx_GOTREF(__pyx_t_4);
92152     }
92153     if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 2)) {
92154       PyObject* tuple = __pyx_t_4;
92155       __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
92156       __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_2); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92157       __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
92158       __pyx_2 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_2);
92159       if (!(likely(PyTuple_CheckExact(__pyx_2)) || (__pyx_2) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected tuple, got %s", Py_TYPE(__pyx_2)->tp_name), 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92160       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
92161       __pyx_v_i = __pyx_t_5;
92162       __Pyx_DECREF(((PyObject *)__pyx_v_ns_tag));
92163       __pyx_v_ns_tag = ((PyObject *)__pyx_2);
92164       __pyx_2 = 0;
92165     } else {
92166       __pyx_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92167       __Pyx_GOTREF(__pyx_1);
92168       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
92169       __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92170       __Pyx_GOTREF(__pyx_2);
92171       __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_2); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92172       __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
92173       __pyx_2 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92174       __Pyx_GOTREF(__pyx_2);
92175       if (!(likely(PyTuple_CheckExact(__pyx_2)) || (__pyx_2) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected tuple, got %s", Py_TYPE(__pyx_2)->tp_name), 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92176       if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92177       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
92178       __pyx_v_i = __pyx_t_5;
92179       __Pyx_DECREF(((PyObject *)__pyx_v_ns_tag));
92180       __pyx_v_ns_tag = ((PyObject *)__pyx_2);
92181       __pyx_2 = 0;
92182     }
92183
92184     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":238
92185  *     cdef tuple ns_tag
92186  *     cdef Py_ssize_t i
92187  *     decorated_list = [ (ns_tag[0] or '', ns_tag[1], i, ns_tag)             # <<<<<<<<<<<<<<
92188  *                        for i, ns_tag in enumerate(l) ]
92189  *     decorated_list.sort()
92190  */
92191     __pyx_1 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_ns_tag), 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92192     __Pyx_GOTREF(__pyx_1);
92193     __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92194     if (!__pyx_t_6) {
92195       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
92196       __Pyx_INCREF(__pyx_kp_554);
92197       __pyx_t_4 = __pyx_kp_554;
92198     } else {
92199       __pyx_t_4 = __pyx_1;
92200       __pyx_1 = 0;
92201     }
92202     __pyx_2 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_ns_tag), 1, sizeof(long), PyInt_FromLong); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92203     __Pyx_GOTREF(__pyx_2);
92204     __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92205     __Pyx_GOTREF(__pyx_t_7);
92206     __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92207     __Pyx_GOTREF(((PyObject *)__pyx_t_8));
92208     PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4);
92209     __Pyx_GIVEREF(__pyx_t_4);
92210     PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_2);
92211     __Pyx_GIVEREF(__pyx_2);
92212     PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
92213     __Pyx_GIVEREF(__pyx_t_7);
92214     __Pyx_INCREF(((PyObject *)__pyx_v_ns_tag));
92215     PyTuple_SET_ITEM(__pyx_t_8, 3, ((PyObject *)__pyx_v_ns_tag));
92216     __Pyx_GIVEREF(((PyObject *)__pyx_v_ns_tag));
92217     __pyx_t_4 = 0;
92218     __pyx_2 = 0;
92219     __pyx_t_7 = 0;
92220     __pyx_t_9 = PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_8); if (unlikely(__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92221     __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
92222   }
92223   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
92224   __Pyx_INCREF(((PyObject *)__pyx_t_1));
92225   __Pyx_DECREF(((PyObject *)__pyx_v_decorated_list));
92226   __pyx_v_decorated_list = __pyx_t_1;
92227   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
92228
92229   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":240
92230  *     decorated_list = [ (ns_tag[0] or '', ns_tag[1], i, ns_tag)
92231  *                        for i, ns_tag in enumerate(l) ]
92232  *     decorated_list.sort()             # <<<<<<<<<<<<<<
92233  *     return [ item[-1] for item in decorated_list ]
92234  * 
92235  */
92236   __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_decorated_list), __pyx_kp_sort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92237   __Pyx_GOTREF(__pyx_t_1);
92238   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92239   __Pyx_GOTREF(__pyx_t_3);
92240   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
92241   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
92242
92243   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":241
92244  *                        for i, ns_tag in enumerate(l) ]
92245  *     decorated_list.sort()
92246  *     return [ item[-1] for item in decorated_list ]             # <<<<<<<<<<<<<<
92247  * 
92248  * cdef list _filterSpecialTagNames(tag_names, bint* comments, bint* pis, bint* entities):
92249  */
92250   __Pyx_XDECREF(((PyObject *)__pyx_r));
92251   __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92252   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
92253   if (likely(((PyObject *)__pyx_v_decorated_list) != Py_None)) {
92254     __pyx_t_2 = 0; __pyx_t_1 = ((PyObject *)__pyx_v_decorated_list); __Pyx_INCREF(__pyx_t_1);
92255   } else {
92256     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92257   }
92258   for (;;) {
92259     if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
92260     __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_8); __pyx_t_2++;
92261     __Pyx_DECREF(__pyx_v_item);
92262     __pyx_v_item = __pyx_t_8;
92263     __pyx_t_8 = 0;
92264     __pyx_1 = __Pyx_GetItemInt(__pyx_v_item, -1, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92265     __Pyx_GOTREF(__pyx_1);
92266     __pyx_t_9 = PyList_Append(__pyx_t_3, (PyObject*)__pyx_1); if (unlikely(__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92267     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
92268   }
92269   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
92270   __Pyx_INCREF(((PyObject *)__pyx_t_3));
92271   __pyx_r = __pyx_t_3;
92272   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
92273   goto __pyx_L0;
92274
92275   __pyx_r = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
92276   goto __pyx_L0;
92277   __pyx_L1_error:;
92278   __Pyx_XDECREF(__pyx_1);
92279   __Pyx_XDECREF(__pyx_2);
92280   __Pyx_XDECREF(__pyx_t_1);
92281   __Pyx_XDECREF(__pyx_t_3);
92282   __Pyx_XDECREF(__pyx_t_4);
92283   __Pyx_XDECREF(__pyx_t_7);
92284   __Pyx_XDECREF(__pyx_t_8);
92285   __Pyx_AddTraceback("lxml.etree._sortedTagList");
92286   __pyx_r = 0;
92287   __pyx_L0:;
92288   __Pyx_DECREF(__pyx_v_decorated_list);
92289   __Pyx_DECREF(__pyx_v_ns_tag);
92290   __Pyx_DECREF(__pyx_v_item);
92291   __Pyx_XGIVEREF(__pyx_r);
92292   __Pyx_FinishRefcountContext();
92293   return __pyx_r;
92294 }
92295
92296 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":243
92297  *     return [ item[-1] for item in decorated_list ]
92298  * 
92299  * cdef list _filterSpecialTagNames(tag_names, bint* comments, bint* pis, bint* entities):             # <<<<<<<<<<<<<<
92300  *     cdef list ns_tags
92301  *     comments[0] = 0
92302  */
92303
92304 static  PyObject *__pyx_f_4lxml_5etree__filterSpecialTagNames(PyObject *__pyx_v_tag_names, int *__pyx_v_comments, int *__pyx_v_pis, int *__pyx_v_entities) {
92305   PyObject *__pyx_v_ns_tags;
92306   PyObject *__pyx_v_tag;
92307   PyObject *__pyx_v_ns;
92308   PyObject *__pyx_r = NULL;
92309   PyObject *__pyx_1 = 0;
92310   PyObject *__pyx_2 = 0;
92311   PyObject *__pyx_3 = 0;
92312   int __pyx_t_1;
92313   PyObject *__pyx_t_2 = NULL;
92314   Py_ssize_t __pyx_t_3;
92315   PyObject *__pyx_t_4 = NULL;
92316   PyObject *__pyx_t_5 = NULL;
92317   int __pyx_t_6;
92318   __Pyx_SetupRefcountContext("_filterSpecialTagNames");
92319   __Pyx_INCREF(__pyx_v_tag_names);
92320   __pyx_v_ns_tags = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
92321   __pyx_v_tag = Py_None; __Pyx_INCREF(Py_None);
92322   __pyx_v_ns = Py_None; __Pyx_INCREF(Py_None);
92323
92324   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":245
92325  * cdef list _filterSpecialTagNames(tag_names, bint* comments, bint* pis, bint* entities):
92326  *     cdef list ns_tags
92327  *     comments[0] = 0             # <<<<<<<<<<<<<<
92328  *     pis[0] = 0
92329  *     entities[0] = 0
92330  */
92331   (__pyx_v_comments[0]) = 0;
92332
92333   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":246
92334  *     cdef list ns_tags
92335  *     comments[0] = 0
92336  *     pis[0] = 0             # <<<<<<<<<<<<<<
92337  *     entities[0] = 0
92338  * 
92339  */
92340   (__pyx_v_pis[0]) = 0;
92341
92342   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":247
92343  *     comments[0] = 0
92344  *     pis[0] = 0
92345  *     entities[0] = 0             # <<<<<<<<<<<<<<
92346  * 
92347  *     if Comment in tag_names:
92348  */
92349   (__pyx_v_entities[0]) = 0;
92350
92351   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":249
92352  *     entities[0] = 0
92353  * 
92354  *     if Comment in tag_names:             # <<<<<<<<<<<<<<
92355  *         comments[0] = 1
92356  *         tag_names = [ tag for tag in tag_names
92357  */
92358   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_Comment); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92359   __Pyx_GOTREF(__pyx_1);
92360   __pyx_t_1 = (PySequence_Contains(__pyx_v_tag_names, __pyx_1)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92361   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
92362   if (__pyx_t_1) {
92363
92364     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":250
92365  * 
92366  *     if Comment in tag_names:
92367  *         comments[0] = 1             # <<<<<<<<<<<<<<
92368  *         tag_names = [ tag for tag in tag_names
92369  *                       if tag is not Comment ]
92370  */
92371     (__pyx_v_comments[0]) = 1;
92372
92373     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":251
92374  *     if Comment in tag_names:
92375  *         comments[0] = 1
92376  *         tag_names = [ tag for tag in tag_names             # <<<<<<<<<<<<<<
92377  *                       if tag is not Comment ]
92378  *     if ProcessingInstruction in tag_names:
92379  */
92380     __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92381     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
92382
92383     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":252
92384  *         comments[0] = 1
92385  *         tag_names = [ tag for tag in tag_names
92386  *                       if tag is not Comment ]             # <<<<<<<<<<<<<<
92387  *     if ProcessingInstruction in tag_names:
92388  *         pis[0] = 1
92389  */
92390     if (PyList_CheckExact(__pyx_v_tag_names) || PyTuple_CheckExact(__pyx_v_tag_names)) {
92391       __pyx_t_3 = 0; __pyx_t_4 = __pyx_v_tag_names; __Pyx_INCREF(__pyx_t_4);
92392     } else {
92393       __pyx_t_3 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tag_names); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92394       __Pyx_GOTREF(__pyx_t_4);
92395     }
92396     for (;;) {
92397
92398       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":251
92399  *     if Comment in tag_names:
92400  *         comments[0] = 1
92401  *         tag_names = [ tag for tag in tag_names             # <<<<<<<<<<<<<<
92402  *                       if tag is not Comment ]
92403  *     if ProcessingInstruction in tag_names:
92404  */
92405       if (likely(PyList_CheckExact(__pyx_t_4))) {
92406         if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_4)) break;
92407         __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
92408       } else if (likely(PyTuple_CheckExact(__pyx_t_4))) {
92409         if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
92410         __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
92411       } else {
92412         __pyx_t_5 = PyIter_Next(__pyx_t_4);
92413         if (!__pyx_t_5) {
92414           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92415           break;
92416         }
92417         __Pyx_GOTREF(__pyx_t_5);
92418       }
92419       __Pyx_DECREF(__pyx_v_tag);
92420       __pyx_v_tag = __pyx_t_5;
92421       __pyx_t_5 = 0;
92422
92423       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":252
92424  *         comments[0] = 1
92425  *         tag_names = [ tag for tag in tag_names
92426  *                       if tag is not Comment ]             # <<<<<<<<<<<<<<
92427  *     if ProcessingInstruction in tag_names:
92428  *         pis[0] = 1
92429  */
92430       __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_Comment); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92431       __Pyx_GOTREF(__pyx_1);
92432       __pyx_t_1 = (__pyx_v_tag != __pyx_1);
92433       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
92434       if (__pyx_t_1) {
92435
92436         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":251
92437  *     if Comment in tag_names:
92438  *         comments[0] = 1
92439  *         tag_names = [ tag for tag in tag_names             # <<<<<<<<<<<<<<
92440  *                       if tag is not Comment ]
92441  *     if ProcessingInstruction in tag_names:
92442  */
92443         __pyx_t_6 = PyList_Append(__pyx_t_2, (PyObject*)__pyx_v_tag); if (unlikely(__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92444         goto __pyx_L6;
92445       }
92446       __pyx_L6:;
92447     }
92448     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
92449     __Pyx_INCREF(((PyObject *)__pyx_t_2));
92450     __Pyx_DECREF(__pyx_v_tag_names);
92451     __pyx_v_tag_names = ((PyObject *)__pyx_t_2);
92452     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
92453     goto __pyx_L3;
92454   }
92455   __pyx_L3:;
92456
92457   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":253
92458  *         tag_names = [ tag for tag in tag_names
92459  *                       if tag is not Comment ]
92460  *     if ProcessingInstruction in tag_names:             # <<<<<<<<<<<<<<
92461  *         pis[0] = 1
92462  *         tag_names = [ tag for tag in tag_names
92463  */
92464   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_101); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92465   __Pyx_GOTREF(__pyx_1);
92466   __pyx_t_1 = (PySequence_Contains(__pyx_v_tag_names, __pyx_1)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92467   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
92468   if (__pyx_t_1) {
92469
92470     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":254
92471  *                       if tag is not Comment ]
92472  *     if ProcessingInstruction in tag_names:
92473  *         pis[0] = 1             # <<<<<<<<<<<<<<
92474  *         tag_names = [ tag for tag in tag_names
92475  *                       if tag is not ProcessingInstruction ]
92476  */
92477     (__pyx_v_pis[0]) = 1;
92478
92479     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":255
92480  *     if ProcessingInstruction in tag_names:
92481  *         pis[0] = 1
92482  *         tag_names = [ tag for tag in tag_names             # <<<<<<<<<<<<<<
92483  *                       if tag is not ProcessingInstruction ]
92484  *     if Entity in tag_names:
92485  */
92486     __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92487     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
92488
92489     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":256
92490  *         pis[0] = 1
92491  *         tag_names = [ tag for tag in tag_names
92492  *                       if tag is not ProcessingInstruction ]             # <<<<<<<<<<<<<<
92493  *     if Entity in tag_names:
92494  *         entities[0] = 1
92495  */
92496     if (PyList_CheckExact(__pyx_v_tag_names) || PyTuple_CheckExact(__pyx_v_tag_names)) {
92497       __pyx_t_3 = 0; __pyx_t_4 = __pyx_v_tag_names; __Pyx_INCREF(__pyx_t_4);
92498     } else {
92499       __pyx_t_3 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tag_names); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92500       __Pyx_GOTREF(__pyx_t_4);
92501     }
92502     for (;;) {
92503
92504       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":255
92505  *     if ProcessingInstruction in tag_names:
92506  *         pis[0] = 1
92507  *         tag_names = [ tag for tag in tag_names             # <<<<<<<<<<<<<<
92508  *                       if tag is not ProcessingInstruction ]
92509  *     if Entity in tag_names:
92510  */
92511       if (likely(PyList_CheckExact(__pyx_t_4))) {
92512         if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_4)) break;
92513         __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
92514       } else if (likely(PyTuple_CheckExact(__pyx_t_4))) {
92515         if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
92516         __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
92517       } else {
92518         __pyx_t_5 = PyIter_Next(__pyx_t_4);
92519         if (!__pyx_t_5) {
92520           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92521           break;
92522         }
92523         __Pyx_GOTREF(__pyx_t_5);
92524       }
92525       __Pyx_DECREF(__pyx_v_tag);
92526       __pyx_v_tag = __pyx_t_5;
92527       __pyx_t_5 = 0;
92528
92529       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":256
92530  *         pis[0] = 1
92531  *         tag_names = [ tag for tag in tag_names
92532  *                       if tag is not ProcessingInstruction ]             # <<<<<<<<<<<<<<
92533  *     if Entity in tag_names:
92534  *         entities[0] = 1
92535  */
92536       __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_101); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92537       __Pyx_GOTREF(__pyx_1);
92538       __pyx_t_1 = (__pyx_v_tag != __pyx_1);
92539       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
92540       if (__pyx_t_1) {
92541
92542         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":255
92543  *     if ProcessingInstruction in tag_names:
92544  *         pis[0] = 1
92545  *         tag_names = [ tag for tag in tag_names             # <<<<<<<<<<<<<<
92546  *                       if tag is not ProcessingInstruction ]
92547  *     if Entity in tag_names:
92548  */
92549         __pyx_t_6 = PyList_Append(__pyx_t_2, (PyObject*)__pyx_v_tag); if (unlikely(__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92550         goto __pyx_L10;
92551       }
92552       __pyx_L10:;
92553     }
92554     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
92555     __Pyx_INCREF(((PyObject *)__pyx_t_2));
92556     __Pyx_DECREF(__pyx_v_tag_names);
92557     __pyx_v_tag_names = ((PyObject *)__pyx_t_2);
92558     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
92559     goto __pyx_L7;
92560   }
92561   __pyx_L7:;
92562
92563   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":257
92564  *         tag_names = [ tag for tag in tag_names
92565  *                       if tag is not ProcessingInstruction ]
92566  *     if Entity in tag_names:             # <<<<<<<<<<<<<<
92567  *         entities[0] = 1
92568  *         tag_names = [ tag for tag in tag_names
92569  */
92570   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_Entity); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92571   __Pyx_GOTREF(__pyx_1);
92572   __pyx_t_1 = (PySequence_Contains(__pyx_v_tag_names, __pyx_1)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92573   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
92574   if (__pyx_t_1) {
92575
92576     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":258
92577  *                       if tag is not ProcessingInstruction ]
92578  *     if Entity in tag_names:
92579  *         entities[0] = 1             # <<<<<<<<<<<<<<
92580  *         tag_names = [ tag for tag in tag_names
92581  *                       if tag is not Entity ]
92582  */
92583     (__pyx_v_entities[0]) = 1;
92584
92585     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":259
92586  *     if Entity in tag_names:
92587  *         entities[0] = 1
92588  *         tag_names = [ tag for tag in tag_names             # <<<<<<<<<<<<<<
92589  *                       if tag is not Entity ]
92590  *     ns_tags = _sortedTagList([ _getNsTag(tag) for tag in tag_names ])
92591  */
92592     __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92593     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
92594
92595     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":260
92596  *         entities[0] = 1
92597  *         tag_names = [ tag for tag in tag_names
92598  *                       if tag is not Entity ]             # <<<<<<<<<<<<<<
92599  *     ns_tags = _sortedTagList([ _getNsTag(tag) for tag in tag_names ])
92600  *     return [ (ns, tag if tag != '*' else None)
92601  */
92602     if (PyList_CheckExact(__pyx_v_tag_names) || PyTuple_CheckExact(__pyx_v_tag_names)) {
92603       __pyx_t_3 = 0; __pyx_t_4 = __pyx_v_tag_names; __Pyx_INCREF(__pyx_t_4);
92604     } else {
92605       __pyx_t_3 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tag_names); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92606       __Pyx_GOTREF(__pyx_t_4);
92607     }
92608     for (;;) {
92609
92610       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":259
92611  *     if Entity in tag_names:
92612  *         entities[0] = 1
92613  *         tag_names = [ tag for tag in tag_names             # <<<<<<<<<<<<<<
92614  *                       if tag is not Entity ]
92615  *     ns_tags = _sortedTagList([ _getNsTag(tag) for tag in tag_names ])
92616  */
92617       if (likely(PyList_CheckExact(__pyx_t_4))) {
92618         if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_4)) break;
92619         __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
92620       } else if (likely(PyTuple_CheckExact(__pyx_t_4))) {
92621         if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
92622         __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
92623       } else {
92624         __pyx_t_5 = PyIter_Next(__pyx_t_4);
92625         if (!__pyx_t_5) {
92626           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92627           break;
92628         }
92629         __Pyx_GOTREF(__pyx_t_5);
92630       }
92631       __Pyx_DECREF(__pyx_v_tag);
92632       __pyx_v_tag = __pyx_t_5;
92633       __pyx_t_5 = 0;
92634
92635       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":260
92636  *         entities[0] = 1
92637  *         tag_names = [ tag for tag in tag_names
92638  *                       if tag is not Entity ]             # <<<<<<<<<<<<<<
92639  *     ns_tags = _sortedTagList([ _getNsTag(tag) for tag in tag_names ])
92640  *     return [ (ns, tag if tag != '*' else None)
92641  */
92642       __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_Entity); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92643       __Pyx_GOTREF(__pyx_1);
92644       __pyx_t_1 = (__pyx_v_tag != __pyx_1);
92645       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
92646       if (__pyx_t_1) {
92647
92648         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":259
92649  *     if Entity in tag_names:
92650  *         entities[0] = 1
92651  *         tag_names = [ tag for tag in tag_names             # <<<<<<<<<<<<<<
92652  *                       if tag is not Entity ]
92653  *     ns_tags = _sortedTagList([ _getNsTag(tag) for tag in tag_names ])
92654  */
92655         __pyx_t_6 = PyList_Append(__pyx_t_2, (PyObject*)__pyx_v_tag); if (unlikely(__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92656         goto __pyx_L14;
92657       }
92658       __pyx_L14:;
92659     }
92660     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
92661     __Pyx_INCREF(((PyObject *)__pyx_t_2));
92662     __Pyx_DECREF(__pyx_v_tag_names);
92663     __pyx_v_tag_names = ((PyObject *)__pyx_t_2);
92664     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
92665     goto __pyx_L11;
92666   }
92667   __pyx_L11:;
92668
92669   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":261
92670  *         tag_names = [ tag for tag in tag_names
92671  *                       if tag is not Entity ]
92672  *     ns_tags = _sortedTagList([ _getNsTag(tag) for tag in tag_names ])             # <<<<<<<<<<<<<<
92673  *     return [ (ns, tag if tag != '*' else None)
92674  *              for ns, tag in ns_tags ]
92675  */
92676   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92677   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
92678   if (PyList_CheckExact(__pyx_v_tag_names) || PyTuple_CheckExact(__pyx_v_tag_names)) {
92679     __pyx_t_3 = 0; __pyx_t_4 = __pyx_v_tag_names; __Pyx_INCREF(__pyx_t_4);
92680   } else {
92681     __pyx_t_3 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tag_names); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92682     __Pyx_GOTREF(__pyx_t_4);
92683   }
92684   for (;;) {
92685     if (likely(PyList_CheckExact(__pyx_t_4))) {
92686       if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_4)) break;
92687       __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
92688     } else if (likely(PyTuple_CheckExact(__pyx_t_4))) {
92689       if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
92690       __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
92691     } else {
92692       __pyx_t_5 = PyIter_Next(__pyx_t_4);
92693       if (!__pyx_t_5) {
92694         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92695         break;
92696       }
92697       __Pyx_GOTREF(__pyx_t_5);
92698     }
92699     __Pyx_DECREF(__pyx_v_tag);
92700     __pyx_v_tag = __pyx_t_5;
92701     __pyx_t_5 = 0;
92702     __pyx_t_5 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_tag); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92703     __Pyx_GOTREF(__pyx_t_5);
92704     __pyx_t_6 = PyList_Append(__pyx_t_2, (PyObject*)__pyx_t_5); if (unlikely(__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92705     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
92706   }
92707   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
92708   __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__sortedTagList(__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92709   __Pyx_GOTREF(__pyx_t_4);
92710   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
92711   __Pyx_DECREF(((PyObject *)__pyx_v_ns_tags));
92712   __pyx_v_ns_tags = ((PyObject *)__pyx_t_4);
92713   __pyx_t_4 = 0;
92714
92715   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":262
92716  *                       if tag is not Entity ]
92717  *     ns_tags = _sortedTagList([ _getNsTag(tag) for tag in tag_names ])
92718  *     return [ (ns, tag if tag != '*' else None)             # <<<<<<<<<<<<<<
92719  *              for ns, tag in ns_tags ]
92720  */
92721   __Pyx_XDECREF(((PyObject *)__pyx_r));
92722   __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92723   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
92724
92725   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":263
92726  *     ns_tags = _sortedTagList([ _getNsTag(tag) for tag in tag_names ])
92727  *     return [ (ns, tag if tag != '*' else None)
92728  *              for ns, tag in ns_tags ]             # <<<<<<<<<<<<<<
92729  */
92730   if (likely(((PyObject *)__pyx_v_ns_tags) != Py_None)) {
92731     __pyx_t_3 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_ns_tags); __Pyx_INCREF(__pyx_t_2);
92732   } else {
92733     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92734   }
92735   for (;;) {
92736     if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
92737     __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
92738     if (PyTuple_CheckExact(__pyx_t_5) && likely(PyTuple_GET_SIZE(__pyx_t_5) == 2)) {
92739       PyObject* tuple = __pyx_t_5;
92740       __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
92741       __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
92742       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
92743       __Pyx_DECREF(__pyx_v_ns);
92744       __pyx_v_ns = __pyx_2;
92745       __pyx_2 = 0;
92746       __Pyx_DECREF(__pyx_v_tag);
92747       __pyx_v_tag = __pyx_3;
92748       __pyx_3 = 0;
92749     } else {
92750       __pyx_1 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92751       __Pyx_GOTREF(__pyx_1);
92752       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
92753       __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92754       __Pyx_GOTREF(__pyx_2);
92755       __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92756       __Pyx_GOTREF(__pyx_3);
92757       if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92758       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
92759       __Pyx_DECREF(__pyx_v_ns);
92760       __pyx_v_ns = __pyx_2;
92761       __pyx_2 = 0;
92762       __Pyx_DECREF(__pyx_v_tag);
92763       __pyx_v_tag = __pyx_3;
92764       __pyx_3 = 0;
92765     }
92766
92767     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/cleanup.pxi":262
92768  *                       if tag is not Entity ]
92769  *     ns_tags = _sortedTagList([ _getNsTag(tag) for tag in tag_names ])
92770  *     return [ (ns, tag if tag != '*' else None)             # <<<<<<<<<<<<<<
92771  *              for ns, tag in ns_tags ]
92772  */
92773     __pyx_t_5 = PyObject_RichCompare(__pyx_v_tag, __pyx_kp_555, Py_NE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92774     __Pyx_GOTREF(__pyx_t_5);
92775     __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92776     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
92777     if (__pyx_t_1) {
92778       __Pyx_INCREF(__pyx_v_tag);
92779       __pyx_1 = __pyx_v_tag;
92780     } else {
92781       __Pyx_INCREF(Py_None);
92782       __pyx_1 = Py_None;
92783     }
92784     __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92785     __Pyx_GOTREF(((PyObject *)__pyx_t_5));
92786     __Pyx_INCREF(__pyx_v_ns);
92787     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_ns);
92788     __Pyx_GIVEREF(__pyx_v_ns);
92789     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_1);
92790     __Pyx_GIVEREF(__pyx_1);
92791     __pyx_1 = 0;
92792     __pyx_t_6 = PyList_Append(__pyx_t_4, (PyObject*)__pyx_t_5); if (unlikely(__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92793     __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
92794   }
92795   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
92796   __Pyx_INCREF(((PyObject *)__pyx_t_4));
92797   __pyx_r = __pyx_t_4;
92798   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
92799   goto __pyx_L0;
92800
92801   __pyx_r = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
92802   goto __pyx_L0;
92803   __pyx_L1_error:;
92804   __Pyx_XDECREF(__pyx_1);
92805   __Pyx_XDECREF(__pyx_2);
92806   __Pyx_XDECREF(__pyx_3);
92807   __Pyx_XDECREF(__pyx_t_2);
92808   __Pyx_XDECREF(__pyx_t_4);
92809   __Pyx_XDECREF(__pyx_t_5);
92810   __Pyx_AddTraceback("lxml.etree._filterSpecialTagNames");
92811   __pyx_r = 0;
92812   __pyx_L0:;
92813   __Pyx_DECREF(__pyx_v_ns_tags);
92814   __Pyx_DECREF(__pyx_v_tag);
92815   __Pyx_DECREF(__pyx_v_ns);
92816   __Pyx_DECREF(__pyx_v_tag_names);
92817   __Pyx_XGIVEREF(__pyx_r);
92818   __Pyx_FinishRefcountContext();
92819   return __pyx_r;
92820 }
92821
92822 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":45
92823  *     cdef _ExceptionContext _exc
92824  * 
92825  *     def __init__(self, namespaces, extensions, enable_regexp,             # <<<<<<<<<<<<<<
92826  *                  build_smart_strings):
92827  *         cdef _ExsltRegExp _regexp
92828  */
92829
92830 static int __pyx_pf_4lxml_5etree_12_BaseContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
92831 static int __pyx_pf_4lxml_5etree_12_BaseContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
92832   PyObject *__pyx_v_namespaces = 0;
92833   PyObject *__pyx_v_extensions = 0;
92834   PyObject *__pyx_v_enable_regexp = 0;
92835   PyObject *__pyx_v_build_smart_strings = 0;
92836   struct __pyx_obj_4lxml_5etree__ExsltRegExp *__pyx_v__regexp;
92837   PyObject *__pyx_v_new_extensions;
92838   PyObject *__pyx_v_ns;
92839   PyObject *__pyx_v_extension;
92840   PyObject *__pyx_v_ns_uri;
92841   PyObject *__pyx_v_name;
92842   PyObject *__pyx_v_function;
92843   PyObject *__pyx_v_ns_utf;
92844   PyObject *__pyx_v_name_utf;
92845   PyObject *__pyx_v_prefix;
92846   PyObject *__pyx_v_prefix_utf;
92847   PyObject *__pyx_v_ns_uri_utf;
92848   int __pyx_r;
92849   PyObject *__pyx_1 = 0;
92850   PyObject *__pyx_2 = 0;
92851   PyObject *__pyx_3 = 0;
92852   PyObject *__pyx_4 = 0;
92853   PyObject *__pyx_5 = 0;
92854   PyObject *__pyx_6 = 0;
92855   PyObject *__pyx_t_1 = NULL;
92856   int __pyx_t_2;
92857   Py_ssize_t __pyx_t_3;
92858   PyObject *__pyx_t_4 = NULL;
92859   Py_ssize_t __pyx_t_5;
92860   PyObject *__pyx_t_6 = NULL;
92861   int __pyx_t_7;
92862   int __pyx_t_8;
92863   int __pyx_t_9;
92864   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_namespaces,&__pyx_kp_extensions,&__pyx_kp_enable_regexp,&__pyx_kp_build_smart_strings,0};
92865   __Pyx_SetupRefcountContext("__init__");
92866   if (unlikely(__pyx_kwds)) {
92867     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
92868     PyObject* values[4] = {0,0,0,0};
92869     switch (PyTuple_GET_SIZE(__pyx_args)) {
92870       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
92871       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
92872       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
92873       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
92874       case  0: break;
92875       default: goto __pyx_L5_argtuple_error;
92876     }
92877     switch (PyTuple_GET_SIZE(__pyx_args)) {
92878       case  0:
92879       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_namespaces);
92880       if (likely(values[0])) kw_args--;
92881       else goto __pyx_L5_argtuple_error;
92882       case  1:
92883       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_extensions);
92884       if (likely(values[1])) kw_args--;
92885       else {
92886         __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
92887       }
92888       case  2:
92889       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_enable_regexp);
92890       if (likely(values[2])) kw_args--;
92891       else {
92892         __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
92893       }
92894       case  3:
92895       values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_build_smart_strings);
92896       if (likely(values[3])) kw_args--;
92897       else {
92898         __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
92899       }
92900     }
92901     if (unlikely(kw_args > 0)) {
92902       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
92903     }
92904     __pyx_v_namespaces = values[0];
92905     __pyx_v_extensions = values[1];
92906     __pyx_v_enable_regexp = values[2];
92907     __pyx_v_build_smart_strings = values[3];
92908   } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
92909     goto __pyx_L5_argtuple_error;
92910   } else {
92911     __pyx_v_namespaces = PyTuple_GET_ITEM(__pyx_args, 0);
92912     __pyx_v_extensions = PyTuple_GET_ITEM(__pyx_args, 1);
92913     __pyx_v_enable_regexp = PyTuple_GET_ITEM(__pyx_args, 2);
92914     __pyx_v_build_smart_strings = PyTuple_GET_ITEM(__pyx_args, 3);
92915   }
92916   goto __pyx_L4_argument_unpacking_done;
92917   __pyx_L5_argtuple_error:;
92918   __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
92919   __pyx_L3_error:;
92920   __Pyx_AddTraceback("lxml.etree._BaseContext.__init__");
92921   return -1;
92922   __pyx_L4_argument_unpacking_done:;
92923   __Pyx_INCREF(__pyx_v_namespaces);
92924   __Pyx_INCREF(__pyx_v_extensions);
92925   __pyx_v__regexp = ((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)Py_None); __Pyx_INCREF(Py_None);
92926   __pyx_v_new_extensions = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
92927   __pyx_v_ns = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
92928   __pyx_v_extension = Py_None; __Pyx_INCREF(Py_None);
92929   __pyx_v_ns_uri = Py_None; __Pyx_INCREF(Py_None);
92930   __pyx_v_name = Py_None; __Pyx_INCREF(Py_None);
92931   __pyx_v_function = Py_None; __Pyx_INCREF(Py_None);
92932   __pyx_v_ns_utf = Py_None; __Pyx_INCREF(Py_None);
92933   __pyx_v_name_utf = Py_None; __Pyx_INCREF(Py_None);
92934   __pyx_v_prefix = Py_None; __Pyx_INCREF(Py_None);
92935   __pyx_v_prefix_utf = Py_None; __Pyx_INCREF(Py_None);
92936   __pyx_v_ns_uri_utf = Py_None; __Pyx_INCREF(Py_None);
92937
92938   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":50
92939  *         cdef dict new_extensions
92940  *         cdef list ns
92941  *         self._utf_refs = {}             # <<<<<<<<<<<<<<
92942  *         self._global_namespaces = []
92943  *         self._function_cache = {}
92944  */
92945   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92946   __Pyx_GOTREF(((PyObject *)__pyx_1));
92947   __Pyx_GIVEREF(((PyObject *)__pyx_1));
92948   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_utf_refs);
92949   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_utf_refs));
92950   ((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_utf_refs = __pyx_1;
92951   __pyx_1 = 0;
92952
92953   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":51
92954  *         cdef list ns
92955  *         self._utf_refs = {}
92956  *         self._global_namespaces = []             # <<<<<<<<<<<<<<
92957  *         self._function_cache = {}
92958  *         self._eval_context_dict = None
92959  */
92960   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92961   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
92962   __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
92963   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_global_namespaces);
92964   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_global_namespaces));
92965   ((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_global_namespaces = __pyx_t_1;
92966   __pyx_t_1 = 0;
92967
92968   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":52
92969  *         self._utf_refs = {}
92970  *         self._global_namespaces = []
92971  *         self._function_cache = {}             # <<<<<<<<<<<<<<
92972  *         self._eval_context_dict = None
92973  * 
92974  */
92975   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
92976   __Pyx_GOTREF(((PyObject *)__pyx_1));
92977   __Pyx_GIVEREF(((PyObject *)__pyx_1));
92978   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_function_cache);
92979   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_function_cache));
92980   ((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_function_cache = __pyx_1;
92981   __pyx_1 = 0;
92982
92983   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":53
92984  *         self._global_namespaces = []
92985  *         self._function_cache = {}
92986  *         self._eval_context_dict = None             # <<<<<<<<<<<<<<
92987  * 
92988  *         if extensions is not None:
92989  */
92990   __Pyx_INCREF(Py_None);
92991   __Pyx_GIVEREF(Py_None);
92992   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_eval_context_dict);
92993   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_eval_context_dict));
92994   ((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_eval_context_dict = ((PyObject *)Py_None);
92995
92996   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":55
92997  *         self._eval_context_dict = None
92998  * 
92999  *         if extensions is not None:             # <<<<<<<<<<<<<<
93000  *             # convert extensions to UTF-8
93001  *             if python.PyDict_Check(extensions):
93002  */
93003   __pyx_t_2 = (__pyx_v_extensions != Py_None);
93004   if (__pyx_t_2) {
93005
93006     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":57
93007  *         if extensions is not None:
93008  *             # convert extensions to UTF-8
93009  *             if python.PyDict_Check(extensions):             # <<<<<<<<<<<<<<
93010  *                 extensions = (extensions,)
93011  *             # format: [ {(ns, name):function} ] -> {(ns_utf, name_utf):function}
93012  */
93013     __pyx_t_2 = PyDict_Check(__pyx_v_extensions);
93014     if (__pyx_t_2) {
93015
93016       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":58
93017  *             # convert extensions to UTF-8
93018  *             if python.PyDict_Check(extensions):
93019  *                 extensions = (extensions,)             # <<<<<<<<<<<<<<
93020  *             # format: [ {(ns, name):function} ] -> {(ns_utf, name_utf):function}
93021  *             new_extensions = {}
93022  */
93023       __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93024       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
93025       __Pyx_INCREF(__pyx_v_extensions);
93026       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_extensions);
93027       __Pyx_GIVEREF(__pyx_v_extensions);
93028       __Pyx_DECREF(__pyx_v_extensions);
93029       __pyx_v_extensions = ((PyObject *)__pyx_t_1);
93030       __pyx_t_1 = 0;
93031       goto __pyx_L7;
93032     }
93033     __pyx_L7:;
93034
93035     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":60
93036  *                 extensions = (extensions,)
93037  *             # format: [ {(ns, name):function} ] -> {(ns_utf, name_utf):function}
93038  *             new_extensions = {}             # <<<<<<<<<<<<<<
93039  *             for extension in extensions:
93040  *                 for (ns_uri, name), function in extension.items():
93041  */
93042     __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93043     __Pyx_GOTREF(((PyObject *)__pyx_1));
93044     __Pyx_DECREF(((PyObject *)__pyx_v_new_extensions));
93045     __pyx_v_new_extensions = __pyx_1;
93046     __pyx_1 = 0;
93047
93048     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":61
93049  *             # format: [ {(ns, name):function} ] -> {(ns_utf, name_utf):function}
93050  *             new_extensions = {}
93051  *             for extension in extensions:             # <<<<<<<<<<<<<<
93052  *                 for (ns_uri, name), function in extension.items():
93053  *                     if name is None:
93054  */
93055     if (PyList_CheckExact(__pyx_v_extensions) || PyTuple_CheckExact(__pyx_v_extensions)) {
93056       __pyx_t_3 = 0; __pyx_t_1 = __pyx_v_extensions; __Pyx_INCREF(__pyx_t_1);
93057     } else {
93058       __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_extensions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93059       __Pyx_GOTREF(__pyx_t_1);
93060     }
93061     for (;;) {
93062       if (likely(PyList_CheckExact(__pyx_t_1))) {
93063         if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
93064         __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++;
93065       } else if (likely(PyTuple_CheckExact(__pyx_t_1))) {
93066         if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
93067         __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++;
93068       } else {
93069         __pyx_t_4 = PyIter_Next(__pyx_t_1);
93070         if (!__pyx_t_4) {
93071           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93072           break;
93073         }
93074         __Pyx_GOTREF(__pyx_t_4);
93075       }
93076       __Pyx_DECREF(__pyx_v_extension);
93077       __pyx_v_extension = __pyx_t_4;
93078       __pyx_t_4 = 0;
93079
93080       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":62
93081  *             new_extensions = {}
93082  *             for extension in extensions:
93083  *                 for (ns_uri, name), function in extension.items():             # <<<<<<<<<<<<<<
93084  *                     if name is None:
93085  *                         raise ValueError, u"extensions must have non empty names"
93086  */
93087       __pyx_t_4 = PyObject_GetAttr(__pyx_v_extension, __pyx_kp_items); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93088       __Pyx_GOTREF(__pyx_t_4);
93089       __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93090       __Pyx_GOTREF(__pyx_t_6);
93091       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
93092       if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) {
93093         __pyx_t_5 = 0; __pyx_t_4 = __pyx_t_6; __Pyx_INCREF(__pyx_t_4);
93094       } else {
93095         __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93096         __Pyx_GOTREF(__pyx_t_4);
93097       }
93098       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
93099       for (;;) {
93100         if (likely(PyList_CheckExact(__pyx_t_4))) {
93101           if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
93102           __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++;
93103         } else if (likely(PyTuple_CheckExact(__pyx_t_4))) {
93104           if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
93105           __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++;
93106         } else {
93107           __pyx_t_6 = PyIter_Next(__pyx_t_4);
93108           if (!__pyx_t_6) {
93109             if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93110             break;
93111           }
93112           __Pyx_GOTREF(__pyx_t_6);
93113         }
93114         if (PyTuple_CheckExact(__pyx_t_6) && likely(PyTuple_GET_SIZE(__pyx_t_6) == 2)) {
93115           PyObject* tuple = __pyx_t_6;
93116           __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
93117           __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
93118           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
93119           if (PyTuple_CheckExact(__pyx_2) && likely(PyTuple_GET_SIZE(__pyx_2) == 2)) {
93120             PyObject* tuple = __pyx_2;
93121             __pyx_5 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_5);
93122             __pyx_6 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_6);
93123             __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
93124             __Pyx_DECREF(__pyx_v_ns_uri);
93125             __pyx_v_ns_uri = __pyx_5;
93126             __pyx_5 = 0;
93127             __Pyx_DECREF(__pyx_v_name);
93128             __pyx_v_name = __pyx_6;
93129             __pyx_6 = 0;
93130           } else {
93131             __pyx_4 = PyObject_GetIter(__pyx_2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93132             __Pyx_GOTREF(__pyx_4);
93133             __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
93134             __pyx_5 = __Pyx_UnpackItem(__pyx_4, 0); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93135             __Pyx_GOTREF(__pyx_5);
93136             __pyx_6 = __Pyx_UnpackItem(__pyx_4, 1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93137             __Pyx_GOTREF(__pyx_6);
93138             if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93139             __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
93140             __Pyx_DECREF(__pyx_v_ns_uri);
93141             __pyx_v_ns_uri = __pyx_5;
93142             __pyx_5 = 0;
93143             __Pyx_DECREF(__pyx_v_name);
93144             __pyx_v_name = __pyx_6;
93145             __pyx_6 = 0;
93146           }
93147           __Pyx_DECREF(__pyx_v_function);
93148           __pyx_v_function = __pyx_3;
93149           __pyx_3 = 0;
93150         } else {
93151           __pyx_1 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93152           __Pyx_GOTREF(__pyx_1);
93153           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
93154           __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93155           __Pyx_GOTREF(__pyx_2);
93156           __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93157           __Pyx_GOTREF(__pyx_3);
93158           if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93159           __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
93160           if (PyTuple_CheckExact(__pyx_2) && likely(PyTuple_GET_SIZE(__pyx_2) == 2)) {
93161             PyObject* tuple = __pyx_2;
93162             __pyx_5 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_5);
93163             __pyx_6 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_6);
93164             __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
93165             __Pyx_DECREF(__pyx_v_ns_uri);
93166             __pyx_v_ns_uri = __pyx_5;
93167             __pyx_5 = 0;
93168             __Pyx_DECREF(__pyx_v_name);
93169             __pyx_v_name = __pyx_6;
93170             __pyx_6 = 0;
93171           } else {
93172             __pyx_4 = PyObject_GetIter(__pyx_2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93173             __Pyx_GOTREF(__pyx_4);
93174             __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
93175             __pyx_5 = __Pyx_UnpackItem(__pyx_4, 0); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93176             __Pyx_GOTREF(__pyx_5);
93177             __pyx_6 = __Pyx_UnpackItem(__pyx_4, 1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93178             __Pyx_GOTREF(__pyx_6);
93179             if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93180             __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
93181             __Pyx_DECREF(__pyx_v_ns_uri);
93182             __pyx_v_ns_uri = __pyx_5;
93183             __pyx_5 = 0;
93184             __Pyx_DECREF(__pyx_v_name);
93185             __pyx_v_name = __pyx_6;
93186             __pyx_6 = 0;
93187           }
93188           __Pyx_DECREF(__pyx_v_function);
93189           __pyx_v_function = __pyx_3;
93190           __pyx_3 = 0;
93191         }
93192
93193         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":63
93194  *             for extension in extensions:
93195  *                 for (ns_uri, name), function in extension.items():
93196  *                     if name is None:             # <<<<<<<<<<<<<<
93197  *                         raise ValueError, u"extensions must have non empty names"
93198  *                     ns_utf   = self._to_utf(ns_uri)
93199  */
93200         __pyx_t_2 = (__pyx_v_name == Py_None);
93201         if (__pyx_t_2) {
93202
93203           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":64
93204  *                 for (ns_uri, name), function in extension.items():
93205  *                     if name is None:
93206  *                         raise ValueError, u"extensions must have non empty names"             # <<<<<<<<<<<<<<
93207  *                     ns_utf   = self._to_utf(ns_uri)
93208  *                     name_utf = self._to_utf(name)
93209  */
93210           __Pyx_Raise(__pyx_builtin_ValueError, ((PyObject *)__pyx_kp_556), 0);
93211           {__pyx_filename = __pyx_f[5]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93212           goto __pyx_L12;
93213         }
93214         __pyx_L12:;
93215
93216         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":65
93217  *                     if name is None:
93218  *                         raise ValueError, u"extensions must have non empty names"
93219  *                     ns_utf   = self._to_utf(ns_uri)             # <<<<<<<<<<<<<<
93220  *                     name_utf = self._to_utf(name)
93221  *                     new_extensions[(ns_utf, name_utf)] = function
93222  */
93223         __pyx_t_6 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseContext *)((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->__pyx_vtab)->_to_utf(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self), __pyx_v_ns_uri); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93224         __Pyx_GOTREF(__pyx_t_6);
93225         __Pyx_DECREF(__pyx_v_ns_utf);
93226         __pyx_v_ns_utf = __pyx_t_6;
93227         __pyx_t_6 = 0;
93228
93229         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":66
93230  *                         raise ValueError, u"extensions must have non empty names"
93231  *                     ns_utf   = self._to_utf(ns_uri)
93232  *                     name_utf = self._to_utf(name)             # <<<<<<<<<<<<<<
93233  *                     new_extensions[(ns_utf, name_utf)] = function
93234  *             extensions = new_extensions or None
93235  */
93236         __pyx_t_6 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseContext *)((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->__pyx_vtab)->_to_utf(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self), __pyx_v_name); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93237         __Pyx_GOTREF(__pyx_t_6);
93238         __Pyx_DECREF(__pyx_v_name_utf);
93239         __pyx_v_name_utf = __pyx_t_6;
93240         __pyx_t_6 = 0;
93241
93242         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":67
93243  *                     ns_utf   = self._to_utf(ns_uri)
93244  *                     name_utf = self._to_utf(name)
93245  *                     new_extensions[(ns_utf, name_utf)] = function             # <<<<<<<<<<<<<<
93246  *             extensions = new_extensions or None
93247  * 
93248  */
93249         __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93250         __Pyx_GOTREF(((PyObject *)__pyx_t_6));
93251         __Pyx_INCREF(__pyx_v_ns_utf);
93252         PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_ns_utf);
93253         __Pyx_GIVEREF(__pyx_v_ns_utf);
93254         __Pyx_INCREF(__pyx_v_name_utf);
93255         PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_name_utf);
93256         __Pyx_GIVEREF(__pyx_v_name_utf);
93257         if (PyDict_SetItem(((PyObject *)__pyx_v_new_extensions), ((PyObject *)__pyx_t_6), __pyx_v_function) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93258         __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
93259       }
93260       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
93261     }
93262     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
93263
93264     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":68
93265  *                     name_utf = self._to_utf(name)
93266  *                     new_extensions[(ns_utf, name_utf)] = function
93267  *             extensions = new_extensions or None             # <<<<<<<<<<<<<<
93268  * 
93269  *         if namespaces is not None:
93270  */
93271     __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_new_extensions)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93272     if (!__pyx_t_2) {
93273       __Pyx_INCREF(Py_None);
93274       __pyx_t_1 = Py_None;
93275     } else {
93276       __Pyx_INCREF(((PyObject *)__pyx_v_new_extensions));
93277       __pyx_t_1 = __pyx_v_new_extensions;
93278     }
93279     __Pyx_DECREF(__pyx_v_extensions);
93280     __pyx_v_extensions = __pyx_t_1;
93281     __pyx_t_1 = 0;
93282     goto __pyx_L6;
93283   }
93284   __pyx_L6:;
93285
93286   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":70
93287  *             extensions = new_extensions or None
93288  * 
93289  *         if namespaces is not None:             # <<<<<<<<<<<<<<
93290  *             if python.PyDict_Check(namespaces):
93291  *                 namespaces = namespaces.items()
93292  */
93293   __pyx_t_2 = (__pyx_v_namespaces != Py_None);
93294   if (__pyx_t_2) {
93295
93296     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":71
93297  * 
93298  *         if namespaces is not None:
93299  *             if python.PyDict_Check(namespaces):             # <<<<<<<<<<<<<<
93300  *                 namespaces = namespaces.items()
93301  *             if namespaces:
93302  */
93303     __pyx_t_2 = PyDict_Check(__pyx_v_namespaces);
93304     if (__pyx_t_2) {
93305
93306       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":72
93307  *         if namespaces is not None:
93308  *             if python.PyDict_Check(namespaces):
93309  *                 namespaces = namespaces.items()             # <<<<<<<<<<<<<<
93310  *             if namespaces:
93311  *                 ns = []
93312  */
93313       __pyx_t_1 = PyObject_GetAttr(__pyx_v_namespaces, __pyx_kp_items); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93314       __Pyx_GOTREF(__pyx_t_1);
93315       __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93316       __Pyx_GOTREF(__pyx_t_4);
93317       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
93318       __Pyx_DECREF(__pyx_v_namespaces);
93319       __pyx_v_namespaces = __pyx_t_4;
93320       __pyx_t_4 = 0;
93321       goto __pyx_L14;
93322     }
93323     __pyx_L14:;
93324
93325     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":73
93326  *             if python.PyDict_Check(namespaces):
93327  *                 namespaces = namespaces.items()
93328  *             if namespaces:             # <<<<<<<<<<<<<<
93329  *                 ns = []
93330  *                 for prefix, ns_uri in namespaces:
93331  */
93332     __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_namespaces); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93333     if (__pyx_t_2) {
93334
93335       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":74
93336  *                 namespaces = namespaces.items()
93337  *             if namespaces:
93338  *                 ns = []             # <<<<<<<<<<<<<<
93339  *                 for prefix, ns_uri in namespaces:
93340  *                     if prefix is None or not prefix:
93341  */
93342       __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93343       __Pyx_GOTREF(((PyObject *)__pyx_t_4));
93344       __Pyx_DECREF(((PyObject *)__pyx_v_ns));
93345       __pyx_v_ns = __pyx_t_4;
93346       __pyx_t_4 = 0;
93347
93348       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":75
93349  *             if namespaces:
93350  *                 ns = []
93351  *                 for prefix, ns_uri in namespaces:             # <<<<<<<<<<<<<<
93352  *                     if prefix is None or not prefix:
93353  *                         raise TypeError, \
93354  */
93355       if (PyList_CheckExact(__pyx_v_namespaces) || PyTuple_CheckExact(__pyx_v_namespaces)) {
93356         __pyx_t_3 = 0; __pyx_t_4 = __pyx_v_namespaces; __Pyx_INCREF(__pyx_t_4);
93357       } else {
93358         __pyx_t_3 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_namespaces); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93359         __Pyx_GOTREF(__pyx_t_4);
93360       }
93361       for (;;) {
93362         if (likely(PyList_CheckExact(__pyx_t_4))) {
93363           if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_4)) break;
93364           __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
93365         } else if (likely(PyTuple_CheckExact(__pyx_t_4))) {
93366           if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
93367           __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
93368         } else {
93369           __pyx_t_1 = PyIter_Next(__pyx_t_4);
93370           if (!__pyx_t_1) {
93371             if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93372             break;
93373           }
93374           __Pyx_GOTREF(__pyx_t_1);
93375         }
93376         if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 2)) {
93377           PyObject* tuple = __pyx_t_1;
93378           __pyx_5 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_5);
93379           __pyx_6 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_6);
93380           __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
93381           __Pyx_DECREF(__pyx_v_prefix);
93382           __pyx_v_prefix = __pyx_5;
93383           __pyx_5 = 0;
93384           __Pyx_DECREF(__pyx_v_ns_uri);
93385           __pyx_v_ns_uri = __pyx_6;
93386           __pyx_6 = 0;
93387         } else {
93388           __pyx_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93389           __Pyx_GOTREF(__pyx_4);
93390           __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
93391           __pyx_5 = __Pyx_UnpackItem(__pyx_4, 0); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93392           __Pyx_GOTREF(__pyx_5);
93393           __pyx_6 = __Pyx_UnpackItem(__pyx_4, 1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93394           __Pyx_GOTREF(__pyx_6);
93395           if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93396           __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
93397           __Pyx_DECREF(__pyx_v_prefix);
93398           __pyx_v_prefix = __pyx_5;
93399           __pyx_5 = 0;
93400           __Pyx_DECREF(__pyx_v_ns_uri);
93401           __pyx_v_ns_uri = __pyx_6;
93402           __pyx_6 = 0;
93403         }
93404
93405         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":76
93406  *                 ns = []
93407  *                 for prefix, ns_uri in namespaces:
93408  *                     if prefix is None or not prefix:             # <<<<<<<<<<<<<<
93409  *                         raise TypeError, \
93410  *                             u"empty namespace prefix is not supported in XPath"
93411  */
93412         __pyx_t_2 = (__pyx_v_prefix == Py_None);
93413         if (!__pyx_t_2) {
93414           __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_prefix); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93415           __pyx_t_8 = (!__pyx_t_7);
93416         } else {
93417           __pyx_t_8 = __pyx_t_2;
93418         }
93419         if (__pyx_t_8) {
93420
93421           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":78
93422  *                     if prefix is None or not prefix:
93423  *                         raise TypeError, \
93424  *                             u"empty namespace prefix is not supported in XPath"             # <<<<<<<<<<<<<<
93425  *                     if ns_uri is None or not ns_uri:
93426  *                         raise TypeError, \
93427  */
93428           __Pyx_Raise(__pyx_builtin_TypeError, ((PyObject *)__pyx_kp_557), 0);
93429           {__pyx_filename = __pyx_f[5]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93430           goto __pyx_L18;
93431         }
93432         __pyx_L18:;
93433
93434         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":79
93435  *                         raise TypeError, \
93436  *                             u"empty namespace prefix is not supported in XPath"
93437  *                     if ns_uri is None or not ns_uri:             # <<<<<<<<<<<<<<
93438  *                         raise TypeError, \
93439  *                             u"setting default namespace is not supported in XPath"
93440  */
93441         __pyx_t_8 = (__pyx_v_ns_uri == Py_None);
93442         if (!__pyx_t_8) {
93443           __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_ns_uri); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93444           __pyx_t_7 = (!__pyx_t_2);
93445         } else {
93446           __pyx_t_7 = __pyx_t_8;
93447         }
93448         if (__pyx_t_7) {
93449
93450           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":81
93451  *                     if ns_uri is None or not ns_uri:
93452  *                         raise TypeError, \
93453  *                             u"setting default namespace is not supported in XPath"             # <<<<<<<<<<<<<<
93454  *                     prefix_utf = self._to_utf(prefix)
93455  *                     ns_uri_utf = self._to_utf(ns_uri)
93456  */
93457           __Pyx_Raise(__pyx_builtin_TypeError, ((PyObject *)__pyx_kp_558), 0);
93458           {__pyx_filename = __pyx_f[5]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93459           goto __pyx_L19;
93460         }
93461         __pyx_L19:;
93462
93463         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":82
93464  *                         raise TypeError, \
93465  *                             u"setting default namespace is not supported in XPath"
93466  *                     prefix_utf = self._to_utf(prefix)             # <<<<<<<<<<<<<<
93467  *                     ns_uri_utf = self._to_utf(ns_uri)
93468  *                     ns.append( (prefix_utf, ns_uri_utf) )
93469  */
93470         __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseContext *)((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->__pyx_vtab)->_to_utf(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self), __pyx_v_prefix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93471         __Pyx_GOTREF(__pyx_t_1);
93472         __Pyx_DECREF(__pyx_v_prefix_utf);
93473         __pyx_v_prefix_utf = __pyx_t_1;
93474         __pyx_t_1 = 0;
93475
93476         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":83
93477  *                             u"setting default namespace is not supported in XPath"
93478  *                     prefix_utf = self._to_utf(prefix)
93479  *                     ns_uri_utf = self._to_utf(ns_uri)             # <<<<<<<<<<<<<<
93480  *                     ns.append( (prefix_utf, ns_uri_utf) )
93481  *                 namespaces = ns
93482  */
93483         __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseContext *)((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->__pyx_vtab)->_to_utf(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self), __pyx_v_ns_uri); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93484         __Pyx_GOTREF(__pyx_t_1);
93485         __Pyx_DECREF(__pyx_v_ns_uri_utf);
93486         __pyx_v_ns_uri_utf = __pyx_t_1;
93487         __pyx_t_1 = 0;
93488
93489         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":84
93490  *                     prefix_utf = self._to_utf(prefix)
93491  *                     ns_uri_utf = self._to_utf(ns_uri)
93492  *                     ns.append( (prefix_utf, ns_uri_utf) )             # <<<<<<<<<<<<<<
93493  *                 namespaces = ns
93494  *             else:
93495  */
93496         __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93497         __Pyx_GOTREF(((PyObject *)__pyx_t_1));
93498         __Pyx_INCREF(__pyx_v_prefix_utf);
93499         PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_prefix_utf);
93500         __Pyx_GIVEREF(__pyx_v_prefix_utf);
93501         __Pyx_INCREF(__pyx_v_ns_uri_utf);
93502         PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ns_uri_utf);
93503         __Pyx_GIVEREF(__pyx_v_ns_uri_utf);
93504         __pyx_t_9 = PyList_Append(((PyObject *)__pyx_v_ns), ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93505         __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
93506       }
93507       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
93508
93509       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":85
93510  *                     ns_uri_utf = self._to_utf(ns_uri)
93511  *                     ns.append( (prefix_utf, ns_uri_utf) )
93512  *                 namespaces = ns             # <<<<<<<<<<<<<<
93513  *             else:
93514  *                 namespaces = None
93515  */
93516       __Pyx_INCREF(((PyObject *)__pyx_v_ns));
93517       __Pyx_DECREF(__pyx_v_namespaces);
93518       __pyx_v_namespaces = ((PyObject *)__pyx_v_ns);
93519       goto __pyx_L15;
93520     }
93521     /*else*/ {
93522
93523       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":87
93524  *                 namespaces = ns
93525  *             else:
93526  *                 namespaces = None             # <<<<<<<<<<<<<<
93527  * 
93528  *         self._doc        = None
93529  */
93530       __Pyx_INCREF(Py_None);
93531       __Pyx_DECREF(__pyx_v_namespaces);
93532       __pyx_v_namespaces = Py_None;
93533     }
93534     __pyx_L15:;
93535     goto __pyx_L13;
93536   }
93537   __pyx_L13:;
93538
93539   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":89
93540  *                 namespaces = None
93541  * 
93542  *         self._doc        = None             # <<<<<<<<<<<<<<
93543  *         self._exc        = _ExceptionContext()
93544  *         self._extensions = extensions
93545  */
93546   __Pyx_INCREF(Py_None);
93547   __Pyx_GIVEREF(Py_None);
93548   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_doc);
93549   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_doc));
93550   ((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_doc = ((struct LxmlDocument *)Py_None);
93551
93552   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":90
93553  * 
93554  *         self._doc        = None
93555  *         self._exc        = _ExceptionContext()             # <<<<<<<<<<<<<<
93556  *         self._extensions = extensions
93557  *         self._namespaces = namespaces
93558  */
93559   __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ExceptionContext)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93560   __Pyx_GOTREF(__pyx_t_4);
93561   if (!(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__ExceptionContext))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93562   __Pyx_GIVEREF(__pyx_t_4);
93563   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_exc);
93564   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_exc));
93565   ((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_exc = ((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_t_4);
93566   __pyx_t_4 = 0;
93567
93568   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":91
93569  *         self._doc        = None
93570  *         self._exc        = _ExceptionContext()
93571  *         self._extensions = extensions             # <<<<<<<<<<<<<<
93572  *         self._namespaces = namespaces
93573  *         self._temp_refs  = _TempStore()
93574  */
93575   if (!(likely(PyDict_CheckExact(__pyx_v_extensions)) || (__pyx_v_extensions) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected dict, got %s", Py_TYPE(__pyx_v_extensions)->tp_name), 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93576   __Pyx_INCREF(__pyx_v_extensions);
93577   __Pyx_GIVEREF(__pyx_v_extensions);
93578   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_extensions);
93579   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_extensions));
93580   ((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_extensions = ((PyObject *)__pyx_v_extensions);
93581
93582   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":92
93583  *         self._exc        = _ExceptionContext()
93584  *         self._extensions = extensions
93585  *         self._namespaces = namespaces             # <<<<<<<<<<<<<<
93586  *         self._temp_refs  = _TempStore()
93587  *         self._build_smart_strings = build_smart_strings
93588  */
93589   if (!(likely(PyList_CheckExact(__pyx_v_namespaces)) || (__pyx_v_namespaces) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected list, got %s", Py_TYPE(__pyx_v_namespaces)->tp_name), 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93590   __Pyx_INCREF(__pyx_v_namespaces);
93591   __Pyx_GIVEREF(__pyx_v_namespaces);
93592   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_namespaces);
93593   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_namespaces));
93594   ((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_namespaces = ((PyObject *)__pyx_v_namespaces);
93595
93596   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":93
93597  *         self._extensions = extensions
93598  *         self._namespaces = namespaces
93599  *         self._temp_refs  = _TempStore()             # <<<<<<<<<<<<<<
93600  *         self._build_smart_strings = build_smart_strings
93601  * 
93602  */
93603   __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__TempStore)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93604   __Pyx_GOTREF(__pyx_t_4);
93605   if (!(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__TempStore))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93606   __Pyx_GIVEREF(__pyx_t_4);
93607   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_temp_refs);
93608   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_temp_refs));
93609   ((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_temp_refs = ((struct __pyx_obj_4lxml_5etree__TempStore *)__pyx_t_4);
93610   __pyx_t_4 = 0;
93611
93612   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":94
93613  *         self._namespaces = namespaces
93614  *         self._temp_refs  = _TempStore()
93615  *         self._build_smart_strings = build_smart_strings             # <<<<<<<<<<<<<<
93616  * 
93617  *         if enable_regexp:
93618  */
93619   __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_build_smart_strings); if (unlikely((__pyx_t_7 == (int)-1))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93620   ((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_build_smart_strings = __pyx_t_7;
93621
93622   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":96
93623  *         self._build_smart_strings = build_smart_strings
93624  * 
93625  *         if enable_regexp:             # <<<<<<<<<<<<<<
93626  *             _regexp = _ExsltRegExp()
93627  *             _regexp._register_in_context(self)
93628  */
93629   __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_enable_regexp); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93630   if (__pyx_t_7) {
93631
93632     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":97
93633  * 
93634  *         if enable_regexp:
93635  *             _regexp = _ExsltRegExp()             # <<<<<<<<<<<<<<
93636  *             _regexp._register_in_context(self)
93637  * 
93638  */
93639     __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ExsltRegExp)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93640     __Pyx_GOTREF(__pyx_t_4);
93641     if (!(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__ExsltRegExp))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93642     __Pyx_DECREF(((PyObject *)__pyx_v__regexp));
93643     __pyx_v__regexp = ((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)__pyx_t_4);
93644     __pyx_t_4 = 0;
93645
93646     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":98
93647  *         if enable_regexp:
93648  *             _regexp = _ExsltRegExp()
93649  *             _regexp._register_in_context(self)             # <<<<<<<<<<<<<<
93650  * 
93651  *     cdef _BaseContext _copy(self):
93652  */
93653     __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__ExsltRegExp *)__pyx_v__regexp->__pyx_vtab)->_register_in_context(__pyx_v__regexp, ((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93654     __Pyx_GOTREF(__pyx_t_4);
93655     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
93656     goto __pyx_L20;
93657   }
93658   __pyx_L20:;
93659
93660   __pyx_r = 0;
93661   goto __pyx_L0;
93662   __pyx_L1_error:;
93663   __Pyx_XDECREF(__pyx_1);
93664   __Pyx_XDECREF(__pyx_2);
93665   __Pyx_XDECREF(__pyx_3);
93666   __Pyx_XDECREF(__pyx_4);
93667   __Pyx_XDECREF(__pyx_5);
93668   __Pyx_XDECREF(__pyx_6);
93669   __Pyx_XDECREF(__pyx_t_1);
93670   __Pyx_XDECREF(__pyx_t_4);
93671   __Pyx_XDECREF(__pyx_t_6);
93672   __Pyx_AddTraceback("lxml.etree._BaseContext.__init__");
93673   __pyx_r = -1;
93674   __pyx_L0:;
93675   __Pyx_DECREF((PyObject *)__pyx_v__regexp);
93676   __Pyx_DECREF(__pyx_v_new_extensions);
93677   __Pyx_DECREF(__pyx_v_ns);
93678   __Pyx_DECREF(__pyx_v_extension);
93679   __Pyx_DECREF(__pyx_v_ns_uri);
93680   __Pyx_DECREF(__pyx_v_name);
93681   __Pyx_DECREF(__pyx_v_function);
93682   __Pyx_DECREF(__pyx_v_ns_utf);
93683   __Pyx_DECREF(__pyx_v_name_utf);
93684   __Pyx_DECREF(__pyx_v_prefix);
93685   __Pyx_DECREF(__pyx_v_prefix_utf);
93686   __Pyx_DECREF(__pyx_v_ns_uri_utf);
93687   __Pyx_DECREF(__pyx_v_namespaces);
93688   __Pyx_DECREF(__pyx_v_extensions);
93689   __Pyx_FinishRefcountContext();
93690   return __pyx_r;
93691 }
93692
93693 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":100
93694  *             _regexp._register_in_context(self)
93695  * 
93696  *     cdef _BaseContext _copy(self):             # <<<<<<<<<<<<<<
93697  *         cdef _BaseContext context
93698  *         if self._namespaces is not None:
93699  */
93700
93701 static  struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_f_4lxml_5etree_12_BaseContext__copy(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self) {
93702   struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_context;
93703   PyObject *__pyx_v_namespaces;
93704   struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_r = NULL;
93705   PyObject *__pyx_1 = 0;
93706   int __pyx_t_1;
93707   PyObject *__pyx_t_2 = NULL;
93708   PyObject *__pyx_t_3 = NULL;
93709   PyObject *__pyx_t_4 = NULL;
93710   PyObject *__pyx_t_5 = NULL;
93711   __Pyx_SetupRefcountContext("_copy");
93712   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__BaseContext *)Py_None); __Pyx_INCREF(Py_None);
93713   __pyx_v_namespaces = Py_None; __Pyx_INCREF(Py_None);
93714
93715   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":102
93716  *     cdef _BaseContext _copy(self):
93717  *         cdef _BaseContext context
93718  *         if self._namespaces is not None:             # <<<<<<<<<<<<<<
93719  *             namespaces = self._namespaces[:]
93720  *         context = self.__class__(namespaces, None, False,
93721  */
93722   __pyx_t_1 = (__pyx_v_self->_namespaces != ((PyObject *)Py_None));
93723   if (__pyx_t_1) {
93724
93725     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":103
93726  *         cdef _BaseContext context
93727  *         if self._namespaces is not None:
93728  *             namespaces = self._namespaces[:]             # <<<<<<<<<<<<<<
93729  *         context = self.__class__(namespaces, None, False,
93730  *                                  self._build_smart_strings)
93731  */
93732     __pyx_1 = PySequence_GetSlice(((PyObject *)__pyx_v_self->_namespaces), 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93733     __Pyx_GOTREF(((PyObject *)__pyx_1));
93734     __Pyx_DECREF(__pyx_v_namespaces);
93735     __pyx_v_namespaces = ((PyObject *)__pyx_1);
93736     __pyx_1 = 0;
93737     goto __pyx_L3;
93738   }
93739   __pyx_L3:;
93740
93741   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":104
93742  *         if self._namespaces is not None:
93743  *             namespaces = self._namespaces[:]
93744  *         context = self.__class__(namespaces, None, False,             # <<<<<<<<<<<<<<
93745  *                                  self._build_smart_strings)
93746  *         if self._extensions is not None:
93747  */
93748   __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_kp___class__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93749   __Pyx_GOTREF(__pyx_t_2);
93750   __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93751   __Pyx_GOTREF(__pyx_t_3);
93752
93753   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":105
93754  *             namespaces = self._namespaces[:]
93755  *         context = self.__class__(namespaces, None, False,
93756  *                                  self._build_smart_strings)             # <<<<<<<<<<<<<<
93757  *         if self._extensions is not None:
93758  *             context._extensions = self._extensions.copy()
93759  */
93760   __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->_build_smart_strings); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93761   __Pyx_GOTREF(__pyx_t_4);
93762   __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93763   __Pyx_GOTREF(((PyObject *)__pyx_t_5));
93764   __Pyx_INCREF(__pyx_v_namespaces);
93765   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_namespaces);
93766   __Pyx_GIVEREF(__pyx_v_namespaces);
93767   __Pyx_INCREF(Py_None);
93768   PyTuple_SET_ITEM(__pyx_t_5, 1, Py_None);
93769   __Pyx_GIVEREF(Py_None);
93770   PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
93771   __Pyx_GIVEREF(__pyx_t_3);
93772   PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
93773   __Pyx_GIVEREF(__pyx_t_4);
93774   __pyx_t_3 = 0;
93775   __pyx_t_4 = 0;
93776   __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93777   __Pyx_GOTREF(__pyx_t_4);
93778   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
93779   __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
93780   if (!(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__BaseContext))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93781   __Pyx_DECREF(((PyObject *)__pyx_v_context));
93782   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_t_4);
93783   __pyx_t_4 = 0;
93784
93785   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":106
93786  *         context = self.__class__(namespaces, None, False,
93787  *                                  self._build_smart_strings)
93788  *         if self._extensions is not None:             # <<<<<<<<<<<<<<
93789  *             context._extensions = self._extensions.copy()
93790  *         return context
93791  */
93792   __pyx_t_1 = (__pyx_v_self->_extensions != ((PyObject *)Py_None));
93793   if (__pyx_t_1) {
93794
93795     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":107
93796  *                                  self._build_smart_strings)
93797  *         if self._extensions is not None:
93798  *             context._extensions = self._extensions.copy()             # <<<<<<<<<<<<<<
93799  *         return context
93800  * 
93801  */
93802     __pyx_t_4 = PyDict_Copy(((PyObject *)__pyx_v_self->_extensions)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93803     __Pyx_GOTREF(__pyx_t_4);
93804     if (!(likely(PyDict_CheckExact(__pyx_t_4)) || (__pyx_t_4) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected dict, got %s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93805     __Pyx_GIVEREF(__pyx_t_4);
93806     __Pyx_GOTREF(__pyx_v_context->_extensions);
93807     __Pyx_DECREF(((PyObject *)__pyx_v_context->_extensions));
93808     __pyx_v_context->_extensions = ((PyObject *)__pyx_t_4);
93809     __pyx_t_4 = 0;
93810     goto __pyx_L4;
93811   }
93812   __pyx_L4:;
93813
93814   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":108
93815  *         if self._extensions is not None:
93816  *             context._extensions = self._extensions.copy()
93817  *         return context             # <<<<<<<<<<<<<<
93818  * 
93819  *     cdef object _to_utf(self, s):
93820  */
93821   __Pyx_XDECREF(((PyObject *)__pyx_r));
93822   __Pyx_INCREF(((PyObject *)__pyx_v_context));
93823   __pyx_r = __pyx_v_context;
93824   goto __pyx_L0;
93825
93826   __pyx_r = ((struct __pyx_obj_4lxml_5etree__BaseContext *)Py_None); __Pyx_INCREF(Py_None);
93827   goto __pyx_L0;
93828   __pyx_L1_error:;
93829   __Pyx_XDECREF(__pyx_1);
93830   __Pyx_XDECREF(__pyx_t_2);
93831   __Pyx_XDECREF(__pyx_t_3);
93832   __Pyx_XDECREF(__pyx_t_4);
93833   __Pyx_XDECREF(__pyx_t_5);
93834   __Pyx_AddTraceback("lxml.etree._BaseContext._copy");
93835   __pyx_r = 0;
93836   __pyx_L0:;
93837   __Pyx_DECREF((PyObject *)__pyx_v_context);
93838   __Pyx_DECREF(__pyx_v_namespaces);
93839   __Pyx_XGIVEREF((PyObject *)__pyx_r);
93840   __Pyx_FinishRefcountContext();
93841   return __pyx_r;
93842 }
93843
93844 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":110
93845  *         return context
93846  * 
93847  *     cdef object _to_utf(self, s):             # <<<<<<<<<<<<<<
93848  *         u"Convert to UTF-8 and keep a reference to the encoded string"
93849  *         cdef python.PyObject* dict_result
93850  */
93851
93852 static  PyObject *__pyx_f_4lxml_5etree_12_BaseContext__to_utf(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self, PyObject *__pyx_v_s) {
93853   PyObject *__pyx_v_dict_result;
93854   PyObject *__pyx_v_utf;
93855   PyObject *__pyx_r = NULL;
93856   int __pyx_t_1;
93857   PyObject *__pyx_t_2 = NULL;
93858   __Pyx_SetupRefcountContext("_to_utf");
93859   __pyx_v_utf = Py_None; __Pyx_INCREF(Py_None);
93860
93861   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":113
93862  *         u"Convert to UTF-8 and keep a reference to the encoded string"
93863  *         cdef python.PyObject* dict_result
93864  *         if s is None:             # <<<<<<<<<<<<<<
93865  *             return None
93866  *         dict_result = python.PyDict_GetItem(self._utf_refs, s)
93867  */
93868   __pyx_t_1 = (__pyx_v_s == Py_None);
93869   if (__pyx_t_1) {
93870
93871     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":114
93872  *         cdef python.PyObject* dict_result
93873  *         if s is None:
93874  *             return None             # <<<<<<<<<<<<<<
93875  *         dict_result = python.PyDict_GetItem(self._utf_refs, s)
93876  *         if dict_result is not NULL:
93877  */
93878     __Pyx_XDECREF(__pyx_r);
93879     __Pyx_INCREF(Py_None);
93880     __pyx_r = Py_None;
93881     goto __pyx_L0;
93882     goto __pyx_L3;
93883   }
93884   __pyx_L3:;
93885
93886   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":115
93887  *         if s is None:
93888  *             return None
93889  *         dict_result = python.PyDict_GetItem(self._utf_refs, s)             # <<<<<<<<<<<<<<
93890  *         if dict_result is not NULL:
93891  *             return <object>dict_result
93892  */
93893   __pyx_v_dict_result = PyDict_GetItem(((PyObject *)__pyx_v_self->_utf_refs), __pyx_v_s);
93894
93895   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":116
93896  *             return None
93897  *         dict_result = python.PyDict_GetItem(self._utf_refs, s)
93898  *         if dict_result is not NULL:             # <<<<<<<<<<<<<<
93899  *             return <object>dict_result
93900  *         utf = _utf8(s)
93901  */
93902   __pyx_t_1 = (__pyx_v_dict_result != NULL);
93903   if (__pyx_t_1) {
93904
93905     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":117
93906  *         dict_result = python.PyDict_GetItem(self._utf_refs, s)
93907  *         if dict_result is not NULL:
93908  *             return <object>dict_result             # <<<<<<<<<<<<<<
93909  *         utf = _utf8(s)
93910  *         self._utf_refs[s] = utf
93911  */
93912     __Pyx_XDECREF(__pyx_r);
93913     __Pyx_INCREF(((PyObject *)__pyx_v_dict_result));
93914     __pyx_r = ((PyObject *)__pyx_v_dict_result);
93915     goto __pyx_L0;
93916     goto __pyx_L4;
93917   }
93918   __pyx_L4:;
93919
93920   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":118
93921  *         if dict_result is not NULL:
93922  *             return <object>dict_result
93923  *         utf = _utf8(s)             # <<<<<<<<<<<<<<
93924  *         self._utf_refs[s] = utf
93925  *         return utf
93926  */
93927   __pyx_t_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93928   __Pyx_GOTREF(__pyx_t_2);
93929   __Pyx_DECREF(__pyx_v_utf);
93930   __pyx_v_utf = __pyx_t_2;
93931   __pyx_t_2 = 0;
93932
93933   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":119
93934  *             return <object>dict_result
93935  *         utf = _utf8(s)
93936  *         self._utf_refs[s] = utf             # <<<<<<<<<<<<<<
93937  *         return utf
93938  * 
93939  */
93940   if (PyDict_SetItem(((PyObject *)__pyx_v_self->_utf_refs), __pyx_v_s, __pyx_v_utf) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
93941
93942   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":120
93943  *         utf = _utf8(s)
93944  *         self._utf_refs[s] = utf
93945  *         return utf             # <<<<<<<<<<<<<<
93946  * 
93947  *     cdef void _set_xpath_context(self, xpath.xmlXPathContext* xpathCtxt):
93948  */
93949   __Pyx_XDECREF(__pyx_r);
93950   __Pyx_INCREF(__pyx_v_utf);
93951   __pyx_r = __pyx_v_utf;
93952   goto __pyx_L0;
93953
93954   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
93955   goto __pyx_L0;
93956   __pyx_L1_error:;
93957   __Pyx_XDECREF(__pyx_t_2);
93958   __Pyx_AddTraceback("lxml.etree._BaseContext._to_utf");
93959   __pyx_r = 0;
93960   __pyx_L0:;
93961   __Pyx_DECREF(__pyx_v_utf);
93962   __Pyx_XGIVEREF(__pyx_r);
93963   __Pyx_FinishRefcountContext();
93964   return __pyx_r;
93965 }
93966
93967 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":122
93968  *         return utf
93969  * 
93970  *     cdef void _set_xpath_context(self, xpath.xmlXPathContext* xpathCtxt):             # <<<<<<<<<<<<<<
93971  *         self._xpathCtxt = xpathCtxt
93972  *         xpathCtxt.userData = <void*>self
93973  */
93974
93975 static  void __pyx_f_4lxml_5etree_12_BaseContext__set_xpath_context(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self, xmlXPathContext *__pyx_v_xpathCtxt) {
93976   __Pyx_SetupRefcountContext("_set_xpath_context");
93977
93978   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":123
93979  * 
93980  *     cdef void _set_xpath_context(self, xpath.xmlXPathContext* xpathCtxt):
93981  *         self._xpathCtxt = xpathCtxt             # <<<<<<<<<<<<<<
93982  *         xpathCtxt.userData = <void*>self
93983  * 
93984  */
93985   __pyx_v_self->_xpathCtxt = __pyx_v_xpathCtxt;
93986
93987   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":124
93988  *     cdef void _set_xpath_context(self, xpath.xmlXPathContext* xpathCtxt):
93989  *         self._xpathCtxt = xpathCtxt
93990  *         xpathCtxt.userData = <void*>self             # <<<<<<<<<<<<<<
93991  * 
93992  *     cdef _register_context(self, _Document doc):
93993  */
93994   __pyx_v_xpathCtxt->userData = ((void *)__pyx_v_self);
93995
93996   __Pyx_FinishRefcountContext();
93997 }
93998
93999 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":126
94000  *         xpathCtxt.userData = <void*>self
94001  * 
94002  *     cdef _register_context(self, _Document doc):             # <<<<<<<<<<<<<<
94003  *         self._doc = doc
94004  *         self._exc.clear()
94005  */
94006
94007 static  PyObject *__pyx_f_4lxml_5etree_12_BaseContext__register_context(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self, struct LxmlDocument *__pyx_v_doc) {
94008   PyObject *__pyx_r = NULL;
94009   __Pyx_SetupRefcountContext("_register_context");
94010
94011   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":127
94012  * 
94013  *     cdef _register_context(self, _Document doc):
94014  *         self._doc = doc             # <<<<<<<<<<<<<<
94015  *         self._exc.clear()
94016  * 
94017  */
94018   __Pyx_INCREF(((PyObject *)__pyx_v_doc));
94019   __Pyx_GIVEREF(((PyObject *)__pyx_v_doc));
94020   __Pyx_GOTREF(__pyx_v_self->_doc);
94021   __Pyx_DECREF(((PyObject *)__pyx_v_self->_doc));
94022   __pyx_v_self->_doc = __pyx_v_doc;
94023
94024   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":128
94025  *     cdef _register_context(self, _Document doc):
94026  *         self._doc = doc
94027  *         self._exc.clear()             # <<<<<<<<<<<<<<
94028  * 
94029  *     cdef _cleanup_context(self):
94030  */
94031   ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_self->_exc->__pyx_vtab)->clear(__pyx_v_self->_exc);
94032
94033   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
94034   __Pyx_XGIVEREF(__pyx_r);
94035   __Pyx_FinishRefcountContext();
94036   return __pyx_r;
94037 }
94038
94039 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":130
94040  *         self._exc.clear()
94041  * 
94042  *     cdef _cleanup_context(self):             # <<<<<<<<<<<<<<
94043  *         #xpath.xmlXPathRegisteredNsCleanup(self._xpathCtxt)
94044  *         #self.unregisterGlobalNamespaces()
94045  */
94046
94047 static  PyObject *__pyx_f_4lxml_5etree_12_BaseContext__cleanup_context(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self) {
94048   PyObject *__pyx_r = NULL;
94049   __Pyx_SetupRefcountContext("_cleanup_context");
94050
94051   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":133
94052  *         #xpath.xmlXPathRegisteredNsCleanup(self._xpathCtxt)
94053  *         #self.unregisterGlobalNamespaces()
94054  *         python.PyDict_Clear(self._utf_refs)             # <<<<<<<<<<<<<<
94055  *         self._eval_context_dict = None
94056  *         self._doc = None
94057  */
94058   PyDict_Clear(((PyObject *)__pyx_v_self->_utf_refs));
94059
94060   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":134
94061  *         #self.unregisterGlobalNamespaces()
94062  *         python.PyDict_Clear(self._utf_refs)
94063  *         self._eval_context_dict = None             # <<<<<<<<<<<<<<
94064  *         self._doc = None
94065  * 
94066  */
94067   __Pyx_INCREF(Py_None);
94068   __Pyx_GIVEREF(Py_None);
94069   __Pyx_GOTREF(__pyx_v_self->_eval_context_dict);
94070   __Pyx_DECREF(((PyObject *)__pyx_v_self->_eval_context_dict));
94071   __pyx_v_self->_eval_context_dict = ((PyObject *)Py_None);
94072
94073   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":135
94074  *         python.PyDict_Clear(self._utf_refs)
94075  *         self._eval_context_dict = None
94076  *         self._doc = None             # <<<<<<<<<<<<<<
94077  * 
94078  *     cdef _release_context(self):
94079  */
94080   __Pyx_INCREF(Py_None);
94081   __Pyx_GIVEREF(Py_None);
94082   __Pyx_GOTREF(__pyx_v_self->_doc);
94083   __Pyx_DECREF(((PyObject *)__pyx_v_self->_doc));
94084   __pyx_v_self->_doc = ((struct LxmlDocument *)Py_None);
94085
94086   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
94087   __Pyx_XGIVEREF(__pyx_r);
94088   __Pyx_FinishRefcountContext();
94089   return __pyx_r;
94090 }
94091
94092 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":137
94093  *         self._doc = None
94094  * 
94095  *     cdef _release_context(self):             # <<<<<<<<<<<<<<
94096  *         if self._xpathCtxt is not NULL:
94097  *             self._xpathCtxt.userData = NULL
94098  */
94099
94100 static  PyObject *__pyx_f_4lxml_5etree_12_BaseContext__release_context(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self) {
94101   PyObject *__pyx_r = NULL;
94102   int __pyx_t_1;
94103   __Pyx_SetupRefcountContext("_release_context");
94104
94105   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":138
94106  * 
94107  *     cdef _release_context(self):
94108  *         if self._xpathCtxt is not NULL:             # <<<<<<<<<<<<<<
94109  *             self._xpathCtxt.userData = NULL
94110  *             self._xpathCtxt = NULL
94111  */
94112   __pyx_t_1 = (__pyx_v_self->_xpathCtxt != NULL);
94113   if (__pyx_t_1) {
94114
94115     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":139
94116  *     cdef _release_context(self):
94117  *         if self._xpathCtxt is not NULL:
94118  *             self._xpathCtxt.userData = NULL             # <<<<<<<<<<<<<<
94119  *             self._xpathCtxt = NULL
94120  * 
94121  */
94122     __pyx_v_self->_xpathCtxt->userData = NULL;
94123
94124     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":140
94125  *         if self._xpathCtxt is not NULL:
94126  *             self._xpathCtxt.userData = NULL
94127  *             self._xpathCtxt = NULL             # <<<<<<<<<<<<<<
94128  * 
94129  *     # namespaces (internal UTF-8 methods with leading '_')
94130  */
94131     __pyx_v_self->_xpathCtxt = NULL;
94132     goto __pyx_L3;
94133   }
94134   __pyx_L3:;
94135
94136   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
94137   __Pyx_XGIVEREF(__pyx_r);
94138   __Pyx_FinishRefcountContext();
94139   return __pyx_r;
94140 }
94141
94142 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":144
94143  *     # namespaces (internal UTF-8 methods with leading '_')
94144  * 
94145  *     cdef addNamespace(self, prefix, ns_uri):             # <<<<<<<<<<<<<<
94146  *         cdef list namespaces
94147  *         if prefix is None:
94148  */
94149
94150 static  PyObject *__pyx_f_4lxml_5etree_12_BaseContext_addNamespace(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self, PyObject *__pyx_v_prefix, PyObject *__pyx_v_ns_uri) {
94151   PyObject *__pyx_v_namespaces;
94152   PyObject *__pyx_v_prefix_utf;
94153   PyObject *__pyx_v_ns_uri_utf;
94154   PyObject *__pyx_v_new_item;
94155   PyObject *__pyx_v_item;
94156   PyObject *__pyx_r = NULL;
94157   PyObject *__pyx_1 = 0;
94158   int __pyx_t_1;
94159   PyObject *__pyx_t_2 = NULL;
94160   Py_ssize_t __pyx_t_3;
94161   PyObject *__pyx_t_4 = NULL;
94162   int __pyx_t_5;
94163   __Pyx_SetupRefcountContext("addNamespace");
94164   __pyx_v_namespaces = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
94165   __pyx_v_prefix_utf = Py_None; __Pyx_INCREF(Py_None);
94166   __pyx_v_ns_uri_utf = Py_None; __Pyx_INCREF(Py_None);
94167   __pyx_v_new_item = Py_None; __Pyx_INCREF(Py_None);
94168   __pyx_v_item = Py_None; __Pyx_INCREF(Py_None);
94169
94170   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":146
94171  *     cdef addNamespace(self, prefix, ns_uri):
94172  *         cdef list namespaces
94173  *         if prefix is None:             # <<<<<<<<<<<<<<
94174  *             raise TypeError, u"empty prefix is not supported in XPath"
94175  *         prefix_utf = self._to_utf(prefix)
94176  */
94177   __pyx_t_1 = (__pyx_v_prefix == Py_None);
94178   if (__pyx_t_1) {
94179
94180     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":147
94181  *         cdef list namespaces
94182  *         if prefix is None:
94183  *             raise TypeError, u"empty prefix is not supported in XPath"             # <<<<<<<<<<<<<<
94184  *         prefix_utf = self._to_utf(prefix)
94185  *         ns_uri_utf = self._to_utf(ns_uri)
94186  */
94187     __Pyx_Raise(__pyx_builtin_TypeError, ((PyObject *)__pyx_kp_559), 0);
94188     {__pyx_filename = __pyx_f[5]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94189     goto __pyx_L3;
94190   }
94191   __pyx_L3:;
94192
94193   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":148
94194  *         if prefix is None:
94195  *             raise TypeError, u"empty prefix is not supported in XPath"
94196  *         prefix_utf = self._to_utf(prefix)             # <<<<<<<<<<<<<<
94197  *         ns_uri_utf = self._to_utf(ns_uri)
94198  *         new_item = (prefix_utf, ns_uri_utf)
94199  */
94200   __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseContext *)__pyx_v_self->__pyx_vtab)->_to_utf(__pyx_v_self, __pyx_v_prefix); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94201   __Pyx_GOTREF(__pyx_t_2);
94202   __Pyx_DECREF(__pyx_v_prefix_utf);
94203   __pyx_v_prefix_utf = __pyx_t_2;
94204   __pyx_t_2 = 0;
94205
94206   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":149
94207  *             raise TypeError, u"empty prefix is not supported in XPath"
94208  *         prefix_utf = self._to_utf(prefix)
94209  *         ns_uri_utf = self._to_utf(ns_uri)             # <<<<<<<<<<<<<<
94210  *         new_item = (prefix_utf, ns_uri_utf)
94211  *         if self._namespaces is None:
94212  */
94213   __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseContext *)__pyx_v_self->__pyx_vtab)->_to_utf(__pyx_v_self, __pyx_v_ns_uri); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94214   __Pyx_GOTREF(__pyx_t_2);
94215   __Pyx_DECREF(__pyx_v_ns_uri_utf);
94216   __pyx_v_ns_uri_utf = __pyx_t_2;
94217   __pyx_t_2 = 0;
94218
94219   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":150
94220  *         prefix_utf = self._to_utf(prefix)
94221  *         ns_uri_utf = self._to_utf(ns_uri)
94222  *         new_item = (prefix_utf, ns_uri_utf)             # <<<<<<<<<<<<<<
94223  *         if self._namespaces is None:
94224  *             self._namespaces = [new_item]
94225  */
94226   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94227   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
94228   __Pyx_INCREF(__pyx_v_prefix_utf);
94229   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_prefix_utf);
94230   __Pyx_GIVEREF(__pyx_v_prefix_utf);
94231   __Pyx_INCREF(__pyx_v_ns_uri_utf);
94232   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ns_uri_utf);
94233   __Pyx_GIVEREF(__pyx_v_ns_uri_utf);
94234   __Pyx_DECREF(__pyx_v_new_item);
94235   __pyx_v_new_item = ((PyObject *)__pyx_t_2);
94236   __pyx_t_2 = 0;
94237
94238   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":151
94239  *         ns_uri_utf = self._to_utf(ns_uri)
94240  *         new_item = (prefix_utf, ns_uri_utf)
94241  *         if self._namespaces is None:             # <<<<<<<<<<<<<<
94242  *             self._namespaces = [new_item]
94243  *         else:
94244  */
94245   __pyx_t_1 = (__pyx_v_self->_namespaces == ((PyObject *)Py_None));
94246   if (__pyx_t_1) {
94247
94248     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":152
94249  *         new_item = (prefix_utf, ns_uri_utf)
94250  *         if self._namespaces is None:
94251  *             self._namespaces = [new_item]             # <<<<<<<<<<<<<<
94252  *         else:
94253  *             namespaces = []
94254  */
94255     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94256     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
94257     __Pyx_INCREF(__pyx_v_new_item);
94258     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_new_item);
94259     __Pyx_GIVEREF(__pyx_v_new_item);
94260     __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
94261     __Pyx_GOTREF(__pyx_v_self->_namespaces);
94262     __Pyx_DECREF(((PyObject *)__pyx_v_self->_namespaces));
94263     __pyx_v_self->_namespaces = __pyx_t_2;
94264     __pyx_t_2 = 0;
94265     goto __pyx_L4;
94266   }
94267   /*else*/ {
94268
94269     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":154
94270  *             self._namespaces = [new_item]
94271  *         else:
94272  *             namespaces = []             # <<<<<<<<<<<<<<
94273  *             for item in self._namespaces:
94274  *                 if item[0] == prefix_utf:
94275  */
94276     __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94277     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
94278     __Pyx_DECREF(((PyObject *)__pyx_v_namespaces));
94279     __pyx_v_namespaces = __pyx_t_2;
94280     __pyx_t_2 = 0;
94281
94282     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":155
94283  *         else:
94284  *             namespaces = []
94285  *             for item in self._namespaces:             # <<<<<<<<<<<<<<
94286  *                 if item[0] == prefix_utf:
94287  *                     item = new_item
94288  */
94289     if (likely(((PyObject *)__pyx_v_self->_namespaces) != Py_None)) {
94290       __pyx_t_3 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_self->_namespaces); __Pyx_INCREF(__pyx_t_2);
94291     } else {
94292       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94293     }
94294     for (;;) {
94295       if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
94296       __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++;
94297       __Pyx_DECREF(__pyx_v_item);
94298       __pyx_v_item = __pyx_t_4;
94299       __pyx_t_4 = 0;
94300
94301       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":156
94302  *             namespaces = []
94303  *             for item in self._namespaces:
94304  *                 if item[0] == prefix_utf:             # <<<<<<<<<<<<<<
94305  *                     item = new_item
94306  *                     new_item = None
94307  */
94308       __pyx_1 = __Pyx_GetItemInt(__pyx_v_item, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94309       __Pyx_GOTREF(__pyx_1);
94310       __pyx_t_4 = PyObject_RichCompare(__pyx_1, __pyx_v_prefix_utf, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94311       __Pyx_GOTREF(__pyx_t_4);
94312       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
94313       __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94314       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
94315       if (__pyx_t_1) {
94316
94317         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":157
94318  *             for item in self._namespaces:
94319  *                 if item[0] == prefix_utf:
94320  *                     item = new_item             # <<<<<<<<<<<<<<
94321  *                     new_item = None
94322  *                 namespaces.append(item)
94323  */
94324         __Pyx_INCREF(__pyx_v_new_item);
94325         __Pyx_DECREF(__pyx_v_item);
94326         __pyx_v_item = __pyx_v_new_item;
94327
94328         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":158
94329  *                 if item[0] == prefix_utf:
94330  *                     item = new_item
94331  *                     new_item = None             # <<<<<<<<<<<<<<
94332  *                 namespaces.append(item)
94333  *             if new_item is not None:
94334  */
94335         __Pyx_INCREF(Py_None);
94336         __Pyx_DECREF(__pyx_v_new_item);
94337         __pyx_v_new_item = Py_None;
94338         goto __pyx_L7;
94339       }
94340       __pyx_L7:;
94341
94342       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":159
94343  *                     item = new_item
94344  *                     new_item = None
94345  *                 namespaces.append(item)             # <<<<<<<<<<<<<<
94346  *             if new_item is not None:
94347  *                 namespaces.append(new_item)
94348  */
94349       __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_namespaces), __pyx_v_item); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94350     }
94351     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
94352
94353     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":160
94354  *                     new_item = None
94355  *                 namespaces.append(item)
94356  *             if new_item is not None:             # <<<<<<<<<<<<<<
94357  *                 namespaces.append(new_item)
94358  *             self._namespaces = namespaces
94359  */
94360     __pyx_t_1 = (__pyx_v_new_item != Py_None);
94361     if (__pyx_t_1) {
94362
94363       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":161
94364  *                 namespaces.append(item)
94365  *             if new_item is not None:
94366  *                 namespaces.append(new_item)             # <<<<<<<<<<<<<<
94367  *             self._namespaces = namespaces
94368  *         if self._xpathCtxt is not NULL:
94369  */
94370       __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_namespaces), __pyx_v_new_item); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94371       goto __pyx_L8;
94372     }
94373     __pyx_L8:;
94374
94375     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":162
94376  *             if new_item is not None:
94377  *                 namespaces.append(new_item)
94378  *             self._namespaces = namespaces             # <<<<<<<<<<<<<<
94379  *         if self._xpathCtxt is not NULL:
94380  *             xpath.xmlXPathRegisterNs(
94381  */
94382     __Pyx_INCREF(((PyObject *)__pyx_v_namespaces));
94383     __Pyx_GIVEREF(((PyObject *)__pyx_v_namespaces));
94384     __Pyx_GOTREF(__pyx_v_self->_namespaces);
94385     __Pyx_DECREF(((PyObject *)__pyx_v_self->_namespaces));
94386     __pyx_v_self->_namespaces = __pyx_v_namespaces;
94387   }
94388   __pyx_L4:;
94389
94390   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":163
94391  *                 namespaces.append(new_item)
94392  *             self._namespaces = namespaces
94393  *         if self._xpathCtxt is not NULL:             # <<<<<<<<<<<<<<
94394  *             xpath.xmlXPathRegisterNs(
94395  *                 self._xpathCtxt, _cstr(prefix_utf), _cstr(ns_uri_utf))
94396  */
94397   __pyx_t_1 = (__pyx_v_self->_xpathCtxt != NULL);
94398   if (__pyx_t_1) {
94399
94400     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":165
94401  *         if self._xpathCtxt is not NULL:
94402  *             xpath.xmlXPathRegisterNs(
94403  *                 self._xpathCtxt, _cstr(prefix_utf), _cstr(ns_uri_utf))             # <<<<<<<<<<<<<<
94404  * 
94405  *     cdef registerNamespace(self, prefix, ns_uri):
94406  */
94407     xmlXPathRegisterNs(__pyx_v_self->_xpathCtxt, PyString_AS_STRING(__pyx_v_prefix_utf), PyString_AS_STRING(__pyx_v_ns_uri_utf));
94408     goto __pyx_L9;
94409   }
94410   __pyx_L9:;
94411
94412   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
94413   goto __pyx_L0;
94414   __pyx_L1_error:;
94415   __Pyx_XDECREF(__pyx_1);
94416   __Pyx_XDECREF(__pyx_t_2);
94417   __Pyx_XDECREF(__pyx_t_4);
94418   __Pyx_AddTraceback("lxml.etree._BaseContext.addNamespace");
94419   __pyx_r = 0;
94420   __pyx_L0:;
94421   __Pyx_DECREF(__pyx_v_namespaces);
94422   __Pyx_DECREF(__pyx_v_prefix_utf);
94423   __Pyx_DECREF(__pyx_v_ns_uri_utf);
94424   __Pyx_DECREF(__pyx_v_new_item);
94425   __Pyx_DECREF(__pyx_v_item);
94426   __Pyx_XGIVEREF(__pyx_r);
94427   __Pyx_FinishRefcountContext();
94428   return __pyx_r;
94429 }
94430
94431 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":167
94432  *                 self._xpathCtxt, _cstr(prefix_utf), _cstr(ns_uri_utf))
94433  * 
94434  *     cdef registerNamespace(self, prefix, ns_uri):             # <<<<<<<<<<<<<<
94435  *         if prefix is None:
94436  *             raise TypeError, u"empty prefix is not supported in XPath"
94437  */
94438
94439 static  PyObject *__pyx_f_4lxml_5etree_12_BaseContext_registerNamespace(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self, PyObject *__pyx_v_prefix, PyObject *__pyx_v_ns_uri) {
94440   PyObject *__pyx_v_prefix_utf;
94441   PyObject *__pyx_v_ns_uri_utf;
94442   PyObject *__pyx_r = NULL;
94443   int __pyx_t_1;
94444   PyObject *__pyx_t_2 = NULL;
94445   int __pyx_t_3;
94446   __Pyx_SetupRefcountContext("registerNamespace");
94447   __pyx_v_prefix_utf = Py_None; __Pyx_INCREF(Py_None);
94448   __pyx_v_ns_uri_utf = Py_None; __Pyx_INCREF(Py_None);
94449
94450   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":168
94451  * 
94452  *     cdef registerNamespace(self, prefix, ns_uri):
94453  *         if prefix is None:             # <<<<<<<<<<<<<<
94454  *             raise TypeError, u"empty prefix is not supported in XPath"
94455  *         prefix_utf = self._to_utf(prefix)
94456  */
94457   __pyx_t_1 = (__pyx_v_prefix == Py_None);
94458   if (__pyx_t_1) {
94459
94460     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":169
94461  *     cdef registerNamespace(self, prefix, ns_uri):
94462  *         if prefix is None:
94463  *             raise TypeError, u"empty prefix is not supported in XPath"             # <<<<<<<<<<<<<<
94464  *         prefix_utf = self._to_utf(prefix)
94465  *         ns_uri_utf = self._to_utf(ns_uri)
94466  */
94467     __Pyx_Raise(__pyx_builtin_TypeError, ((PyObject *)__pyx_kp_560), 0);
94468     {__pyx_filename = __pyx_f[5]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94469     goto __pyx_L3;
94470   }
94471   __pyx_L3:;
94472
94473   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":170
94474  *         if prefix is None:
94475  *             raise TypeError, u"empty prefix is not supported in XPath"
94476  *         prefix_utf = self._to_utf(prefix)             # <<<<<<<<<<<<<<
94477  *         ns_uri_utf = self._to_utf(ns_uri)
94478  *         self._global_namespaces.append(prefix_utf)
94479  */
94480   __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseContext *)__pyx_v_self->__pyx_vtab)->_to_utf(__pyx_v_self, __pyx_v_prefix); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94481   __Pyx_GOTREF(__pyx_t_2);
94482   __Pyx_DECREF(__pyx_v_prefix_utf);
94483   __pyx_v_prefix_utf = __pyx_t_2;
94484   __pyx_t_2 = 0;
94485
94486   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":171
94487  *             raise TypeError, u"empty prefix is not supported in XPath"
94488  *         prefix_utf = self._to_utf(prefix)
94489  *         ns_uri_utf = self._to_utf(ns_uri)             # <<<<<<<<<<<<<<
94490  *         self._global_namespaces.append(prefix_utf)
94491  *         xpath.xmlXPathRegisterNs(self._xpathCtxt,
94492  */
94493   __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseContext *)__pyx_v_self->__pyx_vtab)->_to_utf(__pyx_v_self, __pyx_v_ns_uri); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94494   __Pyx_GOTREF(__pyx_t_2);
94495   __Pyx_DECREF(__pyx_v_ns_uri_utf);
94496   __pyx_v_ns_uri_utf = __pyx_t_2;
94497   __pyx_t_2 = 0;
94498
94499   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":172
94500  *         prefix_utf = self._to_utf(prefix)
94501  *         ns_uri_utf = self._to_utf(ns_uri)
94502  *         self._global_namespaces.append(prefix_utf)             # <<<<<<<<<<<<<<
94503  *         xpath.xmlXPathRegisterNs(self._xpathCtxt,
94504  *                                  _cstr(prefix_utf), _cstr(ns_uri_utf))
94505  */
94506   __pyx_t_3 = PyList_Append(((PyObject *)__pyx_v_self->_global_namespaces), __pyx_v_prefix_utf); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94507
94508   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":174
94509  *         self._global_namespaces.append(prefix_utf)
94510  *         xpath.xmlXPathRegisterNs(self._xpathCtxt,
94511  *                                  _cstr(prefix_utf), _cstr(ns_uri_utf))             # <<<<<<<<<<<<<<
94512  * 
94513  *     cdef registerLocalNamespaces(self):
94514  */
94515   xmlXPathRegisterNs(__pyx_v_self->_xpathCtxt, PyString_AS_STRING(__pyx_v_prefix_utf), PyString_AS_STRING(__pyx_v_ns_uri_utf));
94516
94517   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
94518   goto __pyx_L0;
94519   __pyx_L1_error:;
94520   __Pyx_XDECREF(__pyx_t_2);
94521   __Pyx_AddTraceback("lxml.etree._BaseContext.registerNamespace");
94522   __pyx_r = 0;
94523   __pyx_L0:;
94524   __Pyx_DECREF(__pyx_v_prefix_utf);
94525   __Pyx_DECREF(__pyx_v_ns_uri_utf);
94526   __Pyx_XGIVEREF(__pyx_r);
94527   __Pyx_FinishRefcountContext();
94528   return __pyx_r;
94529 }
94530
94531 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":176
94532  *                                  _cstr(prefix_utf), _cstr(ns_uri_utf))
94533  * 
94534  *     cdef registerLocalNamespaces(self):             # <<<<<<<<<<<<<<
94535  *         if self._namespaces is None:
94536  *             return
94537  */
94538
94539 static  PyObject *__pyx_f_4lxml_5etree_12_BaseContext_registerLocalNamespaces(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self) {
94540   PyObject *__pyx_v_prefix_utf;
94541   PyObject *__pyx_v_ns_uri_utf;
94542   PyObject *__pyx_r = NULL;
94543   PyObject *__pyx_1 = 0;
94544   PyObject *__pyx_2 = 0;
94545   PyObject *__pyx_3 = 0;
94546   int __pyx_t_1;
94547   Py_ssize_t __pyx_t_2;
94548   PyObject *__pyx_t_3 = NULL;
94549   PyObject *__pyx_t_4 = NULL;
94550   __Pyx_SetupRefcountContext("registerLocalNamespaces");
94551   __pyx_v_prefix_utf = Py_None; __Pyx_INCREF(Py_None);
94552   __pyx_v_ns_uri_utf = Py_None; __Pyx_INCREF(Py_None);
94553
94554   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":177
94555  * 
94556  *     cdef registerLocalNamespaces(self):
94557  *         if self._namespaces is None:             # <<<<<<<<<<<<<<
94558  *             return
94559  *         for prefix_utf, ns_uri_utf in self._namespaces:
94560  */
94561   __pyx_t_1 = (__pyx_v_self->_namespaces == ((PyObject *)Py_None));
94562   if (__pyx_t_1) {
94563
94564     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":178
94565  *     cdef registerLocalNamespaces(self):
94566  *         if self._namespaces is None:
94567  *             return             # <<<<<<<<<<<<<<
94568  *         for prefix_utf, ns_uri_utf in self._namespaces:
94569  *             xpath.xmlXPathRegisterNs(
94570  */
94571     __Pyx_XDECREF(__pyx_r);
94572     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
94573     goto __pyx_L0;
94574     goto __pyx_L3;
94575   }
94576   __pyx_L3:;
94577
94578   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":179
94579  *         if self._namespaces is None:
94580  *             return
94581  *         for prefix_utf, ns_uri_utf in self._namespaces:             # <<<<<<<<<<<<<<
94582  *             xpath.xmlXPathRegisterNs(
94583  *                 self._xpathCtxt, _cstr(prefix_utf), _cstr(ns_uri_utf))
94584  */
94585   if (likely(((PyObject *)__pyx_v_self->_namespaces) != Py_None)) {
94586     __pyx_t_2 = 0; __pyx_t_3 = ((PyObject *)__pyx_v_self->_namespaces); __Pyx_INCREF(__pyx_t_3);
94587   } else {
94588     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94589   }
94590   for (;;) {
94591     if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
94592     __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
94593     if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 2)) {
94594       PyObject* tuple = __pyx_t_4;
94595       __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
94596       __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
94597       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
94598       __Pyx_DECREF(__pyx_v_prefix_utf);
94599       __pyx_v_prefix_utf = __pyx_2;
94600       __pyx_2 = 0;
94601       __Pyx_DECREF(__pyx_v_ns_uri_utf);
94602       __pyx_v_ns_uri_utf = __pyx_3;
94603       __pyx_3 = 0;
94604     } else {
94605       __pyx_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94606       __Pyx_GOTREF(__pyx_1);
94607       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
94608       __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94609       __Pyx_GOTREF(__pyx_2);
94610       __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94611       __Pyx_GOTREF(__pyx_3);
94612       if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94613       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
94614       __Pyx_DECREF(__pyx_v_prefix_utf);
94615       __pyx_v_prefix_utf = __pyx_2;
94616       __pyx_2 = 0;
94617       __Pyx_DECREF(__pyx_v_ns_uri_utf);
94618       __pyx_v_ns_uri_utf = __pyx_3;
94619       __pyx_3 = 0;
94620     }
94621
94622     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":181
94623  *         for prefix_utf, ns_uri_utf in self._namespaces:
94624  *             xpath.xmlXPathRegisterNs(
94625  *                 self._xpathCtxt, _cstr(prefix_utf), _cstr(ns_uri_utf))             # <<<<<<<<<<<<<<
94626  * 
94627  *     cdef registerGlobalNamespaces(self):
94628  */
94629     xmlXPathRegisterNs(__pyx_v_self->_xpathCtxt, PyString_AS_STRING(__pyx_v_prefix_utf), PyString_AS_STRING(__pyx_v_ns_uri_utf));
94630   }
94631   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
94632
94633   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
94634   goto __pyx_L0;
94635   __pyx_L1_error:;
94636   __Pyx_XDECREF(__pyx_1);
94637   __Pyx_XDECREF(__pyx_2);
94638   __Pyx_XDECREF(__pyx_3);
94639   __Pyx_XDECREF(__pyx_t_3);
94640   __Pyx_XDECREF(__pyx_t_4);
94641   __Pyx_AddTraceback("lxml.etree._BaseContext.registerLocalNamespaces");
94642   __pyx_r = 0;
94643   __pyx_L0:;
94644   __Pyx_DECREF(__pyx_v_prefix_utf);
94645   __Pyx_DECREF(__pyx_v_ns_uri_utf);
94646   __Pyx_XGIVEREF(__pyx_r);
94647   __Pyx_FinishRefcountContext();
94648   return __pyx_r;
94649 }
94650
94651 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":183
94652  *                 self._xpathCtxt, _cstr(prefix_utf), _cstr(ns_uri_utf))
94653  * 
94654  *     cdef registerGlobalNamespaces(self):             # <<<<<<<<<<<<<<
94655  *         cdef list ns_prefixes = _find_all_extension_prefixes()
94656  *         if python.PyList_GET_SIZE(ns_prefixes) > 0:
94657  */
94658
94659 static  PyObject *__pyx_f_4lxml_5etree_12_BaseContext_registerGlobalNamespaces(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self) {
94660   PyObject *__pyx_v_ns_prefixes = 0;
94661   PyObject *__pyx_v_prefix_utf;
94662   PyObject *__pyx_v_ns_uri_utf;
94663   PyObject *__pyx_r = NULL;
94664   PyObject *__pyx_1 = 0;
94665   PyObject *__pyx_2 = 0;
94666   PyObject *__pyx_3 = 0;
94667   PyObject *__pyx_t_1 = NULL;
94668   int __pyx_t_2;
94669   Py_ssize_t __pyx_t_3;
94670   PyObject *__pyx_t_4 = NULL;
94671   int __pyx_t_5;
94672   __Pyx_SetupRefcountContext("registerGlobalNamespaces");
94673   __pyx_v_prefix_utf = Py_None; __Pyx_INCREF(Py_None);
94674   __pyx_v_ns_uri_utf = Py_None; __Pyx_INCREF(Py_None);
94675
94676   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":184
94677  * 
94678  *     cdef registerGlobalNamespaces(self):
94679  *         cdef list ns_prefixes = _find_all_extension_prefixes()             # <<<<<<<<<<<<<<
94680  *         if python.PyList_GET_SIZE(ns_prefixes) > 0:
94681  *             for prefix_utf, ns_uri_utf in ns_prefixes:
94682  */
94683   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__find_all_extension_prefixes()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94684   __Pyx_GOTREF(__pyx_t_1);
94685   __pyx_v_ns_prefixes = ((PyObject *)__pyx_t_1);
94686   __pyx_t_1 = 0;
94687
94688   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":185
94689  *     cdef registerGlobalNamespaces(self):
94690  *         cdef list ns_prefixes = _find_all_extension_prefixes()
94691  *         if python.PyList_GET_SIZE(ns_prefixes) > 0:             # <<<<<<<<<<<<<<
94692  *             for prefix_utf, ns_uri_utf in ns_prefixes:
94693  *                 self._global_namespaces.append(prefix_utf)
94694  */
94695   __pyx_t_2 = (PyList_GET_SIZE(((PyObject *)__pyx_v_ns_prefixes)) > 0);
94696   if (__pyx_t_2) {
94697
94698     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":186
94699  *         cdef list ns_prefixes = _find_all_extension_prefixes()
94700  *         if python.PyList_GET_SIZE(ns_prefixes) > 0:
94701  *             for prefix_utf, ns_uri_utf in ns_prefixes:             # <<<<<<<<<<<<<<
94702  *                 self._global_namespaces.append(prefix_utf)
94703  *                 xpath.xmlXPathRegisterNs(
94704  */
94705     if (likely(((PyObject *)__pyx_v_ns_prefixes) != Py_None)) {
94706       __pyx_t_3 = 0; __pyx_t_1 = ((PyObject *)__pyx_v_ns_prefixes); __Pyx_INCREF(__pyx_t_1);
94707     } else {
94708       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94709     }
94710     for (;;) {
94711       if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
94712       __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++;
94713       if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 2)) {
94714         PyObject* tuple = __pyx_t_4;
94715         __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
94716         __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
94717         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
94718         __Pyx_DECREF(__pyx_v_prefix_utf);
94719         __pyx_v_prefix_utf = __pyx_2;
94720         __pyx_2 = 0;
94721         __Pyx_DECREF(__pyx_v_ns_uri_utf);
94722         __pyx_v_ns_uri_utf = __pyx_3;
94723         __pyx_3 = 0;
94724       } else {
94725         __pyx_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94726         __Pyx_GOTREF(__pyx_1);
94727         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
94728         __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94729         __Pyx_GOTREF(__pyx_2);
94730         __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94731         __Pyx_GOTREF(__pyx_3);
94732         if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94733         __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
94734         __Pyx_DECREF(__pyx_v_prefix_utf);
94735         __pyx_v_prefix_utf = __pyx_2;
94736         __pyx_2 = 0;
94737         __Pyx_DECREF(__pyx_v_ns_uri_utf);
94738         __pyx_v_ns_uri_utf = __pyx_3;
94739         __pyx_3 = 0;
94740       }
94741
94742       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":187
94743  *         if python.PyList_GET_SIZE(ns_prefixes) > 0:
94744  *             for prefix_utf, ns_uri_utf in ns_prefixes:
94745  *                 self._global_namespaces.append(prefix_utf)             # <<<<<<<<<<<<<<
94746  *                 xpath.xmlXPathRegisterNs(
94747  *                     self._xpathCtxt, _cstr(prefix_utf), _cstr(ns_uri_utf))
94748  */
94749       __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_self->_global_namespaces), __pyx_v_prefix_utf); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94750
94751       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":189
94752  *                 self._global_namespaces.append(prefix_utf)
94753  *                 xpath.xmlXPathRegisterNs(
94754  *                     self._xpathCtxt, _cstr(prefix_utf), _cstr(ns_uri_utf))             # <<<<<<<<<<<<<<
94755  * 
94756  *     cdef unregisterGlobalNamespaces(self):
94757  */
94758       xmlXPathRegisterNs(__pyx_v_self->_xpathCtxt, PyString_AS_STRING(__pyx_v_prefix_utf), PyString_AS_STRING(__pyx_v_ns_uri_utf));
94759     }
94760     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
94761     goto __pyx_L3;
94762   }
94763   __pyx_L3:;
94764
94765   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
94766   goto __pyx_L0;
94767   __pyx_L1_error:;
94768   __Pyx_XDECREF(__pyx_1);
94769   __Pyx_XDECREF(__pyx_2);
94770   __Pyx_XDECREF(__pyx_3);
94771   __Pyx_XDECREF(__pyx_t_1);
94772   __Pyx_XDECREF(__pyx_t_4);
94773   __Pyx_AddTraceback("lxml.etree._BaseContext.registerGlobalNamespaces");
94774   __pyx_r = 0;
94775   __pyx_L0:;
94776   __Pyx_XDECREF(__pyx_v_ns_prefixes);
94777   __Pyx_DECREF(__pyx_v_prefix_utf);
94778   __Pyx_DECREF(__pyx_v_ns_uri_utf);
94779   __Pyx_XGIVEREF(__pyx_r);
94780   __Pyx_FinishRefcountContext();
94781   return __pyx_r;
94782 }
94783
94784 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":191
94785  *                     self._xpathCtxt, _cstr(prefix_utf), _cstr(ns_uri_utf))
94786  * 
94787  *     cdef unregisterGlobalNamespaces(self):             # <<<<<<<<<<<<<<
94788  *         if python.PyList_GET_SIZE(self._global_namespaces) > 0:
94789  *             for prefix_utf in self._global_namespaces:
94790  */
94791
94792 static  PyObject *__pyx_f_4lxml_5etree_12_BaseContext_unregisterGlobalNamespaces(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self) {
94793   PyObject *__pyx_v_prefix_utf;
94794   PyObject *__pyx_r = NULL;
94795   int __pyx_t_1;
94796   Py_ssize_t __pyx_t_2;
94797   PyObject *__pyx_t_3 = NULL;
94798   PyObject *__pyx_t_4 = NULL;
94799   __Pyx_SetupRefcountContext("unregisterGlobalNamespaces");
94800   __pyx_v_prefix_utf = Py_None; __Pyx_INCREF(Py_None);
94801
94802   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":192
94803  * 
94804  *     cdef unregisterGlobalNamespaces(self):
94805  *         if python.PyList_GET_SIZE(self._global_namespaces) > 0:             # <<<<<<<<<<<<<<
94806  *             for prefix_utf in self._global_namespaces:
94807  *                 xpath.xmlXPathRegisterNs(self._xpathCtxt,
94808  */
94809   __pyx_t_1 = (PyList_GET_SIZE(((PyObject *)__pyx_v_self->_global_namespaces)) > 0);
94810   if (__pyx_t_1) {
94811
94812     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":193
94813  *     cdef unregisterGlobalNamespaces(self):
94814  *         if python.PyList_GET_SIZE(self._global_namespaces) > 0:
94815  *             for prefix_utf in self._global_namespaces:             # <<<<<<<<<<<<<<
94816  *                 xpath.xmlXPathRegisterNs(self._xpathCtxt,
94817  *                                          _cstr(prefix_utf), NULL)
94818  */
94819     if (likely(((PyObject *)__pyx_v_self->_global_namespaces) != Py_None)) {
94820       __pyx_t_2 = 0; __pyx_t_3 = ((PyObject *)__pyx_v_self->_global_namespaces); __Pyx_INCREF(__pyx_t_3);
94821     } else {
94822       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94823     }
94824     for (;;) {
94825       if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
94826       __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
94827       __Pyx_DECREF(__pyx_v_prefix_utf);
94828       __pyx_v_prefix_utf = __pyx_t_4;
94829       __pyx_t_4 = 0;
94830
94831       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":195
94832  *             for prefix_utf in self._global_namespaces:
94833  *                 xpath.xmlXPathRegisterNs(self._xpathCtxt,
94834  *                                          _cstr(prefix_utf), NULL)             # <<<<<<<<<<<<<<
94835  *             del self._global_namespaces[:]
94836  * 
94837  */
94838       xmlXPathRegisterNs(__pyx_v_self->_xpathCtxt, PyString_AS_STRING(__pyx_v_prefix_utf), NULL);
94839     }
94840     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
94841
94842     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":196
94843  *                 xpath.xmlXPathRegisterNs(self._xpathCtxt,
94844  *                                          _cstr(prefix_utf), NULL)
94845  *             del self._global_namespaces[:]             # <<<<<<<<<<<<<<
94846  * 
94847  *     cdef void _unregisterNamespace(self, prefix_utf):
94848  */
94849     if (PySequence_DelSlice(((PyObject *)__pyx_v_self->_global_namespaces), 0, PY_SSIZE_T_MAX) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94850     goto __pyx_L3;
94851   }
94852   __pyx_L3:;
94853
94854   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
94855   goto __pyx_L0;
94856   __pyx_L1_error:;
94857   __Pyx_XDECREF(__pyx_t_3);
94858   __Pyx_XDECREF(__pyx_t_4);
94859   __Pyx_AddTraceback("lxml.etree._BaseContext.unregisterGlobalNamespaces");
94860   __pyx_r = 0;
94861   __pyx_L0:;
94862   __Pyx_DECREF(__pyx_v_prefix_utf);
94863   __Pyx_XGIVEREF(__pyx_r);
94864   __Pyx_FinishRefcountContext();
94865   return __pyx_r;
94866 }
94867
94868 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":198
94869  *             del self._global_namespaces[:]
94870  * 
94871  *     cdef void _unregisterNamespace(self, prefix_utf):             # <<<<<<<<<<<<<<
94872  *         xpath.xmlXPathRegisterNs(self._xpathCtxt,
94873  *                                  _cstr(prefix_utf), NULL)
94874  */
94875
94876 static  void __pyx_f_4lxml_5etree_12_BaseContext__unregisterNamespace(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self, PyObject *__pyx_v_prefix_utf) {
94877   __Pyx_SetupRefcountContext("_unregisterNamespace");
94878
94879   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":200
94880  *     cdef void _unregisterNamespace(self, prefix_utf):
94881  *         xpath.xmlXPathRegisterNs(self._xpathCtxt,
94882  *                                  _cstr(prefix_utf), NULL)             # <<<<<<<<<<<<<<
94883  * 
94884  *     # extension functions
94885  */
94886   xmlXPathRegisterNs(__pyx_v_self->_xpathCtxt, PyString_AS_STRING(__pyx_v_prefix_utf), NULL);
94887
94888   __Pyx_FinishRefcountContext();
94889 }
94890
94891 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":204
94892  *     # extension functions
94893  * 
94894  *     cdef void _addLocalExtensionFunction(self, ns_utf, name_utf, function):             # <<<<<<<<<<<<<<
94895  *         if self._extensions is None:
94896  *             self._extensions = {}
94897  */
94898
94899 static  void __pyx_f_4lxml_5etree_12_BaseContext__addLocalExtensionFunction(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self, PyObject *__pyx_v_ns_utf, PyObject *__pyx_v_name_utf, PyObject *__pyx_v_function) {
94900   PyObject *__pyx_1 = 0;
94901   int __pyx_t_1;
94902   PyObject *__pyx_t_2 = NULL;
94903   __Pyx_SetupRefcountContext("_addLocalExtensionFunction");
94904
94905   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":205
94906  * 
94907  *     cdef void _addLocalExtensionFunction(self, ns_utf, name_utf, function):
94908  *         if self._extensions is None:             # <<<<<<<<<<<<<<
94909  *             self._extensions = {}
94910  *         self._extensions[(ns_utf, name_utf)] = function
94911  */
94912   __pyx_t_1 = (__pyx_v_self->_extensions == ((PyObject *)Py_None));
94913   if (__pyx_t_1) {
94914
94915     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":206
94916  *     cdef void _addLocalExtensionFunction(self, ns_utf, name_utf, function):
94917  *         if self._extensions is None:
94918  *             self._extensions = {}             # <<<<<<<<<<<<<<
94919  *         self._extensions[(ns_utf, name_utf)] = function
94920  * 
94921  */
94922     __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94923     __Pyx_GOTREF(((PyObject *)__pyx_1));
94924     __Pyx_GIVEREF(((PyObject *)__pyx_1));
94925     __Pyx_GOTREF(__pyx_v_self->_extensions);
94926     __Pyx_DECREF(((PyObject *)__pyx_v_self->_extensions));
94927     __pyx_v_self->_extensions = __pyx_1;
94928     __pyx_1 = 0;
94929     goto __pyx_L3;
94930   }
94931   __pyx_L3:;
94932
94933   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":207
94934  *         if self._extensions is None:
94935  *             self._extensions = {}
94936  *         self._extensions[(ns_utf, name_utf)] = function             # <<<<<<<<<<<<<<
94937  * 
94938  *     cdef void registerGlobalFunctions(self, void* ctxt,
94939  */
94940   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94941   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
94942   __Pyx_INCREF(__pyx_v_ns_utf);
94943   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ns_utf);
94944   __Pyx_GIVEREF(__pyx_v_ns_utf);
94945   __Pyx_INCREF(__pyx_v_name_utf);
94946   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_name_utf);
94947   __Pyx_GIVEREF(__pyx_v_name_utf);
94948   if (PyDict_SetItem(((PyObject *)__pyx_v_self->_extensions), ((PyObject *)__pyx_t_2), __pyx_v_function) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
94949   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
94950
94951   goto __pyx_L0;
94952   __pyx_L1_error:;
94953   __Pyx_XDECREF(__pyx_1);
94954   __Pyx_XDECREF(__pyx_t_2);
94955   __Pyx_WriteUnraisable("lxml.etree._BaseContext._addLocalExtensionFunction");
94956   __pyx_L0:;
94957   __Pyx_FinishRefcountContext();
94958 }
94959
94960 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":209
94961  *         self._extensions[(ns_utf, name_utf)] = function
94962  * 
94963  *     cdef void registerGlobalFunctions(self, void* ctxt,             # <<<<<<<<<<<<<<
94964  *                                       _register_function reg_func):
94965  *         cdef python.PyObject* dict_result
94966  */
94967
94968 static  void __pyx_f_4lxml_5etree_12_BaseContext_registerGlobalFunctions(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self, void *__pyx_v_ctxt, __pyx_t_4lxml_5etree__register_function __pyx_v_reg_func) {
94969   PyObject *__pyx_v_dict_result;
94970   PyObject *__pyx_v_d;
94971   PyObject *__pyx_v_ns_utf;
94972   PyObject *__pyx_v_ns_functions;
94973   PyObject *__pyx_v_name_utf;
94974   PyObject *__pyx_v_function;
94975   PyObject *__pyx_1 = 0;
94976   PyObject *__pyx_2 = 0;
94977   PyObject *__pyx_3 = 0;
94978   PyObject *__pyx_t_1 = NULL;
94979   Py_ssize_t __pyx_t_2;
94980   void *__pyx_t_3;
94981   void *__pyx_t_4;
94982   int __pyx_t_5;
94983   Py_ssize_t __pyx_t_6;
94984   PyObject *__pyx_t_7 = NULL;
94985   PyObject *__pyx_t_8 = NULL;
94986   __Pyx_SetupRefcountContext("registerGlobalFunctions");
94987   __pyx_v_d = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
94988   __pyx_v_ns_utf = Py_None; __Pyx_INCREF(Py_None);
94989   __pyx_v_ns_functions = Py_None; __Pyx_INCREF(Py_None);
94990   __pyx_v_name_utf = Py_None; __Pyx_INCREF(Py_None);
94991   __pyx_v_function = Py_None; __Pyx_INCREF(Py_None);
94992
94993   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":213
94994  *         cdef python.PyObject* dict_result
94995  *         cdef dict d
94996  *         for ns_utf, ns_functions in __FUNCTION_NAMESPACE_REGISTRIES.iteritems():             # <<<<<<<<<<<<<<
94997  *             dict_result = python.PyDict_GetItem(
94998  *                 self._function_cache, ns_utf)
94999  */
95000   __Pyx_INCREF(((PyObject *)__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES));
95001   __Pyx_XDECREF(__pyx_t_1);
95002   __pyx_t_1 = ((PyObject *)__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES);
95003   __pyx_t_2 = 0;
95004   while (1) {
95005     if (!PyDict_Next(__pyx_t_1, (&__pyx_t_2), ((PyObject **)(&__pyx_t_3)), ((PyObject **)(&__pyx_t_4)))) break;
95006     __Pyx_INCREF(((PyObject *)__pyx_t_3));
95007     __Pyx_DECREF(__pyx_v_ns_utf);
95008     __pyx_v_ns_utf = ((PyObject *)__pyx_t_3);
95009     __Pyx_INCREF(((PyObject *)__pyx_t_4));
95010     __Pyx_DECREF(__pyx_v_ns_functions);
95011     __pyx_v_ns_functions = ((PyObject *)__pyx_t_4);
95012
95013     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":215
95014  *         for ns_utf, ns_functions in __FUNCTION_NAMESPACE_REGISTRIES.iteritems():
95015  *             dict_result = python.PyDict_GetItem(
95016  *                 self._function_cache, ns_utf)             # <<<<<<<<<<<<<<
95017  *             if dict_result is not NULL:
95018  *                 d = <dict>dict_result
95019  */
95020     __pyx_v_dict_result = PyDict_GetItem(((PyObject *)__pyx_v_self->_function_cache), __pyx_v_ns_utf);
95021
95022     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":216
95023  *             dict_result = python.PyDict_GetItem(
95024  *                 self._function_cache, ns_utf)
95025  *             if dict_result is not NULL:             # <<<<<<<<<<<<<<
95026  *                 d = <dict>dict_result
95027  *             else:
95028  */
95029     __pyx_t_5 = (__pyx_v_dict_result != NULL);
95030     if (__pyx_t_5) {
95031
95032       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":217
95033  *                 self._function_cache, ns_utf)
95034  *             if dict_result is not NULL:
95035  *                 d = <dict>dict_result             # <<<<<<<<<<<<<<
95036  *             else:
95037  *                 d = {}
95038  */
95039       __Pyx_INCREF(((PyObject *)((PyObject *)__pyx_v_dict_result)));
95040       __Pyx_DECREF(((PyObject *)__pyx_v_d));
95041       __pyx_v_d = ((PyObject *)__pyx_v_dict_result);
95042       goto __pyx_L5;
95043     }
95044     /*else*/ {
95045
95046       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":219
95047  *                 d = <dict>dict_result
95048  *             else:
95049  *                 d = {}             # <<<<<<<<<<<<<<
95050  *                 self._function_cache[ns_utf] = d
95051  *             for name_utf, function in ns_functions.iteritems():
95052  */
95053       __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95054       __Pyx_GOTREF(((PyObject *)__pyx_1));
95055       __Pyx_DECREF(((PyObject *)__pyx_v_d));
95056       __pyx_v_d = __pyx_1;
95057       __pyx_1 = 0;
95058
95059       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":220
95060  *             else:
95061  *                 d = {}
95062  *                 self._function_cache[ns_utf] = d             # <<<<<<<<<<<<<<
95063  *             for name_utf, function in ns_functions.iteritems():
95064  *                 d[name_utf] = function
95065  */
95066       if (PyDict_SetItem(((PyObject *)__pyx_v_self->_function_cache), __pyx_v_ns_utf, ((PyObject *)__pyx_v_d)) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95067     }
95068     __pyx_L5:;
95069
95070     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":221
95071  *                 d = {}
95072  *                 self._function_cache[ns_utf] = d
95073  *             for name_utf, function in ns_functions.iteritems():             # <<<<<<<<<<<<<<
95074  *                 d[name_utf] = function
95075  *                 reg_func(ctxt, name_utf, ns_utf)
95076  */
95077     __pyx_t_7 = PyObject_GetAttr(__pyx_v_ns_functions, __pyx_kp_iteritems); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95078     __Pyx_GOTREF(__pyx_t_7);
95079     __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95080     __Pyx_GOTREF(__pyx_t_8);
95081     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
95082     if (PyList_CheckExact(__pyx_t_8) || PyTuple_CheckExact(__pyx_t_8)) {
95083       __pyx_t_6 = 0; __pyx_t_7 = __pyx_t_8; __Pyx_INCREF(__pyx_t_7);
95084     } else {
95085       __pyx_t_6 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95086       __Pyx_GOTREF(__pyx_t_7);
95087     }
95088     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
95089     for (;;) {
95090       if (likely(PyList_CheckExact(__pyx_t_7))) {
95091         if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_7)) break;
95092         __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++;
95093       } else if (likely(PyTuple_CheckExact(__pyx_t_7))) {
95094         if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
95095         __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++;
95096       } else {
95097         __pyx_t_8 = PyIter_Next(__pyx_t_7);
95098         if (!__pyx_t_8) {
95099           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95100           break;
95101         }
95102         __Pyx_GOTREF(__pyx_t_8);
95103       }
95104       if (PyTuple_CheckExact(__pyx_t_8) && likely(PyTuple_GET_SIZE(__pyx_t_8) == 2)) {
95105         PyObject* tuple = __pyx_t_8;
95106         __pyx_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_3);
95107         __pyx_1 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_1);
95108         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
95109         __Pyx_DECREF(__pyx_v_name_utf);
95110         __pyx_v_name_utf = __pyx_3;
95111         __pyx_3 = 0;
95112         __Pyx_DECREF(__pyx_v_function);
95113         __pyx_v_function = __pyx_1;
95114         __pyx_1 = 0;
95115       } else {
95116         __pyx_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95117         __Pyx_GOTREF(__pyx_2);
95118         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
95119         __pyx_3 = __Pyx_UnpackItem(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95120         __Pyx_GOTREF(__pyx_3);
95121         __pyx_1 = __Pyx_UnpackItem(__pyx_2, 1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95122         __Pyx_GOTREF(__pyx_1);
95123         if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95124         __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
95125         __Pyx_DECREF(__pyx_v_name_utf);
95126         __pyx_v_name_utf = __pyx_3;
95127         __pyx_3 = 0;
95128         __Pyx_DECREF(__pyx_v_function);
95129         __pyx_v_function = __pyx_1;
95130         __pyx_1 = 0;
95131       }
95132
95133       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":222
95134  *                 self._function_cache[ns_utf] = d
95135  *             for name_utf, function in ns_functions.iteritems():
95136  *                 d[name_utf] = function             # <<<<<<<<<<<<<<
95137  *                 reg_func(ctxt, name_utf, ns_utf)
95138  * 
95139  */
95140       if (PyDict_SetItem(((PyObject *)__pyx_v_d), __pyx_v_name_utf, __pyx_v_function) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95141
95142       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":223
95143  *             for name_utf, function in ns_functions.iteritems():
95144  *                 d[name_utf] = function
95145  *                 reg_func(ctxt, name_utf, ns_utf)             # <<<<<<<<<<<<<<
95146  * 
95147  *     cdef void registerLocalFunctions(self, void* ctxt,
95148  */
95149       __pyx_v_reg_func(__pyx_v_ctxt, __pyx_v_name_utf, __pyx_v_ns_utf);
95150     }
95151     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
95152   }
95153   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
95154
95155   goto __pyx_L0;
95156   __pyx_L1_error:;
95157   __Pyx_XDECREF(__pyx_1);
95158   __Pyx_XDECREF(__pyx_2);
95159   __Pyx_XDECREF(__pyx_3);
95160   __Pyx_XDECREF(__pyx_t_1);
95161   __Pyx_XDECREF(__pyx_t_7);
95162   __Pyx_XDECREF(__pyx_t_8);
95163   __Pyx_WriteUnraisable("lxml.etree._BaseContext.registerGlobalFunctions");
95164   __pyx_L0:;
95165   __Pyx_DECREF(__pyx_v_d);
95166   __Pyx_DECREF(__pyx_v_ns_utf);
95167   __Pyx_DECREF(__pyx_v_ns_functions);
95168   __Pyx_DECREF(__pyx_v_name_utf);
95169   __Pyx_DECREF(__pyx_v_function);
95170   __Pyx_FinishRefcountContext();
95171 }
95172
95173 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":225
95174  *                 reg_func(ctxt, name_utf, ns_utf)
95175  * 
95176  *     cdef void registerLocalFunctions(self, void* ctxt,             # <<<<<<<<<<<<<<
95177  *                                       _register_function reg_func):
95178  *         cdef python.PyObject* dict_result
95179  */
95180
95181 static  void __pyx_f_4lxml_5etree_12_BaseContext_registerLocalFunctions(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self, void *__pyx_v_ctxt, __pyx_t_4lxml_5etree__register_function __pyx_v_reg_func) {
95182   PyObject *__pyx_v_dict_result;
95183   PyObject *__pyx_v_d;
95184   PyObject *__pyx_v_last_ns;
95185   PyObject *__pyx_v_ns_utf;
95186   PyObject *__pyx_v_name_utf;
95187   PyObject *__pyx_v_function;
95188   PyObject *__pyx_1 = 0;
95189   PyObject *__pyx_2 = 0;
95190   PyObject *__pyx_3 = 0;
95191   PyObject *__pyx_4 = 0;
95192   PyObject *__pyx_5 = 0;
95193   PyObject *__pyx_6 = 0;
95194   int __pyx_t_1;
95195   PyObject *__pyx_t_2 = NULL;
95196   Py_ssize_t __pyx_t_3;
95197   void *__pyx_t_4;
95198   void *__pyx_t_5;
95199   int __pyx_t_6;
95200   int __pyx_t_7;
95201   __Pyx_SetupRefcountContext("registerLocalFunctions");
95202   __pyx_v_d = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
95203   __pyx_v_last_ns = Py_None; __Pyx_INCREF(Py_None);
95204   __pyx_v_ns_utf = Py_None; __Pyx_INCREF(Py_None);
95205   __pyx_v_name_utf = Py_None; __Pyx_INCREF(Py_None);
95206   __pyx_v_function = Py_None; __Pyx_INCREF(Py_None);
95207
95208   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":229
95209  *         cdef python.PyObject* dict_result
95210  *         cdef dict d
95211  *         if self._extensions is None:             # <<<<<<<<<<<<<<
95212  *             return # done
95213  *         last_ns = None
95214  */
95215   __pyx_t_1 = (__pyx_v_self->_extensions == ((PyObject *)Py_None));
95216   if (__pyx_t_1) {
95217
95218     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":230
95219  *         cdef dict d
95220  *         if self._extensions is None:
95221  *             return # done             # <<<<<<<<<<<<<<
95222  *         last_ns = None
95223  *         d = None
95224  */
95225     goto __pyx_L0;
95226     goto __pyx_L3;
95227   }
95228   __pyx_L3:;
95229
95230   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":231
95231  *         if self._extensions is None:
95232  *             return # done
95233  *         last_ns = None             # <<<<<<<<<<<<<<
95234  *         d = None
95235  *         for (ns_utf, name_utf), function in self._extensions.iteritems():
95236  */
95237   __Pyx_INCREF(Py_None);
95238   __Pyx_DECREF(__pyx_v_last_ns);
95239   __pyx_v_last_ns = Py_None;
95240
95241   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":232
95242  *             return # done
95243  *         last_ns = None
95244  *         d = None             # <<<<<<<<<<<<<<
95245  *         for (ns_utf, name_utf), function in self._extensions.iteritems():
95246  *             if ns_utf is not last_ns or d is None:
95247  */
95248   __Pyx_INCREF(Py_None);
95249   __Pyx_DECREF(((PyObject *)__pyx_v_d));
95250   __pyx_v_d = ((PyObject *)Py_None);
95251
95252   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":233
95253  *         last_ns = None
95254  *         d = None
95255  *         for (ns_utf, name_utf), function in self._extensions.iteritems():             # <<<<<<<<<<<<<<
95256  *             if ns_utf is not last_ns or d is None:
95257  *                 last_ns = ns_utf
95258  */
95259   __Pyx_INCREF(((PyObject *)__pyx_v_self->_extensions));
95260   __Pyx_XDECREF(__pyx_t_2);
95261   __pyx_t_2 = ((PyObject *)__pyx_v_self->_extensions);
95262   __pyx_t_3 = 0;
95263   while (1) {
95264     if (!PyDict_Next(__pyx_t_2, (&__pyx_t_3), ((PyObject **)(&__pyx_t_4)), ((PyObject **)(&__pyx_t_5)))) break;
95265     if (PyTuple_CheckExact(((PyObject *)__pyx_t_4)) && likely(PyTuple_GET_SIZE(((PyObject *)__pyx_t_4)) == 2)) {
95266       PyObject* tuple = ((PyObject *)__pyx_t_4);
95267       __pyx_5 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_5);
95268       __pyx_6 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_6);
95269       __Pyx_DECREF(__pyx_v_ns_utf);
95270       __pyx_v_ns_utf = __pyx_5;
95271       __pyx_5 = 0;
95272       __Pyx_DECREF(__pyx_v_name_utf);
95273       __pyx_v_name_utf = __pyx_6;
95274       __pyx_6 = 0;
95275     } else {
95276       __pyx_4 = PyObject_GetIter(((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95277       __Pyx_GOTREF(__pyx_4);
95278       __pyx_5 = __Pyx_UnpackItem(__pyx_4, 0); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95279       __Pyx_GOTREF(__pyx_5);
95280       __pyx_6 = __Pyx_UnpackItem(__pyx_4, 1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95281       __Pyx_GOTREF(__pyx_6);
95282       if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95283       __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
95284       __Pyx_DECREF(__pyx_v_ns_utf);
95285       __pyx_v_ns_utf = __pyx_5;
95286       __pyx_5 = 0;
95287       __Pyx_DECREF(__pyx_v_name_utf);
95288       __pyx_v_name_utf = __pyx_6;
95289       __pyx_6 = 0;
95290     }
95291     __Pyx_INCREF(((PyObject *)__pyx_t_5));
95292     __Pyx_DECREF(__pyx_v_function);
95293     __pyx_v_function = ((PyObject *)__pyx_t_5);
95294
95295     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":234
95296  *         d = None
95297  *         for (ns_utf, name_utf), function in self._extensions.iteritems():
95298  *             if ns_utf is not last_ns or d is None:             # <<<<<<<<<<<<<<
95299  *                 last_ns = ns_utf
95300  *                 dict_result = python.PyDict_GetItem(
95301  */
95302     __pyx_t_1 = (__pyx_v_ns_utf != __pyx_v_last_ns);
95303     if (!__pyx_t_1) {
95304       __pyx_t_6 = (__pyx_v_d == ((PyObject *)Py_None));
95305       __pyx_t_7 = __pyx_t_6;
95306     } else {
95307       __pyx_t_7 = __pyx_t_1;
95308     }
95309     if (__pyx_t_7) {
95310
95311       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":235
95312  *         for (ns_utf, name_utf), function in self._extensions.iteritems():
95313  *             if ns_utf is not last_ns or d is None:
95314  *                 last_ns = ns_utf             # <<<<<<<<<<<<<<
95315  *                 dict_result = python.PyDict_GetItem(
95316  *                     self._function_cache, ns_utf)
95317  */
95318       __Pyx_INCREF(__pyx_v_ns_utf);
95319       __Pyx_DECREF(__pyx_v_last_ns);
95320       __pyx_v_last_ns = __pyx_v_ns_utf;
95321
95322       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":237
95323  *                 last_ns = ns_utf
95324  *                 dict_result = python.PyDict_GetItem(
95325  *                     self._function_cache, ns_utf)             # <<<<<<<<<<<<<<
95326  *                 if dict_result is not NULL:
95327  *                     d = <dict>dict_result
95328  */
95329       __pyx_v_dict_result = PyDict_GetItem(((PyObject *)__pyx_v_self->_function_cache), __pyx_v_ns_utf);
95330
95331       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":238
95332  *                 dict_result = python.PyDict_GetItem(
95333  *                     self._function_cache, ns_utf)
95334  *                 if dict_result is not NULL:             # <<<<<<<<<<<<<<
95335  *                     d = <dict>dict_result
95336  *                 else:
95337  */
95338       __pyx_t_7 = (__pyx_v_dict_result != NULL);
95339       if (__pyx_t_7) {
95340
95341         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":239
95342  *                     self._function_cache, ns_utf)
95343  *                 if dict_result is not NULL:
95344  *                     d = <dict>dict_result             # <<<<<<<<<<<<<<
95345  *                 else:
95346  *                     d = {}
95347  */
95348         __Pyx_INCREF(((PyObject *)((PyObject *)__pyx_v_dict_result)));
95349         __Pyx_DECREF(((PyObject *)__pyx_v_d));
95350         __pyx_v_d = ((PyObject *)__pyx_v_dict_result);
95351         goto __pyx_L7;
95352       }
95353       /*else*/ {
95354
95355         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":241
95356  *                     d = <dict>dict_result
95357  *                 else:
95358  *                     d = {}             # <<<<<<<<<<<<<<
95359  *                     self._function_cache[ns_utf] = d
95360  *             d[name_utf] = function
95361  */
95362         __pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95363         __Pyx_GOTREF(((PyObject *)__pyx_4));
95364         __Pyx_DECREF(((PyObject *)__pyx_v_d));
95365         __pyx_v_d = __pyx_4;
95366         __pyx_4 = 0;
95367
95368         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":242
95369  *                 else:
95370  *                     d = {}
95371  *                     self._function_cache[ns_utf] = d             # <<<<<<<<<<<<<<
95372  *             d[name_utf] = function
95373  *             reg_func(ctxt, name_utf, ns_utf)
95374  */
95375         if (PyDict_SetItem(((PyObject *)__pyx_v_self->_function_cache), __pyx_v_ns_utf, ((PyObject *)__pyx_v_d)) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95376       }
95377       __pyx_L7:;
95378       goto __pyx_L6;
95379     }
95380     __pyx_L6:;
95381
95382     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":243
95383  *                     d = {}
95384  *                     self._function_cache[ns_utf] = d
95385  *             d[name_utf] = function             # <<<<<<<<<<<<<<
95386  *             reg_func(ctxt, name_utf, ns_utf)
95387  * 
95388  */
95389     if (PyDict_SetItem(((PyObject *)__pyx_v_d), __pyx_v_name_utf, __pyx_v_function) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95390
95391     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":244
95392  *                     self._function_cache[ns_utf] = d
95393  *             d[name_utf] = function
95394  *             reg_func(ctxt, name_utf, ns_utf)             # <<<<<<<<<<<<<<
95395  * 
95396  *     cdef unregisterAllFunctions(self, void* ctxt,
95397  */
95398     __pyx_v_reg_func(__pyx_v_ctxt, __pyx_v_name_utf, __pyx_v_ns_utf);
95399   }
95400   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
95401
95402   goto __pyx_L0;
95403   __pyx_L1_error:;
95404   __Pyx_XDECREF(__pyx_1);
95405   __Pyx_XDECREF(__pyx_2);
95406   __Pyx_XDECREF(__pyx_3);
95407   __Pyx_XDECREF(__pyx_4);
95408   __Pyx_XDECREF(__pyx_5);
95409   __Pyx_XDECREF(__pyx_6);
95410   __Pyx_XDECREF(__pyx_t_2);
95411   __Pyx_WriteUnraisable("lxml.etree._BaseContext.registerLocalFunctions");
95412   __pyx_L0:;
95413   __Pyx_DECREF(__pyx_v_d);
95414   __Pyx_DECREF(__pyx_v_last_ns);
95415   __Pyx_DECREF(__pyx_v_ns_utf);
95416   __Pyx_DECREF(__pyx_v_name_utf);
95417   __Pyx_DECREF(__pyx_v_function);
95418   __Pyx_FinishRefcountContext();
95419 }
95420
95421 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":246
95422  *             reg_func(ctxt, name_utf, ns_utf)
95423  * 
95424  *     cdef unregisterAllFunctions(self, void* ctxt,             # <<<<<<<<<<<<<<
95425  *                                       _register_function unreg_func):
95426  *         for ns_utf, functions in self._function_cache.iteritems():
95427  */
95428
95429 static  PyObject *__pyx_f_4lxml_5etree_12_BaseContext_unregisterAllFunctions(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self, void *__pyx_v_ctxt, __pyx_t_4lxml_5etree__register_function __pyx_v_unreg_func) {
95430   PyObject *__pyx_v_ns_utf;
95431   PyObject *__pyx_v_functions;
95432   PyObject *__pyx_v_name_utf;
95433   PyObject *__pyx_r = NULL;
95434   PyObject *__pyx_1 = 0;
95435   PyObject *__pyx_2 = 0;
95436   PyObject *__pyx_3 = 0;
95437   PyObject *__pyx_t_1 = NULL;
95438   Py_ssize_t __pyx_t_2;
95439   void *__pyx_t_3;
95440   void *__pyx_t_4;
95441   Py_ssize_t __pyx_t_5;
95442   PyObject *__pyx_t_6 = NULL;
95443   PyObject *__pyx_t_7 = NULL;
95444   __Pyx_SetupRefcountContext("unregisterAllFunctions");
95445   __pyx_v_ns_utf = Py_None; __Pyx_INCREF(Py_None);
95446   __pyx_v_functions = Py_None; __Pyx_INCREF(Py_None);
95447   __pyx_v_name_utf = Py_None; __Pyx_INCREF(Py_None);
95448
95449   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":248
95450  *     cdef unregisterAllFunctions(self, void* ctxt,
95451  *                                       _register_function unreg_func):
95452  *         for ns_utf, functions in self._function_cache.iteritems():             # <<<<<<<<<<<<<<
95453  *             for name_utf in functions:
95454  *                 unreg_func(ctxt, name_utf, ns_utf)
95455  */
95456   __Pyx_INCREF(((PyObject *)__pyx_v_self->_function_cache));
95457   __Pyx_XDECREF(__pyx_t_1);
95458   __pyx_t_1 = ((PyObject *)__pyx_v_self->_function_cache);
95459   __pyx_t_2 = 0;
95460   while (1) {
95461     if (!PyDict_Next(__pyx_t_1, (&__pyx_t_2), ((PyObject **)(&__pyx_t_3)), ((PyObject **)(&__pyx_t_4)))) break;
95462     __Pyx_INCREF(((PyObject *)__pyx_t_3));
95463     __Pyx_DECREF(__pyx_v_ns_utf);
95464     __pyx_v_ns_utf = ((PyObject *)__pyx_t_3);
95465     __Pyx_INCREF(((PyObject *)__pyx_t_4));
95466     __Pyx_DECREF(__pyx_v_functions);
95467     __pyx_v_functions = ((PyObject *)__pyx_t_4);
95468
95469     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":249
95470  *                                       _register_function unreg_func):
95471  *         for ns_utf, functions in self._function_cache.iteritems():
95472  *             for name_utf in functions:             # <<<<<<<<<<<<<<
95473  *                 unreg_func(ctxt, name_utf, ns_utf)
95474  * 
95475  */
95476     if (PyList_CheckExact(__pyx_v_functions) || PyTuple_CheckExact(__pyx_v_functions)) {
95477       __pyx_t_5 = 0; __pyx_t_6 = __pyx_v_functions; __Pyx_INCREF(__pyx_t_6);
95478     } else {
95479       __pyx_t_5 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_functions); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95480       __Pyx_GOTREF(__pyx_t_6);
95481     }
95482     for (;;) {
95483       if (likely(PyList_CheckExact(__pyx_t_6))) {
95484         if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_6)) break;
95485         __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
95486       } else if (likely(PyTuple_CheckExact(__pyx_t_6))) {
95487         if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
95488         __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++;
95489       } else {
95490         __pyx_t_7 = PyIter_Next(__pyx_t_6);
95491         if (!__pyx_t_7) {
95492           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95493           break;
95494         }
95495         __Pyx_GOTREF(__pyx_t_7);
95496       }
95497       __Pyx_DECREF(__pyx_v_name_utf);
95498       __pyx_v_name_utf = __pyx_t_7;
95499       __pyx_t_7 = 0;
95500
95501       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":250
95502  *         for ns_utf, functions in self._function_cache.iteritems():
95503  *             for name_utf in functions:
95504  *                 unreg_func(ctxt, name_utf, ns_utf)             # <<<<<<<<<<<<<<
95505  * 
95506  *     cdef unregisterGlobalFunctions(self, void* ctxt,
95507  */
95508       __pyx_v_unreg_func(__pyx_v_ctxt, __pyx_v_name_utf, __pyx_v_ns_utf);
95509     }
95510     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
95511   }
95512   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
95513
95514   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
95515   goto __pyx_L0;
95516   __pyx_L1_error:;
95517   __Pyx_XDECREF(__pyx_1);
95518   __Pyx_XDECREF(__pyx_2);
95519   __Pyx_XDECREF(__pyx_3);
95520   __Pyx_XDECREF(__pyx_t_1);
95521   __Pyx_XDECREF(__pyx_t_6);
95522   __Pyx_XDECREF(__pyx_t_7);
95523   __Pyx_AddTraceback("lxml.etree._BaseContext.unregisterAllFunctions");
95524   __pyx_r = 0;
95525   __pyx_L0:;
95526   __Pyx_DECREF(__pyx_v_ns_utf);
95527   __Pyx_DECREF(__pyx_v_functions);
95528   __Pyx_DECREF(__pyx_v_name_utf);
95529   __Pyx_XGIVEREF(__pyx_r);
95530   __Pyx_FinishRefcountContext();
95531   return __pyx_r;
95532 }
95533
95534 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":252
95535  *                 unreg_func(ctxt, name_utf, ns_utf)
95536  * 
95537  *     cdef unregisterGlobalFunctions(self, void* ctxt,             # <<<<<<<<<<<<<<
95538  *                                          _register_function unreg_func):
95539  *         for ns_utf, functions in self._function_cache.items():
95540  */
95541
95542 static  PyObject *__pyx_f_4lxml_5etree_12_BaseContext_unregisterGlobalFunctions(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self, void *__pyx_v_ctxt, __pyx_t_4lxml_5etree__register_function __pyx_v_unreg_func) {
95543   PyObject *__pyx_v_ns_utf;
95544   PyObject *__pyx_v_functions;
95545   PyObject *__pyx_v_name_utf;
95546   PyObject *__pyx_r = NULL;
95547   PyObject *__pyx_1 = 0;
95548   PyObject *__pyx_2 = 0;
95549   PyObject *__pyx_3 = 0;
95550   Py_ssize_t __pyx_t_1;
95551   PyObject *__pyx_t_2 = NULL;
95552   PyObject *__pyx_t_3 = NULL;
95553   Py_ssize_t __pyx_t_4;
95554   PyObject *__pyx_t_5 = NULL;
95555   int __pyx_t_6;
95556   int __pyx_t_7;
95557   int __pyx_t_8;
95558   __Pyx_SetupRefcountContext("unregisterGlobalFunctions");
95559   __pyx_v_ns_utf = Py_None; __Pyx_INCREF(Py_None);
95560   __pyx_v_functions = Py_None; __Pyx_INCREF(Py_None);
95561   __pyx_v_name_utf = Py_None; __Pyx_INCREF(Py_None);
95562
95563   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":254
95564  *     cdef unregisterGlobalFunctions(self, void* ctxt,
95565  *                                          _register_function unreg_func):
95566  *         for ns_utf, functions in self._function_cache.items():             # <<<<<<<<<<<<<<
95567  *             for name_utf in functions:
95568  *                 if self._extensions is None or \
95569  */
95570   __pyx_t_2 = PyDict_Items(((PyObject *)__pyx_v_self->_function_cache)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95571   __Pyx_GOTREF(__pyx_t_2);
95572   if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
95573     __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3);
95574   } else {
95575     __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95576     __Pyx_GOTREF(__pyx_t_3);
95577   }
95578   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
95579   for (;;) {
95580     if (likely(PyList_CheckExact(__pyx_t_3))) {
95581       if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break;
95582       __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++;
95583     } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
95584       if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
95585       __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++;
95586     } else {
95587       __pyx_t_2 = PyIter_Next(__pyx_t_3);
95588       if (!__pyx_t_2) {
95589         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95590         break;
95591       }
95592       __Pyx_GOTREF(__pyx_t_2);
95593     }
95594     if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 2)) {
95595       PyObject* tuple = __pyx_t_2;
95596       __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
95597       __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
95598       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
95599       __Pyx_DECREF(__pyx_v_ns_utf);
95600       __pyx_v_ns_utf = __pyx_2;
95601       __pyx_2 = 0;
95602       __Pyx_DECREF(__pyx_v_functions);
95603       __pyx_v_functions = __pyx_3;
95604       __pyx_3 = 0;
95605     } else {
95606       __pyx_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95607       __Pyx_GOTREF(__pyx_1);
95608       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
95609       __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95610       __Pyx_GOTREF(__pyx_2);
95611       __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95612       __Pyx_GOTREF(__pyx_3);
95613       if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95614       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
95615       __Pyx_DECREF(__pyx_v_ns_utf);
95616       __pyx_v_ns_utf = __pyx_2;
95617       __pyx_2 = 0;
95618       __Pyx_DECREF(__pyx_v_functions);
95619       __pyx_v_functions = __pyx_3;
95620       __pyx_3 = 0;
95621     }
95622
95623     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":255
95624  *                                          _register_function unreg_func):
95625  *         for ns_utf, functions in self._function_cache.items():
95626  *             for name_utf in functions:             # <<<<<<<<<<<<<<
95627  *                 if self._extensions is None or \
95628  *                        (ns_utf, name_utf) not in self._extensions:
95629  */
95630     if (PyList_CheckExact(__pyx_v_functions) || PyTuple_CheckExact(__pyx_v_functions)) {
95631       __pyx_t_4 = 0; __pyx_t_2 = __pyx_v_functions; __Pyx_INCREF(__pyx_t_2);
95632     } else {
95633       __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_functions); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95634       __Pyx_GOTREF(__pyx_t_2);
95635     }
95636     for (;;) {
95637       if (likely(PyList_CheckExact(__pyx_t_2))) {
95638         if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
95639         __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
95640       } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
95641         if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
95642         __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
95643       } else {
95644         __pyx_t_5 = PyIter_Next(__pyx_t_2);
95645         if (!__pyx_t_5) {
95646           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95647           break;
95648         }
95649         __Pyx_GOTREF(__pyx_t_5);
95650       }
95651       __Pyx_DECREF(__pyx_v_name_utf);
95652       __pyx_v_name_utf = __pyx_t_5;
95653       __pyx_t_5 = 0;
95654
95655       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":256
95656  *         for ns_utf, functions in self._function_cache.items():
95657  *             for name_utf in functions:
95658  *                 if self._extensions is None or \             # <<<<<<<<<<<<<<
95659  *                        (ns_utf, name_utf) not in self._extensions:
95660  *                     unreg_func(ctxt, name_utf, ns_utf)
95661  */
95662       __pyx_t_6 = (__pyx_v_self->_extensions == ((PyObject *)Py_None));
95663       if (!__pyx_t_6) {
95664
95665         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":257
95666  *             for name_utf in functions:
95667  *                 if self._extensions is None or \
95668  *                        (ns_utf, name_utf) not in self._extensions:             # <<<<<<<<<<<<<<
95669  *                     unreg_func(ctxt, name_utf, ns_utf)
95670  * 
95671  */
95672         __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95673         __Pyx_GOTREF(((PyObject *)__pyx_t_5));
95674         __Pyx_INCREF(__pyx_v_ns_utf);
95675         PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_ns_utf);
95676         __Pyx_GIVEREF(__pyx_v_ns_utf);
95677         __Pyx_INCREF(__pyx_v_name_utf);
95678         PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_name_utf);
95679         __Pyx_GIVEREF(__pyx_v_name_utf);
95680         __pyx_t_7 = (!PySequence_Contains(((PyObject *)__pyx_v_self->_extensions), ((PyObject *)__pyx_t_5))); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95681         __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
95682         __pyx_t_8 = __pyx_t_7;
95683       } else {
95684         __pyx_t_8 = __pyx_t_6;
95685       }
95686       if (__pyx_t_8) {
95687
95688         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":258
95689  *                 if self._extensions is None or \
95690  *                        (ns_utf, name_utf) not in self._extensions:
95691  *                     unreg_func(ctxt, name_utf, ns_utf)             # <<<<<<<<<<<<<<
95692  * 
95693  *     cdef _find_cached_function(self, char* c_ns_uri, char* c_name):
95694  */
95695         __pyx_v_unreg_func(__pyx_v_ctxt, __pyx_v_name_utf, __pyx_v_ns_utf);
95696         goto __pyx_L7;
95697       }
95698       __pyx_L7:;
95699     }
95700     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
95701   }
95702   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
95703
95704   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
95705   goto __pyx_L0;
95706   __pyx_L1_error:;
95707   __Pyx_XDECREF(__pyx_1);
95708   __Pyx_XDECREF(__pyx_2);
95709   __Pyx_XDECREF(__pyx_3);
95710   __Pyx_XDECREF(__pyx_t_2);
95711   __Pyx_XDECREF(__pyx_t_3);
95712   __Pyx_XDECREF(__pyx_t_5);
95713   __Pyx_AddTraceback("lxml.etree._BaseContext.unregisterGlobalFunctions");
95714   __pyx_r = 0;
95715   __pyx_L0:;
95716   __Pyx_DECREF(__pyx_v_ns_utf);
95717   __Pyx_DECREF(__pyx_v_functions);
95718   __Pyx_DECREF(__pyx_v_name_utf);
95719   __Pyx_XGIVEREF(__pyx_r);
95720   __Pyx_FinishRefcountContext();
95721   return __pyx_r;
95722 }
95723
95724 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":260
95725  *                     unreg_func(ctxt, name_utf, ns_utf)
95726  * 
95727  *     cdef _find_cached_function(self, char* c_ns_uri, char* c_name):             # <<<<<<<<<<<<<<
95728  *         u"""Lookup an extension function in the cache and return it.
95729  * 
95730  */
95731
95732 static  PyObject *__pyx_f_4lxml_5etree_12_BaseContext__find_cached_function(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self, char *__pyx_v_c_ns_uri, char *__pyx_v_c_name) {
95733   PyObject *__pyx_v_c_dict;
95734   PyObject *__pyx_v_dict_result;
95735   PyObject *__pyx_r = NULL;
95736   int __pyx_t_1;
95737   PyObject *__pyx_t_2 = NULL;
95738   __Pyx_SetupRefcountContext("_find_cached_function");
95739
95740   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":267
95741  *         cdef python.PyObject* c_dict
95742  *         cdef python.PyObject* dict_result
95743  *         if c_ns_uri is NULL:             # <<<<<<<<<<<<<<
95744  *             c_dict = python.PyDict_GetItem(
95745  *                 self._function_cache, None)
95746  */
95747   __pyx_t_1 = (__pyx_v_c_ns_uri == NULL);
95748   if (__pyx_t_1) {
95749
95750     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":269
95751  *         if c_ns_uri is NULL:
95752  *             c_dict = python.PyDict_GetItem(
95753  *                 self._function_cache, None)             # <<<<<<<<<<<<<<
95754  *         else:
95755  *             c_dict = python.PyDict_GetItem(
95756  */
95757     __pyx_v_c_dict = PyDict_GetItem(((PyObject *)__pyx_v_self->_function_cache), Py_None);
95758     goto __pyx_L3;
95759   }
95760   /*else*/ {
95761
95762     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":272
95763  *         else:
95764  *             c_dict = python.PyDict_GetItem(
95765  *                 self._function_cache, c_ns_uri)             # <<<<<<<<<<<<<<
95766  * 
95767  *         if c_dict is not NULL:
95768  */
95769     __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_c_ns_uri); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95770     __Pyx_GOTREF(__pyx_t_2);
95771     __pyx_v_c_dict = PyDict_GetItem(((PyObject *)__pyx_v_self->_function_cache), __pyx_t_2);
95772     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
95773   }
95774   __pyx_L3:;
95775
95776   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":274
95777  *                 self._function_cache, c_ns_uri)
95778  * 
95779  *         if c_dict is not NULL:             # <<<<<<<<<<<<<<
95780  *             dict_result = python.PyDict_GetItem(
95781  *                 <object>c_dict, c_name)
95782  */
95783   __pyx_t_1 = (__pyx_v_c_dict != NULL);
95784   if (__pyx_t_1) {
95785
95786     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":276
95787  *         if c_dict is not NULL:
95788  *             dict_result = python.PyDict_GetItem(
95789  *                 <object>c_dict, c_name)             # <<<<<<<<<<<<<<
95790  *             if dict_result is not NULL:
95791  *                 return <object>dict_result
95792  */
95793     __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_c_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95794     __Pyx_GOTREF(__pyx_t_2);
95795     __pyx_v_dict_result = PyDict_GetItem(((PyObject *)__pyx_v_c_dict), __pyx_t_2);
95796     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
95797
95798     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":277
95799  *             dict_result = python.PyDict_GetItem(
95800  *                 <object>c_dict, c_name)
95801  *             if dict_result is not NULL:             # <<<<<<<<<<<<<<
95802  *                 return <object>dict_result
95803  *         return None
95804  */
95805     __pyx_t_1 = (__pyx_v_dict_result != NULL);
95806     if (__pyx_t_1) {
95807
95808       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":278
95809  *                 <object>c_dict, c_name)
95810  *             if dict_result is not NULL:
95811  *                 return <object>dict_result             # <<<<<<<<<<<<<<
95812  *         return None
95813  * 
95814  */
95815       __Pyx_XDECREF(__pyx_r);
95816       __Pyx_INCREF(((PyObject *)__pyx_v_dict_result));
95817       __pyx_r = ((PyObject *)__pyx_v_dict_result);
95818       goto __pyx_L0;
95819       goto __pyx_L5;
95820     }
95821     __pyx_L5:;
95822     goto __pyx_L4;
95823   }
95824   __pyx_L4:;
95825
95826   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":279
95827  *             if dict_result is not NULL:
95828  *                 return <object>dict_result
95829  *         return None             # <<<<<<<<<<<<<<
95830  * 
95831  *     # Python access to the XPath context for extension functions
95832  */
95833   __Pyx_XDECREF(__pyx_r);
95834   __Pyx_INCREF(Py_None);
95835   __pyx_r = Py_None;
95836   goto __pyx_L0;
95837
95838   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
95839   goto __pyx_L0;
95840   __pyx_L1_error:;
95841   __Pyx_XDECREF(__pyx_t_2);
95842   __Pyx_AddTraceback("lxml.etree._BaseContext._find_cached_function");
95843   __pyx_r = 0;
95844   __pyx_L0:;
95845   __Pyx_XGIVEREF(__pyx_r);
95846   __Pyx_FinishRefcountContext();
95847   return __pyx_r;
95848 }
95849
95850 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":284
95851  * 
95852  *     property context_node:
95853  *         def __get__(self):             # <<<<<<<<<<<<<<
95854  *             cdef xmlNode* c_node
95855  *             if self._xpathCtxt is NULL:
95856  */
95857
95858 static PyObject *__pyx_pf_4lxml_5etree_12_BaseContext_12context_node___get__(PyObject *__pyx_v_self); /*proto*/
95859 static PyObject *__pyx_pf_4lxml_5etree_12_BaseContext_12context_node___get__(PyObject *__pyx_v_self) {
95860   xmlNode *__pyx_v_c_node;
95861   PyObject *__pyx_r = NULL;
95862   PyObject *__pyx_1 = 0;
95863   int __pyx_t_1;
95864   PyObject *__pyx_t_2 = NULL;
95865   __Pyx_SetupRefcountContext("__get__");
95866
95867   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":286
95868  *         def __get__(self):
95869  *             cdef xmlNode* c_node
95870  *             if self._xpathCtxt is NULL:             # <<<<<<<<<<<<<<
95871  *                 raise XPathError, \
95872  *                     u"XPath context is only usable during the evaluation"
95873  */
95874   __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_xpathCtxt == NULL);
95875   if (__pyx_t_1) {
95876
95877     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":287
95878  *             cdef xmlNode* c_node
95879  *             if self._xpathCtxt is NULL:
95880  *                 raise XPathError, \             # <<<<<<<<<<<<<<
95881  *                     u"XPath context is only usable during the evaluation"
95882  *             c_node = self._xpathCtxt.node
95883  */
95884     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XPathError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95885     __Pyx_GOTREF(__pyx_1);
95886
95887     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":288
95888  *             if self._xpathCtxt is NULL:
95889  *                 raise XPathError, \
95890  *                     u"XPath context is only usable during the evaluation"             # <<<<<<<<<<<<<<
95891  *             c_node = self._xpathCtxt.node
95892  *             if c_node is NULL:
95893  */
95894     __Pyx_Raise(__pyx_1, ((PyObject *)__pyx_kp_561), 0);
95895     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
95896     {__pyx_filename = __pyx_f[5]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95897     goto __pyx_L5;
95898   }
95899   __pyx_L5:;
95900
95901   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":289
95902  *                 raise XPathError, \
95903  *                     u"XPath context is only usable during the evaluation"
95904  *             c_node = self._xpathCtxt.node             # <<<<<<<<<<<<<<
95905  *             if c_node is NULL:
95906  *                 raise XPathError, u"no context node"
95907  */
95908   __pyx_v_c_node = ((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_xpathCtxt->node;
95909
95910   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":290
95911  *                     u"XPath context is only usable during the evaluation"
95912  *             c_node = self._xpathCtxt.node
95913  *             if c_node is NULL:             # <<<<<<<<<<<<<<
95914  *                 raise XPathError, u"no context node"
95915  *             if c_node.doc != self._xpathCtxt.doc:
95916  */
95917   __pyx_t_1 = (__pyx_v_c_node == NULL);
95918   if (__pyx_t_1) {
95919
95920     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":291
95921  *             c_node = self._xpathCtxt.node
95922  *             if c_node is NULL:
95923  *                 raise XPathError, u"no context node"             # <<<<<<<<<<<<<<
95924  *             if c_node.doc != self._xpathCtxt.doc:
95925  *                 raise XPathError, \
95926  */
95927     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XPathError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95928     __Pyx_GOTREF(__pyx_1);
95929     __Pyx_Raise(__pyx_1, ((PyObject *)__pyx_kp_562), 0);
95930     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
95931     {__pyx_filename = __pyx_f[5]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95932     goto __pyx_L6;
95933   }
95934   __pyx_L6:;
95935
95936   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":292
95937  *             if c_node is NULL:
95938  *                 raise XPathError, u"no context node"
95939  *             if c_node.doc != self._xpathCtxt.doc:             # <<<<<<<<<<<<<<
95940  *                 raise XPathError, \
95941  *                     u"document-external context nodes are not supported"
95942  */
95943   __pyx_t_1 = (__pyx_v_c_node->doc != ((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_xpathCtxt->doc);
95944   if (__pyx_t_1) {
95945
95946     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":293
95947  *                 raise XPathError, u"no context node"
95948  *             if c_node.doc != self._xpathCtxt.doc:
95949  *                 raise XPathError, \             # <<<<<<<<<<<<<<
95950  *                     u"document-external context nodes are not supported"
95951  *             if self._doc is None:
95952  */
95953     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XPathError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95954     __Pyx_GOTREF(__pyx_1);
95955
95956     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":294
95957  *             if c_node.doc != self._xpathCtxt.doc:
95958  *                 raise XPathError, \
95959  *                     u"document-external context nodes are not supported"             # <<<<<<<<<<<<<<
95960  *             if self._doc is None:
95961  *                 raise XPathError, u"document context is missing"
95962  */
95963     __Pyx_Raise(__pyx_1, ((PyObject *)__pyx_kp_563), 0);
95964     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
95965     {__pyx_filename = __pyx_f[5]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95966     goto __pyx_L7;
95967   }
95968   __pyx_L7:;
95969
95970   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":295
95971  *                 raise XPathError, \
95972  *                     u"document-external context nodes are not supported"
95973  *             if self._doc is None:             # <<<<<<<<<<<<<<
95974  *                 raise XPathError, u"document context is missing"
95975  *             return _elementFactory(self._doc, c_node)
95976  */
95977   __pyx_t_1 = (((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_doc) == Py_None);
95978   if (__pyx_t_1) {
95979
95980     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":296
95981  *                     u"document-external context nodes are not supported"
95982  *             if self._doc is None:
95983  *                 raise XPathError, u"document context is missing"             # <<<<<<<<<<<<<<
95984  *             return _elementFactory(self._doc, c_node)
95985  * 
95986  */
95987     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XPathError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95988     __Pyx_GOTREF(__pyx_1);
95989     __Pyx_Raise(__pyx_1, ((PyObject *)__pyx_kp_564), 0);
95990     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
95991     {__pyx_filename = __pyx_f[5]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
95992     goto __pyx_L8;
95993   }
95994   __pyx_L8:;
95995
95996   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":297
95997  *             if self._doc is None:
95998  *                 raise XPathError, u"document context is missing"
95999  *             return _elementFactory(self._doc, c_node)             # <<<<<<<<<<<<<<
96000  * 
96001  *     property eval_context:
96002  */
96003   __Pyx_XDECREF(__pyx_r);
96004   __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96005   __Pyx_GOTREF(__pyx_t_2);
96006   __pyx_r = __pyx_t_2;
96007   __pyx_t_2 = 0;
96008   goto __pyx_L0;
96009
96010   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
96011   goto __pyx_L0;
96012   __pyx_L1_error:;
96013   __Pyx_XDECREF(__pyx_1);
96014   __Pyx_XDECREF(__pyx_t_2);
96015   __Pyx_AddTraceback("lxml.etree._BaseContext.context_node.__get__");
96016   __pyx_r = NULL;
96017   __pyx_L0:;
96018   __Pyx_XGIVEREF(__pyx_r);
96019   __Pyx_FinishRefcountContext();
96020   return __pyx_r;
96021 }
96022
96023 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":300
96024  * 
96025  *     property eval_context:
96026  *         def __get__(self):             # <<<<<<<<<<<<<<
96027  *             if self._eval_context_dict is None:
96028  *                 self._eval_context_dict = {}
96029  */
96030
96031 static PyObject *__pyx_pf_4lxml_5etree_12_BaseContext_12eval_context___get__(PyObject *__pyx_v_self); /*proto*/
96032 static PyObject *__pyx_pf_4lxml_5etree_12_BaseContext_12eval_context___get__(PyObject *__pyx_v_self) {
96033   PyObject *__pyx_r = NULL;
96034   PyObject *__pyx_1 = 0;
96035   int __pyx_t_1;
96036   __Pyx_SetupRefcountContext("__get__");
96037
96038   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":301
96039  *     property eval_context:
96040  *         def __get__(self):
96041  *             if self._eval_context_dict is None:             # <<<<<<<<<<<<<<
96042  *                 self._eval_context_dict = {}
96043  *             return self._eval_context_dict
96044  */
96045   __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_eval_context_dict == ((PyObject *)Py_None));
96046   if (__pyx_t_1) {
96047
96048     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":302
96049  *         def __get__(self):
96050  *             if self._eval_context_dict is None:
96051  *                 self._eval_context_dict = {}             # <<<<<<<<<<<<<<
96052  *             return self._eval_context_dict
96053  * 
96054  */
96055     __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96056     __Pyx_GOTREF(((PyObject *)__pyx_1));
96057     __Pyx_GIVEREF(((PyObject *)__pyx_1));
96058     __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_eval_context_dict);
96059     __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_eval_context_dict));
96060     ((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_eval_context_dict = __pyx_1;
96061     __pyx_1 = 0;
96062     goto __pyx_L5;
96063   }
96064   __pyx_L5:;
96065
96066   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":303
96067  *             if self._eval_context_dict is None:
96068  *                 self._eval_context_dict = {}
96069  *             return self._eval_context_dict             # <<<<<<<<<<<<<<
96070  * 
96071  *     # Python reference keeping during XPath function evaluation
96072  */
96073   __Pyx_XDECREF(__pyx_r);
96074   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_eval_context_dict));
96075   __pyx_r = ((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_eval_context_dict);
96076   goto __pyx_L0;
96077
96078   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
96079   goto __pyx_L0;
96080   __pyx_L1_error:;
96081   __Pyx_XDECREF(__pyx_1);
96082   __Pyx_AddTraceback("lxml.etree._BaseContext.eval_context.__get__");
96083   __pyx_r = NULL;
96084   __pyx_L0:;
96085   __Pyx_XGIVEREF(__pyx_r);
96086   __Pyx_FinishRefcountContext();
96087   return __pyx_r;
96088 }
96089
96090 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":307
96091  *     # Python reference keeping during XPath function evaluation
96092  * 
96093  *     cdef _release_temp_refs(self):             # <<<<<<<<<<<<<<
96094  *         u"Free temporarily referenced objects from this context."
96095  *         self._temp_refs.clear()
96096  */
96097
96098 static  PyObject *__pyx_f_4lxml_5etree_12_BaseContext__release_temp_refs(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self) {
96099   PyObject *__pyx_r = NULL;
96100   int __pyx_t_1;
96101   __Pyx_SetupRefcountContext("_release_temp_refs");
96102
96103   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":309
96104  *     cdef _release_temp_refs(self):
96105  *         u"Free temporarily referenced objects from this context."
96106  *         self._temp_refs.clear()             # <<<<<<<<<<<<<<
96107  * 
96108  *     cdef _hold(self, obj):
96109  */
96110   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__TempStore *)__pyx_v_self->_temp_refs->__pyx_vtab)->clear(__pyx_v_self->_temp_refs); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96111
96112   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
96113   goto __pyx_L0;
96114   __pyx_L1_error:;
96115   __Pyx_AddTraceback("lxml.etree._BaseContext._release_temp_refs");
96116   __pyx_r = 0;
96117   __pyx_L0:;
96118   __Pyx_XGIVEREF(__pyx_r);
96119   __Pyx_FinishRefcountContext();
96120   return __pyx_r;
96121 }
96122
96123 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":311
96124  *         self._temp_refs.clear()
96125  * 
96126  *     cdef _hold(self, obj):             # <<<<<<<<<<<<<<
96127  *         u"""A way to temporarily hold references to nodes in the evaluator.
96128  * 
96129  */
96130
96131 static  PyObject *__pyx_f_4lxml_5etree_12_BaseContext__hold(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self, PyObject *__pyx_v_obj) {
96132   PyObject *__pyx_v_o;
96133   PyObject *__pyx_r = NULL;
96134   int __pyx_t_1;
96135   int __pyx_t_2;
96136   Py_ssize_t __pyx_t_3;
96137   PyObject *__pyx_t_4 = NULL;
96138   PyObject *__pyx_t_5 = NULL;
96139   __Pyx_SetupRefcountContext("_hold");
96140   __pyx_v_o = Py_None; __Pyx_INCREF(Py_None);
96141
96142   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":319
96143  *         """
96144  *         cdef _Element element
96145  *         if isinstance(obj, _Element):             # <<<<<<<<<<<<<<
96146  *             self._temp_refs.add(obj)
96147  *             self._temp_refs.add((<_Element>obj)._doc)
96148  */
96149   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_obj, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Element))); 
96150   if (__pyx_t_1) {
96151
96152     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":320
96153  *         cdef _Element element
96154  *         if isinstance(obj, _Element):
96155  *             self._temp_refs.add(obj)             # <<<<<<<<<<<<<<
96156  *             self._temp_refs.add((<_Element>obj)._doc)
96157  *             return
96158  */
96159     __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__TempStore *)__pyx_v_self->_temp_refs->__pyx_vtab)->add(__pyx_v_self->_temp_refs, __pyx_v_obj); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96160
96161     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":321
96162  *         if isinstance(obj, _Element):
96163  *             self._temp_refs.add(obj)
96164  *             self._temp_refs.add((<_Element>obj)._doc)             # <<<<<<<<<<<<<<
96165  *             return
96166  *         elif _isString(obj) or not python.PySequence_Check(obj):
96167  */
96168     __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__TempStore *)__pyx_v_self->_temp_refs->__pyx_vtab)->add(__pyx_v_self->_temp_refs, ((PyObject *)((struct LxmlElement *)__pyx_v_obj)->_doc)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96169
96170     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":322
96171  *             self._temp_refs.add(obj)
96172  *             self._temp_refs.add((<_Element>obj)._doc)
96173  *             return             # <<<<<<<<<<<<<<
96174  *         elif _isString(obj) or not python.PySequence_Check(obj):
96175  *             return
96176  */
96177     __Pyx_XDECREF(__pyx_r);
96178     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
96179     goto __pyx_L0;
96180     goto __pyx_L3;
96181   }
96182
96183   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":323
96184  *             self._temp_refs.add((<_Element>obj)._doc)
96185  *             return
96186  *         elif _isString(obj) or not python.PySequence_Check(obj):             # <<<<<<<<<<<<<<
96187  *             return
96188  *         for o in obj:
96189  */
96190   if (!_isString(__pyx_v_obj)) {
96191     __pyx_t_1 = (!PySequence_Check(__pyx_v_obj));
96192   } else {
96193     __pyx_t_1 = _isString(__pyx_v_obj);
96194   }
96195   if (__pyx_t_1) {
96196
96197     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":324
96198  *             return
96199  *         elif _isString(obj) or not python.PySequence_Check(obj):
96200  *             return             # <<<<<<<<<<<<<<
96201  *         for o in obj:
96202  *             if isinstance(o, _Element):
96203  */
96204     __Pyx_XDECREF(__pyx_r);
96205     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
96206     goto __pyx_L0;
96207     goto __pyx_L3;
96208   }
96209   __pyx_L3:;
96210
96211   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":325
96212  *         elif _isString(obj) or not python.PySequence_Check(obj):
96213  *             return
96214  *         for o in obj:             # <<<<<<<<<<<<<<
96215  *             if isinstance(o, _Element):
96216  *                 #print "Holding element:", <int>element._c_node
96217  */
96218   if (PyList_CheckExact(__pyx_v_obj) || PyTuple_CheckExact(__pyx_v_obj)) {
96219     __pyx_t_3 = 0; __pyx_t_4 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_4);
96220   } else {
96221     __pyx_t_3 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96222     __Pyx_GOTREF(__pyx_t_4);
96223   }
96224   for (;;) {
96225     if (likely(PyList_CheckExact(__pyx_t_4))) {
96226       if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_4)) break;
96227       __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
96228     } else if (likely(PyTuple_CheckExact(__pyx_t_4))) {
96229       if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
96230       __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
96231     } else {
96232       __pyx_t_5 = PyIter_Next(__pyx_t_4);
96233       if (!__pyx_t_5) {
96234         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96235         break;
96236       }
96237       __Pyx_GOTREF(__pyx_t_5);
96238     }
96239     __Pyx_DECREF(__pyx_v_o);
96240     __pyx_v_o = __pyx_t_5;
96241     __pyx_t_5 = 0;
96242
96243     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":326
96244  *             return
96245  *         for o in obj:
96246  *             if isinstance(o, _Element):             # <<<<<<<<<<<<<<
96247  *                 #print "Holding element:", <int>element._c_node
96248  *                 self._temp_refs.add(o)
96249  */
96250     __pyx_t_1 = PyObject_TypeCheck(__pyx_v_o, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Element))); 
96251     if (__pyx_t_1) {
96252
96253       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":328
96254  *             if isinstance(o, _Element):
96255  *                 #print "Holding element:", <int>element._c_node
96256  *                 self._temp_refs.add(o)             # <<<<<<<<<<<<<<
96257  *                 #print "Holding document:", <int>element._doc._c_doc
96258  *                 self._temp_refs.add((<_Element>o)._doc)
96259  */
96260       __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__TempStore *)__pyx_v_self->_temp_refs->__pyx_vtab)->add(__pyx_v_self->_temp_refs, __pyx_v_o); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96261
96262       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":330
96263  *                 self._temp_refs.add(o)
96264  *                 #print "Holding document:", <int>element._doc._c_doc
96265  *                 self._temp_refs.add((<_Element>o)._doc)             # <<<<<<<<<<<<<<
96266  * 
96267  * def Extension(module, function_mapping=None, *, ns=None):
96268  */
96269       __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__TempStore *)__pyx_v_self->_temp_refs->__pyx_vtab)->add(__pyx_v_self->_temp_refs, ((PyObject *)((struct LxmlElement *)__pyx_v_o)->_doc)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96270       goto __pyx_L6;
96271     }
96272     __pyx_L6:;
96273   }
96274   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
96275
96276   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
96277   goto __pyx_L0;
96278   __pyx_L1_error:;
96279   __Pyx_XDECREF(__pyx_t_4);
96280   __Pyx_XDECREF(__pyx_t_5);
96281   __Pyx_AddTraceback("lxml.etree._BaseContext._hold");
96282   __pyx_r = 0;
96283   __pyx_L0:;
96284   __Pyx_DECREF(__pyx_v_o);
96285   __Pyx_XGIVEREF(__pyx_r);
96286   __Pyx_FinishRefcountContext();
96287   return __pyx_r;
96288 }
96289
96290 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":332
96291  *                 self._temp_refs.add((<_Element>o)._doc)
96292  * 
96293  * def Extension(module, function_mapping=None, *, ns=None):             # <<<<<<<<<<<<<<
96294  *     u"""Extension(module, function_mapping=None, ns=None)
96295  * 
96296  */
96297
96298 static PyObject *__pyx_pf_4lxml_5etree_Extension(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
96299 static char __pyx_doc_4lxml_5etree_Extension[] = "Extension(module, function_mapping=None, ns=None)\n\n    Build a dictionary of extension functions from the functions\n    defined in a module or the methods of an object.\n\n    As second argument, you can pass an additional mapping of\n    attribute names to XPath function names, or a list of function\n    names that should be taken.\n\n    The ``ns`` keyword argument accepts a namespace URI for the XPath\n    functions.\n    ";
96300 static PyObject *__pyx_pf_4lxml_5etree_Extension(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
96301   PyObject *__pyx_v_module = 0;
96302   PyObject *__pyx_v_function_mapping = 0;
96303   PyObject *__pyx_v_ns = 0;
96304   PyObject *__pyx_v_functions = 0;
96305   PyObject *__pyx_v_function_name;
96306   PyObject *__pyx_v_xpath_name;
96307   PyObject *__pyx_v_name;
96308   PyObject *__pyx_r = NULL;
96309   PyObject *__pyx_1 = 0;
96310   PyObject *__pyx_2 = 0;
96311   PyObject *__pyx_3 = 0;
96312   int __pyx_t_1;
96313   Py_ssize_t __pyx_t_2;
96314   PyObject *__pyx_t_3 = NULL;
96315   PyObject *__pyx_t_4 = NULL;
96316   PyObject *__pyx_t_5 = NULL;
96317   PyObject *__pyx_t_6 = NULL;
96318   PyObject *__pyx_t_7 = NULL;
96319   int __pyx_t_8;
96320   int __pyx_t_9;
96321   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_module,&__pyx_kp_function_mapping,&__pyx_kp_ns,0};
96322   __Pyx_SetupRefcountContext("Extension");
96323   __pyx_self = __pyx_self;
96324   if (unlikely(__pyx_kwds)) {
96325     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
96326     PyObject* values[3] = {0,0,0};
96327     values[1] = Py_None;
96328     values[2] = Py_None;
96329     switch (PyTuple_GET_SIZE(__pyx_args)) {
96330       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
96331       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
96332       case  0: break;
96333       default: goto __pyx_L5_argtuple_error;
96334     }
96335     switch (PyTuple_GET_SIZE(__pyx_args)) {
96336       case  0:
96337       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_module);
96338       if (likely(values[0])) kw_args--;
96339       else goto __pyx_L5_argtuple_error;
96340       case  1:
96341       if (kw_args > 0) {
96342         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_function_mapping);
96343         if (unlikely(value)) { values[1] = value; kw_args--; }
96344       }
96345     }
96346     while (kw_args > 0) {
96347       PyObject* value;
96348       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_ns);
96349       if (value) { values[2] = value; if (!(--kw_args)) break; }
96350       break;
96351     }
96352     if (unlikely(kw_args > 0)) {
96353       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "Extension") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
96354     }
96355     __pyx_v_module = values[0];
96356     __pyx_v_function_mapping = values[1];
96357     __pyx_v_ns = values[2];
96358   } else {
96359     __pyx_v_function_mapping = Py_None;
96360     __pyx_v_ns = Py_None;
96361     switch (PyTuple_GET_SIZE(__pyx_args)) {
96362       case  2: __pyx_v_function_mapping = PyTuple_GET_ITEM(__pyx_args, 1);
96363       case  1: __pyx_v_module = PyTuple_GET_ITEM(__pyx_args, 0);
96364       break;
96365       default: goto __pyx_L5_argtuple_error;
96366     }
96367   }
96368   goto __pyx_L4_argument_unpacking_done;
96369   __pyx_L5_argtuple_error:;
96370   __Pyx_RaiseArgtupleInvalid("Extension", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
96371   __pyx_L3_error:;
96372   __Pyx_AddTraceback("lxml.etree.Extension");
96373   return NULL;
96374   __pyx_L4_argument_unpacking_done:;
96375   __Pyx_INCREF(__pyx_v_function_mapping);
96376   __pyx_v_function_name = Py_None; __Pyx_INCREF(Py_None);
96377   __pyx_v_xpath_name = Py_None; __Pyx_INCREF(Py_None);
96378   __pyx_v_name = Py_None; __Pyx_INCREF(Py_None);
96379
96380   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":345
96381  *     functions.
96382  *     """
96383  *     cdef dict functions = {}             # <<<<<<<<<<<<<<
96384  *     if python.PyDict_Check(function_mapping):
96385  *         for function_name, xpath_name in function_mapping.items():
96386  */
96387   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96388   __Pyx_GOTREF(((PyObject *)__pyx_1));
96389   __pyx_v_functions = __pyx_1;
96390   __pyx_1 = 0;
96391
96392   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":346
96393  *     """
96394  *     cdef dict functions = {}
96395  *     if python.PyDict_Check(function_mapping):             # <<<<<<<<<<<<<<
96396  *         for function_name, xpath_name in function_mapping.items():
96397  *             functions[(ns, xpath_name)] = getattr(module, function_name)
96398  */
96399   __pyx_t_1 = PyDict_Check(__pyx_v_function_mapping);
96400   if (__pyx_t_1) {
96401
96402     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":347
96403  *     cdef dict functions = {}
96404  *     if python.PyDict_Check(function_mapping):
96405  *         for function_name, xpath_name in function_mapping.items():             # <<<<<<<<<<<<<<
96406  *             functions[(ns, xpath_name)] = getattr(module, function_name)
96407  *     else:
96408  */
96409     __pyx_t_3 = PyObject_GetAttr(__pyx_v_function_mapping, __pyx_kp_items); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96410     __Pyx_GOTREF(__pyx_t_3);
96411     __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96412     __Pyx_GOTREF(__pyx_t_4);
96413     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
96414     if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
96415       __pyx_t_2 = 0; __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3);
96416     } else {
96417       __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96418       __Pyx_GOTREF(__pyx_t_3);
96419     }
96420     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
96421     for (;;) {
96422       if (likely(PyList_CheckExact(__pyx_t_3))) {
96423         if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
96424         __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
96425       } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
96426         if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
96427         __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
96428       } else {
96429         __pyx_t_4 = PyIter_Next(__pyx_t_3);
96430         if (!__pyx_t_4) {
96431           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96432           break;
96433         }
96434         __Pyx_GOTREF(__pyx_t_4);
96435       }
96436       if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 2)) {
96437         PyObject* tuple = __pyx_t_4;
96438         __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
96439         __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
96440         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
96441         __Pyx_DECREF(__pyx_v_function_name);
96442         __pyx_v_function_name = __pyx_2;
96443         __pyx_2 = 0;
96444         __Pyx_DECREF(__pyx_v_xpath_name);
96445         __pyx_v_xpath_name = __pyx_3;
96446         __pyx_3 = 0;
96447       } else {
96448         __pyx_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96449         __Pyx_GOTREF(__pyx_1);
96450         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
96451         __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96452         __Pyx_GOTREF(__pyx_2);
96453         __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96454         __Pyx_GOTREF(__pyx_3);
96455         if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96456         __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
96457         __Pyx_DECREF(__pyx_v_function_name);
96458         __pyx_v_function_name = __pyx_2;
96459         __pyx_2 = 0;
96460         __Pyx_DECREF(__pyx_v_xpath_name);
96461         __pyx_v_xpath_name = __pyx_3;
96462         __pyx_3 = 0;
96463       }
96464
96465       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":348
96466  *     if python.PyDict_Check(function_mapping):
96467  *         for function_name, xpath_name in function_mapping.items():
96468  *             functions[(ns, xpath_name)] = getattr(module, function_name)             # <<<<<<<<<<<<<<
96469  *     else:
96470  *         if function_mapping is None:
96471  */
96472       __pyx_t_4 = PyObject_GetAttr(__pyx_v_module, __pyx_v_function_name); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96473       __Pyx_GOTREF(__pyx_t_4);
96474       __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96475       __Pyx_GOTREF(((PyObject *)__pyx_t_5));
96476       __Pyx_INCREF(__pyx_v_ns);
96477       PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_ns);
96478       __Pyx_GIVEREF(__pyx_v_ns);
96479       __Pyx_INCREF(__pyx_v_xpath_name);
96480       PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_xpath_name);
96481       __Pyx_GIVEREF(__pyx_v_xpath_name);
96482       if (PyDict_SetItem(((PyObject *)__pyx_v_functions), ((PyObject *)__pyx_t_5), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96483       __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
96484       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
96485     }
96486     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
96487     goto __pyx_L6;
96488   }
96489   /*else*/ {
96490
96491     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":350
96492  *             functions[(ns, xpath_name)] = getattr(module, function_name)
96493  *     else:
96494  *         if function_mapping is None:             # <<<<<<<<<<<<<<
96495  *             function_mapping = [ name for name in dir(module)
96496  *                                  if not name.startswith(u'_') ]
96497  */
96498     __pyx_t_1 = (__pyx_v_function_mapping == Py_None);
96499     if (__pyx_t_1) {
96500
96501       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":351
96502  *     else:
96503  *         if function_mapping is None:
96504  *             function_mapping = [ name for name in dir(module)             # <<<<<<<<<<<<<<
96505  *                                  if not name.startswith(u'_') ]
96506  *         for function_name in function_mapping:
96507  */
96508       __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96509       __Pyx_GOTREF(((PyObject *)__pyx_t_3));
96510       __pyx_t_4 = PyObject_Dir(__pyx_v_module); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96511       __Pyx_GOTREF(__pyx_t_4);
96512       if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
96513         __pyx_t_2 = 0; __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5);
96514       } else {
96515         __pyx_t_2 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96516         __Pyx_GOTREF(__pyx_t_5);
96517       }
96518       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
96519       for (;;) {
96520         if (likely(PyList_CheckExact(__pyx_t_5))) {
96521           if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_5)) break;
96522           __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
96523         } else if (likely(PyTuple_CheckExact(__pyx_t_5))) {
96524           if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
96525           __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
96526         } else {
96527           __pyx_t_4 = PyIter_Next(__pyx_t_5);
96528           if (!__pyx_t_4) {
96529             if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96530             break;
96531           }
96532           __Pyx_GOTREF(__pyx_t_4);
96533         }
96534         __Pyx_DECREF(__pyx_v_name);
96535         __pyx_v_name = __pyx_t_4;
96536         __pyx_t_4 = 0;
96537
96538         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":352
96539  *         if function_mapping is None:
96540  *             function_mapping = [ name for name in dir(module)
96541  *                                  if not name.startswith(u'_') ]             # <<<<<<<<<<<<<<
96542  *         for function_name in function_mapping:
96543  *             functions[(ns, function_name)] = getattr(module, function_name)
96544  */
96545         __pyx_t_4 = PyObject_GetAttr(__pyx_v_name, __pyx_kp_startswith); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96546         __Pyx_GOTREF(__pyx_t_4);
96547         __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96548         __Pyx_GOTREF(((PyObject *)__pyx_t_6));
96549         __Pyx_INCREF(((PyObject *)__pyx_kp_565));
96550         PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_565));
96551         __Pyx_GIVEREF(((PyObject *)__pyx_kp_565));
96552         __pyx_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96553         __Pyx_GOTREF(__pyx_t_7);
96554         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
96555         __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
96556         __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96557         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
96558         __pyx_t_8 = (!__pyx_t_1);
96559         if (__pyx_t_8) {
96560
96561           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":351
96562  *     else:
96563  *         if function_mapping is None:
96564  *             function_mapping = [ name for name in dir(module)             # <<<<<<<<<<<<<<
96565  *                                  if not name.startswith(u'_') ]
96566  *         for function_name in function_mapping:
96567  */
96568           __pyx_t_9 = PyList_Append(__pyx_t_3, (PyObject*)__pyx_v_name); if (unlikely(__pyx_t_9)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96569           goto __pyx_L12;
96570         }
96571         __pyx_L12:;
96572       }
96573       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
96574       __Pyx_INCREF(((PyObject *)__pyx_t_3));
96575       __Pyx_DECREF(__pyx_v_function_mapping);
96576       __pyx_v_function_mapping = ((PyObject *)__pyx_t_3);
96577       __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
96578       goto __pyx_L9;
96579     }
96580     __pyx_L9:;
96581
96582     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":353
96583  *             function_mapping = [ name for name in dir(module)
96584  *                                  if not name.startswith(u'_') ]
96585  *         for function_name in function_mapping:             # <<<<<<<<<<<<<<
96586  *             functions[(ns, function_name)] = getattr(module, function_name)
96587  *     return functions
96588  */
96589     if (PyList_CheckExact(__pyx_v_function_mapping) || PyTuple_CheckExact(__pyx_v_function_mapping)) {
96590       __pyx_t_2 = 0; __pyx_t_3 = __pyx_v_function_mapping; __Pyx_INCREF(__pyx_t_3);
96591     } else {
96592       __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_function_mapping); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96593       __Pyx_GOTREF(__pyx_t_3);
96594     }
96595     for (;;) {
96596       if (likely(PyList_CheckExact(__pyx_t_3))) {
96597         if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
96598         __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++;
96599       } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
96600         if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
96601         __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++;
96602       } else {
96603         __pyx_t_5 = PyIter_Next(__pyx_t_3);
96604         if (!__pyx_t_5) {
96605           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96606           break;
96607         }
96608         __Pyx_GOTREF(__pyx_t_5);
96609       }
96610       __Pyx_DECREF(__pyx_v_function_name);
96611       __pyx_v_function_name = __pyx_t_5;
96612       __pyx_t_5 = 0;
96613
96614       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":354
96615  *                                  if not name.startswith(u'_') ]
96616  *         for function_name in function_mapping:
96617  *             functions[(ns, function_name)] = getattr(module, function_name)             # <<<<<<<<<<<<<<
96618  *     return functions
96619  * 
96620  */
96621       __pyx_t_5 = PyObject_GetAttr(__pyx_v_module, __pyx_v_function_name); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96622       __Pyx_GOTREF(__pyx_t_5);
96623       __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96624       __Pyx_GOTREF(((PyObject *)__pyx_t_7));
96625       __Pyx_INCREF(__pyx_v_ns);
96626       PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_ns);
96627       __Pyx_GIVEREF(__pyx_v_ns);
96628       __Pyx_INCREF(__pyx_v_function_name);
96629       PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_function_name);
96630       __Pyx_GIVEREF(__pyx_v_function_name);
96631       if (PyDict_SetItem(((PyObject *)__pyx_v_functions), ((PyObject *)__pyx_t_7), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96632       __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
96633       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
96634     }
96635     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
96636   }
96637   __pyx_L6:;
96638
96639   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":355
96640  *         for function_name in function_mapping:
96641  *             functions[(ns, function_name)] = getattr(module, function_name)
96642  *     return functions             # <<<<<<<<<<<<<<
96643  * 
96644  * ################################################################################
96645  */
96646   __Pyx_XDECREF(__pyx_r);
96647   __Pyx_INCREF(((PyObject *)__pyx_v_functions));
96648   __pyx_r = ((PyObject *)__pyx_v_functions);
96649   goto __pyx_L0;
96650
96651   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
96652   goto __pyx_L0;
96653   __pyx_L1_error:;
96654   __Pyx_XDECREF(__pyx_1);
96655   __Pyx_XDECREF(__pyx_2);
96656   __Pyx_XDECREF(__pyx_3);
96657   __Pyx_XDECREF(__pyx_t_3);
96658   __Pyx_XDECREF(__pyx_t_4);
96659   __Pyx_XDECREF(__pyx_t_5);
96660   __Pyx_XDECREF(__pyx_t_6);
96661   __Pyx_XDECREF(__pyx_t_7);
96662   __Pyx_AddTraceback("lxml.etree.Extension");
96663   __pyx_r = NULL;
96664   __pyx_L0:;
96665   __Pyx_XDECREF(__pyx_v_functions);
96666   __Pyx_DECREF(__pyx_v_function_name);
96667   __Pyx_DECREF(__pyx_v_xpath_name);
96668   __Pyx_DECREF(__pyx_v_name);
96669   __Pyx_DECREF(__pyx_v_function_mapping);
96670   __Pyx_XGIVEREF(__pyx_r);
96671   __Pyx_FinishRefcountContext();
96672   return __pyx_r;
96673 }
96674
96675 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":362
96676  * cdef class _ExsltRegExp:
96677  *     cdef dict _compile_map
96678  *     def __init__(self):             # <<<<<<<<<<<<<<
96679  *         self._compile_map = {}
96680  * 
96681  */
96682
96683 static int __pyx_pf_4lxml_5etree_12_ExsltRegExp___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
96684 static int __pyx_pf_4lxml_5etree_12_ExsltRegExp___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
96685   int __pyx_r;
96686   PyObject *__pyx_1 = 0;
96687   __Pyx_SetupRefcountContext("__init__");
96688   if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
96689     __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
96690   if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
96691
96692   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":363
96693  *     cdef dict _compile_map
96694  *     def __init__(self):
96695  *         self._compile_map = {}             # <<<<<<<<<<<<<<
96696  * 
96697  *     cdef _make_string(self, value):
96698  */
96699   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96700   __Pyx_GOTREF(((PyObject *)__pyx_1));
96701   __Pyx_GIVEREF(((PyObject *)__pyx_1));
96702   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)__pyx_v_self)->_compile_map);
96703   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)__pyx_v_self)->_compile_map));
96704   ((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)__pyx_v_self)->_compile_map = __pyx_1;
96705   __pyx_1 = 0;
96706
96707   __pyx_r = 0;
96708   goto __pyx_L0;
96709   __pyx_L1_error:;
96710   __Pyx_XDECREF(__pyx_1);
96711   __Pyx_AddTraceback("lxml.etree._ExsltRegExp.__init__");
96712   __pyx_r = -1;
96713   __pyx_L0:;
96714   __Pyx_FinishRefcountContext();
96715   return __pyx_r;
96716 }
96717
96718 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":365
96719  *         self._compile_map = {}
96720  * 
96721  *     cdef _make_string(self, value):             # <<<<<<<<<<<<<<
96722  *         cdef char* c_text
96723  *         if _isString(value):
96724  */
96725
96726 static  PyObject *__pyx_f_4lxml_5etree_12_ExsltRegExp__make_string(struct __pyx_obj_4lxml_5etree__ExsltRegExp *__pyx_v_self, PyObject *__pyx_v_value) {
96727   char *__pyx_v_c_text;
96728   PyObject *__pyx_v_firstnode;
96729   PyObject *__pyx_v_s;
96730   PyObject *__pyx_r = NULL;
96731   PyObject *__pyx_1 = 0;
96732   int __pyx_t_1;
96733   PyObject *__pyx_t_2 = NULL;
96734   PyObject *__pyx_t_3 = NULL;
96735   __Pyx_SetupRefcountContext("_make_string");
96736   __pyx_v_firstnode = Py_None; __Pyx_INCREF(Py_None);
96737   __pyx_v_s = Py_None; __Pyx_INCREF(Py_None);
96738
96739   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":367
96740  *     cdef _make_string(self, value):
96741  *         cdef char* c_text
96742  *         if _isString(value):             # <<<<<<<<<<<<<<
96743  *             return value
96744  *         elif python.PyList_Check(value):
96745  */
96746   __pyx_t_1 = _isString(__pyx_v_value);
96747   if (__pyx_t_1) {
96748
96749     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":368
96750  *         cdef char* c_text
96751  *         if _isString(value):
96752  *             return value             # <<<<<<<<<<<<<<
96753  *         elif python.PyList_Check(value):
96754  *             # node set: take recursive text concatenation of first element
96755  */
96756     __Pyx_XDECREF(__pyx_r);
96757     __Pyx_INCREF(__pyx_v_value);
96758     __pyx_r = __pyx_v_value;
96759     goto __pyx_L0;
96760     goto __pyx_L3;
96761   }
96762
96763   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":369
96764  *         if _isString(value):
96765  *             return value
96766  *         elif python.PyList_Check(value):             # <<<<<<<<<<<<<<
96767  *             # node set: take recursive text concatenation of first element
96768  *             if python.PyList_GET_SIZE(value) == 0:
96769  */
96770   __pyx_t_1 = PyList_Check(__pyx_v_value);
96771   if (__pyx_t_1) {
96772
96773     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":371
96774  *         elif python.PyList_Check(value):
96775  *             # node set: take recursive text concatenation of first element
96776  *             if python.PyList_GET_SIZE(value) == 0:             # <<<<<<<<<<<<<<
96777  *                 return u''
96778  *             firstnode = value[0]
96779  */
96780     __pyx_t_1 = (PyList_GET_SIZE(__pyx_v_value) == 0);
96781     if (__pyx_t_1) {
96782
96783       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":372
96784  *             # node set: take recursive text concatenation of first element
96785  *             if python.PyList_GET_SIZE(value) == 0:
96786  *                 return u''             # <<<<<<<<<<<<<<
96787  *             firstnode = value[0]
96788  *             if _isString(firstnode):
96789  */
96790       __Pyx_XDECREF(__pyx_r);
96791       __Pyx_INCREF(((PyObject *)__pyx_kp_566));
96792       __pyx_r = ((PyObject *)__pyx_kp_566);
96793       goto __pyx_L0;
96794       goto __pyx_L4;
96795     }
96796     __pyx_L4:;
96797
96798     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":373
96799  *             if python.PyList_GET_SIZE(value) == 0:
96800  *                 return u''
96801  *             firstnode = value[0]             # <<<<<<<<<<<<<<
96802  *             if _isString(firstnode):
96803  *                 return firstnode
96804  */
96805     __pyx_1 = __Pyx_GetItemInt(__pyx_v_value, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96806     __Pyx_GOTREF(__pyx_1);
96807     __Pyx_DECREF(__pyx_v_firstnode);
96808     __pyx_v_firstnode = __pyx_1;
96809     __pyx_1 = 0;
96810
96811     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":374
96812  *                 return u''
96813  *             firstnode = value[0]
96814  *             if _isString(firstnode):             # <<<<<<<<<<<<<<
96815  *                 return firstnode
96816  *             elif isinstance(firstnode, _Element):
96817  */
96818     __pyx_t_1 = _isString(__pyx_v_firstnode);
96819     if (__pyx_t_1) {
96820
96821       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":375
96822  *             firstnode = value[0]
96823  *             if _isString(firstnode):
96824  *                 return firstnode             # <<<<<<<<<<<<<<
96825  *             elif isinstance(firstnode, _Element):
96826  *                 c_text = tree.xmlNodeGetContent((<_Element>firstnode)._c_node)
96827  */
96828       __Pyx_XDECREF(__pyx_r);
96829       __Pyx_INCREF(__pyx_v_firstnode);
96830       __pyx_r = __pyx_v_firstnode;
96831       goto __pyx_L0;
96832       goto __pyx_L5;
96833     }
96834
96835     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":376
96836  *             if _isString(firstnode):
96837  *                 return firstnode
96838  *             elif isinstance(firstnode, _Element):             # <<<<<<<<<<<<<<
96839  *                 c_text = tree.xmlNodeGetContent((<_Element>firstnode)._c_node)
96840  *                 if c_text is NULL:
96841  */
96842     __pyx_t_1 = PyObject_TypeCheck(__pyx_v_firstnode, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Element))); 
96843     if (__pyx_t_1) {
96844
96845       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":377
96846  *                 return firstnode
96847  *             elif isinstance(firstnode, _Element):
96848  *                 c_text = tree.xmlNodeGetContent((<_Element>firstnode)._c_node)             # <<<<<<<<<<<<<<
96849  *                 if c_text is NULL:
96850  *                     python.PyErr_NoMemory()
96851  */
96852       __pyx_v_c_text = xmlNodeGetContent(((struct LxmlElement *)__pyx_v_firstnode)->_c_node);
96853
96854       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":378
96855  *             elif isinstance(firstnode, _Element):
96856  *                 c_text = tree.xmlNodeGetContent((<_Element>firstnode)._c_node)
96857  *                 if c_text is NULL:             # <<<<<<<<<<<<<<
96858  *                     python.PyErr_NoMemory()
96859  *                 try:
96860  */
96861       __pyx_t_1 = (__pyx_v_c_text == NULL);
96862       if (__pyx_t_1) {
96863
96864         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":379
96865  *                 c_text = tree.xmlNodeGetContent((<_Element>firstnode)._c_node)
96866  *                 if c_text is NULL:
96867  *                     python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
96868  *                 try:
96869  *                     s = funicode(c_text)
96870  */
96871         __pyx_t_2 = PyErr_NoMemory(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96872         __Pyx_GOTREF(__pyx_t_2);
96873         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
96874         goto __pyx_L6;
96875       }
96876       __pyx_L6:;
96877
96878       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":380
96879  *                 if c_text is NULL:
96880  *                     python.PyErr_NoMemory()
96881  *                 try:             # <<<<<<<<<<<<<<
96882  *                     s = funicode(c_text)
96883  *                 finally:
96884  */
96885       /*try:*/ {
96886
96887         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":381
96888  *                     python.PyErr_NoMemory()
96889  *                 try:
96890  *                     s = funicode(c_text)             # <<<<<<<<<<<<<<
96891  *                 finally:
96892  *                     tree.xmlFree(c_text)
96893  */
96894         __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_text); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L8;}
96895         __Pyx_GOTREF(__pyx_t_2);
96896         __Pyx_DECREF(__pyx_v_s);
96897         __pyx_v_s = __pyx_t_2;
96898         __pyx_t_2 = 0;
96899       }
96900       /*finally:*/ {
96901         int __pyx_why;
96902         PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
96903         int __pyx_exc_lineno;
96904         __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
96905         __pyx_why = 0; goto __pyx_L9;
96906         __pyx_L8: {
96907           __pyx_why = 4;
96908           __Pyx_XDECREF(__pyx_1); __pyx_1 = 0;
96909           __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
96910           __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
96911           __pyx_exc_lineno = __pyx_lineno;
96912           goto __pyx_L9;
96913         }
96914         __pyx_L9:;
96915
96916         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":383
96917  *                     s = funicode(c_text)
96918  *                 finally:
96919  *                     tree.xmlFree(c_text)             # <<<<<<<<<<<<<<
96920  *                 return s
96921  *             else:
96922  */
96923         xmlFree(__pyx_v_c_text);
96924         switch (__pyx_why) {
96925           case 4: {
96926             __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
96927             __pyx_lineno = __pyx_exc_lineno;
96928             __pyx_exc_type = 0;
96929             __pyx_exc_value = 0;
96930             __pyx_exc_tb = 0;
96931             goto __pyx_L1_error;
96932           }
96933         }
96934       }
96935
96936       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":384
96937  *                 finally:
96938  *                     tree.xmlFree(c_text)
96939  *                 return s             # <<<<<<<<<<<<<<
96940  *             else:
96941  *                 return unicode(firstnode)
96942  */
96943       __Pyx_XDECREF(__pyx_r);
96944       __Pyx_INCREF(__pyx_v_s);
96945       __pyx_r = __pyx_v_s;
96946       goto __pyx_L0;
96947       goto __pyx_L5;
96948     }
96949     /*else*/ {
96950
96951       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":386
96952  *                 return s
96953  *             else:
96954  *                 return unicode(firstnode)             # <<<<<<<<<<<<<<
96955  *         else:
96956  *             return unicode(value)
96957  */
96958       __Pyx_XDECREF(__pyx_r);
96959       __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96960       __Pyx_GOTREF(((PyObject *)__pyx_t_2));
96961       __Pyx_INCREF(__pyx_v_firstnode);
96962       PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_firstnode);
96963       __Pyx_GIVEREF(__pyx_v_firstnode);
96964       __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyUnicode_Type)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96965       __Pyx_GOTREF(__pyx_t_3);
96966       __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
96967       __pyx_r = __pyx_t_3;
96968       __pyx_t_3 = 0;
96969       goto __pyx_L0;
96970     }
96971     __pyx_L5:;
96972     goto __pyx_L3;
96973   }
96974   /*else*/ {
96975
96976     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":388
96977  *                 return unicode(firstnode)
96978  *         else:
96979  *             return unicode(value)             # <<<<<<<<<<<<<<
96980  * 
96981  *     cdef _compile(self, rexp, ignore_case):
96982  */
96983     __Pyx_XDECREF(__pyx_r);
96984     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96985     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
96986     __Pyx_INCREF(__pyx_v_value);
96987     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_value);
96988     __Pyx_GIVEREF(__pyx_v_value);
96989     __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyUnicode_Type)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
96990     __Pyx_GOTREF(__pyx_t_2);
96991     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
96992     __pyx_r = __pyx_t_2;
96993     __pyx_t_2 = 0;
96994     goto __pyx_L0;
96995   }
96996   __pyx_L3:;
96997
96998   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
96999   goto __pyx_L0;
97000   __pyx_L1_error:;
97001   __Pyx_XDECREF(__pyx_1);
97002   __Pyx_XDECREF(__pyx_t_2);
97003   __Pyx_XDECREF(__pyx_t_3);
97004   __Pyx_AddTraceback("lxml.etree._ExsltRegExp._make_string");
97005   __pyx_r = 0;
97006   __pyx_L0:;
97007   __Pyx_DECREF(__pyx_v_firstnode);
97008   __Pyx_DECREF(__pyx_v_s);
97009   __Pyx_XGIVEREF(__pyx_r);
97010   __Pyx_FinishRefcountContext();
97011   return __pyx_r;
97012 }
97013
97014 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":390
97015  *             return unicode(value)
97016  * 
97017  *     cdef _compile(self, rexp, ignore_case):             # <<<<<<<<<<<<<<
97018  *         cdef python.PyObject* c_result
97019  *         rexp = self._make_string(rexp)
97020  */
97021
97022 static  PyObject *__pyx_f_4lxml_5etree_12_ExsltRegExp__compile(struct __pyx_obj_4lxml_5etree__ExsltRegExp *__pyx_v_self, PyObject *__pyx_v_rexp, PyObject *__pyx_v_ignore_case) {
97023   PyObject *__pyx_v_c_result;
97024   PyObject *__pyx_v_key;
97025   PyObject *__pyx_v_py_flags;
97026   PyObject *__pyx_v_rexp_compiled;
97027   PyObject *__pyx_r = NULL;
97028   PyObject *__pyx_t_1 = NULL;
97029   int __pyx_t_2;
97030   PyObject *__pyx_t_3 = NULL;
97031   PyObject *__pyx_t_4 = NULL;
97032   __Pyx_SetupRefcountContext("_compile");
97033   __Pyx_INCREF(__pyx_v_rexp);
97034   __pyx_v_key = Py_None; __Pyx_INCREF(Py_None);
97035   __pyx_v_py_flags = Py_None; __Pyx_INCREF(Py_None);
97036   __pyx_v_rexp_compiled = Py_None; __Pyx_INCREF(Py_None);
97037
97038   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":392
97039  *     cdef _compile(self, rexp, ignore_case):
97040  *         cdef python.PyObject* c_result
97041  *         rexp = self._make_string(rexp)             # <<<<<<<<<<<<<<
97042  *         key = (rexp, ignore_case)
97043  *         c_result = python.PyDict_GetItem(self._compile_map, key)
97044  */
97045   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ExsltRegExp *)__pyx_v_self->__pyx_vtab)->_make_string(__pyx_v_self, __pyx_v_rexp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97046   __Pyx_GOTREF(__pyx_t_1);
97047   __Pyx_DECREF(__pyx_v_rexp);
97048   __pyx_v_rexp = __pyx_t_1;
97049   __pyx_t_1 = 0;
97050
97051   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":393
97052  *         cdef python.PyObject* c_result
97053  *         rexp = self._make_string(rexp)
97054  *         key = (rexp, ignore_case)             # <<<<<<<<<<<<<<
97055  *         c_result = python.PyDict_GetItem(self._compile_map, key)
97056  *         if c_result is not NULL:
97057  */
97058   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97059   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
97060   __Pyx_INCREF(__pyx_v_rexp);
97061   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_rexp);
97062   __Pyx_GIVEREF(__pyx_v_rexp);
97063   __Pyx_INCREF(__pyx_v_ignore_case);
97064   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ignore_case);
97065   __Pyx_GIVEREF(__pyx_v_ignore_case);
97066   __Pyx_DECREF(__pyx_v_key);
97067   __pyx_v_key = ((PyObject *)__pyx_t_1);
97068   __pyx_t_1 = 0;
97069
97070   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":394
97071  *         rexp = self._make_string(rexp)
97072  *         key = (rexp, ignore_case)
97073  *         c_result = python.PyDict_GetItem(self._compile_map, key)             # <<<<<<<<<<<<<<
97074  *         if c_result is not NULL:
97075  *             return <object>c_result
97076  */
97077   __pyx_v_c_result = PyDict_GetItem(((PyObject *)__pyx_v_self->_compile_map), __pyx_v_key);
97078
97079   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":395
97080  *         key = (rexp, ignore_case)
97081  *         c_result = python.PyDict_GetItem(self._compile_map, key)
97082  *         if c_result is not NULL:             # <<<<<<<<<<<<<<
97083  *             return <object>c_result
97084  *         py_flags = re.UNICODE
97085  */
97086   __pyx_t_2 = (__pyx_v_c_result != NULL);
97087   if (__pyx_t_2) {
97088
97089     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":396
97090  *         c_result = python.PyDict_GetItem(self._compile_map, key)
97091  *         if c_result is not NULL:
97092  *             return <object>c_result             # <<<<<<<<<<<<<<
97093  *         py_flags = re.UNICODE
97094  *         if ignore_case:
97095  */
97096     __Pyx_XDECREF(__pyx_r);
97097     __Pyx_INCREF(((PyObject *)__pyx_v_c_result));
97098     __pyx_r = ((PyObject *)__pyx_v_c_result);
97099     goto __pyx_L0;
97100     goto __pyx_L3;
97101   }
97102   __pyx_L3:;
97103
97104   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":397
97105  *         if c_result is not NULL:
97106  *             return <object>c_result
97107  *         py_flags = re.UNICODE             # <<<<<<<<<<<<<<
97108  *         if ignore_case:
97109  *             py_flags = py_flags | re.IGNORECASE
97110  */
97111   __pyx_t_1 = PyObject_GetAttr(__pyx_v_4lxml_5etree_re, __pyx_kp_UNICODE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97112   __Pyx_GOTREF(__pyx_t_1);
97113   __Pyx_DECREF(__pyx_v_py_flags);
97114   __pyx_v_py_flags = __pyx_t_1;
97115   __pyx_t_1 = 0;
97116
97117   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":398
97118  *             return <object>c_result
97119  *         py_flags = re.UNICODE
97120  *         if ignore_case:             # <<<<<<<<<<<<<<
97121  *             py_flags = py_flags | re.IGNORECASE
97122  *         rexp_compiled = re.compile(rexp, py_flags)
97123  */
97124   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_ignore_case); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97125   if (__pyx_t_2) {
97126
97127     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":399
97128  *         py_flags = re.UNICODE
97129  *         if ignore_case:
97130  *             py_flags = py_flags | re.IGNORECASE             # <<<<<<<<<<<<<<
97131  *         rexp_compiled = re.compile(rexp, py_flags)
97132  *         self._compile_map[key] = rexp_compiled
97133  */
97134     __pyx_t_1 = PyObject_GetAttr(__pyx_v_4lxml_5etree_re, __pyx_kp_IGNORECASE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97135     __Pyx_GOTREF(__pyx_t_1);
97136     __pyx_t_3 = PyNumber_Or(__pyx_v_py_flags, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97137     __Pyx_GOTREF(__pyx_t_3);
97138     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
97139     __Pyx_DECREF(__pyx_v_py_flags);
97140     __pyx_v_py_flags = __pyx_t_3;
97141     __pyx_t_3 = 0;
97142     goto __pyx_L4;
97143   }
97144   __pyx_L4:;
97145
97146   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":400
97147  *         if ignore_case:
97148  *             py_flags = py_flags | re.IGNORECASE
97149  *         rexp_compiled = re.compile(rexp, py_flags)             # <<<<<<<<<<<<<<
97150  *         self._compile_map[key] = rexp_compiled
97151  *         return rexp_compiled
97152  */
97153   __pyx_t_3 = PyObject_GetAttr(__pyx_v_4lxml_5etree_re, __pyx_kp_compile); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97154   __Pyx_GOTREF(__pyx_t_3);
97155   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97156   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
97157   __Pyx_INCREF(__pyx_v_rexp);
97158   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_rexp);
97159   __Pyx_GIVEREF(__pyx_v_rexp);
97160   __Pyx_INCREF(__pyx_v_py_flags);
97161   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_py_flags);
97162   __Pyx_GIVEREF(__pyx_v_py_flags);
97163   __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97164   __Pyx_GOTREF(__pyx_t_4);
97165   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
97166   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
97167   __Pyx_DECREF(__pyx_v_rexp_compiled);
97168   __pyx_v_rexp_compiled = __pyx_t_4;
97169   __pyx_t_4 = 0;
97170
97171   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":401
97172  *             py_flags = py_flags | re.IGNORECASE
97173  *         rexp_compiled = re.compile(rexp, py_flags)
97174  *         self._compile_map[key] = rexp_compiled             # <<<<<<<<<<<<<<
97175  *         return rexp_compiled
97176  * 
97177  */
97178   if (PyDict_SetItem(((PyObject *)__pyx_v_self->_compile_map), __pyx_v_key, __pyx_v_rexp_compiled) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97179
97180   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":402
97181  *         rexp_compiled = re.compile(rexp, py_flags)
97182  *         self._compile_map[key] = rexp_compiled
97183  *         return rexp_compiled             # <<<<<<<<<<<<<<
97184  * 
97185  *     def test(self, ctxt, s, rexp, flags=u''):
97186  */
97187   __Pyx_XDECREF(__pyx_r);
97188   __Pyx_INCREF(__pyx_v_rexp_compiled);
97189   __pyx_r = __pyx_v_rexp_compiled;
97190   goto __pyx_L0;
97191
97192   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
97193   goto __pyx_L0;
97194   __pyx_L1_error:;
97195   __Pyx_XDECREF(__pyx_t_1);
97196   __Pyx_XDECREF(__pyx_t_3);
97197   __Pyx_XDECREF(__pyx_t_4);
97198   __Pyx_AddTraceback("lxml.etree._ExsltRegExp._compile");
97199   __pyx_r = 0;
97200   __pyx_L0:;
97201   __Pyx_DECREF(__pyx_v_key);
97202   __Pyx_DECREF(__pyx_v_py_flags);
97203   __Pyx_DECREF(__pyx_v_rexp_compiled);
97204   __Pyx_DECREF(__pyx_v_rexp);
97205   __Pyx_XGIVEREF(__pyx_r);
97206   __Pyx_FinishRefcountContext();
97207   return __pyx_r;
97208 }
97209
97210 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":404
97211  *         return rexp_compiled
97212  * 
97213  *     def test(self, ctxt, s, rexp, flags=u''):             # <<<<<<<<<<<<<<
97214  *         flags = self._make_string(flags)
97215  *         s = self._make_string(s)
97216  */
97217
97218 static PyObject *__pyx_pf_4lxml_5etree_12_ExsltRegExp_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
97219 static PyObject *__pyx_pf_4lxml_5etree_12_ExsltRegExp_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
97220   PyObject *__pyx_v_ctxt = 0;
97221   PyObject *__pyx_v_s = 0;
97222   PyObject *__pyx_v_rexp = 0;
97223   PyObject *__pyx_v_flags = 0;
97224   PyObject *__pyx_v_rexpc;
97225   PyObject *__pyx_r = NULL;
97226   PyObject *__pyx_t_1 = NULL;
97227   int __pyx_t_2;
97228   PyObject *__pyx_t_3 = NULL;
97229   PyObject *__pyx_t_4 = NULL;
97230   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_ctxt,&__pyx_kp_s,&__pyx_kp_rexp,&__pyx_kp_flags,0};
97231   __Pyx_SetupRefcountContext("test");
97232   if (unlikely(__pyx_kwds)) {
97233     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
97234     PyObject* values[4] = {0,0,0,0};
97235     values[3] = ((PyObject *)__pyx_kp_172);
97236     switch (PyTuple_GET_SIZE(__pyx_args)) {
97237       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
97238       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
97239       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
97240       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
97241       case  0: break;
97242       default: goto __pyx_L5_argtuple_error;
97243     }
97244     switch (PyTuple_GET_SIZE(__pyx_args)) {
97245       case  0:
97246       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_ctxt);
97247       if (likely(values[0])) kw_args--;
97248       else goto __pyx_L5_argtuple_error;
97249       case  1:
97250       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_s);
97251       if (likely(values[1])) kw_args--;
97252       else {
97253         __Pyx_RaiseArgtupleInvalid("test", 0, 3, 4, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
97254       }
97255       case  2:
97256       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_rexp);
97257       if (likely(values[2])) kw_args--;
97258       else {
97259         __Pyx_RaiseArgtupleInvalid("test", 0, 3, 4, 2); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
97260       }
97261       case  3:
97262       if (kw_args > 1) {
97263         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_flags);
97264         if (unlikely(value)) { values[3] = value; kw_args--; }
97265       }
97266     }
97267     if (unlikely(kw_args > 0)) {
97268       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "test") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
97269     }
97270     __pyx_v_ctxt = values[0];
97271     __pyx_v_s = values[1];
97272     __pyx_v_rexp = values[2];
97273     __pyx_v_flags = values[3];
97274   } else {
97275     __pyx_v_flags = ((PyObject *)__pyx_kp_172);
97276     switch (PyTuple_GET_SIZE(__pyx_args)) {
97277       case  4:
97278       __pyx_v_flags = PyTuple_GET_ITEM(__pyx_args, 3);
97279       case  3:
97280       __pyx_v_rexp = PyTuple_GET_ITEM(__pyx_args, 2);
97281       __pyx_v_s = PyTuple_GET_ITEM(__pyx_args, 1);
97282       __pyx_v_ctxt = PyTuple_GET_ITEM(__pyx_args, 0);
97283       break;
97284       default: goto __pyx_L5_argtuple_error;
97285     }
97286   }
97287   goto __pyx_L4_argument_unpacking_done;
97288   __pyx_L5_argtuple_error:;
97289   __Pyx_RaiseArgtupleInvalid("test", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
97290   __pyx_L3_error:;
97291   __Pyx_AddTraceback("lxml.etree._ExsltRegExp.test");
97292   return NULL;
97293   __pyx_L4_argument_unpacking_done:;
97294   __Pyx_INCREF(__pyx_v_s);
97295   __Pyx_INCREF(__pyx_v_flags);
97296   __pyx_v_rexpc = Py_None; __Pyx_INCREF(Py_None);
97297
97298   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":405
97299  * 
97300  *     def test(self, ctxt, s, rexp, flags=u''):
97301  *         flags = self._make_string(flags)             # <<<<<<<<<<<<<<
97302  *         s = self._make_string(s)
97303  *         rexpc = self._compile(rexp, u'i' in flags)
97304  */
97305   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ExsltRegExp *)((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)__pyx_v_self)->__pyx_vtab)->_make_string(((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)__pyx_v_self), __pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97306   __Pyx_GOTREF(__pyx_t_1);
97307   __Pyx_DECREF(__pyx_v_flags);
97308   __pyx_v_flags = __pyx_t_1;
97309   __pyx_t_1 = 0;
97310
97311   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":406
97312  *     def test(self, ctxt, s, rexp, flags=u''):
97313  *         flags = self._make_string(flags)
97314  *         s = self._make_string(s)             # <<<<<<<<<<<<<<
97315  *         rexpc = self._compile(rexp, u'i' in flags)
97316  *         if rexpc.search(s) is None:
97317  */
97318   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ExsltRegExp *)((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)__pyx_v_self)->__pyx_vtab)->_make_string(((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)__pyx_v_self), __pyx_v_s); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97319   __Pyx_GOTREF(__pyx_t_1);
97320   __Pyx_DECREF(__pyx_v_s);
97321   __pyx_v_s = __pyx_t_1;
97322   __pyx_t_1 = 0;
97323
97324   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":407
97325  *         flags = self._make_string(flags)
97326  *         s = self._make_string(s)
97327  *         rexpc = self._compile(rexp, u'i' in flags)             # <<<<<<<<<<<<<<
97328  *         if rexpc.search(s) is None:
97329  *             return False
97330  */
97331   __pyx_t_2 = (PySequence_Contains(__pyx_v_flags, ((PyObject *)__pyx_kp_567))); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97332   __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97333   __Pyx_GOTREF(__pyx_t_1);
97334   __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__ExsltRegExp *)((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)__pyx_v_self)->__pyx_vtab)->_compile(((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)__pyx_v_self), __pyx_v_rexp, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97335   __Pyx_GOTREF(__pyx_t_3);
97336   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
97337   __Pyx_DECREF(__pyx_v_rexpc);
97338   __pyx_v_rexpc = __pyx_t_3;
97339   __pyx_t_3 = 0;
97340
97341   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":408
97342  *         s = self._make_string(s)
97343  *         rexpc = self._compile(rexp, u'i' in flags)
97344  *         if rexpc.search(s) is None:             # <<<<<<<<<<<<<<
97345  *             return False
97346  *         else:
97347  */
97348   __pyx_t_3 = PyObject_GetAttr(__pyx_v_rexpc, __pyx_kp_search); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97349   __Pyx_GOTREF(__pyx_t_3);
97350   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97351   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
97352   __Pyx_INCREF(__pyx_v_s);
97353   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_s);
97354   __Pyx_GIVEREF(__pyx_v_s);
97355   __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97356   __Pyx_GOTREF(__pyx_t_4);
97357   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
97358   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
97359   __pyx_t_2 = (__pyx_t_4 == Py_None);
97360   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
97361   if (__pyx_t_2) {
97362
97363     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":409
97364  *         rexpc = self._compile(rexp, u'i' in flags)
97365  *         if rexpc.search(s) is None:
97366  *             return False             # <<<<<<<<<<<<<<
97367  *         else:
97368  *             return True
97369  */
97370     __Pyx_XDECREF(__pyx_r);
97371     __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97372     __Pyx_GOTREF(__pyx_t_4);
97373     __pyx_r = __pyx_t_4;
97374     __pyx_t_4 = 0;
97375     goto __pyx_L0;
97376     goto __pyx_L6;
97377   }
97378   /*else*/ {
97379
97380     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":411
97381  *             return False
97382  *         else:
97383  *             return True             # <<<<<<<<<<<<<<
97384  * 
97385  *     def match(self, ctxt, s, rexp, flags=u''):
97386  */
97387     __Pyx_XDECREF(__pyx_r);
97388     __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97389     __Pyx_GOTREF(__pyx_t_4);
97390     __pyx_r = __pyx_t_4;
97391     __pyx_t_4 = 0;
97392     goto __pyx_L0;
97393   }
97394   __pyx_L6:;
97395
97396   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
97397   goto __pyx_L0;
97398   __pyx_L1_error:;
97399   __Pyx_XDECREF(__pyx_t_1);
97400   __Pyx_XDECREF(__pyx_t_3);
97401   __Pyx_XDECREF(__pyx_t_4);
97402   __Pyx_AddTraceback("lxml.etree._ExsltRegExp.test");
97403   __pyx_r = NULL;
97404   __pyx_L0:;
97405   __Pyx_DECREF(__pyx_v_rexpc);
97406   __Pyx_DECREF(__pyx_v_s);
97407   __Pyx_DECREF(__pyx_v_flags);
97408   __Pyx_XGIVEREF(__pyx_r);
97409   __Pyx_FinishRefcountContext();
97410   return __pyx_r;
97411 }
97412
97413 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":413
97414  *             return True
97415  * 
97416  *     def match(self, ctxt, s, rexp, flags=u''):             # <<<<<<<<<<<<<<
97417  *         cdef list result_list
97418  *         flags = self._make_string(flags)
97419  */
97420
97421 static PyObject *__pyx_pf_4lxml_5etree_12_ExsltRegExp_match(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
97422 static PyObject *__pyx_pf_4lxml_5etree_12_ExsltRegExp_match(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
97423   PyObject *__pyx_v_ctxt = 0;
97424   PyObject *__pyx_v_s = 0;
97425   PyObject *__pyx_v_rexp = 0;
97426   PyObject *__pyx_v_flags = 0;
97427   PyObject *__pyx_v_result_list;
97428   PyObject *__pyx_v_rexpc;
97429   PyObject *__pyx_v_results;
97430   PyObject *__pyx_v_result;
97431   PyObject *__pyx_v_root;
97432   PyObject *__pyx_v_join_groups;
97433   PyObject *__pyx_v_s_match;
97434   PyObject *__pyx_v_elem;
97435   PyObject *__pyx_r = NULL;
97436   PyObject *__pyx_1 = 0;
97437   PyObject *__pyx_t_1 = NULL;
97438   int __pyx_t_2;
97439   PyObject *__pyx_t_3 = NULL;
97440   PyObject *__pyx_t_4 = NULL;
97441   int __pyx_t_5;
97442   PyObject *__pyx_t_6 = NULL;
97443   Py_ssize_t __pyx_t_7;
97444   int __pyx_t_8;
97445   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_ctxt,&__pyx_kp_s,&__pyx_kp_rexp,&__pyx_kp_flags,0};
97446   __Pyx_SetupRefcountContext("match");
97447   if (unlikely(__pyx_kwds)) {
97448     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
97449     PyObject* values[4] = {0,0,0,0};
97450     values[3] = ((PyObject *)__pyx_kp_173);
97451     switch (PyTuple_GET_SIZE(__pyx_args)) {
97452       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
97453       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
97454       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
97455       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
97456       case  0: break;
97457       default: goto __pyx_L5_argtuple_error;
97458     }
97459     switch (PyTuple_GET_SIZE(__pyx_args)) {
97460       case  0:
97461       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_ctxt);
97462       if (likely(values[0])) kw_args--;
97463       else goto __pyx_L5_argtuple_error;
97464       case  1:
97465       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_s);
97466       if (likely(values[1])) kw_args--;
97467       else {
97468         __Pyx_RaiseArgtupleInvalid("match", 0, 3, 4, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
97469       }
97470       case  2:
97471       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_rexp);
97472       if (likely(values[2])) kw_args--;
97473       else {
97474         __Pyx_RaiseArgtupleInvalid("match", 0, 3, 4, 2); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
97475       }
97476       case  3:
97477       if (kw_args > 1) {
97478         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_flags);
97479         if (unlikely(value)) { values[3] = value; kw_args--; }
97480       }
97481     }
97482     if (unlikely(kw_args > 0)) {
97483       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "match") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
97484     }
97485     __pyx_v_ctxt = values[0];
97486     __pyx_v_s = values[1];
97487     __pyx_v_rexp = values[2];
97488     __pyx_v_flags = values[3];
97489   } else {
97490     __pyx_v_flags = ((PyObject *)__pyx_kp_173);
97491     switch (PyTuple_GET_SIZE(__pyx_args)) {
97492       case  4:
97493       __pyx_v_flags = PyTuple_GET_ITEM(__pyx_args, 3);
97494       case  3:
97495       __pyx_v_rexp = PyTuple_GET_ITEM(__pyx_args, 2);
97496       __pyx_v_s = PyTuple_GET_ITEM(__pyx_args, 1);
97497       __pyx_v_ctxt = PyTuple_GET_ITEM(__pyx_args, 0);
97498       break;
97499       default: goto __pyx_L5_argtuple_error;
97500     }
97501   }
97502   goto __pyx_L4_argument_unpacking_done;
97503   __pyx_L5_argtuple_error:;
97504   __Pyx_RaiseArgtupleInvalid("match", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
97505   __pyx_L3_error:;
97506   __Pyx_AddTraceback("lxml.etree._ExsltRegExp.match");
97507   return NULL;
97508   __pyx_L4_argument_unpacking_done:;
97509   __Pyx_INCREF(__pyx_v_s);
97510   __Pyx_INCREF(__pyx_v_flags);
97511   __pyx_v_result_list = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
97512   __pyx_v_rexpc = Py_None; __Pyx_INCREF(Py_None);
97513   __pyx_v_results = Py_None; __Pyx_INCREF(Py_None);
97514   __pyx_v_result = Py_None; __Pyx_INCREF(Py_None);
97515   __pyx_v_root = Py_None; __Pyx_INCREF(Py_None);
97516   __pyx_v_join_groups = Py_None; __Pyx_INCREF(Py_None);
97517   __pyx_v_s_match = Py_None; __Pyx_INCREF(Py_None);
97518   __pyx_v_elem = Py_None; __Pyx_INCREF(Py_None);
97519
97520   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":415
97521  *     def match(self, ctxt, s, rexp, flags=u''):
97522  *         cdef list result_list
97523  *         flags = self._make_string(flags)             # <<<<<<<<<<<<<<
97524  *         s = self._make_string(s)
97525  *         rexpc = self._compile(rexp, u'i' in flags)
97526  */
97527   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ExsltRegExp *)((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)__pyx_v_self)->__pyx_vtab)->_make_string(((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)__pyx_v_self), __pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97528   __Pyx_GOTREF(__pyx_t_1);
97529   __Pyx_DECREF(__pyx_v_flags);
97530   __pyx_v_flags = __pyx_t_1;
97531   __pyx_t_1 = 0;
97532
97533   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":416
97534  *         cdef list result_list
97535  *         flags = self._make_string(flags)
97536  *         s = self._make_string(s)             # <<<<<<<<<<<<<<
97537  *         rexpc = self._compile(rexp, u'i' in flags)
97538  *         if u'g' in flags:
97539  */
97540   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ExsltRegExp *)((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)__pyx_v_self)->__pyx_vtab)->_make_string(((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)__pyx_v_self), __pyx_v_s); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97541   __Pyx_GOTREF(__pyx_t_1);
97542   __Pyx_DECREF(__pyx_v_s);
97543   __pyx_v_s = __pyx_t_1;
97544   __pyx_t_1 = 0;
97545
97546   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":417
97547  *         flags = self._make_string(flags)
97548  *         s = self._make_string(s)
97549  *         rexpc = self._compile(rexp, u'i' in flags)             # <<<<<<<<<<<<<<
97550  *         if u'g' in flags:
97551  *             results = rexpc.findall(s)
97552  */
97553   __pyx_t_2 = (PySequence_Contains(__pyx_v_flags, ((PyObject *)__pyx_kp_568))); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97554   __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97555   __Pyx_GOTREF(__pyx_t_1);
97556   __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__ExsltRegExp *)((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)__pyx_v_self)->__pyx_vtab)->_compile(((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)__pyx_v_self), __pyx_v_rexp, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97557   __Pyx_GOTREF(__pyx_t_3);
97558   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
97559   __Pyx_DECREF(__pyx_v_rexpc);
97560   __pyx_v_rexpc = __pyx_t_3;
97561   __pyx_t_3 = 0;
97562
97563   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":418
97564  *         s = self._make_string(s)
97565  *         rexpc = self._compile(rexp, u'i' in flags)
97566  *         if u'g' in flags:             # <<<<<<<<<<<<<<
97567  *             results = rexpc.findall(s)
97568  *             if not results:
97569  */
97570   __pyx_t_2 = (PySequence_Contains(__pyx_v_flags, ((PyObject *)__pyx_kp_569))); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97571   if (__pyx_t_2) {
97572
97573     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":419
97574  *         rexpc = self._compile(rexp, u'i' in flags)
97575  *         if u'g' in flags:
97576  *             results = rexpc.findall(s)             # <<<<<<<<<<<<<<
97577  *             if not results:
97578  *                 return ()
97579  */
97580     __pyx_t_3 = PyObject_GetAttr(__pyx_v_rexpc, __pyx_kp_findall); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97581     __Pyx_GOTREF(__pyx_t_3);
97582     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97583     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
97584     __Pyx_INCREF(__pyx_v_s);
97585     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_s);
97586     __Pyx_GIVEREF(__pyx_v_s);
97587     __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97588     __Pyx_GOTREF(__pyx_t_4);
97589     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
97590     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
97591     __Pyx_DECREF(__pyx_v_results);
97592     __pyx_v_results = __pyx_t_4;
97593     __pyx_t_4 = 0;
97594
97595     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":420
97596  *         if u'g' in flags:
97597  *             results = rexpc.findall(s)
97598  *             if not results:             # <<<<<<<<<<<<<<
97599  *                 return ()
97600  *         else:
97601  */
97602     __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_results); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97603     __pyx_t_5 = (!__pyx_t_2);
97604     if (__pyx_t_5) {
97605
97606       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":421
97607  *             results = rexpc.findall(s)
97608  *             if not results:
97609  *                 return ()             # <<<<<<<<<<<<<<
97610  *         else:
97611  *             result = rexpc.search(s)
97612  */
97613       __Pyx_XDECREF(__pyx_r);
97614       __Pyx_INCREF(((PyObject *)__pyx_empty_tuple));
97615       __pyx_r = ((PyObject *)__pyx_empty_tuple);
97616       goto __pyx_L0;
97617       goto __pyx_L7;
97618     }
97619     __pyx_L7:;
97620     goto __pyx_L6;
97621   }
97622   /*else*/ {
97623
97624     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":423
97625  *                 return ()
97626  *         else:
97627  *             result = rexpc.search(s)             # <<<<<<<<<<<<<<
97628  *             if not result:
97629  *                 return ()
97630  */
97631     __pyx_t_4 = PyObject_GetAttr(__pyx_v_rexpc, __pyx_kp_search); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97632     __Pyx_GOTREF(__pyx_t_4);
97633     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97634     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
97635     __Pyx_INCREF(__pyx_v_s);
97636     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_s);
97637     __Pyx_GIVEREF(__pyx_v_s);
97638     __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97639     __Pyx_GOTREF(__pyx_t_3);
97640     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
97641     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
97642     __Pyx_DECREF(__pyx_v_result);
97643     __pyx_v_result = __pyx_t_3;
97644     __pyx_t_3 = 0;
97645
97646     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":424
97647  *         else:
97648  *             result = rexpc.search(s)
97649  *             if not result:             # <<<<<<<<<<<<<<
97650  *                 return ()
97651  *             results = [ result.group() ]
97652  */
97653     __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_result); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97654     __pyx_t_2 = (!__pyx_t_5);
97655     if (__pyx_t_2) {
97656
97657       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":425
97658  *             result = rexpc.search(s)
97659  *             if not result:
97660  *                 return ()             # <<<<<<<<<<<<<<
97661  *             results = [ result.group() ]
97662  *             results.extend( result.groups(u'') )
97663  */
97664       __Pyx_XDECREF(__pyx_r);
97665       __Pyx_INCREF(((PyObject *)__pyx_empty_tuple));
97666       __pyx_r = ((PyObject *)__pyx_empty_tuple);
97667       goto __pyx_L0;
97668       goto __pyx_L8;
97669     }
97670     __pyx_L8:;
97671
97672     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":426
97673  *             if not result:
97674  *                 return ()
97675  *             results = [ result.group() ]             # <<<<<<<<<<<<<<
97676  *             results.extend( result.groups(u'') )
97677  *         result_list = []
97678  */
97679     __pyx_t_3 = PyObject_GetAttr(__pyx_v_result, __pyx_kp_group); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97680     __Pyx_GOTREF(__pyx_t_3);
97681     __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97682     __Pyx_GOTREF(__pyx_t_1);
97683     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
97684     __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97685     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
97686     PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
97687     __Pyx_GIVEREF(__pyx_t_1);
97688     __pyx_t_1 = 0;
97689     __Pyx_DECREF(__pyx_v_results);
97690     __pyx_v_results = ((PyObject *)__pyx_t_3);
97691     __pyx_t_3 = 0;
97692
97693     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":427
97694  *                 return ()
97695  *             results = [ result.group() ]
97696  *             results.extend( result.groups(u'') )             # <<<<<<<<<<<<<<
97697  *         result_list = []
97698  *         root = Element(u'matches')
97699  */
97700     __pyx_t_3 = PyObject_GetAttr(__pyx_v_results, __pyx_kp_extend); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97701     __Pyx_GOTREF(__pyx_t_3);
97702     __pyx_t_1 = PyObject_GetAttr(__pyx_v_result, __pyx_kp_groups); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97703     __Pyx_GOTREF(__pyx_t_1);
97704     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97705     __Pyx_GOTREF(((PyObject *)__pyx_t_4));
97706     __Pyx_INCREF(((PyObject *)__pyx_kp_570));
97707     PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_570));
97708     __Pyx_GIVEREF(((PyObject *)__pyx_kp_570));
97709     __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97710     __Pyx_GOTREF(__pyx_t_6);
97711     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
97712     __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
97713     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97714     __Pyx_GOTREF(((PyObject *)__pyx_t_4));
97715     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
97716     __Pyx_GIVEREF(__pyx_t_6);
97717     __pyx_t_6 = 0;
97718     __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97719     __Pyx_GOTREF(__pyx_t_6);
97720     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
97721     __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
97722     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
97723   }
97724   __pyx_L6:;
97725
97726   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":428
97727  *             results = [ result.group() ]
97728  *             results.extend( result.groups(u'') )
97729  *         result_list = []             # <<<<<<<<<<<<<<
97730  *         root = Element(u'matches')
97731  *         join_groups = u''.join
97732  */
97733   __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97734   __Pyx_GOTREF(((PyObject *)__pyx_t_6));
97735   __Pyx_DECREF(((PyObject *)__pyx_v_result_list));
97736   __pyx_v_result_list = __pyx_t_6;
97737   __pyx_t_6 = 0;
97738
97739   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":429
97740  *             results.extend( result.groups(u'') )
97741  *         result_list = []
97742  *         root = Element(u'matches')             # <<<<<<<<<<<<<<
97743  *         join_groups = u''.join
97744  *         for s_match in results:
97745  */
97746   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_Element); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97747   __Pyx_GOTREF(__pyx_1);
97748   __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97749   __Pyx_GOTREF(((PyObject *)__pyx_t_6));
97750   __Pyx_INCREF(((PyObject *)__pyx_kp_571));
97751   PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_571));
97752   __Pyx_GIVEREF(((PyObject *)__pyx_kp_571));
97753   __pyx_t_4 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97754   __Pyx_GOTREF(__pyx_t_4);
97755   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
97756   __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
97757   __Pyx_DECREF(__pyx_v_root);
97758   __pyx_v_root = __pyx_t_4;
97759   __pyx_t_4 = 0;
97760
97761   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":430
97762  *         result_list = []
97763  *         root = Element(u'matches')
97764  *         join_groups = u''.join             # <<<<<<<<<<<<<<
97765  *         for s_match in results:
97766  *             if python.PyTuple_CheckExact(s_match):
97767  */
97768   __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_kp_572), __pyx_kp_join); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97769   __Pyx_GOTREF(__pyx_t_4);
97770   __Pyx_DECREF(__pyx_v_join_groups);
97771   __pyx_v_join_groups = __pyx_t_4;
97772   __pyx_t_4 = 0;
97773
97774   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":431
97775  *         root = Element(u'matches')
97776  *         join_groups = u''.join
97777  *         for s_match in results:             # <<<<<<<<<<<<<<
97778  *             if python.PyTuple_CheckExact(s_match):
97779  *                 s_match = join_groups(s_match)
97780  */
97781   if (PyList_CheckExact(__pyx_v_results) || PyTuple_CheckExact(__pyx_v_results)) {
97782     __pyx_t_7 = 0; __pyx_t_4 = __pyx_v_results; __Pyx_INCREF(__pyx_t_4);
97783   } else {
97784     __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_results); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97785     __Pyx_GOTREF(__pyx_t_4);
97786   }
97787   for (;;) {
97788     if (likely(PyList_CheckExact(__pyx_t_4))) {
97789       if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break;
97790       __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++;
97791     } else if (likely(PyTuple_CheckExact(__pyx_t_4))) {
97792       if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
97793       __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++;
97794     } else {
97795       __pyx_t_6 = PyIter_Next(__pyx_t_4);
97796       if (!__pyx_t_6) {
97797         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97798         break;
97799       }
97800       __Pyx_GOTREF(__pyx_t_6);
97801     }
97802     __Pyx_DECREF(__pyx_v_s_match);
97803     __pyx_v_s_match = __pyx_t_6;
97804     __pyx_t_6 = 0;
97805
97806     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":432
97807  *         join_groups = u''.join
97808  *         for s_match in results:
97809  *             if python.PyTuple_CheckExact(s_match):             # <<<<<<<<<<<<<<
97810  *                 s_match = join_groups(s_match)
97811  *             elem = SubElement(root, u'match')
97812  */
97813     __pyx_t_2 = PyTuple_CheckExact(__pyx_v_s_match);
97814     if (__pyx_t_2) {
97815
97816       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":433
97817  *         for s_match in results:
97818  *             if python.PyTuple_CheckExact(s_match):
97819  *                 s_match = join_groups(s_match)             # <<<<<<<<<<<<<<
97820  *             elem = SubElement(root, u'match')
97821  *             elem.text = s_match
97822  */
97823       __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97824       __Pyx_GOTREF(((PyObject *)__pyx_t_6));
97825       __Pyx_INCREF(__pyx_v_s_match);
97826       PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_s_match);
97827       __Pyx_GIVEREF(__pyx_v_s_match);
97828       __pyx_t_3 = PyObject_Call(__pyx_v_join_groups, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97829       __Pyx_GOTREF(__pyx_t_3);
97830       __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
97831       __Pyx_DECREF(__pyx_v_s_match);
97832       __pyx_v_s_match = __pyx_t_3;
97833       __pyx_t_3 = 0;
97834       goto __pyx_L11;
97835     }
97836     __pyx_L11:;
97837
97838     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":434
97839  *             if python.PyTuple_CheckExact(s_match):
97840  *                 s_match = join_groups(s_match)
97841  *             elem = SubElement(root, u'match')             # <<<<<<<<<<<<<<
97842  *             elem.text = s_match
97843  *             result_list.append(elem)
97844  */
97845     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_SubElement); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97846     __Pyx_GOTREF(__pyx_1);
97847     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97848     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
97849     __Pyx_INCREF(__pyx_v_root);
97850     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_root);
97851     __Pyx_GIVEREF(__pyx_v_root);
97852     __Pyx_INCREF(((PyObject *)__pyx_kp_573));
97853     PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_kp_573));
97854     __Pyx_GIVEREF(((PyObject *)__pyx_kp_573));
97855     __pyx_t_6 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97856     __Pyx_GOTREF(__pyx_t_6);
97857     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
97858     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
97859     __Pyx_DECREF(__pyx_v_elem);
97860     __pyx_v_elem = __pyx_t_6;
97861     __pyx_t_6 = 0;
97862
97863     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":435
97864  *                 s_match = join_groups(s_match)
97865  *             elem = SubElement(root, u'match')
97866  *             elem.text = s_match             # <<<<<<<<<<<<<<
97867  *             result_list.append(elem)
97868  *         return result_list
97869  */
97870     if (PyObject_SetAttr(__pyx_v_elem, __pyx_kp_text, __pyx_v_s_match) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97871
97872     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":436
97873  *             elem = SubElement(root, u'match')
97874  *             elem.text = s_match
97875  *             result_list.append(elem)             # <<<<<<<<<<<<<<
97876  *         return result_list
97877  * 
97878  */
97879     __pyx_t_8 = PyList_Append(((PyObject *)__pyx_v_result_list), __pyx_v_elem); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
97880   }
97881   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
97882
97883   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":437
97884  *             elem.text = s_match
97885  *             result_list.append(elem)
97886  *         return result_list             # <<<<<<<<<<<<<<
97887  * 
97888  *     def replace(self, ctxt, s, rexp, flags, replacement):
97889  */
97890   __Pyx_XDECREF(__pyx_r);
97891   __Pyx_INCREF(((PyObject *)__pyx_v_result_list));
97892   __pyx_r = ((PyObject *)__pyx_v_result_list);
97893   goto __pyx_L0;
97894
97895   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
97896   goto __pyx_L0;
97897   __pyx_L1_error:;
97898   __Pyx_XDECREF(__pyx_1);
97899   __Pyx_XDECREF(__pyx_t_1);
97900   __Pyx_XDECREF(__pyx_t_3);
97901   __Pyx_XDECREF(__pyx_t_4);
97902   __Pyx_XDECREF(__pyx_t_6);
97903   __Pyx_AddTraceback("lxml.etree._ExsltRegExp.match");
97904   __pyx_r = NULL;
97905   __pyx_L0:;
97906   __Pyx_DECREF(__pyx_v_result_list);
97907   __Pyx_DECREF(__pyx_v_rexpc);
97908   __Pyx_DECREF(__pyx_v_results);
97909   __Pyx_DECREF(__pyx_v_result);
97910   __Pyx_DECREF(__pyx_v_root);
97911   __Pyx_DECREF(__pyx_v_join_groups);
97912   __Pyx_DECREF(__pyx_v_s_match);
97913   __Pyx_DECREF(__pyx_v_elem);
97914   __Pyx_DECREF(__pyx_v_s);
97915   __Pyx_DECREF(__pyx_v_flags);
97916   __Pyx_XGIVEREF(__pyx_r);
97917   __Pyx_FinishRefcountContext();
97918   return __pyx_r;
97919 }
97920
97921 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":439
97922  *         return result_list
97923  * 
97924  *     def replace(self, ctxt, s, rexp, flags, replacement):             # <<<<<<<<<<<<<<
97925  *         replacement = self._make_string(replacement)
97926  *         flags = self._make_string(flags)
97927  */
97928
97929 static PyObject *__pyx_pf_4lxml_5etree_12_ExsltRegExp_replace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
97930 static PyObject *__pyx_pf_4lxml_5etree_12_ExsltRegExp_replace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
97931   PyObject *__pyx_v_ctxt = 0;
97932   PyObject *__pyx_v_s = 0;
97933   PyObject *__pyx_v_rexp = 0;
97934   PyObject *__pyx_v_flags = 0;
97935   PyObject *__pyx_v_replacement = 0;
97936   PyObject *__pyx_v_rexpc;
97937   PyObject *__pyx_v_count;
97938   PyObject *__pyx_r = NULL;
97939   PyObject *__pyx_t_1 = NULL;
97940   int __pyx_t_2;
97941   PyObject *__pyx_t_3 = NULL;
97942   PyObject *__pyx_t_4 = NULL;
97943   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_ctxt,&__pyx_kp_s,&__pyx_kp_rexp,&__pyx_kp_flags,&__pyx_kp_replacement,0};
97944   __Pyx_SetupRefcountContext("replace");
97945   if (unlikely(__pyx_kwds)) {
97946     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
97947     PyObject* values[5] = {0,0,0,0,0};
97948     switch (PyTuple_GET_SIZE(__pyx_args)) {
97949       case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
97950       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
97951       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
97952       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
97953       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
97954       case  0: break;
97955       default: goto __pyx_L5_argtuple_error;
97956     }
97957     switch (PyTuple_GET_SIZE(__pyx_args)) {
97958       case  0:
97959       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_ctxt);
97960       if (likely(values[0])) kw_args--;
97961       else goto __pyx_L5_argtuple_error;
97962       case  1:
97963       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_s);
97964       if (likely(values[1])) kw_args--;
97965       else {
97966         __Pyx_RaiseArgtupleInvalid("replace", 1, 5, 5, 1); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
97967       }
97968       case  2:
97969       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_rexp);
97970       if (likely(values[2])) kw_args--;
97971       else {
97972         __Pyx_RaiseArgtupleInvalid("replace", 1, 5, 5, 2); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
97973       }
97974       case  3:
97975       values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_flags);
97976       if (likely(values[3])) kw_args--;
97977       else {
97978         __Pyx_RaiseArgtupleInvalid("replace", 1, 5, 5, 3); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
97979       }
97980       case  4:
97981       values[4] = PyDict_GetItem(__pyx_kwds, __pyx_kp_replacement);
97982       if (likely(values[4])) kw_args--;
97983       else {
97984         __Pyx_RaiseArgtupleInvalid("replace", 1, 5, 5, 4); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
97985       }
97986     }
97987     if (unlikely(kw_args > 0)) {
97988       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "replace") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
97989     }
97990     __pyx_v_ctxt = values[0];
97991     __pyx_v_s = values[1];
97992     __pyx_v_rexp = values[2];
97993     __pyx_v_flags = values[3];
97994     __pyx_v_replacement = values[4];
97995   } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
97996     goto __pyx_L5_argtuple_error;
97997   } else {
97998     __pyx_v_ctxt = PyTuple_GET_ITEM(__pyx_args, 0);
97999     __pyx_v_s = PyTuple_GET_ITEM(__pyx_args, 1);
98000     __pyx_v_rexp = PyTuple_GET_ITEM(__pyx_args, 2);
98001     __pyx_v_flags = PyTuple_GET_ITEM(__pyx_args, 3);
98002     __pyx_v_replacement = PyTuple_GET_ITEM(__pyx_args, 4);
98003   }
98004   goto __pyx_L4_argument_unpacking_done;
98005   __pyx_L5_argtuple_error:;
98006   __Pyx_RaiseArgtupleInvalid("replace", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
98007   __pyx_L3_error:;
98008   __Pyx_AddTraceback("lxml.etree._ExsltRegExp.replace");
98009   return NULL;
98010   __pyx_L4_argument_unpacking_done:;
98011   __Pyx_INCREF(__pyx_v_s);
98012   __Pyx_INCREF(__pyx_v_flags);
98013   __Pyx_INCREF(__pyx_v_replacement);
98014   __pyx_v_rexpc = Py_None; __Pyx_INCREF(Py_None);
98015   __pyx_v_count = Py_None; __Pyx_INCREF(Py_None);
98016
98017   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":440
98018  * 
98019  *     def replace(self, ctxt, s, rexp, flags, replacement):
98020  *         replacement = self._make_string(replacement)             # <<<<<<<<<<<<<<
98021  *         flags = self._make_string(flags)
98022  *         s = self._make_string(s)
98023  */
98024   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ExsltRegExp *)((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)__pyx_v_self)->__pyx_vtab)->_make_string(((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)__pyx_v_self), __pyx_v_replacement); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98025   __Pyx_GOTREF(__pyx_t_1);
98026   __Pyx_DECREF(__pyx_v_replacement);
98027   __pyx_v_replacement = __pyx_t_1;
98028   __pyx_t_1 = 0;
98029
98030   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":441
98031  *     def replace(self, ctxt, s, rexp, flags, replacement):
98032  *         replacement = self._make_string(replacement)
98033  *         flags = self._make_string(flags)             # <<<<<<<<<<<<<<
98034  *         s = self._make_string(s)
98035  *         rexpc = self._compile(rexp, u'i' in flags)
98036  */
98037   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ExsltRegExp *)((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)__pyx_v_self)->__pyx_vtab)->_make_string(((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)__pyx_v_self), __pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98038   __Pyx_GOTREF(__pyx_t_1);
98039   __Pyx_DECREF(__pyx_v_flags);
98040   __pyx_v_flags = __pyx_t_1;
98041   __pyx_t_1 = 0;
98042
98043   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":442
98044  *         replacement = self._make_string(replacement)
98045  *         flags = self._make_string(flags)
98046  *         s = self._make_string(s)             # <<<<<<<<<<<<<<
98047  *         rexpc = self._compile(rexp, u'i' in flags)
98048  *         if u'g' in flags:
98049  */
98050   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ExsltRegExp *)((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)__pyx_v_self)->__pyx_vtab)->_make_string(((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)__pyx_v_self), __pyx_v_s); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98051   __Pyx_GOTREF(__pyx_t_1);
98052   __Pyx_DECREF(__pyx_v_s);
98053   __pyx_v_s = __pyx_t_1;
98054   __pyx_t_1 = 0;
98055
98056   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":443
98057  *         flags = self._make_string(flags)
98058  *         s = self._make_string(s)
98059  *         rexpc = self._compile(rexp, u'i' in flags)             # <<<<<<<<<<<<<<
98060  *         if u'g' in flags:
98061  *             count = 0
98062  */
98063   __pyx_t_2 = (PySequence_Contains(__pyx_v_flags, ((PyObject *)__pyx_kp_574))); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98064   __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98065   __Pyx_GOTREF(__pyx_t_1);
98066   __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__ExsltRegExp *)((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)__pyx_v_self)->__pyx_vtab)->_compile(((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)__pyx_v_self), __pyx_v_rexp, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98067   __Pyx_GOTREF(__pyx_t_3);
98068   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
98069   __Pyx_DECREF(__pyx_v_rexpc);
98070   __pyx_v_rexpc = __pyx_t_3;
98071   __pyx_t_3 = 0;
98072
98073   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":444
98074  *         s = self._make_string(s)
98075  *         rexpc = self._compile(rexp, u'i' in flags)
98076  *         if u'g' in flags:             # <<<<<<<<<<<<<<
98077  *             count = 0
98078  *         else:
98079  */
98080   __pyx_t_2 = (PySequence_Contains(__pyx_v_flags, ((PyObject *)__pyx_kp_575))); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98081   if (__pyx_t_2) {
98082
98083     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":445
98084  *         rexpc = self._compile(rexp, u'i' in flags)
98085  *         if u'g' in flags:
98086  *             count = 0             # <<<<<<<<<<<<<<
98087  *         else:
98088  *             count = 1
98089  */
98090     __Pyx_INCREF(__pyx_int_0);
98091     __Pyx_DECREF(__pyx_v_count);
98092     __pyx_v_count = __pyx_int_0;
98093     goto __pyx_L6;
98094   }
98095   /*else*/ {
98096
98097     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":447
98098  *             count = 0
98099  *         else:
98100  *             count = 1             # <<<<<<<<<<<<<<
98101  *         return rexpc.sub(replacement, s, count)
98102  * 
98103  */
98104     __Pyx_INCREF(__pyx_int_1);
98105     __Pyx_DECREF(__pyx_v_count);
98106     __pyx_v_count = __pyx_int_1;
98107   }
98108   __pyx_L6:;
98109
98110   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":448
98111  *         else:
98112  *             count = 1
98113  *         return rexpc.sub(replacement, s, count)             # <<<<<<<<<<<<<<
98114  * 
98115  *     cdef _register_in_context(self, _BaseContext context):
98116  */
98117   __Pyx_XDECREF(__pyx_r);
98118   __pyx_t_3 = PyObject_GetAttr(__pyx_v_rexpc, __pyx_kp_sub); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98119   __Pyx_GOTREF(__pyx_t_3);
98120   __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98121   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
98122   __Pyx_INCREF(__pyx_v_replacement);
98123   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_replacement);
98124   __Pyx_GIVEREF(__pyx_v_replacement);
98125   __Pyx_INCREF(__pyx_v_s);
98126   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_s);
98127   __Pyx_GIVEREF(__pyx_v_s);
98128   __Pyx_INCREF(__pyx_v_count);
98129   PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_count);
98130   __Pyx_GIVEREF(__pyx_v_count);
98131   __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98132   __Pyx_GOTREF(__pyx_t_4);
98133   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
98134   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
98135   __pyx_r = __pyx_t_4;
98136   __pyx_t_4 = 0;
98137   goto __pyx_L0;
98138
98139   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
98140   goto __pyx_L0;
98141   __pyx_L1_error:;
98142   __Pyx_XDECREF(__pyx_t_1);
98143   __Pyx_XDECREF(__pyx_t_3);
98144   __Pyx_XDECREF(__pyx_t_4);
98145   __Pyx_AddTraceback("lxml.etree._ExsltRegExp.replace");
98146   __pyx_r = NULL;
98147   __pyx_L0:;
98148   __Pyx_DECREF(__pyx_v_rexpc);
98149   __Pyx_DECREF(__pyx_v_count);
98150   __Pyx_DECREF(__pyx_v_s);
98151   __Pyx_DECREF(__pyx_v_flags);
98152   __Pyx_DECREF(__pyx_v_replacement);
98153   __Pyx_XGIVEREF(__pyx_r);
98154   __Pyx_FinishRefcountContext();
98155   return __pyx_r;
98156 }
98157
98158 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":450
98159  *         return rexpc.sub(replacement, s, count)
98160  * 
98161  *     cdef _register_in_context(self, _BaseContext context):             # <<<<<<<<<<<<<<
98162  *         ns = "http://exslt.org/regular-expressions"
98163  *         context._addLocalExtensionFunction(ns, "test",    self.test)
98164  */
98165
98166 static  PyObject *__pyx_f_4lxml_5etree_12_ExsltRegExp__register_in_context(struct __pyx_obj_4lxml_5etree__ExsltRegExp *__pyx_v_self, struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_context) {
98167   PyObject *__pyx_v_ns;
98168   PyObject *__pyx_r = NULL;
98169   PyObject *__pyx_t_1 = NULL;
98170   __Pyx_SetupRefcountContext("_register_in_context");
98171   __pyx_v_ns = Py_None; __Pyx_INCREF(Py_None);
98172
98173   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":451
98174  * 
98175  *     cdef _register_in_context(self, _BaseContext context):
98176  *         ns = "http://exslt.org/regular-expressions"             # <<<<<<<<<<<<<<
98177  *         context._addLocalExtensionFunction(ns, "test",    self.test)
98178  *         context._addLocalExtensionFunction(ns, "match",   self.match)
98179  */
98180   __Pyx_INCREF(__pyx_kp_576);
98181   __Pyx_DECREF(__pyx_v_ns);
98182   __pyx_v_ns = __pyx_kp_576;
98183
98184   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":452
98185  *     cdef _register_in_context(self, _BaseContext context):
98186  *         ns = "http://exslt.org/regular-expressions"
98187  *         context._addLocalExtensionFunction(ns, "test",    self.test)             # <<<<<<<<<<<<<<
98188  *         context._addLocalExtensionFunction(ns, "match",   self.match)
98189  *         context._addLocalExtensionFunction(ns, "replace", self.replace)
98190  */
98191   __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_kp_test); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98192   __Pyx_GOTREF(__pyx_t_1);
98193   ((struct __pyx_vtabstruct_4lxml_5etree__BaseContext *)__pyx_v_context->__pyx_vtab)->_addLocalExtensionFunction(__pyx_v_context, __pyx_v_ns, __pyx_kp_577, __pyx_t_1);
98194   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
98195
98196   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":453
98197  *         ns = "http://exslt.org/regular-expressions"
98198  *         context._addLocalExtensionFunction(ns, "test",    self.test)
98199  *         context._addLocalExtensionFunction(ns, "match",   self.match)             # <<<<<<<<<<<<<<
98200  *         context._addLocalExtensionFunction(ns, "replace", self.replace)
98201  * 
98202  */
98203   __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_kp_match); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98204   __Pyx_GOTREF(__pyx_t_1);
98205   ((struct __pyx_vtabstruct_4lxml_5etree__BaseContext *)__pyx_v_context->__pyx_vtab)->_addLocalExtensionFunction(__pyx_v_context, __pyx_v_ns, __pyx_kp_578, __pyx_t_1);
98206   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
98207
98208   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":454
98209  *         context._addLocalExtensionFunction(ns, "test",    self.test)
98210  *         context._addLocalExtensionFunction(ns, "match",   self.match)
98211  *         context._addLocalExtensionFunction(ns, "replace", self.replace)             # <<<<<<<<<<<<<<
98212  * 
98213  * 
98214  */
98215   __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_kp_replace); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98216   __Pyx_GOTREF(__pyx_t_1);
98217   ((struct __pyx_vtabstruct_4lxml_5etree__BaseContext *)__pyx_v_context->__pyx_vtab)->_addLocalExtensionFunction(__pyx_v_context, __pyx_v_ns, __pyx_kp_579, __pyx_t_1);
98218   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
98219
98220   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
98221   goto __pyx_L0;
98222   __pyx_L1_error:;
98223   __Pyx_XDECREF(__pyx_t_1);
98224   __Pyx_AddTraceback("lxml.etree._ExsltRegExp._register_in_context");
98225   __pyx_r = 0;
98226   __pyx_L0:;
98227   __Pyx_DECREF(__pyx_v_ns);
98228   __Pyx_XGIVEREF(__pyx_r);
98229   __Pyx_FinishRefcountContext();
98230   return __pyx_r;
98231 }
98232
98233 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":460
98234  * # helper functions
98235  * 
98236  * cdef xpath.xmlXPathObject* _wrapXPathObject(object obj) except NULL:             # <<<<<<<<<<<<<<
98237  *     cdef xpath.xmlNodeSet* resultSet
98238  *     cdef _Element node
98239  */
98240
98241 static  xmlXPathObject *__pyx_f_4lxml_5etree__wrapXPathObject(PyObject *__pyx_v_obj) {
98242   xmlNodeSet *__pyx_v_resultSet;
98243   struct LxmlElement *__pyx_v_node;
98244   PyObject *__pyx_v_element;
98245   xmlXPathObject *__pyx_r;
98246   PyObject *__pyx_1 = 0;
98247   int __pyx_t_1;
98248   PyObject *__pyx_t_2 = NULL;
98249   int __pyx_t_3;
98250   double __pyx_t_4;
98251   Py_ssize_t __pyx_t_5;
98252   PyObject *__pyx_t_6 = NULL;
98253   __Pyx_SetupRefcountContext("_wrapXPathObject");
98254   __Pyx_INCREF(__pyx_v_obj);
98255   __pyx_v_node = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
98256   __pyx_v_element = Py_None; __Pyx_INCREF(Py_None);
98257
98258   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":463
98259  *     cdef xpath.xmlNodeSet* resultSet
98260  *     cdef _Element node
98261  *     if python.PyUnicode_Check(obj):             # <<<<<<<<<<<<<<
98262  *         obj = _utf8(obj)
98263  *     if python.PyString_Check(obj):
98264  */
98265   __pyx_t_1 = PyUnicode_Check(__pyx_v_obj);
98266   if (__pyx_t_1) {
98267
98268     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":464
98269  *     cdef _Element node
98270  *     if python.PyUnicode_Check(obj):
98271  *         obj = _utf8(obj)             # <<<<<<<<<<<<<<
98272  *     if python.PyString_Check(obj):
98273  *         return xpath.xmlXPathNewCString(_cstr(obj))
98274  */
98275     __pyx_t_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_obj); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98276     __Pyx_GOTREF(__pyx_t_2);
98277     __Pyx_DECREF(__pyx_v_obj);
98278     __pyx_v_obj = __pyx_t_2;
98279     __pyx_t_2 = 0;
98280     goto __pyx_L3;
98281   }
98282   __pyx_L3:;
98283
98284   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":465
98285  *     if python.PyUnicode_Check(obj):
98286  *         obj = _utf8(obj)
98287  *     if python.PyString_Check(obj):             # <<<<<<<<<<<<<<
98288  *         return xpath.xmlXPathNewCString(_cstr(obj))
98289  *     if python.PyBool_Check(obj):
98290  */
98291   __pyx_t_1 = PyString_Check(__pyx_v_obj);
98292   if (__pyx_t_1) {
98293
98294     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":466
98295  *         obj = _utf8(obj)
98296  *     if python.PyString_Check(obj):
98297  *         return xpath.xmlXPathNewCString(_cstr(obj))             # <<<<<<<<<<<<<<
98298  *     if python.PyBool_Check(obj):
98299  *         return xpath.xmlXPathNewBoolean(obj)
98300  */
98301     __pyx_r = xmlXPathNewCString(PyString_AS_STRING(__pyx_v_obj));
98302     goto __pyx_L0;
98303     goto __pyx_L4;
98304   }
98305   __pyx_L4:;
98306
98307   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":467
98308  *     if python.PyString_Check(obj):
98309  *         return xpath.xmlXPathNewCString(_cstr(obj))
98310  *     if python.PyBool_Check(obj):             # <<<<<<<<<<<<<<
98311  *         return xpath.xmlXPathNewBoolean(obj)
98312  *     if python.PyNumber_Check(obj):
98313  */
98314   __pyx_t_1 = PyBool_Check(__pyx_v_obj);
98315   if (__pyx_t_1) {
98316
98317     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":468
98318  *         return xpath.xmlXPathNewCString(_cstr(obj))
98319  *     if python.PyBool_Check(obj):
98320  *         return xpath.xmlXPathNewBoolean(obj)             # <<<<<<<<<<<<<<
98321  *     if python.PyNumber_Check(obj):
98322  *         return xpath.xmlXPathNewFloat(obj)
98323  */
98324     __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_v_obj); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98325     __pyx_r = xmlXPathNewBoolean(__pyx_t_3);
98326     goto __pyx_L0;
98327     goto __pyx_L5;
98328   }
98329   __pyx_L5:;
98330
98331   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":469
98332  *     if python.PyBool_Check(obj):
98333  *         return xpath.xmlXPathNewBoolean(obj)
98334  *     if python.PyNumber_Check(obj):             # <<<<<<<<<<<<<<
98335  *         return xpath.xmlXPathNewFloat(obj)
98336  *     if obj is None:
98337  */
98338   __pyx_t_1 = PyNumber_Check(__pyx_v_obj);
98339   if (__pyx_t_1) {
98340
98341     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":470
98342  *         return xpath.xmlXPathNewBoolean(obj)
98343  *     if python.PyNumber_Check(obj):
98344  *         return xpath.xmlXPathNewFloat(obj)             # <<<<<<<<<<<<<<
98345  *     if obj is None:
98346  *         resultSet = xpath.xmlXPathNodeSetCreate(NULL)
98347  */
98348     __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_obj); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98349     __pyx_r = xmlXPathNewFloat(__pyx_t_4);
98350     goto __pyx_L0;
98351     goto __pyx_L6;
98352   }
98353   __pyx_L6:;
98354
98355   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":471
98356  *     if python.PyNumber_Check(obj):
98357  *         return xpath.xmlXPathNewFloat(obj)
98358  *     if obj is None:             # <<<<<<<<<<<<<<
98359  *         resultSet = xpath.xmlXPathNodeSetCreate(NULL)
98360  *     elif isinstance(obj, _Element):
98361  */
98362   __pyx_t_1 = (__pyx_v_obj == Py_None);
98363   if (__pyx_t_1) {
98364
98365     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":472
98366  *         return xpath.xmlXPathNewFloat(obj)
98367  *     if obj is None:
98368  *         resultSet = xpath.xmlXPathNodeSetCreate(NULL)             # <<<<<<<<<<<<<<
98369  *     elif isinstance(obj, _Element):
98370  *         resultSet = xpath.xmlXPathNodeSetCreate((<_Element>obj)._c_node)
98371  */
98372     __pyx_v_resultSet = xmlXPathNodeSetCreate(NULL);
98373     goto __pyx_L7;
98374   }
98375
98376   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":473
98377  *     if obj is None:
98378  *         resultSet = xpath.xmlXPathNodeSetCreate(NULL)
98379  *     elif isinstance(obj, _Element):             # <<<<<<<<<<<<<<
98380  *         resultSet = xpath.xmlXPathNodeSetCreate((<_Element>obj)._c_node)
98381  *     elif python.PySequence_Check(obj):
98382  */
98383   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_obj, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Element))); 
98384   if (__pyx_t_1) {
98385
98386     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":474
98387  *         resultSet = xpath.xmlXPathNodeSetCreate(NULL)
98388  *     elif isinstance(obj, _Element):
98389  *         resultSet = xpath.xmlXPathNodeSetCreate((<_Element>obj)._c_node)             # <<<<<<<<<<<<<<
98390  *     elif python.PySequence_Check(obj):
98391  *         resultSet = xpath.xmlXPathNodeSetCreate(NULL)
98392  */
98393     __pyx_v_resultSet = xmlXPathNodeSetCreate(((struct LxmlElement *)__pyx_v_obj)->_c_node);
98394     goto __pyx_L7;
98395   }
98396
98397   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":475
98398  *     elif isinstance(obj, _Element):
98399  *         resultSet = xpath.xmlXPathNodeSetCreate((<_Element>obj)._c_node)
98400  *     elif python.PySequence_Check(obj):             # <<<<<<<<<<<<<<
98401  *         resultSet = xpath.xmlXPathNodeSetCreate(NULL)
98402  *         for element in obj:
98403  */
98404   __pyx_t_1 = PySequence_Check(__pyx_v_obj);
98405   if (__pyx_t_1) {
98406
98407     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":476
98408  *         resultSet = xpath.xmlXPathNodeSetCreate((<_Element>obj)._c_node)
98409  *     elif python.PySequence_Check(obj):
98410  *         resultSet = xpath.xmlXPathNodeSetCreate(NULL)             # <<<<<<<<<<<<<<
98411  *         for element in obj:
98412  *             if isinstance(element, _Element):
98413  */
98414     __pyx_v_resultSet = xmlXPathNodeSetCreate(NULL);
98415
98416     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":477
98417  *     elif python.PySequence_Check(obj):
98418  *         resultSet = xpath.xmlXPathNodeSetCreate(NULL)
98419  *         for element in obj:             # <<<<<<<<<<<<<<
98420  *             if isinstance(element, _Element):
98421  *                 node = <_Element>element
98422  */
98423     if (PyList_CheckExact(__pyx_v_obj) || PyTuple_CheckExact(__pyx_v_obj)) {
98424       __pyx_t_5 = 0; __pyx_t_2 = __pyx_v_obj; __Pyx_INCREF(__pyx_t_2);
98425     } else {
98426       __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98427       __Pyx_GOTREF(__pyx_t_2);
98428     }
98429     for (;;) {
98430       if (likely(PyList_CheckExact(__pyx_t_2))) {
98431         if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
98432         __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++;
98433       } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
98434         if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
98435         __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++;
98436       } else {
98437         __pyx_t_6 = PyIter_Next(__pyx_t_2);
98438         if (!__pyx_t_6) {
98439           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98440           break;
98441         }
98442         __Pyx_GOTREF(__pyx_t_6);
98443       }
98444       __Pyx_DECREF(__pyx_v_element);
98445       __pyx_v_element = __pyx_t_6;
98446       __pyx_t_6 = 0;
98447
98448       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":478
98449  *         resultSet = xpath.xmlXPathNodeSetCreate(NULL)
98450  *         for element in obj:
98451  *             if isinstance(element, _Element):             # <<<<<<<<<<<<<<
98452  *                 node = <_Element>element
98453  *                 xpath.xmlXPathNodeSetAdd(resultSet, node._c_node)
98454  */
98455       __pyx_t_1 = PyObject_TypeCheck(__pyx_v_element, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Element))); 
98456       if (__pyx_t_1) {
98457
98458         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":479
98459  *         for element in obj:
98460  *             if isinstance(element, _Element):
98461  *                 node = <_Element>element             # <<<<<<<<<<<<<<
98462  *                 xpath.xmlXPathNodeSetAdd(resultSet, node._c_node)
98463  *             else:
98464  */
98465         __Pyx_INCREF(((PyObject *)((struct LxmlElement *)__pyx_v_element)));
98466         __Pyx_DECREF(((PyObject *)__pyx_v_node));
98467         __pyx_v_node = ((struct LxmlElement *)__pyx_v_element);
98468
98469         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":480
98470  *             if isinstance(element, _Element):
98471  *                 node = <_Element>element
98472  *                 xpath.xmlXPathNodeSetAdd(resultSet, node._c_node)             # <<<<<<<<<<<<<<
98473  *             else:
98474  *                 xpath.xmlXPathFreeNodeSet(resultSet)
98475  */
98476         xmlXPathNodeSetAdd(__pyx_v_resultSet, __pyx_v_node->_c_node);
98477         goto __pyx_L10;
98478       }
98479       /*else*/ {
98480
98481         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":482
98482  *                 xpath.xmlXPathNodeSetAdd(resultSet, node._c_node)
98483  *             else:
98484  *                 xpath.xmlXPathFreeNodeSet(resultSet)             # <<<<<<<<<<<<<<
98485  *                 raise XPathResultError, u"This is not a node: %r" % element
98486  *     else:
98487  */
98488         xmlXPathFreeNodeSet(__pyx_v_resultSet);
98489
98490         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":483
98491  *             else:
98492  *                 xpath.xmlXPathFreeNodeSet(resultSet)
98493  *                 raise XPathResultError, u"This is not a node: %r" % element             # <<<<<<<<<<<<<<
98494  *     else:
98495  *         raise XPathResultError, u"Unknown return type: %s" % \
98496  */
98497         __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XPathResultError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98498         __Pyx_GOTREF(__pyx_1);
98499         __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_580), __pyx_v_element); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98500         __Pyx_GOTREF(__pyx_t_6);
98501         __Pyx_Raise(__pyx_1, __pyx_t_6, 0);
98502         __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
98503         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
98504         {__pyx_filename = __pyx_f[5]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98505       }
98506       __pyx_L10:;
98507     }
98508     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
98509     goto __pyx_L7;
98510   }
98511   /*else*/ {
98512
98513     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":485
98514  *                 raise XPathResultError, u"This is not a node: %r" % element
98515  *     else:
98516  *         raise XPathResultError, u"Unknown return type: %s" % \             # <<<<<<<<<<<<<<
98517  *             python._fqtypename(obj)
98518  *     return xpath.xmlXPathWrapNodeSet(resultSet)
98519  */
98520     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XPathResultError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98521     __Pyx_GOTREF(__pyx_1);
98522
98523     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":486
98524  *     else:
98525  *         raise XPathResultError, u"Unknown return type: %s" % \
98526  *             python._fqtypename(obj)             # <<<<<<<<<<<<<<
98527  *     return xpath.xmlXPathWrapNodeSet(resultSet)
98528  * 
98529  */
98530     __pyx_t_2 = __Pyx_PyBytes_FromString(_fqtypename(__pyx_v_obj)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98531     __Pyx_GOTREF(__pyx_t_2);
98532     __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_581), __pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98533     __Pyx_GOTREF(__pyx_t_6);
98534     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
98535     __Pyx_Raise(__pyx_1, __pyx_t_6, 0);
98536     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
98537     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
98538     {__pyx_filename = __pyx_f[5]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98539   }
98540   __pyx_L7:;
98541
98542   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":487
98543  *         raise XPathResultError, u"Unknown return type: %s" % \
98544  *             python._fqtypename(obj)
98545  *     return xpath.xmlXPathWrapNodeSet(resultSet)             # <<<<<<<<<<<<<<
98546  * 
98547  * cdef object _unwrapXPathObject(xpath.xmlXPathObject* xpathObj,
98548  */
98549   __pyx_r = xmlXPathWrapNodeSet(__pyx_v_resultSet);
98550   goto __pyx_L0;
98551
98552   __pyx_r = 0;
98553   goto __pyx_L0;
98554   __pyx_L1_error:;
98555   __Pyx_XDECREF(__pyx_1);
98556   __Pyx_XDECREF(__pyx_t_2);
98557   __Pyx_XDECREF(__pyx_t_6);
98558   __Pyx_AddTraceback("lxml.etree._wrapXPathObject");
98559   __pyx_r = NULL;
98560   __pyx_L0:;
98561   __Pyx_DECREF((PyObject *)__pyx_v_node);
98562   __Pyx_DECREF(__pyx_v_element);
98563   __Pyx_DECREF(__pyx_v_obj);
98564   __Pyx_FinishRefcountContext();
98565   return __pyx_r;
98566 }
98567
98568 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":489
98569  *     return xpath.xmlXPathWrapNodeSet(resultSet)
98570  * 
98571  * cdef object _unwrapXPathObject(xpath.xmlXPathObject* xpathObj,             # <<<<<<<<<<<<<<
98572  *                                _Document doc, bint smart_string):
98573  *     if xpathObj.type == xpath.XPATH_UNDEFINED:
98574  */
98575
98576 static  PyObject *__pyx_f_4lxml_5etree__unwrapXPathObject(xmlXPathObject *__pyx_v_xpathObj, struct LxmlDocument *__pyx_v_doc, int __pyx_v_smart_string) {
98577   PyObject *__pyx_v_stringval;
98578   PyObject *__pyx_r = NULL;
98579   PyObject *__pyx_1 = 0;
98580   int __pyx_t_1;
98581   PyObject *__pyx_t_2 = NULL;
98582   PyObject *__pyx_t_3 = NULL;
98583   __Pyx_SetupRefcountContext("_unwrapXPathObject");
98584   __pyx_v_stringval = Py_None; __Pyx_INCREF(Py_None);
98585
98586   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":491
98587  * cdef object _unwrapXPathObject(xpath.xmlXPathObject* xpathObj,
98588  *                                _Document doc, bint smart_string):
98589  *     if xpathObj.type == xpath.XPATH_UNDEFINED:             # <<<<<<<<<<<<<<
98590  *         raise XPathResultError, u"Undefined xpath result"
98591  *     elif xpathObj.type == xpath.XPATH_NODESET:
98592  */
98593   __pyx_t_1 = (__pyx_v_xpathObj->type == XPATH_UNDEFINED);
98594   if (__pyx_t_1) {
98595
98596     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":492
98597  *                                _Document doc, bint smart_string):
98598  *     if xpathObj.type == xpath.XPATH_UNDEFINED:
98599  *         raise XPathResultError, u"Undefined xpath result"             # <<<<<<<<<<<<<<
98600  *     elif xpathObj.type == xpath.XPATH_NODESET:
98601  *         return _createNodeSetResult(xpathObj, doc, smart_string, 0)
98602  */
98603     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XPathResultError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98604     __Pyx_GOTREF(__pyx_1);
98605     __Pyx_Raise(__pyx_1, ((PyObject *)__pyx_kp_582), 0);
98606     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
98607     {__pyx_filename = __pyx_f[5]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98608     goto __pyx_L3;
98609   }
98610
98611   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":493
98612  *     if xpathObj.type == xpath.XPATH_UNDEFINED:
98613  *         raise XPathResultError, u"Undefined xpath result"
98614  *     elif xpathObj.type == xpath.XPATH_NODESET:             # <<<<<<<<<<<<<<
98615  *         return _createNodeSetResult(xpathObj, doc, smart_string, 0)
98616  *     elif xpathObj.type == xpath.XPATH_BOOLEAN:
98617  */
98618   __pyx_t_1 = (__pyx_v_xpathObj->type == XPATH_NODESET);
98619   if (__pyx_t_1) {
98620
98621     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":494
98622  *         raise XPathResultError, u"Undefined xpath result"
98623  *     elif xpathObj.type == xpath.XPATH_NODESET:
98624  *         return _createNodeSetResult(xpathObj, doc, smart_string, 0)             # <<<<<<<<<<<<<<
98625  *     elif xpathObj.type == xpath.XPATH_BOOLEAN:
98626  *         return xpathObj.boolval
98627  */
98628     __Pyx_XDECREF(__pyx_r);
98629     __pyx_t_2 = __pyx_f_4lxml_5etree__createNodeSetResult(__pyx_v_xpathObj, __pyx_v_doc, __pyx_v_smart_string, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98630     __Pyx_GOTREF(__pyx_t_2);
98631     __pyx_r = __pyx_t_2;
98632     __pyx_t_2 = 0;
98633     goto __pyx_L0;
98634     goto __pyx_L3;
98635   }
98636
98637   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":495
98638  *     elif xpathObj.type == xpath.XPATH_NODESET:
98639  *         return _createNodeSetResult(xpathObj, doc, smart_string, 0)
98640  *     elif xpathObj.type == xpath.XPATH_BOOLEAN:             # <<<<<<<<<<<<<<
98641  *         return xpathObj.boolval
98642  *     elif xpathObj.type == xpath.XPATH_NUMBER:
98643  */
98644   __pyx_t_1 = (__pyx_v_xpathObj->type == XPATH_BOOLEAN);
98645   if (__pyx_t_1) {
98646
98647     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":496
98648  *         return _createNodeSetResult(xpathObj, doc, smart_string, 0)
98649  *     elif xpathObj.type == xpath.XPATH_BOOLEAN:
98650  *         return xpathObj.boolval             # <<<<<<<<<<<<<<
98651  *     elif xpathObj.type == xpath.XPATH_NUMBER:
98652  *         return xpathObj.floatval
98653  */
98654     __Pyx_XDECREF(__pyx_r);
98655     __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_xpathObj->boolval); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98656     __Pyx_GOTREF(__pyx_t_2);
98657     __pyx_r = __pyx_t_2;
98658     __pyx_t_2 = 0;
98659     goto __pyx_L0;
98660     goto __pyx_L3;
98661   }
98662
98663   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":497
98664  *     elif xpathObj.type == xpath.XPATH_BOOLEAN:
98665  *         return xpathObj.boolval
98666  *     elif xpathObj.type == xpath.XPATH_NUMBER:             # <<<<<<<<<<<<<<
98667  *         return xpathObj.floatval
98668  *     elif xpathObj.type == xpath.XPATH_STRING:
98669  */
98670   __pyx_t_1 = (__pyx_v_xpathObj->type == XPATH_NUMBER);
98671   if (__pyx_t_1) {
98672
98673     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":498
98674  *         return xpathObj.boolval
98675  *     elif xpathObj.type == xpath.XPATH_NUMBER:
98676  *         return xpathObj.floatval             # <<<<<<<<<<<<<<
98677  *     elif xpathObj.type == xpath.XPATH_STRING:
98678  *         stringval = funicode(xpathObj.stringval)
98679  */
98680     __Pyx_XDECREF(__pyx_r);
98681     __pyx_t_2 = PyFloat_FromDouble(__pyx_v_xpathObj->floatval); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98682     __Pyx_GOTREF(__pyx_t_2);
98683     __pyx_r = __pyx_t_2;
98684     __pyx_t_2 = 0;
98685     goto __pyx_L0;
98686     goto __pyx_L3;
98687   }
98688
98689   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":499
98690  *     elif xpathObj.type == xpath.XPATH_NUMBER:
98691  *         return xpathObj.floatval
98692  *     elif xpathObj.type == xpath.XPATH_STRING:             # <<<<<<<<<<<<<<
98693  *         stringval = funicode(xpathObj.stringval)
98694  *         if smart_string:
98695  */
98696   __pyx_t_1 = (__pyx_v_xpathObj->type == XPATH_STRING);
98697   if (__pyx_t_1) {
98698
98699     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":500
98700  *         return xpathObj.floatval
98701  *     elif xpathObj.type == xpath.XPATH_STRING:
98702  *         stringval = funicode(xpathObj.stringval)             # <<<<<<<<<<<<<<
98703  *         if smart_string:
98704  *             stringval = _elementStringResultFactory(
98705  */
98706     __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_xpathObj->stringval); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98707     __Pyx_GOTREF(__pyx_t_2);
98708     __Pyx_DECREF(__pyx_v_stringval);
98709     __pyx_v_stringval = __pyx_t_2;
98710     __pyx_t_2 = 0;
98711
98712     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":501
98713  *     elif xpathObj.type == xpath.XPATH_STRING:
98714  *         stringval = funicode(xpathObj.stringval)
98715  *         if smart_string:             # <<<<<<<<<<<<<<
98716  *             stringval = _elementStringResultFactory(
98717  *                 stringval, None, 0, 0)
98718  */
98719     __pyx_t_1 = __pyx_v_smart_string;
98720     if (__pyx_t_1) {
98721
98722       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":503
98723  *         if smart_string:
98724  *             stringval = _elementStringResultFactory(
98725  *                 stringval, None, 0, 0)             # <<<<<<<<<<<<<<
98726  *         return stringval
98727  *     elif xpathObj.type == xpath.XPATH_POINT:
98728  */
98729       __pyx_t_2 = __pyx_f_4lxml_5etree__elementStringResultFactory(__pyx_v_stringval, ((struct LxmlElement *)Py_None), 0, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98730       __Pyx_GOTREF(__pyx_t_2);
98731       __Pyx_DECREF(__pyx_v_stringval);
98732       __pyx_v_stringval = __pyx_t_2;
98733       __pyx_t_2 = 0;
98734       goto __pyx_L4;
98735     }
98736     __pyx_L4:;
98737
98738     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":504
98739  *             stringval = _elementStringResultFactory(
98740  *                 stringval, None, 0, 0)
98741  *         return stringval             # <<<<<<<<<<<<<<
98742  *     elif xpathObj.type == xpath.XPATH_POINT:
98743  *         raise NotImplementedError, u"XPATH_POINT"
98744  */
98745     __Pyx_XDECREF(__pyx_r);
98746     __Pyx_INCREF(__pyx_v_stringval);
98747     __pyx_r = __pyx_v_stringval;
98748     goto __pyx_L0;
98749     goto __pyx_L3;
98750   }
98751
98752   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":505
98753  *                 stringval, None, 0, 0)
98754  *         return stringval
98755  *     elif xpathObj.type == xpath.XPATH_POINT:             # <<<<<<<<<<<<<<
98756  *         raise NotImplementedError, u"XPATH_POINT"
98757  *     elif xpathObj.type == xpath.XPATH_RANGE:
98758  */
98759   __pyx_t_1 = (__pyx_v_xpathObj->type == XPATH_POINT);
98760   if (__pyx_t_1) {
98761
98762     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":506
98763  *         return stringval
98764  *     elif xpathObj.type == xpath.XPATH_POINT:
98765  *         raise NotImplementedError, u"XPATH_POINT"             # <<<<<<<<<<<<<<
98766  *     elif xpathObj.type == xpath.XPATH_RANGE:
98767  *         raise NotImplementedError, u"XPATH_RANGE"
98768  */
98769     __Pyx_Raise(__pyx_builtin_NotImplementedError, ((PyObject *)__pyx_kp_583), 0);
98770     {__pyx_filename = __pyx_f[5]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98771     goto __pyx_L3;
98772   }
98773
98774   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":507
98775  *     elif xpathObj.type == xpath.XPATH_POINT:
98776  *         raise NotImplementedError, u"XPATH_POINT"
98777  *     elif xpathObj.type == xpath.XPATH_RANGE:             # <<<<<<<<<<<<<<
98778  *         raise NotImplementedError, u"XPATH_RANGE"
98779  *     elif xpathObj.type == xpath.XPATH_LOCATIONSET:
98780  */
98781   __pyx_t_1 = (__pyx_v_xpathObj->type == XPATH_RANGE);
98782   if (__pyx_t_1) {
98783
98784     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":508
98785  *         raise NotImplementedError, u"XPATH_POINT"
98786  *     elif xpathObj.type == xpath.XPATH_RANGE:
98787  *         raise NotImplementedError, u"XPATH_RANGE"             # <<<<<<<<<<<<<<
98788  *     elif xpathObj.type == xpath.XPATH_LOCATIONSET:
98789  *         raise NotImplementedError, u"XPATH_LOCATIONSET"
98790  */
98791     __Pyx_Raise(__pyx_builtin_NotImplementedError, ((PyObject *)__pyx_kp_584), 0);
98792     {__pyx_filename = __pyx_f[5]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98793     goto __pyx_L3;
98794   }
98795
98796   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":509
98797  *     elif xpathObj.type == xpath.XPATH_RANGE:
98798  *         raise NotImplementedError, u"XPATH_RANGE"
98799  *     elif xpathObj.type == xpath.XPATH_LOCATIONSET:             # <<<<<<<<<<<<<<
98800  *         raise NotImplementedError, u"XPATH_LOCATIONSET"
98801  *     elif xpathObj.type == xpath.XPATH_USERS:
98802  */
98803   __pyx_t_1 = (__pyx_v_xpathObj->type == XPATH_LOCATIONSET);
98804   if (__pyx_t_1) {
98805
98806     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":510
98807  *         raise NotImplementedError, u"XPATH_RANGE"
98808  *     elif xpathObj.type == xpath.XPATH_LOCATIONSET:
98809  *         raise NotImplementedError, u"XPATH_LOCATIONSET"             # <<<<<<<<<<<<<<
98810  *     elif xpathObj.type == xpath.XPATH_USERS:
98811  *         raise NotImplementedError, u"XPATH_USERS"
98812  */
98813     __Pyx_Raise(__pyx_builtin_NotImplementedError, ((PyObject *)__pyx_kp_585), 0);
98814     {__pyx_filename = __pyx_f[5]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98815     goto __pyx_L3;
98816   }
98817
98818   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":511
98819  *     elif xpathObj.type == xpath.XPATH_LOCATIONSET:
98820  *         raise NotImplementedError, u"XPATH_LOCATIONSET"
98821  *     elif xpathObj.type == xpath.XPATH_USERS:             # <<<<<<<<<<<<<<
98822  *         raise NotImplementedError, u"XPATH_USERS"
98823  *     elif xpathObj.type == xpath.XPATH_XSLT_TREE:
98824  */
98825   __pyx_t_1 = (__pyx_v_xpathObj->type == XPATH_USERS);
98826   if (__pyx_t_1) {
98827
98828     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":512
98829  *         raise NotImplementedError, u"XPATH_LOCATIONSET"
98830  *     elif xpathObj.type == xpath.XPATH_USERS:
98831  *         raise NotImplementedError, u"XPATH_USERS"             # <<<<<<<<<<<<<<
98832  *     elif xpathObj.type == xpath.XPATH_XSLT_TREE:
98833  *         return _createNodeSetResult(xpathObj, doc, smart_string, 1)
98834  */
98835     __Pyx_Raise(__pyx_builtin_NotImplementedError, ((PyObject *)__pyx_kp_586), 0);
98836     {__pyx_filename = __pyx_f[5]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98837     goto __pyx_L3;
98838   }
98839
98840   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":513
98841  *     elif xpathObj.type == xpath.XPATH_USERS:
98842  *         raise NotImplementedError, u"XPATH_USERS"
98843  *     elif xpathObj.type == xpath.XPATH_XSLT_TREE:             # <<<<<<<<<<<<<<
98844  *         return _createNodeSetResult(xpathObj, doc, smart_string, 1)
98845  *     else:
98846  */
98847   __pyx_t_1 = (__pyx_v_xpathObj->type == XPATH_XSLT_TREE);
98848   if (__pyx_t_1) {
98849
98850     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":514
98851  *         raise NotImplementedError, u"XPATH_USERS"
98852  *     elif xpathObj.type == xpath.XPATH_XSLT_TREE:
98853  *         return _createNodeSetResult(xpathObj, doc, smart_string, 1)             # <<<<<<<<<<<<<<
98854  *     else:
98855  *         raise XPathResultError, u"Unknown xpath result %s" % unicode(xpathObj.type)
98856  */
98857     __Pyx_XDECREF(__pyx_r);
98858     __pyx_t_2 = __pyx_f_4lxml_5etree__createNodeSetResult(__pyx_v_xpathObj, __pyx_v_doc, __pyx_v_smart_string, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98859     __Pyx_GOTREF(__pyx_t_2);
98860     __pyx_r = __pyx_t_2;
98861     __pyx_t_2 = 0;
98862     goto __pyx_L0;
98863     goto __pyx_L3;
98864   }
98865   /*else*/ {
98866
98867     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":516
98868  *         return _createNodeSetResult(xpathObj, doc, smart_string, 1)
98869  *     else:
98870  *         raise XPathResultError, u"Unknown xpath result %s" % unicode(xpathObj.type)             # <<<<<<<<<<<<<<
98871  * 
98872  * cdef object _createNodeSetResult(xpath.xmlXPathObject* xpathObj, _Document doc,
98873  */
98874     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XPathResultError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98875     __Pyx_GOTREF(__pyx_1);
98876     __pyx_t_2 = PyInt_FromLong(__pyx_v_xpathObj->type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98877     __Pyx_GOTREF(__pyx_t_2);
98878     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98879     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
98880     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
98881     __Pyx_GIVEREF(__pyx_t_2);
98882     __pyx_t_2 = 0;
98883     __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyUnicode_Type)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98884     __Pyx_GOTREF(__pyx_t_2);
98885     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
98886     __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_587), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98887     __Pyx_GOTREF(__pyx_t_3);
98888     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
98889     __Pyx_Raise(__pyx_1, __pyx_t_3, 0);
98890     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
98891     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
98892     {__pyx_filename = __pyx_f[5]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98893   }
98894   __pyx_L3:;
98895
98896   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
98897   goto __pyx_L0;
98898   __pyx_L1_error:;
98899   __Pyx_XDECREF(__pyx_1);
98900   __Pyx_XDECREF(__pyx_t_2);
98901   __Pyx_XDECREF(__pyx_t_3);
98902   __Pyx_AddTraceback("lxml.etree._unwrapXPathObject");
98903   __pyx_r = 0;
98904   __pyx_L0:;
98905   __Pyx_DECREF(__pyx_v_stringval);
98906   __Pyx_XGIVEREF(__pyx_r);
98907   __Pyx_FinishRefcountContext();
98908   return __pyx_r;
98909 }
98910
98911 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":518
98912  *         raise XPathResultError, u"Unknown xpath result %s" % unicode(xpathObj.type)
98913  * 
98914  * cdef object _createNodeSetResult(xpath.xmlXPathObject* xpathObj, _Document doc,             # <<<<<<<<<<<<<<
98915  *                                  bint smart_string, bint is_fragment):
98916  *     cdef xmlNode* c_node
98917  */
98918
98919 static  PyObject *__pyx_f_4lxml_5etree__createNodeSetResult(xmlXPathObject *__pyx_v_xpathObj, struct LxmlDocument *__pyx_v_doc, int __pyx_v_smart_string, int __pyx_v_is_fragment) {
98920   xmlNode *__pyx_v_c_node;
98921   int __pyx_v_i;
98922   PyObject *__pyx_v_result;
98923   PyObject *__pyx_r = NULL;
98924   PyObject *__pyx_t_1 = NULL;
98925   int __pyx_t_2;
98926   int __pyx_t_3;
98927   __Pyx_SetupRefcountContext("_createNodeSetResult");
98928   __pyx_v_result = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
98929
98930   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":523
98931  *     cdef int i
98932  *     cdef list result
98933  *     result = []             # <<<<<<<<<<<<<<
98934  *     if xpathObj.nodesetval is NULL:
98935  *         return result
98936  */
98937   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98938   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
98939   __Pyx_DECREF(((PyObject *)__pyx_v_result));
98940   __pyx_v_result = __pyx_t_1;
98941   __pyx_t_1 = 0;
98942
98943   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":524
98944  *     cdef list result
98945  *     result = []
98946  *     if xpathObj.nodesetval is NULL:             # <<<<<<<<<<<<<<
98947  *         return result
98948  *     for i from 0 <= i < xpathObj.nodesetval.nodeNr:
98949  */
98950   __pyx_t_2 = (__pyx_v_xpathObj->nodesetval == NULL);
98951   if (__pyx_t_2) {
98952
98953     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":525
98954  *     result = []
98955  *     if xpathObj.nodesetval is NULL:
98956  *         return result             # <<<<<<<<<<<<<<
98957  *     for i from 0 <= i < xpathObj.nodesetval.nodeNr:
98958  *         c_node = xpathObj.nodesetval.nodeTab[i]
98959  */
98960     __Pyx_XDECREF(__pyx_r);
98961     __Pyx_INCREF(((PyObject *)__pyx_v_result));
98962     __pyx_r = ((PyObject *)__pyx_v_result);
98963     goto __pyx_L0;
98964     goto __pyx_L3;
98965   }
98966   __pyx_L3:;
98967
98968   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":526
98969  *     if xpathObj.nodesetval is NULL:
98970  *         return result
98971  *     for i from 0 <= i < xpathObj.nodesetval.nodeNr:             # <<<<<<<<<<<<<<
98972  *         c_node = xpathObj.nodesetval.nodeTab[i]
98973  *         _unpackNodeSetEntry(result, c_node, doc,
98974  */
98975   __pyx_t_3 = __pyx_v_xpathObj->nodesetval->nodeNr;
98976   for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
98977
98978     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":527
98979  *         return result
98980  *     for i from 0 <= i < xpathObj.nodesetval.nodeNr:
98981  *         c_node = xpathObj.nodesetval.nodeTab[i]             # <<<<<<<<<<<<<<
98982  *         _unpackNodeSetEntry(result, c_node, doc,
98983  *                             smart_string, is_fragment)
98984  */
98985     __pyx_v_c_node = (__pyx_v_xpathObj->nodesetval->nodeTab[__pyx_v_i]);
98986
98987     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":529
98988  *         c_node = xpathObj.nodesetval.nodeTab[i]
98989  *         _unpackNodeSetEntry(result, c_node, doc,
98990  *                             smart_string, is_fragment)             # <<<<<<<<<<<<<<
98991  *     return result
98992  * 
98993  */
98994     __pyx_t_1 = __pyx_f_4lxml_5etree__unpackNodeSetEntry(__pyx_v_result, __pyx_v_c_node, __pyx_v_doc, __pyx_v_smart_string, __pyx_v_is_fragment); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
98995     __Pyx_GOTREF(__pyx_t_1);
98996     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
98997   }
98998
98999   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":530
99000  *         _unpackNodeSetEntry(result, c_node, doc,
99001  *                             smart_string, is_fragment)
99002  *     return result             # <<<<<<<<<<<<<<
99003  * 
99004  * cdef _unpackNodeSetEntry(list results, xmlNode* c_node, _Document doc,
99005  */
99006   __Pyx_XDECREF(__pyx_r);
99007   __Pyx_INCREF(((PyObject *)__pyx_v_result));
99008   __pyx_r = ((PyObject *)__pyx_v_result);
99009   goto __pyx_L0;
99010
99011   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
99012   goto __pyx_L0;
99013   __pyx_L1_error:;
99014   __Pyx_XDECREF(__pyx_t_1);
99015   __Pyx_AddTraceback("lxml.etree._createNodeSetResult");
99016   __pyx_r = 0;
99017   __pyx_L0:;
99018   __Pyx_DECREF(__pyx_v_result);
99019   __Pyx_XGIVEREF(__pyx_r);
99020   __Pyx_FinishRefcountContext();
99021   return __pyx_r;
99022 }
99023
99024 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":532
99025  *     return result
99026  * 
99027  * cdef _unpackNodeSetEntry(list results, xmlNode* c_node, _Document doc,             # <<<<<<<<<<<<<<
99028  *                          bint smart_string, bint is_fragment):
99029  *     cdef xmlNode* c_child
99030  */
99031
99032 static  PyObject *__pyx_f_4lxml_5etree__unpackNodeSetEntry(PyObject *__pyx_v_results, xmlNode *__pyx_v_c_node, struct LxmlDocument *__pyx_v_doc, int __pyx_v_smart_string, int __pyx_v_is_fragment) {
99033   xmlNode *__pyx_v_c_child;
99034   char *__pyx_v_s;
99035   PyObject *__pyx_v_href;
99036   PyObject *__pyx_v_prefix;
99037   PyObject *__pyx_r = NULL;
99038   int __pyx_t_1;
99039   PyObject *__pyx_t_2 = NULL;
99040   int __pyx_t_3;
99041   int __pyx_t_4;
99042   PyObject *__pyx_t_5 = NULL;
99043   __Pyx_SetupRefcountContext("_unpackNodeSetEntry");
99044   __pyx_v_href = Py_None; __Pyx_INCREF(Py_None);
99045   __pyx_v_prefix = Py_None; __Pyx_INCREF(Py_None);
99046
99047   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":536
99048  *     cdef xmlNode* c_child
99049  *     cdef char* s
99050  *     if _isElement(c_node):             # <<<<<<<<<<<<<<
99051  *         if c_node.doc != doc._c_doc and c_node.doc._private is NULL:
99052  *             # XXX: works, but maybe not always the right thing to do?
99053  */
99054   __pyx_t_1 = _isElement(__pyx_v_c_node);
99055   if (__pyx_t_1) {
99056
99057     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":537
99058  *     cdef char* s
99059  *     if _isElement(c_node):
99060  *         if c_node.doc != doc._c_doc and c_node.doc._private is NULL:             # <<<<<<<<<<<<<<
99061  *             # XXX: works, but maybe not always the right thing to do?
99062  *             # XPath: only runs when extensions create or copy trees
99063  */
99064     if ((__pyx_v_c_node->doc != __pyx_v_doc->_c_doc)) {
99065       __pyx_t_1 = (__pyx_v_c_node->doc->_private == NULL);
99066     } else {
99067       __pyx_t_1 = (__pyx_v_c_node->doc != __pyx_v_doc->_c_doc);
99068     }
99069     if (__pyx_t_1) {
99070
99071       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":542
99072  *             #        -> we store Python refs to these, so that is OK
99073  *             # XSLT: can it leak when merging trees from multiple sources?
99074  *             c_node = tree.xmlDocCopyNode(c_node, doc._c_doc, 1)             # <<<<<<<<<<<<<<
99075  *         results.append(
99076  *             _fakeDocElementFactory(doc, c_node))
99077  */
99078       __pyx_v_c_node = xmlDocCopyNode(__pyx_v_c_node, __pyx_v_doc->_c_doc, 1);
99079       goto __pyx_L4;
99080     }
99081     __pyx_L4:;
99082
99083     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":544
99084  *             c_node = tree.xmlDocCopyNode(c_node, doc._c_doc, 1)
99085  *         results.append(
99086  *             _fakeDocElementFactory(doc, c_node))             # <<<<<<<<<<<<<<
99087  *     elif c_node.type == tree.XML_TEXT_NODE or \
99088  *              c_node.type == tree.XML_CDATA_SECTION_NODE or \
99089  */
99090     __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__fakeDocElementFactory(__pyx_v_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99091     __Pyx_GOTREF(__pyx_t_2);
99092     __pyx_t_3 = PyList_Append(((PyObject *)__pyx_v_results), __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99093     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
99094     goto __pyx_L3;
99095   }
99096
99097   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":545
99098  *         results.append(
99099  *             _fakeDocElementFactory(doc, c_node))
99100  *     elif c_node.type == tree.XML_TEXT_NODE or \             # <<<<<<<<<<<<<<
99101  *              c_node.type == tree.XML_CDATA_SECTION_NODE or \
99102  *              c_node.type == tree.XML_ATTRIBUTE_NODE:
99103  */
99104   if (!(__pyx_v_c_node->type == XML_TEXT_NODE)) {
99105
99106     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":546
99107  *             _fakeDocElementFactory(doc, c_node))
99108  *     elif c_node.type == tree.XML_TEXT_NODE or \
99109  *              c_node.type == tree.XML_CDATA_SECTION_NODE or \             # <<<<<<<<<<<<<<
99110  *              c_node.type == tree.XML_ATTRIBUTE_NODE:
99111  *         results.append(
99112  */
99113     if (!(__pyx_v_c_node->type == XML_CDATA_SECTION_NODE)) {
99114
99115       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":547
99116  *     elif c_node.type == tree.XML_TEXT_NODE or \
99117  *              c_node.type == tree.XML_CDATA_SECTION_NODE or \
99118  *              c_node.type == tree.XML_ATTRIBUTE_NODE:             # <<<<<<<<<<<<<<
99119  *         results.append(
99120  *             _buildElementStringResult(doc, c_node, smart_string))
99121  */
99122       __pyx_t_1 = (__pyx_v_c_node->type == XML_ATTRIBUTE_NODE);
99123     } else {
99124       __pyx_t_1 = (__pyx_v_c_node->type == XML_CDATA_SECTION_NODE);
99125     }
99126     __pyx_t_4 = __pyx_t_1;
99127   } else {
99128     __pyx_t_4 = (__pyx_v_c_node->type == XML_TEXT_NODE);
99129   }
99130   if (__pyx_t_4) {
99131
99132     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":549
99133  *              c_node.type == tree.XML_ATTRIBUTE_NODE:
99134  *         results.append(
99135  *             _buildElementStringResult(doc, c_node, smart_string))             # <<<<<<<<<<<<<<
99136  *     elif c_node.type == tree.XML_NAMESPACE_DECL:
99137  *         s = (<xmlNs*>c_node).href
99138  */
99139     __pyx_t_2 = __pyx_f_4lxml_5etree__buildElementStringResult(__pyx_v_doc, __pyx_v_c_node, __pyx_v_smart_string); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99140     __Pyx_GOTREF(__pyx_t_2);
99141     __pyx_t_3 = PyList_Append(((PyObject *)__pyx_v_results), __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99142     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
99143     goto __pyx_L3;
99144   }
99145
99146   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":550
99147  *         results.append(
99148  *             _buildElementStringResult(doc, c_node, smart_string))
99149  *     elif c_node.type == tree.XML_NAMESPACE_DECL:             # <<<<<<<<<<<<<<
99150  *         s = (<xmlNs*>c_node).href
99151  *         if s is NULL:
99152  */
99153   __pyx_t_4 = (__pyx_v_c_node->type == XML_NAMESPACE_DECL);
99154   if (__pyx_t_4) {
99155
99156     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":551
99157  *             _buildElementStringResult(doc, c_node, smart_string))
99158  *     elif c_node.type == tree.XML_NAMESPACE_DECL:
99159  *         s = (<xmlNs*>c_node).href             # <<<<<<<<<<<<<<
99160  *         if s is NULL:
99161  *             href = None
99162  */
99163     __pyx_v_s = ((xmlNs *)__pyx_v_c_node)->href;
99164
99165     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":552
99166  *     elif c_node.type == tree.XML_NAMESPACE_DECL:
99167  *         s = (<xmlNs*>c_node).href
99168  *         if s is NULL:             # <<<<<<<<<<<<<<
99169  *             href = None
99170  *         else:
99171  */
99172     __pyx_t_4 = (__pyx_v_s == NULL);
99173     if (__pyx_t_4) {
99174
99175       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":553
99176  *         s = (<xmlNs*>c_node).href
99177  *         if s is NULL:
99178  *             href = None             # <<<<<<<<<<<<<<
99179  *         else:
99180  *             href = funicode(s)
99181  */
99182       __Pyx_INCREF(Py_None);
99183       __Pyx_DECREF(__pyx_v_href);
99184       __pyx_v_href = Py_None;
99185       goto __pyx_L5;
99186     }
99187     /*else*/ {
99188
99189       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":555
99190  *             href = None
99191  *         else:
99192  *             href = funicode(s)             # <<<<<<<<<<<<<<
99193  *         s = (<xmlNs*>c_node).prefix
99194  *         if s is NULL:
99195  */
99196       __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99197       __Pyx_GOTREF(__pyx_t_2);
99198       __Pyx_DECREF(__pyx_v_href);
99199       __pyx_v_href = __pyx_t_2;
99200       __pyx_t_2 = 0;
99201     }
99202     __pyx_L5:;
99203
99204     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":556
99205  *         else:
99206  *             href = funicode(s)
99207  *         s = (<xmlNs*>c_node).prefix             # <<<<<<<<<<<<<<
99208  *         if s is NULL:
99209  *             prefix = None
99210  */
99211     __pyx_v_s = ((xmlNs *)__pyx_v_c_node)->prefix;
99212
99213     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":557
99214  *             href = funicode(s)
99215  *         s = (<xmlNs*>c_node).prefix
99216  *         if s is NULL:             # <<<<<<<<<<<<<<
99217  *             prefix = None
99218  *         else:
99219  */
99220     __pyx_t_4 = (__pyx_v_s == NULL);
99221     if (__pyx_t_4) {
99222
99223       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":558
99224  *         s = (<xmlNs*>c_node).prefix
99225  *         if s is NULL:
99226  *             prefix = None             # <<<<<<<<<<<<<<
99227  *         else:
99228  *             prefix = funicode(s)
99229  */
99230       __Pyx_INCREF(Py_None);
99231       __Pyx_DECREF(__pyx_v_prefix);
99232       __pyx_v_prefix = Py_None;
99233       goto __pyx_L6;
99234     }
99235     /*else*/ {
99236
99237       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":560
99238  *             prefix = None
99239  *         else:
99240  *             prefix = funicode(s)             # <<<<<<<<<<<<<<
99241  *         results.append( (prefix, href) )
99242  *     elif c_node.type == tree.XML_DOCUMENT_NODE or \
99243  */
99244       __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99245       __Pyx_GOTREF(__pyx_t_2);
99246       __Pyx_DECREF(__pyx_v_prefix);
99247       __pyx_v_prefix = __pyx_t_2;
99248       __pyx_t_2 = 0;
99249     }
99250     __pyx_L6:;
99251
99252     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":561
99253  *         else:
99254  *             prefix = funicode(s)
99255  *         results.append( (prefix, href) )             # <<<<<<<<<<<<<<
99256  *     elif c_node.type == tree.XML_DOCUMENT_NODE or \
99257  *             c_node.type == tree.XML_HTML_DOCUMENT_NODE:
99258  */
99259     __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99260     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
99261     __Pyx_INCREF(__pyx_v_prefix);
99262     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_prefix);
99263     __Pyx_GIVEREF(__pyx_v_prefix);
99264     __Pyx_INCREF(__pyx_v_href);
99265     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_href);
99266     __Pyx_GIVEREF(__pyx_v_href);
99267     __pyx_t_3 = PyList_Append(((PyObject *)__pyx_v_results), ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99268     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
99269     goto __pyx_L3;
99270   }
99271
99272   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":562
99273  *             prefix = funicode(s)
99274  *         results.append( (prefix, href) )
99275  *     elif c_node.type == tree.XML_DOCUMENT_NODE or \             # <<<<<<<<<<<<<<
99276  *             c_node.type == tree.XML_HTML_DOCUMENT_NODE:
99277  *         # ignored for everything but result tree fragments
99278  */
99279   if (!(__pyx_v_c_node->type == XML_DOCUMENT_NODE)) {
99280
99281     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":563
99282  *         results.append( (prefix, href) )
99283  *     elif c_node.type == tree.XML_DOCUMENT_NODE or \
99284  *             c_node.type == tree.XML_HTML_DOCUMENT_NODE:             # <<<<<<<<<<<<<<
99285  *         # ignored for everything but result tree fragments
99286  *         if is_fragment:
99287  */
99288     __pyx_t_4 = (__pyx_v_c_node->type == XML_HTML_DOCUMENT_NODE);
99289   } else {
99290     __pyx_t_4 = (__pyx_v_c_node->type == XML_DOCUMENT_NODE);
99291   }
99292   if (__pyx_t_4) {
99293
99294     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":565
99295  *             c_node.type == tree.XML_HTML_DOCUMENT_NODE:
99296  *         # ignored for everything but result tree fragments
99297  *         if is_fragment:             # <<<<<<<<<<<<<<
99298  *             c_child = c_node.children
99299  *             while c_child is not NULL:
99300  */
99301     __pyx_t_4 = __pyx_v_is_fragment;
99302     if (__pyx_t_4) {
99303
99304       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":566
99305  *         # ignored for everything but result tree fragments
99306  *         if is_fragment:
99307  *             c_child = c_node.children             # <<<<<<<<<<<<<<
99308  *             while c_child is not NULL:
99309  *                 _unpackNodeSetEntry(results, c_child, doc,
99310  */
99311       __pyx_v_c_child = __pyx_v_c_node->children;
99312
99313       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":567
99314  *         if is_fragment:
99315  *             c_child = c_node.children
99316  *             while c_child is not NULL:             # <<<<<<<<<<<<<<
99317  *                 _unpackNodeSetEntry(results, c_child, doc,
99318  *                                     smart_string, is_fragment)
99319  */
99320       while (1) {
99321         __pyx_t_4 = (__pyx_v_c_child != NULL);
99322         if (!__pyx_t_4) break;
99323
99324         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":569
99325  *             while c_child is not NULL:
99326  *                 _unpackNodeSetEntry(results, c_child, doc,
99327  *                                     smart_string, is_fragment)             # <<<<<<<<<<<<<<
99328  *                 c_child = c_child.next
99329  *     elif c_node.type == tree.XML_XINCLUDE_START or \
99330  */
99331         __pyx_t_2 = __pyx_f_4lxml_5etree__unpackNodeSetEntry(__pyx_v_results, __pyx_v_c_child, __pyx_v_doc, __pyx_v_smart_string, __pyx_v_is_fragment); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99332         __Pyx_GOTREF(__pyx_t_2);
99333         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
99334
99335         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":570
99336  *                 _unpackNodeSetEntry(results, c_child, doc,
99337  *                                     smart_string, is_fragment)
99338  *                 c_child = c_child.next             # <<<<<<<<<<<<<<
99339  *     elif c_node.type == tree.XML_XINCLUDE_START or \
99340  *             c_node.type == tree.XML_XINCLUDE_END:
99341  */
99342         __pyx_v_c_child = __pyx_v_c_child->next;
99343       }
99344       goto __pyx_L7;
99345     }
99346     __pyx_L7:;
99347     goto __pyx_L3;
99348   }
99349
99350   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":571
99351  *                                     smart_string, is_fragment)
99352  *                 c_child = c_child.next
99353  *     elif c_node.type == tree.XML_XINCLUDE_START or \             # <<<<<<<<<<<<<<
99354  *             c_node.type == tree.XML_XINCLUDE_END:
99355  *         pass
99356  */
99357   if (!(__pyx_v_c_node->type == XML_XINCLUDE_START)) {
99358
99359     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":572
99360  *                 c_child = c_child.next
99361  *     elif c_node.type == tree.XML_XINCLUDE_START or \
99362  *             c_node.type == tree.XML_XINCLUDE_END:             # <<<<<<<<<<<<<<
99363  *         pass
99364  *     else:
99365  */
99366     __pyx_t_4 = (__pyx_v_c_node->type == XML_XINCLUDE_END);
99367   } else {
99368     __pyx_t_4 = (__pyx_v_c_node->type == XML_XINCLUDE_START);
99369   }
99370   if (__pyx_t_4) {
99371     goto __pyx_L3;
99372   }
99373   /*else*/ {
99374
99375     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":576
99376  *     else:
99377  *         raise NotImplementedError, \
99378  *             u"Not yet implemented result node type: %d" % c_node.type             # <<<<<<<<<<<<<<
99379  * 
99380  * cdef void _freeXPathObject(xpath.xmlXPathObject* xpathObj):
99381  */
99382     __pyx_t_2 = PyInt_FromLong(__pyx_v_c_node->type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99383     __Pyx_GOTREF(__pyx_t_2);
99384     __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_588), __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99385     __Pyx_GOTREF(__pyx_t_5);
99386     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
99387     __Pyx_Raise(__pyx_builtin_NotImplementedError, __pyx_t_5, 0);
99388     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
99389     {__pyx_filename = __pyx_f[5]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99390   }
99391   __pyx_L3:;
99392
99393   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
99394   goto __pyx_L0;
99395   __pyx_L1_error:;
99396   __Pyx_XDECREF(__pyx_t_2);
99397   __Pyx_XDECREF(__pyx_t_5);
99398   __Pyx_AddTraceback("lxml.etree._unpackNodeSetEntry");
99399   __pyx_r = 0;
99400   __pyx_L0:;
99401   __Pyx_DECREF(__pyx_v_href);
99402   __Pyx_DECREF(__pyx_v_prefix);
99403   __Pyx_XGIVEREF(__pyx_r);
99404   __Pyx_FinishRefcountContext();
99405   return __pyx_r;
99406 }
99407
99408 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":578
99409  *             u"Not yet implemented result node type: %d" % c_node.type
99410  * 
99411  * cdef void _freeXPathObject(xpath.xmlXPathObject* xpathObj):             # <<<<<<<<<<<<<<
99412  *     u"""Free the XPath object, but *never* free the *content* of node sets.
99413  *     Python dealloc will do that for us.
99414  */
99415
99416 static  void __pyx_f_4lxml_5etree__freeXPathObject(xmlXPathObject *__pyx_v_xpathObj) {
99417   int __pyx_t_1;
99418   __Pyx_SetupRefcountContext("_freeXPathObject");
99419
99420   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":582
99421  *     Python dealloc will do that for us.
99422  *     """
99423  *     if xpathObj.nodesetval is not NULL:             # <<<<<<<<<<<<<<
99424  *         xpath.xmlXPathFreeNodeSet(xpathObj.nodesetval)
99425  *         xpathObj.nodesetval = NULL
99426  */
99427   __pyx_t_1 = (__pyx_v_xpathObj->nodesetval != NULL);
99428   if (__pyx_t_1) {
99429
99430     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":583
99431  *     """
99432  *     if xpathObj.nodesetval is not NULL:
99433  *         xpath.xmlXPathFreeNodeSet(xpathObj.nodesetval)             # <<<<<<<<<<<<<<
99434  *         xpathObj.nodesetval = NULL
99435  *     xpath.xmlXPathFreeObject(xpathObj)
99436  */
99437     xmlXPathFreeNodeSet(__pyx_v_xpathObj->nodesetval);
99438
99439     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":584
99440  *     if xpathObj.nodesetval is not NULL:
99441  *         xpath.xmlXPathFreeNodeSet(xpathObj.nodesetval)
99442  *         xpathObj.nodesetval = NULL             # <<<<<<<<<<<<<<
99443  *     xpath.xmlXPathFreeObject(xpathObj)
99444  * 
99445  */
99446     __pyx_v_xpathObj->nodesetval = NULL;
99447     goto __pyx_L3;
99448   }
99449   __pyx_L3:;
99450
99451   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":585
99452  *         xpath.xmlXPathFreeNodeSet(xpathObj.nodesetval)
99453  *         xpathObj.nodesetval = NULL
99454  *     xpath.xmlXPathFreeObject(xpathObj)             # <<<<<<<<<<<<<<
99455  * 
99456  * ################################################################################
99457  */
99458   xmlXPathFreeObject(__pyx_v_xpathObj);
99459
99460   __Pyx_FinishRefcountContext();
99461 }
99462
99463 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":596
99464  *     cdef readonly object is_attribute
99465  * 
99466  *     def getparent(self):             # <<<<<<<<<<<<<<
99467  *         return self._parent
99468  * 
99469  */
99470
99471 static PyObject *__pyx_pf_4lxml_5etree_21_ElementUnicodeResult_getparent(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
99472 static PyObject *__pyx_pf_4lxml_5etree_21_ElementUnicodeResult_getparent(PyObject *__pyx_v_self, PyObject *unused) {
99473   PyObject *__pyx_r = NULL;
99474   __Pyx_SetupRefcountContext("getparent");
99475
99476   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":597
99477  * 
99478  *     def getparent(self):
99479  *         return self._parent             # <<<<<<<<<<<<<<
99480  * 
99481  * class _ElementStringResult(str):
99482  */
99483   __Pyx_XDECREF(__pyx_r);
99484   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__ElementUnicodeResult *)__pyx_v_self)->_parent));
99485   __pyx_r = ((PyObject *)((struct __pyx_obj_4lxml_5etree__ElementUnicodeResult *)__pyx_v_self)->_parent);
99486   goto __pyx_L0;
99487
99488   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
99489   __pyx_L0:;
99490   __Pyx_XGIVEREF(__pyx_r);
99491   __Pyx_FinishRefcountContext();
99492   return __pyx_r;
99493 }
99494
99495 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":602
99496  *     # we need to use a Python class here, str cannot be C-subclassed
99497  *     # in Pyrex/Cython
99498  *     def getparent(self):             # <<<<<<<<<<<<<<
99499  *         return self._parent
99500  * 
99501  */
99502
99503 static PyObject *__pyx_pf_4lxml_5etree_20_ElementStringResult_getparent(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
99504 static PyMethodDef __pyx_mdef_4lxml_5etree_20_ElementStringResult_getparent = {__Pyx_NAMESTR("getparent"), (PyCFunction)__pyx_pf_4lxml_5etree_20_ElementStringResult_getparent, METH_O, __Pyx_DOCSTR(0)};
99505 static PyObject *__pyx_pf_4lxml_5etree_20_ElementStringResult_getparent(PyObject *__pyx_self, PyObject *__pyx_v_self) {
99506   PyObject *__pyx_r = NULL;
99507   PyObject *__pyx_t_1 = NULL;
99508   __Pyx_SetupRefcountContext("getparent");
99509   __pyx_self = __pyx_self;
99510
99511   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":603
99512  *     # in Pyrex/Cython
99513  *     def getparent(self):
99514  *         return self._parent             # <<<<<<<<<<<<<<
99515  * 
99516  * cdef object _elementStringResultFactory(string_value, _Element parent,
99517  */
99518   __Pyx_XDECREF(__pyx_r);
99519   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp__parent); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99520   __Pyx_GOTREF(__pyx_t_1);
99521   __pyx_r = __pyx_t_1;
99522   __pyx_t_1 = 0;
99523   goto __pyx_L0;
99524
99525   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
99526   goto __pyx_L0;
99527   __pyx_L1_error:;
99528   __Pyx_XDECREF(__pyx_t_1);
99529   __Pyx_AddTraceback("lxml.etree._ElementStringResult.getparent");
99530   __pyx_r = NULL;
99531   __pyx_L0:;
99532   __Pyx_XGIVEREF(__pyx_r);
99533   __Pyx_FinishRefcountContext();
99534   return __pyx_r;
99535 }
99536
99537 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":605
99538  *         return self._parent
99539  * 
99540  * cdef object _elementStringResultFactory(string_value, _Element parent,             # <<<<<<<<<<<<<<
99541  *                                         bint is_attribute, bint is_tail):
99542  *     cdef _ElementUnicodeResult uresult
99543  */
99544
99545 static  PyObject *__pyx_f_4lxml_5etree__elementStringResultFactory(PyObject *__pyx_v_string_value, struct LxmlElement *__pyx_v_parent, int __pyx_v_is_attribute, int __pyx_v_is_tail) {
99546   struct __pyx_obj_4lxml_5etree__ElementUnicodeResult *__pyx_v_uresult;
99547   int __pyx_v_is_text;
99548   PyObject *__pyx_v_result;
99549   PyObject *__pyx_r = NULL;
99550   PyObject *__pyx_1 = 0;
99551   int __pyx_t_1;
99552   PyObject *__pyx_t_2 = NULL;
99553   PyObject *__pyx_t_3 = NULL;
99554   __Pyx_SetupRefcountContext("_elementStringResultFactory");
99555   __pyx_v_uresult = ((struct __pyx_obj_4lxml_5etree__ElementUnicodeResult *)Py_None); __Pyx_INCREF(Py_None);
99556   __pyx_v_result = Py_None; __Pyx_INCREF(Py_None);
99557
99558   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":609
99559  *     cdef _ElementUnicodeResult uresult
99560  *     cdef bint is_text
99561  *     if parent is None:             # <<<<<<<<<<<<<<
99562  *         is_text = 0
99563  *     else:
99564  */
99565   __pyx_t_1 = (((PyObject *)__pyx_v_parent) == Py_None);
99566   if (__pyx_t_1) {
99567
99568     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":610
99569  *     cdef bint is_text
99570  *     if parent is None:
99571  *         is_text = 0             # <<<<<<<<<<<<<<
99572  *     else:
99573  *         is_text = not (is_tail or is_attribute)
99574  */
99575     __pyx_v_is_text = 0;
99576     goto __pyx_L3;
99577   }
99578   /*else*/ {
99579
99580     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":612
99581  *         is_text = 0
99582  *     else:
99583  *         is_text = not (is_tail or is_attribute)             # <<<<<<<<<<<<<<
99584  * 
99585  *     if python.PyString_CheckExact(string_value):
99586  */
99587     if (!__pyx_v_is_tail) {
99588       __pyx_t_1 = __pyx_v_is_attribute;
99589     } else {
99590       __pyx_t_1 = __pyx_v_is_tail;
99591     }
99592     __pyx_v_is_text = (!__pyx_t_1);
99593   }
99594   __pyx_L3:;
99595
99596   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":614
99597  *         is_text = not (is_tail or is_attribute)
99598  * 
99599  *     if python.PyString_CheckExact(string_value):             # <<<<<<<<<<<<<<
99600  *         result = _ElementStringResult(string_value)
99601  *         result._parent = parent
99602  */
99603   __pyx_t_1 = PyString_CheckExact(__pyx_v_string_value);
99604   if (__pyx_t_1) {
99605
99606     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":615
99607  * 
99608  *     if python.PyString_CheckExact(string_value):
99609  *         result = _ElementStringResult(string_value)             # <<<<<<<<<<<<<<
99610  *         result._parent = parent
99611  *         result.is_attribute = is_attribute
99612  */
99613     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_174); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99614     __Pyx_GOTREF(__pyx_1);
99615     __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99616     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
99617     __Pyx_INCREF(__pyx_v_string_value);
99618     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_string_value);
99619     __Pyx_GIVEREF(__pyx_v_string_value);
99620     __pyx_t_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99621     __Pyx_GOTREF(__pyx_t_3);
99622     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
99623     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
99624     __Pyx_DECREF(__pyx_v_result);
99625     __pyx_v_result = __pyx_t_3;
99626     __pyx_t_3 = 0;
99627
99628     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":616
99629  *     if python.PyString_CheckExact(string_value):
99630  *         result = _ElementStringResult(string_value)
99631  *         result._parent = parent             # <<<<<<<<<<<<<<
99632  *         result.is_attribute = is_attribute
99633  *         result.is_tail = is_tail
99634  */
99635     if (PyObject_SetAttr(__pyx_v_result, __pyx_kp__parent, ((PyObject *)__pyx_v_parent)) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99636
99637     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":617
99638  *         result = _ElementStringResult(string_value)
99639  *         result._parent = parent
99640  *         result.is_attribute = is_attribute             # <<<<<<<<<<<<<<
99641  *         result.is_tail = is_tail
99642  *         result.is_text = is_text
99643  */
99644     __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_is_attribute); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99645     __Pyx_GOTREF(__pyx_t_3);
99646     if (PyObject_SetAttr(__pyx_v_result, __pyx_kp_is_attribute, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99647     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
99648
99649     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":618
99650  *         result._parent = parent
99651  *         result.is_attribute = is_attribute
99652  *         result.is_tail = is_tail             # <<<<<<<<<<<<<<
99653  *         result.is_text = is_text
99654  *         return result
99655  */
99656     __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_is_tail); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99657     __Pyx_GOTREF(__pyx_t_3);
99658     if (PyObject_SetAttr(__pyx_v_result, __pyx_kp_is_tail, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99659     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
99660
99661     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":619
99662  *         result.is_attribute = is_attribute
99663  *         result.is_tail = is_tail
99664  *         result.is_text = is_text             # <<<<<<<<<<<<<<
99665  *         return result
99666  *     else:
99667  */
99668     __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_is_text); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99669     __Pyx_GOTREF(__pyx_t_3);
99670     if (PyObject_SetAttr(__pyx_v_result, __pyx_kp_is_text, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99671     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
99672
99673     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":620
99674  *         result.is_tail = is_tail
99675  *         result.is_text = is_text
99676  *         return result             # <<<<<<<<<<<<<<
99677  *     else:
99678  *         uresult = _ElementUnicodeResult(string_value)
99679  */
99680     __Pyx_XDECREF(__pyx_r);
99681     __Pyx_INCREF(__pyx_v_result);
99682     __pyx_r = __pyx_v_result;
99683     goto __pyx_L0;
99684     goto __pyx_L4;
99685   }
99686   /*else*/ {
99687
99688     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":622
99689  *         return result
99690  *     else:
99691  *         uresult = _ElementUnicodeResult(string_value)             # <<<<<<<<<<<<<<
99692  *         uresult._parent = parent
99693  *         uresult.is_attribute = is_attribute
99694  */
99695     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99696     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
99697     __Pyx_INCREF(__pyx_v_string_value);
99698     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_string_value);
99699     __Pyx_GIVEREF(__pyx_v_string_value);
99700     __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ElementUnicodeResult)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99701     __Pyx_GOTREF(__pyx_t_2);
99702     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
99703     if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__ElementUnicodeResult))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99704     __Pyx_DECREF(((PyObject *)__pyx_v_uresult));
99705     __pyx_v_uresult = ((struct __pyx_obj_4lxml_5etree__ElementUnicodeResult *)__pyx_t_2);
99706     __pyx_t_2 = 0;
99707
99708     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":623
99709  *     else:
99710  *         uresult = _ElementUnicodeResult(string_value)
99711  *         uresult._parent = parent             # <<<<<<<<<<<<<<
99712  *         uresult.is_attribute = is_attribute
99713  *         uresult.is_tail = is_tail
99714  */
99715     __Pyx_INCREF(((PyObject *)__pyx_v_parent));
99716     __Pyx_GIVEREF(((PyObject *)__pyx_v_parent));
99717     __Pyx_GOTREF(__pyx_v_uresult->_parent);
99718     __Pyx_DECREF(((PyObject *)__pyx_v_uresult->_parent));
99719     __pyx_v_uresult->_parent = __pyx_v_parent;
99720
99721     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":624
99722  *         uresult = _ElementUnicodeResult(string_value)
99723  *         uresult._parent = parent
99724  *         uresult.is_attribute = is_attribute             # <<<<<<<<<<<<<<
99725  *         uresult.is_tail = is_tail
99726  *         uresult.is_text = is_text
99727  */
99728     __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_is_attribute); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99729     __Pyx_GOTREF(__pyx_t_2);
99730     __Pyx_GIVEREF(__pyx_t_2);
99731     __Pyx_GOTREF(__pyx_v_uresult->is_attribute);
99732     __Pyx_DECREF(__pyx_v_uresult->is_attribute);
99733     __pyx_v_uresult->is_attribute = __pyx_t_2;
99734     __pyx_t_2 = 0;
99735
99736     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":625
99737  *         uresult._parent = parent
99738  *         uresult.is_attribute = is_attribute
99739  *         uresult.is_tail = is_tail             # <<<<<<<<<<<<<<
99740  *         uresult.is_text = is_text
99741  *         return uresult
99742  */
99743     __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_is_tail); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99744     __Pyx_GOTREF(__pyx_t_2);
99745     __Pyx_GIVEREF(__pyx_t_2);
99746     __Pyx_GOTREF(__pyx_v_uresult->is_tail);
99747     __Pyx_DECREF(__pyx_v_uresult->is_tail);
99748     __pyx_v_uresult->is_tail = __pyx_t_2;
99749     __pyx_t_2 = 0;
99750
99751     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":626
99752  *         uresult.is_attribute = is_attribute
99753  *         uresult.is_tail = is_tail
99754  *         uresult.is_text = is_text             # <<<<<<<<<<<<<<
99755  *         return uresult
99756  * 
99757  */
99758     __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_is_text); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99759     __Pyx_GOTREF(__pyx_t_2);
99760     __Pyx_GIVEREF(__pyx_t_2);
99761     __Pyx_GOTREF(__pyx_v_uresult->is_text);
99762     __Pyx_DECREF(__pyx_v_uresult->is_text);
99763     __pyx_v_uresult->is_text = __pyx_t_2;
99764     __pyx_t_2 = 0;
99765
99766     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":627
99767  *         uresult.is_tail = is_tail
99768  *         uresult.is_text = is_text
99769  *         return uresult             # <<<<<<<<<<<<<<
99770  * 
99771  * cdef object _buildElementStringResult(_Document doc, xmlNode* c_node,
99772  */
99773     __Pyx_XDECREF(__pyx_r);
99774     __Pyx_INCREF(((PyObject *)__pyx_v_uresult));
99775     __pyx_r = ((PyObject *)__pyx_v_uresult);
99776     goto __pyx_L0;
99777   }
99778   __pyx_L4:;
99779
99780   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
99781   goto __pyx_L0;
99782   __pyx_L1_error:;
99783   __Pyx_XDECREF(__pyx_1);
99784   __Pyx_XDECREF(__pyx_t_2);
99785   __Pyx_XDECREF(__pyx_t_3);
99786   __Pyx_AddTraceback("lxml.etree._elementStringResultFactory");
99787   __pyx_r = 0;
99788   __pyx_L0:;
99789   __Pyx_DECREF((PyObject *)__pyx_v_uresult);
99790   __Pyx_DECREF(__pyx_v_result);
99791   __Pyx_XGIVEREF(__pyx_r);
99792   __Pyx_FinishRefcountContext();
99793   return __pyx_r;
99794 }
99795
99796 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":629
99797  *         return uresult
99798  * 
99799  * cdef object _buildElementStringResult(_Document doc, xmlNode* c_node,             # <<<<<<<<<<<<<<
99800  *                                       bint smart_string):
99801  *     cdef _Element parent
99802  */
99803
99804 static  PyObject *__pyx_f_4lxml_5etree__buildElementStringResult(struct LxmlDocument *__pyx_v_doc, xmlNode *__pyx_v_c_node, int __pyx_v_smart_string) {
99805   struct LxmlElement *__pyx_v_parent;
99806   xmlNode *__pyx_v_c_element;
99807   char *__pyx_v_s;
99808   int __pyx_v_is_attribute;
99809   int __pyx_v_is_tail;
99810   PyObject *__pyx_v_value;
99811   PyObject *__pyx_r = NULL;
99812   int __pyx_t_1;
99813   PyObject *__pyx_t_2 = NULL;
99814   __Pyx_SetupRefcountContext("_buildElementStringResult");
99815   __pyx_v_parent = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
99816   __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);
99817
99818   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":636
99819  *     cdef bint is_attribute, is_text, is_tail
99820  * 
99821  *     if c_node.type == tree.XML_ATTRIBUTE_NODE:             # <<<<<<<<<<<<<<
99822  *         is_attribute = 1
99823  *         is_tail = 0
99824  */
99825   __pyx_t_1 = (__pyx_v_c_node->type == XML_ATTRIBUTE_NODE);
99826   if (__pyx_t_1) {
99827
99828     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":637
99829  * 
99830  *     if c_node.type == tree.XML_ATTRIBUTE_NODE:
99831  *         is_attribute = 1             # <<<<<<<<<<<<<<
99832  *         is_tail = 0
99833  *         s = tree.xmlNodeGetContent(c_node)
99834  */
99835     __pyx_v_is_attribute = 1;
99836
99837     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":638
99838  *     if c_node.type == tree.XML_ATTRIBUTE_NODE:
99839  *         is_attribute = 1
99840  *         is_tail = 0             # <<<<<<<<<<<<<<
99841  *         s = tree.xmlNodeGetContent(c_node)
99842  *         try:
99843  */
99844     __pyx_v_is_tail = 0;
99845
99846     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":639
99847  *         is_attribute = 1
99848  *         is_tail = 0
99849  *         s = tree.xmlNodeGetContent(c_node)             # <<<<<<<<<<<<<<
99850  *         try:
99851  *             value = funicode(s)
99852  */
99853     __pyx_v_s = xmlNodeGetContent(__pyx_v_c_node);
99854
99855     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":640
99856  *         is_tail = 0
99857  *         s = tree.xmlNodeGetContent(c_node)
99858  *         try:             # <<<<<<<<<<<<<<
99859  *             value = funicode(s)
99860  *         finally:
99861  */
99862     /*try:*/ {
99863
99864       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":641
99865  *         s = tree.xmlNodeGetContent(c_node)
99866  *         try:
99867  *             value = funicode(s)             # <<<<<<<<<<<<<<
99868  *         finally:
99869  *             tree.xmlFree(s)
99870  */
99871       __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L5;}
99872       __Pyx_GOTREF(__pyx_t_2);
99873       __Pyx_DECREF(__pyx_v_value);
99874       __pyx_v_value = __pyx_t_2;
99875       __pyx_t_2 = 0;
99876     }
99877     /*finally:*/ {
99878       int __pyx_why;
99879       PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
99880       int __pyx_exc_lineno;
99881       __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
99882       __pyx_why = 0; goto __pyx_L6;
99883       __pyx_L5: {
99884         __pyx_why = 4;
99885         __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
99886         __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
99887         __pyx_exc_lineno = __pyx_lineno;
99888         goto __pyx_L6;
99889       }
99890       __pyx_L6:;
99891
99892       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":643
99893  *             value = funicode(s)
99894  *         finally:
99895  *             tree.xmlFree(s)             # <<<<<<<<<<<<<<
99896  *         c_element = NULL
99897  *     else:
99898  */
99899       xmlFree(__pyx_v_s);
99900       switch (__pyx_why) {
99901         case 4: {
99902           __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
99903           __pyx_lineno = __pyx_exc_lineno;
99904           __pyx_exc_type = 0;
99905           __pyx_exc_value = 0;
99906           __pyx_exc_tb = 0;
99907           goto __pyx_L1_error;
99908         }
99909       }
99910     }
99911
99912     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":644
99913  *         finally:
99914  *             tree.xmlFree(s)
99915  *         c_element = NULL             # <<<<<<<<<<<<<<
99916  *     else:
99917  *         #assert c_node.type == tree.XML_TEXT_NODE or c_node.type == tree.XML_CDATA_SECTION_NODE, "invalid node type"
99918  */
99919     __pyx_v_c_element = NULL;
99920     goto __pyx_L3;
99921   }
99922   /*else*/ {
99923
99924     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":647
99925  *     else:
99926  *         #assert c_node.type == tree.XML_TEXT_NODE or c_node.type == tree.XML_CDATA_SECTION_NODE, "invalid node type"
99927  *         is_attribute = 0             # <<<<<<<<<<<<<<
99928  *         # may be tail text or normal text
99929  *         value = funicode(c_node.content)
99930  */
99931     __pyx_v_is_attribute = 0;
99932
99933     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":649
99934  *         is_attribute = 0
99935  *         # may be tail text or normal text
99936  *         value = funicode(c_node.content)             # <<<<<<<<<<<<<<
99937  *         c_element = _previousElement(c_node)
99938  *         is_tail = c_element is not NULL
99939  */
99940     __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_node->content); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
99941     __Pyx_GOTREF(__pyx_t_2);
99942     __Pyx_DECREF(__pyx_v_value);
99943     __pyx_v_value = __pyx_t_2;
99944     __pyx_t_2 = 0;
99945
99946     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":650
99947  *         # may be tail text or normal text
99948  *         value = funicode(c_node.content)
99949  *         c_element = _previousElement(c_node)             # <<<<<<<<<<<<<<
99950  *         is_tail = c_element is not NULL
99951  * 
99952  */
99953     __pyx_v_c_element = __pyx_f_4lxml_5etree__previousElement(__pyx_v_c_node);
99954
99955     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":651
99956  *         value = funicode(c_node.content)
99957  *         c_element = _previousElement(c_node)
99958  *         is_tail = c_element is not NULL             # <<<<<<<<<<<<<<
99959  * 
99960  *     if not smart_string:
99961  */
99962     __pyx_v_is_tail = (__pyx_v_c_element != NULL);
99963   }
99964   __pyx_L3:;
99965
99966   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":653
99967  *         is_tail = c_element is not NULL
99968  * 
99969  *     if not smart_string:             # <<<<<<<<<<<<<<
99970  *         return value
99971  * 
99972  */
99973   __pyx_t_1 = (!__pyx_v_smart_string);
99974   if (__pyx_t_1) {
99975
99976     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":654
99977  * 
99978  *     if not smart_string:
99979  *         return value             # <<<<<<<<<<<<<<
99980  * 
99981  *     if c_element is NULL:
99982  */
99983     __Pyx_XDECREF(__pyx_r);
99984     __Pyx_INCREF(__pyx_v_value);
99985     __pyx_r = __pyx_v_value;
99986     goto __pyx_L0;
99987     goto __pyx_L8;
99988   }
99989   __pyx_L8:;
99990
99991   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":656
99992  *         return value
99993  * 
99994  *     if c_element is NULL:             # <<<<<<<<<<<<<<
99995  *         # non-tail text or attribute text
99996  *         c_element = c_node.parent
99997  */
99998   __pyx_t_1 = (__pyx_v_c_element == NULL);
99999   if (__pyx_t_1) {
100000
100001     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":658
100002  *     if c_element is NULL:
100003  *         # non-tail text or attribute text
100004  *         c_element = c_node.parent             # <<<<<<<<<<<<<<
100005  *         while c_element is not NULL and not _isElement(c_element):
100006  *             c_element = c_element.parent
100007  */
100008     __pyx_v_c_element = __pyx_v_c_node->parent;
100009
100010     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":659
100011  *         # non-tail text or attribute text
100012  *         c_element = c_node.parent
100013  *         while c_element is not NULL and not _isElement(c_element):             # <<<<<<<<<<<<<<
100014  *             c_element = c_element.parent
100015  * 
100016  */
100017     while (1) {
100018       if ((__pyx_v_c_element != NULL)) {
100019         __pyx_t_1 = (!_isElement(__pyx_v_c_element));
100020       } else {
100021         __pyx_t_1 = (__pyx_v_c_element != NULL);
100022       }
100023       if (!__pyx_t_1) break;
100024
100025       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":660
100026  *         c_element = c_node.parent
100027  *         while c_element is not NULL and not _isElement(c_element):
100028  *             c_element = c_element.parent             # <<<<<<<<<<<<<<
100029  * 
100030  *     if c_element is not NULL:
100031  */
100032       __pyx_v_c_element = __pyx_v_c_element->parent;
100033     }
100034     goto __pyx_L9;
100035   }
100036   __pyx_L9:;
100037
100038   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":662
100039  *             c_element = c_element.parent
100040  * 
100041  *     if c_element is not NULL:             # <<<<<<<<<<<<<<
100042  *         parent = _fakeDocElementFactory(doc, c_element)
100043  * 
100044  */
100045   __pyx_t_1 = (__pyx_v_c_element != NULL);
100046   if (__pyx_t_1) {
100047
100048     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":663
100049  * 
100050  *     if c_element is not NULL:
100051  *         parent = _fakeDocElementFactory(doc, c_element)             # <<<<<<<<<<<<<<
100052  * 
100053  *     return _elementStringResultFactory(
100054  */
100055     __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__fakeDocElementFactory(__pyx_v_doc, __pyx_v_c_element)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
100056     __Pyx_GOTREF(__pyx_t_2);
100057     __Pyx_DECREF(((PyObject *)__pyx_v_parent));
100058     __pyx_v_parent = ((struct LxmlElement *)__pyx_t_2);
100059     __pyx_t_2 = 0;
100060     goto __pyx_L12;
100061   }
100062   __pyx_L12:;
100063
100064   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":665
100065  *         parent = _fakeDocElementFactory(doc, c_element)
100066  * 
100067  *     return _elementStringResultFactory(             # <<<<<<<<<<<<<<
100068  *         value, parent, is_attribute, is_tail)
100069  * 
100070  */
100071   __Pyx_XDECREF(__pyx_r);
100072
100073   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":666
100074  * 
100075  *     return _elementStringResultFactory(
100076  *         value, parent, is_attribute, is_tail)             # <<<<<<<<<<<<<<
100077  * 
100078  * 
100079  */
100080   __pyx_t_2 = __pyx_f_4lxml_5etree__elementStringResultFactory(__pyx_v_value, __pyx_v_parent, __pyx_v_is_attribute, __pyx_v_is_tail); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
100081   __Pyx_GOTREF(__pyx_t_2);
100082   __pyx_r = __pyx_t_2;
100083   __pyx_t_2 = 0;
100084   goto __pyx_L0;
100085
100086   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
100087   goto __pyx_L0;
100088   __pyx_L1_error:;
100089   __Pyx_XDECREF(__pyx_t_2);
100090   __Pyx_AddTraceback("lxml.etree._buildElementStringResult");
100091   __pyx_r = 0;
100092   __pyx_L0:;
100093   __Pyx_DECREF((PyObject *)__pyx_v_parent);
100094   __Pyx_DECREF(__pyx_v_value);
100095   __Pyx_XGIVEREF(__pyx_r);
100096   __Pyx_FinishRefcountContext();
100097   return __pyx_r;
100098 }
100099
100100 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":672
100101  * # callbacks for XPath/XSLT extension functions
100102  * 
100103  * cdef void _extension_function_call(_BaseContext context, function,             # <<<<<<<<<<<<<<
100104  *                                    xpath.xmlXPathParserContext* ctxt, int nargs):
100105  *     cdef _Document doc
100106  */
100107
100108 static  void __pyx_f_4lxml_5etree__extension_function_call(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_context, PyObject *__pyx_v_function, xmlXPathParserContext *__pyx_v_ctxt, int __pyx_v_nargs) {
100109   struct LxmlDocument *__pyx_v_doc;
100110   xmlXPathObject *__pyx_v_obj;
100111   int __pyx_v_i;
100112   PyObject *__pyx_v_args;
100113   PyObject *__pyx_v_o;
100114   PyObject *__pyx_v_res;
100115   PyObject *__pyx_1 = 0;
100116   PyObject *__pyx_t_1 = NULL;
100117   int __pyx_t_2;
100118   int __pyx_t_3;
100119   PyObject *__pyx_t_4 = NULL;
100120   xmlXPathObject *__pyx_t_5;
100121   PyObject *__pyx_t_6 = NULL;
100122   __Pyx_SetupRefcountContext("_extension_function_call");
100123   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
100124   __pyx_v_args = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
100125   __pyx_v_o = Py_None; __Pyx_INCREF(Py_None);
100126   __pyx_v_res = Py_None; __Pyx_INCREF(Py_None);
100127
100128   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":678
100129  *     cdef int i
100130  *     cdef list args
100131  *     doc = context._doc             # <<<<<<<<<<<<<<
100132  *     try:
100133  *         args = []
100134  */
100135   __Pyx_INCREF(((PyObject *)__pyx_v_context->_doc));
100136   __Pyx_DECREF(((PyObject *)__pyx_v_doc));
100137   __pyx_v_doc = __pyx_v_context->_doc;
100138
100139   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":679
100140  *     cdef list args
100141  *     doc = context._doc
100142  *     try:             # <<<<<<<<<<<<<<
100143  *         args = []
100144  *         for i from 0 <= i < nargs:
100145  */
100146   {
100147     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
100148     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
100149     __Pyx_XGOTREF(__pyx_save_exc_type);
100150     __Pyx_XGOTREF(__pyx_save_exc_value);
100151     __Pyx_XGOTREF(__pyx_save_exc_tb);
100152     /*try:*/ {
100153
100154       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":680
100155  *     doc = context._doc
100156  *     try:
100157  *         args = []             # <<<<<<<<<<<<<<
100158  *         for i from 0 <= i < nargs:
100159  *             obj = xpath.valuePop(ctxt)
100160  */
100161       __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
100162       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
100163       __Pyx_DECREF(((PyObject *)__pyx_v_args));
100164       __pyx_v_args = __pyx_t_1;
100165       __pyx_t_1 = 0;
100166
100167       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":681
100168  *     try:
100169  *         args = []
100170  *         for i from 0 <= i < nargs:             # <<<<<<<<<<<<<<
100171  *             obj = xpath.valuePop(ctxt)
100172  *             o = _unwrapXPathObject(obj, doc, context._build_smart_strings)
100173  */
100174       __pyx_t_2 = __pyx_v_nargs;
100175       for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
100176
100177         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":682
100178  *         args = []
100179  *         for i from 0 <= i < nargs:
100180  *             obj = xpath.valuePop(ctxt)             # <<<<<<<<<<<<<<
100181  *             o = _unwrapXPathObject(obj, doc, context._build_smart_strings)
100182  *             _freeXPathObject(obj)
100183  */
100184         __pyx_v_obj = valuePop(__pyx_v_ctxt);
100185
100186         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":683
100187  *         for i from 0 <= i < nargs:
100188  *             obj = xpath.valuePop(ctxt)
100189  *             o = _unwrapXPathObject(obj, doc, context._build_smart_strings)             # <<<<<<<<<<<<<<
100190  *             _freeXPathObject(obj)
100191  *             args.append(o)
100192  */
100193         __pyx_t_1 = __pyx_f_4lxml_5etree__unwrapXPathObject(__pyx_v_obj, __pyx_v_doc, __pyx_v_context->_build_smart_strings); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
100194         __Pyx_GOTREF(__pyx_t_1);
100195         __Pyx_DECREF(__pyx_v_o);
100196         __pyx_v_o = __pyx_t_1;
100197         __pyx_t_1 = 0;
100198
100199         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":684
100200  *             obj = xpath.valuePop(ctxt)
100201  *             o = _unwrapXPathObject(obj, doc, context._build_smart_strings)
100202  *             _freeXPathObject(obj)             # <<<<<<<<<<<<<<
100203  *             args.append(o)
100204  *         args.reverse()
100205  */
100206         __pyx_f_4lxml_5etree__freeXPathObject(__pyx_v_obj);
100207
100208         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":685
100209  *             o = _unwrapXPathObject(obj, doc, context._build_smart_strings)
100210  *             _freeXPathObject(obj)
100211  *             args.append(o)             # <<<<<<<<<<<<<<
100212  *         args.reverse()
100213  * 
100214  */
100215         __pyx_t_3 = PyList_Append(((PyObject *)__pyx_v_args), __pyx_v_o); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
100216       }
100217
100218       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":686
100219  *             _freeXPathObject(obj)
100220  *             args.append(o)
100221  *         args.reverse()             # <<<<<<<<<<<<<<
100222  * 
100223  *         res = function(context, *args)
100224  */
100225       __pyx_t_2 = PyList_Reverse(((PyObject *)__pyx_v_args)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
100226
100227       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":688
100228  *         args.reverse()
100229  * 
100230  *         res = function(context, *args)             # <<<<<<<<<<<<<<
100231  *         # wrap result for XPath consumption
100232  *         obj = _wrapXPathObject(res)
100233  */
100234       __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
100235       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
100236       __Pyx_INCREF(((PyObject *)__pyx_v_context));
100237       PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_context));
100238       __Pyx_GIVEREF(((PyObject *)__pyx_v_context));
100239       __pyx_1 = PySequence_Tuple(((PyObject *)__pyx_v_args)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
100240       __Pyx_GOTREF(((PyObject *)__pyx_1));
100241       __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
100242       __Pyx_GOTREF(__pyx_t_4);
100243       __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
100244       __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
100245       __pyx_t_1 = PyObject_Call(__pyx_v_function, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
100246       __Pyx_GOTREF(__pyx_t_1);
100247       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
100248       __Pyx_DECREF(__pyx_v_res);
100249       __pyx_v_res = __pyx_t_1;
100250       __pyx_t_1 = 0;
100251
100252       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":690
100253  *         res = function(context, *args)
100254  *         # wrap result for XPath consumption
100255  *         obj = _wrapXPathObject(res)             # <<<<<<<<<<<<<<
100256  *         # prevent Python from deallocating elements handed to libxml2
100257  *         context._hold(res)
100258  */
100259       __pyx_t_5 = __pyx_f_4lxml_5etree__wrapXPathObject(__pyx_v_res); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
100260       __pyx_v_obj = __pyx_t_5;
100261
100262       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":692
100263  *         obj = _wrapXPathObject(res)
100264  *         # prevent Python from deallocating elements handed to libxml2
100265  *         context._hold(res)             # <<<<<<<<<<<<<<
100266  *         xpath.valuePush(ctxt, obj)
100267  *     except:
100268  */
100269       __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseContext *)__pyx_v_context->__pyx_vtab)->_hold(__pyx_v_context, __pyx_v_res); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
100270       __Pyx_GOTREF(__pyx_t_1);
100271       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
100272
100273       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":693
100274  *         # prevent Python from deallocating elements handed to libxml2
100275  *         context._hold(res)
100276  *         xpath.valuePush(ctxt, obj)             # <<<<<<<<<<<<<<
100277  *     except:
100278  *         xpath.xmlXPathErr(ctxt, xpath.XPATH_EXPR_ERROR)
100279  */
100280       valuePush(__pyx_v_ctxt, __pyx_v_obj);
100281     }
100282     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
100283     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
100284     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
100285     goto __pyx_L10_try_end;
100286     __pyx_L3_error:;
100287     __Pyx_XDECREF(__pyx_1); __pyx_1 = 0;
100288     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
100289     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
100290
100291     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":694
100292  *         context._hold(res)
100293  *         xpath.valuePush(ctxt, obj)
100294  *     except:             # <<<<<<<<<<<<<<
100295  *         xpath.xmlXPathErr(ctxt, xpath.XPATH_EXPR_ERROR)
100296  *         context._exc._store_raised()
100297  */
100298     /*except:*/ {
100299       __Pyx_AddTraceback("lxml.etree._extension_function_call");
100300       if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
100301       __Pyx_GOTREF(__pyx_t_1);
100302       __Pyx_GOTREF(__pyx_t_4);
100303       __Pyx_GOTREF(__pyx_t_6);
100304
100305       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":695
100306  *         xpath.valuePush(ctxt, obj)
100307  *     except:
100308  *         xpath.xmlXPathErr(ctxt, xpath.XPATH_EXPR_ERROR)             # <<<<<<<<<<<<<<
100309  *         context._exc._store_raised()
100310  * 
100311  */
100312       xmlXPathErr(__pyx_v_ctxt, XPATH_EXPR_ERROR);
100313
100314       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":696
100315  *     except:
100316  *         xpath.xmlXPathErr(ctxt, xpath.XPATH_EXPR_ERROR)
100317  *         context._exc._store_raised()             # <<<<<<<<<<<<<<
100318  * 
100319  * # lookup the function by name and call it
100320  */
100321       ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_context->_exc->__pyx_vtab)->_store_raised(__pyx_v_context->_exc);
100322       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
100323       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
100324       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
100325       goto __pyx_L4_exception_handled;
100326     }
100327     __pyx_L5_except_error:;
100328     __Pyx_XDECREF(__pyx_save_exc_type);
100329     __Pyx_XDECREF(__pyx_save_exc_value);
100330     __Pyx_XDECREF(__pyx_save_exc_tb);
100331     goto __pyx_L1_error;
100332     __pyx_L4_exception_handled:;
100333     __Pyx_XGIVEREF(__pyx_save_exc_type);
100334     __Pyx_XGIVEREF(__pyx_save_exc_value);
100335     __Pyx_XGIVEREF(__pyx_save_exc_tb);
100336     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
100337     __pyx_L10_try_end:;
100338   }
100339
100340   goto __pyx_L0;
100341   __pyx_L1_error:;
100342   __Pyx_XDECREF(__pyx_1);
100343   __Pyx_XDECREF(__pyx_t_1);
100344   __Pyx_XDECREF(__pyx_t_4);
100345   __Pyx_XDECREF(__pyx_t_6);
100346   __Pyx_WriteUnraisable("lxml.etree._extension_function_call");
100347   __pyx_L0:;
100348   __Pyx_DECREF((PyObject *)__pyx_v_doc);
100349   __Pyx_DECREF(__pyx_v_args);
100350   __Pyx_DECREF(__pyx_v_o);
100351   __Pyx_DECREF(__pyx_v_res);
100352   __Pyx_FinishRefcountContext();
100353 }
100354
100355 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":700
100356  * # lookup the function by name and call it
100357  * 
100358  * cdef void _xpath_function_call(xpath.xmlXPathParserContext* ctxt,             # <<<<<<<<<<<<<<
100359  *                                int nargs) with gil:
100360  *     cdef xpath.xmlXPathContext* rctxt
100361  */
100362
100363 static  void __pyx_f_4lxml_5etree__xpath_function_call(xmlXPathParserContext *__pyx_v_ctxt, int __pyx_v_nargs) {
100364   xmlXPathContext *__pyx_v_rctxt;
100365   struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_context;
100366   PyObject *__pyx_v_function;
100367   PyObject *__pyx_v_fref;
100368   PyObject *__pyx_v_exception;
100369   PyObject *__pyx_1 = 0;
100370   PyObject *__pyx_t_1 = NULL;
100371   int __pyx_t_2;
100372   PyObject *__pyx_t_3 = NULL;
100373   PyObject *__pyx_t_4 = NULL;
100374   PyGILState_STATE _save = PyGILState_Ensure();
100375   __Pyx_SetupRefcountContext("_xpath_function_call");
100376   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__BaseContext *)Py_None); __Pyx_INCREF(Py_None);
100377   __pyx_v_function = Py_None; __Pyx_INCREF(Py_None);
100378   __pyx_v_fref = Py_None; __Pyx_INCREF(Py_None);
100379   __pyx_v_exception = Py_None; __Pyx_INCREF(Py_None);
100380
100381   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":704
100382  *     cdef xpath.xmlXPathContext* rctxt
100383  *     cdef _BaseContext context
100384  *     rctxt = ctxt.context             # <<<<<<<<<<<<<<
100385  *     context = <_BaseContext>(rctxt.userData)
100386  *     function = context._find_cached_function(rctxt.functionURI, rctxt.function)
100387  */
100388   __pyx_v_rctxt = __pyx_v_ctxt->context;
100389
100390   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":705
100391  *     cdef _BaseContext context
100392  *     rctxt = ctxt.context
100393  *     context = <_BaseContext>(rctxt.userData)             # <<<<<<<<<<<<<<
100394  *     function = context._find_cached_function(rctxt.functionURI, rctxt.function)
100395  *     if function is not None:
100396  */
100397   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_rctxt->userData)));
100398   __Pyx_DECREF(((PyObject *)__pyx_v_context));
100399   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_rctxt->userData);
100400
100401   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":706
100402  *     rctxt = ctxt.context
100403  *     context = <_BaseContext>(rctxt.userData)
100404  *     function = context._find_cached_function(rctxt.functionURI, rctxt.function)             # <<<<<<<<<<<<<<
100405  *     if function is not None:
100406  *         _extension_function_call(context, function, ctxt, nargs)
100407  */
100408   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseContext *)__pyx_v_context->__pyx_vtab)->_find_cached_function(__pyx_v_context, __pyx_v_rctxt->functionURI, __pyx_v_rctxt->function); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
100409   __Pyx_GOTREF(__pyx_t_1);
100410   __Pyx_DECREF(__pyx_v_function);
100411   __pyx_v_function = __pyx_t_1;
100412   __pyx_t_1 = 0;
100413
100414   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":707
100415  *     context = <_BaseContext>(rctxt.userData)
100416  *     function = context._find_cached_function(rctxt.functionURI, rctxt.function)
100417  *     if function is not None:             # <<<<<<<<<<<<<<
100418  *         _extension_function_call(context, function, ctxt, nargs)
100419  *     else:
100420  */
100421   __pyx_t_2 = (__pyx_v_function != Py_None);
100422   if (__pyx_t_2) {
100423
100424     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":708
100425  *     function = context._find_cached_function(rctxt.functionURI, rctxt.function)
100426  *     if function is not None:
100427  *         _extension_function_call(context, function, ctxt, nargs)             # <<<<<<<<<<<<<<
100428  *     else:
100429  *         if rctxt.functionURI is not NULL:
100430  */
100431     __pyx_f_4lxml_5etree__extension_function_call(__pyx_v_context, __pyx_v_function, __pyx_v_ctxt, __pyx_v_nargs);
100432     goto __pyx_L3;
100433   }
100434   /*else*/ {
100435
100436     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":710
100437  *         _extension_function_call(context, function, ctxt, nargs)
100438  *     else:
100439  *         if rctxt.functionURI is not NULL:             # <<<<<<<<<<<<<<
100440  *             fref = u"{%s}%s" % (rctxt.functionURI, rctxt.function)
100441  *         else:
100442  */
100443     __pyx_t_2 = (__pyx_v_rctxt->functionURI != NULL);
100444     if (__pyx_t_2) {
100445
100446       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":711
100447  *     else:
100448  *         if rctxt.functionURI is not NULL:
100449  *             fref = u"{%s}%s" % (rctxt.functionURI, rctxt.function)             # <<<<<<<<<<<<<<
100450  *         else:
100451  *             fref = rctxt.function
100452  */
100453       __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_rctxt->functionURI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
100454       __Pyx_GOTREF(__pyx_t_1);
100455       __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_rctxt->function); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
100456       __Pyx_GOTREF(__pyx_t_3);
100457       __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
100458       __Pyx_GOTREF(((PyObject *)__pyx_t_4));
100459       PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
100460       __Pyx_GIVEREF(__pyx_t_1);
100461       PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
100462       __Pyx_GIVEREF(__pyx_t_3);
100463       __pyx_t_1 = 0;
100464       __pyx_t_3 = 0;
100465       __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_589), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
100466       __Pyx_GOTREF(__pyx_t_3);
100467       __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
100468       __Pyx_DECREF(__pyx_v_fref);
100469       __pyx_v_fref = __pyx_t_3;
100470       __pyx_t_3 = 0;
100471       goto __pyx_L4;
100472     }
100473     /*else*/ {
100474
100475       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":713
100476  *             fref = u"{%s}%s" % (rctxt.functionURI, rctxt.function)
100477  *         else:
100478  *             fref = rctxt.function             # <<<<<<<<<<<<<<
100479  *         xpath.xmlXPathErr(ctxt, xpath.XPATH_UNKNOWN_FUNC_ERROR)
100480  *         exception = XPathFunctionError(u"XPath function '%s' not found" % fref)
100481  */
100482       __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_rctxt->function); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
100483       __Pyx_GOTREF(__pyx_t_3);
100484       __Pyx_DECREF(__pyx_v_fref);
100485       __pyx_v_fref = __pyx_t_3;
100486       __pyx_t_3 = 0;
100487     }
100488     __pyx_L4:;
100489
100490     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":714
100491  *         else:
100492  *             fref = rctxt.function
100493  *         xpath.xmlXPathErr(ctxt, xpath.XPATH_UNKNOWN_FUNC_ERROR)             # <<<<<<<<<<<<<<
100494  *         exception = XPathFunctionError(u"XPath function '%s' not found" % fref)
100495  *         context._exc._store_exception(exception)
100496  */
100497     xmlXPathErr(__pyx_v_ctxt, XPATH_UNKNOWN_FUNC_ERROR);
100498
100499     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":715
100500  *             fref = rctxt.function
100501  *         xpath.xmlXPathErr(ctxt, xpath.XPATH_UNKNOWN_FUNC_ERROR)
100502  *         exception = XPathFunctionError(u"XPath function '%s' not found" % fref)             # <<<<<<<<<<<<<<
100503  *         context._exc._store_exception(exception)
100504  */
100505     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XPathFunctionError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
100506     __Pyx_GOTREF(__pyx_1);
100507     __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_590), __pyx_v_fref); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
100508     __Pyx_GOTREF(__pyx_t_3);
100509     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
100510     __Pyx_GOTREF(((PyObject *)__pyx_t_4));
100511     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
100512     __Pyx_GIVEREF(__pyx_t_3);
100513     __pyx_t_3 = 0;
100514     __pyx_t_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
100515     __Pyx_GOTREF(__pyx_t_3);
100516     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
100517     __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
100518     __Pyx_DECREF(__pyx_v_exception);
100519     __pyx_v_exception = __pyx_t_3;
100520     __pyx_t_3 = 0;
100521
100522     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":716
100523  *         xpath.xmlXPathErr(ctxt, xpath.XPATH_UNKNOWN_FUNC_ERROR)
100524  *         exception = XPathFunctionError(u"XPath function '%s' not found" % fref)
100525  *         context._exc._store_exception(exception)             # <<<<<<<<<<<<<<
100526  */
100527     ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_context->_exc->__pyx_vtab)->_store_exception(__pyx_v_context->_exc, __pyx_v_exception);
100528   }
100529   __pyx_L3:;
100530
100531   goto __pyx_L0;
100532   __pyx_L1_error:;
100533   __Pyx_XDECREF(__pyx_1);
100534   __Pyx_XDECREF(__pyx_t_1);
100535   __Pyx_XDECREF(__pyx_t_3);
100536   __Pyx_XDECREF(__pyx_t_4);
100537   __Pyx_WriteUnraisable("lxml.etree._xpath_function_call");
100538   __pyx_L0:;
100539   __Pyx_DECREF((PyObject *)__pyx_v_context);
100540   __Pyx_DECREF(__pyx_v_function);
100541   __Pyx_DECREF(__pyx_v_fref);
100542   __Pyx_DECREF(__pyx_v_exception);
100543   __Pyx_FinishRefcountContext();
100544   PyGILState_Release(_save);
100545 }
100546
100547 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":31
100548  * )
100549  * 
100550  * cdef int _register_xpath_function(void* ctxt, name_utf, ns_utf):             # <<<<<<<<<<<<<<
100551  *     if ns_utf is None:
100552  *         return xpath.xmlXPathRegisterFunc(
100553  */
100554
100555 static  int __pyx_f_4lxml_5etree__register_xpath_function(void *__pyx_v_ctxt, PyObject *__pyx_v_name_utf, PyObject *__pyx_v_ns_utf) {
100556   int __pyx_r;
100557   int __pyx_t_1;
100558   __Pyx_SetupRefcountContext("_register_xpath_function");
100559
100560   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":32
100561  * 
100562  * cdef int _register_xpath_function(void* ctxt, name_utf, ns_utf):
100563  *     if ns_utf is None:             # <<<<<<<<<<<<<<
100564  *         return xpath.xmlXPathRegisterFunc(
100565  *             <xpath.xmlXPathContext*>ctxt, _cstr(name_utf),
100566  */
100567   __pyx_t_1 = (__pyx_v_ns_utf == Py_None);
100568   if (__pyx_t_1) {
100569
100570     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":35
100571  *         return xpath.xmlXPathRegisterFunc(
100572  *             <xpath.xmlXPathContext*>ctxt, _cstr(name_utf),
100573  *             _xpath_function_call)             # <<<<<<<<<<<<<<
100574  *     else:
100575  *         return xpath.xmlXPathRegisterFuncNS(
100576  */
100577     __pyx_r = xmlXPathRegisterFunc(((xmlXPathContext *)__pyx_v_ctxt), PyString_AS_STRING(__pyx_v_name_utf), __pyx_f_4lxml_5etree__xpath_function_call);
100578     goto __pyx_L0;
100579     goto __pyx_L3;
100580   }
100581   /*else*/ {
100582
100583     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":39
100584  *         return xpath.xmlXPathRegisterFuncNS(
100585  *             <xpath.xmlXPathContext*>ctxt, _cstr(name_utf), _cstr(ns_utf),
100586  *             _xpath_function_call)             # <<<<<<<<<<<<<<
100587  * 
100588  * cdef int _unregister_xpath_function(void* ctxt, name_utf, ns_utf):
100589  */
100590     __pyx_r = xmlXPathRegisterFuncNS(((xmlXPathContext *)__pyx_v_ctxt), PyString_AS_STRING(__pyx_v_name_utf), PyString_AS_STRING(__pyx_v_ns_utf), __pyx_f_4lxml_5etree__xpath_function_call);
100591     goto __pyx_L0;
100592   }
100593   __pyx_L3:;
100594
100595   __pyx_r = 0;
100596   __pyx_L0:;
100597   __Pyx_FinishRefcountContext();
100598   return __pyx_r;
100599 }
100600
100601 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":41
100602  *             _xpath_function_call)
100603  * 
100604  * cdef int _unregister_xpath_function(void* ctxt, name_utf, ns_utf):             # <<<<<<<<<<<<<<
100605  *     if ns_utf is None:
100606  *         return xpath.xmlXPathRegisterFunc(
100607  */
100608
100609 static  int __pyx_f_4lxml_5etree__unregister_xpath_function(void *__pyx_v_ctxt, PyObject *__pyx_v_name_utf, PyObject *__pyx_v_ns_utf) {
100610   int __pyx_r;
100611   int __pyx_t_1;
100612   __Pyx_SetupRefcountContext("_unregister_xpath_function");
100613
100614   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":42
100615  * 
100616  * cdef int _unregister_xpath_function(void* ctxt, name_utf, ns_utf):
100617  *     if ns_utf is None:             # <<<<<<<<<<<<<<
100618  *         return xpath.xmlXPathRegisterFunc(
100619  *             <xpath.xmlXPathContext*>ctxt, _cstr(name_utf), NULL)
100620  */
100621   __pyx_t_1 = (__pyx_v_ns_utf == Py_None);
100622   if (__pyx_t_1) {
100623
100624     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":44
100625  *     if ns_utf is None:
100626  *         return xpath.xmlXPathRegisterFunc(
100627  *             <xpath.xmlXPathContext*>ctxt, _cstr(name_utf), NULL)             # <<<<<<<<<<<<<<
100628  *     else:
100629  *         return xpath.xmlXPathRegisterFuncNS(
100630  */
100631     __pyx_r = xmlXPathRegisterFunc(((xmlXPathContext *)__pyx_v_ctxt), PyString_AS_STRING(__pyx_v_name_utf), NULL);
100632     goto __pyx_L0;
100633     goto __pyx_L3;
100634   }
100635   /*else*/ {
100636
100637     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":47
100638  *     else:
100639  *         return xpath.xmlXPathRegisterFuncNS(
100640  *             <xpath.xmlXPathContext*>ctxt, _cstr(name_utf), _cstr(ns_utf), NULL)             # <<<<<<<<<<<<<<
100641  * 
100642  * 
100643  */
100644     __pyx_r = xmlXPathRegisterFuncNS(((xmlXPathContext *)__pyx_v_ctxt), PyString_AS_STRING(__pyx_v_name_utf), PyString_AS_STRING(__pyx_v_ns_utf), NULL);
100645     goto __pyx_L0;
100646   }
100647   __pyx_L3:;
100648
100649   __pyx_r = 0;
100650   __pyx_L0:;
100651   __Pyx_FinishRefcountContext();
100652   return __pyx_r;
100653 }
100654
100655 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":52
100656  * cdef class _XPathContext(_BaseContext):
100657  *     cdef object _variables
100658  *     def __init__(self, namespaces, extensions, enable_regexp, variables,             # <<<<<<<<<<<<<<
100659  *                  build_smart_strings):
100660  *         self._variables = variables
100661  */
100662
100663 static int __pyx_pf_4lxml_5etree_13_XPathContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
100664 static int __pyx_pf_4lxml_5etree_13_XPathContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
100665   PyObject *__pyx_v_namespaces = 0;
100666   PyObject *__pyx_v_extensions = 0;
100667   PyObject *__pyx_v_enable_regexp = 0;
100668   PyObject *__pyx_v_variables = 0;
100669   PyObject *__pyx_v_build_smart_strings = 0;
100670   int __pyx_r;
100671   PyObject *__pyx_t_1 = NULL;
100672   PyObject *__pyx_t_2 = NULL;
100673   PyObject *__pyx_t_3 = NULL;
100674   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_namespaces,&__pyx_kp_extensions,&__pyx_kp_enable_regexp,&__pyx_kp_variables,&__pyx_kp_build_smart_strings,0};
100675   __Pyx_SetupRefcountContext("__init__");
100676   if (unlikely(__pyx_kwds)) {
100677     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
100678     PyObject* values[5] = {0,0,0,0,0};
100679     switch (PyTuple_GET_SIZE(__pyx_args)) {
100680       case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
100681       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
100682       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
100683       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
100684       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
100685       case  0: break;
100686       default: goto __pyx_L5_argtuple_error;
100687     }
100688     switch (PyTuple_GET_SIZE(__pyx_args)) {
100689       case  0:
100690       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_namespaces);
100691       if (likely(values[0])) kw_args--;
100692       else goto __pyx_L5_argtuple_error;
100693       case  1:
100694       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_extensions);
100695       if (likely(values[1])) kw_args--;
100696       else {
100697         __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 1); {__pyx_filename = __pyx_f[17]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
100698       }
100699       case  2:
100700       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_enable_regexp);
100701       if (likely(values[2])) kw_args--;
100702       else {
100703         __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 2); {__pyx_filename = __pyx_f[17]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
100704       }
100705       case  3:
100706       values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_variables);
100707       if (likely(values[3])) kw_args--;
100708       else {
100709         __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 3); {__pyx_filename = __pyx_f[17]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
100710       }
100711       case  4:
100712       values[4] = PyDict_GetItem(__pyx_kwds, __pyx_kp_build_smart_strings);
100713       if (likely(values[4])) kw_args--;
100714       else {
100715         __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 4); {__pyx_filename = __pyx_f[17]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
100716       }
100717     }
100718     if (unlikely(kw_args > 0)) {
100719       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
100720     }
100721     __pyx_v_namespaces = values[0];
100722     __pyx_v_extensions = values[1];
100723     __pyx_v_enable_regexp = values[2];
100724     __pyx_v_variables = values[3];
100725     __pyx_v_build_smart_strings = values[4];
100726   } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
100727     goto __pyx_L5_argtuple_error;
100728   } else {
100729     __pyx_v_namespaces = PyTuple_GET_ITEM(__pyx_args, 0);
100730     __pyx_v_extensions = PyTuple_GET_ITEM(__pyx_args, 1);
100731     __pyx_v_enable_regexp = PyTuple_GET_ITEM(__pyx_args, 2);
100732     __pyx_v_variables = PyTuple_GET_ITEM(__pyx_args, 3);
100733     __pyx_v_build_smart_strings = PyTuple_GET_ITEM(__pyx_args, 4);
100734   }
100735   goto __pyx_L4_argument_unpacking_done;
100736   __pyx_L5_argtuple_error:;
100737   __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[17]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
100738   __pyx_L3_error:;
100739   __Pyx_AddTraceback("lxml.etree._XPathContext.__init__");
100740   return -1;
100741   __pyx_L4_argument_unpacking_done:;
100742
100743   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":54
100744  *     def __init__(self, namespaces, extensions, enable_regexp, variables,
100745  *                  build_smart_strings):
100746  *         self._variables = variables             # <<<<<<<<<<<<<<
100747  *         _BaseContext.__init__(self, namespaces, extensions, enable_regexp,
100748  *                               build_smart_strings)
100749  */
100750   __Pyx_INCREF(__pyx_v_variables);
100751   __Pyx_GIVEREF(__pyx_v_variables);
100752   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__XPathContext *)__pyx_v_self)->_variables);
100753   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree__XPathContext *)__pyx_v_self)->_variables);
100754   ((struct __pyx_obj_4lxml_5etree__XPathContext *)__pyx_v_self)->_variables = __pyx_v_variables;
100755
100756   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":55
100757  *                  build_smart_strings):
100758  *         self._variables = variables
100759  *         _BaseContext.__init__(self, namespaces, extensions, enable_regexp,             # <<<<<<<<<<<<<<
100760  *                               build_smart_strings)
100761  * 
100762  */
100763   __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__BaseContext)), __pyx_kp___init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
100764   __Pyx_GOTREF(__pyx_t_1);
100765
100766   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":56
100767  *         self._variables = variables
100768  *         _BaseContext.__init__(self, namespaces, extensions, enable_regexp,
100769  *                               build_smart_strings)             # <<<<<<<<<<<<<<
100770  * 
100771  *     cdef set_context(self, xpath.xmlXPathContext* xpathCtxt):
100772  */
100773   __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
100774   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
100775   __Pyx_INCREF(__pyx_v_self);
100776   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
100777   __Pyx_GIVEREF(__pyx_v_self);
100778   __Pyx_INCREF(__pyx_v_namespaces);
100779   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_namespaces);
100780   __Pyx_GIVEREF(__pyx_v_namespaces);
100781   __Pyx_INCREF(__pyx_v_extensions);
100782   PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_extensions);
100783   __Pyx_GIVEREF(__pyx_v_extensions);
100784   __Pyx_INCREF(__pyx_v_enable_regexp);
100785   PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_enable_regexp);
100786   __Pyx_GIVEREF(__pyx_v_enable_regexp);
100787   __Pyx_INCREF(__pyx_v_build_smart_strings);
100788   PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_build_smart_strings);
100789   __Pyx_GIVEREF(__pyx_v_build_smart_strings);
100790   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
100791   __Pyx_GOTREF(__pyx_t_3);
100792   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
100793   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
100794   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
100795
100796   __pyx_r = 0;
100797   goto __pyx_L0;
100798   __pyx_L1_error:;
100799   __Pyx_XDECREF(__pyx_t_1);
100800   __Pyx_XDECREF(__pyx_t_2);
100801   __Pyx_XDECREF(__pyx_t_3);
100802   __Pyx_AddTraceback("lxml.etree._XPathContext.__init__");
100803   __pyx_r = -1;
100804   __pyx_L0:;
100805   __Pyx_FinishRefcountContext();
100806   return __pyx_r;
100807 }
100808
100809 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":58
100810  *                               build_smart_strings)
100811  * 
100812  *     cdef set_context(self, xpath.xmlXPathContext* xpathCtxt):             # <<<<<<<<<<<<<<
100813  *         self._set_xpath_context(xpathCtxt)
100814  *         self._setupDict(xpathCtxt)
100815  */
100816
100817 static  PyObject *__pyx_f_4lxml_5etree_13_XPathContext_set_context(struct __pyx_obj_4lxml_5etree__XPathContext *__pyx_v_self, xmlXPathContext *__pyx_v_xpathCtxt) {
100818   PyObject *__pyx_r = NULL;
100819   PyObject *__pyx_t_1 = NULL;
100820   __Pyx_SetupRefcountContext("set_context");
100821
100822   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":59
100823  * 
100824  *     cdef set_context(self, xpath.xmlXPathContext* xpathCtxt):
100825  *         self._set_xpath_context(xpathCtxt)             # <<<<<<<<<<<<<<
100826  *         self._setupDict(xpathCtxt)
100827  *         self.registerLocalNamespaces()
100828  */
100829   ((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._set_xpath_context(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self), __pyx_v_xpathCtxt);
100830
100831   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":60
100832  *     cdef set_context(self, xpath.xmlXPathContext* xpathCtxt):
100833  *         self._set_xpath_context(xpathCtxt)
100834  *         self._setupDict(xpathCtxt)             # <<<<<<<<<<<<<<
100835  *         self.registerLocalNamespaces()
100836  *         self.registerLocalFunctions(xpathCtxt, _register_xpath_function)
100837  */
100838   ((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->_setupDict(__pyx_v_self, __pyx_v_xpathCtxt);
100839
100840   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":61
100841  *         self._set_xpath_context(xpathCtxt)
100842  *         self._setupDict(xpathCtxt)
100843  *         self.registerLocalNamespaces()             # <<<<<<<<<<<<<<
100844  *         self.registerLocalFunctions(xpathCtxt, _register_xpath_function)
100845  * 
100846  */
100847   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.registerLocalNamespaces(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
100848   __Pyx_GOTREF(__pyx_t_1);
100849   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
100850
100851   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":62
100852  *         self._setupDict(xpathCtxt)
100853  *         self.registerLocalNamespaces()
100854  *         self.registerLocalFunctions(xpathCtxt, _register_xpath_function)             # <<<<<<<<<<<<<<
100855  * 
100856  *     cdef register_context(self, _Document doc):
100857  */
100858   ((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.registerLocalFunctions(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self), __pyx_v_xpathCtxt, __pyx_f_4lxml_5etree__register_xpath_function);
100859
100860   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
100861   goto __pyx_L0;
100862   __pyx_L1_error:;
100863   __Pyx_XDECREF(__pyx_t_1);
100864   __Pyx_AddTraceback("lxml.etree._XPathContext.set_context");
100865   __pyx_r = 0;
100866   __pyx_L0:;
100867   __Pyx_XGIVEREF(__pyx_r);
100868   __Pyx_FinishRefcountContext();
100869   return __pyx_r;
100870 }
100871
100872 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":64
100873  *         self.registerLocalFunctions(xpathCtxt, _register_xpath_function)
100874  * 
100875  *     cdef register_context(self, _Document doc):             # <<<<<<<<<<<<<<
100876  *         self._register_context(doc)
100877  *         self.registerGlobalNamespaces()
100878  */
100879
100880 static  PyObject *__pyx_f_4lxml_5etree_13_XPathContext_register_context(struct __pyx_obj_4lxml_5etree__XPathContext *__pyx_v_self, struct LxmlDocument *__pyx_v_doc) {
100881   PyObject *__pyx_r = NULL;
100882   PyObject *__pyx_t_1 = NULL;
100883   int __pyx_t_2;
100884   __Pyx_SetupRefcountContext("register_context");
100885
100886   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":65
100887  * 
100888  *     cdef register_context(self, _Document doc):
100889  *         self._register_context(doc)             # <<<<<<<<<<<<<<
100890  *         self.registerGlobalNamespaces()
100891  *         self.registerGlobalFunctions(self._xpathCtxt, _register_xpath_function)
100892  */
100893   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._register_context(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self), __pyx_v_doc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
100894   __Pyx_GOTREF(__pyx_t_1);
100895   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
100896
100897   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":66
100898  *     cdef register_context(self, _Document doc):
100899  *         self._register_context(doc)
100900  *         self.registerGlobalNamespaces()             # <<<<<<<<<<<<<<
100901  *         self.registerGlobalFunctions(self._xpathCtxt, _register_xpath_function)
100902  *         if self._variables is not None:
100903  */
100904   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.registerGlobalNamespaces(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
100905   __Pyx_GOTREF(__pyx_t_1);
100906   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
100907
100908   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":67
100909  *         self._register_context(doc)
100910  *         self.registerGlobalNamespaces()
100911  *         self.registerGlobalFunctions(self._xpathCtxt, _register_xpath_function)             # <<<<<<<<<<<<<<
100912  *         if self._variables is not None:
100913  *             self.registerVariables(self._variables)
100914  */
100915   ((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.registerGlobalFunctions(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self), __pyx_v_self->__pyx_base._xpathCtxt, __pyx_f_4lxml_5etree__register_xpath_function);
100916
100917   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":68
100918  *         self.registerGlobalNamespaces()
100919  *         self.registerGlobalFunctions(self._xpathCtxt, _register_xpath_function)
100920  *         if self._variables is not None:             # <<<<<<<<<<<<<<
100921  *             self.registerVariables(self._variables)
100922  * 
100923  */
100924   __pyx_t_2 = (__pyx_v_self->_variables != Py_None);
100925   if (__pyx_t_2) {
100926
100927     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":69
100928  *         self.registerGlobalFunctions(self._xpathCtxt, _register_xpath_function)
100929  *         if self._variables is not None:
100930  *             self.registerVariables(self._variables)             # <<<<<<<<<<<<<<
100931  * 
100932  *     cdef unregister_context(self):
100933  */
100934     __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->registerVariables(__pyx_v_self, __pyx_v_self->_variables); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
100935     __Pyx_GOTREF(__pyx_t_1);
100936     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
100937     goto __pyx_L3;
100938   }
100939   __pyx_L3:;
100940
100941   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
100942   goto __pyx_L0;
100943   __pyx_L1_error:;
100944   __Pyx_XDECREF(__pyx_t_1);
100945   __Pyx_AddTraceback("lxml.etree._XPathContext.register_context");
100946   __pyx_r = 0;
100947   __pyx_L0:;
100948   __Pyx_XGIVEREF(__pyx_r);
100949   __Pyx_FinishRefcountContext();
100950   return __pyx_r;
100951 }
100952
100953 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":71
100954  *             self.registerVariables(self._variables)
100955  * 
100956  *     cdef unregister_context(self):             # <<<<<<<<<<<<<<
100957  *         self.unregisterGlobalFunctions(
100958  *             self._xpathCtxt, _unregister_xpath_function)
100959  */
100960
100961 static  PyObject *__pyx_f_4lxml_5etree_13_XPathContext_unregister_context(struct __pyx_obj_4lxml_5etree__XPathContext *__pyx_v_self) {
100962   PyObject *__pyx_r = NULL;
100963   PyObject *__pyx_t_1 = NULL;
100964   __Pyx_SetupRefcountContext("unregister_context");
100965
100966   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":73
100967  *     cdef unregister_context(self):
100968  *         self.unregisterGlobalFunctions(
100969  *             self._xpathCtxt, _unregister_xpath_function)             # <<<<<<<<<<<<<<
100970  *         self.unregisterGlobalNamespaces()
100971  *         xpath.xmlXPathRegisteredVariablesCleanup(self._xpathCtxt)
100972  */
100973   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.unregisterGlobalFunctions(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self), __pyx_v_self->__pyx_base._xpathCtxt, __pyx_f_4lxml_5etree__unregister_xpath_function); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
100974   __Pyx_GOTREF(__pyx_t_1);
100975   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
100976
100977   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":74
100978  *         self.unregisterGlobalFunctions(
100979  *             self._xpathCtxt, _unregister_xpath_function)
100980  *         self.unregisterGlobalNamespaces()             # <<<<<<<<<<<<<<
100981  *         xpath.xmlXPathRegisteredVariablesCleanup(self._xpathCtxt)
100982  *         self._cleanup_context()
100983  */
100984   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.unregisterGlobalNamespaces(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
100985   __Pyx_GOTREF(__pyx_t_1);
100986   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
100987
100988   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":75
100989  *             self._xpathCtxt, _unregister_xpath_function)
100990  *         self.unregisterGlobalNamespaces()
100991  *         xpath.xmlXPathRegisteredVariablesCleanup(self._xpathCtxt)             # <<<<<<<<<<<<<<
100992  *         self._cleanup_context()
100993  * 
100994  */
100995   xmlXPathRegisteredVariablesCleanup(__pyx_v_self->__pyx_base._xpathCtxt);
100996
100997   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":76
100998  *         self.unregisterGlobalNamespaces()
100999  *         xpath.xmlXPathRegisteredVariablesCleanup(self._xpathCtxt)
101000  *         self._cleanup_context()             # <<<<<<<<<<<<<<
101001  * 
101002  *     cdef registerVariables(self, variable_dict):
101003  */
101004   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._cleanup_context(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101005   __Pyx_GOTREF(__pyx_t_1);
101006   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
101007
101008   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
101009   goto __pyx_L0;
101010   __pyx_L1_error:;
101011   __Pyx_XDECREF(__pyx_t_1);
101012   __Pyx_AddTraceback("lxml.etree._XPathContext.unregister_context");
101013   __pyx_r = 0;
101014   __pyx_L0:;
101015   __Pyx_XGIVEREF(__pyx_r);
101016   __Pyx_FinishRefcountContext();
101017   return __pyx_r;
101018 }
101019
101020 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":78
101021  *         self._cleanup_context()
101022  * 
101023  *     cdef registerVariables(self, variable_dict):             # <<<<<<<<<<<<<<
101024  *         for name, value in variable_dict.items():
101025  *             name_utf = self._to_utf(name)
101026  */
101027
101028 static  PyObject *__pyx_f_4lxml_5etree_13_XPathContext_registerVariables(struct __pyx_obj_4lxml_5etree__XPathContext *__pyx_v_self, PyObject *__pyx_v_variable_dict) {
101029   PyObject *__pyx_v_name;
101030   PyObject *__pyx_v_value;
101031   PyObject *__pyx_v_name_utf;
101032   PyObject *__pyx_r = NULL;
101033   PyObject *__pyx_1 = 0;
101034   PyObject *__pyx_2 = 0;
101035   PyObject *__pyx_3 = 0;
101036   Py_ssize_t __pyx_t_1;
101037   PyObject *__pyx_t_2 = NULL;
101038   PyObject *__pyx_t_3 = NULL;
101039   xmlXPathObject *__pyx_t_4;
101040   __Pyx_SetupRefcountContext("registerVariables");
101041   __pyx_v_name = Py_None; __Pyx_INCREF(Py_None);
101042   __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);
101043   __pyx_v_name_utf = Py_None; __Pyx_INCREF(Py_None);
101044
101045   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":79
101046  * 
101047  *     cdef registerVariables(self, variable_dict):
101048  *         for name, value in variable_dict.items():             # <<<<<<<<<<<<<<
101049  *             name_utf = self._to_utf(name)
101050  *             xpath.xmlXPathRegisterVariable(
101051  */
101052   __pyx_t_2 = PyObject_GetAttr(__pyx_v_variable_dict, __pyx_kp_items); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101053   __Pyx_GOTREF(__pyx_t_2);
101054   __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101055   __Pyx_GOTREF(__pyx_t_3);
101056   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
101057   if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
101058     __pyx_t_1 = 0; __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2);
101059   } else {
101060     __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101061     __Pyx_GOTREF(__pyx_t_2);
101062   }
101063   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
101064   for (;;) {
101065     if (likely(PyList_CheckExact(__pyx_t_2))) {
101066       if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break;
101067       __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
101068     } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
101069       if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
101070       __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
101071     } else {
101072       __pyx_t_3 = PyIter_Next(__pyx_t_2);
101073       if (!__pyx_t_3) {
101074         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101075         break;
101076       }
101077       __Pyx_GOTREF(__pyx_t_3);
101078     }
101079     if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) {
101080       PyObject* tuple = __pyx_t_3;
101081       __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
101082       __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
101083       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
101084       __Pyx_DECREF(__pyx_v_name);
101085       __pyx_v_name = __pyx_2;
101086       __pyx_2 = 0;
101087       __Pyx_DECREF(__pyx_v_value);
101088       __pyx_v_value = __pyx_3;
101089       __pyx_3 = 0;
101090     } else {
101091       __pyx_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101092       __Pyx_GOTREF(__pyx_1);
101093       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
101094       __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101095       __Pyx_GOTREF(__pyx_2);
101096       __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101097       __Pyx_GOTREF(__pyx_3);
101098       if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101099       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
101100       __Pyx_DECREF(__pyx_v_name);
101101       __pyx_v_name = __pyx_2;
101102       __pyx_2 = 0;
101103       __Pyx_DECREF(__pyx_v_value);
101104       __pyx_v_value = __pyx_3;
101105       __pyx_3 = 0;
101106     }
101107
101108     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":80
101109  *     cdef registerVariables(self, variable_dict):
101110  *         for name, value in variable_dict.items():
101111  *             name_utf = self._to_utf(name)             # <<<<<<<<<<<<<<
101112  *             xpath.xmlXPathRegisterVariable(
101113  *                 self._xpathCtxt, _cstr(name_utf), _wrapXPathObject(value))
101114  */
101115     __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._to_utf(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self), __pyx_v_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101116     __Pyx_GOTREF(__pyx_t_3);
101117     __Pyx_DECREF(__pyx_v_name_utf);
101118     __pyx_v_name_utf = __pyx_t_3;
101119     __pyx_t_3 = 0;
101120
101121     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":82
101122  *             name_utf = self._to_utf(name)
101123  *             xpath.xmlXPathRegisterVariable(
101124  *                 self._xpathCtxt, _cstr(name_utf), _wrapXPathObject(value))             # <<<<<<<<<<<<<<
101125  * 
101126  *     cdef registerVariable(self, name, value):
101127  */
101128     __pyx_t_4 = __pyx_f_4lxml_5etree__wrapXPathObject(__pyx_v_value); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101129     xmlXPathRegisterVariable(__pyx_v_self->__pyx_base._xpathCtxt, PyString_AS_STRING(__pyx_v_name_utf), __pyx_t_4);
101130   }
101131   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
101132
101133   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
101134   goto __pyx_L0;
101135   __pyx_L1_error:;
101136   __Pyx_XDECREF(__pyx_1);
101137   __Pyx_XDECREF(__pyx_2);
101138   __Pyx_XDECREF(__pyx_3);
101139   __Pyx_XDECREF(__pyx_t_2);
101140   __Pyx_XDECREF(__pyx_t_3);
101141   __Pyx_AddTraceback("lxml.etree._XPathContext.registerVariables");
101142   __pyx_r = 0;
101143   __pyx_L0:;
101144   __Pyx_DECREF(__pyx_v_name);
101145   __Pyx_DECREF(__pyx_v_value);
101146   __Pyx_DECREF(__pyx_v_name_utf);
101147   __Pyx_XGIVEREF(__pyx_r);
101148   __Pyx_FinishRefcountContext();
101149   return __pyx_r;
101150 }
101151
101152 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":84
101153  *                 self._xpathCtxt, _cstr(name_utf), _wrapXPathObject(value))
101154  * 
101155  *     cdef registerVariable(self, name, value):             # <<<<<<<<<<<<<<
101156  *         name_utf = self._to_utf(name)
101157  *         xpath.xmlXPathRegisterVariable(
101158  */
101159
101160 static  PyObject *__pyx_f_4lxml_5etree_13_XPathContext_registerVariable(struct __pyx_obj_4lxml_5etree__XPathContext *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_value) {
101161   PyObject *__pyx_v_name_utf;
101162   PyObject *__pyx_r = NULL;
101163   PyObject *__pyx_t_1 = NULL;
101164   xmlXPathObject *__pyx_t_2;
101165   __Pyx_SetupRefcountContext("registerVariable");
101166   __pyx_v_name_utf = Py_None; __Pyx_INCREF(Py_None);
101167
101168   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":85
101169  * 
101170  *     cdef registerVariable(self, name, value):
101171  *         name_utf = self._to_utf(name)             # <<<<<<<<<<<<<<
101172  *         xpath.xmlXPathRegisterVariable(
101173  *             self._xpathCtxt, _cstr(name_utf), _wrapXPathObject(value))
101174  */
101175   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._to_utf(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self), __pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101176   __Pyx_GOTREF(__pyx_t_1);
101177   __Pyx_DECREF(__pyx_v_name_utf);
101178   __pyx_v_name_utf = __pyx_t_1;
101179   __pyx_t_1 = 0;
101180
101181   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":87
101182  *         name_utf = self._to_utf(name)
101183  *         xpath.xmlXPathRegisterVariable(
101184  *             self._xpathCtxt, _cstr(name_utf), _wrapXPathObject(value))             # <<<<<<<<<<<<<<
101185  * 
101186  *     cdef void _registerVariable(self, name_utf, value):
101187  */
101188   __pyx_t_2 = __pyx_f_4lxml_5etree__wrapXPathObject(__pyx_v_value); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101189   xmlXPathRegisterVariable(__pyx_v_self->__pyx_base._xpathCtxt, PyString_AS_STRING(__pyx_v_name_utf), __pyx_t_2);
101190
101191   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
101192   goto __pyx_L0;
101193   __pyx_L1_error:;
101194   __Pyx_XDECREF(__pyx_t_1);
101195   __Pyx_AddTraceback("lxml.etree._XPathContext.registerVariable");
101196   __pyx_r = 0;
101197   __pyx_L0:;
101198   __Pyx_DECREF(__pyx_v_name_utf);
101199   __Pyx_XGIVEREF(__pyx_r);
101200   __Pyx_FinishRefcountContext();
101201   return __pyx_r;
101202 }
101203
101204 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":89
101205  *             self._xpathCtxt, _cstr(name_utf), _wrapXPathObject(value))
101206  * 
101207  *     cdef void _registerVariable(self, name_utf, value):             # <<<<<<<<<<<<<<
101208  *         xpath.xmlXPathRegisterVariable(
101209  *             self._xpathCtxt, _cstr(name_utf), _wrapXPathObject(value))
101210  */
101211
101212 static  void __pyx_f_4lxml_5etree_13_XPathContext__registerVariable(struct __pyx_obj_4lxml_5etree__XPathContext *__pyx_v_self, PyObject *__pyx_v_name_utf, PyObject *__pyx_v_value) {
101213   xmlXPathObject *__pyx_t_1;
101214   __Pyx_SetupRefcountContext("_registerVariable");
101215
101216   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":91
101217  *     cdef void _registerVariable(self, name_utf, value):
101218  *         xpath.xmlXPathRegisterVariable(
101219  *             self._xpathCtxt, _cstr(name_utf), _wrapXPathObject(value))             # <<<<<<<<<<<<<<
101220  * 
101221  *     cdef void _setupDict(self, xpath.xmlXPathContext* xpathCtxt):
101222  */
101223   __pyx_t_1 = __pyx_f_4lxml_5etree__wrapXPathObject(__pyx_v_value); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101224   xmlXPathRegisterVariable(__pyx_v_self->__pyx_base._xpathCtxt, PyString_AS_STRING(__pyx_v_name_utf), __pyx_t_1);
101225
101226   goto __pyx_L0;
101227   __pyx_L1_error:;
101228   __Pyx_WriteUnraisable("lxml.etree._XPathContext._registerVariable");
101229   __pyx_L0:;
101230   __Pyx_FinishRefcountContext();
101231 }
101232
101233 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":93
101234  *             self._xpathCtxt, _cstr(name_utf), _wrapXPathObject(value))
101235  * 
101236  *     cdef void _setupDict(self, xpath.xmlXPathContext* xpathCtxt):             # <<<<<<<<<<<<<<
101237  *         __GLOBAL_PARSER_CONTEXT.initXPathParserDict(xpathCtxt)
101238  * 
101239  */
101240
101241 static  void __pyx_f_4lxml_5etree_13_XPathContext__setupDict(struct __pyx_obj_4lxml_5etree__XPathContext *__pyx_v_self, xmlXPathContext *__pyx_v_xpathCtxt) {
101242   __Pyx_SetupRefcountContext("_setupDict");
101243
101244   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":94
101245  * 
101246  *     cdef void _setupDict(self, xpath.xmlXPathContext* xpathCtxt):
101247  *         __GLOBAL_PARSER_CONTEXT.initXPathParserDict(xpathCtxt)             # <<<<<<<<<<<<<<
101248  * 
101249  * cdef bint _XPATH_VERSION_WARNING_REQUIRED
101250  */
101251   ((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initXPathParserDict(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT, __pyx_v_xpathCtxt);
101252
101253   __Pyx_FinishRefcountContext();
101254 }
101255
101256 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":108
101257  *     cdef _ErrorLog _error_log
101258  * 
101259  *     def __init__(self, namespaces, extensions, enable_regexp,             # <<<<<<<<<<<<<<
101260  *                  smart_strings):
101261  *         global _XPATH_VERSION_WARNING_REQUIRED
101262  */
101263
101264 static int __pyx_pf_4lxml_5etree_19_XPathEvaluatorBase___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
101265 static int __pyx_pf_4lxml_5etree_19_XPathEvaluatorBase___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
101266   PyObject *__pyx_v_namespaces = 0;
101267   PyObject *__pyx_v_extensions = 0;
101268   PyObject *__pyx_v_enable_regexp = 0;
101269   PyObject *__pyx_v_smart_strings = 0;
101270   PyObject *__pyx_v_warnings;
101271   int __pyx_r;
101272   PyObject *__pyx_1 = 0;
101273   int __pyx_t_1;
101274   PyObject *__pyx_t_2 = NULL;
101275   PyObject *__pyx_t_3 = NULL;
101276   PyObject *__pyx_t_4 = NULL;
101277   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_namespaces,&__pyx_kp_extensions,&__pyx_kp_enable_regexp,&__pyx_kp_smart_strings,0};
101278   __Pyx_SetupRefcountContext("__init__");
101279   if (unlikely(__pyx_kwds)) {
101280     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
101281     PyObject* values[4] = {0,0,0,0};
101282     switch (PyTuple_GET_SIZE(__pyx_args)) {
101283       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
101284       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
101285       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
101286       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
101287       case  0: break;
101288       default: goto __pyx_L5_argtuple_error;
101289     }
101290     switch (PyTuple_GET_SIZE(__pyx_args)) {
101291       case  0:
101292       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_namespaces);
101293       if (likely(values[0])) kw_args--;
101294       else goto __pyx_L5_argtuple_error;
101295       case  1:
101296       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_extensions);
101297       if (likely(values[1])) kw_args--;
101298       else {
101299         __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); {__pyx_filename = __pyx_f[17]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
101300       }
101301       case  2:
101302       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_enable_regexp);
101303       if (likely(values[2])) kw_args--;
101304       else {
101305         __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); {__pyx_filename = __pyx_f[17]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
101306       }
101307       case  3:
101308       values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_smart_strings);
101309       if (likely(values[3])) kw_args--;
101310       else {
101311         __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); {__pyx_filename = __pyx_f[17]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
101312       }
101313     }
101314     if (unlikely(kw_args > 0)) {
101315       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
101316     }
101317     __pyx_v_namespaces = values[0];
101318     __pyx_v_extensions = values[1];
101319     __pyx_v_enable_regexp = values[2];
101320     __pyx_v_smart_strings = values[3];
101321   } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
101322     goto __pyx_L5_argtuple_error;
101323   } else {
101324     __pyx_v_namespaces = PyTuple_GET_ITEM(__pyx_args, 0);
101325     __pyx_v_extensions = PyTuple_GET_ITEM(__pyx_args, 1);
101326     __pyx_v_enable_regexp = PyTuple_GET_ITEM(__pyx_args, 2);
101327     __pyx_v_smart_strings = PyTuple_GET_ITEM(__pyx_args, 3);
101328   }
101329   goto __pyx_L4_argument_unpacking_done;
101330   __pyx_L5_argtuple_error:;
101331   __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[17]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
101332   __pyx_L3_error:;
101333   __Pyx_AddTraceback("lxml.etree._XPathEvaluatorBase.__init__");
101334   return -1;
101335   __pyx_L4_argument_unpacking_done:;
101336   __pyx_v_warnings = Py_None; __Pyx_INCREF(Py_None);
101337
101338   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":111
101339  *                  smart_strings):
101340  *         global _XPATH_VERSION_WARNING_REQUIRED
101341  *         if _XPATH_VERSION_WARNING_REQUIRED:             # <<<<<<<<<<<<<<
101342  *             _XPATH_VERSION_WARNING_REQUIRED = 0
101343  *             import warnings
101344  */
101345   __pyx_t_1 = __pyx_v_4lxml_5etree__XPATH_VERSION_WARNING_REQUIRED;
101346   if (__pyx_t_1) {
101347
101348     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":112
101349  *         global _XPATH_VERSION_WARNING_REQUIRED
101350  *         if _XPATH_VERSION_WARNING_REQUIRED:
101351  *             _XPATH_VERSION_WARNING_REQUIRED = 0             # <<<<<<<<<<<<<<
101352  *             import warnings
101353  *             warnings.warn(u"This version of libxml2 has a known XPath bug. " + \
101354  */
101355     __pyx_v_4lxml_5etree__XPATH_VERSION_WARNING_REQUIRED = 0;
101356
101357     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":113
101358  *         if _XPATH_VERSION_WARNING_REQUIRED:
101359  *             _XPATH_VERSION_WARNING_REQUIRED = 0
101360  *             import warnings             # <<<<<<<<<<<<<<
101361  *             warnings.warn(u"This version of libxml2 has a known XPath bug. " + \
101362  *                           u"Use it at your own risk.")
101363  */
101364     __pyx_1 = __Pyx_Import(__pyx_kp_warnings, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101365     __Pyx_GOTREF(__pyx_1);
101366     __Pyx_DECREF(__pyx_v_warnings);
101367     __pyx_v_warnings = __pyx_1;
101368     __pyx_1 = 0;
101369
101370     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":114
101371  *             _XPATH_VERSION_WARNING_REQUIRED = 0
101372  *             import warnings
101373  *             warnings.warn(u"This version of libxml2 has a known XPath bug. " + \             # <<<<<<<<<<<<<<
101374  *                           u"Use it at your own risk.")
101375  *         self._error_log = _ErrorLog()
101376  */
101377     __pyx_t_2 = PyObject_GetAttr(__pyx_v_warnings, __pyx_kp_warn); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101378     __Pyx_GOTREF(__pyx_t_2);
101379
101380     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":115
101381  *             import warnings
101382  *             warnings.warn(u"This version of libxml2 has a known XPath bug. " + \
101383  *                           u"Use it at your own risk.")             # <<<<<<<<<<<<<<
101384  *         self._error_log = _ErrorLog()
101385  *         self._context = _XPathContext(namespaces, extensions,
101386  */
101387     __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_kp_591), ((PyObject *)__pyx_kp_592)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101388     __Pyx_GOTREF(__pyx_t_3);
101389     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101390     __Pyx_GOTREF(((PyObject *)__pyx_t_4));
101391     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
101392     __Pyx_GIVEREF(__pyx_t_3);
101393     __pyx_t_3 = 0;
101394     __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101395     __Pyx_GOTREF(__pyx_t_3);
101396     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
101397     __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
101398     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
101399     goto __pyx_L6;
101400   }
101401   __pyx_L6:;
101402
101403   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":116
101404  *             warnings.warn(u"This version of libxml2 has a known XPath bug. " + \
101405  *                           u"Use it at your own risk.")
101406  *         self._error_log = _ErrorLog()             # <<<<<<<<<<<<<<
101407  *         self._context = _XPathContext(namespaces, extensions,
101408  *                                       enable_regexp, None, smart_strings)
101409  */
101410   __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ErrorLog)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101411   __Pyx_GOTREF(__pyx_t_3);
101412   if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4lxml_5etree__ErrorLog))) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101413   __Pyx_GIVEREF(__pyx_t_3);
101414   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)->_error_log);
101415   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)->_error_log));
101416   ((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_t_3);
101417   __pyx_t_3 = 0;
101418
101419   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":118
101420  *         self._error_log = _ErrorLog()
101421  *         self._context = _XPathContext(namespaces, extensions,
101422  *                                       enable_regexp, None, smart_strings)             # <<<<<<<<<<<<<<
101423  *         if config.ENABLE_THREADING:
101424  *             self._eval_lock = python.PyThread_allocate_lock()
101425  */
101426   __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101427   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
101428   __Pyx_INCREF(__pyx_v_namespaces);
101429   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_namespaces);
101430   __Pyx_GIVEREF(__pyx_v_namespaces);
101431   __Pyx_INCREF(__pyx_v_extensions);
101432   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_extensions);
101433   __Pyx_GIVEREF(__pyx_v_extensions);
101434   __Pyx_INCREF(__pyx_v_enable_regexp);
101435   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_enable_regexp);
101436   __Pyx_GIVEREF(__pyx_v_enable_regexp);
101437   __Pyx_INCREF(Py_None);
101438   PyTuple_SET_ITEM(__pyx_t_3, 3, Py_None);
101439   __Pyx_GIVEREF(Py_None);
101440   __Pyx_INCREF(__pyx_v_smart_strings);
101441   PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_smart_strings);
101442   __Pyx_GIVEREF(__pyx_v_smart_strings);
101443   __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__XPathContext)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101444   __Pyx_GOTREF(__pyx_t_4);
101445   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
101446   if (!(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__XPathContext))) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101447
101448   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":117
101449  *                           u"Use it at your own risk.")
101450  *         self._error_log = _ErrorLog()
101451  *         self._context = _XPathContext(namespaces, extensions,             # <<<<<<<<<<<<<<
101452  *                                       enable_regexp, None, smart_strings)
101453  *         if config.ENABLE_THREADING:
101454  */
101455   __Pyx_GIVEREF(__pyx_t_4);
101456   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)->_context);
101457   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)->_context));
101458   ((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)->_context = ((struct __pyx_obj_4lxml_5etree__XPathContext *)__pyx_t_4);
101459   __pyx_t_4 = 0;
101460
101461   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":119
101462  *         self._context = _XPathContext(namespaces, extensions,
101463  *                                       enable_regexp, None, smart_strings)
101464  *         if config.ENABLE_THREADING:             # <<<<<<<<<<<<<<
101465  *             self._eval_lock = python.PyThread_allocate_lock()
101466  *             if self._eval_lock is NULL:
101467  */
101468   __pyx_t_1 = ENABLE_THREADING;
101469   if (__pyx_t_1) {
101470
101471     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":120
101472  *                                       enable_regexp, None, smart_strings)
101473  *         if config.ENABLE_THREADING:
101474  *             self._eval_lock = python.PyThread_allocate_lock()             # <<<<<<<<<<<<<<
101475  *             if self._eval_lock is NULL:
101476  *                 python.PyErr_NoMemory()
101477  */
101478     ((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)->_eval_lock = PyThread_allocate_lock();
101479
101480     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":121
101481  *         if config.ENABLE_THREADING:
101482  *             self._eval_lock = python.PyThread_allocate_lock()
101483  *             if self._eval_lock is NULL:             # <<<<<<<<<<<<<<
101484  *                 python.PyErr_NoMemory()
101485  * 
101486  */
101487     __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)->_eval_lock == NULL);
101488     if (__pyx_t_1) {
101489
101490       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":122
101491  *             self._eval_lock = python.PyThread_allocate_lock()
101492  *             if self._eval_lock is NULL:
101493  *                 python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
101494  * 
101495  *     property error_log:
101496  */
101497       __pyx_t_4 = PyErr_NoMemory(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101498       __Pyx_GOTREF(__pyx_t_4);
101499       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
101500       goto __pyx_L8;
101501     }
101502     __pyx_L8:;
101503     goto __pyx_L7;
101504   }
101505   __pyx_L7:;
101506
101507   __pyx_r = 0;
101508   goto __pyx_L0;
101509   __pyx_L1_error:;
101510   __Pyx_XDECREF(__pyx_1);
101511   __Pyx_XDECREF(__pyx_t_2);
101512   __Pyx_XDECREF(__pyx_t_3);
101513   __Pyx_XDECREF(__pyx_t_4);
101514   __Pyx_AddTraceback("lxml.etree._XPathEvaluatorBase.__init__");
101515   __pyx_r = -1;
101516   __pyx_L0:;
101517   __Pyx_DECREF(__pyx_v_warnings);
101518   __Pyx_FinishRefcountContext();
101519   return __pyx_r;
101520 }
101521
101522 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":125
101523  * 
101524  *     property error_log:
101525  *         def __get__(self):             # <<<<<<<<<<<<<<
101526  *             return self._error_log.copy()
101527  * 
101528  */
101529
101530 static PyObject *__pyx_pf_4lxml_5etree_19_XPathEvaluatorBase_9error_log___get__(PyObject *__pyx_v_self); /*proto*/
101531 static PyObject *__pyx_pf_4lxml_5etree_19_XPathEvaluatorBase_9error_log___get__(PyObject *__pyx_v_self) {
101532   PyObject *__pyx_r = NULL;
101533   PyObject *__pyx_t_1 = NULL;
101534   PyObject *__pyx_t_2 = NULL;
101535   __Pyx_SetupRefcountContext("__get__");
101536
101537   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":126
101538  *     property error_log:
101539  *         def __get__(self):
101540  *             return self._error_log.copy()             # <<<<<<<<<<<<<<
101541  * 
101542  *     def __dealloc__(self):
101543  */
101544   __Pyx_XDECREF(__pyx_r);
101545   __pyx_t_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)->_error_log), __pyx_kp_copy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101546   __Pyx_GOTREF(__pyx_t_1);
101547   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101548   __Pyx_GOTREF(__pyx_t_2);
101549   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
101550   __pyx_r = __pyx_t_2;
101551   __pyx_t_2 = 0;
101552   goto __pyx_L0;
101553
101554   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
101555   goto __pyx_L0;
101556   __pyx_L1_error:;
101557   __Pyx_XDECREF(__pyx_t_1);
101558   __Pyx_XDECREF(__pyx_t_2);
101559   __Pyx_AddTraceback("lxml.etree._XPathEvaluatorBase.error_log.__get__");
101560   __pyx_r = NULL;
101561   __pyx_L0:;
101562   __Pyx_XGIVEREF(__pyx_r);
101563   __Pyx_FinishRefcountContext();
101564   return __pyx_r;
101565 }
101566
101567 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":128
101568  *             return self._error_log.copy()
101569  * 
101570  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
101571  *         if self._xpathCtxt is not NULL:
101572  *             xpath.xmlXPathFreeContext(self._xpathCtxt)
101573  */
101574
101575 static void __pyx_pf_4lxml_5etree_19_XPathEvaluatorBase___dealloc__(PyObject *__pyx_v_self); /*proto*/
101576 static void __pyx_pf_4lxml_5etree_19_XPathEvaluatorBase___dealloc__(PyObject *__pyx_v_self) {
101577   int __pyx_t_1;
101578   __Pyx_SetupRefcountContext("__dealloc__");
101579
101580   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":129
101581  * 
101582  *     def __dealloc__(self):
101583  *         if self._xpathCtxt is not NULL:             # <<<<<<<<<<<<<<
101584  *             xpath.xmlXPathFreeContext(self._xpathCtxt)
101585  *         if config.ENABLE_THREADING:
101586  */
101587   __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)->_xpathCtxt != NULL);
101588   if (__pyx_t_1) {
101589
101590     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":130
101591  *     def __dealloc__(self):
101592  *         if self._xpathCtxt is not NULL:
101593  *             xpath.xmlXPathFreeContext(self._xpathCtxt)             # <<<<<<<<<<<<<<
101594  *         if config.ENABLE_THREADING:
101595  *             if self._eval_lock is not NULL:
101596  */
101597     xmlXPathFreeContext(((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)->_xpathCtxt);
101598     goto __pyx_L5;
101599   }
101600   __pyx_L5:;
101601
101602   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":131
101603  *         if self._xpathCtxt is not NULL:
101604  *             xpath.xmlXPathFreeContext(self._xpathCtxt)
101605  *         if config.ENABLE_THREADING:             # <<<<<<<<<<<<<<
101606  *             if self._eval_lock is not NULL:
101607  *                 python.PyThread_free_lock(self._eval_lock)
101608  */
101609   __pyx_t_1 = ENABLE_THREADING;
101610   if (__pyx_t_1) {
101611
101612     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":132
101613  *             xpath.xmlXPathFreeContext(self._xpathCtxt)
101614  *         if config.ENABLE_THREADING:
101615  *             if self._eval_lock is not NULL:             # <<<<<<<<<<<<<<
101616  *                 python.PyThread_free_lock(self._eval_lock)
101617  * 
101618  */
101619     __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)->_eval_lock != NULL);
101620     if (__pyx_t_1) {
101621
101622       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":133
101623  *         if config.ENABLE_THREADING:
101624  *             if self._eval_lock is not NULL:
101625  *                 python.PyThread_free_lock(self._eval_lock)             # <<<<<<<<<<<<<<
101626  * 
101627  *     cdef set_context(self, xpath.xmlXPathContext* xpathCtxt):
101628  */
101629       PyThread_free_lock(((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)->_eval_lock);
101630       goto __pyx_L7;
101631     }
101632     __pyx_L7:;
101633     goto __pyx_L6;
101634   }
101635   __pyx_L6:;
101636
101637   __Pyx_FinishRefcountContext();
101638 }
101639
101640 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":135
101641  *                 python.PyThread_free_lock(self._eval_lock)
101642  * 
101643  *     cdef set_context(self, xpath.xmlXPathContext* xpathCtxt):             # <<<<<<<<<<<<<<
101644  *         self._xpathCtxt = xpathCtxt
101645  *         self._context.set_context(xpathCtxt)
101646  */
101647
101648 static  PyObject *__pyx_f_4lxml_5etree_19_XPathEvaluatorBase_set_context(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *__pyx_v_self, xmlXPathContext *__pyx_v_xpathCtxt) {
101649   PyObject *__pyx_r = NULL;
101650   PyObject *__pyx_t_1 = NULL;
101651   __Pyx_SetupRefcountContext("set_context");
101652
101653   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":136
101654  * 
101655  *     cdef set_context(self, xpath.xmlXPathContext* xpathCtxt):
101656  *         self._xpathCtxt = xpathCtxt             # <<<<<<<<<<<<<<
101657  *         self._context.set_context(xpathCtxt)
101658  * 
101659  */
101660   __pyx_v_self->_xpathCtxt = __pyx_v_xpathCtxt;
101661
101662   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":137
101663  *     cdef set_context(self, xpath.xmlXPathContext* xpathCtxt):
101664  *         self._xpathCtxt = xpathCtxt
101665  *         self._context.set_context(xpathCtxt)             # <<<<<<<<<<<<<<
101666  * 
101667  *     def evaluate(self, _eval_arg, **_variables):
101668  */
101669   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)__pyx_v_self->_context->__pyx_base.__pyx_vtab)->set_context(__pyx_v_self->_context, __pyx_v_xpathCtxt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101670   __Pyx_GOTREF(__pyx_t_1);
101671   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
101672
101673   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
101674   goto __pyx_L0;
101675   __pyx_L1_error:;
101676   __Pyx_XDECREF(__pyx_t_1);
101677   __Pyx_AddTraceback("lxml.etree._XPathEvaluatorBase.set_context");
101678   __pyx_r = 0;
101679   __pyx_L0:;
101680   __Pyx_XGIVEREF(__pyx_r);
101681   __Pyx_FinishRefcountContext();
101682   return __pyx_r;
101683 }
101684
101685 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":139
101686  *         self._context.set_context(xpathCtxt)
101687  * 
101688  *     def evaluate(self, _eval_arg, **_variables):             # <<<<<<<<<<<<<<
101689  *         u"""evaluate(self, _eval_arg, **_variables)
101690  * 
101691  */
101692
101693 static PyObject *__pyx_pf_4lxml_5etree_19_XPathEvaluatorBase_evaluate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
101694 static char __pyx_doc_4lxml_5etree_19_XPathEvaluatorBase_evaluate[] = "evaluate(self, _eval_arg, **_variables)\n\n        Evaluate an XPath expression.\n\n        Instead of calling this method, you can also call the evaluator object\n        itself.\n\n        Variables may be provided as keyword arguments.  Note that namespaces\n        are currently not supported for variables.\n\n        :deprecated: call the object, not its method.\n        ";
101695 static PyObject *__pyx_pf_4lxml_5etree_19_XPathEvaluatorBase_evaluate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
101696   PyObject *__pyx_v__eval_arg = 0;
101697   PyObject *__pyx_v__variables = 0;
101698   PyObject *__pyx_r = NULL;
101699   PyObject *__pyx_t_1 = NULL;
101700   PyObject *__pyx_t_2 = NULL;
101701   static PyObject **__pyx_pyargnames[] = {&__pyx_kp__eval_arg,0};
101702   __Pyx_SetupRefcountContext("evaluate");
101703   __pyx_v__variables = PyDict_New(); if (unlikely(!__pyx_v__variables)) return NULL;
101704   __Pyx_GOTREF(__pyx_v__variables);
101705   if (unlikely(__pyx_kwds)) {
101706     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
101707     PyObject* values[1] = {0};
101708     switch (PyTuple_GET_SIZE(__pyx_args)) {
101709       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
101710       case  0: break;
101711       default: goto __pyx_L5_argtuple_error;
101712     }
101713     switch (PyTuple_GET_SIZE(__pyx_args)) {
101714       case  0:
101715       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp__eval_arg);
101716       if (likely(values[0])) kw_args--;
101717       else goto __pyx_L5_argtuple_error;
101718     }
101719     if (unlikely(kw_args > 0)) {
101720       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__variables, values, PyTuple_GET_SIZE(__pyx_args), "evaluate") < 0)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
101721     }
101722     __pyx_v__eval_arg = values[0];
101723   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
101724     goto __pyx_L5_argtuple_error;
101725   } else {
101726     __pyx_v__eval_arg = PyTuple_GET_ITEM(__pyx_args, 0);
101727   }
101728   goto __pyx_L4_argument_unpacking_done;
101729   __pyx_L5_argtuple_error:;
101730   __Pyx_RaiseArgtupleInvalid("evaluate", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[17]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
101731   __pyx_L3_error:;
101732   __Pyx_DECREF(__pyx_v__variables);
101733   __Pyx_AddTraceback("lxml.etree._XPathEvaluatorBase.evaluate");
101734   return NULL;
101735   __pyx_L4_argument_unpacking_done:;
101736
101737   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":152
101738  *         :deprecated: call the object, not its method.
101739  *         """
101740  *         return self(_eval_arg, **_variables)             # <<<<<<<<<<<<<<
101741  * 
101742  *     cdef bint _checkAbsolutePath(self, char* path):
101743  */
101744   __Pyx_XDECREF(__pyx_r);
101745   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101746   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
101747   __Pyx_INCREF(__pyx_v__eval_arg);
101748   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__eval_arg);
101749   __Pyx_GIVEREF(__pyx_v__eval_arg);
101750   __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_v_self, ((PyObject *)__pyx_t_1), __pyx_v__variables); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101751   __Pyx_GOTREF(__pyx_t_2);
101752   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
101753   __pyx_r = __pyx_t_2;
101754   __pyx_t_2 = 0;
101755   goto __pyx_L0;
101756
101757   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
101758   goto __pyx_L0;
101759   __pyx_L1_error:;
101760   __Pyx_XDECREF(__pyx_t_1);
101761   __Pyx_XDECREF(__pyx_t_2);
101762   __Pyx_AddTraceback("lxml.etree._XPathEvaluatorBase.evaluate");
101763   __pyx_r = NULL;
101764   __pyx_L0:;
101765   __Pyx_DECREF(__pyx_v__variables);
101766   __Pyx_XGIVEREF(__pyx_r);
101767   __Pyx_FinishRefcountContext();
101768   return __pyx_r;
101769 }
101770
101771 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":154
101772  *         return self(_eval_arg, **_variables)
101773  * 
101774  *     cdef bint _checkAbsolutePath(self, char* path):             # <<<<<<<<<<<<<<
101775  *         cdef char c
101776  *         if path is NULL:
101777  */
101778
101779 static  int __pyx_f_4lxml_5etree_19_XPathEvaluatorBase__checkAbsolutePath(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *__pyx_v_self, char *__pyx_v_path) {
101780   char __pyx_v_c;
101781   int __pyx_r;
101782   int __pyx_t_1;
101783   __Pyx_SetupRefcountContext("_checkAbsolutePath");
101784
101785   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":156
101786  *     cdef bint _checkAbsolutePath(self, char* path):
101787  *         cdef char c
101788  *         if path is NULL:             # <<<<<<<<<<<<<<
101789  *             return 0
101790  *         c = path[0]
101791  */
101792   __pyx_t_1 = (__pyx_v_path == NULL);
101793   if (__pyx_t_1) {
101794
101795     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":157
101796  *         cdef char c
101797  *         if path is NULL:
101798  *             return 0             # <<<<<<<<<<<<<<
101799  *         c = path[0]
101800  *         while c == c' ' or c == c'\t':
101801  */
101802     __pyx_r = 0;
101803     goto __pyx_L0;
101804     goto __pyx_L3;
101805   }
101806   __pyx_L3:;
101807
101808   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":158
101809  *         if path is NULL:
101810  *             return 0
101811  *         c = path[0]             # <<<<<<<<<<<<<<
101812  *         while c == c' ' or c == c'\t':
101813  *             path = path + 1
101814  */
101815   __pyx_v_c = (__pyx_v_path[0]);
101816
101817   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":159
101818  *             return 0
101819  *         c = path[0]
101820  *         while c == c' ' or c == c'\t':             # <<<<<<<<<<<<<<
101821  *             path = path + 1
101822  *             c = path[0]
101823  */
101824   while (1) {
101825     if (!(__pyx_v_c == ' ')) {
101826       __pyx_t_1 = (__pyx_v_c == '\t');
101827     } else {
101828       __pyx_t_1 = (__pyx_v_c == ' ');
101829     }
101830     if (!__pyx_t_1) break;
101831
101832     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":160
101833  *         c = path[0]
101834  *         while c == c' ' or c == c'\t':
101835  *             path = path + 1             # <<<<<<<<<<<<<<
101836  *             c = path[0]
101837  *         return c == c'/'
101838  */
101839     __pyx_v_path = (__pyx_v_path + 1);
101840
101841     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":161
101842  *         while c == c' ' or c == c'\t':
101843  *             path = path + 1
101844  *             c = path[0]             # <<<<<<<<<<<<<<
101845  *         return c == c'/'
101846  * 
101847  */
101848     __pyx_v_c = (__pyx_v_path[0]);
101849   }
101850
101851   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":162
101852  *             path = path + 1
101853  *             c = path[0]
101854  *         return c == c'/'             # <<<<<<<<<<<<<<
101855  * 
101856  *     cdef int _lock(self) except -1:
101857  */
101858   __pyx_r = (__pyx_v_c == '/');
101859   goto __pyx_L0;
101860
101861   __pyx_r = 0;
101862   __pyx_L0:;
101863   __Pyx_FinishRefcountContext();
101864   return __pyx_r;
101865 }
101866
101867 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":164
101868  *         return c == c'/'
101869  * 
101870  *     cdef int _lock(self) except -1:             # <<<<<<<<<<<<<<
101871  *         cdef int result
101872  *         if config.ENABLE_THREADING and self._eval_lock != NULL:
101873  */
101874
101875 static  int __pyx_f_4lxml_5etree_19_XPathEvaluatorBase__lock(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *__pyx_v_self) {
101876   int __pyx_v_result;
101877   int __pyx_r;
101878   PyObject *__pyx_1 = 0;
101879   int __pyx_t_1;
101880   __Pyx_SetupRefcountContext("_lock");
101881
101882   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":166
101883  *     cdef int _lock(self) except -1:
101884  *         cdef int result
101885  *         if config.ENABLE_THREADING and self._eval_lock != NULL:             # <<<<<<<<<<<<<<
101886  *             with nogil:
101887  *                 result = python.PyThread_acquire_lock(
101888  */
101889   if (ENABLE_THREADING) {
101890     __pyx_t_1 = (__pyx_v_self->_eval_lock != NULL);
101891   } else {
101892     __pyx_t_1 = ENABLE_THREADING;
101893   }
101894   if (__pyx_t_1) {
101895
101896     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":167
101897  *         cdef int result
101898  *         if config.ENABLE_THREADING and self._eval_lock != NULL:
101899  *             with nogil:             # <<<<<<<<<<<<<<
101900  *                 result = python.PyThread_acquire_lock(
101901  *                     self._eval_lock, python.WAIT_LOCK)
101902  */
101903     { PyThreadState *_save;
101904       Py_UNBLOCK_THREADS
101905       /*try:*/ {
101906
101907         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":169
101908  *             with nogil:
101909  *                 result = python.PyThread_acquire_lock(
101910  *                     self._eval_lock, python.WAIT_LOCK)             # <<<<<<<<<<<<<<
101911  *             if result == 0:
101912  *                 raise ParserError, u"parser locking failed"
101913  */
101914         __pyx_v_result = PyThread_acquire_lock(__pyx_v_self->_eval_lock, WAIT_LOCK);
101915       }
101916       /*finally:*/ {
101917         Py_BLOCK_THREADS
101918       }
101919     }
101920
101921     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":170
101922  *                 result = python.PyThread_acquire_lock(
101923  *                     self._eval_lock, python.WAIT_LOCK)
101924  *             if result == 0:             # <<<<<<<<<<<<<<
101925  *                 raise ParserError, u"parser locking failed"
101926  *         return 0
101927  */
101928     __pyx_t_1 = (__pyx_v_result == 0);
101929     if (__pyx_t_1) {
101930
101931       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":171
101932  *                     self._eval_lock, python.WAIT_LOCK)
101933  *             if result == 0:
101934  *                 raise ParserError, u"parser locking failed"             # <<<<<<<<<<<<<<
101935  *         return 0
101936  * 
101937  */
101938       __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ParserError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101939       __Pyx_GOTREF(__pyx_1);
101940       __Pyx_Raise(__pyx_1, ((PyObject *)__pyx_kp_593), 0);
101941       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
101942       {__pyx_filename = __pyx_f[17]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
101943       goto __pyx_L7;
101944     }
101945     __pyx_L7:;
101946     goto __pyx_L3;
101947   }
101948   __pyx_L3:;
101949
101950   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":172
101951  *             if result == 0:
101952  *                 raise ParserError, u"parser locking failed"
101953  *         return 0             # <<<<<<<<<<<<<<
101954  * 
101955  *     cdef void _unlock(self):
101956  */
101957   __pyx_r = 0;
101958   goto __pyx_L0;
101959
101960   __pyx_r = 0;
101961   goto __pyx_L0;
101962   __pyx_L1_error:;
101963   __Pyx_XDECREF(__pyx_1);
101964   __Pyx_AddTraceback("lxml.etree._XPathEvaluatorBase._lock");
101965   __pyx_r = -1;
101966   __pyx_L0:;
101967   __Pyx_FinishRefcountContext();
101968   return __pyx_r;
101969 }
101970
101971 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":174
101972  *         return 0
101973  * 
101974  *     cdef void _unlock(self):             # <<<<<<<<<<<<<<
101975  *         if config.ENABLE_THREADING and self._eval_lock != NULL:
101976  *             python.PyThread_release_lock(self._eval_lock)
101977  */
101978
101979 static  void __pyx_f_4lxml_5etree_19_XPathEvaluatorBase__unlock(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *__pyx_v_self) {
101980   int __pyx_t_1;
101981   __Pyx_SetupRefcountContext("_unlock");
101982
101983   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":175
101984  * 
101985  *     cdef void _unlock(self):
101986  *         if config.ENABLE_THREADING and self._eval_lock != NULL:             # <<<<<<<<<<<<<<
101987  *             python.PyThread_release_lock(self._eval_lock)
101988  * 
101989  */
101990   if (ENABLE_THREADING) {
101991     __pyx_t_1 = (__pyx_v_self->_eval_lock != NULL);
101992   } else {
101993     __pyx_t_1 = ENABLE_THREADING;
101994   }
101995   if (__pyx_t_1) {
101996
101997     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":176
101998  *     cdef void _unlock(self):
101999  *         if config.ENABLE_THREADING and self._eval_lock != NULL:
102000  *             python.PyThread_release_lock(self._eval_lock)             # <<<<<<<<<<<<<<
102001  * 
102002  *     cdef _raise_parse_error(self):
102003  */
102004     PyThread_release_lock(__pyx_v_self->_eval_lock);
102005     goto __pyx_L3;
102006   }
102007   __pyx_L3:;
102008
102009   __Pyx_FinishRefcountContext();
102010 }
102011
102012 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":178
102013  *             python.PyThread_release_lock(self._eval_lock)
102014  * 
102015  *     cdef _raise_parse_error(self):             # <<<<<<<<<<<<<<
102016  *         cdef _BaseErrorLog entries
102017  *         entries = self._error_log.filter_types(_XPATH_SYNTAX_ERRORS)
102018  */
102019
102020 static  PyObject *__pyx_f_4lxml_5etree_19_XPathEvaluatorBase__raise_parse_error(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *__pyx_v_self) {
102021   struct __pyx_obj_4lxml_5etree__BaseErrorLog *__pyx_v_entries;
102022   PyObject *__pyx_v_message;
102023   PyObject *__pyx_r = NULL;
102024   PyObject *__pyx_1 = 0;
102025   PyObject *__pyx_t_1 = NULL;
102026   PyObject *__pyx_t_2 = NULL;
102027   PyObject *__pyx_t_3 = NULL;
102028   int __pyx_t_4;
102029   __Pyx_SetupRefcountContext("_raise_parse_error");
102030   __pyx_v_entries = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)Py_None); __Pyx_INCREF(Py_None);
102031   __pyx_v_message = Py_None; __Pyx_INCREF(Py_None);
102032
102033   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":180
102034  *     cdef _raise_parse_error(self):
102035  *         cdef _BaseErrorLog entries
102036  *         entries = self._error_log.filter_types(_XPATH_SYNTAX_ERRORS)             # <<<<<<<<<<<<<<
102037  *         if entries:
102038  *             message = entries._buildExceptionMessage(None)
102039  */
102040   __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->_error_log), __pyx_kp_filter_types); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102041   __Pyx_GOTREF(__pyx_t_1);
102042   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102043   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
102044   __Pyx_INCREF(__pyx_v_4lxml_5etree__XPATH_SYNTAX_ERRORS);
102045   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_4lxml_5etree__XPATH_SYNTAX_ERRORS);
102046   __Pyx_GIVEREF(__pyx_v_4lxml_5etree__XPATH_SYNTAX_ERRORS);
102047   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102048   __Pyx_GOTREF(__pyx_t_3);
102049   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
102050   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
102051   if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4lxml_5etree__BaseErrorLog))) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102052   __Pyx_DECREF(((PyObject *)__pyx_v_entries));
102053   __pyx_v_entries = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_t_3);
102054   __pyx_t_3 = 0;
102055
102056   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":181
102057  *         cdef _BaseErrorLog entries
102058  *         entries = self._error_log.filter_types(_XPATH_SYNTAX_ERRORS)
102059  *         if entries:             # <<<<<<<<<<<<<<
102060  *             message = entries._buildExceptionMessage(None)
102061  *             if message is not None:
102062  */
102063   __pyx_t_4 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_entries)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102064   if (__pyx_t_4) {
102065
102066     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":182
102067  *         entries = self._error_log.filter_types(_XPATH_SYNTAX_ERRORS)
102068  *         if entries:
102069  *             message = entries._buildExceptionMessage(None)             # <<<<<<<<<<<<<<
102070  *             if message is not None:
102071  *                 raise XPathSyntaxError(message, self._error_log)
102072  */
102073     __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseErrorLog *)__pyx_v_entries->__pyx_vtab)->_buildExceptionMessage(__pyx_v_entries, Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102074     __Pyx_GOTREF(__pyx_t_3);
102075     __Pyx_DECREF(__pyx_v_message);
102076     __pyx_v_message = __pyx_t_3;
102077     __pyx_t_3 = 0;
102078
102079     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":183
102080  *         if entries:
102081  *             message = entries._buildExceptionMessage(None)
102082  *             if message is not None:             # <<<<<<<<<<<<<<
102083  *                 raise XPathSyntaxError(message, self._error_log)
102084  *         raise XPathSyntaxError(self._error_log._buildExceptionMessage(
102085  */
102086     __pyx_t_4 = (__pyx_v_message != Py_None);
102087     if (__pyx_t_4) {
102088
102089       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":184
102090  *             message = entries._buildExceptionMessage(None)
102091  *             if message is not None:
102092  *                 raise XPathSyntaxError(message, self._error_log)             # <<<<<<<<<<<<<<
102093  *         raise XPathSyntaxError(self._error_log._buildExceptionMessage(
102094  *                 u"Error in xpath expression"),
102095  */
102096       __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XPathSyntaxError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102097       __Pyx_GOTREF(__pyx_1);
102098       __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102099       __Pyx_GOTREF(((PyObject *)__pyx_t_3));
102100       __Pyx_INCREF(__pyx_v_message);
102101       PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_message);
102102       __Pyx_GIVEREF(__pyx_v_message);
102103       __Pyx_INCREF(((PyObject *)__pyx_v_self->_error_log));
102104       PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self->_error_log));
102105       __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_error_log));
102106       __pyx_t_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102107       __Pyx_GOTREF(__pyx_t_2);
102108       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
102109       __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
102110       __Pyx_Raise(__pyx_t_2, 0, 0);
102111       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
102112       {__pyx_filename = __pyx_f[17]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102113       goto __pyx_L4;
102114     }
102115     __pyx_L4:;
102116     goto __pyx_L3;
102117   }
102118   __pyx_L3:;
102119
102120   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":185
102121  *             if message is not None:
102122  *                 raise XPathSyntaxError(message, self._error_log)
102123  *         raise XPathSyntaxError(self._error_log._buildExceptionMessage(             # <<<<<<<<<<<<<<
102124  *                 u"Error in xpath expression"),
102125  *                                self._error_log)
102126  */
102127   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XPathSyntaxError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102128   __Pyx_GOTREF(__pyx_1);
102129
102130   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":186
102131  *                 raise XPathSyntaxError(message, self._error_log)
102132  *         raise XPathSyntaxError(self._error_log._buildExceptionMessage(
102133  *                 u"Error in xpath expression"),             # <<<<<<<<<<<<<<
102134  *                                self._error_log)
102135  * 
102136  */
102137   __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)__pyx_v_self->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._buildExceptionMessage(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self->_error_log), ((PyObject *)__pyx_kp_594)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102138   __Pyx_GOTREF(__pyx_t_2);
102139
102140   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":187
102141  *         raise XPathSyntaxError(self._error_log._buildExceptionMessage(
102142  *                 u"Error in xpath expression"),
102143  *                                self._error_log)             # <<<<<<<<<<<<<<
102144  * 
102145  *     cdef _raise_eval_error(self):
102146  */
102147   __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102148   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
102149   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
102150   __Pyx_GIVEREF(__pyx_t_2);
102151   __Pyx_INCREF(((PyObject *)__pyx_v_self->_error_log));
102152   PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self->_error_log));
102153   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_error_log));
102154   __pyx_t_2 = 0;
102155   __pyx_t_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102156   __Pyx_GOTREF(__pyx_t_2);
102157   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
102158   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
102159   __Pyx_Raise(__pyx_t_2, 0, 0);
102160   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
102161   {__pyx_filename = __pyx_f[17]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102162
102163   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
102164   goto __pyx_L0;
102165   __pyx_L1_error:;
102166   __Pyx_XDECREF(__pyx_1);
102167   __Pyx_XDECREF(__pyx_t_1);
102168   __Pyx_XDECREF(__pyx_t_2);
102169   __Pyx_XDECREF(__pyx_t_3);
102170   __Pyx_AddTraceback("lxml.etree._XPathEvaluatorBase._raise_parse_error");
102171   __pyx_r = 0;
102172   __pyx_L0:;
102173   __Pyx_DECREF((PyObject *)__pyx_v_entries);
102174   __Pyx_DECREF(__pyx_v_message);
102175   __Pyx_XGIVEREF(__pyx_r);
102176   __Pyx_FinishRefcountContext();
102177   return __pyx_r;
102178 }
102179
102180 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":189
102181  *                                self._error_log)
102182  * 
102183  *     cdef _raise_eval_error(self):             # <<<<<<<<<<<<<<
102184  *         cdef _BaseErrorLog entries
102185  *         entries = self._error_log.filter_types(_XPATH_EVAL_ERRORS)
102186  */
102187
102188 static  PyObject *__pyx_f_4lxml_5etree_19_XPathEvaluatorBase__raise_eval_error(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *__pyx_v_self) {
102189   struct __pyx_obj_4lxml_5etree__BaseErrorLog *__pyx_v_entries;
102190   PyObject *__pyx_v_message;
102191   PyObject *__pyx_r = NULL;
102192   PyObject *__pyx_1 = 0;
102193   PyObject *__pyx_t_1 = NULL;
102194   PyObject *__pyx_t_2 = NULL;
102195   PyObject *__pyx_t_3 = NULL;
102196   int __pyx_t_4;
102197   int __pyx_t_5;
102198   __Pyx_SetupRefcountContext("_raise_eval_error");
102199   __pyx_v_entries = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)Py_None); __Pyx_INCREF(Py_None);
102200   __pyx_v_message = Py_None; __Pyx_INCREF(Py_None);
102201
102202   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":191
102203  *     cdef _raise_eval_error(self):
102204  *         cdef _BaseErrorLog entries
102205  *         entries = self._error_log.filter_types(_XPATH_EVAL_ERRORS)             # <<<<<<<<<<<<<<
102206  *         if not entries:
102207  *             entries = self._error_log.filter_types(_XPATH_SYNTAX_ERRORS)
102208  */
102209   __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->_error_log), __pyx_kp_filter_types); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102210   __Pyx_GOTREF(__pyx_t_1);
102211   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102212   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
102213   __Pyx_INCREF(__pyx_v_4lxml_5etree__XPATH_EVAL_ERRORS);
102214   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_4lxml_5etree__XPATH_EVAL_ERRORS);
102215   __Pyx_GIVEREF(__pyx_v_4lxml_5etree__XPATH_EVAL_ERRORS);
102216   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102217   __Pyx_GOTREF(__pyx_t_3);
102218   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
102219   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
102220   if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4lxml_5etree__BaseErrorLog))) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102221   __Pyx_DECREF(((PyObject *)__pyx_v_entries));
102222   __pyx_v_entries = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_t_3);
102223   __pyx_t_3 = 0;
102224
102225   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":192
102226  *         cdef _BaseErrorLog entries
102227  *         entries = self._error_log.filter_types(_XPATH_EVAL_ERRORS)
102228  *         if not entries:             # <<<<<<<<<<<<<<
102229  *             entries = self._error_log.filter_types(_XPATH_SYNTAX_ERRORS)
102230  *         if entries:
102231  */
102232   __pyx_t_4 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_entries)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102233   __pyx_t_5 = (!__pyx_t_4);
102234   if (__pyx_t_5) {
102235
102236     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":193
102237  *         entries = self._error_log.filter_types(_XPATH_EVAL_ERRORS)
102238  *         if not entries:
102239  *             entries = self._error_log.filter_types(_XPATH_SYNTAX_ERRORS)             # <<<<<<<<<<<<<<
102240  *         if entries:
102241  *             message = entries._buildExceptionMessage(None)
102242  */
102243     __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self->_error_log), __pyx_kp_filter_types); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102244     __Pyx_GOTREF(__pyx_t_3);
102245     __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102246     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
102247     __Pyx_INCREF(__pyx_v_4lxml_5etree__XPATH_SYNTAX_ERRORS);
102248     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_4lxml_5etree__XPATH_SYNTAX_ERRORS);
102249     __Pyx_GIVEREF(__pyx_v_4lxml_5etree__XPATH_SYNTAX_ERRORS);
102250     __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102251     __Pyx_GOTREF(__pyx_t_1);
102252     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
102253     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
102254     if (!(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__BaseErrorLog))) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102255     __Pyx_DECREF(((PyObject *)__pyx_v_entries));
102256     __pyx_v_entries = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_t_1);
102257     __pyx_t_1 = 0;
102258     goto __pyx_L3;
102259   }
102260   __pyx_L3:;
102261
102262   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":194
102263  *         if not entries:
102264  *             entries = self._error_log.filter_types(_XPATH_SYNTAX_ERRORS)
102265  *         if entries:             # <<<<<<<<<<<<<<
102266  *             message = entries._buildExceptionMessage(None)
102267  *             if message is not None:
102268  */
102269   __pyx_t_5 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_entries)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102270   if (__pyx_t_5) {
102271
102272     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":195
102273  *             entries = self._error_log.filter_types(_XPATH_SYNTAX_ERRORS)
102274  *         if entries:
102275  *             message = entries._buildExceptionMessage(None)             # <<<<<<<<<<<<<<
102276  *             if message is not None:
102277  *                 raise XPathEvalError(message, self._error_log)
102278  */
102279     __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseErrorLog *)__pyx_v_entries->__pyx_vtab)->_buildExceptionMessage(__pyx_v_entries, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102280     __Pyx_GOTREF(__pyx_t_1);
102281     __Pyx_DECREF(__pyx_v_message);
102282     __pyx_v_message = __pyx_t_1;
102283     __pyx_t_1 = 0;
102284
102285     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":196
102286  *         if entries:
102287  *             message = entries._buildExceptionMessage(None)
102288  *             if message is not None:             # <<<<<<<<<<<<<<
102289  *                 raise XPathEvalError(message, self._error_log)
102290  *         raise XPathEvalError(self._error_log._buildExceptionMessage(
102291  */
102292     __pyx_t_5 = (__pyx_v_message != Py_None);
102293     if (__pyx_t_5) {
102294
102295       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":197
102296  *             message = entries._buildExceptionMessage(None)
102297  *             if message is not None:
102298  *                 raise XPathEvalError(message, self._error_log)             # <<<<<<<<<<<<<<
102299  *         raise XPathEvalError(self._error_log._buildExceptionMessage(
102300  *                 u"Error in xpath expression"),
102301  */
102302       __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XPathEvalError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102303       __Pyx_GOTREF(__pyx_1);
102304       __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102305       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
102306       __Pyx_INCREF(__pyx_v_message);
102307       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_message);
102308       __Pyx_GIVEREF(__pyx_v_message);
102309       __Pyx_INCREF(((PyObject *)__pyx_v_self->_error_log));
102310       PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self->_error_log));
102311       __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_error_log));
102312       __pyx_t_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102313       __Pyx_GOTREF(__pyx_t_2);
102314       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
102315       __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
102316       __Pyx_Raise(__pyx_t_2, 0, 0);
102317       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
102318       {__pyx_filename = __pyx_f[17]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102319       goto __pyx_L5;
102320     }
102321     __pyx_L5:;
102322     goto __pyx_L4;
102323   }
102324   __pyx_L4:;
102325
102326   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":198
102327  *             if message is not None:
102328  *                 raise XPathEvalError(message, self._error_log)
102329  *         raise XPathEvalError(self._error_log._buildExceptionMessage(             # <<<<<<<<<<<<<<
102330  *                 u"Error in xpath expression"),
102331  *                              self._error_log)
102332  */
102333   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XPathEvalError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102334   __Pyx_GOTREF(__pyx_1);
102335
102336   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":199
102337  *                 raise XPathEvalError(message, self._error_log)
102338  *         raise XPathEvalError(self._error_log._buildExceptionMessage(
102339  *                 u"Error in xpath expression"),             # <<<<<<<<<<<<<<
102340  *                              self._error_log)
102341  * 
102342  */
102343   __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)__pyx_v_self->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._buildExceptionMessage(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self->_error_log), ((PyObject *)__pyx_kp_595)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102344   __Pyx_GOTREF(__pyx_t_2);
102345
102346   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":200
102347  *         raise XPathEvalError(self._error_log._buildExceptionMessage(
102348  *                 u"Error in xpath expression"),
102349  *                              self._error_log)             # <<<<<<<<<<<<<<
102350  * 
102351  *     cdef object _handle_result(self, xpath.xmlXPathObject* xpathObj, _Document doc):
102352  */
102353   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102354   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
102355   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
102356   __Pyx_GIVEREF(__pyx_t_2);
102357   __Pyx_INCREF(((PyObject *)__pyx_v_self->_error_log));
102358   PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self->_error_log));
102359   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_error_log));
102360   __pyx_t_2 = 0;
102361   __pyx_t_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102362   __Pyx_GOTREF(__pyx_t_2);
102363   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
102364   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
102365   __Pyx_Raise(__pyx_t_2, 0, 0);
102366   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
102367   {__pyx_filename = __pyx_f[17]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102368
102369   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
102370   goto __pyx_L0;
102371   __pyx_L1_error:;
102372   __Pyx_XDECREF(__pyx_1);
102373   __Pyx_XDECREF(__pyx_t_1);
102374   __Pyx_XDECREF(__pyx_t_2);
102375   __Pyx_XDECREF(__pyx_t_3);
102376   __Pyx_AddTraceback("lxml.etree._XPathEvaluatorBase._raise_eval_error");
102377   __pyx_r = 0;
102378   __pyx_L0:;
102379   __Pyx_DECREF((PyObject *)__pyx_v_entries);
102380   __Pyx_DECREF(__pyx_v_message);
102381   __Pyx_XGIVEREF(__pyx_r);
102382   __Pyx_FinishRefcountContext();
102383   return __pyx_r;
102384 }
102385
102386 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":202
102387  *                              self._error_log)
102388  * 
102389  *     cdef object _handle_result(self, xpath.xmlXPathObject* xpathObj, _Document doc):             # <<<<<<<<<<<<<<
102390  *         if self._context._exc._has_raised():
102391  *             if xpathObj is not NULL:
102392  */
102393
102394 static  PyObject *__pyx_f_4lxml_5etree_19_XPathEvaluatorBase__handle_result(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *__pyx_v_self, xmlXPathObject *__pyx_v_xpathObj, struct LxmlDocument *__pyx_v_doc) {
102395   PyObject *__pyx_v_result;
102396   PyObject *__pyx_r = NULL;
102397   int __pyx_t_1;
102398   PyObject *__pyx_t_2 = NULL;
102399   int __pyx_t_3;
102400   __Pyx_SetupRefcountContext("_handle_result");
102401   __pyx_v_result = Py_None; __Pyx_INCREF(Py_None);
102402
102403   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":203
102404  * 
102405  *     cdef object _handle_result(self, xpath.xmlXPathObject* xpathObj, _Document doc):
102406  *         if self._context._exc._has_raised():             # <<<<<<<<<<<<<<
102407  *             if xpathObj is not NULL:
102408  *                 _freeXPathObject(xpathObj)
102409  */
102410   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_self->_context->__pyx_base._exc->__pyx_vtab)->_has_raised(__pyx_v_self->_context->__pyx_base._exc);
102411   if (__pyx_t_1) {
102412
102413     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":204
102414  *     cdef object _handle_result(self, xpath.xmlXPathObject* xpathObj, _Document doc):
102415  *         if self._context._exc._has_raised():
102416  *             if xpathObj is not NULL:             # <<<<<<<<<<<<<<
102417  *                 _freeXPathObject(xpathObj)
102418  *                 xpathObj = NULL
102419  */
102420     __pyx_t_1 = (__pyx_v_xpathObj != NULL);
102421     if (__pyx_t_1) {
102422
102423       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":205
102424  *         if self._context._exc._has_raised():
102425  *             if xpathObj is not NULL:
102426  *                 _freeXPathObject(xpathObj)             # <<<<<<<<<<<<<<
102427  *                 xpathObj = NULL
102428  *             self._context._release_temp_refs()
102429  */
102430       __pyx_f_4lxml_5etree__freeXPathObject(__pyx_v_xpathObj);
102431
102432       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":206
102433  *             if xpathObj is not NULL:
102434  *                 _freeXPathObject(xpathObj)
102435  *                 xpathObj = NULL             # <<<<<<<<<<<<<<
102436  *             self._context._release_temp_refs()
102437  *             self._context._exc._raise_if_stored()
102438  */
102439       __pyx_v_xpathObj = NULL;
102440       goto __pyx_L4;
102441     }
102442     __pyx_L4:;
102443
102444     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":207
102445  *                 _freeXPathObject(xpathObj)
102446  *                 xpathObj = NULL
102447  *             self._context._release_temp_refs()             # <<<<<<<<<<<<<<
102448  *             self._context._exc._raise_if_stored()
102449  * 
102450  */
102451     __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)__pyx_v_self->_context->__pyx_base.__pyx_vtab)->__pyx_base._release_temp_refs(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self->_context)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102452     __Pyx_GOTREF(__pyx_t_2);
102453     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
102454
102455     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":208
102456  *                 xpathObj = NULL
102457  *             self._context._release_temp_refs()
102458  *             self._context._exc._raise_if_stored()             # <<<<<<<<<<<<<<
102459  * 
102460  *         if xpathObj is NULL:
102461  */
102462     __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_self->_context->__pyx_base._exc->__pyx_vtab)->_raise_if_stored(__pyx_v_self->_context->__pyx_base._exc); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102463     goto __pyx_L3;
102464   }
102465   __pyx_L3:;
102466
102467   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":210
102468  *             self._context._exc._raise_if_stored()
102469  * 
102470  *         if xpathObj is NULL:             # <<<<<<<<<<<<<<
102471  *             self._context._release_temp_refs()
102472  *             self._raise_eval_error()
102473  */
102474   __pyx_t_1 = (__pyx_v_xpathObj == NULL);
102475   if (__pyx_t_1) {
102476
102477     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":211
102478  * 
102479  *         if xpathObj is NULL:
102480  *             self._context._release_temp_refs()             # <<<<<<<<<<<<<<
102481  *             self._raise_eval_error()
102482  * 
102483  */
102484     __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)__pyx_v_self->_context->__pyx_base.__pyx_vtab)->__pyx_base._release_temp_refs(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self->_context)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102485     __Pyx_GOTREF(__pyx_t_2);
102486     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
102487
102488     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":212
102489  *         if xpathObj is NULL:
102490  *             self._context._release_temp_refs()
102491  *             self._raise_eval_error()             # <<<<<<<<<<<<<<
102492  * 
102493  *         try:
102494  */
102495     __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self->__pyx_vtab)->_raise_eval_error(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102496     __Pyx_GOTREF(__pyx_t_2);
102497     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
102498     goto __pyx_L5;
102499   }
102500   __pyx_L5:;
102501
102502   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":214
102503  *             self._raise_eval_error()
102504  * 
102505  *         try:             # <<<<<<<<<<<<<<
102506  *             result = _unwrapXPathObject(xpathObj, doc,
102507  *                                         self._context._build_smart_strings)
102508  */
102509   /*try:*/ {
102510
102511     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":216
102512  *         try:
102513  *             result = _unwrapXPathObject(xpathObj, doc,
102514  *                                         self._context._build_smart_strings)             # <<<<<<<<<<<<<<
102515  *         finally:
102516  *             _freeXPathObject(xpathObj)
102517  */
102518     __pyx_t_2 = __pyx_f_4lxml_5etree__unwrapXPathObject(__pyx_v_xpathObj, __pyx_v_doc, __pyx_v_self->_context->__pyx_base._build_smart_strings); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L7;}
102519     __Pyx_GOTREF(__pyx_t_2);
102520     __Pyx_DECREF(__pyx_v_result);
102521     __pyx_v_result = __pyx_t_2;
102522     __pyx_t_2 = 0;
102523   }
102524   /*finally:*/ {
102525     int __pyx_why;
102526     PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
102527     int __pyx_exc_lineno;
102528     __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
102529     __pyx_why = 0; goto __pyx_L8;
102530     __pyx_L7: {
102531       __pyx_why = 4;
102532       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
102533       __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
102534       __pyx_exc_lineno = __pyx_lineno;
102535       goto __pyx_L8;
102536     }
102537     __pyx_L8:;
102538
102539     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":218
102540  *                                         self._context._build_smart_strings)
102541  *         finally:
102542  *             _freeXPathObject(xpathObj)             # <<<<<<<<<<<<<<
102543  *             self._context._release_temp_refs()
102544  * 
102545  */
102546     __pyx_f_4lxml_5etree__freeXPathObject(__pyx_v_xpathObj);
102547
102548     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":219
102549  *         finally:
102550  *             _freeXPathObject(xpathObj)
102551  *             self._context._release_temp_refs()             # <<<<<<<<<<<<<<
102552  * 
102553  *         return result
102554  */
102555     __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)__pyx_v_self->_context->__pyx_base.__pyx_vtab)->__pyx_base._release_temp_refs(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self->_context)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
102556     __Pyx_GOTREF(__pyx_t_2);
102557     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
102558     goto __pyx_L10;
102559     __pyx_L9_error:;
102560     if (__pyx_why == 4) {
102561       Py_XDECREF(__pyx_exc_type);
102562       Py_XDECREF(__pyx_exc_value);
102563       Py_XDECREF(__pyx_exc_tb);
102564     }
102565     goto __pyx_L1_error;
102566     __pyx_L10:;
102567     switch (__pyx_why) {
102568       case 4: {
102569         __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
102570         __pyx_lineno = __pyx_exc_lineno;
102571         __pyx_exc_type = 0;
102572         __pyx_exc_value = 0;
102573         __pyx_exc_tb = 0;
102574         goto __pyx_L1_error;
102575       }
102576     }
102577   }
102578
102579   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":221
102580  *             self._context._release_temp_refs()
102581  * 
102582  *         return result             # <<<<<<<<<<<<<<
102583  * 
102584  * 
102585  */
102586   __Pyx_XDECREF(__pyx_r);
102587   __Pyx_INCREF(__pyx_v_result);
102588   __pyx_r = __pyx_v_result;
102589   goto __pyx_L0;
102590
102591   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
102592   goto __pyx_L0;
102593   __pyx_L1_error:;
102594   __Pyx_XDECREF(__pyx_t_2);
102595   __Pyx_AddTraceback("lxml.etree._XPathEvaluatorBase._handle_result");
102596   __pyx_r = 0;
102597   __pyx_L0:;
102598   __Pyx_DECREF(__pyx_v_result);
102599   __Pyx_XGIVEREF(__pyx_r);
102600   __Pyx_FinishRefcountContext();
102601   return __pyx_r;
102602 }
102603
102604 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":238
102605  *     """
102606  *     cdef _Element _element
102607  *     def __init__(self, _Element element not None, *, namespaces=None,             # <<<<<<<<<<<<<<
102608  *                  extensions=None, regexp=True, smart_strings=True):
102609  *         cdef xpath.xmlXPathContext* xpathCtxt
102610  */
102611
102612 static int __pyx_pf_4lxml_5etree_21XPathElementEvaluator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
102613 static int __pyx_pf_4lxml_5etree_21XPathElementEvaluator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
102614   struct LxmlElement *__pyx_v_element = 0;
102615   PyObject *__pyx_v_namespaces = 0;
102616   PyObject *__pyx_v_extensions = 0;
102617   PyObject *__pyx_v_regexp = 0;
102618   PyObject *__pyx_v_smart_strings = 0;
102619   xmlXPathContext *__pyx_v_xpathCtxt;
102620   struct LxmlDocument *__pyx_v_doc;
102621   int __pyx_r;
102622   PyObject *__pyx_t_1 = NULL;
102623   PyObject *__pyx_t_2 = NULL;
102624   PyObject *__pyx_t_3 = NULL;
102625   int __pyx_t_4;
102626   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_element,&__pyx_kp_namespaces,&__pyx_kp_extensions,&__pyx_kp_regexp,&__pyx_kp_smart_strings,0};
102627   __Pyx_SetupRefcountContext("__init__");
102628   if (unlikely(__pyx_kwds)) {
102629     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
102630     PyObject* values[5] = {0,0,0,0,0};
102631     values[1] = Py_None;
102632     values[2] = Py_None;
102633     values[3] = __pyx_k_175;
102634     values[4] = __pyx_k_176;
102635     switch (PyTuple_GET_SIZE(__pyx_args)) {
102636       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
102637       case  0: break;
102638       default: goto __pyx_L5_argtuple_error;
102639     }
102640     switch (PyTuple_GET_SIZE(__pyx_args)) {
102641       case  0:
102642       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_element);
102643       if (likely(values[0])) kw_args--;
102644       else goto __pyx_L5_argtuple_error;
102645     }
102646     while (kw_args > 0) {
102647       PyObject* value;
102648       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_namespaces);
102649       if (value) { values[1] = value; if (!(--kw_args)) break; }
102650       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_extensions);
102651       if (value) { values[2] = value; if (!(--kw_args)) break; }
102652       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_regexp);
102653       if (value) { values[3] = value; if (!(--kw_args)) break; }
102654       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_smart_strings);
102655       if (value) { values[4] = value; if (!(--kw_args)) break; }
102656       break;
102657     }
102658     if (unlikely(kw_args > 0)) {
102659       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
102660     }
102661     __pyx_v_element = ((struct LxmlElement *)values[0]);
102662     __pyx_v_namespaces = values[1];
102663     __pyx_v_extensions = values[2];
102664     __pyx_v_regexp = values[3];
102665     __pyx_v_smart_strings = values[4];
102666   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
102667     goto __pyx_L5_argtuple_error;
102668   } else {
102669     __pyx_v_element = ((struct LxmlElement *)PyTuple_GET_ITEM(__pyx_args, 0));
102670     __pyx_v_namespaces = Py_None;
102671     __pyx_v_extensions = Py_None;
102672     __pyx_v_regexp = __pyx_k_175;
102673     __pyx_v_smart_strings = __pyx_k_176;
102674   }
102675   goto __pyx_L4_argument_unpacking_done;
102676   __pyx_L5_argtuple_error:;
102677   __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[17]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
102678   __pyx_L3_error:;
102679   __Pyx_AddTraceback("lxml.etree.XPathElementEvaluator.__init__");
102680   return -1;
102681   __pyx_L4_argument_unpacking_done:;
102682   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
102683   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element", 0))) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102684
102685   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":243
102686  *         cdef int ns_register_status
102687  *         cdef _Document doc
102688  *         self._element = element             # <<<<<<<<<<<<<<
102689  *         doc = element._doc
102690  *         _XPathEvaluatorBase.__init__(self, namespaces, extensions,
102691  */
102692   __Pyx_INCREF(((PyObject *)__pyx_v_element));
102693   __Pyx_GIVEREF(((PyObject *)__pyx_v_element));
102694   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->_element);
102695   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->_element));
102696   ((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->_element = __pyx_v_element;
102697
102698   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":244
102699  *         cdef _Document doc
102700  *         self._element = element
102701  *         doc = element._doc             # <<<<<<<<<<<<<<
102702  *         _XPathEvaluatorBase.__init__(self, namespaces, extensions,
102703  *                                      regexp, smart_strings)
102704  */
102705   __Pyx_INCREF(((PyObject *)__pyx_v_element->_doc));
102706   __Pyx_DECREF(((PyObject *)__pyx_v_doc));
102707   __pyx_v_doc = __pyx_v_element->_doc;
102708
102709   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":245
102710  *         self._element = element
102711  *         doc = element._doc
102712  *         _XPathEvaluatorBase.__init__(self, namespaces, extensions,             # <<<<<<<<<<<<<<
102713  *                                      regexp, smart_strings)
102714  *         xpathCtxt = xpath.xmlXPathNewContext(doc._c_doc)
102715  */
102716   __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__XPathEvaluatorBase)), __pyx_kp___init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102717   __Pyx_GOTREF(__pyx_t_1);
102718
102719   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":246
102720  *         doc = element._doc
102721  *         _XPathEvaluatorBase.__init__(self, namespaces, extensions,
102722  *                                      regexp, smart_strings)             # <<<<<<<<<<<<<<
102723  *         xpathCtxt = xpath.xmlXPathNewContext(doc._c_doc)
102724  *         if xpathCtxt is NULL:
102725  */
102726   __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102727   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
102728   __Pyx_INCREF(__pyx_v_self);
102729   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
102730   __Pyx_GIVEREF(__pyx_v_self);
102731   __Pyx_INCREF(__pyx_v_namespaces);
102732   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_namespaces);
102733   __Pyx_GIVEREF(__pyx_v_namespaces);
102734   __Pyx_INCREF(__pyx_v_extensions);
102735   PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_extensions);
102736   __Pyx_GIVEREF(__pyx_v_extensions);
102737   __Pyx_INCREF(__pyx_v_regexp);
102738   PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_regexp);
102739   __Pyx_GIVEREF(__pyx_v_regexp);
102740   __Pyx_INCREF(__pyx_v_smart_strings);
102741   PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_smart_strings);
102742   __Pyx_GIVEREF(__pyx_v_smart_strings);
102743   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102744   __Pyx_GOTREF(__pyx_t_3);
102745   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
102746   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
102747   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
102748
102749   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":247
102750  *         _XPathEvaluatorBase.__init__(self, namespaces, extensions,
102751  *                                      regexp, smart_strings)
102752  *         xpathCtxt = xpath.xmlXPathNewContext(doc._c_doc)             # <<<<<<<<<<<<<<
102753  *         if xpathCtxt is NULL:
102754  *             python.PyErr_NoMemory()
102755  */
102756   __pyx_v_xpathCtxt = xmlXPathNewContext(__pyx_v_doc->_c_doc);
102757
102758   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":248
102759  *                                      regexp, smart_strings)
102760  *         xpathCtxt = xpath.xmlXPathNewContext(doc._c_doc)
102761  *         if xpathCtxt is NULL:             # <<<<<<<<<<<<<<
102762  *             python.PyErr_NoMemory()
102763  *         self.set_context(xpathCtxt)
102764  */
102765   __pyx_t_4 = (__pyx_v_xpathCtxt == NULL);
102766   if (__pyx_t_4) {
102767
102768     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":249
102769  *         xpathCtxt = xpath.xmlXPathNewContext(doc._c_doc)
102770  *         if xpathCtxt is NULL:
102771  *             python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
102772  *         self.set_context(xpathCtxt)
102773  * 
102774  */
102775     __pyx_t_3 = PyErr_NoMemory(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102776     __Pyx_GOTREF(__pyx_t_3);
102777     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
102778     goto __pyx_L6;
102779   }
102780   __pyx_L6:;
102781
102782   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":250
102783  *         if xpathCtxt is NULL:
102784  *             python.PyErr_NoMemory()
102785  *         self.set_context(xpathCtxt)             # <<<<<<<<<<<<<<
102786  * 
102787  *     def register_namespace(self, prefix, uri):
102788  */
102789   __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree_XPathElementEvaluator *)((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.set_context(((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self), __pyx_v_xpathCtxt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102790   __Pyx_GOTREF(__pyx_t_3);
102791   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
102792
102793   __pyx_r = 0;
102794   goto __pyx_L0;
102795   __pyx_L1_error:;
102796   __Pyx_XDECREF(__pyx_t_1);
102797   __Pyx_XDECREF(__pyx_t_2);
102798   __Pyx_XDECREF(__pyx_t_3);
102799   __Pyx_AddTraceback("lxml.etree.XPathElementEvaluator.__init__");
102800   __pyx_r = -1;
102801   __pyx_L0:;
102802   __Pyx_DECREF((PyObject *)__pyx_v_doc);
102803   __Pyx_FinishRefcountContext();
102804   return __pyx_r;
102805 }
102806
102807 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":252
102808  *         self.set_context(xpathCtxt)
102809  * 
102810  *     def register_namespace(self, prefix, uri):             # <<<<<<<<<<<<<<
102811  *         u"""Register a namespace with the XPath context.
102812  *         """
102813  */
102814
102815 static PyObject *__pyx_pf_4lxml_5etree_21XPathElementEvaluator_register_namespace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
102816 static char __pyx_doc_4lxml_5etree_21XPathElementEvaluator_register_namespace[] = "Register a namespace with the XPath context.\n        ";
102817 static PyObject *__pyx_pf_4lxml_5etree_21XPathElementEvaluator_register_namespace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
102818   PyObject *__pyx_v_prefix = 0;
102819   PyObject *__pyx_v_uri = 0;
102820   PyObject *__pyx_r = NULL;
102821   PyObject *__pyx_t_1 = NULL;
102822   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_prefix,&__pyx_kp_uri,0};
102823   __Pyx_SetupRefcountContext("register_namespace");
102824   if (unlikely(__pyx_kwds)) {
102825     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
102826     PyObject* values[2] = {0,0};
102827     switch (PyTuple_GET_SIZE(__pyx_args)) {
102828       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
102829       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
102830       case  0: break;
102831       default: goto __pyx_L5_argtuple_error;
102832     }
102833     switch (PyTuple_GET_SIZE(__pyx_args)) {
102834       case  0:
102835       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_prefix);
102836       if (likely(values[0])) kw_args--;
102837       else goto __pyx_L5_argtuple_error;
102838       case  1:
102839       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_uri);
102840       if (likely(values[1])) kw_args--;
102841       else {
102842         __Pyx_RaiseArgtupleInvalid("register_namespace", 1, 2, 2, 1); {__pyx_filename = __pyx_f[17]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
102843       }
102844     }
102845     if (unlikely(kw_args > 0)) {
102846       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "register_namespace") < 0)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
102847     }
102848     __pyx_v_prefix = values[0];
102849     __pyx_v_uri = values[1];
102850   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
102851     goto __pyx_L5_argtuple_error;
102852   } else {
102853     __pyx_v_prefix = PyTuple_GET_ITEM(__pyx_args, 0);
102854     __pyx_v_uri = PyTuple_GET_ITEM(__pyx_args, 1);
102855   }
102856   goto __pyx_L4_argument_unpacking_done;
102857   __pyx_L5_argtuple_error:;
102858   __Pyx_RaiseArgtupleInvalid("register_namespace", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[17]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
102859   __pyx_L3_error:;
102860   __Pyx_AddTraceback("lxml.etree.XPathElementEvaluator.register_namespace");
102861   return NULL;
102862   __pyx_L4_argument_unpacking_done:;
102863
102864   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":255
102865  *         u"""Register a namespace with the XPath context.
102866  *         """
102867  *         self._context.addNamespace(prefix, uri)             # <<<<<<<<<<<<<<
102868  * 
102869  *     def register_namespaces(self, namespaces):
102870  */
102871   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base._context->__pyx_base.__pyx_vtab)->__pyx_base.addNamespace(((struct __pyx_obj_4lxml_5etree__BaseContext *)((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base._context), __pyx_v_prefix, __pyx_v_uri); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102872   __Pyx_GOTREF(__pyx_t_1);
102873   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
102874
102875   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
102876   goto __pyx_L0;
102877   __pyx_L1_error:;
102878   __Pyx_XDECREF(__pyx_t_1);
102879   __Pyx_AddTraceback("lxml.etree.XPathElementEvaluator.register_namespace");
102880   __pyx_r = NULL;
102881   __pyx_L0:;
102882   __Pyx_XGIVEREF(__pyx_r);
102883   __Pyx_FinishRefcountContext();
102884   return __pyx_r;
102885 }
102886
102887 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":257
102888  *         self._context.addNamespace(prefix, uri)
102889  * 
102890  *     def register_namespaces(self, namespaces):             # <<<<<<<<<<<<<<
102891  *         u"""Register a prefix -> uri dict.
102892  *         """
102893  */
102894
102895 static PyObject *__pyx_pf_4lxml_5etree_21XPathElementEvaluator_register_namespaces(PyObject *__pyx_v_self, PyObject *__pyx_v_namespaces); /*proto*/
102896 static char __pyx_doc_4lxml_5etree_21XPathElementEvaluator_register_namespaces[] = "Register a prefix -> uri dict.\n        ";
102897 static PyObject *__pyx_pf_4lxml_5etree_21XPathElementEvaluator_register_namespaces(PyObject *__pyx_v_self, PyObject *__pyx_v_namespaces) {
102898   PyObject *__pyx_v_prefix;
102899   PyObject *__pyx_v_uri;
102900   PyObject *__pyx_r = NULL;
102901   PyObject *__pyx_1 = 0;
102902   PyObject *__pyx_2 = 0;
102903   PyObject *__pyx_3 = 0;
102904   Py_ssize_t __pyx_t_1;
102905   PyObject *__pyx_t_2 = NULL;
102906   PyObject *__pyx_t_3 = NULL;
102907   __Pyx_SetupRefcountContext("register_namespaces");
102908   __pyx_v_prefix = Py_None; __Pyx_INCREF(Py_None);
102909   __pyx_v_uri = Py_None; __Pyx_INCREF(Py_None);
102910
102911   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":260
102912  *         u"""Register a prefix -> uri dict.
102913  *         """
102914  *         for prefix, uri in namespaces.items():             # <<<<<<<<<<<<<<
102915  *             self._context.addNamespace(prefix, uri)
102916  * 
102917  */
102918   __pyx_t_2 = PyObject_GetAttr(__pyx_v_namespaces, __pyx_kp_items); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102919   __Pyx_GOTREF(__pyx_t_2);
102920   __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102921   __Pyx_GOTREF(__pyx_t_3);
102922   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
102923   if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
102924     __pyx_t_1 = 0; __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2);
102925   } else {
102926     __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102927     __Pyx_GOTREF(__pyx_t_2);
102928   }
102929   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
102930   for (;;) {
102931     if (likely(PyList_CheckExact(__pyx_t_2))) {
102932       if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break;
102933       __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
102934     } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
102935       if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
102936       __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
102937     } else {
102938       __pyx_t_3 = PyIter_Next(__pyx_t_2);
102939       if (!__pyx_t_3) {
102940         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102941         break;
102942       }
102943       __Pyx_GOTREF(__pyx_t_3);
102944     }
102945     if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) {
102946       PyObject* tuple = __pyx_t_3;
102947       __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
102948       __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
102949       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
102950       __Pyx_DECREF(__pyx_v_prefix);
102951       __pyx_v_prefix = __pyx_2;
102952       __pyx_2 = 0;
102953       __Pyx_DECREF(__pyx_v_uri);
102954       __pyx_v_uri = __pyx_3;
102955       __pyx_3 = 0;
102956     } else {
102957       __pyx_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102958       __Pyx_GOTREF(__pyx_1);
102959       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
102960       __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102961       __Pyx_GOTREF(__pyx_2);
102962       __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102963       __Pyx_GOTREF(__pyx_3);
102964       if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102965       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
102966       __Pyx_DECREF(__pyx_v_prefix);
102967       __pyx_v_prefix = __pyx_2;
102968       __pyx_2 = 0;
102969       __Pyx_DECREF(__pyx_v_uri);
102970       __pyx_v_uri = __pyx_3;
102971       __pyx_3 = 0;
102972     }
102973
102974     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":261
102975  *         """
102976  *         for prefix, uri in namespaces.items():
102977  *             self._context.addNamespace(prefix, uri)             # <<<<<<<<<<<<<<
102978  * 
102979  *     def __call__(self, _path, **_variables):
102980  */
102981     __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base._context->__pyx_base.__pyx_vtab)->__pyx_base.addNamespace(((struct __pyx_obj_4lxml_5etree__BaseContext *)((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base._context), __pyx_v_prefix, __pyx_v_uri); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
102982     __Pyx_GOTREF(__pyx_t_3);
102983     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
102984   }
102985   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
102986
102987   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
102988   goto __pyx_L0;
102989   __pyx_L1_error:;
102990   __Pyx_XDECREF(__pyx_1);
102991   __Pyx_XDECREF(__pyx_2);
102992   __Pyx_XDECREF(__pyx_3);
102993   __Pyx_XDECREF(__pyx_t_2);
102994   __Pyx_XDECREF(__pyx_t_3);
102995   __Pyx_AddTraceback("lxml.etree.XPathElementEvaluator.register_namespaces");
102996   __pyx_r = NULL;
102997   __pyx_L0:;
102998   __Pyx_DECREF(__pyx_v_prefix);
102999   __Pyx_DECREF(__pyx_v_uri);
103000   __Pyx_XGIVEREF(__pyx_r);
103001   __Pyx_FinishRefcountContext();
103002   return __pyx_r;
103003 }
103004
103005 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":263
103006  *             self._context.addNamespace(prefix, uri)
103007  * 
103008  *     def __call__(self, _path, **_variables):             # <<<<<<<<<<<<<<
103009  *         u"""__call__(self, _path, **_variables)
103010  * 
103011  */
103012
103013 static PyObject *__pyx_pf_4lxml_5etree_21XPathElementEvaluator___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
103014 static char __pyx_doc_4lxml_5etree_21XPathElementEvaluator___call__[] = "__call__(self, _path, **_variables)\n\n        Evaluate an XPath expression on the document.\n\n        Variables may be provided as keyword arguments.  Note that namespaces\n        are currently not supported for variables.\n\n        Absolute XPath expressions (starting with '/') will be evaluated\n        against the ElementTree as returned by getroottree().\n        ";
103015 static PyObject *__pyx_pf_4lxml_5etree_21XPathElementEvaluator___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
103016   PyObject *__pyx_v__path = 0;
103017   PyObject *__pyx_v__variables = 0;
103018   xmlXPathObject *__pyx_v_xpathObj;
103019   struct LxmlDocument *__pyx_v_doc;
103020   char *__pyx_v_c_path;
103021   PyObject *__pyx_v_path;
103022   PyObject *__pyx_v_result;
103023   PyObject *__pyx_r = NULL;
103024   PyObject *__pyx_t_1 = NULL;
103025   int __pyx_t_2;
103026   static PyObject **__pyx_pyargnames[] = {&__pyx_kp__path,0};
103027   __Pyx_SetupRefcountContext("__call__");
103028   __pyx_v__variables = PyDict_New(); if (unlikely(!__pyx_v__variables)) return NULL;
103029   __Pyx_GOTREF(__pyx_v__variables);
103030   if (unlikely(__pyx_kwds)) {
103031     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
103032     PyObject* values[1] = {0};
103033     switch (PyTuple_GET_SIZE(__pyx_args)) {
103034       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
103035       case  0: break;
103036       default: goto __pyx_L5_argtuple_error;
103037     }
103038     switch (PyTuple_GET_SIZE(__pyx_args)) {
103039       case  0:
103040       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp__path);
103041       if (likely(values[0])) kw_args--;
103042       else goto __pyx_L5_argtuple_error;
103043     }
103044     if (unlikely(kw_args > 0)) {
103045       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__variables, values, PyTuple_GET_SIZE(__pyx_args), "__call__") < 0)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
103046     }
103047     __pyx_v__path = values[0];
103048   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
103049     goto __pyx_L5_argtuple_error;
103050   } else {
103051     __pyx_v__path = PyTuple_GET_ITEM(__pyx_args, 0);
103052   }
103053   goto __pyx_L4_argument_unpacking_done;
103054   __pyx_L5_argtuple_error:;
103055   __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[17]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
103056   __pyx_L3_error:;
103057   __Pyx_DECREF(__pyx_v__variables);
103058   __Pyx_AddTraceback("lxml.etree.XPathElementEvaluator.__call__");
103059   return NULL;
103060   __pyx_L4_argument_unpacking_done:;
103061   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
103062   __pyx_v_path = Py_None; __Pyx_INCREF(Py_None);
103063   __pyx_v_result = Py_None; __Pyx_INCREF(Py_None);
103064
103065   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":277
103066  *         cdef _Document doc
103067  *         cdef char* c_path
103068  *         path = _utf8(_path)             # <<<<<<<<<<<<<<
103069  *         doc = self._element._doc
103070  * 
103071  */
103072   __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v__path); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
103073   __Pyx_GOTREF(__pyx_t_1);
103074   __Pyx_DECREF(__pyx_v_path);
103075   __pyx_v_path = __pyx_t_1;
103076   __pyx_t_1 = 0;
103077
103078   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":278
103079  *         cdef char* c_path
103080  *         path = _utf8(_path)
103081  *         doc = self._element._doc             # <<<<<<<<<<<<<<
103082  * 
103083  *         self._lock()
103084  */
103085   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->_element->_doc));
103086   __Pyx_DECREF(((PyObject *)__pyx_v_doc));
103087   __pyx_v_doc = ((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->_element->_doc;
103088
103089   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":280
103090  *         doc = self._element._doc
103091  * 
103092  *         self._lock()             # <<<<<<<<<<<<<<
103093  *         self._error_log.connect()
103094  *         self._xpathCtxt.node = self._element._c_node
103095  */
103096   __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree_XPathElementEvaluator *)((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._lock(((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
103097
103098   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":281
103099  * 
103100  *         self._lock()
103101  *         self._error_log.connect()             # <<<<<<<<<<<<<<
103102  *         self._xpathCtxt.node = self._element._c_node
103103  *         try:
103104  */
103105   ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base._error_log);
103106
103107   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":282
103108  *         self._lock()
103109  *         self._error_log.connect()
103110  *         self._xpathCtxt.node = self._element._c_node             # <<<<<<<<<<<<<<
103111  *         try:
103112  *             self._context.register_context(doc)
103113  */
103114   ((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base._xpathCtxt->node = ((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->_element->_c_node;
103115
103116   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":283
103117  *         self._error_log.connect()
103118  *         self._xpathCtxt.node = self._element._c_node
103119  *         try:             # <<<<<<<<<<<<<<
103120  *             self._context.register_context(doc)
103121  *             self._context.registerVariables(_variables)
103122  */
103123   /*try:*/ {
103124
103125     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":284
103126  *         self._xpathCtxt.node = self._element._c_node
103127  *         try:
103128  *             self._context.register_context(doc)             # <<<<<<<<<<<<<<
103129  *             self._context.registerVariables(_variables)
103130  *             c_path = _cstr(path)
103131  */
103132     __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base._context->__pyx_base.__pyx_vtab)->register_context(((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base._context, __pyx_v_doc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L7;}
103133     __Pyx_GOTREF(__pyx_t_1);
103134     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
103135
103136     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":285
103137  *         try:
103138  *             self._context.register_context(doc)
103139  *             self._context.registerVariables(_variables)             # <<<<<<<<<<<<<<
103140  *             c_path = _cstr(path)
103141  *             with nogil:
103142  */
103143     __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base._context->__pyx_base.__pyx_vtab)->registerVariables(((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base._context, __pyx_v__variables); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L7;}
103144     __Pyx_GOTREF(__pyx_t_1);
103145     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
103146
103147     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":286
103148  *             self._context.register_context(doc)
103149  *             self._context.registerVariables(_variables)
103150  *             c_path = _cstr(path)             # <<<<<<<<<<<<<<
103151  *             with nogil:
103152  *                 xpathObj = xpath.xmlXPathEvalExpression(
103153  */
103154     __pyx_v_c_path = PyString_AS_STRING(__pyx_v_path);
103155
103156     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":287
103157  *             self._context.registerVariables(_variables)
103158  *             c_path = _cstr(path)
103159  *             with nogil:             # <<<<<<<<<<<<<<
103160  *                 xpathObj = xpath.xmlXPathEvalExpression(
103161  *                     c_path, self._xpathCtxt)
103162  */
103163     { PyThreadState *_save;
103164       Py_UNBLOCK_THREADS
103165       /*try:*/ {
103166
103167         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":289
103168  *             with nogil:
103169  *                 xpathObj = xpath.xmlXPathEvalExpression(
103170  *                     c_path, self._xpathCtxt)             # <<<<<<<<<<<<<<
103171  *             result = self._handle_result(xpathObj, doc)
103172  *         finally:
103173  */
103174         __pyx_v_xpathObj = xmlXPathEvalExpression(__pyx_v_c_path, ((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base._xpathCtxt);
103175       }
103176       /*finally:*/ {
103177         Py_BLOCK_THREADS
103178       }
103179     }
103180
103181     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":290
103182  *                 xpathObj = xpath.xmlXPathEvalExpression(
103183  *                     c_path, self._xpathCtxt)
103184  *             result = self._handle_result(xpathObj, doc)             # <<<<<<<<<<<<<<
103185  *         finally:
103186  *             self._error_log.disconnect()
103187  */
103188     __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree_XPathElementEvaluator *)((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._handle_result(((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self), __pyx_v_xpathObj, __pyx_v_doc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L7;}
103189     __Pyx_GOTREF(__pyx_t_1);
103190     __Pyx_DECREF(__pyx_v_result);
103191     __pyx_v_result = __pyx_t_1;
103192     __pyx_t_1 = 0;
103193   }
103194   /*finally:*/ {
103195     int __pyx_why;
103196     PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
103197     int __pyx_exc_lineno;
103198     __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
103199     __pyx_why = 0; goto __pyx_L8;
103200     __pyx_L7: {
103201       __pyx_why = 4;
103202       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
103203       __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
103204       __pyx_exc_lineno = __pyx_lineno;
103205       goto __pyx_L8;
103206     }
103207     __pyx_L8:;
103208
103209     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":292
103210  *             result = self._handle_result(xpathObj, doc)
103211  *         finally:
103212  *             self._error_log.disconnect()             # <<<<<<<<<<<<<<
103213  *             self._context.unregister_context()
103214  *             self._unlock()
103215  */
103216     ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base._error_log);
103217
103218     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":293
103219  *         finally:
103220  *             self._error_log.disconnect()
103221  *             self._context.unregister_context()             # <<<<<<<<<<<<<<
103222  *             self._unlock()
103223  * 
103224  */
103225     __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base._context->__pyx_base.__pyx_vtab)->unregister_context(((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base._context); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
103226     __Pyx_GOTREF(__pyx_t_1);
103227     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
103228
103229     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":294
103230  *             self._error_log.disconnect()
103231  *             self._context.unregister_context()
103232  *             self._unlock()             # <<<<<<<<<<<<<<
103233  * 
103234  *         return result
103235  */
103236     ((struct __pyx_vtabstruct_4lxml_5etree_XPathElementEvaluator *)((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._unlock(((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self));
103237     goto __pyx_L13;
103238     __pyx_L12_error:;
103239     if (__pyx_why == 4) {
103240       Py_XDECREF(__pyx_exc_type);
103241       Py_XDECREF(__pyx_exc_value);
103242       Py_XDECREF(__pyx_exc_tb);
103243     }
103244     goto __pyx_L1_error;
103245     __pyx_L13:;
103246     switch (__pyx_why) {
103247       case 4: {
103248         __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
103249         __pyx_lineno = __pyx_exc_lineno;
103250         __pyx_exc_type = 0;
103251         __pyx_exc_value = 0;
103252         __pyx_exc_tb = 0;
103253         goto __pyx_L1_error;
103254       }
103255     }
103256   }
103257
103258   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":296
103259  *             self._unlock()
103260  * 
103261  *         return result             # <<<<<<<<<<<<<<
103262  * 
103263  * 
103264  */
103265   __Pyx_XDECREF(__pyx_r);
103266   __Pyx_INCREF(__pyx_v_result);
103267   __pyx_r = __pyx_v_result;
103268   goto __pyx_L0;
103269
103270   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
103271   goto __pyx_L0;
103272   __pyx_L1_error:;
103273   __Pyx_XDECREF(__pyx_t_1);
103274   __Pyx_AddTraceback("lxml.etree.XPathElementEvaluator.__call__");
103275   __pyx_r = NULL;
103276   __pyx_L0:;
103277   __Pyx_DECREF(__pyx_v__variables);
103278   __Pyx_DECREF((PyObject *)__pyx_v_doc);
103279   __Pyx_DECREF(__pyx_v_path);
103280   __Pyx_DECREF(__pyx_v_result);
103281   __Pyx_XGIVEREF(__pyx_r);
103282   __Pyx_FinishRefcountContext();
103283   return __pyx_r;
103284 }
103285
103286 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":309
103287  *     you pass ``smart_strings=False``.
103288  *     """
103289  *     def __init__(self, _ElementTree etree not None, *, namespaces=None,             # <<<<<<<<<<<<<<
103290  *                  extensions=None, regexp=True, smart_strings=True):
103291  *         XPathElementEvaluator.__init__(
103292  */
103293
103294 static int __pyx_pf_4lxml_5etree_22XPathDocumentEvaluator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
103295 static int __pyx_pf_4lxml_5etree_22XPathDocumentEvaluator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
103296   struct LxmlElementTree *__pyx_v_etree = 0;
103297   PyObject *__pyx_v_namespaces = 0;
103298   PyObject *__pyx_v_extensions = 0;
103299   PyObject *__pyx_v_regexp = 0;
103300   PyObject *__pyx_v_smart_strings = 0;
103301   int __pyx_r;
103302   PyObject *__pyx_1 = 0;
103303   PyObject *__pyx_t_1 = NULL;
103304   PyObject *__pyx_t_2 = NULL;
103305   PyObject *__pyx_t_3 = NULL;
103306   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_etree,&__pyx_kp_namespaces,&__pyx_kp_extensions,&__pyx_kp_regexp,&__pyx_kp_smart_strings,0};
103307   __Pyx_SetupRefcountContext("__init__");
103308   if (unlikely(__pyx_kwds)) {
103309     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
103310     PyObject* values[5] = {0,0,0,0,0};
103311     values[1] = Py_None;
103312     values[2] = Py_None;
103313     values[3] = __pyx_k_177;
103314     values[4] = __pyx_k_178;
103315     switch (PyTuple_GET_SIZE(__pyx_args)) {
103316       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
103317       case  0: break;
103318       default: goto __pyx_L5_argtuple_error;
103319     }
103320     switch (PyTuple_GET_SIZE(__pyx_args)) {
103321       case  0:
103322       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_etree);
103323       if (likely(values[0])) kw_args--;
103324       else goto __pyx_L5_argtuple_error;
103325     }
103326     while (kw_args > 0) {
103327       PyObject* value;
103328       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_namespaces);
103329       if (value) { values[1] = value; if (!(--kw_args)) break; }
103330       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_extensions);
103331       if (value) { values[2] = value; if (!(--kw_args)) break; }
103332       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_regexp);
103333       if (value) { values[3] = value; if (!(--kw_args)) break; }
103334       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_smart_strings);
103335       if (value) { values[4] = value; if (!(--kw_args)) break; }
103336       break;
103337     }
103338     if (unlikely(kw_args > 0)) {
103339       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
103340     }
103341     __pyx_v_etree = ((struct LxmlElementTree *)values[0]);
103342     __pyx_v_namespaces = values[1];
103343     __pyx_v_extensions = values[2];
103344     __pyx_v_regexp = values[3];
103345     __pyx_v_smart_strings = values[4];
103346   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
103347     goto __pyx_L5_argtuple_error;
103348   } else {
103349     __pyx_v_etree = ((struct LxmlElementTree *)PyTuple_GET_ITEM(__pyx_args, 0));
103350     __pyx_v_namespaces = Py_None;
103351     __pyx_v_extensions = Py_None;
103352     __pyx_v_regexp = __pyx_k_177;
103353     __pyx_v_smart_strings = __pyx_k_178;
103354   }
103355   goto __pyx_L4_argument_unpacking_done;
103356   __pyx_L5_argtuple_error:;
103357   __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[17]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
103358   __pyx_L3_error:;
103359   __Pyx_AddTraceback("lxml.etree.XPathDocumentEvaluator.__init__");
103360   return -1;
103361   __pyx_L4_argument_unpacking_done:;
103362   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_etree), __pyx_ptype_4lxml_5etree__ElementTree, 0, "etree", 0))) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
103363
103364   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":311
103365  *     def __init__(self, _ElementTree etree not None, *, namespaces=None,
103366  *                  extensions=None, regexp=True, smart_strings=True):
103367  *         XPathElementEvaluator.__init__(             # <<<<<<<<<<<<<<
103368  *             self, etree._context_node, namespaces=namespaces,
103369  *             extensions=extensions, regexp=regexp, smart_strings=smart_strings)
103370  */
103371   __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_XPathElementEvaluator)), __pyx_kp___init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
103372   __Pyx_GOTREF(__pyx_t_1);
103373
103374   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":312
103375  *                  extensions=None, regexp=True, smart_strings=True):
103376  *         XPathElementEvaluator.__init__(
103377  *             self, etree._context_node, namespaces=namespaces,             # <<<<<<<<<<<<<<
103378  *             extensions=extensions, regexp=regexp, smart_strings=smart_strings)
103379  * 
103380  */
103381   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
103382   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
103383   __Pyx_INCREF(__pyx_v_self);
103384   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
103385   __Pyx_GIVEREF(__pyx_v_self);
103386   __Pyx_INCREF(((PyObject *)__pyx_v_etree->_context_node));
103387   PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_etree->_context_node));
103388   __Pyx_GIVEREF(((PyObject *)__pyx_v_etree->_context_node));
103389   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
103390   __Pyx_GOTREF(((PyObject *)__pyx_1));
103391   if (PyDict_SetItem(__pyx_1, __pyx_kp_namespaces, __pyx_v_namespaces) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
103392
103393   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":313
103394  *         XPathElementEvaluator.__init__(
103395  *             self, etree._context_node, namespaces=namespaces,
103396  *             extensions=extensions, regexp=regexp, smart_strings=smart_strings)             # <<<<<<<<<<<<<<
103397  * 
103398  *     def __call__(self, _path, **_variables):
103399  */
103400   if (PyDict_SetItem(__pyx_1, __pyx_kp_extensions, __pyx_v_extensions) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
103401   if (PyDict_SetItem(__pyx_1, __pyx_kp_regexp, __pyx_v_regexp) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
103402   if (PyDict_SetItem(__pyx_1, __pyx_kp_smart_strings, __pyx_v_smart_strings) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
103403   __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
103404   __Pyx_GOTREF(__pyx_t_3);
103405   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
103406   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
103407   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
103408   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
103409
103410   __pyx_r = 0;
103411   goto __pyx_L0;
103412   __pyx_L1_error:;
103413   __Pyx_XDECREF(__pyx_1);
103414   __Pyx_XDECREF(__pyx_t_1);
103415   __Pyx_XDECREF(__pyx_t_2);
103416   __Pyx_XDECREF(__pyx_t_3);
103417   __Pyx_AddTraceback("lxml.etree.XPathDocumentEvaluator.__init__");
103418   __pyx_r = -1;
103419   __pyx_L0:;
103420   __Pyx_FinishRefcountContext();
103421   return __pyx_r;
103422 }
103423
103424 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":315
103425  *             extensions=extensions, regexp=regexp, smart_strings=smart_strings)
103426  * 
103427  *     def __call__(self, _path, **_variables):             # <<<<<<<<<<<<<<
103428  *         u"""__call__(self, _path, **_variables)
103429  * 
103430  */
103431
103432 static PyObject *__pyx_pf_4lxml_5etree_22XPathDocumentEvaluator___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
103433 static char __pyx_doc_4lxml_5etree_22XPathDocumentEvaluator___call__[] = "__call__(self, _path, **_variables)\n\n        Evaluate an XPath expression on the document.\n\n        Variables may be provided as keyword arguments.  Note that namespaces\n        are currently not supported for variables.\n        ";
103434 static PyObject *__pyx_pf_4lxml_5etree_22XPathDocumentEvaluator___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
103435   PyObject *__pyx_v__path = 0;
103436   PyObject *__pyx_v__variables = 0;
103437   xmlXPathObject *__pyx_v_xpathObj;
103438   xmlDoc *__pyx_v_c_doc;
103439   struct LxmlDocument *__pyx_v_doc;
103440   char *__pyx_v_c_path;
103441   PyObject *__pyx_v_path;
103442   PyObject *__pyx_v_result;
103443   PyObject *__pyx_r = NULL;
103444   PyObject *__pyx_t_1 = NULL;
103445   int __pyx_t_2;
103446   xmlDoc *__pyx_t_3;
103447   static PyObject **__pyx_pyargnames[] = {&__pyx_kp__path,0};
103448   __Pyx_SetupRefcountContext("__call__");
103449   __pyx_v__variables = PyDict_New(); if (unlikely(!__pyx_v__variables)) return NULL;
103450   __Pyx_GOTREF(__pyx_v__variables);
103451   if (unlikely(__pyx_kwds)) {
103452     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
103453     PyObject* values[1] = {0};
103454     switch (PyTuple_GET_SIZE(__pyx_args)) {
103455       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
103456       case  0: break;
103457       default: goto __pyx_L5_argtuple_error;
103458     }
103459     switch (PyTuple_GET_SIZE(__pyx_args)) {
103460       case  0:
103461       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp__path);
103462       if (likely(values[0])) kw_args--;
103463       else goto __pyx_L5_argtuple_error;
103464     }
103465     if (unlikely(kw_args > 0)) {
103466       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__variables, values, PyTuple_GET_SIZE(__pyx_args), "__call__") < 0)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
103467     }
103468     __pyx_v__path = values[0];
103469   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
103470     goto __pyx_L5_argtuple_error;
103471   } else {
103472     __pyx_v__path = PyTuple_GET_ITEM(__pyx_args, 0);
103473   }
103474   goto __pyx_L4_argument_unpacking_done;
103475   __pyx_L5_argtuple_error:;
103476   __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[17]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
103477   __pyx_L3_error:;
103478   __Pyx_DECREF(__pyx_v__variables);
103479   __Pyx_AddTraceback("lxml.etree.XPathDocumentEvaluator.__call__");
103480   return NULL;
103481   __pyx_L4_argument_unpacking_done:;
103482   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
103483   __pyx_v_path = Py_None; __Pyx_INCREF(Py_None);
103484   __pyx_v_result = Py_None; __Pyx_INCREF(Py_None);
103485
103486   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":327
103487  *         cdef _Document doc
103488  *         cdef char* c_path
103489  *         path = _utf8(_path)             # <<<<<<<<<<<<<<
103490  *         doc = self._element._doc
103491  * 
103492  */
103493   __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v__path); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
103494   __Pyx_GOTREF(__pyx_t_1);
103495   __Pyx_DECREF(__pyx_v_path);
103496   __pyx_v_path = __pyx_t_1;
103497   __pyx_t_1 = 0;
103498
103499   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":328
103500  *         cdef char* c_path
103501  *         path = _utf8(_path)
103502  *         doc = self._element._doc             # <<<<<<<<<<<<<<
103503  * 
103504  *         self._lock()
103505  */
103506   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base._element->_doc));
103507   __Pyx_DECREF(((PyObject *)__pyx_v_doc));
103508   __pyx_v_doc = ((struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base._element->_doc;
103509
103510   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":330
103511  *         doc = self._element._doc
103512  * 
103513  *         self._lock()             # <<<<<<<<<<<<<<
103514  *         self._error_log.connect()
103515  *         try:
103516  */
103517   __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree_XPathDocumentEvaluator *)((struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._lock(((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
103518
103519   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":331
103520  * 
103521  *         self._lock()
103522  *         self._error_log.connect()             # <<<<<<<<<<<<<<
103523  *         try:
103524  *             self._context.register_context(doc)
103525  */
103526   ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base.__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(((struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base.__pyx_base._error_log);
103527
103528   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":332
103529  *         self._lock()
103530  *         self._error_log.connect()
103531  *         try:             # <<<<<<<<<<<<<<
103532  *             self._context.register_context(doc)
103533  *             c_doc = _fakeRootDoc(doc._c_doc, self._element._c_node)
103534  */
103535   /*try:*/ {
103536
103537     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":333
103538  *         self._error_log.connect()
103539  *         try:
103540  *             self._context.register_context(doc)             # <<<<<<<<<<<<<<
103541  *             c_doc = _fakeRootDoc(doc._c_doc, self._element._c_node)
103542  *             try:
103543  */
103544     __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)((struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base.__pyx_base._context->__pyx_base.__pyx_vtab)->register_context(((struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base.__pyx_base._context, __pyx_v_doc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L7;}
103545     __Pyx_GOTREF(__pyx_t_1);
103546     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
103547
103548     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":334
103549  *         try:
103550  *             self._context.register_context(doc)
103551  *             c_doc = _fakeRootDoc(doc._c_doc, self._element._c_node)             # <<<<<<<<<<<<<<
103552  *             try:
103553  *                 self._context.registerVariables(_variables)
103554  */
103555     __pyx_t_3 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc, ((struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base._element->_c_node); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L7;}
103556     __pyx_v_c_doc = __pyx_t_3;
103557
103558     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":335
103559  *             self._context.register_context(doc)
103560  *             c_doc = _fakeRootDoc(doc._c_doc, self._element._c_node)
103561  *             try:             # <<<<<<<<<<<<<<
103562  *                 self._context.registerVariables(_variables)
103563  *                 c_path = _cstr(path)
103564  */
103565     /*try:*/ {
103566
103567       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":336
103568  *             c_doc = _fakeRootDoc(doc._c_doc, self._element._c_node)
103569  *             try:
103570  *                 self._context.registerVariables(_variables)             # <<<<<<<<<<<<<<
103571  *                 c_path = _cstr(path)
103572  *                 with nogil:
103573  */
103574       __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)((struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base.__pyx_base._context->__pyx_base.__pyx_vtab)->registerVariables(((struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base.__pyx_base._context, __pyx_v__variables); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L10;}
103575       __Pyx_GOTREF(__pyx_t_1);
103576       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
103577
103578       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":337
103579  *             try:
103580  *                 self._context.registerVariables(_variables)
103581  *                 c_path = _cstr(path)             # <<<<<<<<<<<<<<
103582  *                 with nogil:
103583  *                     self._xpathCtxt.doc  = c_doc
103584  */
103585       __pyx_v_c_path = PyString_AS_STRING(__pyx_v_path);
103586
103587       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":338
103588  *                 self._context.registerVariables(_variables)
103589  *                 c_path = _cstr(path)
103590  *                 with nogil:             # <<<<<<<<<<<<<<
103591  *                     self._xpathCtxt.doc  = c_doc
103592  *                     self._xpathCtxt.node = tree.xmlDocGetRootElement(c_doc)
103593  */
103594       { PyThreadState *_save;
103595         Py_UNBLOCK_THREADS
103596         /*try:*/ {
103597
103598           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":339
103599  *                 c_path = _cstr(path)
103600  *                 with nogil:
103601  *                     self._xpathCtxt.doc  = c_doc             # <<<<<<<<<<<<<<
103602  *                     self._xpathCtxt.node = tree.xmlDocGetRootElement(c_doc)
103603  *                     xpathObj = xpath.xmlXPathEvalExpression(
103604  */
103605           ((struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base.__pyx_base._xpathCtxt->doc = __pyx_v_c_doc;
103606
103607           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":340
103608  *                 with nogil:
103609  *                     self._xpathCtxt.doc  = c_doc
103610  *                     self._xpathCtxt.node = tree.xmlDocGetRootElement(c_doc)             # <<<<<<<<<<<<<<
103611  *                     xpathObj = xpath.xmlXPathEvalExpression(
103612  *                         c_path, self._xpathCtxt)
103613  */
103614           ((struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base.__pyx_base._xpathCtxt->node = xmlDocGetRootElement(__pyx_v_c_doc);
103615
103616           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":342
103617  *                     self._xpathCtxt.node = tree.xmlDocGetRootElement(c_doc)
103618  *                     xpathObj = xpath.xmlXPathEvalExpression(
103619  *                         c_path, self._xpathCtxt)             # <<<<<<<<<<<<<<
103620  *                 result = self._handle_result(xpathObj, doc)
103621  *             finally:
103622  */
103623           __pyx_v_xpathObj = xmlXPathEvalExpression(__pyx_v_c_path, ((struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base.__pyx_base._xpathCtxt);
103624         }
103625         /*finally:*/ {
103626           Py_BLOCK_THREADS
103627         }
103628       }
103629
103630       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":343
103631  *                     xpathObj = xpath.xmlXPathEvalExpression(
103632  *                         c_path, self._xpathCtxt)
103633  *                 result = self._handle_result(xpathObj, doc)             # <<<<<<<<<<<<<<
103634  *             finally:
103635  *                 _destroyFakeDoc(doc._c_doc, c_doc)
103636  */
103637       __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree_XPathDocumentEvaluator *)((struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._handle_result(((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self), __pyx_v_xpathObj, __pyx_v_doc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L10;}
103638       __Pyx_GOTREF(__pyx_t_1);
103639       __Pyx_DECREF(__pyx_v_result);
103640       __pyx_v_result = __pyx_t_1;
103641       __pyx_t_1 = 0;
103642     }
103643     /*finally:*/ {
103644       int __pyx_why;
103645       PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
103646       int __pyx_exc_lineno;
103647       __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
103648       __pyx_why = 0; goto __pyx_L11;
103649       __pyx_L10: {
103650         __pyx_why = 4;
103651         __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
103652         __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
103653         __pyx_exc_lineno = __pyx_lineno;
103654         goto __pyx_L11;
103655       }
103656       __pyx_L11:;
103657
103658       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":345
103659  *                 result = self._handle_result(xpathObj, doc)
103660  *             finally:
103661  *                 _destroyFakeDoc(doc._c_doc, c_doc)             # <<<<<<<<<<<<<<
103662  *                 self._context.unregister_context()
103663  *         finally:
103664  */
103665       __pyx_f_4lxml_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc, __pyx_v_c_doc);
103666
103667       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":346
103668  *             finally:
103669  *                 _destroyFakeDoc(doc._c_doc, c_doc)
103670  *                 self._context.unregister_context()             # <<<<<<<<<<<<<<
103671  *         finally:
103672  *             self._error_log.disconnect()
103673  */
103674       __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)((struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base.__pyx_base._context->__pyx_base.__pyx_vtab)->unregister_context(((struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base.__pyx_base._context); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L15_error;}
103675       __Pyx_GOTREF(__pyx_t_1);
103676       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
103677       goto __pyx_L16;
103678       __pyx_L15_error:;
103679       if (__pyx_why == 4) {
103680         Py_XDECREF(__pyx_exc_type);
103681         Py_XDECREF(__pyx_exc_value);
103682         Py_XDECREF(__pyx_exc_tb);
103683       }
103684       goto __pyx_L7;
103685       __pyx_L16:;
103686       switch (__pyx_why) {
103687         case 4: {
103688           __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
103689           __pyx_lineno = __pyx_exc_lineno;
103690           __pyx_exc_type = 0;
103691           __pyx_exc_value = 0;
103692           __pyx_exc_tb = 0;
103693           goto __pyx_L7;
103694         }
103695       }
103696     }
103697   }
103698   /*finally:*/ {
103699     int __pyx_why;
103700     PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
103701     int __pyx_exc_lineno;
103702     __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
103703     __pyx_why = 0; goto __pyx_L8;
103704     __pyx_L7: {
103705       __pyx_why = 4;
103706       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
103707       __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
103708       __pyx_exc_lineno = __pyx_lineno;
103709       goto __pyx_L8;
103710     }
103711     __pyx_L8:;
103712
103713     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":348
103714  *                 self._context.unregister_context()
103715  *         finally:
103716  *             self._error_log.disconnect()             # <<<<<<<<<<<<<<
103717  *             self._unlock()
103718  * 
103719  */
103720     ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base.__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(((struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base.__pyx_base._error_log);
103721
103722     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":349
103723  *         finally:
103724  *             self._error_log.disconnect()
103725  *             self._unlock()             # <<<<<<<<<<<<<<
103726  * 
103727  *         return result
103728  */
103729     ((struct __pyx_vtabstruct_4lxml_5etree_XPathDocumentEvaluator *)((struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._unlock(((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self));
103730     switch (__pyx_why) {
103731       case 4: {
103732         __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
103733         __pyx_lineno = __pyx_exc_lineno;
103734         __pyx_exc_type = 0;
103735         __pyx_exc_value = 0;
103736         __pyx_exc_tb = 0;
103737         goto __pyx_L1_error;
103738       }
103739     }
103740   }
103741
103742   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":351
103743  *             self._unlock()
103744  * 
103745  *         return result             # <<<<<<<<<<<<<<
103746  * 
103747  * 
103748  */
103749   __Pyx_XDECREF(__pyx_r);
103750   __Pyx_INCREF(__pyx_v_result);
103751   __pyx_r = __pyx_v_result;
103752   goto __pyx_L0;
103753
103754   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
103755   goto __pyx_L0;
103756   __pyx_L1_error:;
103757   __Pyx_XDECREF(__pyx_t_1);
103758   __Pyx_AddTraceback("lxml.etree.XPathDocumentEvaluator.__call__");
103759   __pyx_r = NULL;
103760   __pyx_L0:;
103761   __Pyx_DECREF(__pyx_v__variables);
103762   __Pyx_DECREF((PyObject *)__pyx_v_doc);
103763   __Pyx_DECREF(__pyx_v_path);
103764   __Pyx_DECREF(__pyx_v_result);
103765   __Pyx_XGIVEREF(__pyx_r);
103766   __Pyx_FinishRefcountContext();
103767   return __pyx_r;
103768 }
103769
103770 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":354
103771  * 
103772  * 
103773  * def XPathEvaluator(etree_or_element, *, namespaces=None, extensions=None,             # <<<<<<<<<<<<<<
103774  *                    regexp=True, smart_strings=True):
103775  *     u"""XPathEvaluator(etree_or_element, namespaces=None, extensions=None, regexp=True, smart_strings=True)
103776  */
103777
103778 static PyObject *__pyx_pf_4lxml_5etree_XPathEvaluator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
103779 static char __pyx_doc_4lxml_5etree_XPathEvaluator[] = "XPathEvaluator(etree_or_element, namespaces=None, extensions=None, regexp=True, smart_strings=True)\n\n    Creates an XPath evaluator for an ElementTree or an Element.\n\n    The resulting object can be called with an XPath expression as argument\n    and XPath variables provided as keyword arguments.\n\n    Additional namespace declarations can be passed with the\n    'namespace' keyword argument.  EXSLT regular expression support\n    can be disabled with the 'regexp' boolean keyword (defaults to\n    True).  Smart strings will be returned for string results unless\n    you pass ``smart_strings=False``.\n    ";
103780 static PyObject *__pyx_pf_4lxml_5etree_XPathEvaluator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
103781   PyObject *__pyx_v_etree_or_element = 0;
103782   PyObject *__pyx_v_namespaces = 0;
103783   PyObject *__pyx_v_extensions = 0;
103784   PyObject *__pyx_v_regexp = 0;
103785   PyObject *__pyx_v_smart_strings = 0;
103786   PyObject *__pyx_r = NULL;
103787   PyObject *__pyx_1 = 0;
103788   int __pyx_t_1;
103789   PyObject *__pyx_t_2 = NULL;
103790   PyObject *__pyx_t_3 = NULL;
103791   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_etree_or_element,&__pyx_kp_namespaces,&__pyx_kp_extensions,&__pyx_kp_regexp,&__pyx_kp_smart_strings,0};
103792   __Pyx_SetupRefcountContext("XPathEvaluator");
103793   __pyx_self = __pyx_self;
103794   if (unlikely(__pyx_kwds)) {
103795     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
103796     PyObject* values[5] = {0,0,0,0,0};
103797     values[1] = Py_None;
103798     values[2] = Py_None;
103799     values[3] = __pyx_k_179;
103800     values[4] = __pyx_k_180;
103801     switch (PyTuple_GET_SIZE(__pyx_args)) {
103802       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
103803       case  0: break;
103804       default: goto __pyx_L5_argtuple_error;
103805     }
103806     switch (PyTuple_GET_SIZE(__pyx_args)) {
103807       case  0:
103808       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_etree_or_element);
103809       if (likely(values[0])) kw_args--;
103810       else goto __pyx_L5_argtuple_error;
103811     }
103812     while (kw_args > 0) {
103813       PyObject* value;
103814       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_namespaces);
103815       if (value) { values[1] = value; if (!(--kw_args)) break; }
103816       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_extensions);
103817       if (value) { values[2] = value; if (!(--kw_args)) break; }
103818       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_regexp);
103819       if (value) { values[3] = value; if (!(--kw_args)) break; }
103820       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_smart_strings);
103821       if (value) { values[4] = value; if (!(--kw_args)) break; }
103822       break;
103823     }
103824     if (unlikely(kw_args > 0)) {
103825       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "XPathEvaluator") < 0)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
103826     }
103827     __pyx_v_etree_or_element = values[0];
103828     __pyx_v_namespaces = values[1];
103829     __pyx_v_extensions = values[2];
103830     __pyx_v_regexp = values[3];
103831     __pyx_v_smart_strings = values[4];
103832   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
103833     goto __pyx_L5_argtuple_error;
103834   } else {
103835     __pyx_v_etree_or_element = PyTuple_GET_ITEM(__pyx_args, 0);
103836     __pyx_v_namespaces = Py_None;
103837     __pyx_v_extensions = Py_None;
103838     __pyx_v_regexp = __pyx_k_179;
103839     __pyx_v_smart_strings = __pyx_k_180;
103840   }
103841   goto __pyx_L4_argument_unpacking_done;
103842   __pyx_L5_argtuple_error:;
103843   __Pyx_RaiseArgtupleInvalid("XPathEvaluator", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[17]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
103844   __pyx_L3_error:;
103845   __Pyx_AddTraceback("lxml.etree.XPathEvaluator");
103846   return NULL;
103847   __pyx_L4_argument_unpacking_done:;
103848
103849   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":369
103850  *     you pass ``smart_strings=False``.
103851  *     """
103852  *     if isinstance(etree_or_element, _ElementTree):             # <<<<<<<<<<<<<<
103853  *         return XPathDocumentEvaluator(
103854  *             etree_or_element, namespaces=namespaces,
103855  */
103856   __pyx_t_1 = PyObject_TypeCheck(__pyx_v_etree_or_element, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ElementTree))); 
103857   if (__pyx_t_1) {
103858
103859     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":370
103860  *     """
103861  *     if isinstance(etree_or_element, _ElementTree):
103862  *         return XPathDocumentEvaluator(             # <<<<<<<<<<<<<<
103863  *             etree_or_element, namespaces=namespaces,
103864  *             extensions=extensions, regexp=regexp, smart_strings=smart_strings)
103865  */
103866     __Pyx_XDECREF(__pyx_r);
103867
103868     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":371
103869  *     if isinstance(etree_or_element, _ElementTree):
103870  *         return XPathDocumentEvaluator(
103871  *             etree_or_element, namespaces=namespaces,             # <<<<<<<<<<<<<<
103872  *             extensions=extensions, regexp=regexp, smart_strings=smart_strings)
103873  *     else:
103874  */
103875     __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
103876     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
103877     __Pyx_INCREF(__pyx_v_etree_or_element);
103878     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_etree_or_element);
103879     __Pyx_GIVEREF(__pyx_v_etree_or_element);
103880     __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
103881     __Pyx_GOTREF(((PyObject *)__pyx_1));
103882     if (PyDict_SetItem(__pyx_1, __pyx_kp_namespaces, __pyx_v_namespaces) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
103883
103884     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":372
103885  *         return XPathDocumentEvaluator(
103886  *             etree_or_element, namespaces=namespaces,
103887  *             extensions=extensions, regexp=regexp, smart_strings=smart_strings)             # <<<<<<<<<<<<<<
103888  *     else:
103889  *         return XPathElementEvaluator(
103890  */
103891     if (PyDict_SetItem(__pyx_1, __pyx_kp_extensions, __pyx_v_extensions) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
103892     if (PyDict_SetItem(__pyx_1, __pyx_kp_regexp, __pyx_v_regexp) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
103893     if (PyDict_SetItem(__pyx_1, __pyx_kp_smart_strings, __pyx_v_smart_strings) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
103894     __pyx_t_3 = PyEval_CallObjectWithKeywords(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_XPathDocumentEvaluator)), ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
103895     __Pyx_GOTREF(__pyx_t_3);
103896     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
103897     __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
103898     __pyx_r = __pyx_t_3;
103899     __pyx_t_3 = 0;
103900     goto __pyx_L0;
103901     goto __pyx_L6;
103902   }
103903   /*else*/ {
103904
103905     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":374
103906  *             extensions=extensions, regexp=regexp, smart_strings=smart_strings)
103907  *     else:
103908  *         return XPathElementEvaluator(             # <<<<<<<<<<<<<<
103909  *             etree_or_element, namespaces=namespaces,
103910  *             extensions=extensions, regexp=regexp, smart_strings=smart_strings)
103911  */
103912     __Pyx_XDECREF(__pyx_r);
103913
103914     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":375
103915  *     else:
103916  *         return XPathElementEvaluator(
103917  *             etree_or_element, namespaces=namespaces,             # <<<<<<<<<<<<<<
103918  *             extensions=extensions, regexp=regexp, smart_strings=smart_strings)
103919  * 
103920  */
103921     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
103922     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
103923     __Pyx_INCREF(__pyx_v_etree_or_element);
103924     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_etree_or_element);
103925     __Pyx_GIVEREF(__pyx_v_etree_or_element);
103926     __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
103927     __Pyx_GOTREF(((PyObject *)__pyx_1));
103928     if (PyDict_SetItem(__pyx_1, __pyx_kp_namespaces, __pyx_v_namespaces) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
103929
103930     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":376
103931  *         return XPathElementEvaluator(
103932  *             etree_or_element, namespaces=namespaces,
103933  *             extensions=extensions, regexp=regexp, smart_strings=smart_strings)             # <<<<<<<<<<<<<<
103934  * 
103935  * 
103936  */
103937     if (PyDict_SetItem(__pyx_1, __pyx_kp_extensions, __pyx_v_extensions) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
103938     if (PyDict_SetItem(__pyx_1, __pyx_kp_regexp, __pyx_v_regexp) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
103939     if (PyDict_SetItem(__pyx_1, __pyx_kp_smart_strings, __pyx_v_smart_strings) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
103940     __pyx_t_2 = PyEval_CallObjectWithKeywords(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_XPathElementEvaluator)), ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
103941     __Pyx_GOTREF(__pyx_t_2);
103942     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
103943     __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
103944     __pyx_r = __pyx_t_2;
103945     __pyx_t_2 = 0;
103946     goto __pyx_L0;
103947   }
103948   __pyx_L6:;
103949
103950   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
103951   goto __pyx_L0;
103952   __pyx_L1_error:;
103953   __Pyx_XDECREF(__pyx_1);
103954   __Pyx_XDECREF(__pyx_t_2);
103955   __Pyx_XDECREF(__pyx_t_3);
103956   __Pyx_AddTraceback("lxml.etree.XPathEvaluator");
103957   __pyx_r = NULL;
103958   __pyx_L0:;
103959   __Pyx_XGIVEREF(__pyx_r);
103960   __Pyx_FinishRefcountContext();
103961   return __pyx_r;
103962 }
103963
103964 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":394
103965  *     cdef readonly object path
103966  * 
103967  *     def __init__(self, path, *, namespaces=None, extensions=None,             # <<<<<<<<<<<<<<
103968  *                  regexp=True, smart_strings=True):
103969  *         cdef xpath.xmlXPathContext* xpathCtxt
103970  */
103971
103972 static int __pyx_pf_4lxml_5etree_5XPath___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
103973 static int __pyx_pf_4lxml_5etree_5XPath___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
103974   PyObject *__pyx_v_path = 0;
103975   PyObject *__pyx_v_namespaces = 0;
103976   PyObject *__pyx_v_extensions = 0;
103977   PyObject *__pyx_v_regexp = 0;
103978   PyObject *__pyx_v_smart_strings = 0;
103979   xmlXPathContext *__pyx_v_xpathCtxt;
103980   int __pyx_r;
103981   PyObject *__pyx_t_1 = NULL;
103982   PyObject *__pyx_t_2 = NULL;
103983   PyObject *__pyx_t_3 = NULL;
103984   int __pyx_t_4;
103985   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_path,&__pyx_kp_namespaces,&__pyx_kp_extensions,&__pyx_kp_regexp,&__pyx_kp_smart_strings,0};
103986   __Pyx_SetupRefcountContext("__init__");
103987   if (unlikely(__pyx_kwds)) {
103988     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
103989     PyObject* values[5] = {0,0,0,0,0};
103990     values[1] = Py_None;
103991     values[2] = Py_None;
103992     values[3] = __pyx_k_181;
103993     values[4] = __pyx_k_182;
103994     switch (PyTuple_GET_SIZE(__pyx_args)) {
103995       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
103996       case  0: break;
103997       default: goto __pyx_L5_argtuple_error;
103998     }
103999     switch (PyTuple_GET_SIZE(__pyx_args)) {
104000       case  0:
104001       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_path);
104002       if (likely(values[0])) kw_args--;
104003       else goto __pyx_L5_argtuple_error;
104004     }
104005     while (kw_args > 0) {
104006       PyObject* value;
104007       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_namespaces);
104008       if (value) { values[1] = value; if (!(--kw_args)) break; }
104009       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_extensions);
104010       if (value) { values[2] = value; if (!(--kw_args)) break; }
104011       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_regexp);
104012       if (value) { values[3] = value; if (!(--kw_args)) break; }
104013       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_smart_strings);
104014       if (value) { values[4] = value; if (!(--kw_args)) break; }
104015       break;
104016     }
104017     if (unlikely(kw_args > 0)) {
104018       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
104019     }
104020     __pyx_v_path = values[0];
104021     __pyx_v_namespaces = values[1];
104022     __pyx_v_extensions = values[2];
104023     __pyx_v_regexp = values[3];
104024     __pyx_v_smart_strings = values[4];
104025   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
104026     goto __pyx_L5_argtuple_error;
104027   } else {
104028     __pyx_v_path = PyTuple_GET_ITEM(__pyx_args, 0);
104029     __pyx_v_namespaces = Py_None;
104030     __pyx_v_extensions = Py_None;
104031     __pyx_v_regexp = __pyx_k_181;
104032     __pyx_v_smart_strings = __pyx_k_182;
104033   }
104034   goto __pyx_L4_argument_unpacking_done;
104035   __pyx_L5_argtuple_error:;
104036   __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[17]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
104037   __pyx_L3_error:;
104038   __Pyx_AddTraceback("lxml.etree.XPath.__init__");
104039   return -1;
104040   __pyx_L4_argument_unpacking_done:;
104041   __Pyx_INCREF(__pyx_v_path);
104042
104043   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":397
104044  *                  regexp=True, smart_strings=True):
104045  *         cdef xpath.xmlXPathContext* xpathCtxt
104046  *         _XPathEvaluatorBase.__init__(self, namespaces, extensions,             # <<<<<<<<<<<<<<
104047  *                                      regexp, smart_strings)
104048  *         self.path = path
104049  */
104050   __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__XPathEvaluatorBase)), __pyx_kp___init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104051   __Pyx_GOTREF(__pyx_t_1);
104052
104053   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":398
104054  *         cdef xpath.xmlXPathContext* xpathCtxt
104055  *         _XPathEvaluatorBase.__init__(self, namespaces, extensions,
104056  *                                      regexp, smart_strings)             # <<<<<<<<<<<<<<
104057  *         self.path = path
104058  *         path = _utf8(path)
104059  */
104060   __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104061   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
104062   __Pyx_INCREF(__pyx_v_self);
104063   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
104064   __Pyx_GIVEREF(__pyx_v_self);
104065   __Pyx_INCREF(__pyx_v_namespaces);
104066   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_namespaces);
104067   __Pyx_GIVEREF(__pyx_v_namespaces);
104068   __Pyx_INCREF(__pyx_v_extensions);
104069   PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_extensions);
104070   __Pyx_GIVEREF(__pyx_v_extensions);
104071   __Pyx_INCREF(__pyx_v_regexp);
104072   PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_regexp);
104073   __Pyx_GIVEREF(__pyx_v_regexp);
104074   __Pyx_INCREF(__pyx_v_smart_strings);
104075   PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_smart_strings);
104076   __Pyx_GIVEREF(__pyx_v_smart_strings);
104077   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104078   __Pyx_GOTREF(__pyx_t_3);
104079   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
104080   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
104081   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
104082
104083   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":399
104084  *         _XPathEvaluatorBase.__init__(self, namespaces, extensions,
104085  *                                      regexp, smart_strings)
104086  *         self.path = path             # <<<<<<<<<<<<<<
104087  *         path = _utf8(path)
104088  *         xpathCtxt = xpath.xmlXPathNewContext(NULL)
104089  */
104090   __Pyx_INCREF(__pyx_v_path);
104091   __Pyx_GIVEREF(__pyx_v_path);
104092   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->path);
104093   __Pyx_DECREF(((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->path);
104094   ((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->path = __pyx_v_path;
104095
104096   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":400
104097  *                                      regexp, smart_strings)
104098  *         self.path = path
104099  *         path = _utf8(path)             # <<<<<<<<<<<<<<
104100  *         xpathCtxt = xpath.xmlXPathNewContext(NULL)
104101  *         if xpathCtxt is NULL:
104102  */
104103   __pyx_t_3 = __pyx_f_4lxml_5etree__utf8(__pyx_v_path); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104104   __Pyx_GOTREF(__pyx_t_3);
104105   __Pyx_DECREF(__pyx_v_path);
104106   __pyx_v_path = __pyx_t_3;
104107   __pyx_t_3 = 0;
104108
104109   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":401
104110  *         self.path = path
104111  *         path = _utf8(path)
104112  *         xpathCtxt = xpath.xmlXPathNewContext(NULL)             # <<<<<<<<<<<<<<
104113  *         if xpathCtxt is NULL:
104114  *             python.PyErr_NoMemory()
104115  */
104116   __pyx_v_xpathCtxt = xmlXPathNewContext(NULL);
104117
104118   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":402
104119  *         path = _utf8(path)
104120  *         xpathCtxt = xpath.xmlXPathNewContext(NULL)
104121  *         if xpathCtxt is NULL:             # <<<<<<<<<<<<<<
104122  *             python.PyErr_NoMemory()
104123  *         self.set_context(xpathCtxt)
104124  */
104125   __pyx_t_4 = (__pyx_v_xpathCtxt == NULL);
104126   if (__pyx_t_4) {
104127
104128     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":403
104129  *         xpathCtxt = xpath.xmlXPathNewContext(NULL)
104130  *         if xpathCtxt is NULL:
104131  *             python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
104132  *         self.set_context(xpathCtxt)
104133  *         self._error_log.connect()
104134  */
104135     __pyx_t_3 = PyErr_NoMemory(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104136     __Pyx_GOTREF(__pyx_t_3);
104137     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
104138     goto __pyx_L6;
104139   }
104140   __pyx_L6:;
104141
104142   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":404
104143  *         if xpathCtxt is NULL:
104144  *             python.PyErr_NoMemory()
104145  *         self.set_context(xpathCtxt)             # <<<<<<<<<<<<<<
104146  *         self._error_log.connect()
104147  *         self._xpath = xpath.xmlXPathCtxtCompile(xpathCtxt, _cstr(path))
104148  */
104149   __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree_XPath *)((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.set_context(((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self), __pyx_v_xpathCtxt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104150   __Pyx_GOTREF(__pyx_t_3);
104151   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
104152
104153   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":405
104154  *             python.PyErr_NoMemory()
104155  *         self.set_context(xpathCtxt)
104156  *         self._error_log.connect()             # <<<<<<<<<<<<<<
104157  *         self._xpath = xpath.xmlXPathCtxtCompile(xpathCtxt, _cstr(path))
104158  *         self._error_log.disconnect()
104159  */
104160   ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->__pyx_base._error_log);
104161
104162   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":406
104163  *         self.set_context(xpathCtxt)
104164  *         self._error_log.connect()
104165  *         self._xpath = xpath.xmlXPathCtxtCompile(xpathCtxt, _cstr(path))             # <<<<<<<<<<<<<<
104166  *         self._error_log.disconnect()
104167  *         if self._xpath is NULL:
104168  */
104169   ((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->_xpath = xmlXPathCtxtCompile(__pyx_v_xpathCtxt, PyString_AS_STRING(__pyx_v_path));
104170
104171   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":407
104172  *         self._error_log.connect()
104173  *         self._xpath = xpath.xmlXPathCtxtCompile(xpathCtxt, _cstr(path))
104174  *         self._error_log.disconnect()             # <<<<<<<<<<<<<<
104175  *         if self._xpath is NULL:
104176  *             self._raise_parse_error()
104177  */
104178   ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->__pyx_base._error_log);
104179
104180   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":408
104181  *         self._xpath = xpath.xmlXPathCtxtCompile(xpathCtxt, _cstr(path))
104182  *         self._error_log.disconnect()
104183  *         if self._xpath is NULL:             # <<<<<<<<<<<<<<
104184  *             self._raise_parse_error()
104185  * 
104186  */
104187   __pyx_t_4 = (((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->_xpath == NULL);
104188   if (__pyx_t_4) {
104189
104190     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":409
104191  *         self._error_log.disconnect()
104192  *         if self._xpath is NULL:
104193  *             self._raise_parse_error()             # <<<<<<<<<<<<<<
104194  * 
104195  *     def __call__(self, _etree_or_element, **_variables):
104196  */
104197     __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree_XPath *)((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._raise_parse_error(((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104198     __Pyx_GOTREF(__pyx_t_3);
104199     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
104200     goto __pyx_L7;
104201   }
104202   __pyx_L7:;
104203
104204   __pyx_r = 0;
104205   goto __pyx_L0;
104206   __pyx_L1_error:;
104207   __Pyx_XDECREF(__pyx_t_1);
104208   __Pyx_XDECREF(__pyx_t_2);
104209   __Pyx_XDECREF(__pyx_t_3);
104210   __Pyx_AddTraceback("lxml.etree.XPath.__init__");
104211   __pyx_r = -1;
104212   __pyx_L0:;
104213   __Pyx_DECREF(__pyx_v_path);
104214   __Pyx_FinishRefcountContext();
104215   return __pyx_r;
104216 }
104217
104218 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":411
104219  *             self._raise_parse_error()
104220  * 
104221  *     def __call__(self, _etree_or_element, **_variables):             # <<<<<<<<<<<<<<
104222  *         u"__call__(self, _etree_or_element, **_variables)"
104223  *         cdef xpath.xmlXPathObject*  xpathObj
104224  */
104225
104226 static PyObject *__pyx_pf_4lxml_5etree_5XPath___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
104227 static char __pyx_doc_4lxml_5etree_5XPath___call__[] = "__call__(self, _etree_or_element, **_variables)";
104228 static PyObject *__pyx_pf_4lxml_5etree_5XPath___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
104229   PyObject *__pyx_v__etree_or_element = 0;
104230   PyObject *__pyx_v__variables = 0;
104231   xmlXPathObject *__pyx_v_xpathObj;
104232   struct LxmlDocument *__pyx_v_document;
104233   struct LxmlElement *__pyx_v_element;
104234   PyObject *__pyx_v_result;
104235   PyObject *__pyx_r = NULL;
104236   PyObject *__pyx_t_1 = NULL;
104237   int __pyx_t_2;
104238   static PyObject **__pyx_pyargnames[] = {&__pyx_kp__etree_or_element,0};
104239   __Pyx_SetupRefcountContext("__call__");
104240   __pyx_v__variables = PyDict_New(); if (unlikely(!__pyx_v__variables)) return NULL;
104241   __Pyx_GOTREF(__pyx_v__variables);
104242   if (unlikely(__pyx_kwds)) {
104243     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
104244     PyObject* values[1] = {0};
104245     switch (PyTuple_GET_SIZE(__pyx_args)) {
104246       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
104247       case  0: break;
104248       default: goto __pyx_L5_argtuple_error;
104249     }
104250     switch (PyTuple_GET_SIZE(__pyx_args)) {
104251       case  0:
104252       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp__etree_or_element);
104253       if (likely(values[0])) kw_args--;
104254       else goto __pyx_L5_argtuple_error;
104255     }
104256     if (unlikely(kw_args > 0)) {
104257       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__variables, values, PyTuple_GET_SIZE(__pyx_args), "__call__") < 0)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
104258     }
104259     __pyx_v__etree_or_element = values[0];
104260   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
104261     goto __pyx_L5_argtuple_error;
104262   } else {
104263     __pyx_v__etree_or_element = PyTuple_GET_ITEM(__pyx_args, 0);
104264   }
104265   goto __pyx_L4_argument_unpacking_done;
104266   __pyx_L5_argtuple_error:;
104267   __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[17]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
104268   __pyx_L3_error:;
104269   __Pyx_DECREF(__pyx_v__variables);
104270   __Pyx_AddTraceback("lxml.etree.XPath.__call__");
104271   return NULL;
104272   __pyx_L4_argument_unpacking_done:;
104273   __pyx_v_document = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
104274   __pyx_v_element = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
104275   __pyx_v_result = Py_None; __Pyx_INCREF(Py_None);
104276
104277   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":417
104278  *         cdef _Element element
104279  * 
104280  *         document = _documentOrRaise(_etree_or_element)             # <<<<<<<<<<<<<<
104281  *         element  = _rootNodeOrRaise(_etree_or_element)
104282  * 
104283  */
104284   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v__etree_or_element)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104285   __Pyx_GOTREF(__pyx_t_1);
104286   __Pyx_DECREF(((PyObject *)__pyx_v_document));
104287   __pyx_v_document = ((struct LxmlDocument *)__pyx_t_1);
104288   __pyx_t_1 = 0;
104289
104290   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":418
104291  * 
104292  *         document = _documentOrRaise(_etree_or_element)
104293  *         element  = _rootNodeOrRaise(_etree_or_element)             # <<<<<<<<<<<<<<
104294  * 
104295  *         self._lock()
104296  */
104297   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v__etree_or_element)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104298   __Pyx_GOTREF(__pyx_t_1);
104299   __Pyx_DECREF(((PyObject *)__pyx_v_element));
104300   __pyx_v_element = ((struct LxmlElement *)__pyx_t_1);
104301   __pyx_t_1 = 0;
104302
104303   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":420
104304  *         element  = _rootNodeOrRaise(_etree_or_element)
104305  * 
104306  *         self._lock()             # <<<<<<<<<<<<<<
104307  *         self._error_log.connect()
104308  *         self._xpathCtxt.doc  = document._c_doc
104309  */
104310   __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree_XPath *)((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._lock(((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104311
104312   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":421
104313  * 
104314  *         self._lock()
104315  *         self._error_log.connect()             # <<<<<<<<<<<<<<
104316  *         self._xpathCtxt.doc  = document._c_doc
104317  *         self._xpathCtxt.node = element._c_node
104318  */
104319   ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->__pyx_base._error_log);
104320
104321   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":422
104322  *         self._lock()
104323  *         self._error_log.connect()
104324  *         self._xpathCtxt.doc  = document._c_doc             # <<<<<<<<<<<<<<
104325  *         self._xpathCtxt.node = element._c_node
104326  * 
104327  */
104328   ((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->__pyx_base._xpathCtxt->doc = __pyx_v_document->_c_doc;
104329
104330   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":423
104331  *         self._error_log.connect()
104332  *         self._xpathCtxt.doc  = document._c_doc
104333  *         self._xpathCtxt.node = element._c_node             # <<<<<<<<<<<<<<
104334  * 
104335  *         try:
104336  */
104337   ((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->__pyx_base._xpathCtxt->node = __pyx_v_element->_c_node;
104338
104339   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":425
104340  *         self._xpathCtxt.node = element._c_node
104341  * 
104342  *         try:             # <<<<<<<<<<<<<<
104343  *             self._context.register_context(document)
104344  *             self._context.registerVariables(_variables)
104345  */
104346   /*try:*/ {
104347
104348     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":426
104349  * 
104350  *         try:
104351  *             self._context.register_context(document)             # <<<<<<<<<<<<<<
104352  *             self._context.registerVariables(_variables)
104353  *             with nogil:
104354  */
104355     __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->__pyx_base._context->__pyx_base.__pyx_vtab)->register_context(((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->__pyx_base._context, __pyx_v_document); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L7;}
104356     __Pyx_GOTREF(__pyx_t_1);
104357     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
104358
104359     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":427
104360  *         try:
104361  *             self._context.register_context(document)
104362  *             self._context.registerVariables(_variables)             # <<<<<<<<<<<<<<
104363  *             with nogil:
104364  *                 xpathObj = xpath.xmlXPathCompiledEval(
104365  */
104366     __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->__pyx_base._context->__pyx_base.__pyx_vtab)->registerVariables(((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->__pyx_base._context, __pyx_v__variables); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L7;}
104367     __Pyx_GOTREF(__pyx_t_1);
104368     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
104369
104370     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":428
104371  *             self._context.register_context(document)
104372  *             self._context.registerVariables(_variables)
104373  *             with nogil:             # <<<<<<<<<<<<<<
104374  *                 xpathObj = xpath.xmlXPathCompiledEval(
104375  *                     self._xpath, self._xpathCtxt)
104376  */
104377     { PyThreadState *_save;
104378       Py_UNBLOCK_THREADS
104379       /*try:*/ {
104380
104381         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":430
104382  *             with nogil:
104383  *                 xpathObj = xpath.xmlXPathCompiledEval(
104384  *                     self._xpath, self._xpathCtxt)             # <<<<<<<<<<<<<<
104385  *             result = self._handle_result(xpathObj, document)
104386  *         finally:
104387  */
104388         __pyx_v_xpathObj = xmlXPathCompiledEval(((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->_xpath, ((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->__pyx_base._xpathCtxt);
104389       }
104390       /*finally:*/ {
104391         Py_BLOCK_THREADS
104392       }
104393     }
104394
104395     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":431
104396  *                 xpathObj = xpath.xmlXPathCompiledEval(
104397  *                     self._xpath, self._xpathCtxt)
104398  *             result = self._handle_result(xpathObj, document)             # <<<<<<<<<<<<<<
104399  *         finally:
104400  *             self._error_log.disconnect()
104401  */
104402     __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree_XPath *)((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._handle_result(((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self), __pyx_v_xpathObj, __pyx_v_document); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L7;}
104403     __Pyx_GOTREF(__pyx_t_1);
104404     __Pyx_DECREF(__pyx_v_result);
104405     __pyx_v_result = __pyx_t_1;
104406     __pyx_t_1 = 0;
104407   }
104408   /*finally:*/ {
104409     int __pyx_why;
104410     PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
104411     int __pyx_exc_lineno;
104412     __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
104413     __pyx_why = 0; goto __pyx_L8;
104414     __pyx_L7: {
104415       __pyx_why = 4;
104416       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
104417       __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
104418       __pyx_exc_lineno = __pyx_lineno;
104419       goto __pyx_L8;
104420     }
104421     __pyx_L8:;
104422
104423     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":433
104424  *             result = self._handle_result(xpathObj, document)
104425  *         finally:
104426  *             self._error_log.disconnect()             # <<<<<<<<<<<<<<
104427  *             self._context.unregister_context()
104428  *             self._unlock()
104429  */
104430     ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->__pyx_base._error_log);
104431
104432     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":434
104433  *         finally:
104434  *             self._error_log.disconnect()
104435  *             self._context.unregister_context()             # <<<<<<<<<<<<<<
104436  *             self._unlock()
104437  *         return result
104438  */
104439     __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->__pyx_base._context->__pyx_base.__pyx_vtab)->unregister_context(((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->__pyx_base._context); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
104440     __Pyx_GOTREF(__pyx_t_1);
104441     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
104442
104443     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":435
104444  *             self._error_log.disconnect()
104445  *             self._context.unregister_context()
104446  *             self._unlock()             # <<<<<<<<<<<<<<
104447  *         return result
104448  * 
104449  */
104450     ((struct __pyx_vtabstruct_4lxml_5etree_XPath *)((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._unlock(((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self));
104451     goto __pyx_L13;
104452     __pyx_L12_error:;
104453     if (__pyx_why == 4) {
104454       Py_XDECREF(__pyx_exc_type);
104455       Py_XDECREF(__pyx_exc_value);
104456       Py_XDECREF(__pyx_exc_tb);
104457     }
104458     goto __pyx_L1_error;
104459     __pyx_L13:;
104460     switch (__pyx_why) {
104461       case 4: {
104462         __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
104463         __pyx_lineno = __pyx_exc_lineno;
104464         __pyx_exc_type = 0;
104465         __pyx_exc_value = 0;
104466         __pyx_exc_tb = 0;
104467         goto __pyx_L1_error;
104468       }
104469     }
104470   }
104471
104472   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":436
104473  *             self._context.unregister_context()
104474  *             self._unlock()
104475  *         return result             # <<<<<<<<<<<<<<
104476  * 
104477  *     def __dealloc__(self):
104478  */
104479   __Pyx_XDECREF(__pyx_r);
104480   __Pyx_INCREF(__pyx_v_result);
104481   __pyx_r = __pyx_v_result;
104482   goto __pyx_L0;
104483
104484   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
104485   goto __pyx_L0;
104486   __pyx_L1_error:;
104487   __Pyx_XDECREF(__pyx_t_1);
104488   __Pyx_AddTraceback("lxml.etree.XPath.__call__");
104489   __pyx_r = NULL;
104490   __pyx_L0:;
104491   __Pyx_DECREF(__pyx_v__variables);
104492   __Pyx_DECREF((PyObject *)__pyx_v_document);
104493   __Pyx_DECREF((PyObject *)__pyx_v_element);
104494   __Pyx_DECREF(__pyx_v_result);
104495   __Pyx_XGIVEREF(__pyx_r);
104496   __Pyx_FinishRefcountContext();
104497   return __pyx_r;
104498 }
104499
104500 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":438
104501  *         return result
104502  * 
104503  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
104504  *         if self._xpath is not NULL:
104505  *             xpath.xmlXPathFreeCompExpr(self._xpath)
104506  */
104507
104508 static void __pyx_pf_4lxml_5etree_5XPath___dealloc__(PyObject *__pyx_v_self); /*proto*/
104509 static void __pyx_pf_4lxml_5etree_5XPath___dealloc__(PyObject *__pyx_v_self) {
104510   int __pyx_t_1;
104511   __Pyx_SetupRefcountContext("__dealloc__");
104512
104513   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":439
104514  * 
104515  *     def __dealloc__(self):
104516  *         if self._xpath is not NULL:             # <<<<<<<<<<<<<<
104517  *             xpath.xmlXPathFreeCompExpr(self._xpath)
104518  * 
104519  */
104520   __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->_xpath != NULL);
104521   if (__pyx_t_1) {
104522
104523     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":440
104524  *     def __dealloc__(self):
104525  *         if self._xpath is not NULL:
104526  *             xpath.xmlXPathFreeCompExpr(self._xpath)             # <<<<<<<<<<<<<<
104527  * 
104528  *     def __repr__(self):
104529  */
104530     xmlXPathFreeCompExpr(((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->_xpath);
104531     goto __pyx_L5;
104532   }
104533   __pyx_L5:;
104534
104535   __Pyx_FinishRefcountContext();
104536 }
104537
104538 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":442
104539  *             xpath.xmlXPathFreeCompExpr(self._xpath)
104540  * 
104541  *     def __repr__(self):             # <<<<<<<<<<<<<<
104542  *         return self.path
104543  * 
104544  */
104545
104546 static PyObject *__pyx_pf_4lxml_5etree_5XPath___repr__(PyObject *__pyx_v_self); /*proto*/
104547 static PyObject *__pyx_pf_4lxml_5etree_5XPath___repr__(PyObject *__pyx_v_self) {
104548   PyObject *__pyx_r = NULL;
104549   __Pyx_SetupRefcountContext("__repr__");
104550
104551   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":443
104552  * 
104553  *     def __repr__(self):
104554  *         return self.path             # <<<<<<<<<<<<<<
104555  * 
104556  * 
104557  */
104558   __Pyx_XDECREF(__pyx_r);
104559   __Pyx_INCREF(((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->path);
104560   __pyx_r = ((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->path;
104561   goto __pyx_L0;
104562
104563   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
104564   __pyx_L0:;
104565   __Pyx_XGIVEREF(__pyx_r);
104566   __Pyx_FinishRefcountContext();
104567   return __pyx_r;
104568 }
104569
104570 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":460
104571  *     you pass ``smart_strings=False``.
104572  *     """
104573  *     def __init__(self, path, *, extensions=None, regexp=True, smart_strings=True):             # <<<<<<<<<<<<<<
104574  *         path, namespaces = self._nsextract_path(path)
104575  *         XPath.__init__(self, path, namespaces=namespaces,
104576  */
104577
104578 static int __pyx_pf_4lxml_5etree_7ETXPath___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
104579 static int __pyx_pf_4lxml_5etree_7ETXPath___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
104580   PyObject *__pyx_v_path = 0;
104581   PyObject *__pyx_v_extensions = 0;
104582   PyObject *__pyx_v_regexp = 0;
104583   PyObject *__pyx_v_smart_strings = 0;
104584   PyObject *__pyx_v_namespaces;
104585   int __pyx_r;
104586   PyObject *__pyx_1 = 0;
104587   PyObject *__pyx_2 = 0;
104588   PyObject *__pyx_3 = 0;
104589   PyObject *__pyx_t_1 = NULL;
104590   PyObject *__pyx_t_2 = NULL;
104591   PyObject *__pyx_t_3 = NULL;
104592   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_path,&__pyx_kp_extensions,&__pyx_kp_regexp,&__pyx_kp_smart_strings,0};
104593   __Pyx_SetupRefcountContext("__init__");
104594   if (unlikely(__pyx_kwds)) {
104595     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
104596     PyObject* values[4] = {0,0,0,0};
104597     values[1] = Py_None;
104598     values[2] = __pyx_k_185;
104599     values[3] = __pyx_k_186;
104600     switch (PyTuple_GET_SIZE(__pyx_args)) {
104601       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
104602       case  0: break;
104603       default: goto __pyx_L5_argtuple_error;
104604     }
104605     switch (PyTuple_GET_SIZE(__pyx_args)) {
104606       case  0:
104607       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_path);
104608       if (likely(values[0])) kw_args--;
104609       else goto __pyx_L5_argtuple_error;
104610     }
104611     while (kw_args > 0) {
104612       PyObject* value;
104613       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_extensions);
104614       if (value) { values[1] = value; if (!(--kw_args)) break; }
104615       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_regexp);
104616       if (value) { values[2] = value; if (!(--kw_args)) break; }
104617       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_smart_strings);
104618       if (value) { values[3] = value; if (!(--kw_args)) break; }
104619       break;
104620     }
104621     if (unlikely(kw_args > 0)) {
104622       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
104623     }
104624     __pyx_v_path = values[0];
104625     __pyx_v_extensions = values[1];
104626     __pyx_v_regexp = values[2];
104627     __pyx_v_smart_strings = values[3];
104628   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
104629     goto __pyx_L5_argtuple_error;
104630   } else {
104631     __pyx_v_path = PyTuple_GET_ITEM(__pyx_args, 0);
104632     __pyx_v_extensions = Py_None;
104633     __pyx_v_regexp = __pyx_k_185;
104634     __pyx_v_smart_strings = __pyx_k_186;
104635   }
104636   goto __pyx_L4_argument_unpacking_done;
104637   __pyx_L5_argtuple_error:;
104638   __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[17]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
104639   __pyx_L3_error:;
104640   __Pyx_AddTraceback("lxml.etree.ETXPath.__init__");
104641   return -1;
104642   __pyx_L4_argument_unpacking_done:;
104643   __Pyx_INCREF(__pyx_v_path);
104644   __pyx_v_namespaces = Py_None; __Pyx_INCREF(Py_None);
104645
104646   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":461
104647  *     """
104648  *     def __init__(self, path, *, extensions=None, regexp=True, smart_strings=True):
104649  *         path, namespaces = self._nsextract_path(path)             # <<<<<<<<<<<<<<
104650  *         XPath.__init__(self, path, namespaces=namespaces,
104651  *                        extensions=extensions, regexp=regexp,
104652  */
104653   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree_ETXPath *)((struct __pyx_obj_4lxml_5etree_ETXPath *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->_nsextract_path(((struct __pyx_obj_4lxml_5etree_ETXPath *)__pyx_v_self), __pyx_v_path); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104654   __Pyx_GOTREF(__pyx_t_1);
104655   if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 2)) {
104656     PyObject* tuple = __pyx_t_1;
104657     __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
104658     __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
104659     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
104660     __Pyx_DECREF(__pyx_v_path);
104661     __pyx_v_path = __pyx_2;
104662     __pyx_2 = 0;
104663     __Pyx_DECREF(__pyx_v_namespaces);
104664     __pyx_v_namespaces = __pyx_3;
104665     __pyx_3 = 0;
104666   } else {
104667     __pyx_1 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104668     __Pyx_GOTREF(__pyx_1);
104669     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
104670     __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104671     __Pyx_GOTREF(__pyx_2);
104672     __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104673     __Pyx_GOTREF(__pyx_3);
104674     if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104675     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
104676     __Pyx_DECREF(__pyx_v_path);
104677     __pyx_v_path = __pyx_2;
104678     __pyx_2 = 0;
104679     __Pyx_DECREF(__pyx_v_namespaces);
104680     __pyx_v_namespaces = __pyx_3;
104681     __pyx_3 = 0;
104682   }
104683
104684   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":462
104685  *     def __init__(self, path, *, extensions=None, regexp=True, smart_strings=True):
104686  *         path, namespaces = self._nsextract_path(path)
104687  *         XPath.__init__(self, path, namespaces=namespaces,             # <<<<<<<<<<<<<<
104688  *                        extensions=extensions, regexp=regexp,
104689  *                        smart_strings=smart_strings)
104690  */
104691   __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_XPath)), __pyx_kp___init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104692   __Pyx_GOTREF(__pyx_t_1);
104693   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104694   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
104695   __Pyx_INCREF(__pyx_v_self);
104696   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
104697   __Pyx_GIVEREF(__pyx_v_self);
104698   __Pyx_INCREF(__pyx_v_path);
104699   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_path);
104700   __Pyx_GIVEREF(__pyx_v_path);
104701   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104702   __Pyx_GOTREF(((PyObject *)__pyx_1));
104703   if (PyDict_SetItem(__pyx_1, __pyx_kp_namespaces, __pyx_v_namespaces) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104704
104705   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":463
104706  *         path, namespaces = self._nsextract_path(path)
104707  *         XPath.__init__(self, path, namespaces=namespaces,
104708  *                        extensions=extensions, regexp=regexp,             # <<<<<<<<<<<<<<
104709  *                        smart_strings=smart_strings)
104710  * 
104711  */
104712   if (PyDict_SetItem(__pyx_1, __pyx_kp_extensions, __pyx_v_extensions) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104713   if (PyDict_SetItem(__pyx_1, __pyx_kp_regexp, __pyx_v_regexp) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104714
104715   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":464
104716  *         XPath.__init__(self, path, namespaces=namespaces,
104717  *                        extensions=extensions, regexp=regexp,
104718  *                        smart_strings=smart_strings)             # <<<<<<<<<<<<<<
104719  * 
104720  *     cdef _nsextract_path(self, path):
104721  */
104722   if (PyDict_SetItem(__pyx_1, __pyx_kp_smart_strings, __pyx_v_smart_strings) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104723   __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104724   __Pyx_GOTREF(__pyx_t_3);
104725   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
104726   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
104727   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
104728   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
104729
104730   __pyx_r = 0;
104731   goto __pyx_L0;
104732   __pyx_L1_error:;
104733   __Pyx_XDECREF(__pyx_1);
104734   __Pyx_XDECREF(__pyx_2);
104735   __Pyx_XDECREF(__pyx_3);
104736   __Pyx_XDECREF(__pyx_t_1);
104737   __Pyx_XDECREF(__pyx_t_2);
104738   __Pyx_XDECREF(__pyx_t_3);
104739   __Pyx_AddTraceback("lxml.etree.ETXPath.__init__");
104740   __pyx_r = -1;
104741   __pyx_L0:;
104742   __Pyx_DECREF(__pyx_v_namespaces);
104743   __Pyx_DECREF(__pyx_v_path);
104744   __Pyx_FinishRefcountContext();
104745   return __pyx_r;
104746 }
104747
104748 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":466
104749  *                        smart_strings=smart_strings)
104750  * 
104751  *     cdef _nsextract_path(self, path):             # <<<<<<<<<<<<<<
104752  *         # replace {namespaces} by new prefixes
104753  *         cdef dict namespaces = {}
104754  */
104755
104756 static  PyObject *__pyx_f_4lxml_5etree_7ETXPath__nsextract_path(struct __pyx_obj_4lxml_5etree_ETXPath *__pyx_v_self, PyObject *__pyx_v_path) {
104757   PyObject *__pyx_v_namespaces = 0;
104758   PyObject *__pyx_v_namespace_defs = 0;
104759   int __pyx_v_i;
104760   PyObject *__pyx_v_path_utf;
104761   PyObject *__pyx_v_stripped_path;
104762   PyObject *__pyx_v_namespace_def;
104763   PyObject *__pyx_v_prefix;
104764   PyObject *__pyx_v_namespace;
104765   PyObject *__pyx_v_prefix_str;
104766   PyObject *__pyx_r = NULL;
104767   PyObject *__pyx_1 = 0;
104768   PyObject *__pyx_t_1 = NULL;
104769   PyObject *__pyx_t_2 = NULL;
104770   Py_ssize_t __pyx_t_3;
104771   int __pyx_t_4;
104772   int __pyx_t_5;
104773   PyObject *__pyx_t_6 = NULL;
104774   PyObject *__pyx_t_7 = NULL;
104775   __Pyx_SetupRefcountContext("_nsextract_path");
104776   __Pyx_INCREF(__pyx_v_path);
104777   __pyx_v_path_utf = Py_None; __Pyx_INCREF(Py_None);
104778   __pyx_v_stripped_path = Py_None; __Pyx_INCREF(Py_None);
104779   __pyx_v_namespace_def = Py_None; __Pyx_INCREF(Py_None);
104780   __pyx_v_prefix = Py_None; __Pyx_INCREF(Py_None);
104781   __pyx_v_namespace = Py_None; __Pyx_INCREF(Py_None);
104782   __pyx_v_prefix_str = Py_None; __Pyx_INCREF(Py_None);
104783
104784   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":468
104785  *     cdef _nsextract_path(self, path):
104786  *         # replace {namespaces} by new prefixes
104787  *         cdef dict namespaces = {}             # <<<<<<<<<<<<<<
104788  *         cdef list namespace_defs = []
104789  *         cdef int i
104790  */
104791   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104792   __Pyx_GOTREF(((PyObject *)__pyx_1));
104793   __pyx_v_namespaces = __pyx_1;
104794   __pyx_1 = 0;
104795
104796   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":469
104797  *         # replace {namespaces} by new prefixes
104798  *         cdef dict namespaces = {}
104799  *         cdef list namespace_defs = []             # <<<<<<<<<<<<<<
104800  *         cdef int i
104801  *         path_utf = _utf8(path)
104802  */
104803   __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104804   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
104805   __pyx_v_namespace_defs = __pyx_t_1;
104806   __pyx_t_1 = 0;
104807
104808   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":471
104809  *         cdef list namespace_defs = []
104810  *         cdef int i
104811  *         path_utf = _utf8(path)             # <<<<<<<<<<<<<<
104812  *         stripped_path = _replace_strings('', path_utf) # remove string literals
104813  *         i = 1
104814  */
104815   __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_path); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104816   __Pyx_GOTREF(__pyx_t_1);
104817   __Pyx_DECREF(__pyx_v_path_utf);
104818   __pyx_v_path_utf = __pyx_t_1;
104819   __pyx_t_1 = 0;
104820
104821   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":472
104822  *         cdef int i
104823  *         path_utf = _utf8(path)
104824  *         stripped_path = _replace_strings('', path_utf) # remove string literals             # <<<<<<<<<<<<<<
104825  *         i = 1
104826  *         for namespace_def in _find_namespaces(stripped_path):
104827  */
104828   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104829   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
104830   __Pyx_INCREF(__pyx_kp_596);
104831   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_596);
104832   __Pyx_GIVEREF(__pyx_kp_596);
104833   __Pyx_INCREF(__pyx_v_path_utf);
104834   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_path_utf);
104835   __Pyx_GIVEREF(__pyx_v_path_utf);
104836   __pyx_t_2 = PyObject_Call(__pyx_v_4lxml_5etree__replace_strings, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104837   __Pyx_GOTREF(__pyx_t_2);
104838   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
104839   __Pyx_DECREF(__pyx_v_stripped_path);
104840   __pyx_v_stripped_path = __pyx_t_2;
104841   __pyx_t_2 = 0;
104842
104843   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":473
104844  *         path_utf = _utf8(path)
104845  *         stripped_path = _replace_strings('', path_utf) # remove string literals
104846  *         i = 1             # <<<<<<<<<<<<<<
104847  *         for namespace_def in _find_namespaces(stripped_path):
104848  *             if namespace_def not in namespace_defs:
104849  */
104850   __pyx_v_i = 1;
104851
104852   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":474
104853  *         stripped_path = _replace_strings('', path_utf) # remove string literals
104854  *         i = 1
104855  *         for namespace_def in _find_namespaces(stripped_path):             # <<<<<<<<<<<<<<
104856  *             if namespace_def not in namespace_defs:
104857  *                 prefix = python.PyString_FromFormat("__xpp%02d", i)
104858  */
104859   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104860   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
104861   __Pyx_INCREF(__pyx_v_stripped_path);
104862   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_stripped_path);
104863   __Pyx_GIVEREF(__pyx_v_stripped_path);
104864   __pyx_t_1 = PyObject_Call(__pyx_v_4lxml_5etree__find_namespaces, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104865   __Pyx_GOTREF(__pyx_t_1);
104866   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
104867   if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
104868     __pyx_t_3 = 0; __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2);
104869   } else {
104870     __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104871     __Pyx_GOTREF(__pyx_t_2);
104872   }
104873   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
104874   for (;;) {
104875     if (likely(PyList_CheckExact(__pyx_t_2))) {
104876       if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
104877       __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
104878     } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
104879       if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
104880       __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
104881     } else {
104882       __pyx_t_1 = PyIter_Next(__pyx_t_2);
104883       if (!__pyx_t_1) {
104884         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104885         break;
104886       }
104887       __Pyx_GOTREF(__pyx_t_1);
104888     }
104889     __Pyx_DECREF(__pyx_v_namespace_def);
104890     __pyx_v_namespace_def = __pyx_t_1;
104891     __pyx_t_1 = 0;
104892
104893     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":475
104894  *         i = 1
104895  *         for namespace_def in _find_namespaces(stripped_path):
104896  *             if namespace_def not in namespace_defs:             # <<<<<<<<<<<<<<
104897  *                 prefix = python.PyString_FromFormat("__xpp%02d", i)
104898  *                 i += 1
104899  */
104900     __pyx_t_4 = (!PySequence_Contains(((PyObject *)__pyx_v_namespace_defs), __pyx_v_namespace_def)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104901     if (__pyx_t_4) {
104902
104903       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":476
104904  *         for namespace_def in _find_namespaces(stripped_path):
104905  *             if namespace_def not in namespace_defs:
104906  *                 prefix = python.PyString_FromFormat("__xpp%02d", i)             # <<<<<<<<<<<<<<
104907  *                 i += 1
104908  *                 namespace_defs.append(namespace_def)
104909  */
104910       __pyx_t_1 = PyString_FromFormat(__pyx_k_597, __pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104911       __Pyx_GOTREF(__pyx_t_1);
104912       __Pyx_DECREF(__pyx_v_prefix);
104913       __pyx_v_prefix = __pyx_t_1;
104914       __pyx_t_1 = 0;
104915
104916       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":477
104917  *             if namespace_def not in namespace_defs:
104918  *                 prefix = python.PyString_FromFormat("__xpp%02d", i)
104919  *                 i += 1             # <<<<<<<<<<<<<<
104920  *                 namespace_defs.append(namespace_def)
104921  *                 namespace = namespace_def[1:-1] # remove '{}'
104922  */
104923       __pyx_v_i += 1;
104924
104925       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":478
104926  *                 prefix = python.PyString_FromFormat("__xpp%02d", i)
104927  *                 i += 1
104928  *                 namespace_defs.append(namespace_def)             # <<<<<<<<<<<<<<
104929  *                 namespace = namespace_def[1:-1] # remove '{}'
104930  *                 namespace = python.PyUnicode_FromEncodedObject(
104931  */
104932       __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_namespace_defs), __pyx_v_namespace_def); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104933
104934       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":479
104935  *                 i += 1
104936  *                 namespace_defs.append(namespace_def)
104937  *                 namespace = namespace_def[1:-1] # remove '{}'             # <<<<<<<<<<<<<<
104938  *                 namespace = python.PyUnicode_FromEncodedObject(
104939  *                     namespace, 'UTF-8', 'strict')
104940  */
104941       __pyx_1 = PySequence_GetSlice(__pyx_v_namespace_def, 1, -1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104942       __Pyx_GOTREF(__pyx_1);
104943       __Pyx_DECREF(__pyx_v_namespace);
104944       __pyx_v_namespace = __pyx_1;
104945       __pyx_1 = 0;
104946
104947       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":481
104948  *                 namespace = namespace_def[1:-1] # remove '{}'
104949  *                 namespace = python.PyUnicode_FromEncodedObject(
104950  *                     namespace, 'UTF-8', 'strict')             # <<<<<<<<<<<<<<
104951  *                 namespaces[
104952  *                     python.PyUnicode_FromEncodedObject(prefix, 'UTF-8', 'strict')
104953  */
104954       __pyx_t_1 = PyUnicode_FromEncodedObject(__pyx_v_namespace, __pyx_k_598, __pyx_k_599); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104955       __Pyx_GOTREF(__pyx_t_1);
104956       __Pyx_DECREF(__pyx_v_namespace);
104957       __pyx_v_namespace = __pyx_t_1;
104958       __pyx_t_1 = 0;
104959
104960       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":483
104961  *                     namespace, 'UTF-8', 'strict')
104962  *                 namespaces[
104963  *                     python.PyUnicode_FromEncodedObject(prefix, 'UTF-8', 'strict')             # <<<<<<<<<<<<<<
104964  *                     ] = namespace
104965  *                 prefix_str = prefix + ':'
104966  */
104967       __pyx_t_1 = PyUnicode_FromEncodedObject(__pyx_v_prefix, __pyx_k_600, __pyx_k_601); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104968       __Pyx_GOTREF(__pyx_t_1);
104969       if (PyDict_SetItem(((PyObject *)__pyx_v_namespaces), __pyx_t_1, __pyx_v_namespace) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104970       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
104971
104972       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":485
104973  *                     python.PyUnicode_FromEncodedObject(prefix, 'UTF-8', 'strict')
104974  *                     ] = namespace
104975  *                 prefix_str = prefix + ':'             # <<<<<<<<<<<<<<
104976  *                 # FIXME: this also replaces {namespaces} within strings!
104977  *                 path_utf = path_utf.replace(namespace_def, prefix_str)
104978  */
104979       __pyx_t_1 = PyNumber_Add(__pyx_v_prefix, __pyx_kp_602); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104980       __Pyx_GOTREF(__pyx_t_1);
104981       __Pyx_DECREF(__pyx_v_prefix_str);
104982       __pyx_v_prefix_str = __pyx_t_1;
104983       __pyx_t_1 = 0;
104984
104985       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":487
104986  *                 prefix_str = prefix + ':'
104987  *                 # FIXME: this also replaces {namespaces} within strings!
104988  *                 path_utf = path_utf.replace(namespace_def, prefix_str)             # <<<<<<<<<<<<<<
104989  *         path = python.PyUnicode_FromEncodedObject(path_utf, 'UTF-8', 'strict')
104990  *         return path, namespaces
104991  */
104992       __pyx_t_1 = PyObject_GetAttr(__pyx_v_path_utf, __pyx_kp_replace); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104993       __Pyx_GOTREF(__pyx_t_1);
104994       __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
104995       __Pyx_GOTREF(((PyObject *)__pyx_t_6));
104996       __Pyx_INCREF(__pyx_v_namespace_def);
104997       PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_namespace_def);
104998       __Pyx_GIVEREF(__pyx_v_namespace_def);
104999       __Pyx_INCREF(__pyx_v_prefix_str);
105000       PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_prefix_str);
105001       __Pyx_GIVEREF(__pyx_v_prefix_str);
105002       __pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
105003       __Pyx_GOTREF(__pyx_t_7);
105004       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
105005       __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
105006       __Pyx_DECREF(__pyx_v_path_utf);
105007       __pyx_v_path_utf = __pyx_t_7;
105008       __pyx_t_7 = 0;
105009       goto __pyx_L5;
105010     }
105011     __pyx_L5:;
105012   }
105013   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
105014
105015   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":488
105016  *                 # FIXME: this also replaces {namespaces} within strings!
105017  *                 path_utf = path_utf.replace(namespace_def, prefix_str)
105018  *         path = python.PyUnicode_FromEncodedObject(path_utf, 'UTF-8', 'strict')             # <<<<<<<<<<<<<<
105019  *         return path, namespaces
105020  */
105021   __pyx_t_2 = PyUnicode_FromEncodedObject(__pyx_v_path_utf, __pyx_k_603, __pyx_k_604); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
105022   __Pyx_GOTREF(__pyx_t_2);
105023   __Pyx_DECREF(__pyx_v_path);
105024   __pyx_v_path = __pyx_t_2;
105025   __pyx_t_2 = 0;
105026
105027   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":489
105028  *                 path_utf = path_utf.replace(namespace_def, prefix_str)
105029  *         path = python.PyUnicode_FromEncodedObject(path_utf, 'UTF-8', 'strict')
105030  *         return path, namespaces             # <<<<<<<<<<<<<<
105031  */
105032   __Pyx_XDECREF(__pyx_r);
105033   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
105034   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
105035   __Pyx_INCREF(__pyx_v_path);
105036   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_path);
105037   __Pyx_GIVEREF(__pyx_v_path);
105038   __Pyx_INCREF(((PyObject *)__pyx_v_namespaces));
105039   PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_namespaces));
105040   __Pyx_GIVEREF(((PyObject *)__pyx_v_namespaces));
105041   __pyx_r = ((PyObject *)__pyx_t_2);
105042   __pyx_t_2 = 0;
105043   goto __pyx_L0;
105044
105045   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
105046   goto __pyx_L0;
105047   __pyx_L1_error:;
105048   __Pyx_XDECREF(__pyx_1);
105049   __Pyx_XDECREF(__pyx_t_1);
105050   __Pyx_XDECREF(__pyx_t_2);
105051   __Pyx_XDECREF(__pyx_t_6);
105052   __Pyx_XDECREF(__pyx_t_7);
105053   __Pyx_AddTraceback("lxml.etree.ETXPath._nsextract_path");
105054   __pyx_r = 0;
105055   __pyx_L0:;
105056   __Pyx_XDECREF(__pyx_v_namespaces);
105057   __Pyx_XDECREF(__pyx_v_namespace_defs);
105058   __Pyx_DECREF(__pyx_v_path_utf);
105059   __Pyx_DECREF(__pyx_v_stripped_path);
105060   __Pyx_DECREF(__pyx_v_namespace_def);
105061   __Pyx_DECREF(__pyx_v_prefix);
105062   __Pyx_DECREF(__pyx_v_namespace);
105063   __Pyx_DECREF(__pyx_v_prefix_str);
105064   __Pyx_DECREF(__pyx_v_path);
105065   __Pyx_XGIVEREF(__pyx_r);
105066   __Pyx_FinishRefcountContext();
105067   return __pyx_r;
105068 }
105069
105070 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":54
105071  *     cdef _BaseParser _parser
105072  * 
105073  *     cdef _XSLTResolverContext _copy(self):             # <<<<<<<<<<<<<<
105074  *         cdef _XSLTResolverContext context
105075  *         context = _XSLTResolverContext()
105076  */
105077
105078 static  struct __pyx_obj_4lxml_5etree__XSLTResolverContext *__pyx_f_4lxml_5etree_20_XSLTResolverContext__copy(struct __pyx_obj_4lxml_5etree__XSLTResolverContext *__pyx_v_self) {
105079   struct __pyx_obj_4lxml_5etree__XSLTResolverContext *__pyx_v_context;
105080   struct __pyx_obj_4lxml_5etree__XSLTResolverContext *__pyx_r = NULL;
105081   PyObject *__pyx_t_1 = NULL;
105082   __Pyx_SetupRefcountContext("_copy");
105083   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)Py_None); __Pyx_INCREF(Py_None);
105084
105085   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":56
105086  *     cdef _XSLTResolverContext _copy(self):
105087  *         cdef _XSLTResolverContext context
105088  *         context = _XSLTResolverContext()             # <<<<<<<<<<<<<<
105089  *         _initXSLTResolverContext(context, self._parser)
105090  *         context._c_style_doc = self._c_style_doc
105091  */
105092   __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__XSLTResolverContext)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
105093   __Pyx_GOTREF(__pyx_t_1);
105094   if (!(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__XSLTResolverContext))) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
105095   __Pyx_DECREF(((PyObject *)__pyx_v_context));
105096   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)__pyx_t_1);
105097   __pyx_t_1 = 0;
105098
105099   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":57
105100  *         cdef _XSLTResolverContext context
105101  *         context = _XSLTResolverContext()
105102  *         _initXSLTResolverContext(context, self._parser)             # <<<<<<<<<<<<<<
105103  *         context._c_style_doc = self._c_style_doc
105104  *         return context
105105  */
105106   __pyx_t_1 = __pyx_f_4lxml_5etree__initXSLTResolverContext(__pyx_v_context, __pyx_v_self->_parser); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
105107   __Pyx_GOTREF(__pyx_t_1);
105108   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
105109
105110   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":58
105111  *         context = _XSLTResolverContext()
105112  *         _initXSLTResolverContext(context, self._parser)
105113  *         context._c_style_doc = self._c_style_doc             # <<<<<<<<<<<<<<
105114  *         return context
105115  * 
105116  */
105117   __pyx_v_context->_c_style_doc = __pyx_v_self->_c_style_doc;
105118
105119   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":59
105120  *         _initXSLTResolverContext(context, self._parser)
105121  *         context._c_style_doc = self._c_style_doc
105122  *         return context             # <<<<<<<<<<<<<<
105123  * 
105124  * cdef _initXSLTResolverContext(_XSLTResolverContext context,
105125  */
105126   __Pyx_XDECREF(((PyObject *)__pyx_r));
105127   __Pyx_INCREF(((PyObject *)__pyx_v_context));
105128   __pyx_r = __pyx_v_context;
105129   goto __pyx_L0;
105130
105131   __pyx_r = ((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)Py_None); __Pyx_INCREF(Py_None);
105132   goto __pyx_L0;
105133   __pyx_L1_error:;
105134   __Pyx_XDECREF(__pyx_t_1);
105135   __Pyx_AddTraceback("lxml.etree._XSLTResolverContext._copy");
105136   __pyx_r = 0;
105137   __pyx_L0:;
105138   __Pyx_DECREF((PyObject *)__pyx_v_context);
105139   __Pyx_XGIVEREF((PyObject *)__pyx_r);
105140   __Pyx_FinishRefcountContext();
105141   return __pyx_r;
105142 }
105143
105144 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":61
105145  *         return context
105146  * 
105147  * cdef _initXSLTResolverContext(_XSLTResolverContext context,             # <<<<<<<<<<<<<<
105148  *                               _BaseParser parser):
105149  *     _initResolverContext(context, parser.resolvers)
105150  */
105151
105152 static  PyObject *__pyx_f_4lxml_5etree__initXSLTResolverContext(struct __pyx_obj_4lxml_5etree__XSLTResolverContext *__pyx_v_context, struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser) {
105153   PyObject *__pyx_r = NULL;
105154   PyObject *__pyx_t_1 = NULL;
105155   PyObject *__pyx_t_2 = NULL;
105156   __Pyx_SetupRefcountContext("_initXSLTResolverContext");
105157
105158   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":63
105159  * cdef _initXSLTResolverContext(_XSLTResolverContext context,
105160  *                               _BaseParser parser):
105161  *     _initResolverContext(context, parser.resolvers)             # <<<<<<<<<<<<<<
105162  *     context._parser = parser
105163  *     context._c_style_doc = NULL
105164  */
105165   __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_parser), __pyx_kp_resolvers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
105166   __Pyx_GOTREF(__pyx_t_1);
105167   if (!(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__ResolverRegistry))) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
105168   __pyx_t_2 = __pyx_f_4lxml_5etree__initResolverContext(((struct __pyx_obj_4lxml_5etree__ResolverContext *)__pyx_v_context), ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
105169   __Pyx_GOTREF(__pyx_t_2);
105170   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
105171   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
105172
105173   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":64
105174  *                               _BaseParser parser):
105175  *     _initResolverContext(context, parser.resolvers)
105176  *     context._parser = parser             # <<<<<<<<<<<<<<
105177  *     context._c_style_doc = NULL
105178  * 
105179  */
105180   __Pyx_INCREF(((PyObject *)__pyx_v_parser));
105181   __Pyx_GIVEREF(((PyObject *)__pyx_v_parser));
105182   __Pyx_GOTREF(__pyx_v_context->_parser);
105183   __Pyx_DECREF(((PyObject *)__pyx_v_context->_parser));
105184   __pyx_v_context->_parser = __pyx_v_parser;
105185
105186   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":65
105187  *     _initResolverContext(context, parser.resolvers)
105188  *     context._parser = parser
105189  *     context._c_style_doc = NULL             # <<<<<<<<<<<<<<
105190  * 
105191  * cdef xmlDoc* _xslt_resolve_from_python(char* c_uri, void* c_context,
105192  */
105193   __pyx_v_context->_c_style_doc = NULL;
105194
105195   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
105196   goto __pyx_L0;
105197   __pyx_L1_error:;
105198   __Pyx_XDECREF(__pyx_t_1);
105199   __Pyx_XDECREF(__pyx_t_2);
105200   __Pyx_AddTraceback("lxml.etree._initXSLTResolverContext");
105201   __pyx_r = 0;
105202   __pyx_L0:;
105203   __Pyx_XGIVEREF(__pyx_r);
105204   __Pyx_FinishRefcountContext();
105205   return __pyx_r;
105206 }
105207
105208 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":67
105209  *     context._c_style_doc = NULL
105210  * 
105211  * cdef xmlDoc* _xslt_resolve_from_python(char* c_uri, void* c_context,             # <<<<<<<<<<<<<<
105212  *                                        int parse_options, int* error) with gil:
105213  *     # call the Python document loaders
105214  */
105215
105216 static  xmlDoc *__pyx_f_4lxml_5etree__xslt_resolve_from_python(char *__pyx_v_c_uri, void *__pyx_v_c_context, int __pyx_v_parse_options, int *__pyx_v_error) {
105217   struct __pyx_obj_4lxml_5etree__XSLTResolverContext *__pyx_v_context;
105218   struct __pyx_obj_4lxml_5etree__ResolverRegistry *__pyx_v_resolvers;
105219   struct __pyx_obj_4lxml_5etree__InputDocument *__pyx_v_doc_ref;
105220   xmlDoc *__pyx_v_c_doc;
105221   PyObject *__pyx_v_uri;
105222   xmlDoc *__pyx_r;
105223   int __pyx_t_1;
105224   xmlDoc *__pyx_t_2;
105225   PyObject *__pyx_t_3 = NULL;
105226   PyObject *__pyx_t_4 = NULL;
105227   PyObject *__pyx_t_5 = NULL;
105228   xmlDoc *__pyx_t_6;
105229   xmlDoc *__pyx_t_7;
105230   xmlDoc *__pyx_t_8;
105231   xmlDoc *__pyx_t_9;
105232   PyGILState_STATE _save = PyGILState_Ensure();
105233   __Pyx_SetupRefcountContext("_xslt_resolve_from_python");
105234   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)Py_None); __Pyx_INCREF(Py_None);
105235   __pyx_v_resolvers = ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)Py_None); __Pyx_INCREF(Py_None);
105236   __pyx_v_doc_ref = ((struct __pyx_obj_4lxml_5etree__InputDocument *)Py_None); __Pyx_INCREF(Py_None);
105237   __pyx_v_uri = Py_None; __Pyx_INCREF(Py_None);
105238
105239   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":75
105240  *     cdef xmlDoc* c_doc
105241  * 
105242  *     error[0] = 0             # <<<<<<<<<<<<<<
105243  *     context = <_XSLTResolverContext>c_context
105244  * 
105245  */
105246   (__pyx_v_error[0]) = 0;
105247
105248   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":76
105249  * 
105250  *     error[0] = 0
105251  *     context = <_XSLTResolverContext>c_context             # <<<<<<<<<<<<<<
105252  * 
105253  *     # shortcut if we resolve the stylesheet itself
105254  */
105255   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)__pyx_v_c_context)));
105256   __Pyx_DECREF(((PyObject *)__pyx_v_context));
105257   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)__pyx_v_c_context);
105258
105259   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":79
105260  * 
105261  *     # shortcut if we resolve the stylesheet itself
105262  *     c_doc = context._c_style_doc             # <<<<<<<<<<<<<<
105263  *     if c_doc is not NULL and c_doc.URL is not NULL:
105264  *         if cstd.strcmp(c_uri, c_doc.URL) == 0:
105265  */
105266   __pyx_v_c_doc = __pyx_v_context->_c_style_doc;
105267
105268   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":80
105269  *     # shortcut if we resolve the stylesheet itself
105270  *     c_doc = context._c_style_doc
105271  *     if c_doc is not NULL and c_doc.URL is not NULL:             # <<<<<<<<<<<<<<
105272  *         if cstd.strcmp(c_uri, c_doc.URL) == 0:
105273  *             return _copyDoc(c_doc, 1)
105274  */
105275   if ((__pyx_v_c_doc != NULL)) {
105276     __pyx_t_1 = (__pyx_v_c_doc->URL != NULL);
105277   } else {
105278     __pyx_t_1 = (__pyx_v_c_doc != NULL);
105279   }
105280   if (__pyx_t_1) {
105281
105282     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":81
105283  *     c_doc = context._c_style_doc
105284  *     if c_doc is not NULL and c_doc.URL is not NULL:
105285  *         if cstd.strcmp(c_uri, c_doc.URL) == 0:             # <<<<<<<<<<<<<<
105286  *             return _copyDoc(c_doc, 1)
105287  * 
105288  */
105289     __pyx_t_1 = (strcmp(__pyx_v_c_uri, __pyx_v_c_doc->URL) == 0);
105290     if (__pyx_t_1) {
105291
105292       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":82
105293  *     if c_doc is not NULL and c_doc.URL is not NULL:
105294  *         if cstd.strcmp(c_uri, c_doc.URL) == 0:
105295  *             return _copyDoc(c_doc, 1)             # <<<<<<<<<<<<<<
105296  * 
105297  *     # delegate to the Python resolvers
105298  */
105299       __pyx_t_2 = __pyx_f_4lxml_5etree__copyDoc(__pyx_v_c_doc, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
105300       __pyx_r = __pyx_t_2;
105301       goto __pyx_L0;
105302       goto __pyx_L4;
105303     }
105304     __pyx_L4:;
105305     goto __pyx_L3;
105306   }
105307   __pyx_L3:;
105308
105309   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":85
105310  * 
105311  *     # delegate to the Python resolvers
105312  *     try:             # <<<<<<<<<<<<<<
105313  *         resolvers = context._resolvers
105314  *         if cstd.strncmp('string://__STRING__XSLT__/', c_uri, 26) == 0:
105315  */
105316   {
105317     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
105318     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
105319     __Pyx_XGOTREF(__pyx_save_exc_type);
105320     __Pyx_XGOTREF(__pyx_save_exc_value);
105321     __Pyx_XGOTREF(__pyx_save_exc_tb);
105322     /*try:*/ {
105323
105324       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":86
105325  *     # delegate to the Python resolvers
105326  *     try:
105327  *         resolvers = context._resolvers             # <<<<<<<<<<<<<<
105328  *         if cstd.strncmp('string://__STRING__XSLT__/', c_uri, 26) == 0:
105329  *             c_uri += 26
105330  */
105331       __Pyx_INCREF(((PyObject *)__pyx_v_context->__pyx_base._resolvers));
105332       __Pyx_DECREF(((PyObject *)__pyx_v_resolvers));
105333       __pyx_v_resolvers = __pyx_v_context->__pyx_base._resolvers;
105334
105335       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":87
105336  *     try:
105337  *         resolvers = context._resolvers
105338  *         if cstd.strncmp('string://__STRING__XSLT__/', c_uri, 26) == 0:             # <<<<<<<<<<<<<<
105339  *             c_uri += 26
105340  *         uri = _decodeFilename(c_uri)
105341  */
105342       __pyx_t_1 = (strncmp(__pyx_k_605, __pyx_v_c_uri, 26) == 0);
105343       if (__pyx_t_1) {
105344
105345         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":88
105346  *         resolvers = context._resolvers
105347  *         if cstd.strncmp('string://__STRING__XSLT__/', c_uri, 26) == 0:
105348  *             c_uri += 26             # <<<<<<<<<<<<<<
105349  *         uri = _decodeFilename(c_uri)
105350  *         doc_ref = resolvers.resolve(uri, None, context)
105351  */
105352         __pyx_v_c_uri += 26;
105353         goto __pyx_L13;
105354       }
105355       __pyx_L13:;
105356
105357       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":89
105358  *         if cstd.strncmp('string://__STRING__XSLT__/', c_uri, 26) == 0:
105359  *             c_uri += 26
105360  *         uri = _decodeFilename(c_uri)             # <<<<<<<<<<<<<<
105361  *         doc_ref = resolvers.resolve(uri, None, context)
105362  * 
105363  */
105364       __pyx_t_3 = __pyx_f_4lxml_5etree__decodeFilename(__pyx_v_c_uri); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
105365       __Pyx_GOTREF(__pyx_t_3);
105366       __Pyx_DECREF(__pyx_v_uri);
105367       __pyx_v_uri = __pyx_t_3;
105368       __pyx_t_3 = 0;
105369
105370       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":90
105371  *             c_uri += 26
105372  *         uri = _decodeFilename(c_uri)
105373  *         doc_ref = resolvers.resolve(uri, None, context)             # <<<<<<<<<<<<<<
105374  * 
105375  *         c_doc = NULL
105376  */
105377       __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_resolvers), __pyx_kp_resolve); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
105378       __Pyx_GOTREF(__pyx_t_3);
105379       __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
105380       __Pyx_GOTREF(((PyObject *)__pyx_t_4));
105381       __Pyx_INCREF(__pyx_v_uri);
105382       PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_uri);
105383       __Pyx_GIVEREF(__pyx_v_uri);
105384       __Pyx_INCREF(Py_None);
105385       PyTuple_SET_ITEM(__pyx_t_4, 1, Py_None);
105386       __Pyx_GIVEREF(Py_None);
105387       __Pyx_INCREF(((PyObject *)__pyx_v_context));
105388       PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_context));
105389       __Pyx_GIVEREF(((PyObject *)__pyx_v_context));
105390       __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
105391       __Pyx_GOTREF(__pyx_t_5);
105392       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
105393       __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
105394       if (!(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_4lxml_5etree__InputDocument))) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
105395       __Pyx_DECREF(((PyObject *)__pyx_v_doc_ref));
105396       __pyx_v_doc_ref = ((struct __pyx_obj_4lxml_5etree__InputDocument *)__pyx_t_5);
105397       __pyx_t_5 = 0;
105398
105399       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":92
105400  *         doc_ref = resolvers.resolve(uri, None, context)
105401  * 
105402  *         c_doc = NULL             # <<<<<<<<<<<<<<
105403  *         if doc_ref is not None:
105404  *             if doc_ref._type == PARSER_DATA_STRING:
105405  */
105406       __pyx_v_c_doc = NULL;
105407
105408       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":93
105409  * 
105410  *         c_doc = NULL
105411  *         if doc_ref is not None:             # <<<<<<<<<<<<<<
105412  *             if doc_ref._type == PARSER_DATA_STRING:
105413  *                 c_doc = _parseDoc(
105414  */
105415       __pyx_t_1 = (((PyObject *)__pyx_v_doc_ref) != Py_None);
105416       if (__pyx_t_1) {
105417
105418         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":94
105419  *         c_doc = NULL
105420  *         if doc_ref is not None:
105421  *             if doc_ref._type == PARSER_DATA_STRING:             # <<<<<<<<<<<<<<
105422  *                 c_doc = _parseDoc(
105423  *                     doc_ref._data_bytes, doc_ref._filename, context._parser)
105424  */
105425         __pyx_t_1 = (__pyx_v_doc_ref->_type == __pyx_e_4lxml_5etree_PARSER_DATA_STRING);
105426         if (__pyx_t_1) {
105427
105428           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":96
105429  *             if doc_ref._type == PARSER_DATA_STRING:
105430  *                 c_doc = _parseDoc(
105431  *                     doc_ref._data_bytes, doc_ref._filename, context._parser)             # <<<<<<<<<<<<<<
105432  *             elif doc_ref._type == PARSER_DATA_FILENAME:
105433  *                 c_doc = _parseDocFromFile(doc_ref._filename, context._parser)
105434  */
105435           __pyx_t_6 = __pyx_f_4lxml_5etree__parseDoc(__pyx_v_doc_ref->_data_bytes, __pyx_v_doc_ref->_filename, __pyx_v_context->_parser); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
105436           __pyx_v_c_doc = __pyx_t_6;
105437           goto __pyx_L15;
105438         }
105439
105440         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":97
105441  *                 c_doc = _parseDoc(
105442  *                     doc_ref._data_bytes, doc_ref._filename, context._parser)
105443  *             elif doc_ref._type == PARSER_DATA_FILENAME:             # <<<<<<<<<<<<<<
105444  *                 c_doc = _parseDocFromFile(doc_ref._filename, context._parser)
105445  *             elif doc_ref._type == PARSER_DATA_FILE:
105446  */
105447         __pyx_t_1 = (__pyx_v_doc_ref->_type == __pyx_e_4lxml_5etree_PARSER_DATA_FILENAME);
105448         if (__pyx_t_1) {
105449
105450           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":98
105451  *                     doc_ref._data_bytes, doc_ref._filename, context._parser)
105452  *             elif doc_ref._type == PARSER_DATA_FILENAME:
105453  *                 c_doc = _parseDocFromFile(doc_ref._filename, context._parser)             # <<<<<<<<<<<<<<
105454  *             elif doc_ref._type == PARSER_DATA_FILE:
105455  *                 c_doc = _parseDocFromFilelike(
105456  */
105457           __pyx_t_7 = __pyx_f_4lxml_5etree__parseDocFromFile(__pyx_v_doc_ref->_filename, __pyx_v_context->_parser); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
105458           __pyx_v_c_doc = __pyx_t_7;
105459           goto __pyx_L15;
105460         }
105461
105462         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":99
105463  *             elif doc_ref._type == PARSER_DATA_FILENAME:
105464  *                 c_doc = _parseDocFromFile(doc_ref._filename, context._parser)
105465  *             elif doc_ref._type == PARSER_DATA_FILE:             # <<<<<<<<<<<<<<
105466  *                 c_doc = _parseDocFromFilelike(
105467  *                     doc_ref._file, doc_ref._filename, context._parser)
105468  */
105469         __pyx_t_1 = (__pyx_v_doc_ref->_type == __pyx_e_4lxml_5etree_PARSER_DATA_FILE);
105470         if (__pyx_t_1) {
105471
105472           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":101
105473  *             elif doc_ref._type == PARSER_DATA_FILE:
105474  *                 c_doc = _parseDocFromFilelike(
105475  *                     doc_ref._file, doc_ref._filename, context._parser)             # <<<<<<<<<<<<<<
105476  *             elif doc_ref._type == PARSER_DATA_EMPTY:
105477  *                 c_doc = _newXMLDoc()
105478  */
105479           __pyx_t_8 = __pyx_f_4lxml_5etree__parseDocFromFilelike(__pyx_v_doc_ref->_file, __pyx_v_doc_ref->_filename, __pyx_v_context->_parser); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
105480           __pyx_v_c_doc = __pyx_t_8;
105481           goto __pyx_L15;
105482         }
105483
105484         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":102
105485  *                 c_doc = _parseDocFromFilelike(
105486  *                     doc_ref._file, doc_ref._filename, context._parser)
105487  *             elif doc_ref._type == PARSER_DATA_EMPTY:             # <<<<<<<<<<<<<<
105488  *                 c_doc = _newXMLDoc()
105489  *             if c_doc is not NULL and c_doc.URL is NULL:
105490  */
105491         __pyx_t_1 = (__pyx_v_doc_ref->_type == __pyx_e_4lxml_5etree_PARSER_DATA_EMPTY);
105492         if (__pyx_t_1) {
105493
105494           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":103
105495  *                     doc_ref._file, doc_ref._filename, context._parser)
105496  *             elif doc_ref._type == PARSER_DATA_EMPTY:
105497  *                 c_doc = _newXMLDoc()             # <<<<<<<<<<<<<<
105498  *             if c_doc is not NULL and c_doc.URL is NULL:
105499  *                 c_doc.URL = tree.xmlStrdup(c_uri)
105500  */
105501           __pyx_t_9 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
105502           __pyx_v_c_doc = __pyx_t_9;
105503           goto __pyx_L15;
105504         }
105505         __pyx_L15:;
105506
105507         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":104
105508  *             elif doc_ref._type == PARSER_DATA_EMPTY:
105509  *                 c_doc = _newXMLDoc()
105510  *             if c_doc is not NULL and c_doc.URL is NULL:             # <<<<<<<<<<<<<<
105511  *                 c_doc.URL = tree.xmlStrdup(c_uri)
105512  *         return c_doc
105513  */
105514         if ((__pyx_v_c_doc != NULL)) {
105515           __pyx_t_1 = (__pyx_v_c_doc->URL == NULL);
105516         } else {
105517           __pyx_t_1 = (__pyx_v_c_doc != NULL);
105518         }
105519         if (__pyx_t_1) {
105520
105521           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":105
105522  *                 c_doc = _newXMLDoc()
105523  *             if c_doc is not NULL and c_doc.URL is NULL:
105524  *                 c_doc.URL = tree.xmlStrdup(c_uri)             # <<<<<<<<<<<<<<
105525  *         return c_doc
105526  *     except:
105527  */
105528           __pyx_v_c_doc->URL = xmlStrdup(__pyx_v_c_uri);
105529           goto __pyx_L16;
105530         }
105531         __pyx_L16:;
105532         goto __pyx_L14;
105533       }
105534       __pyx_L14:;
105535
105536       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":106
105537  *             if c_doc is not NULL and c_doc.URL is NULL:
105538  *                 c_doc.URL = tree.xmlStrdup(c_uri)
105539  *         return c_doc             # <<<<<<<<<<<<<<
105540  *     except:
105541  *         context._store_raised()
105542  */
105543       __pyx_r = __pyx_v_c_doc;
105544       goto __pyx_L9_try_return;
105545     }
105546     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
105547     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
105548     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
105549     goto __pyx_L12_try_end;
105550     __pyx_L9_try_return:;
105551     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
105552     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
105553     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
105554     goto __pyx_L0;
105555     __pyx_L5_error:;
105556     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
105557     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
105558     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
105559
105560     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":107
105561  *                 c_doc.URL = tree.xmlStrdup(c_uri)
105562  *         return c_doc
105563  *     except:             # <<<<<<<<<<<<<<
105564  *         context._store_raised()
105565  *         error[0] = 1
105566  */
105567     /*except:*/ {
105568       __Pyx_AddTraceback("lxml.etree._xslt_resolve_from_python");
105569       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
105570       __Pyx_GOTREF(__pyx_t_5);
105571       __Pyx_GOTREF(__pyx_t_4);
105572       __Pyx_GOTREF(__pyx_t_3);
105573
105574       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":108
105575  *         return c_doc
105576  *     except:
105577  *         context._store_raised()             # <<<<<<<<<<<<<<
105578  *         error[0] = 1
105579  *         return NULL
105580  */
105581       ((struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._store_raised(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_context));
105582
105583       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":109
105584  *     except:
105585  *         context._store_raised()
105586  *         error[0] = 1             # <<<<<<<<<<<<<<
105587  *         return NULL
105588  * 
105589  */
105590       (__pyx_v_error[0]) = 1;
105591
105592       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":110
105593  *         context._store_raised()
105594  *         error[0] = 1
105595  *         return NULL             # <<<<<<<<<<<<<<
105596  * 
105597  * cdef void _xslt_store_resolver_exception(char* c_uri, void* context,
105598  */
105599       __pyx_r = NULL;
105600       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
105601       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
105602       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
105603       goto __pyx_L8_except_return;
105604       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
105605       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
105606       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
105607       goto __pyx_L6_exception_handled;
105608     }
105609     __pyx_L7_except_error:;
105610     __Pyx_XDECREF(__pyx_save_exc_type);
105611     __Pyx_XDECREF(__pyx_save_exc_value);
105612     __Pyx_XDECREF(__pyx_save_exc_tb);
105613     goto __pyx_L1_error;
105614     __pyx_L8_except_return:;
105615     __Pyx_XGIVEREF(__pyx_save_exc_type);
105616     __Pyx_XGIVEREF(__pyx_save_exc_value);
105617     __Pyx_XGIVEREF(__pyx_save_exc_tb);
105618     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
105619     goto __pyx_L0;
105620     __pyx_L6_exception_handled:;
105621     __Pyx_XGIVEREF(__pyx_save_exc_type);
105622     __Pyx_XGIVEREF(__pyx_save_exc_value);
105623     __Pyx_XGIVEREF(__pyx_save_exc_tb);
105624     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
105625     __pyx_L12_try_end:;
105626   }
105627
105628   __pyx_r = 0;
105629   goto __pyx_L0;
105630   __pyx_L1_error:;
105631   __Pyx_XDECREF(__pyx_t_3);
105632   __Pyx_XDECREF(__pyx_t_4);
105633   __Pyx_XDECREF(__pyx_t_5);
105634   __Pyx_WriteUnraisable("lxml.etree._xslt_resolve_from_python");
105635   __pyx_r = 0;
105636   __pyx_L0:;
105637   __Pyx_DECREF((PyObject *)__pyx_v_context);
105638   __Pyx_DECREF((PyObject *)__pyx_v_resolvers);
105639   __Pyx_DECREF((PyObject *)__pyx_v_doc_ref);
105640   __Pyx_DECREF(__pyx_v_uri);
105641   __Pyx_FinishRefcountContext();
105642   PyGILState_Release(_save);
105643   return __pyx_r;
105644 }
105645
105646 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":112
105647  *         return NULL
105648  * 
105649  * cdef void _xslt_store_resolver_exception(char* c_uri, void* context,             # <<<<<<<<<<<<<<
105650  *                                          xslt.xsltLoadType c_type) with gil:
105651  *     try:
105652  */
105653
105654 static  void __pyx_f_4lxml_5etree__xslt_store_resolver_exception(char *__pyx_v_c_uri, void *__pyx_v_context, xsltLoadType __pyx_v_c_type) {
105655   PyObject *__pyx_v_message;
105656   PyObject *__pyx_v_exception;
105657   PyObject *__pyx_v_e;
105658   PyObject *__pyx_1 = 0;
105659   int __pyx_2;
105660   PyObject *__pyx_3 = 0;
105661   PyObject *__pyx_4 = 0;
105662   PyObject *__pyx_t_1 = NULL;
105663   PyObject *__pyx_t_2 = NULL;
105664   int __pyx_t_3;
105665   PyGILState_STATE _save = PyGILState_Ensure();
105666   __Pyx_SetupRefcountContext("_xslt_store_resolver_exception");
105667   __pyx_v_message = Py_None; __Pyx_INCREF(Py_None);
105668   __pyx_v_exception = Py_None; __Pyx_INCREF(Py_None);
105669   __pyx_v_e = Py_None; __Pyx_INCREF(Py_None);
105670
105671   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":114
105672  * cdef void _xslt_store_resolver_exception(char* c_uri, void* context,
105673  *                                          xslt.xsltLoadType c_type) with gil:
105674  *     try:             # <<<<<<<<<<<<<<
105675  *         message = u"Cannot resolve URI %s" % _decodeFilename(c_uri)
105676  *         if c_type == xslt.XSLT_LOAD_DOCUMENT:
105677  */
105678   {
105679     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
105680     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
105681     __Pyx_XGOTREF(__pyx_save_exc_type);
105682     __Pyx_XGOTREF(__pyx_save_exc_value);
105683     __Pyx_XGOTREF(__pyx_save_exc_tb);
105684     /*try:*/ {
105685
105686       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":115
105687  *                                          xslt.xsltLoadType c_type) with gil:
105688  *     try:
105689  *         message = u"Cannot resolve URI %s" % _decodeFilename(c_uri)             # <<<<<<<<<<<<<<
105690  *         if c_type == xslt.XSLT_LOAD_DOCUMENT:
105691  *             exception = XSLTApplyError(message)
105692  */
105693       __pyx_t_1 = __pyx_f_4lxml_5etree__decodeFilename(__pyx_v_c_uri); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
105694       __Pyx_GOTREF(__pyx_t_1);
105695       __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_606), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
105696       __Pyx_GOTREF(__pyx_t_2);
105697       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
105698       __Pyx_DECREF(__pyx_v_message);
105699       __pyx_v_message = __pyx_t_2;
105700       __pyx_t_2 = 0;
105701
105702       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":116
105703  *     try:
105704  *         message = u"Cannot resolve URI %s" % _decodeFilename(c_uri)
105705  *         if c_type == xslt.XSLT_LOAD_DOCUMENT:             # <<<<<<<<<<<<<<
105706  *             exception = XSLTApplyError(message)
105707  *         else:
105708  */
105709       __pyx_t_3 = (__pyx_v_c_type == XSLT_LOAD_DOCUMENT);
105710       if (__pyx_t_3) {
105711
105712         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":117
105713  *         message = u"Cannot resolve URI %s" % _decodeFilename(c_uri)
105714  *         if c_type == xslt.XSLT_LOAD_DOCUMENT:
105715  *             exception = XSLTApplyError(message)             # <<<<<<<<<<<<<<
105716  *         else:
105717  *             exception = XSLTParseError(message)
105718  */
105719         __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XSLTApplyError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
105720         __Pyx_GOTREF(__pyx_1);
105721         __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
105722         __Pyx_GOTREF(((PyObject *)__pyx_t_2));
105723         __Pyx_INCREF(__pyx_v_message);
105724         PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_message);
105725         __Pyx_GIVEREF(__pyx_v_message);
105726         __pyx_t_1 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
105727         __Pyx_GOTREF(__pyx_t_1);
105728         __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
105729         __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
105730         __Pyx_DECREF(__pyx_v_exception);
105731         __pyx_v_exception = __pyx_t_1;
105732         __pyx_t_1 = 0;
105733         goto __pyx_L11;
105734       }
105735       /*else*/ {
105736
105737         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":119
105738  *             exception = XSLTApplyError(message)
105739  *         else:
105740  *             exception = XSLTParseError(message)             # <<<<<<<<<<<<<<
105741  *         (<_XSLTResolverContext>context)._store_exception(exception)
105742  *     except Exception, e:
105743  */
105744         __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XSLTParseError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
105745         __Pyx_GOTREF(__pyx_1);
105746         __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
105747         __Pyx_GOTREF(((PyObject *)__pyx_t_1));
105748         __Pyx_INCREF(__pyx_v_message);
105749         PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_message);
105750         __Pyx_GIVEREF(__pyx_v_message);
105751         __pyx_t_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
105752         __Pyx_GOTREF(__pyx_t_2);
105753         __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
105754         __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
105755         __Pyx_DECREF(__pyx_v_exception);
105756         __pyx_v_exception = __pyx_t_2;
105757         __pyx_t_2 = 0;
105758       }
105759       __pyx_L11:;
105760
105761       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":120
105762  *         else:
105763  *             exception = XSLTParseError(message)
105764  *         (<_XSLTResolverContext>context)._store_exception(exception)             # <<<<<<<<<<<<<<
105765  *     except Exception, e:
105766  *         (<_XSLTResolverContext>context)._store_exception(e)
105767  */
105768       ((struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *)((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)__pyx_v_context)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._store_exception(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)__pyx_v_context)), __pyx_v_exception);
105769     }
105770     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
105771     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
105772     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
105773     goto __pyx_L10_try_end;
105774     __pyx_L3_error:;
105775     __Pyx_XDECREF(__pyx_1); __pyx_1 = 0;
105776     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
105777     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
105778
105779     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":121
105780  *             exception = XSLTParseError(message)
105781  *         (<_XSLTResolverContext>context)._store_exception(exception)
105782  *     except Exception, e:             # <<<<<<<<<<<<<<
105783  *         (<_XSLTResolverContext>context)._store_exception(e)
105784  * 
105785  */
105786     __pyx_2 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
105787     if (__pyx_2) {
105788       __Pyx_AddTraceback("lxml.etree._xslt_store_resolver_exception");
105789       if (__Pyx_GetException(&__pyx_1, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
105790       __Pyx_GOTREF(__pyx_1);
105791       __Pyx_GOTREF(__pyx_3);
105792       __Pyx_GOTREF(__pyx_4);
105793       __Pyx_INCREF(__pyx_3);
105794       __Pyx_DECREF(__pyx_v_e);
105795       __pyx_v_e = __pyx_3;
105796
105797       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":122
105798  *         (<_XSLTResolverContext>context)._store_exception(exception)
105799  *     except Exception, e:
105800  *         (<_XSLTResolverContext>context)._store_exception(e)             # <<<<<<<<<<<<<<
105801  * 
105802  * cdef xmlDoc* _xslt_doc_loader(char* c_uri, tree.xmlDict* c_dict,
105803  */
105804       ((struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *)((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)__pyx_v_context)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._store_exception(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)__pyx_v_context)), __pyx_v_e);
105805       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
105806       __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
105807       __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
105808       goto __pyx_L4_exception_handled;
105809     }
105810     __pyx_L5_except_error:;
105811     __Pyx_XDECREF(__pyx_save_exc_type);
105812     __Pyx_XDECREF(__pyx_save_exc_value);
105813     __Pyx_XDECREF(__pyx_save_exc_tb);
105814     goto __pyx_L1_error;
105815     __pyx_L4_exception_handled:;
105816     __Pyx_XGIVEREF(__pyx_save_exc_type);
105817     __Pyx_XGIVEREF(__pyx_save_exc_value);
105818     __Pyx_XGIVEREF(__pyx_save_exc_tb);
105819     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
105820     __pyx_L10_try_end:;
105821   }
105822
105823   goto __pyx_L0;
105824   __pyx_L1_error:;
105825   __Pyx_XDECREF(__pyx_1);
105826   __Pyx_XDECREF(__pyx_3);
105827   __Pyx_XDECREF(__pyx_4);
105828   __Pyx_XDECREF(__pyx_t_1);
105829   __Pyx_XDECREF(__pyx_t_2);
105830   __Pyx_WriteUnraisable("lxml.etree._xslt_store_resolver_exception");
105831   __pyx_L0:;
105832   __Pyx_DECREF(__pyx_v_message);
105833   __Pyx_DECREF(__pyx_v_exception);
105834   __Pyx_DECREF(__pyx_v_e);
105835   __Pyx_FinishRefcountContext();
105836   PyGILState_Release(_save);
105837 }
105838
105839 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":124
105840  *         (<_XSLTResolverContext>context)._store_exception(e)
105841  * 
105842  * cdef xmlDoc* _xslt_doc_loader(char* c_uri, tree.xmlDict* c_dict,             # <<<<<<<<<<<<<<
105843  *                               int parse_options, void* c_ctxt,
105844  *                               xslt.xsltLoadType c_type) nogil:
105845  */
105846
105847 static  xmlDoc *__pyx_f_4lxml_5etree__xslt_doc_loader(char *__pyx_v_c_uri, xmlDict *__pyx_v_c_dict, int __pyx_v_parse_options, void *__pyx_v_c_ctxt, xsltLoadType __pyx_v_c_type) {
105848   xmlDoc *__pyx_v_c_doc;
105849   void *__pyx_v_c_pcontext;
105850   int __pyx_v_error;
105851   xmlDoc *__pyx_r;
105852   int __pyx_t_1;
105853
105854   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":134
105855  *     cdef int error
105856  *     # find resolver contexts of stylesheet and transformed doc
105857  *     if c_type == xslt.XSLT_LOAD_DOCUMENT:             # <<<<<<<<<<<<<<
105858  *         # transformation time
105859  *         c_pcontext = (<xslt.xsltTransformContext*>c_ctxt)._private
105860  */
105861   __pyx_t_1 = (__pyx_v_c_type == XSLT_LOAD_DOCUMENT);
105862   if (__pyx_t_1) {
105863
105864     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":136
105865  *     if c_type == xslt.XSLT_LOAD_DOCUMENT:
105866  *         # transformation time
105867  *         c_pcontext = (<xslt.xsltTransformContext*>c_ctxt)._private             # <<<<<<<<<<<<<<
105868  *     elif c_type == xslt.XSLT_LOAD_STYLESHEET:
105869  *         # include/import resolution while parsing
105870  */
105871     __pyx_v_c_pcontext = ((xsltTransformContext *)__pyx_v_c_ctxt)->_private;
105872     goto __pyx_L3;
105873   }
105874
105875   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":137
105876  *         # transformation time
105877  *         c_pcontext = (<xslt.xsltTransformContext*>c_ctxt)._private
105878  *     elif c_type == xslt.XSLT_LOAD_STYLESHEET:             # <<<<<<<<<<<<<<
105879  *         # include/import resolution while parsing
105880  *         c_pcontext = (<xslt.xsltStylesheet*>c_ctxt).doc._private
105881  */
105882   __pyx_t_1 = (__pyx_v_c_type == XSLT_LOAD_STYLESHEET);
105883   if (__pyx_t_1) {
105884
105885     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":139
105886  *     elif c_type == xslt.XSLT_LOAD_STYLESHEET:
105887  *         # include/import resolution while parsing
105888  *         c_pcontext = (<xslt.xsltStylesheet*>c_ctxt).doc._private             # <<<<<<<<<<<<<<
105889  *     else:
105890  *         c_pcontext = NULL
105891  */
105892     __pyx_v_c_pcontext = ((xsltStylesheet *)__pyx_v_c_ctxt)->doc->_private;
105893     goto __pyx_L3;
105894   }
105895   /*else*/ {
105896
105897     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":141
105898  *         c_pcontext = (<xslt.xsltStylesheet*>c_ctxt).doc._private
105899  *     else:
105900  *         c_pcontext = NULL             # <<<<<<<<<<<<<<
105901  * 
105902  *     if c_pcontext is NULL:
105903  */
105904     __pyx_v_c_pcontext = NULL;
105905   }
105906   __pyx_L3:;
105907
105908   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":143
105909  *         c_pcontext = NULL
105910  * 
105911  *     if c_pcontext is NULL:             # <<<<<<<<<<<<<<
105912  *         # can't call Python without context, fall back to default loader
105913  *         return XSLT_DOC_DEFAULT_LOADER(
105914  */
105915   __pyx_t_1 = (__pyx_v_c_pcontext == NULL);
105916   if (__pyx_t_1) {
105917
105918     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":146
105919  *         # can't call Python without context, fall back to default loader
105920  *         return XSLT_DOC_DEFAULT_LOADER(
105921  *             c_uri, c_dict, parse_options, c_ctxt, c_type)             # <<<<<<<<<<<<<<
105922  * 
105923  *     c_doc = _xslt_resolve_from_python(c_uri, c_pcontext, parse_options, &error)
105924  */
105925     __pyx_r = __pyx_v_4lxml_5etree_XSLT_DOC_DEFAULT_LOADER(__pyx_v_c_uri, __pyx_v_c_dict, __pyx_v_parse_options, __pyx_v_c_ctxt, __pyx_v_c_type);
105926     goto __pyx_L0;
105927     goto __pyx_L4;
105928   }
105929   __pyx_L4:;
105930
105931   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":148
105932  *             c_uri, c_dict, parse_options, c_ctxt, c_type)
105933  * 
105934  *     c_doc = _xslt_resolve_from_python(c_uri, c_pcontext, parse_options, &error)             # <<<<<<<<<<<<<<
105935  *     if c_doc is NULL and not error:
105936  *         c_doc = XSLT_DOC_DEFAULT_LOADER(
105937  */
105938   __pyx_v_c_doc = __pyx_f_4lxml_5etree__xslt_resolve_from_python(__pyx_v_c_uri, __pyx_v_c_pcontext, __pyx_v_parse_options, (&__pyx_v_error));
105939
105940   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":149
105941  * 
105942  *     c_doc = _xslt_resolve_from_python(c_uri, c_pcontext, parse_options, &error)
105943  *     if c_doc is NULL and not error:             # <<<<<<<<<<<<<<
105944  *         c_doc = XSLT_DOC_DEFAULT_LOADER(
105945  *             c_uri, c_dict, parse_options, c_ctxt, c_type)
105946  */
105947   if ((__pyx_v_c_doc == NULL)) {
105948     __pyx_t_1 = (!__pyx_v_error);
105949   } else {
105950     __pyx_t_1 = (__pyx_v_c_doc == NULL);
105951   }
105952   if (__pyx_t_1) {
105953
105954     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":151
105955  *     if c_doc is NULL and not error:
105956  *         c_doc = XSLT_DOC_DEFAULT_LOADER(
105957  *             c_uri, c_dict, parse_options, c_ctxt, c_type)             # <<<<<<<<<<<<<<
105958  *         if c_doc is NULL:
105959  *             _xslt_store_resolver_exception(c_uri, c_pcontext, c_type)
105960  */
105961     __pyx_v_c_doc = __pyx_v_4lxml_5etree_XSLT_DOC_DEFAULT_LOADER(__pyx_v_c_uri, __pyx_v_c_dict, __pyx_v_parse_options, __pyx_v_c_ctxt, __pyx_v_c_type);
105962
105963     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":152
105964  *         c_doc = XSLT_DOC_DEFAULT_LOADER(
105965  *             c_uri, c_dict, parse_options, c_ctxt, c_type)
105966  *         if c_doc is NULL:             # <<<<<<<<<<<<<<
105967  *             _xslt_store_resolver_exception(c_uri, c_pcontext, c_type)
105968  * 
105969  */
105970     __pyx_t_1 = (__pyx_v_c_doc == NULL);
105971     if (__pyx_t_1) {
105972
105973       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":153
105974  *             c_uri, c_dict, parse_options, c_ctxt, c_type)
105975  *         if c_doc is NULL:
105976  *             _xslt_store_resolver_exception(c_uri, c_pcontext, c_type)             # <<<<<<<<<<<<<<
105977  * 
105978  *     if c_doc is not NULL and c_type == xslt.XSLT_LOAD_STYLESHEET:
105979  */
105980       __pyx_f_4lxml_5etree__xslt_store_resolver_exception(__pyx_v_c_uri, __pyx_v_c_pcontext, __pyx_v_c_type);
105981       goto __pyx_L6;
105982     }
105983     __pyx_L6:;
105984     goto __pyx_L5;
105985   }
105986   __pyx_L5:;
105987
105988   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":155
105989  *             _xslt_store_resolver_exception(c_uri, c_pcontext, c_type)
105990  * 
105991  *     if c_doc is not NULL and c_type == xslt.XSLT_LOAD_STYLESHEET:             # <<<<<<<<<<<<<<
105992  *         c_doc._private = c_pcontext
105993  *     return c_doc
105994  */
105995   if ((__pyx_v_c_doc != NULL)) {
105996     __pyx_t_1 = (__pyx_v_c_type == XSLT_LOAD_STYLESHEET);
105997   } else {
105998     __pyx_t_1 = (__pyx_v_c_doc != NULL);
105999   }
106000   if (__pyx_t_1) {
106001
106002     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":156
106003  * 
106004  *     if c_doc is not NULL and c_type == xslt.XSLT_LOAD_STYLESHEET:
106005  *         c_doc._private = c_pcontext             # <<<<<<<<<<<<<<
106006  *     return c_doc
106007  * 
106008  */
106009     __pyx_v_c_doc->_private = __pyx_v_c_pcontext;
106010     goto __pyx_L7;
106011   }
106012   __pyx_L7:;
106013
106014   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":157
106015  *     if c_doc is not NULL and c_type == xslt.XSLT_LOAD_STYLESHEET:
106016  *         c_doc._private = c_pcontext
106017  *     return c_doc             # <<<<<<<<<<<<<<
106018  * 
106019  * cdef xslt.xsltDocLoaderFunc XSLT_DOC_DEFAULT_LOADER
106020  */
106021   __pyx_r = __pyx_v_c_doc;
106022   goto __pyx_L0;
106023
106024   __pyx_r = 0;
106025   __pyx_L0:;
106026   return __pyx_r;
106027 }
106028
106029 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":189
106030  *     """
106031  *     cdef xslt.xsltSecurityPrefs* _prefs
106032  *     def __init__(self, *, read_file=True, write_file=True, create_dir=True,             # <<<<<<<<<<<<<<
106033  *                  read_network=True, write_network=True):
106034  *         self._prefs = xslt.xsltNewSecurityPrefs()
106035  */
106036
106037 static int __pyx_pf_4lxml_5etree_17XSLTAccessControl___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
106038 static int __pyx_pf_4lxml_5etree_17XSLTAccessControl___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
106039   PyObject *__pyx_v_read_file = 0;
106040   PyObject *__pyx_v_write_file = 0;
106041   PyObject *__pyx_v_create_dir = 0;
106042   PyObject *__pyx_v_read_network = 0;
106043   PyObject *__pyx_v_write_network = 0;
106044   int __pyx_r;
106045   int __pyx_t_1;
106046   PyObject *__pyx_t_2 = NULL;
106047   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_read_file,&__pyx_kp_write_file,&__pyx_kp_create_dir,&__pyx_kp_read_network,&__pyx_kp_write_network,0};
106048   __Pyx_SetupRefcountContext("__init__");
106049   if (unlikely(__pyx_kwds)) {
106050     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
106051     PyObject* values[5] = {0,0,0,0,0};
106052     values[0] = __pyx_k_193;
106053     values[1] = __pyx_k_194;
106054     values[2] = __pyx_k_195;
106055     values[3] = __pyx_k_196;
106056     values[4] = __pyx_k_197;
106057     switch (PyTuple_GET_SIZE(__pyx_args)) {
106058       case  0: break;
106059       default: goto __pyx_L5_argtuple_error;
106060     }
106061     while (kw_args > 0) {
106062       PyObject* value;
106063       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_read_file);
106064       if (value) { values[0] = value; if (!(--kw_args)) break; }
106065       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_write_file);
106066       if (value) { values[1] = value; if (!(--kw_args)) break; }
106067       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_create_dir);
106068       if (value) { values[2] = value; if (!(--kw_args)) break; }
106069       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_read_network);
106070       if (value) { values[3] = value; if (!(--kw_args)) break; }
106071       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_write_network);
106072       if (value) { values[4] = value; if (!(--kw_args)) break; }
106073       break;
106074     }
106075     if (unlikely(kw_args > 0)) {
106076       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, 0, "__init__") < 0)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
106077     }
106078     __pyx_v_read_file = values[0];
106079     __pyx_v_write_file = values[1];
106080     __pyx_v_create_dir = values[2];
106081     __pyx_v_read_network = values[3];
106082     __pyx_v_write_network = values[4];
106083   } else if (PyTuple_GET_SIZE(__pyx_args) != 0) {
106084     goto __pyx_L5_argtuple_error;
106085   } else {
106086     __pyx_v_read_file = __pyx_k_193;
106087     __pyx_v_write_file = __pyx_k_194;
106088     __pyx_v_create_dir = __pyx_k_195;
106089     __pyx_v_read_network = __pyx_k_196;
106090     __pyx_v_write_network = __pyx_k_197;
106091   }
106092   goto __pyx_L4_argument_unpacking_done;
106093   __pyx_L5_argtuple_error:;
106094   __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[18]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
106095   __pyx_L3_error:;
106096   __Pyx_AddTraceback("lxml.etree.XSLTAccessControl.__init__");
106097   return -1;
106098   __pyx_L4_argument_unpacking_done:;
106099
106100   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":191
106101  *     def __init__(self, *, read_file=True, write_file=True, create_dir=True,
106102  *                  read_network=True, write_network=True):
106103  *         self._prefs = xslt.xsltNewSecurityPrefs()             # <<<<<<<<<<<<<<
106104  *         if self._prefs is NULL:
106105  *             python.PyErr_NoMemory()
106106  */
106107   ((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_self)->_prefs = xsltNewSecurityPrefs();
106108
106109   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":192
106110  *                  read_network=True, write_network=True):
106111  *         self._prefs = xslt.xsltNewSecurityPrefs()
106112  *         if self._prefs is NULL:             # <<<<<<<<<<<<<<
106113  *             python.PyErr_NoMemory()
106114  *         self._setAccess(xslt.XSLT_SECPREF_READ_FILE, read_file)
106115  */
106116   __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_self)->_prefs == NULL);
106117   if (__pyx_t_1) {
106118
106119     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":193
106120  *         self._prefs = xslt.xsltNewSecurityPrefs()
106121  *         if self._prefs is NULL:
106122  *             python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
106123  *         self._setAccess(xslt.XSLT_SECPREF_READ_FILE, read_file)
106124  *         self._setAccess(xslt.XSLT_SECPREF_WRITE_FILE, write_file)
106125  */
106126     __pyx_t_2 = PyErr_NoMemory(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106127     __Pyx_GOTREF(__pyx_t_2);
106128     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
106129     goto __pyx_L6;
106130   }
106131   __pyx_L6:;
106132
106133   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":194
106134  *         if self._prefs is NULL:
106135  *             python.PyErr_NoMemory()
106136  *         self._setAccess(xslt.XSLT_SECPREF_READ_FILE, read_file)             # <<<<<<<<<<<<<<
106137  *         self._setAccess(xslt.XSLT_SECPREF_WRITE_FILE, write_file)
106138  *         self._setAccess(xslt.XSLT_SECPREF_CREATE_DIRECTORY, create_dir)
106139  */
106140   __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree_XSLTAccessControl *)((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_self)->__pyx_vtab)->_setAccess(((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_self), XSLT_SECPREF_READ_FILE, __pyx_v_read_file); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106141   __Pyx_GOTREF(__pyx_t_2);
106142   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
106143
106144   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":195
106145  *             python.PyErr_NoMemory()
106146  *         self._setAccess(xslt.XSLT_SECPREF_READ_FILE, read_file)
106147  *         self._setAccess(xslt.XSLT_SECPREF_WRITE_FILE, write_file)             # <<<<<<<<<<<<<<
106148  *         self._setAccess(xslt.XSLT_SECPREF_CREATE_DIRECTORY, create_dir)
106149  *         self._setAccess(xslt.XSLT_SECPREF_READ_NETWORK, read_network)
106150  */
106151   __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree_XSLTAccessControl *)((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_self)->__pyx_vtab)->_setAccess(((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_self), XSLT_SECPREF_WRITE_FILE, __pyx_v_write_file); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106152   __Pyx_GOTREF(__pyx_t_2);
106153   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
106154
106155   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":196
106156  *         self._setAccess(xslt.XSLT_SECPREF_READ_FILE, read_file)
106157  *         self._setAccess(xslt.XSLT_SECPREF_WRITE_FILE, write_file)
106158  *         self._setAccess(xslt.XSLT_SECPREF_CREATE_DIRECTORY, create_dir)             # <<<<<<<<<<<<<<
106159  *         self._setAccess(xslt.XSLT_SECPREF_READ_NETWORK, read_network)
106160  *         self._setAccess(xslt.XSLT_SECPREF_WRITE_NETWORK, write_network)
106161  */
106162   __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree_XSLTAccessControl *)((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_self)->__pyx_vtab)->_setAccess(((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_self), XSLT_SECPREF_CREATE_DIRECTORY, __pyx_v_create_dir); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106163   __Pyx_GOTREF(__pyx_t_2);
106164   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
106165
106166   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":197
106167  *         self._setAccess(xslt.XSLT_SECPREF_WRITE_FILE, write_file)
106168  *         self._setAccess(xslt.XSLT_SECPREF_CREATE_DIRECTORY, create_dir)
106169  *         self._setAccess(xslt.XSLT_SECPREF_READ_NETWORK, read_network)             # <<<<<<<<<<<<<<
106170  *         self._setAccess(xslt.XSLT_SECPREF_WRITE_NETWORK, write_network)
106171  * 
106172  */
106173   __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree_XSLTAccessControl *)((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_self)->__pyx_vtab)->_setAccess(((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_self), XSLT_SECPREF_READ_NETWORK, __pyx_v_read_network); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106174   __Pyx_GOTREF(__pyx_t_2);
106175   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
106176
106177   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":198
106178  *         self._setAccess(xslt.XSLT_SECPREF_CREATE_DIRECTORY, create_dir)
106179  *         self._setAccess(xslt.XSLT_SECPREF_READ_NETWORK, read_network)
106180  *         self._setAccess(xslt.XSLT_SECPREF_WRITE_NETWORK, write_network)             # <<<<<<<<<<<<<<
106181  * 
106182  *     DENY_ALL = XSLTAccessControl(
106183  */
106184   __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree_XSLTAccessControl *)((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_self)->__pyx_vtab)->_setAccess(((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_self), XSLT_SECPREF_WRITE_NETWORK, __pyx_v_write_network); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106185   __Pyx_GOTREF(__pyx_t_2);
106186   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
106187
106188   __pyx_r = 0;
106189   goto __pyx_L0;
106190   __pyx_L1_error:;
106191   __Pyx_XDECREF(__pyx_t_2);
106192   __Pyx_AddTraceback("lxml.etree.XSLTAccessControl.__init__");
106193   __pyx_r = -1;
106194   __pyx_L0:;
106195   __Pyx_FinishRefcountContext();
106196   return __pyx_r;
106197 }
106198
106199 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":208
106200  *         read_network=True, write_network=False)
106201  * 
106202  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
106203  *         if self._prefs is not NULL:
106204  *             xslt.xsltFreeSecurityPrefs(self._prefs)
106205  */
106206
106207 static void __pyx_pf_4lxml_5etree_17XSLTAccessControl___dealloc__(PyObject *__pyx_v_self); /*proto*/
106208 static void __pyx_pf_4lxml_5etree_17XSLTAccessControl___dealloc__(PyObject *__pyx_v_self) {
106209   int __pyx_t_1;
106210   __Pyx_SetupRefcountContext("__dealloc__");
106211
106212   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":209
106213  * 
106214  *     def __dealloc__(self):
106215  *         if self._prefs is not NULL:             # <<<<<<<<<<<<<<
106216  *             xslt.xsltFreeSecurityPrefs(self._prefs)
106217  * 
106218  */
106219   __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_self)->_prefs != NULL);
106220   if (__pyx_t_1) {
106221
106222     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":210
106223  *     def __dealloc__(self):
106224  *         if self._prefs is not NULL:
106225  *             xslt.xsltFreeSecurityPrefs(self._prefs)             # <<<<<<<<<<<<<<
106226  * 
106227  *     cdef _setAccess(self, xslt.xsltSecurityOption option, allow):
106228  */
106229     xsltFreeSecurityPrefs(((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_self)->_prefs);
106230     goto __pyx_L5;
106231   }
106232   __pyx_L5:;
106233
106234   __Pyx_FinishRefcountContext();
106235 }
106236
106237 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":212
106238  *             xslt.xsltFreeSecurityPrefs(self._prefs)
106239  * 
106240  *     cdef _setAccess(self, xslt.xsltSecurityOption option, allow):             # <<<<<<<<<<<<<<
106241  *         cdef xslt.xsltSecurityCheck function
106242  *         if allow:
106243  */
106244
106245 static  PyObject *__pyx_f_4lxml_5etree_17XSLTAccessControl__setAccess(struct __pyx_obj_4lxml_5etree_XSLTAccessControl *__pyx_v_self, xsltSecurityOption __pyx_v_option, PyObject *__pyx_v_allow) {
106246   xsltSecurityCheck __pyx_v_function;
106247   PyObject *__pyx_r = NULL;
106248   int __pyx_t_1;
106249   __Pyx_SetupRefcountContext("_setAccess");
106250
106251   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":214
106252  *     cdef _setAccess(self, xslt.xsltSecurityOption option, allow):
106253  *         cdef xslt.xsltSecurityCheck function
106254  *         if allow:             # <<<<<<<<<<<<<<
106255  *             function = xslt.xsltSecurityAllow
106256  *         else:
106257  */
106258   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_allow); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106259   if (__pyx_t_1) {
106260
106261     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":215
106262  *         cdef xslt.xsltSecurityCheck function
106263  *         if allow:
106264  *             function = xslt.xsltSecurityAllow             # <<<<<<<<<<<<<<
106265  *         else:
106266  *             function = xslt.xsltSecurityForbid
106267  */
106268     __pyx_v_function = xsltSecurityAllow;
106269     goto __pyx_L3;
106270   }
106271   /*else*/ {
106272
106273     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":217
106274  *             function = xslt.xsltSecurityAllow
106275  *         else:
106276  *             function = xslt.xsltSecurityForbid             # <<<<<<<<<<<<<<
106277  *         xslt.xsltSetSecurityPrefs(self._prefs, option, function)
106278  * 
106279  */
106280     __pyx_v_function = xsltSecurityForbid;
106281   }
106282   __pyx_L3:;
106283
106284   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":218
106285  *         else:
106286  *             function = xslt.xsltSecurityForbid
106287  *         xslt.xsltSetSecurityPrefs(self._prefs, option, function)             # <<<<<<<<<<<<<<
106288  * 
106289  *     cdef void _register_in_context(self, xslt.xsltTransformContext* ctxt):
106290  */
106291   xsltSetSecurityPrefs(__pyx_v_self->_prefs, __pyx_v_option, __pyx_v_function);
106292
106293   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
106294   goto __pyx_L0;
106295   __pyx_L1_error:;
106296   __Pyx_AddTraceback("lxml.etree.XSLTAccessControl._setAccess");
106297   __pyx_r = 0;
106298   __pyx_L0:;
106299   __Pyx_XGIVEREF(__pyx_r);
106300   __Pyx_FinishRefcountContext();
106301   return __pyx_r;
106302 }
106303
106304 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":220
106305  *         xslt.xsltSetSecurityPrefs(self._prefs, option, function)
106306  * 
106307  *     cdef void _register_in_context(self, xslt.xsltTransformContext* ctxt):             # <<<<<<<<<<<<<<
106308  *         xslt.xsltSetCtxtSecurityPrefs(self._prefs, ctxt)
106309  * 
106310  */
106311
106312 static  void __pyx_f_4lxml_5etree_17XSLTAccessControl__register_in_context(struct __pyx_obj_4lxml_5etree_XSLTAccessControl *__pyx_v_self, xsltTransformContext *__pyx_v_ctxt) {
106313   __Pyx_SetupRefcountContext("_register_in_context");
106314
106315   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":221
106316  * 
106317  *     cdef void _register_in_context(self, xslt.xsltTransformContext* ctxt):
106318  *         xslt.xsltSetCtxtSecurityPrefs(self._prefs, ctxt)             # <<<<<<<<<<<<<<
106319  * 
106320  *     property options:
106321  */
106322   xsltSetCtxtSecurityPrefs(__pyx_v_self->_prefs, __pyx_v_ctxt);
106323
106324   __Pyx_FinishRefcountContext();
106325 }
106326
106327 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":225
106328  *     property options:
106329  *         u"The access control configuration as a map of options."
106330  *         def __get__(self):             # <<<<<<<<<<<<<<
106331  *             return {
106332  *                 u'read_file': self._optval(xslt.XSLT_SECPREF_READ_FILE),
106333  */
106334
106335 static PyObject *__pyx_pf_4lxml_5etree_17XSLTAccessControl_7options___get__(PyObject *__pyx_v_self); /*proto*/
106336 static PyObject *__pyx_pf_4lxml_5etree_17XSLTAccessControl_7options___get__(PyObject *__pyx_v_self) {
106337   PyObject *__pyx_r = NULL;
106338   PyObject *__pyx_1 = 0;
106339   PyObject *__pyx_t_1 = NULL;
106340   __Pyx_SetupRefcountContext("__get__");
106341
106342   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":226
106343  *         u"The access control configuration as a map of options."
106344  *         def __get__(self):
106345  *             return {             # <<<<<<<<<<<<<<
106346  *                 u'read_file': self._optval(xslt.XSLT_SECPREF_READ_FILE),
106347  *                 u'write_file': self._optval(xslt.XSLT_SECPREF_WRITE_FILE),
106348  */
106349   __Pyx_XDECREF(__pyx_r);
106350   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106351   __Pyx_GOTREF(((PyObject *)__pyx_1));
106352
106353   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":227
106354  *         def __get__(self):
106355  *             return {
106356  *                 u'read_file': self._optval(xslt.XSLT_SECPREF_READ_FILE),             # <<<<<<<<<<<<<<
106357  *                 u'write_file': self._optval(xslt.XSLT_SECPREF_WRITE_FILE),
106358  *                 u'create_dir': self._optval(xslt.XSLT_SECPREF_CREATE_DIRECTORY),
106359  */
106360   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree_XSLTAccessControl *)((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_self)->__pyx_vtab)->_optval(((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_self), XSLT_SECPREF_READ_FILE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106361   __Pyx_GOTREF(__pyx_t_1);
106362   if (PyDict_SetItem(__pyx_1, ((PyObject *)__pyx_kp_607), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106363   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
106364
106365   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":228
106366  *             return {
106367  *                 u'read_file': self._optval(xslt.XSLT_SECPREF_READ_FILE),
106368  *                 u'write_file': self._optval(xslt.XSLT_SECPREF_WRITE_FILE),             # <<<<<<<<<<<<<<
106369  *                 u'create_dir': self._optval(xslt.XSLT_SECPREF_CREATE_DIRECTORY),
106370  *                 u'read_network': self._optval(xslt.XSLT_SECPREF_READ_NETWORK),
106371  */
106372   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree_XSLTAccessControl *)((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_self)->__pyx_vtab)->_optval(((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_self), XSLT_SECPREF_WRITE_FILE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106373   __Pyx_GOTREF(__pyx_t_1);
106374   if (PyDict_SetItem(__pyx_1, ((PyObject *)__pyx_kp_608), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106375   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
106376
106377   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":229
106378  *                 u'read_file': self._optval(xslt.XSLT_SECPREF_READ_FILE),
106379  *                 u'write_file': self._optval(xslt.XSLT_SECPREF_WRITE_FILE),
106380  *                 u'create_dir': self._optval(xslt.XSLT_SECPREF_CREATE_DIRECTORY),             # <<<<<<<<<<<<<<
106381  *                 u'read_network': self._optval(xslt.XSLT_SECPREF_READ_NETWORK),
106382  *                 u'write_network': self._optval(xslt.XSLT_SECPREF_WRITE_NETWORK),
106383  */
106384   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree_XSLTAccessControl *)((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_self)->__pyx_vtab)->_optval(((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_self), XSLT_SECPREF_CREATE_DIRECTORY); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106385   __Pyx_GOTREF(__pyx_t_1);
106386   if (PyDict_SetItem(__pyx_1, ((PyObject *)__pyx_kp_609), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106387   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
106388
106389   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":230
106390  *                 u'write_file': self._optval(xslt.XSLT_SECPREF_WRITE_FILE),
106391  *                 u'create_dir': self._optval(xslt.XSLT_SECPREF_CREATE_DIRECTORY),
106392  *                 u'read_network': self._optval(xslt.XSLT_SECPREF_READ_NETWORK),             # <<<<<<<<<<<<<<
106393  *                 u'write_network': self._optval(xslt.XSLT_SECPREF_WRITE_NETWORK),
106394  *                 }
106395  */
106396   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree_XSLTAccessControl *)((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_self)->__pyx_vtab)->_optval(((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_self), XSLT_SECPREF_READ_NETWORK); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106397   __Pyx_GOTREF(__pyx_t_1);
106398   if (PyDict_SetItem(__pyx_1, ((PyObject *)__pyx_kp_610), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106399   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
106400
106401   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":231
106402  *                 u'create_dir': self._optval(xslt.XSLT_SECPREF_CREATE_DIRECTORY),
106403  *                 u'read_network': self._optval(xslt.XSLT_SECPREF_READ_NETWORK),
106404  *                 u'write_network': self._optval(xslt.XSLT_SECPREF_WRITE_NETWORK),             # <<<<<<<<<<<<<<
106405  *                 }
106406  * 
106407  */
106408   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree_XSLTAccessControl *)((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_self)->__pyx_vtab)->_optval(((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_self), XSLT_SECPREF_WRITE_NETWORK); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106409   __Pyx_GOTREF(__pyx_t_1);
106410   if (PyDict_SetItem(__pyx_1, ((PyObject *)__pyx_kp_611), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106411   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
106412   __pyx_r = ((PyObject *)__pyx_1);
106413   __pyx_1 = 0;
106414   goto __pyx_L0;
106415
106416   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
106417   goto __pyx_L0;
106418   __pyx_L1_error:;
106419   __Pyx_XDECREF(__pyx_1);
106420   __Pyx_XDECREF(__pyx_t_1);
106421   __Pyx_AddTraceback("lxml.etree.XSLTAccessControl.options.__get__");
106422   __pyx_r = NULL;
106423   __pyx_L0:;
106424   __Pyx_XGIVEREF(__pyx_r);
106425   __Pyx_FinishRefcountContext();
106426   return __pyx_r;
106427 }
106428
106429 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":234
106430  *                 }
106431  * 
106432  *     cdef _optval(self, xslt.xsltSecurityOption option):             # <<<<<<<<<<<<<<
106433  *         cdef xslt.xsltSecurityCheck function
106434  *         function = xslt.xsltGetSecurityPrefs(self._prefs, option)
106435  */
106436
106437 static  PyObject *__pyx_f_4lxml_5etree_17XSLTAccessControl__optval(struct __pyx_obj_4lxml_5etree_XSLTAccessControl *__pyx_v_self, xsltSecurityOption __pyx_v_option) {
106438   xsltSecurityCheck __pyx_v_function;
106439   PyObject *__pyx_r = NULL;
106440   int __pyx_t_1;
106441   PyObject *__pyx_t_2 = NULL;
106442   __Pyx_SetupRefcountContext("_optval");
106443
106444   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":236
106445  *     cdef _optval(self, xslt.xsltSecurityOption option):
106446  *         cdef xslt.xsltSecurityCheck function
106447  *         function = xslt.xsltGetSecurityPrefs(self._prefs, option)             # <<<<<<<<<<<<<<
106448  *         if function is <xslt.xsltSecurityCheck>xslt.xsltSecurityAllow:
106449  *             return True
106450  */
106451   __pyx_v_function = xsltGetSecurityPrefs(__pyx_v_self->_prefs, __pyx_v_option);
106452
106453   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":237
106454  *         cdef xslt.xsltSecurityCheck function
106455  *         function = xslt.xsltGetSecurityPrefs(self._prefs, option)
106456  *         if function is <xslt.xsltSecurityCheck>xslt.xsltSecurityAllow:             # <<<<<<<<<<<<<<
106457  *             return True
106458  *         elif function is <xslt.xsltSecurityCheck>xslt.xsltSecurityForbid:
106459  */
106460   __pyx_t_1 = (__pyx_v_function == ((int (*)(xsltSecurityPrefs *, xsltTransformContext *, char *))xsltSecurityAllow));
106461   if (__pyx_t_1) {
106462
106463     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":238
106464  *         function = xslt.xsltGetSecurityPrefs(self._prefs, option)
106465  *         if function is <xslt.xsltSecurityCheck>xslt.xsltSecurityAllow:
106466  *             return True             # <<<<<<<<<<<<<<
106467  *         elif function is <xslt.xsltSecurityCheck>xslt.xsltSecurityForbid:
106468  *             return False
106469  */
106470     __Pyx_XDECREF(__pyx_r);
106471     __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106472     __Pyx_GOTREF(__pyx_t_2);
106473     __pyx_r = __pyx_t_2;
106474     __pyx_t_2 = 0;
106475     goto __pyx_L0;
106476     goto __pyx_L3;
106477   }
106478
106479   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":239
106480  *         if function is <xslt.xsltSecurityCheck>xslt.xsltSecurityAllow:
106481  *             return True
106482  *         elif function is <xslt.xsltSecurityCheck>xslt.xsltSecurityForbid:             # <<<<<<<<<<<<<<
106483  *             return False
106484  *         else:
106485  */
106486   __pyx_t_1 = (__pyx_v_function == ((int (*)(xsltSecurityPrefs *, xsltTransformContext *, char *))xsltSecurityForbid));
106487   if (__pyx_t_1) {
106488
106489     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":240
106490  *             return True
106491  *         elif function is <xslt.xsltSecurityCheck>xslt.xsltSecurityForbid:
106492  *             return False             # <<<<<<<<<<<<<<
106493  *         else:
106494  *             return None
106495  */
106496     __Pyx_XDECREF(__pyx_r);
106497     __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106498     __Pyx_GOTREF(__pyx_t_2);
106499     __pyx_r = __pyx_t_2;
106500     __pyx_t_2 = 0;
106501     goto __pyx_L0;
106502     goto __pyx_L3;
106503   }
106504   /*else*/ {
106505
106506     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":242
106507  *             return False
106508  *         else:
106509  *             return None             # <<<<<<<<<<<<<<
106510  * 
106511  *     def __repr__(self):
106512  */
106513     __Pyx_XDECREF(__pyx_r);
106514     __Pyx_INCREF(Py_None);
106515     __pyx_r = Py_None;
106516     goto __pyx_L0;
106517   }
106518   __pyx_L3:;
106519
106520   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
106521   goto __pyx_L0;
106522   __pyx_L1_error:;
106523   __Pyx_XDECREF(__pyx_t_2);
106524   __Pyx_AddTraceback("lxml.etree.XSLTAccessControl._optval");
106525   __pyx_r = 0;
106526   __pyx_L0:;
106527   __Pyx_XGIVEREF(__pyx_r);
106528   __Pyx_FinishRefcountContext();
106529   return __pyx_r;
106530 }
106531
106532 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":244
106533  *             return None
106534  * 
106535  *     def __repr__(self):             # <<<<<<<<<<<<<<
106536  *         items = self.options.items()
106537  *         items.sort()
106538  */
106539
106540 static PyObject *__pyx_pf_4lxml_5etree_17XSLTAccessControl___repr__(PyObject *__pyx_v_self); /*proto*/
106541 static PyObject *__pyx_pf_4lxml_5etree_17XSLTAccessControl___repr__(PyObject *__pyx_v_self) {
106542   PyObject *__pyx_v_items;
106543   PyObject *__pyx_v_item;
106544   PyObject *__pyx_r = NULL;
106545   PyObject *__pyx_1 = 0;
106546   PyObject *__pyx_t_1 = NULL;
106547   PyObject *__pyx_t_2 = NULL;
106548   PyObject *__pyx_t_3 = NULL;
106549   Py_ssize_t __pyx_t_4;
106550   PyObject *__pyx_t_5 = NULL;
106551   int __pyx_t_6;
106552   __Pyx_SetupRefcountContext("__repr__");
106553   __pyx_v_items = Py_None; __Pyx_INCREF(Py_None);
106554   __pyx_v_item = Py_None; __Pyx_INCREF(Py_None);
106555
106556   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":245
106557  * 
106558  *     def __repr__(self):
106559  *         items = self.options.items()             # <<<<<<<<<<<<<<
106560  *         items.sort()
106561  *         return u"%s(%s)" % (
106562  */
106563   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_options); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106564   __Pyx_GOTREF(__pyx_t_1);
106565   __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_kp_items); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106566   __Pyx_GOTREF(__pyx_t_2);
106567   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
106568   __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106569   __Pyx_GOTREF(__pyx_t_1);
106570   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
106571   __Pyx_DECREF(__pyx_v_items);
106572   __pyx_v_items = __pyx_t_1;
106573   __pyx_t_1 = 0;
106574
106575   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":246
106576  *     def __repr__(self):
106577  *         items = self.options.items()
106578  *         items.sort()             # <<<<<<<<<<<<<<
106579  *         return u"%s(%s)" % (
106580  *             funicode(python._fqtypename(self)).split(u'.')[-1],
106581  */
106582   __pyx_t_1 = PyObject_GetAttr(__pyx_v_items, __pyx_kp_sort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106583   __Pyx_GOTREF(__pyx_t_1);
106584   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106585   __Pyx_GOTREF(__pyx_t_2);
106586   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
106587   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
106588
106589   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":247
106590  *         items = self.options.items()
106591  *         items.sort()
106592  *         return u"%s(%s)" % (             # <<<<<<<<<<<<<<
106593  *             funicode(python._fqtypename(self)).split(u'.')[-1],
106594  *             u', '.join([u"%s=%r" % item for item in items]))
106595  */
106596   __Pyx_XDECREF(__pyx_r);
106597
106598   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":248
106599  *         items.sort()
106600  *         return u"%s(%s)" % (
106601  *             funicode(python._fqtypename(self)).split(u'.')[-1],             # <<<<<<<<<<<<<<
106602  *             u', '.join([u"%s=%r" % item for item in items]))
106603  * 
106604  */
106605   __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(_fqtypename(__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106606   __Pyx_GOTREF(__pyx_t_2);
106607   __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_kp_split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106608   __Pyx_GOTREF(__pyx_t_1);
106609   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
106610   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106611   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
106612   __Pyx_INCREF(((PyObject *)__pyx_kp_613));
106613   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_613));
106614   __Pyx_GIVEREF(((PyObject *)__pyx_kp_613));
106615   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106616   __Pyx_GOTREF(__pyx_t_3);
106617   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
106618   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
106619   __pyx_1 = __Pyx_GetItemInt(__pyx_t_3, -1, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106620   __Pyx_GOTREF(__pyx_1);
106621   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
106622
106623   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":249
106624  *         return u"%s(%s)" % (
106625  *             funicode(python._fqtypename(self)).split(u'.')[-1],
106626  *             u', '.join([u"%s=%r" % item for item in items]))             # <<<<<<<<<<<<<<
106627  * 
106628  * ################################################################################
106629  */
106630   __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_kp_614), __pyx_kp_join); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106631   __Pyx_GOTREF(__pyx_t_3);
106632   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106633   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
106634   if (PyList_CheckExact(__pyx_v_items) || PyTuple_CheckExact(__pyx_v_items)) {
106635     __pyx_t_4 = 0; __pyx_t_1 = __pyx_v_items; __Pyx_INCREF(__pyx_t_1);
106636   } else {
106637     __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_items); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106638     __Pyx_GOTREF(__pyx_t_1);
106639   }
106640   for (;;) {
106641     if (likely(PyList_CheckExact(__pyx_t_1))) {
106642       if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
106643       __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
106644     } else if (likely(PyTuple_CheckExact(__pyx_t_1))) {
106645       if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
106646       __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
106647     } else {
106648       __pyx_t_5 = PyIter_Next(__pyx_t_1);
106649       if (!__pyx_t_5) {
106650         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106651         break;
106652       }
106653       __Pyx_GOTREF(__pyx_t_5);
106654     }
106655     __Pyx_DECREF(__pyx_v_item);
106656     __pyx_v_item = __pyx_t_5;
106657     __pyx_t_5 = 0;
106658     __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_615), __pyx_v_item); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106659     __Pyx_GOTREF(__pyx_t_5);
106660     __pyx_t_6 = PyList_Append(__pyx_t_2, (PyObject*)__pyx_t_5); if (unlikely(__pyx_t_6)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106661     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
106662   }
106663   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
106664   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106665   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
106666   __Pyx_INCREF(((PyObject *)__pyx_t_2));
106667   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_2));
106668   __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
106669   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
106670   __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106671   __Pyx_GOTREF(__pyx_t_2);
106672   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
106673   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
106674   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106675   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
106676   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_1);
106677   __Pyx_GIVEREF(__pyx_1);
106678   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
106679   __Pyx_GIVEREF(__pyx_t_2);
106680   __pyx_1 = 0;
106681   __pyx_t_2 = 0;
106682   __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_612), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106683   __Pyx_GOTREF(__pyx_t_2);
106684   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
106685   __pyx_r = __pyx_t_2;
106686   __pyx_t_2 = 0;
106687   goto __pyx_L0;
106688
106689   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
106690   goto __pyx_L0;
106691   __pyx_L1_error:;
106692   __Pyx_XDECREF(__pyx_1);
106693   __Pyx_XDECREF(__pyx_t_1);
106694   __Pyx_XDECREF(__pyx_t_2);
106695   __Pyx_XDECREF(__pyx_t_3);
106696   __Pyx_XDECREF(__pyx_t_5);
106697   __Pyx_AddTraceback("lxml.etree.XSLTAccessControl.__repr__");
106698   __pyx_r = NULL;
106699   __pyx_L0:;
106700   __Pyx_DECREF(__pyx_v_items);
106701   __Pyx_DECREF(__pyx_v_item);
106702   __Pyx_XGIVEREF(__pyx_r);
106703   __Pyx_FinishRefcountContext();
106704   return __pyx_r;
106705 }
106706
106707 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":254
106708  * # XSLT
106709  * 
106710  * cdef int _register_xslt_function(void* ctxt, name_utf, ns_utf):             # <<<<<<<<<<<<<<
106711  *     if ns_utf is None:
106712  *         return 0
106713  */
106714
106715 static  int __pyx_f_4lxml_5etree__register_xslt_function(void *__pyx_v_ctxt, PyObject *__pyx_v_name_utf, PyObject *__pyx_v_ns_utf) {
106716   int __pyx_r;
106717   int __pyx_t_1;
106718   __Pyx_SetupRefcountContext("_register_xslt_function");
106719
106720   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":255
106721  * 
106722  * cdef int _register_xslt_function(void* ctxt, name_utf, ns_utf):
106723  *     if ns_utf is None:             # <<<<<<<<<<<<<<
106724  *         return 0
106725  *     return xslt.xsltRegisterExtFunction(
106726  */
106727   __pyx_t_1 = (__pyx_v_ns_utf == Py_None);
106728   if (__pyx_t_1) {
106729
106730     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":256
106731  * cdef int _register_xslt_function(void* ctxt, name_utf, ns_utf):
106732  *     if ns_utf is None:
106733  *         return 0             # <<<<<<<<<<<<<<
106734  *     return xslt.xsltRegisterExtFunction(
106735  *         <xslt.xsltTransformContext*>ctxt, _cstr(name_utf), _cstr(ns_utf),
106736  */
106737     __pyx_r = 0;
106738     goto __pyx_L0;
106739     goto __pyx_L3;
106740   }
106741   __pyx_L3:;
106742
106743   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":259
106744  *     return xslt.xsltRegisterExtFunction(
106745  *         <xslt.xsltTransformContext*>ctxt, _cstr(name_utf), _cstr(ns_utf),
106746  *         _xpath_function_call)             # <<<<<<<<<<<<<<
106747  * 
106748  * cdef int _unregister_xslt_function(void* ctxt, name_utf, ns_utf):
106749  */
106750   __pyx_r = xsltRegisterExtFunction(((xsltTransformContext *)__pyx_v_ctxt), PyString_AS_STRING(__pyx_v_name_utf), PyString_AS_STRING(__pyx_v_ns_utf), __pyx_f_4lxml_5etree__xpath_function_call);
106751   goto __pyx_L0;
106752
106753   __pyx_r = 0;
106754   __pyx_L0:;
106755   __Pyx_FinishRefcountContext();
106756   return __pyx_r;
106757 }
106758
106759 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":261
106760  *         _xpath_function_call)
106761  * 
106762  * cdef int _unregister_xslt_function(void* ctxt, name_utf, ns_utf):             # <<<<<<<<<<<<<<
106763  *     if ns_utf is None:
106764  *         return 0
106765  */
106766
106767 static  int __pyx_f_4lxml_5etree__unregister_xslt_function(void *__pyx_v_ctxt, PyObject *__pyx_v_name_utf, PyObject *__pyx_v_ns_utf) {
106768   int __pyx_r;
106769   int __pyx_t_1;
106770   __Pyx_SetupRefcountContext("_unregister_xslt_function");
106771
106772   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":262
106773  * 
106774  * cdef int _unregister_xslt_function(void* ctxt, name_utf, ns_utf):
106775  *     if ns_utf is None:             # <<<<<<<<<<<<<<
106776  *         return 0
106777  *     return xslt.xsltRegisterExtFunction(
106778  */
106779   __pyx_t_1 = (__pyx_v_ns_utf == Py_None);
106780   if (__pyx_t_1) {
106781
106782     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":263
106783  * cdef int _unregister_xslt_function(void* ctxt, name_utf, ns_utf):
106784  *     if ns_utf is None:
106785  *         return 0             # <<<<<<<<<<<<<<
106786  *     return xslt.xsltRegisterExtFunction(
106787  *         <xslt.xsltTransformContext*>ctxt, _cstr(name_utf), _cstr(ns_utf),
106788  */
106789     __pyx_r = 0;
106790     goto __pyx_L0;
106791     goto __pyx_L3;
106792   }
106793   __pyx_L3:;
106794
106795   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":266
106796  *     return xslt.xsltRegisterExtFunction(
106797  *         <xslt.xsltTransformContext*>ctxt, _cstr(name_utf), _cstr(ns_utf),
106798  *         NULL)             # <<<<<<<<<<<<<<
106799  * 
106800  * cdef dict EMPTY_DICT = {}
106801  */
106802   __pyx_r = xsltRegisterExtFunction(((xsltTransformContext *)__pyx_v_ctxt), PyString_AS_STRING(__pyx_v_name_utf), PyString_AS_STRING(__pyx_v_ns_utf), NULL);
106803   goto __pyx_L0;
106804
106805   __pyx_r = 0;
106806   __pyx_L0:;
106807   __Pyx_FinishRefcountContext();
106808   return __pyx_r;
106809 }
106810
106811 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":274
106812  *     cdef _ReadOnlyElementProxy _extension_element_proxy
106813  *     cdef dict _extension_elements
106814  *     def __init__(self, namespaces, extensions, enable_regexp,             # <<<<<<<<<<<<<<
106815  *                  build_smart_strings):
106816  *         self._xsltCtxt = NULL
106817  */
106818
106819 static int __pyx_pf_4lxml_5etree_12_XSLTContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
106820 static int __pyx_pf_4lxml_5etree_12_XSLTContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
106821   PyObject *__pyx_v_namespaces = 0;
106822   PyObject *__pyx_v_extensions = 0;
106823   PyObject *__pyx_v_enable_regexp = 0;
106824   PyObject *__pyx_v_build_smart_strings = 0;
106825   PyObject *__pyx_v_ns_name_tuple;
106826   PyObject *__pyx_v_extension;
106827   PyObject *__pyx_v_ns_utf;
106828   PyObject *__pyx_v_name_utf;
106829   int __pyx_r;
106830   PyObject *__pyx_1 = 0;
106831   PyObject *__pyx_2 = 0;
106832   PyObject *__pyx_3 = 0;
106833   int __pyx_t_1;
106834   int __pyx_t_2;
106835   int __pyx_t_3;
106836   Py_ssize_t __pyx_t_4;
106837   PyObject *__pyx_t_5 = NULL;
106838   PyObject *__pyx_t_6 = NULL;
106839   PyObject *__pyx_t_7 = NULL;
106840   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_namespaces,&__pyx_kp_extensions,&__pyx_kp_enable_regexp,&__pyx_kp_build_smart_strings,0};
106841   __Pyx_SetupRefcountContext("__init__");
106842   if (unlikely(__pyx_kwds)) {
106843     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
106844     PyObject* values[4] = {0,0,0,0};
106845     switch (PyTuple_GET_SIZE(__pyx_args)) {
106846       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
106847       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
106848       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
106849       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
106850       case  0: break;
106851       default: goto __pyx_L5_argtuple_error;
106852     }
106853     switch (PyTuple_GET_SIZE(__pyx_args)) {
106854       case  0:
106855       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_namespaces);
106856       if (likely(values[0])) kw_args--;
106857       else goto __pyx_L5_argtuple_error;
106858       case  1:
106859       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_extensions);
106860       if (likely(values[1])) kw_args--;
106861       else {
106862         __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); {__pyx_filename = __pyx_f[18]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
106863       }
106864       case  2:
106865       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_enable_regexp);
106866       if (likely(values[2])) kw_args--;
106867       else {
106868         __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); {__pyx_filename = __pyx_f[18]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
106869       }
106870       case  3:
106871       values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_build_smart_strings);
106872       if (likely(values[3])) kw_args--;
106873       else {
106874         __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); {__pyx_filename = __pyx_f[18]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
106875       }
106876     }
106877     if (unlikely(kw_args > 0)) {
106878       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
106879     }
106880     __pyx_v_namespaces = values[0];
106881     __pyx_v_extensions = values[1];
106882     __pyx_v_enable_regexp = values[2];
106883     __pyx_v_build_smart_strings = values[3];
106884   } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
106885     goto __pyx_L5_argtuple_error;
106886   } else {
106887     __pyx_v_namespaces = PyTuple_GET_ITEM(__pyx_args, 0);
106888     __pyx_v_extensions = PyTuple_GET_ITEM(__pyx_args, 1);
106889     __pyx_v_enable_regexp = PyTuple_GET_ITEM(__pyx_args, 2);
106890     __pyx_v_build_smart_strings = PyTuple_GET_ITEM(__pyx_args, 3);
106891   }
106892   goto __pyx_L4_argument_unpacking_done;
106893   __pyx_L5_argtuple_error:;
106894   __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[18]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
106895   __pyx_L3_error:;
106896   __Pyx_AddTraceback("lxml.etree._XSLTContext.__init__");
106897   return -1;
106898   __pyx_L4_argument_unpacking_done:;
106899   __Pyx_INCREF(__pyx_v_extensions);
106900   __pyx_v_ns_name_tuple = Py_None; __Pyx_INCREF(Py_None);
106901   __pyx_v_extension = Py_None; __Pyx_INCREF(Py_None);
106902   __pyx_v_ns_utf = Py_None; __Pyx_INCREF(Py_None);
106903   __pyx_v_name_utf = Py_None; __Pyx_INCREF(Py_None);
106904
106905   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":276
106906  *     def __init__(self, namespaces, extensions, enable_regexp,
106907  *                  build_smart_strings):
106908  *         self._xsltCtxt = NULL             # <<<<<<<<<<<<<<
106909  *         self._extension_elements = EMPTY_DICT
106910  *         if extensions is not None and extensions:
106911  */
106912   ((struct __pyx_obj_4lxml_5etree__XSLTContext *)__pyx_v_self)->_xsltCtxt = NULL;
106913
106914   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":277
106915  *                  build_smart_strings):
106916  *         self._xsltCtxt = NULL
106917  *         self._extension_elements = EMPTY_DICT             # <<<<<<<<<<<<<<
106918  *         if extensions is not None and extensions:
106919  *             for ns_name_tuple, extension in extensions.items():
106920  */
106921   __Pyx_INCREF(((PyObject *)__pyx_v_4lxml_5etree_EMPTY_DICT));
106922   __Pyx_GIVEREF(((PyObject *)__pyx_v_4lxml_5etree_EMPTY_DICT));
106923   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__XSLTContext *)__pyx_v_self)->_extension_elements);
106924   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__XSLTContext *)__pyx_v_self)->_extension_elements));
106925   ((struct __pyx_obj_4lxml_5etree__XSLTContext *)__pyx_v_self)->_extension_elements = __pyx_v_4lxml_5etree_EMPTY_DICT;
106926
106927   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":278
106928  *         self._xsltCtxt = NULL
106929  *         self._extension_elements = EMPTY_DICT
106930  *         if extensions is not None and extensions:             # <<<<<<<<<<<<<<
106931  *             for ns_name_tuple, extension in extensions.items():
106932  *                 if ns_name_tuple[0] is None:
106933  */
106934   __pyx_t_1 = (__pyx_v_extensions != Py_None);
106935   if (__pyx_t_1) {
106936     __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_extensions); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106937     __pyx_t_3 = __pyx_t_2;
106938   } else {
106939     __pyx_t_3 = __pyx_t_1;
106940   }
106941   if (__pyx_t_3) {
106942
106943     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":279
106944  *         self._extension_elements = EMPTY_DICT
106945  *         if extensions is not None and extensions:
106946  *             for ns_name_tuple, extension in extensions.items():             # <<<<<<<<<<<<<<
106947  *                 if ns_name_tuple[0] is None:
106948  *                     raise XSLTExtensionError, \
106949  */
106950     __pyx_t_5 = PyObject_GetAttr(__pyx_v_extensions, __pyx_kp_items); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106951     __Pyx_GOTREF(__pyx_t_5);
106952     __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106953     __Pyx_GOTREF(__pyx_t_6);
106954     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
106955     if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) {
106956       __pyx_t_4 = 0; __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5);
106957     } else {
106958       __pyx_t_4 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106959       __Pyx_GOTREF(__pyx_t_5);
106960     }
106961     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
106962     for (;;) {
106963       if (likely(PyList_CheckExact(__pyx_t_5))) {
106964         if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_5)) break;
106965         __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++;
106966       } else if (likely(PyTuple_CheckExact(__pyx_t_5))) {
106967         if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
106968         __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++;
106969       } else {
106970         __pyx_t_6 = PyIter_Next(__pyx_t_5);
106971         if (!__pyx_t_6) {
106972           if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106973           break;
106974         }
106975         __Pyx_GOTREF(__pyx_t_6);
106976       }
106977       if (PyTuple_CheckExact(__pyx_t_6) && likely(PyTuple_GET_SIZE(__pyx_t_6) == 2)) {
106978         PyObject* tuple = __pyx_t_6;
106979         __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
106980         __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
106981         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
106982         __Pyx_DECREF(__pyx_v_ns_name_tuple);
106983         __pyx_v_ns_name_tuple = __pyx_2;
106984         __pyx_2 = 0;
106985         __Pyx_DECREF(__pyx_v_extension);
106986         __pyx_v_extension = __pyx_3;
106987         __pyx_3 = 0;
106988       } else {
106989         __pyx_1 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106990         __Pyx_GOTREF(__pyx_1);
106991         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
106992         __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106993         __Pyx_GOTREF(__pyx_2);
106994         __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106995         __Pyx_GOTREF(__pyx_3);
106996         if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
106997         __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
106998         __Pyx_DECREF(__pyx_v_ns_name_tuple);
106999         __pyx_v_ns_name_tuple = __pyx_2;
107000         __pyx_2 = 0;
107001         __Pyx_DECREF(__pyx_v_extension);
107002         __pyx_v_extension = __pyx_3;
107003         __pyx_3 = 0;
107004       }
107005
107006       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":280
107007  *         if extensions is not None and extensions:
107008  *             for ns_name_tuple, extension in extensions.items():
107009  *                 if ns_name_tuple[0] is None:             # <<<<<<<<<<<<<<
107010  *                     raise XSLTExtensionError, \
107011  *                         u"extensions must not have empty namespaces"
107012  */
107013       __pyx_1 = __Pyx_GetItemInt(__pyx_v_ns_name_tuple, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107014       __Pyx_GOTREF(__pyx_1);
107015       __pyx_t_3 = (__pyx_1 == Py_None);
107016       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
107017       if (__pyx_t_3) {
107018
107019         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":281
107020  *             for ns_name_tuple, extension in extensions.items():
107021  *                 if ns_name_tuple[0] is None:
107022  *                     raise XSLTExtensionError, \             # <<<<<<<<<<<<<<
107023  *                         u"extensions must not have empty namespaces"
107024  *                 if isinstance(extension, XSLTExtension):
107025  */
107026         __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_XSLTExtensionError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107027         __Pyx_GOTREF(__pyx_2);
107028
107029         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":282
107030  *                 if ns_name_tuple[0] is None:
107031  *                     raise XSLTExtensionError, \
107032  *                         u"extensions must not have empty namespaces"             # <<<<<<<<<<<<<<
107033  *                 if isinstance(extension, XSLTExtension):
107034  *                     if self._extension_elements is EMPTY_DICT:
107035  */
107036         __Pyx_Raise(__pyx_2, ((PyObject *)__pyx_kp_616), 0);
107037         __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
107038         {__pyx_filename = __pyx_f[18]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107039         goto __pyx_L9;
107040       }
107041       __pyx_L9:;
107042
107043       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":283
107044  *                     raise XSLTExtensionError, \
107045  *                         u"extensions must not have empty namespaces"
107046  *                 if isinstance(extension, XSLTExtension):             # <<<<<<<<<<<<<<
107047  *                     if self._extension_elements is EMPTY_DICT:
107048  *                         self._extension_elements = {}
107049  */
107050       __pyx_t_3 = PyObject_TypeCheck(__pyx_v_extension, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree_XSLTExtension))); 
107051       if (__pyx_t_3) {
107052
107053         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":284
107054  *                         u"extensions must not have empty namespaces"
107055  *                 if isinstance(extension, XSLTExtension):
107056  *                     if self._extension_elements is EMPTY_DICT:             # <<<<<<<<<<<<<<
107057  *                         self._extension_elements = {}
107058  *                         extensions = extensions.copy()
107059  */
107060         __pyx_t_3 = (((struct __pyx_obj_4lxml_5etree__XSLTContext *)__pyx_v_self)->_extension_elements == __pyx_v_4lxml_5etree_EMPTY_DICT);
107061         if (__pyx_t_3) {
107062
107063           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":285
107064  *                 if isinstance(extension, XSLTExtension):
107065  *                     if self._extension_elements is EMPTY_DICT:
107066  *                         self._extension_elements = {}             # <<<<<<<<<<<<<<
107067  *                         extensions = extensions.copy()
107068  *                     ns_utf   = _utf8(ns_name_tuple[0])
107069  */
107070           __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107071           __Pyx_GOTREF(((PyObject *)__pyx_3));
107072           __Pyx_GIVEREF(((PyObject *)__pyx_3));
107073           __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__XSLTContext *)__pyx_v_self)->_extension_elements);
107074           __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__XSLTContext *)__pyx_v_self)->_extension_elements));
107075           ((struct __pyx_obj_4lxml_5etree__XSLTContext *)__pyx_v_self)->_extension_elements = __pyx_3;
107076           __pyx_3 = 0;
107077
107078           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":286
107079  *                     if self._extension_elements is EMPTY_DICT:
107080  *                         self._extension_elements = {}
107081  *                         extensions = extensions.copy()             # <<<<<<<<<<<<<<
107082  *                     ns_utf   = _utf8(ns_name_tuple[0])
107083  *                     name_utf = _utf8(ns_name_tuple[1])
107084  */
107085           __pyx_t_6 = PyObject_GetAttr(__pyx_v_extensions, __pyx_kp_copy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107086           __Pyx_GOTREF(__pyx_t_6);
107087           __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107088           __Pyx_GOTREF(__pyx_t_7);
107089           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
107090           __Pyx_DECREF(__pyx_v_extensions);
107091           __pyx_v_extensions = __pyx_t_7;
107092           __pyx_t_7 = 0;
107093           goto __pyx_L11;
107094         }
107095         __pyx_L11:;
107096
107097         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":287
107098  *                         self._extension_elements = {}
107099  *                         extensions = extensions.copy()
107100  *                     ns_utf   = _utf8(ns_name_tuple[0])             # <<<<<<<<<<<<<<
107101  *                     name_utf = _utf8(ns_name_tuple[1])
107102  *                     self._extension_elements[(ns_utf, name_utf)] = extension
107103  */
107104         __pyx_1 = __Pyx_GetItemInt(__pyx_v_ns_name_tuple, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107105         __Pyx_GOTREF(__pyx_1);
107106         __pyx_t_7 = __pyx_f_4lxml_5etree__utf8(__pyx_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107107         __Pyx_GOTREF(__pyx_t_7);
107108         __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
107109         __Pyx_DECREF(__pyx_v_ns_utf);
107110         __pyx_v_ns_utf = __pyx_t_7;
107111         __pyx_t_7 = 0;
107112
107113         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":288
107114  *                         extensions = extensions.copy()
107115  *                     ns_utf   = _utf8(ns_name_tuple[0])
107116  *                     name_utf = _utf8(ns_name_tuple[1])             # <<<<<<<<<<<<<<
107117  *                     self._extension_elements[(ns_utf, name_utf)] = extension
107118  *                     del extensions[ns_name_tuple]
107119  */
107120         __pyx_2 = __Pyx_GetItemInt(__pyx_v_ns_name_tuple, 1, sizeof(long), PyInt_FromLong); if (!__pyx_2) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107121         __Pyx_GOTREF(__pyx_2);
107122         __pyx_t_7 = __pyx_f_4lxml_5etree__utf8(__pyx_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107123         __Pyx_GOTREF(__pyx_t_7);
107124         __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
107125         __Pyx_DECREF(__pyx_v_name_utf);
107126         __pyx_v_name_utf = __pyx_t_7;
107127         __pyx_t_7 = 0;
107128
107129         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":289
107130  *                     ns_utf   = _utf8(ns_name_tuple[0])
107131  *                     name_utf = _utf8(ns_name_tuple[1])
107132  *                     self._extension_elements[(ns_utf, name_utf)] = extension             # <<<<<<<<<<<<<<
107133  *                     del extensions[ns_name_tuple]
107134  *         _BaseContext.__init__(self, namespaces, extensions, enable_regexp,
107135  */
107136         __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107137         __Pyx_GOTREF(((PyObject *)__pyx_t_7));
107138         __Pyx_INCREF(__pyx_v_ns_utf);
107139         PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_ns_utf);
107140         __Pyx_GIVEREF(__pyx_v_ns_utf);
107141         __Pyx_INCREF(__pyx_v_name_utf);
107142         PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_name_utf);
107143         __Pyx_GIVEREF(__pyx_v_name_utf);
107144         if (PyDict_SetItem(((PyObject *)((struct __pyx_obj_4lxml_5etree__XSLTContext *)__pyx_v_self)->_extension_elements), ((PyObject *)__pyx_t_7), __pyx_v_extension) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107145         __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
107146
107147         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":290
107148  *                     name_utf = _utf8(ns_name_tuple[1])
107149  *                     self._extension_elements[(ns_utf, name_utf)] = extension
107150  *                     del extensions[ns_name_tuple]             # <<<<<<<<<<<<<<
107151  *         _BaseContext.__init__(self, namespaces, extensions, enable_regexp,
107152  *                               build_smart_strings)
107153  */
107154         if (PyObject_DelItem(__pyx_v_extensions, __pyx_v_ns_name_tuple) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107155         goto __pyx_L10;
107156       }
107157       __pyx_L10:;
107158     }
107159     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
107160     goto __pyx_L6;
107161   }
107162   __pyx_L6:;
107163
107164   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":291
107165  *                     self._extension_elements[(ns_utf, name_utf)] = extension
107166  *                     del extensions[ns_name_tuple]
107167  *         _BaseContext.__init__(self, namespaces, extensions, enable_regexp,             # <<<<<<<<<<<<<<
107168  *                               build_smart_strings)
107169  * 
107170  */
107171   __pyx_t_5 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__BaseContext)), __pyx_kp___init__); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107172   __Pyx_GOTREF(__pyx_t_5);
107173
107174   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":292
107175  *                     del extensions[ns_name_tuple]
107176  *         _BaseContext.__init__(self, namespaces, extensions, enable_regexp,
107177  *                               build_smart_strings)             # <<<<<<<<<<<<<<
107178  * 
107179  *     cdef _BaseContext _copy(self):
107180  */
107181   __pyx_t_7 = PyTuple_New(5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107182   __Pyx_GOTREF(((PyObject *)__pyx_t_7));
107183   __Pyx_INCREF(__pyx_v_self);
107184   PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_self);
107185   __Pyx_GIVEREF(__pyx_v_self);
107186   __Pyx_INCREF(__pyx_v_namespaces);
107187   PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_namespaces);
107188   __Pyx_GIVEREF(__pyx_v_namespaces);
107189   __Pyx_INCREF(__pyx_v_extensions);
107190   PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_extensions);
107191   __Pyx_GIVEREF(__pyx_v_extensions);
107192   __Pyx_INCREF(__pyx_v_enable_regexp);
107193   PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_v_enable_regexp);
107194   __Pyx_GIVEREF(__pyx_v_enable_regexp);
107195   __Pyx_INCREF(__pyx_v_build_smart_strings);
107196   PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_v_build_smart_strings);
107197   __Pyx_GIVEREF(__pyx_v_build_smart_strings);
107198   __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107199   __Pyx_GOTREF(__pyx_t_6);
107200   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
107201   __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
107202   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
107203
107204   __pyx_r = 0;
107205   goto __pyx_L0;
107206   __pyx_L1_error:;
107207   __Pyx_XDECREF(__pyx_1);
107208   __Pyx_XDECREF(__pyx_2);
107209   __Pyx_XDECREF(__pyx_3);
107210   __Pyx_XDECREF(__pyx_t_5);
107211   __Pyx_XDECREF(__pyx_t_6);
107212   __Pyx_XDECREF(__pyx_t_7);
107213   __Pyx_AddTraceback("lxml.etree._XSLTContext.__init__");
107214   __pyx_r = -1;
107215   __pyx_L0:;
107216   __Pyx_DECREF(__pyx_v_ns_name_tuple);
107217   __Pyx_DECREF(__pyx_v_extension);
107218   __Pyx_DECREF(__pyx_v_ns_utf);
107219   __Pyx_DECREF(__pyx_v_name_utf);
107220   __Pyx_DECREF(__pyx_v_extensions);
107221   __Pyx_FinishRefcountContext();
107222   return __pyx_r;
107223 }
107224
107225 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":294
107226  *                               build_smart_strings)
107227  * 
107228  *     cdef _BaseContext _copy(self):             # <<<<<<<<<<<<<<
107229  *         cdef _XSLTContext context
107230  *         context = <_XSLTContext>_BaseContext._copy(self)
107231  */
107232
107233 static  struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_f_4lxml_5etree_12_XSLTContext__copy(struct __pyx_obj_4lxml_5etree__XSLTContext *__pyx_v_self) {
107234   struct __pyx_obj_4lxml_5etree__XSLTContext *__pyx_v_context;
107235   struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_r = NULL;
107236   PyObject *__pyx_t_1 = NULL;
107237   __Pyx_SetupRefcountContext("_copy");
107238   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__XSLTContext *)Py_None); __Pyx_INCREF(Py_None);
107239
107240   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":296
107241  *     cdef _BaseContext _copy(self):
107242  *         cdef _XSLTContext context
107243  *         context = <_XSLTContext>_BaseContext._copy(self)             # <<<<<<<<<<<<<<
107244  *         context._extension_elements = self._extension_elements
107245  *         return context
107246  */
107247   __pyx_t_1 = ((PyObject *)__pyx_vtabptr_4lxml_5etree__BaseContext->_copy(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107248   __Pyx_GOTREF(__pyx_t_1);
107249   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__XSLTContext *)__pyx_t_1)));
107250   __Pyx_DECREF(((PyObject *)__pyx_v_context));
107251   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__XSLTContext *)__pyx_t_1);
107252   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
107253
107254   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":297
107255  *         cdef _XSLTContext context
107256  *         context = <_XSLTContext>_BaseContext._copy(self)
107257  *         context._extension_elements = self._extension_elements             # <<<<<<<<<<<<<<
107258  *         return context
107259  * 
107260  */
107261   __Pyx_INCREF(((PyObject *)__pyx_v_self->_extension_elements));
107262   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_extension_elements));
107263   __Pyx_GOTREF(__pyx_v_context->_extension_elements);
107264   __Pyx_DECREF(((PyObject *)__pyx_v_context->_extension_elements));
107265   __pyx_v_context->_extension_elements = __pyx_v_self->_extension_elements;
107266
107267   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":298
107268  *         context = <_XSLTContext>_BaseContext._copy(self)
107269  *         context._extension_elements = self._extension_elements
107270  *         return context             # <<<<<<<<<<<<<<
107271  * 
107272  *     cdef register_context(self, xslt.xsltTransformContext* xsltCtxt,
107273  */
107274   __Pyx_XDECREF(((PyObject *)__pyx_r));
107275   __Pyx_INCREF(((PyObject *)__pyx_v_context));
107276   __pyx_r = ((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_context);
107277   goto __pyx_L0;
107278
107279   __pyx_r = ((struct __pyx_obj_4lxml_5etree__BaseContext *)Py_None); __Pyx_INCREF(Py_None);
107280   goto __pyx_L0;
107281   __pyx_L1_error:;
107282   __Pyx_XDECREF(__pyx_t_1);
107283   __Pyx_AddTraceback("lxml.etree._XSLTContext._copy");
107284   __pyx_r = 0;
107285   __pyx_L0:;
107286   __Pyx_DECREF((PyObject *)__pyx_v_context);
107287   __Pyx_XGIVEREF((PyObject *)__pyx_r);
107288   __Pyx_FinishRefcountContext();
107289   return __pyx_r;
107290 }
107291
107292 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":300
107293  *         return context
107294  * 
107295  *     cdef register_context(self, xslt.xsltTransformContext* xsltCtxt,             # <<<<<<<<<<<<<<
107296  *                                _Document doc):
107297  *         self._xsltCtxt = xsltCtxt
107298  */
107299
107300 static  PyObject *__pyx_f_4lxml_5etree_12_XSLTContext_register_context(struct __pyx_obj_4lxml_5etree__XSLTContext *__pyx_v_self, xsltTransformContext *__pyx_v_xsltCtxt, struct LxmlDocument *__pyx_v_doc) {
107301   PyObject *__pyx_r = NULL;
107302   PyObject *__pyx_t_1 = NULL;
107303   __Pyx_SetupRefcountContext("register_context");
107304
107305   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":302
107306  *     cdef register_context(self, xslt.xsltTransformContext* xsltCtxt,
107307  *                                _Document doc):
107308  *         self._xsltCtxt = xsltCtxt             # <<<<<<<<<<<<<<
107309  *         self._set_xpath_context(xsltCtxt.xpathCtxt)
107310  *         self._register_context(doc)
107311  */
107312   __pyx_v_self->_xsltCtxt = __pyx_v_xsltCtxt;
107313
107314   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":303
107315  *                                _Document doc):
107316  *         self._xsltCtxt = xsltCtxt
107317  *         self._set_xpath_context(xsltCtxt.xpathCtxt)             # <<<<<<<<<<<<<<
107318  *         self._register_context(doc)
107319  *         self.registerLocalFunctions(xsltCtxt, _register_xslt_function)
107320  */
107321   ((struct __pyx_vtabstruct_4lxml_5etree__XSLTContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._set_xpath_context(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self), __pyx_v_xsltCtxt->xpathCtxt);
107322
107323   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":304
107324  *         self._xsltCtxt = xsltCtxt
107325  *         self._set_xpath_context(xsltCtxt.xpathCtxt)
107326  *         self._register_context(doc)             # <<<<<<<<<<<<<<
107327  *         self.registerLocalFunctions(xsltCtxt, _register_xslt_function)
107328  *         self.registerGlobalFunctions(xsltCtxt, _register_xslt_function)
107329  */
107330   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._register_context(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self), __pyx_v_doc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107331   __Pyx_GOTREF(__pyx_t_1);
107332   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
107333
107334   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":305
107335  *         self._set_xpath_context(xsltCtxt.xpathCtxt)
107336  *         self._register_context(doc)
107337  *         self.registerLocalFunctions(xsltCtxt, _register_xslt_function)             # <<<<<<<<<<<<<<
107338  *         self.registerGlobalFunctions(xsltCtxt, _register_xslt_function)
107339  *         _registerXSLTExtensions(xsltCtxt, self._extension_elements)
107340  */
107341   ((struct __pyx_vtabstruct_4lxml_5etree__XSLTContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.registerLocalFunctions(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self), __pyx_v_xsltCtxt, __pyx_f_4lxml_5etree__register_xslt_function);
107342
107343   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":306
107344  *         self._register_context(doc)
107345  *         self.registerLocalFunctions(xsltCtxt, _register_xslt_function)
107346  *         self.registerGlobalFunctions(xsltCtxt, _register_xslt_function)             # <<<<<<<<<<<<<<
107347  *         _registerXSLTExtensions(xsltCtxt, self._extension_elements)
107348  * 
107349  */
107350   ((struct __pyx_vtabstruct_4lxml_5etree__XSLTContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.registerGlobalFunctions(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self), __pyx_v_xsltCtxt, __pyx_f_4lxml_5etree__register_xslt_function);
107351
107352   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":307
107353  *         self.registerLocalFunctions(xsltCtxt, _register_xslt_function)
107354  *         self.registerGlobalFunctions(xsltCtxt, _register_xslt_function)
107355  *         _registerXSLTExtensions(xsltCtxt, self._extension_elements)             # <<<<<<<<<<<<<<
107356  * 
107357  *     cdef free_context(self):
107358  */
107359   __pyx_t_1 = __pyx_f_4lxml_5etree__registerXSLTExtensions(__pyx_v_xsltCtxt, ((PyObject *)__pyx_v_self->_extension_elements)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107360   __Pyx_GOTREF(__pyx_t_1);
107361   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
107362
107363   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
107364   goto __pyx_L0;
107365   __pyx_L1_error:;
107366   __Pyx_XDECREF(__pyx_t_1);
107367   __Pyx_AddTraceback("lxml.etree._XSLTContext.register_context");
107368   __pyx_r = 0;
107369   __pyx_L0:;
107370   __Pyx_XGIVEREF(__pyx_r);
107371   __Pyx_FinishRefcountContext();
107372   return __pyx_r;
107373 }
107374
107375 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":309
107376  *         _registerXSLTExtensions(xsltCtxt, self._extension_elements)
107377  * 
107378  *     cdef free_context(self):             # <<<<<<<<<<<<<<
107379  *         self._cleanup_context()
107380  *         self._release_context()
107381  */
107382
107383 static  PyObject *__pyx_f_4lxml_5etree_12_XSLTContext_free_context(struct __pyx_obj_4lxml_5etree__XSLTContext *__pyx_v_self) {
107384   PyObject *__pyx_r = NULL;
107385   PyObject *__pyx_t_1 = NULL;
107386   int __pyx_t_2;
107387   __Pyx_SetupRefcountContext("free_context");
107388
107389   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":310
107390  * 
107391  *     cdef free_context(self):
107392  *         self._cleanup_context()             # <<<<<<<<<<<<<<
107393  *         self._release_context()
107394  *         if self._xsltCtxt is not NULL:
107395  */
107396   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._cleanup_context(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107397   __Pyx_GOTREF(__pyx_t_1);
107398   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
107399
107400   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":311
107401  *     cdef free_context(self):
107402  *         self._cleanup_context()
107403  *         self._release_context()             # <<<<<<<<<<<<<<
107404  *         if self._xsltCtxt is not NULL:
107405  *             xslt.xsltFreeTransformContext(self._xsltCtxt)
107406  */
107407   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._release_context(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107408   __Pyx_GOTREF(__pyx_t_1);
107409   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
107410
107411   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":312
107412  *         self._cleanup_context()
107413  *         self._release_context()
107414  *         if self._xsltCtxt is not NULL:             # <<<<<<<<<<<<<<
107415  *             xslt.xsltFreeTransformContext(self._xsltCtxt)
107416  *             self._xsltCtxt = NULL
107417  */
107418   __pyx_t_2 = (__pyx_v_self->_xsltCtxt != NULL);
107419   if (__pyx_t_2) {
107420
107421     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":313
107422  *         self._release_context()
107423  *         if self._xsltCtxt is not NULL:
107424  *             xslt.xsltFreeTransformContext(self._xsltCtxt)             # <<<<<<<<<<<<<<
107425  *             self._xsltCtxt = NULL
107426  *         self._release_temp_refs()
107427  */
107428     xsltFreeTransformContext(__pyx_v_self->_xsltCtxt);
107429
107430     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":314
107431  *         if self._xsltCtxt is not NULL:
107432  *             xslt.xsltFreeTransformContext(self._xsltCtxt)
107433  *             self._xsltCtxt = NULL             # <<<<<<<<<<<<<<
107434  *         self._release_temp_refs()
107435  * 
107436  */
107437     __pyx_v_self->_xsltCtxt = NULL;
107438     goto __pyx_L3;
107439   }
107440   __pyx_L3:;
107441
107442   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":315
107443  *             xslt.xsltFreeTransformContext(self._xsltCtxt)
107444  *             self._xsltCtxt = NULL
107445  *         self._release_temp_refs()             # <<<<<<<<<<<<<<
107446  * 
107447  * 
107448  */
107449   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._release_temp_refs(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107450   __Pyx_GOTREF(__pyx_t_1);
107451   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
107452
107453   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
107454   goto __pyx_L0;
107455   __pyx_L1_error:;
107456   __Pyx_XDECREF(__pyx_t_1);
107457   __Pyx_AddTraceback("lxml.etree._XSLTContext.free_context");
107458   __pyx_r = 0;
107459   __pyx_L0:;
107460   __Pyx_XGIVEREF(__pyx_r);
107461   __Pyx_FinishRefcountContext();
107462   return __pyx_r;
107463 }
107464
107465 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":323
107466  *     """
107467  *     cdef str strval
107468  *     def __init__(self, strval):             # <<<<<<<<<<<<<<
107469  *         self.strval = _utf8(strval)
107470  * 
107471  */
107472
107473 static int __pyx_pf_4lxml_5etree_22_XSLTQuotedStringParam___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
107474 static int __pyx_pf_4lxml_5etree_22_XSLTQuotedStringParam___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
107475   PyObject *__pyx_v_strval = 0;
107476   int __pyx_r;
107477   PyObject *__pyx_t_1 = NULL;
107478   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_strval,0};
107479   __Pyx_SetupRefcountContext("__init__");
107480   if (unlikely(__pyx_kwds)) {
107481     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
107482     PyObject* values[1] = {0};
107483     switch (PyTuple_GET_SIZE(__pyx_args)) {
107484       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
107485       case  0: break;
107486       default: goto __pyx_L5_argtuple_error;
107487     }
107488     switch (PyTuple_GET_SIZE(__pyx_args)) {
107489       case  0:
107490       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_strval);
107491       if (likely(values[0])) kw_args--;
107492       else goto __pyx_L5_argtuple_error;
107493     }
107494     if (unlikely(kw_args > 0)) {
107495       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
107496     }
107497     __pyx_v_strval = values[0];
107498   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
107499     goto __pyx_L5_argtuple_error;
107500   } else {
107501     __pyx_v_strval = PyTuple_GET_ITEM(__pyx_args, 0);
107502   }
107503   goto __pyx_L4_argument_unpacking_done;
107504   __pyx_L5_argtuple_error:;
107505   __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[18]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
107506   __pyx_L3_error:;
107507   __Pyx_AddTraceback("lxml.etree._XSLTQuotedStringParam.__init__");
107508   return -1;
107509   __pyx_L4_argument_unpacking_done:;
107510
107511   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":324
107512  *     cdef str strval
107513  *     def __init__(self, strval):
107514  *         self.strval = _utf8(strval)             # <<<<<<<<<<<<<<
107515  * 
107516  * 
107517  */
107518   __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_strval); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107519   __Pyx_GOTREF(__pyx_t_1);
107520   if (!(likely(PyString_CheckExact(__pyx_t_1)) || (__pyx_t_1) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected str, got %s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107521   __Pyx_GIVEREF(__pyx_t_1);
107522   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__XSLTQuotedStringParam *)__pyx_v_self)->strval);
107523   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__XSLTQuotedStringParam *)__pyx_v_self)->strval));
107524   ((struct __pyx_obj_4lxml_5etree__XSLTQuotedStringParam *)__pyx_v_self)->strval = ((PyObject *)__pyx_t_1);
107525   __pyx_t_1 = 0;
107526
107527   __pyx_r = 0;
107528   goto __pyx_L0;
107529   __pyx_L1_error:;
107530   __Pyx_XDECREF(__pyx_t_1);
107531   __Pyx_AddTraceback("lxml.etree._XSLTQuotedStringParam.__init__");
107532   __pyx_r = -1;
107533   __pyx_L0:;
107534   __Pyx_FinishRefcountContext();
107535   return __pyx_r;
107536 }
107537
107538 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":359
107539  *     cdef _ErrorLog _error_log
107540  * 
107541  *     def __init__(self, xslt_input, *, extensions=None, regexp=True,             # <<<<<<<<<<<<<<
107542  *                  access_control=None):
107543  *         cdef xslt.xsltStylesheet* c_style
107544  */
107545
107546 static int __pyx_pf_4lxml_5etree_4XSLT___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
107547 static int __pyx_pf_4lxml_5etree_4XSLT___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
107548   PyObject *__pyx_v_xslt_input = 0;
107549   PyObject *__pyx_v_extensions = 0;
107550   PyObject *__pyx_v_regexp = 0;
107551   PyObject *__pyx_v_access_control = 0;
107552   xsltStylesheet *__pyx_v_c_style;
107553   xmlDoc *__pyx_v_c_doc;
107554   struct LxmlDocument *__pyx_v_doc;
107555   struct LxmlElement *__pyx_v_root_node;
107556   PyObject *__pyx_v_doc_url_utf;
107557   int __pyx_r;
107558   PyObject *__pyx_1 = 0;
107559   PyObject *__pyx_t_1 = NULL;
107560   xmlDoc *__pyx_t_2;
107561   int __pyx_t_3;
107562   PyObject *__pyx_t_4 = NULL;
107563   xmlDoc *__pyx_t_5;
107564   int __pyx_t_6;
107565   int __pyx_t_7;
107566   int __pyx_t_8;
107567   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_xslt_input,&__pyx_kp_extensions,&__pyx_kp_regexp,&__pyx_kp_access_control,0};
107568   __Pyx_SetupRefcountContext("__init__");
107569   if (unlikely(__pyx_kwds)) {
107570     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
107571     PyObject* values[4] = {0,0,0,0};
107572     values[1] = Py_None;
107573     values[2] = __pyx_k_198;
107574     values[3] = Py_None;
107575     switch (PyTuple_GET_SIZE(__pyx_args)) {
107576       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
107577       case  0: break;
107578       default: goto __pyx_L5_argtuple_error;
107579     }
107580     switch (PyTuple_GET_SIZE(__pyx_args)) {
107581       case  0:
107582       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_xslt_input);
107583       if (likely(values[0])) kw_args--;
107584       else goto __pyx_L5_argtuple_error;
107585     }
107586     while (kw_args > 0) {
107587       PyObject* value;
107588       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_extensions);
107589       if (value) { values[1] = value; if (!(--kw_args)) break; }
107590       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_regexp);
107591       if (value) { values[2] = value; if (!(--kw_args)) break; }
107592       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_access_control);
107593       if (value) { values[3] = value; if (!(--kw_args)) break; }
107594       break;
107595     }
107596     if (unlikely(kw_args > 0)) {
107597       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
107598     }
107599     __pyx_v_xslt_input = values[0];
107600     __pyx_v_extensions = values[1];
107601     __pyx_v_regexp = values[2];
107602     __pyx_v_access_control = values[3];
107603   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
107604     goto __pyx_L5_argtuple_error;
107605   } else {
107606     __pyx_v_xslt_input = PyTuple_GET_ITEM(__pyx_args, 0);
107607     __pyx_v_extensions = Py_None;
107608     __pyx_v_regexp = __pyx_k_198;
107609     __pyx_v_access_control = Py_None;
107610   }
107611   goto __pyx_L4_argument_unpacking_done;
107612   __pyx_L5_argtuple_error:;
107613   __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[18]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
107614   __pyx_L3_error:;
107615   __Pyx_AddTraceback("lxml.etree.XSLT.__init__");
107616   return -1;
107617   __pyx_L4_argument_unpacking_done:;
107618   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
107619   __pyx_v_root_node = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
107620   __pyx_v_doc_url_utf = Py_None; __Pyx_INCREF(Py_None);
107621
107622   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":366
107623  *         cdef _Element root_node
107624  * 
107625  *         doc = _documentOrRaise(xslt_input)             # <<<<<<<<<<<<<<
107626  *         root_node = _rootNodeOrRaise(xslt_input)
107627  * 
107628  */
107629   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v_xslt_input)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107630   __Pyx_GOTREF(__pyx_t_1);
107631   __Pyx_DECREF(((PyObject *)__pyx_v_doc));
107632   __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_1);
107633   __pyx_t_1 = 0;
107634
107635   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":367
107636  * 
107637  *         doc = _documentOrRaise(xslt_input)
107638  *         root_node = _rootNodeOrRaise(xslt_input)             # <<<<<<<<<<<<<<
107639  * 
107640  *         # set access control or raise TypeError
107641  */
107642   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v_xslt_input)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107643   __Pyx_GOTREF(__pyx_t_1);
107644   __Pyx_DECREF(((PyObject *)__pyx_v_root_node));
107645   __pyx_v_root_node = ((struct LxmlElement *)__pyx_t_1);
107646   __pyx_t_1 = 0;
107647
107648   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":370
107649  * 
107650  *         # set access control or raise TypeError
107651  *         self._access_control = access_control             # <<<<<<<<<<<<<<
107652  * 
107653  *         # make a copy of the document as stylesheet parsing modifies it
107654  */
107655   if (!(__Pyx_TypeTest(__pyx_v_access_control, __pyx_ptype_4lxml_5etree_XSLTAccessControl))) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107656   __Pyx_INCREF(__pyx_v_access_control);
107657   __Pyx_GIVEREF(__pyx_v_access_control);
107658   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_access_control);
107659   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_access_control));
107660   ((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_access_control = ((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_access_control);
107661
107662   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":373
107663  * 
107664  *         # make a copy of the document as stylesheet parsing modifies it
107665  *         c_doc = _copyDocRoot(doc._c_doc, root_node._c_node)             # <<<<<<<<<<<<<<
107666  * 
107667  *         # make sure we always have a stylesheet URL
107668  */
107669   __pyx_t_2 = __pyx_f_4lxml_5etree__copyDocRoot(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107670   __pyx_v_c_doc = __pyx_t_2;
107671
107672   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":376
107673  * 
107674  *         # make sure we always have a stylesheet URL
107675  *         if c_doc.URL is NULL:             # <<<<<<<<<<<<<<
107676  *             doc_url_utf = python.PyUnicode_AsASCIIString(
107677  *                 u"string://__STRING__XSLT__/%d.xslt" % id(self))
107678  */
107679   __pyx_t_3 = (__pyx_v_c_doc->URL == NULL);
107680   if (__pyx_t_3) {
107681
107682     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":378
107683  *         if c_doc.URL is NULL:
107684  *             doc_url_utf = python.PyUnicode_AsASCIIString(
107685  *                 u"string://__STRING__XSLT__/%d.xslt" % id(self))             # <<<<<<<<<<<<<<
107686  *             c_doc.URL = tree.xmlStrdup(_cstr(doc_url_utf))
107687  * 
107688  */
107689     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107690     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
107691     __Pyx_INCREF(__pyx_v_self);
107692     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
107693     __Pyx_GIVEREF(__pyx_v_self);
107694     __pyx_t_4 = PyObject_Call(__pyx_builtin_id, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107695     __Pyx_GOTREF(__pyx_t_4);
107696     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
107697     __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_617), __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107698     __Pyx_GOTREF(__pyx_t_1);
107699     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
107700     __pyx_t_4 = PyUnicode_AsASCIIString(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107701     __Pyx_GOTREF(__pyx_t_4);
107702     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
107703     __Pyx_DECREF(__pyx_v_doc_url_utf);
107704     __pyx_v_doc_url_utf = __pyx_t_4;
107705     __pyx_t_4 = 0;
107706
107707     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":379
107708  *             doc_url_utf = python.PyUnicode_AsASCIIString(
107709  *                 u"string://__STRING__XSLT__/%d.xslt" % id(self))
107710  *             c_doc.URL = tree.xmlStrdup(_cstr(doc_url_utf))             # <<<<<<<<<<<<<<
107711  * 
107712  *         self._error_log = _ErrorLog()
107713  */
107714     __pyx_v_c_doc->URL = xmlStrdup(PyString_AS_STRING(__pyx_v_doc_url_utf));
107715     goto __pyx_L6;
107716   }
107717   __pyx_L6:;
107718
107719   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":381
107720  *             c_doc.URL = tree.xmlStrdup(_cstr(doc_url_utf))
107721  * 
107722  *         self._error_log = _ErrorLog()             # <<<<<<<<<<<<<<
107723  *         self._xslt_resolver_context = _XSLTResolverContext()
107724  *         _initXSLTResolverContext(self._xslt_resolver_context, doc._parser)
107725  */
107726   __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ErrorLog)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107727   __Pyx_GOTREF(__pyx_t_4);
107728   if (!(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__ErrorLog))) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107729   __Pyx_GIVEREF(__pyx_t_4);
107730   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log);
107731   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log));
107732   ((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_t_4);
107733   __pyx_t_4 = 0;
107734
107735   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":382
107736  * 
107737  *         self._error_log = _ErrorLog()
107738  *         self._xslt_resolver_context = _XSLTResolverContext()             # <<<<<<<<<<<<<<
107739  *         _initXSLTResolverContext(self._xslt_resolver_context, doc._parser)
107740  *         # keep a copy in case we need to access the stylesheet via 'document()'
107741  */
107742   __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__XSLTResolverContext)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107743   __Pyx_GOTREF(__pyx_t_4);
107744   if (!(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__XSLTResolverContext))) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107745   __Pyx_GIVEREF(__pyx_t_4);
107746   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context);
107747   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context));
107748   ((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context = ((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)__pyx_t_4);
107749   __pyx_t_4 = 0;
107750
107751   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":383
107752  *         self._error_log = _ErrorLog()
107753  *         self._xslt_resolver_context = _XSLTResolverContext()
107754  *         _initXSLTResolverContext(self._xslt_resolver_context, doc._parser)             # <<<<<<<<<<<<<<
107755  *         # keep a copy in case we need to access the stylesheet via 'document()'
107756  *         self._xslt_resolver_context._c_style_doc = _copyDoc(c_doc, 1)
107757  */
107758   __pyx_t_4 = __pyx_f_4lxml_5etree__initXSLTResolverContext(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context, __pyx_v_doc->_parser); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107759   __Pyx_GOTREF(__pyx_t_4);
107760   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
107761
107762   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":385
107763  *         _initXSLTResolverContext(self._xslt_resolver_context, doc._parser)
107764  *         # keep a copy in case we need to access the stylesheet via 'document()'
107765  *         self._xslt_resolver_context._c_style_doc = _copyDoc(c_doc, 1)             # <<<<<<<<<<<<<<
107766  *         c_doc._private = <python.PyObject*>self._xslt_resolver_context
107767  * 
107768  */
107769   __pyx_t_5 = __pyx_f_4lxml_5etree__copyDoc(__pyx_v_c_doc, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107770   ((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context->_c_style_doc = __pyx_t_5;
107771
107772   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":386
107773  *         # keep a copy in case we need to access the stylesheet via 'document()'
107774  *         self._xslt_resolver_context._c_style_doc = _copyDoc(c_doc, 1)
107775  *         c_doc._private = <python.PyObject*>self._xslt_resolver_context             # <<<<<<<<<<<<<<
107776  * 
107777  *         self._error_log.connect()
107778  */
107779   __pyx_v_c_doc->_private = ((PyObject *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context);
107780
107781   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":388
107782  *         c_doc._private = <python.PyObject*>self._xslt_resolver_context
107783  * 
107784  *         self._error_log.connect()             # <<<<<<<<<<<<<<
107785  *         with nogil:
107786  *             c_style = xslt.xsltParseStylesheetDoc(c_doc)
107787  */
107788   ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log);
107789
107790   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":389
107791  * 
107792  *         self._error_log.connect()
107793  *         with nogil:             # <<<<<<<<<<<<<<
107794  *             c_style = xslt.xsltParseStylesheetDoc(c_doc)
107795  *         self._error_log.disconnect()
107796  */
107797   { PyThreadState *_save;
107798     Py_UNBLOCK_THREADS
107799     /*try:*/ {
107800
107801       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":390
107802  *         self._error_log.connect()
107803  *         with nogil:
107804  *             c_style = xslt.xsltParseStylesheetDoc(c_doc)             # <<<<<<<<<<<<<<
107805  *         self._error_log.disconnect()
107806  * 
107807  */
107808       __pyx_v_c_style = xsltParseStylesheetDoc(__pyx_v_c_doc);
107809     }
107810     /*finally:*/ {
107811       Py_BLOCK_THREADS
107812     }
107813   }
107814
107815   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":391
107816  *         with nogil:
107817  *             c_style = xslt.xsltParseStylesheetDoc(c_doc)
107818  *         self._error_log.disconnect()             # <<<<<<<<<<<<<<
107819  * 
107820  *         if c_style is NULL:
107821  */
107822   ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log);
107823
107824   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":393
107825  *         self._error_log.disconnect()
107826  * 
107827  *         if c_style is NULL:             # <<<<<<<<<<<<<<
107828  *             tree.xmlFreeDoc(c_doc)
107829  *             self._xslt_resolver_context._raise_if_stored()
107830  */
107831   __pyx_t_3 = (__pyx_v_c_style == NULL);
107832   if (__pyx_t_3) {
107833
107834     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":394
107835  * 
107836  *         if c_style is NULL:
107837  *             tree.xmlFreeDoc(c_doc)             # <<<<<<<<<<<<<<
107838  *             self._xslt_resolver_context._raise_if_stored()
107839  *             # last error seems to be the most accurate here
107840  */
107841     xmlFreeDoc(__pyx_v_c_doc);
107842
107843     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":395
107844  *         if c_style is NULL:
107845  *             tree.xmlFreeDoc(c_doc)
107846  *             self._xslt_resolver_context._raise_if_stored()             # <<<<<<<<<<<<<<
107847  *             # last error seems to be the most accurate here
107848  *             if self._error_log.last_error is not None and \
107849  */
107850     __pyx_t_6 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._raise_if_stored(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107851
107852     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":397
107853  *             self._xslt_resolver_context._raise_if_stored()
107854  *             # last error seems to be the most accurate here
107855  *             if self._error_log.last_error is not None and \             # <<<<<<<<<<<<<<
107856  *                     self._error_log.last_error.message:
107857  *                 raise XSLTParseError(self._error_log.last_error.message,
107858  */
107859     __pyx_t_3 = (((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log->__pyx_base.__pyx_base.last_error != Py_None);
107860     if (__pyx_t_3) {
107861
107862       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":398
107863  *             # last error seems to be the most accurate here
107864  *             if self._error_log.last_error is not None and \
107865  *                     self._error_log.last_error.message:             # <<<<<<<<<<<<<<
107866  *                 raise XSLTParseError(self._error_log.last_error.message,
107867  *                                      self._error_log)
107868  */
107869       __pyx_t_4 = PyObject_GetAttr(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log->__pyx_base.__pyx_base.last_error, __pyx_kp_message); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107870       __Pyx_GOTREF(__pyx_t_4);
107871       __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107872       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
107873       __pyx_t_8 = __pyx_t_7;
107874     } else {
107875       __pyx_t_8 = __pyx_t_3;
107876     }
107877     if (__pyx_t_8) {
107878
107879       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":399
107880  *             if self._error_log.last_error is not None and \
107881  *                     self._error_log.last_error.message:
107882  *                 raise XSLTParseError(self._error_log.last_error.message,             # <<<<<<<<<<<<<<
107883  *                                      self._error_log)
107884  *             else:
107885  */
107886       __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XSLTParseError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107887       __Pyx_GOTREF(__pyx_1);
107888       __pyx_t_4 = PyObject_GetAttr(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log->__pyx_base.__pyx_base.last_error, __pyx_kp_message); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107889       __Pyx_GOTREF(__pyx_t_4);
107890
107891       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":400
107892  *                     self._error_log.last_error.message:
107893  *                 raise XSLTParseError(self._error_log.last_error.message,
107894  *                                      self._error_log)             # <<<<<<<<<<<<<<
107895  *             else:
107896  *                 raise XSLTParseError(
107897  */
107898       __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107899       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
107900       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
107901       __Pyx_GIVEREF(__pyx_t_4);
107902       __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log));
107903       PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log));
107904       __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log));
107905       __pyx_t_4 = 0;
107906       __pyx_t_4 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107907       __Pyx_GOTREF(__pyx_t_4);
107908       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
107909       __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
107910       __Pyx_Raise(__pyx_t_4, 0, 0);
107911       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
107912       {__pyx_filename = __pyx_f[18]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107913       goto __pyx_L11;
107914     }
107915     /*else*/ {
107916
107917       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":402
107918  *                                      self._error_log)
107919  *             else:
107920  *                 raise XSLTParseError(             # <<<<<<<<<<<<<<
107921  *                     self._error_log._buildExceptionMessage(
107922  *                         u"Cannot parse stylesheet"),
107923  */
107924       __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XSLTParseError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107925       __Pyx_GOTREF(__pyx_1);
107926
107927       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":404
107928  *                 raise XSLTParseError(
107929  *                     self._error_log._buildExceptionMessage(
107930  *                         u"Cannot parse stylesheet"),             # <<<<<<<<<<<<<<
107931  *                     self._error_log)
107932  * 
107933  */
107934       __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._buildExceptionMessage(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log), ((PyObject *)__pyx_kp_618)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107935       __Pyx_GOTREF(__pyx_t_4);
107936
107937       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":405
107938  *                     self._error_log._buildExceptionMessage(
107939  *                         u"Cannot parse stylesheet"),
107940  *                     self._error_log)             # <<<<<<<<<<<<<<
107941  * 
107942  *         c_doc._private = NULL # no longer used!
107943  */
107944       __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107945       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
107946       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
107947       __Pyx_GIVEREF(__pyx_t_4);
107948       __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log));
107949       PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log));
107950       __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log));
107951       __pyx_t_4 = 0;
107952       __pyx_t_4 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107953       __Pyx_GOTREF(__pyx_t_4);
107954       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
107955       __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
107956       __Pyx_Raise(__pyx_t_4, 0, 0);
107957       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
107958       {__pyx_filename = __pyx_f[18]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107959     }
107960     __pyx_L11:;
107961     goto __pyx_L10;
107962   }
107963   __pyx_L10:;
107964
107965   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":407
107966  *                     self._error_log)
107967  * 
107968  *         c_doc._private = NULL # no longer used!             # <<<<<<<<<<<<<<
107969  *         self._c_style = c_style
107970  *         self._context = _XSLTContext(None, extensions, regexp, True)
107971  */
107972   __pyx_v_c_doc->_private = NULL;
107973
107974   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":408
107975  * 
107976  *         c_doc._private = NULL # no longer used!
107977  *         self._c_style = c_style             # <<<<<<<<<<<<<<
107978  *         self._context = _XSLTContext(None, extensions, regexp, True)
107979  * 
107980  */
107981   ((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_c_style = __pyx_v_c_style;
107982
107983   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":409
107984  *         c_doc._private = NULL # no longer used!
107985  *         self._c_style = c_style
107986  *         self._context = _XSLTContext(None, extensions, regexp, True)             # <<<<<<<<<<<<<<
107987  * 
107988  *     def __dealloc__(self):
107989  */
107990   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107991   __Pyx_GOTREF(__pyx_t_4);
107992   __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
107993   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
107994   __Pyx_INCREF(Py_None);
107995   PyTuple_SET_ITEM(__pyx_t_1, 0, Py_None);
107996   __Pyx_GIVEREF(Py_None);
107997   __Pyx_INCREF(__pyx_v_extensions);
107998   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_extensions);
107999   __Pyx_GIVEREF(__pyx_v_extensions);
108000   __Pyx_INCREF(__pyx_v_regexp);
108001   PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_regexp);
108002   __Pyx_GIVEREF(__pyx_v_regexp);
108003   PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
108004   __Pyx_GIVEREF(__pyx_t_4);
108005   __pyx_t_4 = 0;
108006   __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__XSLTContext)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
108007   __Pyx_GOTREF(__pyx_t_4);
108008   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
108009   if (!(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__XSLTContext))) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
108010   __Pyx_GIVEREF(__pyx_t_4);
108011   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_context);
108012   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_context));
108013   ((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_context = ((struct __pyx_obj_4lxml_5etree__XSLTContext *)__pyx_t_4);
108014   __pyx_t_4 = 0;
108015
108016   __pyx_r = 0;
108017   goto __pyx_L0;
108018   __pyx_L1_error:;
108019   __Pyx_XDECREF(__pyx_1);
108020   __Pyx_XDECREF(__pyx_t_1);
108021   __Pyx_XDECREF(__pyx_t_4);
108022   __Pyx_AddTraceback("lxml.etree.XSLT.__init__");
108023   __pyx_r = -1;
108024   __pyx_L0:;
108025   __Pyx_DECREF((PyObject *)__pyx_v_doc);
108026   __Pyx_DECREF((PyObject *)__pyx_v_root_node);
108027   __Pyx_DECREF(__pyx_v_doc_url_utf);
108028   __Pyx_FinishRefcountContext();
108029   return __pyx_r;
108030 }
108031
108032 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":411
108033  *         self._context = _XSLTContext(None, extensions, regexp, True)
108034  * 
108035  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
108036  *         if self._xslt_resolver_context is not None and \
108037  *                self._xslt_resolver_context._c_style_doc is not NULL:
108038  */
108039
108040 static void __pyx_pf_4lxml_5etree_4XSLT___dealloc__(PyObject *__pyx_v_self); /*proto*/
108041 static void __pyx_pf_4lxml_5etree_4XSLT___dealloc__(PyObject *__pyx_v_self) {
108042   int __pyx_t_1;
108043   int __pyx_t_2;
108044   __Pyx_SetupRefcountContext("__dealloc__");
108045
108046   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":412
108047  * 
108048  *     def __dealloc__(self):
108049  *         if self._xslt_resolver_context is not None and \             # <<<<<<<<<<<<<<
108050  *                self._xslt_resolver_context._c_style_doc is not NULL:
108051  *             tree.xmlFreeDoc(self._xslt_resolver_context._c_style_doc)
108052  */
108053   __pyx_t_1 = (((PyObject *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context) != Py_None);
108054   if (__pyx_t_1) {
108055
108056     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":413
108057  *     def __dealloc__(self):
108058  *         if self._xslt_resolver_context is not None and \
108059  *                self._xslt_resolver_context._c_style_doc is not NULL:             # <<<<<<<<<<<<<<
108060  *             tree.xmlFreeDoc(self._xslt_resolver_context._c_style_doc)
108061  *         # this cleans up the doc copy as well
108062  */
108063     __pyx_t_2 = (((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context->_c_style_doc != NULL);
108064   } else {
108065     __pyx_t_2 = __pyx_t_1;
108066   }
108067   if (__pyx_t_2) {
108068
108069     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":414
108070  *         if self._xslt_resolver_context is not None and \
108071  *                self._xslt_resolver_context._c_style_doc is not NULL:
108072  *             tree.xmlFreeDoc(self._xslt_resolver_context._c_style_doc)             # <<<<<<<<<<<<<<
108073  *         # this cleans up the doc copy as well
108074  *         xslt.xsltFreeStylesheet(self._c_style)
108075  */
108076     xmlFreeDoc(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context->_c_style_doc);
108077     goto __pyx_L5;
108078   }
108079   __pyx_L5:;
108080
108081   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":416
108082  *             tree.xmlFreeDoc(self._xslt_resolver_context._c_style_doc)
108083  *         # this cleans up the doc copy as well
108084  *         xslt.xsltFreeStylesheet(self._c_style)             # <<<<<<<<<<<<<<
108085  * 
108086  *     property error_log:
108087  */
108088   xsltFreeStylesheet(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_c_style);
108089
108090   __Pyx_FinishRefcountContext();
108091 }
108092
108093 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":420
108094  *     property error_log:
108095  *         u"The log of errors and warnings of an XSLT execution."
108096  *         def __get__(self):             # <<<<<<<<<<<<<<
108097  *             return self._error_log.copy()
108098  * 
108099  */
108100
108101 static PyObject *__pyx_pf_4lxml_5etree_4XSLT_9error_log___get__(PyObject *__pyx_v_self); /*proto*/
108102 static PyObject *__pyx_pf_4lxml_5etree_4XSLT_9error_log___get__(PyObject *__pyx_v_self) {
108103   PyObject *__pyx_r = NULL;
108104   PyObject *__pyx_t_1 = NULL;
108105   PyObject *__pyx_t_2 = NULL;
108106   __Pyx_SetupRefcountContext("__get__");
108107
108108   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":421
108109  *         u"The log of errors and warnings of an XSLT execution."
108110  *         def __get__(self):
108111  *             return self._error_log.copy()             # <<<<<<<<<<<<<<
108112  * 
108113  *     @classmethod
108114  */
108115   __Pyx_XDECREF(__pyx_r);
108116   __pyx_t_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log), __pyx_kp_copy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
108117   __Pyx_GOTREF(__pyx_t_1);
108118   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
108119   __Pyx_GOTREF(__pyx_t_2);
108120   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
108121   __pyx_r = __pyx_t_2;
108122   __pyx_t_2 = 0;
108123   goto __pyx_L0;
108124
108125   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
108126   goto __pyx_L0;
108127   __pyx_L1_error:;
108128   __Pyx_XDECREF(__pyx_t_1);
108129   __Pyx_XDECREF(__pyx_t_2);
108130   __Pyx_AddTraceback("lxml.etree.XSLT.error_log.__get__");
108131   __pyx_r = NULL;
108132   __pyx_L0:;
108133   __Pyx_XGIVEREF(__pyx_r);
108134   __Pyx_FinishRefcountContext();
108135   return __pyx_r;
108136 }
108137
108138 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":424
108139  * 
108140  *     @classmethod
108141  *     def strparam(_, strval):             # <<<<<<<<<<<<<<
108142  *         u"""strparam(strval)
108143  * 
108144  */
108145
108146 static PyObject *__pyx_pf_4lxml_5etree_4XSLT_strparam(PyObject *__pyx_v__, PyObject *__pyx_v_strval); /*proto*/
108147 static char __pyx_doc_4lxml_5etree_4XSLT_strparam[] = "strparam(strval)\n\n        Mark an XSLT string parameter that requires quote escaping\n        before passing it into the transformation.  Use it like this::\n\n            result = transform(doc, some_strval = XSLT.strparam(\n                '''it's \"Monty Python's\" ...'''))\n\n        Escaped string parameters can be reused without restriction.\n        ";
108148 static PyObject *__pyx_pf_4lxml_5etree_4XSLT_strparam(PyObject *__pyx_v__, PyObject *__pyx_v_strval) {
108149   PyObject *__pyx_r = NULL;
108150   PyObject *__pyx_t_1 = NULL;
108151   PyObject *__pyx_t_2 = NULL;
108152   __Pyx_SetupRefcountContext("strparam");
108153
108154   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":435
108155  *         Escaped string parameters can be reused without restriction.
108156  *         """
108157  *         return _XSLTQuotedStringParam(strval)             # <<<<<<<<<<<<<<
108158  * 
108159  *     def apply(self, _input, *, profile_run=False, **kw):
108160  */
108161   __Pyx_XDECREF(__pyx_r);
108162   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
108163   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
108164   __Pyx_INCREF(__pyx_v_strval);
108165   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_strval);
108166   __Pyx_GIVEREF(__pyx_v_strval);
108167   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__XSLTQuotedStringParam)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
108168   __Pyx_GOTREF(__pyx_t_2);
108169   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
108170   __pyx_r = __pyx_t_2;
108171   __pyx_t_2 = 0;
108172   goto __pyx_L0;
108173
108174   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
108175   goto __pyx_L0;
108176   __pyx_L1_error:;
108177   __Pyx_XDECREF(__pyx_t_1);
108178   __Pyx_XDECREF(__pyx_t_2);
108179   __Pyx_AddTraceback("lxml.etree.XSLT.strparam");
108180   __pyx_r = NULL;
108181   __pyx_L0:;
108182   __Pyx_XGIVEREF(__pyx_r);
108183   __Pyx_FinishRefcountContext();
108184   return __pyx_r;
108185 }
108186
108187 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":437
108188  *         return _XSLTQuotedStringParam(strval)
108189  * 
108190  *     def apply(self, _input, *, profile_run=False, **kw):             # <<<<<<<<<<<<<<
108191  *         u"""apply(self, _input,  profile_run=False, **kw)
108192  * 
108193  */
108194
108195 static PyObject *__pyx_pf_4lxml_5etree_4XSLT_apply(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
108196 static char __pyx_doc_4lxml_5etree_4XSLT_apply[] = "apply(self, _input,  profile_run=False, **kw)\n        \n        :deprecated: call the object, not this method.";
108197 static PyObject *__pyx_pf_4lxml_5etree_4XSLT_apply(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
108198   PyObject *__pyx_v__input = 0;
108199   PyObject *__pyx_v_profile_run = 0;
108200   PyObject *__pyx_v_kw = 0;
108201   PyObject *__pyx_r = NULL;
108202   PyObject *__pyx_1 = 0;
108203   PyObject *__pyx_t_1 = NULL;
108204   PyObject *__pyx_t_2 = NULL;
108205   static PyObject **__pyx_pyargnames[] = {&__pyx_kp__input,&__pyx_kp_profile_run,0};
108206   __Pyx_SetupRefcountContext("apply");
108207   __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
108208   __Pyx_GOTREF(__pyx_v_kw);
108209   if (unlikely(__pyx_kwds)) {
108210     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
108211     PyObject* values[2] = {0,0};
108212     values[1] = __pyx_k_199;
108213     switch (PyTuple_GET_SIZE(__pyx_args)) {
108214       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
108215       case  0: break;
108216       default: goto __pyx_L5_argtuple_error;
108217     }
108218     switch (PyTuple_GET_SIZE(__pyx_args)) {
108219       case  0:
108220       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp__input);
108221       if (likely(values[0])) kw_args--;
108222       else goto __pyx_L5_argtuple_error;
108223     }
108224     if (unlikely(kw_args > 0)) {
108225       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, PyTuple_GET_SIZE(__pyx_args), "apply") < 0)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
108226     }
108227     __pyx_v__input = values[0];
108228     __pyx_v_profile_run = values[1];
108229   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
108230     goto __pyx_L5_argtuple_error;
108231   } else {
108232     __pyx_v__input = PyTuple_GET_ITEM(__pyx_args, 0);
108233     __pyx_v_profile_run = __pyx_k_199;
108234   }
108235   goto __pyx_L4_argument_unpacking_done;
108236   __pyx_L5_argtuple_error:;
108237   __Pyx_RaiseArgtupleInvalid("apply", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[18]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
108238   __pyx_L3_error:;
108239   __Pyx_DECREF(__pyx_v_kw);
108240   __Pyx_AddTraceback("lxml.etree.XSLT.apply");
108241   return NULL;
108242   __pyx_L4_argument_unpacking_done:;
108243
108244   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":441
108245  * 
108246  *         :deprecated: call the object, not this method."""
108247  *         return self(_input, profile_run=profile_run, **kw)             # <<<<<<<<<<<<<<
108248  * 
108249  *     def tostring(self, _ElementTree result_tree):
108250  */
108251   __Pyx_XDECREF(__pyx_r);
108252   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
108253   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
108254   __Pyx_INCREF(__pyx_v__input);
108255   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__input);
108256   __Pyx_GIVEREF(__pyx_v__input);
108257   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
108258   __Pyx_GOTREF(((PyObject *)__pyx_1));
108259   if (PyDict_SetItem(__pyx_1, __pyx_kp_profile_run, __pyx_v_profile_run) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
108260   if (PyDict_Update(((PyObject *)__pyx_1), __pyx_v_kw) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
108261   __pyx_t_2 = PyEval_CallObjectWithKeywords(__pyx_v_self, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
108262   __Pyx_GOTREF(__pyx_t_2);
108263   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
108264   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
108265   __pyx_r = __pyx_t_2;
108266   __pyx_t_2 = 0;
108267   goto __pyx_L0;
108268
108269   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
108270   goto __pyx_L0;
108271   __pyx_L1_error:;
108272   __Pyx_XDECREF(__pyx_1);
108273   __Pyx_XDECREF(__pyx_t_1);
108274   __Pyx_XDECREF(__pyx_t_2);
108275   __Pyx_AddTraceback("lxml.etree.XSLT.apply");
108276   __pyx_r = NULL;
108277   __pyx_L0:;
108278   __Pyx_DECREF(__pyx_v_kw);
108279   __Pyx_XGIVEREF(__pyx_r);
108280   __Pyx_FinishRefcountContext();
108281   return __pyx_r;
108282 }
108283
108284 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":443
108285  *         return self(_input, profile_run=profile_run, **kw)
108286  * 
108287  *     def tostring(self, _ElementTree result_tree):             # <<<<<<<<<<<<<<
108288  *         u"""tostring(self, result_tree)
108289  * 
108290  */
108291
108292 static PyObject *__pyx_pf_4lxml_5etree_4XSLT_tostring(PyObject *__pyx_v_self, PyObject *__pyx_v_result_tree); /*proto*/
108293 static char __pyx_doc_4lxml_5etree_4XSLT_tostring[] = "tostring(self, result_tree)\n\n        Save result doc to string based on stylesheet output method.\n\n        :deprecated: use str(result_tree) instead.\n        ";
108294 static PyObject *__pyx_pf_4lxml_5etree_4XSLT_tostring(PyObject *__pyx_v_self, PyObject *__pyx_v_result_tree) {
108295   PyObject *__pyx_r = NULL;
108296   PyObject *__pyx_t_1 = NULL;
108297   PyObject *__pyx_t_2 = NULL;
108298   __Pyx_SetupRefcountContext("tostring");
108299   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result_tree), __pyx_ptype_4lxml_5etree__ElementTree, 1, "result_tree", 0))) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
108300
108301   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":450
108302  *         :deprecated: use str(result_tree) instead.
108303  *         """
108304  *         return str(result_tree)             # <<<<<<<<<<<<<<
108305  * 
108306  *     def __deepcopy__(self, memo):
108307  */
108308   __Pyx_XDECREF(__pyx_r);
108309   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
108310   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
108311   __Pyx_INCREF(__pyx_v_result_tree);
108312   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_result_tree);
108313   __Pyx_GIVEREF(__pyx_v_result_tree);
108314   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
108315   __Pyx_GOTREF(__pyx_t_2);
108316   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
108317   __pyx_r = __pyx_t_2;
108318   __pyx_t_2 = 0;
108319   goto __pyx_L0;
108320
108321   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
108322   goto __pyx_L0;
108323   __pyx_L1_error:;
108324   __Pyx_XDECREF(__pyx_t_1);
108325   __Pyx_XDECREF(__pyx_t_2);
108326   __Pyx_AddTraceback("lxml.etree.XSLT.tostring");
108327   __pyx_r = NULL;
108328   __pyx_L0:;
108329   __Pyx_XGIVEREF(__pyx_r);
108330   __Pyx_FinishRefcountContext();
108331   return __pyx_r;
108332 }
108333
108334 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":452
108335  *         return str(result_tree)
108336  * 
108337  *     def __deepcopy__(self, memo):             # <<<<<<<<<<<<<<
108338  *         return self.__copy__()
108339  * 
108340  */
108341
108342 static PyObject *__pyx_pf_4lxml_5etree_4XSLT___deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo); /*proto*/
108343 static PyObject *__pyx_pf_4lxml_5etree_4XSLT___deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo) {
108344   PyObject *__pyx_r = NULL;
108345   PyObject *__pyx_t_1 = NULL;
108346   PyObject *__pyx_t_2 = NULL;
108347   __Pyx_SetupRefcountContext("__deepcopy__");
108348
108349   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":453
108350  * 
108351  *     def __deepcopy__(self, memo):
108352  *         return self.__copy__()             # <<<<<<<<<<<<<<
108353  * 
108354  *     def __copy__(self):
108355  */
108356   __Pyx_XDECREF(__pyx_r);
108357   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp___copy__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
108358   __Pyx_GOTREF(__pyx_t_1);
108359   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
108360   __Pyx_GOTREF(__pyx_t_2);
108361   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
108362   __pyx_r = __pyx_t_2;
108363   __pyx_t_2 = 0;
108364   goto __pyx_L0;
108365
108366   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
108367   goto __pyx_L0;
108368   __pyx_L1_error:;
108369   __Pyx_XDECREF(__pyx_t_1);
108370   __Pyx_XDECREF(__pyx_t_2);
108371   __Pyx_AddTraceback("lxml.etree.XSLT.__deepcopy__");
108372   __pyx_r = NULL;
108373   __pyx_L0:;
108374   __Pyx_XGIVEREF(__pyx_r);
108375   __Pyx_FinishRefcountContext();
108376   return __pyx_r;
108377 }
108378
108379 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":455
108380  *         return self.__copy__()
108381  * 
108382  *     def __copy__(self):             # <<<<<<<<<<<<<<
108383  *         return _copyXSLT(self)
108384  * 
108385  */
108386
108387 static PyObject *__pyx_pf_4lxml_5etree_4XSLT___copy__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
108388 static PyObject *__pyx_pf_4lxml_5etree_4XSLT___copy__(PyObject *__pyx_v_self, PyObject *unused) {
108389   PyObject *__pyx_r = NULL;
108390   PyObject *__pyx_t_1 = NULL;
108391   __Pyx_SetupRefcountContext("__copy__");
108392
108393   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":456
108394  * 
108395  *     def __copy__(self):
108396  *         return _copyXSLT(self)             # <<<<<<<<<<<<<<
108397  * 
108398  *     def __call__(self, _input, *, profile_run=False, **kw):
108399  */
108400   __Pyx_XDECREF(__pyx_r);
108401   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__copyXSLT(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
108402   __Pyx_GOTREF(__pyx_t_1);
108403   __pyx_r = __pyx_t_1;
108404   __pyx_t_1 = 0;
108405   goto __pyx_L0;
108406
108407   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
108408   goto __pyx_L0;
108409   __pyx_L1_error:;
108410   __Pyx_XDECREF(__pyx_t_1);
108411   __Pyx_AddTraceback("lxml.etree.XSLT.__copy__");
108412   __pyx_r = NULL;
108413   __pyx_L0:;
108414   __Pyx_XGIVEREF(__pyx_r);
108415   __Pyx_FinishRefcountContext();
108416   return __pyx_r;
108417 }
108418
108419 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":458
108420  *         return _copyXSLT(self)
108421  * 
108422  *     def __call__(self, _input, *, profile_run=False, **kw):             # <<<<<<<<<<<<<<
108423  *         u"""__call__(self, _input, profile_run=False, **kw)
108424  * 
108425  */
108426
108427 static PyObject *__pyx_pf_4lxml_5etree_4XSLT___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
108428 static char __pyx_doc_4lxml_5etree_4XSLT___call__[] = "__call__(self, _input, profile_run=False, **kw)\n\n        Execute the XSL transformation on a tree or Element.\n\n        Pass the ``profile_run`` option to get profile information\n        about the XSLT.  The result of the XSLT will have a property\n        xslt_profile that holds an XML tree with profiling data.\n        ";
108429 static PyObject *__pyx_pf_4lxml_5etree_4XSLT___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
108430   PyObject *__pyx_v__input = 0;
108431   PyObject *__pyx_v_profile_run = 0;
108432   PyObject *__pyx_v_kw = 0;
108433   struct __pyx_obj_4lxml_5etree__XSLTContext *__pyx_v_context;
108434   struct __pyx_obj_4lxml_5etree__XSLTResolverContext *__pyx_v_resolver_context;
108435   struct LxmlDocument *__pyx_v_input_doc;
108436   struct LxmlElement *__pyx_v_root_node;
108437   struct LxmlDocument *__pyx_v_result_doc;
108438   struct LxmlDocument *__pyx_v_profile_doc;
108439   xmlDoc *__pyx_v_c_profile_doc;
108440   xsltTransformContext *__pyx_v_transform_ctxt;
108441   xmlDoc *__pyx_v_c_result;
108442   xmlDoc *__pyx_v_c_doc;
108443   xmlDict *__pyx_v_c_dict;
108444   PyObject *__pyx_v_error;
108445   PyObject *__pyx_v_message;
108446   PyObject *__pyx_r = NULL;
108447   PyObject *__pyx_1 = 0;
108448   PyObject *__pyx_t_1 = NULL;
108449   xmlDoc *__pyx_t_2;
108450   int __pyx_t_3;
108451   int __pyx_t_4;
108452   int __pyx_t_5;
108453   int __pyx_t_6;
108454   PyObject *__pyx_t_7 = NULL;
108455   PyObject *__pyx_t_8 = NULL;
108456   static PyObject **__pyx_pyargnames[] = {&__pyx_kp__input,&__pyx_kp_profile_run,0};
108457   __Pyx_SetupRefcountContext("__call__");
108458   __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
108459   __Pyx_GOTREF(__pyx_v_kw);
108460   if (unlikely(__pyx_kwds)) {
108461     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
108462     PyObject* values[2] = {0,0};
108463     values[1] = __pyx_k_200;
108464     switch (PyTuple_GET_SIZE(__pyx_args)) {
108465       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
108466       case  0: break;
108467       default: goto __pyx_L5_argtuple_error;
108468     }
108469     switch (PyTuple_GET_SIZE(__pyx_args)) {
108470       case  0:
108471       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp__input);
108472       if (likely(values[0])) kw_args--;
108473       else goto __pyx_L5_argtuple_error;
108474     }
108475     if (unlikely(kw_args > 0)) {
108476       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, PyTuple_GET_SIZE(__pyx_args), "__call__") < 0)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
108477     }
108478     __pyx_v__input = values[0];
108479     __pyx_v_profile_run = values[1];
108480   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
108481     goto __pyx_L5_argtuple_error;
108482   } else {
108483     __pyx_v__input = PyTuple_GET_ITEM(__pyx_args, 0);
108484     __pyx_v_profile_run = __pyx_k_200;
108485   }
108486   goto __pyx_L4_argument_unpacking_done;
108487   __pyx_L5_argtuple_error:;
108488   __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[18]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
108489   __pyx_L3_error:;
108490   __Pyx_DECREF(__pyx_v_kw);
108491   __Pyx_AddTraceback("lxml.etree.XSLT.__call__");
108492   return NULL;
108493   __pyx_L4_argument_unpacking_done:;
108494   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__XSLTContext *)Py_None); __Pyx_INCREF(Py_None);
108495   __pyx_v_resolver_context = ((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)Py_None); __Pyx_INCREF(Py_None);
108496   __pyx_v_input_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
108497   __pyx_v_root_node = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
108498   __pyx_v_result_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
108499   __pyx_v_profile_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
108500   __pyx_v_error = Py_None; __Pyx_INCREF(Py_None);
108501   __pyx_v_message = Py_None; __Pyx_INCREF(Py_None);
108502
108503   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":475
108504  *         cdef xmlDoc* c_profile_doc
108505  *         cdef xslt.xsltTransformContext* transform_ctxt
108506  *         cdef xmlDoc* c_result = NULL             # <<<<<<<<<<<<<<
108507  *         cdef xmlDoc* c_doc
108508  *         cdef tree.xmlDict* c_dict
108509  */
108510   __pyx_v_c_result = NULL;
108511
108512   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":479
108513  *         cdef tree.xmlDict* c_dict
108514  * 
108515  *         input_doc = _documentOrRaise(_input)             # <<<<<<<<<<<<<<
108516  *         root_node = _rootNodeOrRaise(_input)
108517  * 
108518  */
108519   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v__input)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
108520   __Pyx_GOTREF(__pyx_t_1);
108521   __Pyx_DECREF(((PyObject *)__pyx_v_input_doc));
108522   __pyx_v_input_doc = ((struct LxmlDocument *)__pyx_t_1);
108523   __pyx_t_1 = 0;
108524
108525   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":480
108526  * 
108527  *         input_doc = _documentOrRaise(_input)
108528  *         root_node = _rootNodeOrRaise(_input)             # <<<<<<<<<<<<<<
108529  * 
108530  *         c_doc = _fakeRootDoc(input_doc._c_doc, root_node._c_node)
108531  */
108532   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v__input)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
108533   __Pyx_GOTREF(__pyx_t_1);
108534   __Pyx_DECREF(((PyObject *)__pyx_v_root_node));
108535   __pyx_v_root_node = ((struct LxmlElement *)__pyx_t_1);
108536   __pyx_t_1 = 0;
108537
108538   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":482
108539  *         root_node = _rootNodeOrRaise(_input)
108540  * 
108541  *         c_doc = _fakeRootDoc(input_doc._c_doc, root_node._c_node)             # <<<<<<<<<<<<<<
108542  * 
108543  *         transform_ctxt = xslt.xsltNewTransformContext(self._c_style, c_doc)
108544  */
108545   __pyx_t_2 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_input_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
108546   __pyx_v_c_doc = __pyx_t_2;
108547
108548   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":484
108549  *         c_doc = _fakeRootDoc(input_doc._c_doc, root_node._c_node)
108550  * 
108551  *         transform_ctxt = xslt.xsltNewTransformContext(self._c_style, c_doc)             # <<<<<<<<<<<<<<
108552  *         if transform_ctxt is NULL:
108553  *             _destroyFakeDoc(input_doc._c_doc, c_doc)
108554  */
108555   __pyx_v_transform_ctxt = xsltNewTransformContext(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_c_style, __pyx_v_c_doc);
108556
108557   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":485
108558  * 
108559  *         transform_ctxt = xslt.xsltNewTransformContext(self._c_style, c_doc)
108560  *         if transform_ctxt is NULL:             # <<<<<<<<<<<<<<
108561  *             _destroyFakeDoc(input_doc._c_doc, c_doc)
108562  *             python.PyErr_NoMemory()
108563  */
108564   __pyx_t_3 = (__pyx_v_transform_ctxt == NULL);
108565   if (__pyx_t_3) {
108566
108567     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":486
108568  *         transform_ctxt = xslt.xsltNewTransformContext(self._c_style, c_doc)
108569  *         if transform_ctxt is NULL:
108570  *             _destroyFakeDoc(input_doc._c_doc, c_doc)             # <<<<<<<<<<<<<<
108571  *             python.PyErr_NoMemory()
108572  * 
108573  */
108574     __pyx_f_4lxml_5etree__destroyFakeDoc(__pyx_v_input_doc->_c_doc, __pyx_v_c_doc);
108575
108576     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":487
108577  *         if transform_ctxt is NULL:
108578  *             _destroyFakeDoc(input_doc._c_doc, c_doc)
108579  *             python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
108580  * 
108581  *         # using the stylesheet dict is safer than using a possibly
108582  */
108583     __pyx_t_1 = PyErr_NoMemory(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
108584     __Pyx_GOTREF(__pyx_t_1);
108585     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
108586     goto __pyx_L6;
108587   }
108588   __pyx_L6:;
108589
108590   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":493
108591  *         # non-input tag/attr names will come from the stylesheet
108592  *         # anyway.
108593  *         if transform_ctxt.dict is not NULL:             # <<<<<<<<<<<<<<
108594  *             xmlparser.xmlDictFree(transform_ctxt.dict)
108595  *         transform_ctxt.dict = self._c_style.doc.dict
108596  */
108597   __pyx_t_3 = (__pyx_v_transform_ctxt->dict != NULL);
108598   if (__pyx_t_3) {
108599
108600     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":494
108601  *         # anyway.
108602  *         if transform_ctxt.dict is not NULL:
108603  *             xmlparser.xmlDictFree(transform_ctxt.dict)             # <<<<<<<<<<<<<<
108604  *         transform_ctxt.dict = self._c_style.doc.dict
108605  *         xmlparser.xmlDictReference(transform_ctxt.dict)
108606  */
108607     xmlDictFree(__pyx_v_transform_ctxt->dict);
108608     goto __pyx_L7;
108609   }
108610   __pyx_L7:;
108611
108612   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":495
108613  *         if transform_ctxt.dict is not NULL:
108614  *             xmlparser.xmlDictFree(transform_ctxt.dict)
108615  *         transform_ctxt.dict = self._c_style.doc.dict             # <<<<<<<<<<<<<<
108616  *         xmlparser.xmlDictReference(transform_ctxt.dict)
108617  * 
108618  */
108619   __pyx_v_transform_ctxt->dict = ((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_c_style->doc->dict;
108620
108621   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":496
108622  *             xmlparser.xmlDictFree(transform_ctxt.dict)
108623  *         transform_ctxt.dict = self._c_style.doc.dict
108624  *         xmlparser.xmlDictReference(transform_ctxt.dict)             # <<<<<<<<<<<<<<
108625  * 
108626  *         xslt.xsltSetCtxtParseOptions(
108627  */
108628   xmlDictReference(__pyx_v_transform_ctxt->dict);
108629
108630   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":499
108631  * 
108632  *         xslt.xsltSetCtxtParseOptions(
108633  *             transform_ctxt, input_doc._parser._parse_options)             # <<<<<<<<<<<<<<
108634  * 
108635  *         if profile_run:
108636  */
108637   xsltSetCtxtParseOptions(__pyx_v_transform_ctxt, __pyx_v_input_doc->_parser->_parse_options);
108638
108639   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":501
108640  *             transform_ctxt, input_doc._parser._parse_options)
108641  * 
108642  *         if profile_run:             # <<<<<<<<<<<<<<
108643  *             transform_ctxt.profile = 1
108644  * 
108645  */
108646   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_profile_run); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
108647   if (__pyx_t_3) {
108648
108649     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":502
108650  * 
108651  *         if profile_run:
108652  *             transform_ctxt.profile = 1             # <<<<<<<<<<<<<<
108653  * 
108654  *         try:
108655  */
108656     __pyx_v_transform_ctxt->profile = 1;
108657     goto __pyx_L8;
108658   }
108659   __pyx_L8:;
108660
108661   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":504
108662  *             transform_ctxt.profile = 1
108663  * 
108664  *         try:             # <<<<<<<<<<<<<<
108665  *             self._error_log.connect()
108666  *             context = self._context._copy()
108667  */
108668   /*try:*/ {
108669
108670     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":505
108671  * 
108672  *         try:
108673  *             self._error_log.connect()             # <<<<<<<<<<<<<<
108674  *             context = self._context._copy()
108675  *             context.register_context(transform_ctxt, input_doc)
108676  */
108677     ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log);
108678
108679     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":506
108680  *         try:
108681  *             self._error_log.connect()
108682  *             context = self._context._copy()             # <<<<<<<<<<<<<<
108683  *             context.register_context(transform_ctxt, input_doc)
108684  * 
108685  */
108686     __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__XSLTContext *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_context->__pyx_base.__pyx_vtab)->__pyx_base._copy(((struct __pyx_obj_4lxml_5etree__BaseContext *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_context))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L10;}
108687     __Pyx_GOTREF(__pyx_t_1);
108688     if (!(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__XSLTContext))) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L10;}
108689     __Pyx_DECREF(((PyObject *)__pyx_v_context));
108690     __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__XSLTContext *)__pyx_t_1);
108691     __pyx_t_1 = 0;
108692
108693     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":507
108694  *             self._error_log.connect()
108695  *             context = self._context._copy()
108696  *             context.register_context(transform_ctxt, input_doc)             # <<<<<<<<<<<<<<
108697  * 
108698  *             resolver_context = self._xslt_resolver_context._copy()
108699  */
108700     __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTContext *)__pyx_v_context->__pyx_base.__pyx_vtab)->register_context(__pyx_v_context, __pyx_v_transform_ctxt, __pyx_v_input_doc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L10;}
108701     __Pyx_GOTREF(__pyx_t_1);
108702     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
108703
108704     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":509
108705  *             context.register_context(transform_ctxt, input_doc)
108706  * 
108707  *             resolver_context = self._xslt_resolver_context._copy()             # <<<<<<<<<<<<<<
108708  *             transform_ctxt._private = <python.PyObject*>resolver_context
108709  * 
108710  */
108711     __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context->__pyx_base.__pyx_base.__pyx_vtab)->_copy(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L10;}
108712     __Pyx_GOTREF(__pyx_t_1);
108713     __Pyx_DECREF(((PyObject *)__pyx_v_resolver_context));
108714     __pyx_v_resolver_context = ((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)__pyx_t_1);
108715     __pyx_t_1 = 0;
108716
108717     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":510
108718  * 
108719  *             resolver_context = self._xslt_resolver_context._copy()
108720  *             transform_ctxt._private = <python.PyObject*>resolver_context             # <<<<<<<<<<<<<<
108721  * 
108722  *             c_result = self._run_transform(
108723  */
108724     __pyx_v_transform_ctxt->_private = ((PyObject *)__pyx_v_resolver_context);
108725
108726     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":513
108727  * 
108728  *             c_result = self._run_transform(
108729  *                 c_doc, kw, context, transform_ctxt)             # <<<<<<<<<<<<<<
108730  * 
108731  *             if transform_ctxt.state != xslt.XSLT_STATE_OK:
108732  */
108733     if (!(likely(PyDict_CheckExact(__pyx_v_kw)) || (__pyx_v_kw) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected dict, got %s", Py_TYPE(__pyx_v_kw)->tp_name), 0))) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L10;}
108734     __pyx_v_c_result = ((struct __pyx_vtabstruct_4lxml_5etree_XSLT *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->__pyx_vtab)->_run_transform(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self), __pyx_v_c_doc, ((PyObject *)__pyx_v_kw), __pyx_v_context, __pyx_v_transform_ctxt);
108735
108736     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":515
108737  *                 c_doc, kw, context, transform_ctxt)
108738  * 
108739  *             if transform_ctxt.state != xslt.XSLT_STATE_OK:             # <<<<<<<<<<<<<<
108740  *                 if c_result is not NULL:
108741  *                     tree.xmlFreeDoc(c_result)
108742  */
108743     __pyx_t_3 = (__pyx_v_transform_ctxt->state != XSLT_STATE_OK);
108744     if (__pyx_t_3) {
108745
108746       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":516
108747  * 
108748  *             if transform_ctxt.state != xslt.XSLT_STATE_OK:
108749  *                 if c_result is not NULL:             # <<<<<<<<<<<<<<
108750  *                     tree.xmlFreeDoc(c_result)
108751  *                     c_result = NULL
108752  */
108753       __pyx_t_3 = (__pyx_v_c_result != NULL);
108754       if (__pyx_t_3) {
108755
108756         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":517
108757  *             if transform_ctxt.state != xslt.XSLT_STATE_OK:
108758  *                 if c_result is not NULL:
108759  *                     tree.xmlFreeDoc(c_result)             # <<<<<<<<<<<<<<
108760  *                     c_result = NULL
108761  * 
108762  */
108763         xmlFreeDoc(__pyx_v_c_result);
108764
108765         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":518
108766  *                 if c_result is not NULL:
108767  *                     tree.xmlFreeDoc(c_result)
108768  *                     c_result = NULL             # <<<<<<<<<<<<<<
108769  * 
108770  *             if transform_ctxt.profile:
108771  */
108772         __pyx_v_c_result = NULL;
108773         goto __pyx_L13;
108774       }
108775       __pyx_L13:;
108776       goto __pyx_L12;
108777     }
108778     __pyx_L12:;
108779
108780     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":520
108781  *                     c_result = NULL
108782  * 
108783  *             if transform_ctxt.profile:             # <<<<<<<<<<<<<<
108784  *                 c_profile_doc = xslt.xsltGetProfileInformation(transform_ctxt)
108785  *                 if c_profile_doc is not NULL:
108786  */
108787     __pyx_t_4 = __pyx_v_transform_ctxt->profile;
108788     if (__pyx_t_4) {
108789
108790       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":521
108791  * 
108792  *             if transform_ctxt.profile:
108793  *                 c_profile_doc = xslt.xsltGetProfileInformation(transform_ctxt)             # <<<<<<<<<<<<<<
108794  *                 if c_profile_doc is not NULL:
108795  *                     profile_doc = _documentFactory(
108796  */
108797       __pyx_v_c_profile_doc = xsltGetProfileInformation(__pyx_v_transform_ctxt);
108798
108799       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":522
108800  *             if transform_ctxt.profile:
108801  *                 c_profile_doc = xslt.xsltGetProfileInformation(transform_ctxt)
108802  *                 if c_profile_doc is not NULL:             # <<<<<<<<<<<<<<
108803  *                     profile_doc = _documentFactory(
108804  *                         c_profile_doc, input_doc._parser)
108805  */
108806       __pyx_t_3 = (__pyx_v_c_profile_doc != NULL);
108807       if (__pyx_t_3) {
108808
108809         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":524
108810  *                 if c_profile_doc is not NULL:
108811  *                     profile_doc = _documentFactory(
108812  *                         c_profile_doc, input_doc._parser)             # <<<<<<<<<<<<<<
108813  *         finally:
108814  *             if context is not None:
108815  */
108816         __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_profile_doc, __pyx_v_input_doc->_parser)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L10;}
108817         __Pyx_GOTREF(__pyx_t_1);
108818         __Pyx_DECREF(((PyObject *)__pyx_v_profile_doc));
108819         __pyx_v_profile_doc = ((struct LxmlDocument *)__pyx_t_1);
108820         __pyx_t_1 = 0;
108821         goto __pyx_L15;
108822       }
108823       __pyx_L15:;
108824       goto __pyx_L14;
108825     }
108826     __pyx_L14:;
108827   }
108828   /*finally:*/ {
108829     int __pyx_why;
108830     PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
108831     int __pyx_exc_lineno;
108832     __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
108833     __pyx_why = 0; goto __pyx_L11;
108834     __pyx_L10: {
108835       __pyx_why = 4;
108836       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
108837       __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
108838       __pyx_exc_lineno = __pyx_lineno;
108839       goto __pyx_L11;
108840     }
108841     __pyx_L11:;
108842
108843     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":526
108844  *                         c_profile_doc, input_doc._parser)
108845  *         finally:
108846  *             if context is not None:             # <<<<<<<<<<<<<<
108847  *                 context.free_context()
108848  *             _destroyFakeDoc(input_doc._c_doc, c_doc)
108849  */
108850     __pyx_t_3 = (((PyObject *)__pyx_v_context) != Py_None);
108851     if (__pyx_t_3) {
108852
108853       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":527
108854  *         finally:
108855  *             if context is not None:
108856  *                 context.free_context()             # <<<<<<<<<<<<<<
108857  *             _destroyFakeDoc(input_doc._c_doc, c_doc)
108858  *             self._error_log.disconnect()
108859  */
108860       __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTContext *)__pyx_v_context->__pyx_base.__pyx_vtab)->free_context(__pyx_v_context); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
108861       __Pyx_GOTREF(__pyx_t_1);
108862       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
108863       goto __pyx_L17;
108864     }
108865     __pyx_L17:;
108866
108867     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":528
108868  *             if context is not None:
108869  *                 context.free_context()
108870  *             _destroyFakeDoc(input_doc._c_doc, c_doc)             # <<<<<<<<<<<<<<
108871  *             self._error_log.disconnect()
108872  * 
108873  */
108874     __pyx_f_4lxml_5etree__destroyFakeDoc(__pyx_v_input_doc->_c_doc, __pyx_v_c_doc);
108875
108876     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":529
108877  *                 context.free_context()
108878  *             _destroyFakeDoc(input_doc._c_doc, c_doc)
108879  *             self._error_log.disconnect()             # <<<<<<<<<<<<<<
108880  * 
108881  *         try:
108882  */
108883     ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log);
108884     goto __pyx_L18;
108885     __pyx_L16_error:;
108886     if (__pyx_why == 4) {
108887       Py_XDECREF(__pyx_exc_type);
108888       Py_XDECREF(__pyx_exc_value);
108889       Py_XDECREF(__pyx_exc_tb);
108890     }
108891     goto __pyx_L1_error;
108892     __pyx_L18:;
108893     switch (__pyx_why) {
108894       case 4: {
108895         __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
108896         __pyx_lineno = __pyx_exc_lineno;
108897         __pyx_exc_type = 0;
108898         __pyx_exc_value = 0;
108899         __pyx_exc_tb = 0;
108900         goto __pyx_L1_error;
108901       }
108902     }
108903   }
108904
108905   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":531
108906  *             self._error_log.disconnect()
108907  * 
108908  *         try:             # <<<<<<<<<<<<<<
108909  *             if resolver_context is not None and resolver_context._has_raised():
108910  *                 if c_result is not NULL:
108911  */
108912   /*try:*/ {
108913
108914     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":532
108915  * 
108916  *         try:
108917  *             if resolver_context is not None and resolver_context._has_raised():             # <<<<<<<<<<<<<<
108918  *                 if c_result is not NULL:
108919  *                     tree.xmlFreeDoc(c_result)
108920  */
108921     __pyx_t_3 = (((PyObject *)__pyx_v_resolver_context) != Py_None);
108922     if (__pyx_t_3) {
108923       __pyx_t_5 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *)__pyx_v_resolver_context->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._has_raised(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_resolver_context));
108924     } else {
108925       __pyx_t_5 = __pyx_t_3;
108926     }
108927     if (__pyx_t_5) {
108928
108929       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":533
108930  *         try:
108931  *             if resolver_context is not None and resolver_context._has_raised():
108932  *                 if c_result is not NULL:             # <<<<<<<<<<<<<<
108933  *                     tree.xmlFreeDoc(c_result)
108934  *                     c_result = NULL
108935  */
108936       __pyx_t_5 = (__pyx_v_c_result != NULL);
108937       if (__pyx_t_5) {
108938
108939         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":534
108940  *             if resolver_context is not None and resolver_context._has_raised():
108941  *                 if c_result is not NULL:
108942  *                     tree.xmlFreeDoc(c_result)             # <<<<<<<<<<<<<<
108943  *                     c_result = NULL
108944  *                 resolver_context._raise_if_stored()
108945  */
108946         xmlFreeDoc(__pyx_v_c_result);
108947
108948         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":535
108949  *                 if c_result is not NULL:
108950  *                     tree.xmlFreeDoc(c_result)
108951  *                     c_result = NULL             # <<<<<<<<<<<<<<
108952  *                 resolver_context._raise_if_stored()
108953  * 
108954  */
108955         __pyx_v_c_result = NULL;
108956         goto __pyx_L23;
108957       }
108958       __pyx_L23:;
108959
108960       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":536
108961  *                     tree.xmlFreeDoc(c_result)
108962  *                     c_result = NULL
108963  *                 resolver_context._raise_if_stored()             # <<<<<<<<<<<<<<
108964  * 
108965  *             if context._exc._has_raised():
108966  */
108967       __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *)__pyx_v_resolver_context->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._raise_if_stored(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_resolver_context)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L20;}
108968       goto __pyx_L22;
108969     }
108970     __pyx_L22:;
108971
108972     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":538
108973  *                 resolver_context._raise_if_stored()
108974  * 
108975  *             if context._exc._has_raised():             # <<<<<<<<<<<<<<
108976  *                 if c_result is not NULL:
108977  *                     tree.xmlFreeDoc(c_result)
108978  */
108979     __pyx_t_5 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_context->__pyx_base._exc->__pyx_vtab)->_has_raised(__pyx_v_context->__pyx_base._exc);
108980     if (__pyx_t_5) {
108981
108982       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":539
108983  * 
108984  *             if context._exc._has_raised():
108985  *                 if c_result is not NULL:             # <<<<<<<<<<<<<<
108986  *                     tree.xmlFreeDoc(c_result)
108987  *                     c_result = NULL
108988  */
108989       __pyx_t_5 = (__pyx_v_c_result != NULL);
108990       if (__pyx_t_5) {
108991
108992         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":540
108993  *             if context._exc._has_raised():
108994  *                 if c_result is not NULL:
108995  *                     tree.xmlFreeDoc(c_result)             # <<<<<<<<<<<<<<
108996  *                     c_result = NULL
108997  *                 context._exc._raise_if_stored()
108998  */
108999         xmlFreeDoc(__pyx_v_c_result);
109000
109001         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":541
109002  *                 if c_result is not NULL:
109003  *                     tree.xmlFreeDoc(c_result)
109004  *                     c_result = NULL             # <<<<<<<<<<<<<<
109005  *                 context._exc._raise_if_stored()
109006  * 
109007  */
109008         __pyx_v_c_result = NULL;
109009         goto __pyx_L25;
109010       }
109011       __pyx_L25:;
109012
109013       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":542
109014  *                     tree.xmlFreeDoc(c_result)
109015  *                     c_result = NULL
109016  *                 context._exc._raise_if_stored()             # <<<<<<<<<<<<<<
109017  * 
109018  *             if c_result is NULL:
109019  */
109020       __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_context->__pyx_base._exc->__pyx_vtab)->_raise_if_stored(__pyx_v_context->__pyx_base._exc); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L20;}
109021       goto __pyx_L24;
109022     }
109023     __pyx_L24:;
109024
109025     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":544
109026  *                 context._exc._raise_if_stored()
109027  * 
109028  *             if c_result is NULL:             # <<<<<<<<<<<<<<
109029  *                 # last error seems to be the most accurate here
109030  *                 error = self._error_log.last_error
109031  */
109032     __pyx_t_5 = (__pyx_v_c_result == NULL);
109033     if (__pyx_t_5) {
109034
109035       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":546
109036  *             if c_result is NULL:
109037  *                 # last error seems to be the most accurate here
109038  *                 error = self._error_log.last_error             # <<<<<<<<<<<<<<
109039  *                 if error is not None and error.message:
109040  *                     if error.line > 0:
109041  */
109042       __Pyx_INCREF(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log->__pyx_base.__pyx_base.last_error);
109043       __Pyx_DECREF(__pyx_v_error);
109044       __pyx_v_error = ((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log->__pyx_base.__pyx_base.last_error;
109045
109046       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":547
109047  *                 # last error seems to be the most accurate here
109048  *                 error = self._error_log.last_error
109049  *                 if error is not None and error.message:             # <<<<<<<<<<<<<<
109050  *                     if error.line > 0:
109051  *                         message = u"%s, line %d" % (error.message, error.line)
109052  */
109053       __pyx_t_5 = (__pyx_v_error != Py_None);
109054       if (__pyx_t_5) {
109055         __pyx_t_1 = PyObject_GetAttr(__pyx_v_error, __pyx_kp_message); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L20;}
109056         __Pyx_GOTREF(__pyx_t_1);
109057         __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L20;}
109058         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
109059         __pyx_t_6 = __pyx_t_3;
109060       } else {
109061         __pyx_t_6 = __pyx_t_5;
109062       }
109063       if (__pyx_t_6) {
109064
109065         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":548
109066  *                 error = self._error_log.last_error
109067  *                 if error is not None and error.message:
109068  *                     if error.line > 0:             # <<<<<<<<<<<<<<
109069  *                         message = u"%s, line %d" % (error.message, error.line)
109070  *                     else:
109071  */
109072         __pyx_t_1 = PyObject_GetAttr(__pyx_v_error, __pyx_kp_line); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L20;}
109073         __Pyx_GOTREF(__pyx_t_1);
109074         __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L20;}
109075         __Pyx_GOTREF(__pyx_t_7);
109076         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
109077         __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L20;}
109078         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
109079         if (__pyx_t_6) {
109080
109081           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":549
109082  *                 if error is not None and error.message:
109083  *                     if error.line > 0:
109084  *                         message = u"%s, line %d" % (error.message, error.line)             # <<<<<<<<<<<<<<
109085  *                     else:
109086  *                         message = error.message
109087  */
109088           __pyx_t_7 = PyObject_GetAttr(__pyx_v_error, __pyx_kp_message); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L20;}
109089           __Pyx_GOTREF(__pyx_t_7);
109090           __pyx_t_1 = PyObject_GetAttr(__pyx_v_error, __pyx_kp_line); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L20;}
109091           __Pyx_GOTREF(__pyx_t_1);
109092           __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L20;}
109093           __Pyx_GOTREF(((PyObject *)__pyx_t_8));
109094           PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7);
109095           __Pyx_GIVEREF(__pyx_t_7);
109096           PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_1);
109097           __Pyx_GIVEREF(__pyx_t_1);
109098           __pyx_t_7 = 0;
109099           __pyx_t_1 = 0;
109100           __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_619), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L20;}
109101           __Pyx_GOTREF(__pyx_t_1);
109102           __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
109103           __Pyx_DECREF(__pyx_v_message);
109104           __pyx_v_message = __pyx_t_1;
109105           __pyx_t_1 = 0;
109106           goto __pyx_L28;
109107         }
109108         /*else*/ {
109109
109110           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":551
109111  *                         message = u"%s, line %d" % (error.message, error.line)
109112  *                     else:
109113  *                         message = error.message             # <<<<<<<<<<<<<<
109114  *                 elif error is not None and error.line > 0:
109115  *                     message = u"Error applying stylesheet, line %d" % error.line
109116  */
109117           __pyx_t_1 = PyObject_GetAttr(__pyx_v_error, __pyx_kp_message); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L20;}
109118           __Pyx_GOTREF(__pyx_t_1);
109119           __Pyx_DECREF(__pyx_v_message);
109120           __pyx_v_message = __pyx_t_1;
109121           __pyx_t_1 = 0;
109122         }
109123         __pyx_L28:;
109124         goto __pyx_L27;
109125       }
109126
109127       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":552
109128  *                     else:
109129  *                         message = error.message
109130  *                 elif error is not None and error.line > 0:             # <<<<<<<<<<<<<<
109131  *                     message = u"Error applying stylesheet, line %d" % error.line
109132  *                 else:
109133  */
109134       __pyx_t_6 = (__pyx_v_error != Py_None);
109135       if (__pyx_t_6) {
109136         __pyx_t_1 = PyObject_GetAttr(__pyx_v_error, __pyx_kp_line); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L20;}
109137         __Pyx_GOTREF(__pyx_t_1);
109138         __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GT); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L20;}
109139         __Pyx_GOTREF(__pyx_t_8);
109140         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
109141         __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L20;}
109142         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
109143         __pyx_t_3 = __pyx_t_5;
109144       } else {
109145         __pyx_t_3 = __pyx_t_6;
109146       }
109147       if (__pyx_t_3) {
109148
109149         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":553
109150  *                         message = error.message
109151  *                 elif error is not None and error.line > 0:
109152  *                     message = u"Error applying stylesheet, line %d" % error.line             # <<<<<<<<<<<<<<
109153  *                 else:
109154  *                     message = u"Error applying stylesheet"
109155  */
109156         __pyx_t_8 = PyObject_GetAttr(__pyx_v_error, __pyx_kp_line); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L20;}
109157         __Pyx_GOTREF(__pyx_t_8);
109158         __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_620), __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L20;}
109159         __Pyx_GOTREF(__pyx_t_1);
109160         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
109161         __Pyx_DECREF(__pyx_v_message);
109162         __pyx_v_message = __pyx_t_1;
109163         __pyx_t_1 = 0;
109164         goto __pyx_L27;
109165       }
109166       /*else*/ {
109167
109168         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":555
109169  *                     message = u"Error applying stylesheet, line %d" % error.line
109170  *                 else:
109171  *                     message = u"Error applying stylesheet"             # <<<<<<<<<<<<<<
109172  *                 raise XSLTApplyError(message, self._error_log)
109173  *         finally:
109174  */
109175         __Pyx_INCREF(((PyObject *)__pyx_kp_621));
109176         __Pyx_DECREF(__pyx_v_message);
109177         __pyx_v_message = ((PyObject *)__pyx_kp_621);
109178       }
109179       __pyx_L27:;
109180
109181       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":556
109182  *                 else:
109183  *                     message = u"Error applying stylesheet"
109184  *                 raise XSLTApplyError(message, self._error_log)             # <<<<<<<<<<<<<<
109185  *         finally:
109186  *             if resolver_context is not None:
109187  */
109188       __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XSLTApplyError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L20;}
109189       __Pyx_GOTREF(__pyx_1);
109190       __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L20;}
109191       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
109192       __Pyx_INCREF(__pyx_v_message);
109193       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_message);
109194       __Pyx_GIVEREF(__pyx_v_message);
109195       __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log));
109196       PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log));
109197       __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log));
109198       __pyx_t_8 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L20;}
109199       __Pyx_GOTREF(__pyx_t_8);
109200       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
109201       __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
109202       __Pyx_Raise(__pyx_t_8, 0, 0);
109203       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
109204       {__pyx_filename = __pyx_f[18]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L20;}
109205       goto __pyx_L26;
109206     }
109207     __pyx_L26:;
109208   }
109209   /*finally:*/ {
109210     int __pyx_why;
109211     PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
109212     int __pyx_exc_lineno;
109213     __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
109214     __pyx_why = 0; goto __pyx_L21;
109215     __pyx_L20: {
109216       __pyx_why = 4;
109217       __Pyx_XDECREF(__pyx_1); __pyx_1 = 0;
109218       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
109219       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
109220       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
109221       __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
109222       __pyx_exc_lineno = __pyx_lineno;
109223       goto __pyx_L21;
109224     }
109225     __pyx_L21:;
109226
109227     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":558
109228  *                 raise XSLTApplyError(message, self._error_log)
109229  *         finally:
109230  *             if resolver_context is not None:             # <<<<<<<<<<<<<<
109231  *                 resolver_context.clear()
109232  * 
109233  */
109234     __pyx_t_3 = (((PyObject *)__pyx_v_resolver_context) != Py_None);
109235     if (__pyx_t_3) {
109236
109237       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":559
109238  *         finally:
109239  *             if resolver_context is not None:
109240  *                 resolver_context.clear()             # <<<<<<<<<<<<<<
109241  * 
109242  *         result_doc = _documentFactory(c_result, input_doc._parser)
109243  */
109244       ((struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *)__pyx_v_resolver_context->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.clear(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_resolver_context));
109245       goto __pyx_L30;
109246     }
109247     __pyx_L30:;
109248     switch (__pyx_why) {
109249       case 4: {
109250         __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
109251         __pyx_lineno = __pyx_exc_lineno;
109252         __pyx_exc_type = 0;
109253         __pyx_exc_value = 0;
109254         __pyx_exc_tb = 0;
109255         goto __pyx_L1_error;
109256       }
109257     }
109258   }
109259
109260   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":561
109261  *                 resolver_context.clear()
109262  * 
109263  *         result_doc = _documentFactory(c_result, input_doc._parser)             # <<<<<<<<<<<<<<
109264  * 
109265  *         c_dict = c_result.dict
109266  */
109267   __pyx_t_8 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_result, __pyx_v_input_doc->_parser)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
109268   __Pyx_GOTREF(__pyx_t_8);
109269   __Pyx_DECREF(((PyObject *)__pyx_v_result_doc));
109270   __pyx_v_result_doc = ((struct LxmlDocument *)__pyx_t_8);
109271   __pyx_t_8 = 0;
109272
109273   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":563
109274  *         result_doc = _documentFactory(c_result, input_doc._parser)
109275  * 
109276  *         c_dict = c_result.dict             # <<<<<<<<<<<<<<
109277  *         __GLOBAL_PARSER_CONTEXT.initThreadDictRef(&c_result.dict)
109278  *         if c_dict is not c_result.dict or \
109279  */
109280   __pyx_v_c_dict = __pyx_v_c_result->dict;
109281
109282   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":564
109283  * 
109284  *         c_dict = c_result.dict
109285  *         __GLOBAL_PARSER_CONTEXT.initThreadDictRef(&c_result.dict)             # <<<<<<<<<<<<<<
109286  *         if c_dict is not c_result.dict or \
109287  *                 self._c_style.doc.dict is not c_result.dict or \
109288  */
109289   ((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initThreadDictRef(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT, (&__pyx_v_c_result->dict));
109290
109291   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":565
109292  *         c_dict = c_result.dict
109293  *         __GLOBAL_PARSER_CONTEXT.initThreadDictRef(&c_result.dict)
109294  *         if c_dict is not c_result.dict or \             # <<<<<<<<<<<<<<
109295  *                 self._c_style.doc.dict is not c_result.dict or \
109296  *                 input_doc._c_doc.dict is not c_result.dict:
109297  */
109298   if (!(__pyx_v_c_dict != __pyx_v_c_result->dict)) {
109299
109300     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":566
109301  *         __GLOBAL_PARSER_CONTEXT.initThreadDictRef(&c_result.dict)
109302  *         if c_dict is not c_result.dict or \
109303  *                 self._c_style.doc.dict is not c_result.dict or \             # <<<<<<<<<<<<<<
109304  *                 input_doc._c_doc.dict is not c_result.dict:
109305  *             with nogil:
109306  */
109307     if (!(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_c_style->doc->dict != __pyx_v_c_result->dict)) {
109308
109309       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":567
109310  *         if c_dict is not c_result.dict or \
109311  *                 self._c_style.doc.dict is not c_result.dict or \
109312  *                 input_doc._c_doc.dict is not c_result.dict:             # <<<<<<<<<<<<<<
109313  *             with nogil:
109314  *                 if c_dict is not c_result.dict:
109315  */
109316       __pyx_t_3 = (__pyx_v_input_doc->_c_doc->dict != __pyx_v_c_result->dict);
109317     } else {
109318       __pyx_t_3 = (((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_c_style->doc->dict != __pyx_v_c_result->dict);
109319     }
109320     __pyx_t_6 = __pyx_t_3;
109321   } else {
109322     __pyx_t_6 = (__pyx_v_c_dict != __pyx_v_c_result->dict);
109323   }
109324   if (__pyx_t_6) {
109325
109326     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":568
109327  *                 self._c_style.doc.dict is not c_result.dict or \
109328  *                 input_doc._c_doc.dict is not c_result.dict:
109329  *             with nogil:             # <<<<<<<<<<<<<<
109330  *                 if c_dict is not c_result.dict:
109331  *                     fixThreadDictNames(<xmlNode*>c_result,
109332  */
109333     { PyThreadState *_save;
109334       Py_UNBLOCK_THREADS
109335       /*try:*/ {
109336
109337         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":569
109338  *                 input_doc._c_doc.dict is not c_result.dict:
109339  *             with nogil:
109340  *                 if c_dict is not c_result.dict:             # <<<<<<<<<<<<<<
109341  *                     fixThreadDictNames(<xmlNode*>c_result,
109342  *                                        c_dict, c_result.dict)
109343  */
109344         __pyx_t_6 = (__pyx_v_c_dict != __pyx_v_c_result->dict);
109345         if (__pyx_t_6) {
109346
109347           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":571
109348  *                 if c_dict is not c_result.dict:
109349  *                     fixThreadDictNames(<xmlNode*>c_result,
109350  *                                        c_dict, c_result.dict)             # <<<<<<<<<<<<<<
109351  *                 if self._c_style.doc.dict is not c_result.dict:
109352  *                     fixThreadDictNames(<xmlNode*>c_result,
109353  */
109354           __pyx_f_4lxml_5etree_fixThreadDictNames(((xmlNode *)__pyx_v_c_result), __pyx_v_c_dict, __pyx_v_c_result->dict);
109355           goto __pyx_L35;
109356         }
109357         __pyx_L35:;
109358
109359         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":572
109360  *                     fixThreadDictNames(<xmlNode*>c_result,
109361  *                                        c_dict, c_result.dict)
109362  *                 if self._c_style.doc.dict is not c_result.dict:             # <<<<<<<<<<<<<<
109363  *                     fixThreadDictNames(<xmlNode*>c_result,
109364  *                                        self._c_style.doc.dict, c_result.dict)
109365  */
109366         __pyx_t_6 = (((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_c_style->doc->dict != __pyx_v_c_result->dict);
109367         if (__pyx_t_6) {
109368
109369           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":574
109370  *                 if self._c_style.doc.dict is not c_result.dict:
109371  *                     fixThreadDictNames(<xmlNode*>c_result,
109372  *                                        self._c_style.doc.dict, c_result.dict)             # <<<<<<<<<<<<<<
109373  *                 if input_doc._c_doc.dict is not c_result.dict:
109374  *                     fixThreadDictNames(<xmlNode*>c_result,
109375  */
109376           __pyx_f_4lxml_5etree_fixThreadDictNames(((xmlNode *)__pyx_v_c_result), ((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_c_style->doc->dict, __pyx_v_c_result->dict);
109377           goto __pyx_L36;
109378         }
109379         __pyx_L36:;
109380
109381         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":575
109382  *                     fixThreadDictNames(<xmlNode*>c_result,
109383  *                                        self._c_style.doc.dict, c_result.dict)
109384  *                 if input_doc._c_doc.dict is not c_result.dict:             # <<<<<<<<<<<<<<
109385  *                     fixThreadDictNames(<xmlNode*>c_result,
109386  *                                        input_doc._c_doc.dict, c_result.dict)
109387  */
109388         __pyx_t_6 = (__pyx_v_input_doc->_c_doc->dict != __pyx_v_c_result->dict);
109389         if (__pyx_t_6) {
109390
109391           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":577
109392  *                 if input_doc._c_doc.dict is not c_result.dict:
109393  *                     fixThreadDictNames(<xmlNode*>c_result,
109394  *                                        input_doc._c_doc.dict, c_result.dict)             # <<<<<<<<<<<<<<
109395  * 
109396  *         return _xsltResultTreeFactory(result_doc, self, profile_doc)
109397  */
109398           __pyx_f_4lxml_5etree_fixThreadDictNames(((xmlNode *)__pyx_v_c_result), __pyx_v_input_doc->_c_doc->dict, __pyx_v_c_result->dict);
109399           goto __pyx_L37;
109400         }
109401         __pyx_L37:;
109402       }
109403       /*finally:*/ {
109404         Py_BLOCK_THREADS
109405       }
109406     }
109407     goto __pyx_L31;
109408   }
109409   __pyx_L31:;
109410
109411   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":579
109412  *                                        input_doc._c_doc.dict, c_result.dict)
109413  * 
109414  *         return _xsltResultTreeFactory(result_doc, self, profile_doc)             # <<<<<<<<<<<<<<
109415  * 
109416  *     cdef xmlDoc* _run_transform(self, xmlDoc* c_input_doc,
109417  */
109418   __Pyx_XDECREF(__pyx_r);
109419   __pyx_t_8 = __pyx_f_4lxml_5etree__xsltResultTreeFactory(__pyx_v_result_doc, ((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self), __pyx_v_profile_doc); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
109420   __Pyx_GOTREF(__pyx_t_8);
109421   __pyx_r = __pyx_t_8;
109422   __pyx_t_8 = 0;
109423   goto __pyx_L0;
109424
109425   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
109426   goto __pyx_L0;
109427   __pyx_L1_error:;
109428   __Pyx_XDECREF(__pyx_1);
109429   __Pyx_XDECREF(__pyx_t_1);
109430   __Pyx_XDECREF(__pyx_t_7);
109431   __Pyx_XDECREF(__pyx_t_8);
109432   __Pyx_AddTraceback("lxml.etree.XSLT.__call__");
109433   __pyx_r = NULL;
109434   __pyx_L0:;
109435   __Pyx_DECREF(__pyx_v_kw);
109436   __Pyx_DECREF((PyObject *)__pyx_v_context);
109437   __Pyx_DECREF((PyObject *)__pyx_v_resolver_context);
109438   __Pyx_DECREF((PyObject *)__pyx_v_input_doc);
109439   __Pyx_DECREF((PyObject *)__pyx_v_root_node);
109440   __Pyx_DECREF((PyObject *)__pyx_v_result_doc);
109441   __Pyx_DECREF((PyObject *)__pyx_v_profile_doc);
109442   __Pyx_DECREF(__pyx_v_error);
109443   __Pyx_DECREF(__pyx_v_message);
109444   __Pyx_XGIVEREF(__pyx_r);
109445   __Pyx_FinishRefcountContext();
109446   return __pyx_r;
109447 }
109448
109449 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":581
109450  *         return _xsltResultTreeFactory(result_doc, self, profile_doc)
109451  * 
109452  *     cdef xmlDoc* _run_transform(self, xmlDoc* c_input_doc,             # <<<<<<<<<<<<<<
109453  *                                 dict parameters, _XSLTContext context,
109454  *                                 xslt.xsltTransformContext* transform_ctxt):
109455  */
109456
109457 static  xmlDoc *__pyx_f_4lxml_5etree_4XSLT__run_transform(struct __pyx_obj_4lxml_5etree_XSLT *__pyx_v_self, xmlDoc *__pyx_v_c_input_doc, PyObject *__pyx_v_parameters, struct __pyx_obj_4lxml_5etree__XSLTContext *__pyx_v_context, xsltTransformContext *__pyx_v_transform_ctxt) {
109458   xmlDoc *__pyx_v_c_result;
109459   char **__pyx_v_params;
109460   Py_ssize_t __pyx_v_i;
109461   Py_ssize_t __pyx_v_parameter_count;
109462   PyObject *__pyx_v_keep_ref;
109463   PyObject *__pyx_v_key;
109464   PyObject *__pyx_v_value;
109465   PyObject *__pyx_v_k;
109466   PyObject *__pyx_v_v;
109467   xmlDoc *__pyx_r;
109468   PyObject *__pyx_1 = 0;
109469   PyObject *__pyx_2 = 0;
109470   PyObject *__pyx_3 = 0;
109471   int __pyx_t_1;
109472   Py_ssize_t __pyx_t_2;
109473   PyObject *__pyx_t_3 = NULL;
109474   void *__pyx_t_4;
109475   void *__pyx_t_5;
109476   PyObject *__pyx_t_6 = NULL;
109477   int __pyx_t_7;
109478   PyObject *__pyx_t_8 = NULL;
109479   __Pyx_SetupRefcountContext("_run_transform");
109480   __pyx_v_keep_ref = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
109481   __pyx_v_key = Py_None; __Pyx_INCREF(Py_None);
109482   __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);
109483   __pyx_v_k = Py_None; __Pyx_INCREF(Py_None);
109484   __pyx_v_v = Py_None; __Pyx_INCREF(Py_None);
109485
109486   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":590
109487  * 
109488  *         xslt.xsltSetTransformErrorFunc(transform_ctxt, <void*>self._error_log,
109489  *                                        _receiveXSLTError)             # <<<<<<<<<<<<<<
109490  * 
109491  *         if self._access_control is not None:
109492  */
109493   xsltSetTransformErrorFunc(__pyx_v_transform_ctxt, ((void *)__pyx_v_self->_error_log), __pyx_f_4lxml_5etree__receiveXSLTError);
109494
109495   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":592
109496  *                                        _receiveXSLTError)
109497  * 
109498  *         if self._access_control is not None:             # <<<<<<<<<<<<<<
109499  *             self._access_control._register_in_context(transform_ctxt)
109500  * 
109501  */
109502   __pyx_t_1 = (((PyObject *)__pyx_v_self->_access_control) != Py_None);
109503   if (__pyx_t_1) {
109504
109505     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":593
109506  * 
109507  *         if self._access_control is not None:
109508  *             self._access_control._register_in_context(transform_ctxt)             # <<<<<<<<<<<<<<
109509  * 
109510  *         parameter_count = len(parameters)
109511  */
109512     ((struct __pyx_vtabstruct_4lxml_5etree_XSLTAccessControl *)__pyx_v_self->_access_control->__pyx_vtab)->_register_in_context(__pyx_v_self->_access_control, __pyx_v_transform_ctxt);
109513     goto __pyx_L3;
109514   }
109515   __pyx_L3:;
109516
109517   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":595
109518  *             self._access_control._register_in_context(transform_ctxt)
109519  * 
109520  *         parameter_count = len(parameters)             # <<<<<<<<<<<<<<
109521  *         if parameter_count > 0:
109522  *             # allocate space for parameters
109523  */
109524   __pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_parameters)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
109525   __pyx_v_parameter_count = __pyx_t_2;
109526
109527   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":596
109528  * 
109529  *         parameter_count = len(parameters)
109530  *         if parameter_count > 0:             # <<<<<<<<<<<<<<
109531  *             # allocate space for parameters
109532  *             # * 2 as we want an entry for both key and value,
109533  */
109534   __pyx_t_1 = (__pyx_v_parameter_count > 0);
109535   if (__pyx_t_1) {
109536
109537     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":601
109538  *             # and + 1 as array is NULL terminated
109539  *             params = <char**>python.PyMem_Malloc(
109540  *                 sizeof(char*) * (parameter_count * 2 + 1))             # <<<<<<<<<<<<<<
109541  *             try:
109542  *                 i = 0
109543  */
109544     __pyx_v_params = ((char **)PyMem_Malloc(((sizeof(char *)) * ((__pyx_v_parameter_count * 2) + 1))));
109545
109546     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":602
109547  *             params = <char**>python.PyMem_Malloc(
109548  *                 sizeof(char*) * (parameter_count * 2 + 1))
109549  *             try:             # <<<<<<<<<<<<<<
109550  *                 i = 0
109551  *                 keep_ref = []
109552  */
109553     {
109554       PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
109555       __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
109556       __Pyx_XGOTREF(__pyx_save_exc_type);
109557       __Pyx_XGOTREF(__pyx_save_exc_value);
109558       __Pyx_XGOTREF(__pyx_save_exc_tb);
109559       /*try:*/ {
109560
109561         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":603
109562  *                 sizeof(char*) * (parameter_count * 2 + 1))
109563  *             try:
109564  *                 i = 0             # <<<<<<<<<<<<<<
109565  *                 keep_ref = []
109566  *                 for key, value in parameters.iteritems():
109567  */
109568         __pyx_v_i = 0;
109569
109570         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":604
109571  *             try:
109572  *                 i = 0
109573  *                 keep_ref = []             # <<<<<<<<<<<<<<
109574  *                 for key, value in parameters.iteritems():
109575  *                     k = _utf8(key)
109576  */
109577         __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
109578         __Pyx_GOTREF(((PyObject *)__pyx_t_3));
109579         __Pyx_DECREF(((PyObject *)__pyx_v_keep_ref));
109580         __pyx_v_keep_ref = __pyx_t_3;
109581         __pyx_t_3 = 0;
109582
109583         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":605
109584  *                 i = 0
109585  *                 keep_ref = []
109586  *                 for key, value in parameters.iteritems():             # <<<<<<<<<<<<<<
109587  *                     k = _utf8(key)
109588  *                     if isinstance(value, _XSLTQuotedStringParam):
109589  */
109590         __Pyx_INCREF(((PyObject *)__pyx_v_parameters));
109591         __Pyx_XDECREF(__pyx_t_3);
109592         __pyx_t_3 = ((PyObject *)__pyx_v_parameters);
109593         __pyx_t_2 = 0;
109594         while (1) {
109595           if (!PyDict_Next(__pyx_t_3, (&__pyx_t_2), ((PyObject **)(&__pyx_t_4)), ((PyObject **)(&__pyx_t_5)))) break;
109596           __Pyx_INCREF(((PyObject *)__pyx_t_4));
109597           __Pyx_DECREF(__pyx_v_key);
109598           __pyx_v_key = ((PyObject *)__pyx_t_4);
109599           __Pyx_INCREF(((PyObject *)__pyx_t_5));
109600           __Pyx_DECREF(__pyx_v_value);
109601           __pyx_v_value = ((PyObject *)__pyx_t_5);
109602
109603           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":606
109604  *                 keep_ref = []
109605  *                 for key, value in parameters.iteritems():
109606  *                     k = _utf8(key)             # <<<<<<<<<<<<<<
109607  *                     if isinstance(value, _XSLTQuotedStringParam):
109608  *                         v = (<_XSLTQuotedStringParam>value).strval
109609  */
109610           __pyx_t_6 = __pyx_f_4lxml_5etree__utf8(__pyx_v_key); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
109611           __Pyx_GOTREF(__pyx_t_6);
109612           __Pyx_DECREF(__pyx_v_k);
109613           __pyx_v_k = __pyx_t_6;
109614           __pyx_t_6 = 0;
109615
109616           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":607
109617  *                 for key, value in parameters.iteritems():
109618  *                     k = _utf8(key)
109619  *                     if isinstance(value, _XSLTQuotedStringParam):             # <<<<<<<<<<<<<<
109620  *                         v = (<_XSLTQuotedStringParam>value).strval
109621  *                         xslt.xsltQuoteOneUserParam(
109622  */
109623           __pyx_t_1 = PyObject_TypeCheck(__pyx_v_value, ((PyTypeObject *)((PyObject*)__pyx_ptype_4lxml_5etree__XSLTQuotedStringParam))); 
109624           if (__pyx_t_1) {
109625
109626             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":608
109627  *                     k = _utf8(key)
109628  *                     if isinstance(value, _XSLTQuotedStringParam):
109629  *                         v = (<_XSLTQuotedStringParam>value).strval             # <<<<<<<<<<<<<<
109630  *                         xslt.xsltQuoteOneUserParam(
109631  *                             transform_ctxt, _cstr(k), _cstr(v))
109632  */
109633             __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__XSLTQuotedStringParam *)__pyx_v_value)->strval));
109634             __Pyx_DECREF(__pyx_v_v);
109635             __pyx_v_v = ((PyObject *)((struct __pyx_obj_4lxml_5etree__XSLTQuotedStringParam *)__pyx_v_value)->strval);
109636
109637             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":610
109638  *                         v = (<_XSLTQuotedStringParam>value).strval
109639  *                         xslt.xsltQuoteOneUserParam(
109640  *                             transform_ctxt, _cstr(k), _cstr(v))             # <<<<<<<<<<<<<<
109641  *                     else:
109642  *                         v = _utf8(value)
109643  */
109644             xsltQuoteOneUserParam(__pyx_v_transform_ctxt, PyString_AS_STRING(__pyx_v_k), PyString_AS_STRING(__pyx_v_v));
109645             goto __pyx_L15;
109646           }
109647           /*else*/ {
109648
109649             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":612
109650  *                             transform_ctxt, _cstr(k), _cstr(v))
109651  *                     else:
109652  *                         v = _utf8(value)             # <<<<<<<<<<<<<<
109653  *                         params[i] = _cstr(k)
109654  *                         i += 1
109655  */
109656             __pyx_t_6 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
109657             __Pyx_GOTREF(__pyx_t_6);
109658             __Pyx_DECREF(__pyx_v_v);
109659             __pyx_v_v = __pyx_t_6;
109660             __pyx_t_6 = 0;
109661
109662             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":613
109663  *                     else:
109664  *                         v = _utf8(value)
109665  *                         params[i] = _cstr(k)             # <<<<<<<<<<<<<<
109666  *                         i += 1
109667  *                         params[i] = _cstr(v)
109668  */
109669             (__pyx_v_params[__pyx_v_i]) = PyString_AS_STRING(__pyx_v_k);
109670
109671             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":614
109672  *                         v = _utf8(value)
109673  *                         params[i] = _cstr(k)
109674  *                         i += 1             # <<<<<<<<<<<<<<
109675  *                         params[i] = _cstr(v)
109676  *                         i += 1
109677  */
109678             __pyx_v_i += 1;
109679
109680             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":615
109681  *                         params[i] = _cstr(k)
109682  *                         i += 1
109683  *                         params[i] = _cstr(v)             # <<<<<<<<<<<<<<
109684  *                         i += 1
109685  *                     keep_ref.append(k)
109686  */
109687             (__pyx_v_params[__pyx_v_i]) = PyString_AS_STRING(__pyx_v_v);
109688
109689             /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":616
109690  *                         i += 1
109691  *                         params[i] = _cstr(v)
109692  *                         i += 1             # <<<<<<<<<<<<<<
109693  *                     keep_ref.append(k)
109694  *                     keep_ref.append(v)
109695  */
109696             __pyx_v_i += 1;
109697           }
109698           __pyx_L15:;
109699
109700           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":617
109701  *                         params[i] = _cstr(v)
109702  *                         i += 1
109703  *                     keep_ref.append(k)             # <<<<<<<<<<<<<<
109704  *                     keep_ref.append(v)
109705  *             except:
109706  */
109707           __pyx_t_7 = PyList_Append(((PyObject *)__pyx_v_keep_ref), __pyx_v_k); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
109708
109709           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":618
109710  *                         i += 1
109711  *                     keep_ref.append(k)
109712  *                     keep_ref.append(v)             # <<<<<<<<<<<<<<
109713  *             except:
109714  *                 python.PyMem_Free(params)
109715  */
109716           __pyx_t_7 = PyList_Append(((PyObject *)__pyx_v_keep_ref), __pyx_v_v); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
109717         }
109718         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
109719       }
109720       __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
109721       __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
109722       __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
109723       goto __pyx_L12_try_end;
109724       __pyx_L5_error:;
109725       __Pyx_XDECREF(__pyx_1); __pyx_1 = 0;
109726       __Pyx_XDECREF(__pyx_2); __pyx_2 = 0;
109727       __Pyx_XDECREF(__pyx_3); __pyx_3 = 0;
109728       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
109729       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
109730
109731       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":619
109732  *                     keep_ref.append(k)
109733  *                     keep_ref.append(v)
109734  *             except:             # <<<<<<<<<<<<<<
109735  *                 python.PyMem_Free(params)
109736  *                 raise
109737  */
109738       /*except:*/ {
109739         __Pyx_AddTraceback("lxml.etree._run_transform");
109740         if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_6, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
109741         __Pyx_GOTREF(__pyx_t_3);
109742         __Pyx_GOTREF(__pyx_t_6);
109743         __Pyx_GOTREF(__pyx_t_8);
109744
109745         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":620
109746  *                     keep_ref.append(v)
109747  *             except:
109748  *                 python.PyMem_Free(params)             # <<<<<<<<<<<<<<
109749  *                 raise
109750  *             params[i] = NULL
109751  */
109752         PyMem_Free(__pyx_v_params);
109753
109754         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":621
109755  *             except:
109756  *                 python.PyMem_Free(params)
109757  *                 raise             # <<<<<<<<<<<<<<
109758  *             params[i] = NULL
109759  *         else:
109760  */
109761         __Pyx_Raise(__pyx_t_3, __pyx_t_6, __pyx_t_8);
109762         {__pyx_filename = __pyx_f[18]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
109763         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
109764         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
109765         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
109766         goto __pyx_L6_exception_handled;
109767       }
109768       __pyx_L7_except_error:;
109769       __Pyx_XDECREF(__pyx_save_exc_type);
109770       __Pyx_XDECREF(__pyx_save_exc_value);
109771       __Pyx_XDECREF(__pyx_save_exc_tb);
109772       goto __pyx_L1_error;
109773       __pyx_L6_exception_handled:;
109774       __Pyx_XGIVEREF(__pyx_save_exc_type);
109775       __Pyx_XGIVEREF(__pyx_save_exc_value);
109776       __Pyx_XGIVEREF(__pyx_save_exc_tb);
109777       __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
109778       __pyx_L12_try_end:;
109779     }
109780
109781     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":622
109782  *                 python.PyMem_Free(params)
109783  *                 raise
109784  *             params[i] = NULL             # <<<<<<<<<<<<<<
109785  *         else:
109786  *             params = NULL
109787  */
109788     (__pyx_v_params[__pyx_v_i]) = NULL;
109789     goto __pyx_L4;
109790   }
109791   /*else*/ {
109792
109793     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":624
109794  *             params[i] = NULL
109795  *         else:
109796  *             params = NULL             # <<<<<<<<<<<<<<
109797  * 
109798  *         with nogil:
109799  */
109800     __pyx_v_params = NULL;
109801   }
109802   __pyx_L4:;
109803
109804   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":626
109805  *             params = NULL
109806  * 
109807  *         with nogil:             # <<<<<<<<<<<<<<
109808  *             c_result = xslt.xsltApplyStylesheetUser(
109809  *                 self._c_style, c_input_doc, params, NULL, NULL, transform_ctxt)
109810  */
109811   { PyThreadState *_save;
109812     Py_UNBLOCK_THREADS
109813     /*try:*/ {
109814
109815       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":628
109816  *         with nogil:
109817  *             c_result = xslt.xsltApplyStylesheetUser(
109818  *                 self._c_style, c_input_doc, params, NULL, NULL, transform_ctxt)             # <<<<<<<<<<<<<<
109819  * 
109820  *         if params is not NULL:
109821  */
109822       __pyx_v_c_result = xsltApplyStylesheetUser(__pyx_v_self->_c_style, __pyx_v_c_input_doc, __pyx_v_params, NULL, NULL, __pyx_v_transform_ctxt);
109823     }
109824     /*finally:*/ {
109825       Py_BLOCK_THREADS
109826     }
109827   }
109828
109829   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":630
109830  *                 self._c_style, c_input_doc, params, NULL, NULL, transform_ctxt)
109831  * 
109832  *         if params is not NULL:             # <<<<<<<<<<<<<<
109833  *             # deallocate space for parameters
109834  *             python.PyMem_Free(params)
109835  */
109836   __pyx_t_1 = (__pyx_v_params != NULL);
109837   if (__pyx_t_1) {
109838
109839     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":632
109840  *         if params is not NULL:
109841  *             # deallocate space for parameters
109842  *             python.PyMem_Free(params)             # <<<<<<<<<<<<<<
109843  * 
109844  *         return c_result
109845  */
109846     PyMem_Free(__pyx_v_params);
109847     goto __pyx_L21;
109848   }
109849   __pyx_L21:;
109850
109851   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":634
109852  *             python.PyMem_Free(params)
109853  * 
109854  *         return c_result             # <<<<<<<<<<<<<<
109855  * 
109856  * cdef extern from "etree_defs.h":
109857  */
109858   __pyx_r = __pyx_v_c_result;
109859   goto __pyx_L0;
109860
109861   __pyx_r = 0;
109862   goto __pyx_L0;
109863   __pyx_L1_error:;
109864   __Pyx_XDECREF(__pyx_1);
109865   __Pyx_XDECREF(__pyx_2);
109866   __Pyx_XDECREF(__pyx_3);
109867   __Pyx_XDECREF(__pyx_t_3);
109868   __Pyx_XDECREF(__pyx_t_6);
109869   __Pyx_XDECREF(__pyx_t_8);
109870   __Pyx_WriteUnraisable("lxml.etree.XSLT._run_transform");
109871   __pyx_r = 0;
109872   __pyx_L0:;
109873   __Pyx_DECREF(__pyx_v_keep_ref);
109874   __Pyx_DECREF(__pyx_v_key);
109875   __Pyx_DECREF(__pyx_v_value);
109876   __Pyx_DECREF(__pyx_v_k);
109877   __Pyx_DECREF(__pyx_v_v);
109878   __Pyx_FinishRefcountContext();
109879   return __pyx_r;
109880 }
109881
109882 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":640
109883  *     cdef XSLT NEW_XSLT "PY_NEW" (object t)
109884  * 
109885  * cdef XSLT _copyXSLT(XSLT stylesheet):             # <<<<<<<<<<<<<<
109886  *     cdef XSLT new_xslt
109887  *     cdef xmlDoc* c_doc
109888  */
109889
109890 static  struct __pyx_obj_4lxml_5etree_XSLT *__pyx_f_4lxml_5etree__copyXSLT(struct __pyx_obj_4lxml_5etree_XSLT *__pyx_v_stylesheet) {
109891   struct __pyx_obj_4lxml_5etree_XSLT *__pyx_v_new_xslt;
109892   xmlDoc *__pyx_v_c_doc;
109893   struct __pyx_obj_4lxml_5etree_XSLT *__pyx_r = NULL;
109894   PyObject *__pyx_t_1 = NULL;
109895   xmlDoc *__pyx_t_2;
109896   int __pyx_t_3;
109897   __Pyx_SetupRefcountContext("_copyXSLT");
109898   __pyx_v_new_xslt = ((struct __pyx_obj_4lxml_5etree_XSLT *)Py_None); __Pyx_INCREF(Py_None);
109899
109900   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":643
109901  *     cdef XSLT new_xslt
109902  *     cdef xmlDoc* c_doc
109903  *     new_xslt = NEW_XSLT(XSLT) # without calling __init__()             # <<<<<<<<<<<<<<
109904  *     new_xslt._access_control = stylesheet._access_control
109905  *     new_xslt._error_log = _ErrorLog()
109906  */
109907   __pyx_t_1 = ((PyObject *)PY_NEW(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_XSLT)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
109908   __Pyx_GOTREF(__pyx_t_1);
109909   __Pyx_DECREF(((PyObject *)__pyx_v_new_xslt));
109910   __pyx_v_new_xslt = ((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_t_1);
109911   __pyx_t_1 = 0;
109912
109913   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":644
109914  *     cdef xmlDoc* c_doc
109915  *     new_xslt = NEW_XSLT(XSLT) # without calling __init__()
109916  *     new_xslt._access_control = stylesheet._access_control             # <<<<<<<<<<<<<<
109917  *     new_xslt._error_log = _ErrorLog()
109918  *     new_xslt._context = stylesheet._context._copy()
109919  */
109920   __Pyx_INCREF(((PyObject *)__pyx_v_stylesheet->_access_control));
109921   __Pyx_GIVEREF(((PyObject *)__pyx_v_stylesheet->_access_control));
109922   __Pyx_GOTREF(__pyx_v_new_xslt->_access_control);
109923   __Pyx_DECREF(((PyObject *)__pyx_v_new_xslt->_access_control));
109924   __pyx_v_new_xslt->_access_control = __pyx_v_stylesheet->_access_control;
109925
109926   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":645
109927  *     new_xslt = NEW_XSLT(XSLT) # without calling __init__()
109928  *     new_xslt._access_control = stylesheet._access_control
109929  *     new_xslt._error_log = _ErrorLog()             # <<<<<<<<<<<<<<
109930  *     new_xslt._context = stylesheet._context._copy()
109931  * 
109932  */
109933   __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ErrorLog)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
109934   __Pyx_GOTREF(__pyx_t_1);
109935   if (!(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__ErrorLog))) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
109936   __Pyx_GIVEREF(__pyx_t_1);
109937   __Pyx_GOTREF(__pyx_v_new_xslt->_error_log);
109938   __Pyx_DECREF(((PyObject *)__pyx_v_new_xslt->_error_log));
109939   __pyx_v_new_xslt->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_t_1);
109940   __pyx_t_1 = 0;
109941
109942   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":646
109943  *     new_xslt._access_control = stylesheet._access_control
109944  *     new_xslt._error_log = _ErrorLog()
109945  *     new_xslt._context = stylesheet._context._copy()             # <<<<<<<<<<<<<<
109946  * 
109947  *     new_xslt._xslt_resolver_context = stylesheet._xslt_resolver_context._copy()
109948  */
109949   __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__XSLTContext *)__pyx_v_stylesheet->_context->__pyx_base.__pyx_vtab)->__pyx_base._copy(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_stylesheet->_context))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
109950   __Pyx_GOTREF(__pyx_t_1);
109951   if (!(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__XSLTContext))) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
109952   __Pyx_GIVEREF(__pyx_t_1);
109953   __Pyx_GOTREF(__pyx_v_new_xslt->_context);
109954   __Pyx_DECREF(((PyObject *)__pyx_v_new_xslt->_context));
109955   __pyx_v_new_xslt->_context = ((struct __pyx_obj_4lxml_5etree__XSLTContext *)__pyx_t_1);
109956   __pyx_t_1 = 0;
109957
109958   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":648
109959  *     new_xslt._context = stylesheet._context._copy()
109960  * 
109961  *     new_xslt._xslt_resolver_context = stylesheet._xslt_resolver_context._copy()             # <<<<<<<<<<<<<<
109962  *     new_xslt._xslt_resolver_context._c_style_doc = _copyDoc(
109963  *         stylesheet._xslt_resolver_context._c_style_doc, 1)
109964  */
109965   __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *)__pyx_v_stylesheet->_xslt_resolver_context->__pyx_base.__pyx_base.__pyx_vtab)->_copy(__pyx_v_stylesheet->_xslt_resolver_context)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
109966   __Pyx_GOTREF(__pyx_t_1);
109967   __Pyx_GIVEREF(__pyx_t_1);
109968   __Pyx_GOTREF(__pyx_v_new_xslt->_xslt_resolver_context);
109969   __Pyx_DECREF(((PyObject *)__pyx_v_new_xslt->_xslt_resolver_context));
109970   __pyx_v_new_xslt->_xslt_resolver_context = ((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)__pyx_t_1);
109971   __pyx_t_1 = 0;
109972
109973   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":650
109974  *     new_xslt._xslt_resolver_context = stylesheet._xslt_resolver_context._copy()
109975  *     new_xslt._xslt_resolver_context._c_style_doc = _copyDoc(
109976  *         stylesheet._xslt_resolver_context._c_style_doc, 1)             # <<<<<<<<<<<<<<
109977  * 
109978  *     c_doc = _copyDoc(stylesheet._c_style.doc, 1)
109979  */
109980   __pyx_t_2 = __pyx_f_4lxml_5etree__copyDoc(__pyx_v_stylesheet->_xslt_resolver_context->_c_style_doc, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
109981
109982   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":649
109983  * 
109984  *     new_xslt._xslt_resolver_context = stylesheet._xslt_resolver_context._copy()
109985  *     new_xslt._xslt_resolver_context._c_style_doc = _copyDoc(             # <<<<<<<<<<<<<<
109986  *         stylesheet._xslt_resolver_context._c_style_doc, 1)
109987  * 
109988  */
109989   __pyx_v_new_xslt->_xslt_resolver_context->_c_style_doc = __pyx_t_2;
109990
109991   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":652
109992  *         stylesheet._xslt_resolver_context._c_style_doc, 1)
109993  * 
109994  *     c_doc = _copyDoc(stylesheet._c_style.doc, 1)             # <<<<<<<<<<<<<<
109995  *     new_xslt._c_style = xslt.xsltParseStylesheetDoc(c_doc)
109996  *     if new_xslt._c_style is NULL:
109997  */
109998   __pyx_t_2 = __pyx_f_4lxml_5etree__copyDoc(__pyx_v_stylesheet->_c_style->doc, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
109999   __pyx_v_c_doc = __pyx_t_2;
110000
110001   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":653
110002  * 
110003  *     c_doc = _copyDoc(stylesheet._c_style.doc, 1)
110004  *     new_xslt._c_style = xslt.xsltParseStylesheetDoc(c_doc)             # <<<<<<<<<<<<<<
110005  *     if new_xslt._c_style is NULL:
110006  *         tree.xmlFreeDoc(c_doc)
110007  */
110008   __pyx_v_new_xslt->_c_style = xsltParseStylesheetDoc(__pyx_v_c_doc);
110009
110010   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":654
110011  *     c_doc = _copyDoc(stylesheet._c_style.doc, 1)
110012  *     new_xslt._c_style = xslt.xsltParseStylesheetDoc(c_doc)
110013  *     if new_xslt._c_style is NULL:             # <<<<<<<<<<<<<<
110014  *         tree.xmlFreeDoc(c_doc)
110015  *         python.PyErr_NoMemory()
110016  */
110017   __pyx_t_3 = (__pyx_v_new_xslt->_c_style == NULL);
110018   if (__pyx_t_3) {
110019
110020     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":655
110021  *     new_xslt._c_style = xslt.xsltParseStylesheetDoc(c_doc)
110022  *     if new_xslt._c_style is NULL:
110023  *         tree.xmlFreeDoc(c_doc)             # <<<<<<<<<<<<<<
110024  *         python.PyErr_NoMemory()
110025  * 
110026  */
110027     xmlFreeDoc(__pyx_v_c_doc);
110028
110029     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":656
110030  *     if new_xslt._c_style is NULL:
110031  *         tree.xmlFreeDoc(c_doc)
110032  *         python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
110033  * 
110034  *     return new_xslt
110035  */
110036     __pyx_t_1 = PyErr_NoMemory(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
110037     __Pyx_GOTREF(__pyx_t_1);
110038     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
110039     goto __pyx_L3;
110040   }
110041   __pyx_L3:;
110042
110043   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":658
110044  *         python.PyErr_NoMemory()
110045  * 
110046  *     return new_xslt             # <<<<<<<<<<<<<<
110047  * 
110048  * cdef class _XSLTResultTree(_ElementTree):
110049  */
110050   __Pyx_XDECREF(((PyObject *)__pyx_r));
110051   __Pyx_INCREF(((PyObject *)__pyx_v_new_xslt));
110052   __pyx_r = __pyx_v_new_xslt;
110053   goto __pyx_L0;
110054
110055   __pyx_r = ((struct __pyx_obj_4lxml_5etree_XSLT *)Py_None); __Pyx_INCREF(Py_None);
110056   goto __pyx_L0;
110057   __pyx_L1_error:;
110058   __Pyx_XDECREF(__pyx_t_1);
110059   __Pyx_AddTraceback("lxml.etree._copyXSLT");
110060   __pyx_r = 0;
110061   __pyx_L0:;
110062   __Pyx_DECREF((PyObject *)__pyx_v_new_xslt);
110063   __Pyx_XGIVEREF((PyObject *)__pyx_r);
110064   __Pyx_FinishRefcountContext();
110065   return __pyx_r;
110066 }
110067
110068 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":666
110069  *     cdef Py_ssize_t _buffer_len
110070  *     cdef Py_ssize_t _buffer_refcnt
110071  *     cdef _saveToStringAndSize(self, char** s, int* l):             # <<<<<<<<<<<<<<
110072  *         cdef _Document doc
110073  *         cdef int r
110074  */
110075
110076 static  PyObject *__pyx_f_4lxml_5etree_15_XSLTResultTree__saveToStringAndSize(struct __pyx_obj_4lxml_5etree__XSLTResultTree *__pyx_v_self, char **__pyx_v_s, int *__pyx_v_l) {
110077   struct LxmlDocument *__pyx_v_doc;
110078   int __pyx_v_r;
110079   PyObject *__pyx_r = NULL;
110080   int __pyx_t_1;
110081   PyObject *__pyx_t_2 = NULL;
110082   __Pyx_SetupRefcountContext("_saveToStringAndSize");
110083   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
110084
110085   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":669
110086  *         cdef _Document doc
110087  *         cdef int r
110088  *         if self._context_node is not None:             # <<<<<<<<<<<<<<
110089  *             doc = self._context_node._doc
110090  *         if doc is None:
110091  */
110092   __pyx_t_1 = (((PyObject *)__pyx_v_self->__pyx_base._context_node) != Py_None);
110093   if (__pyx_t_1) {
110094
110095     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":670
110096  *         cdef int r
110097  *         if self._context_node is not None:
110098  *             doc = self._context_node._doc             # <<<<<<<<<<<<<<
110099  *         if doc is None:
110100  *             doc = self._doc
110101  */
110102     __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base._context_node->_doc));
110103     __Pyx_DECREF(((PyObject *)__pyx_v_doc));
110104     __pyx_v_doc = __pyx_v_self->__pyx_base._context_node->_doc;
110105     goto __pyx_L3;
110106   }
110107   __pyx_L3:;
110108
110109   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":671
110110  *         if self._context_node is not None:
110111  *             doc = self._context_node._doc
110112  *         if doc is None:             # <<<<<<<<<<<<<<
110113  *             doc = self._doc
110114  *             if doc is None:
110115  */
110116   __pyx_t_1 = (((PyObject *)__pyx_v_doc) == Py_None);
110117   if (__pyx_t_1) {
110118
110119     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":672
110120  *             doc = self._context_node._doc
110121  *         if doc is None:
110122  *             doc = self._doc             # <<<<<<<<<<<<<<
110123  *             if doc is None:
110124  *                 s[0] = NULL
110125  */
110126     __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base._doc));
110127     __Pyx_DECREF(((PyObject *)__pyx_v_doc));
110128     __pyx_v_doc = __pyx_v_self->__pyx_base._doc;
110129
110130     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":673
110131  *         if doc is None:
110132  *             doc = self._doc
110133  *             if doc is None:             # <<<<<<<<<<<<<<
110134  *                 s[0] = NULL
110135  *                 return
110136  */
110137     __pyx_t_1 = (((PyObject *)__pyx_v_doc) == Py_None);
110138     if (__pyx_t_1) {
110139
110140       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":674
110141  *             doc = self._doc
110142  *             if doc is None:
110143  *                 s[0] = NULL             # <<<<<<<<<<<<<<
110144  *                 return
110145  *         with nogil:
110146  */
110147       (__pyx_v_s[0]) = NULL;
110148
110149       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":675
110150  *             if doc is None:
110151  *                 s[0] = NULL
110152  *                 return             # <<<<<<<<<<<<<<
110153  *         with nogil:
110154  *             r = xslt.xsltSaveResultToString(s, l, doc._c_doc,
110155  */
110156       __Pyx_XDECREF(__pyx_r);
110157       __pyx_r = Py_None; __Pyx_INCREF(Py_None);
110158       goto __pyx_L0;
110159       goto __pyx_L5;
110160     }
110161     __pyx_L5:;
110162     goto __pyx_L4;
110163   }
110164   __pyx_L4:;
110165
110166   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":676
110167  *                 s[0] = NULL
110168  *                 return
110169  *         with nogil:             # <<<<<<<<<<<<<<
110170  *             r = xslt.xsltSaveResultToString(s, l, doc._c_doc,
110171  *                                             self._xslt._c_style)
110172  */
110173   { PyThreadState *_save;
110174     Py_UNBLOCK_THREADS
110175     /*try:*/ {
110176
110177       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":678
110178  *         with nogil:
110179  *             r = xslt.xsltSaveResultToString(s, l, doc._c_doc,
110180  *                                             self._xslt._c_style)             # <<<<<<<<<<<<<<
110181  *         if r == -1:
110182  *             python.PyErr_NoMemory()
110183  */
110184       __pyx_v_r = xsltSaveResultToString(__pyx_v_s, __pyx_v_l, __pyx_v_doc->_c_doc, __pyx_v_self->_xslt->_c_style);
110185     }
110186     /*finally:*/ {
110187       Py_BLOCK_THREADS
110188     }
110189   }
110190
110191   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":679
110192  *             r = xslt.xsltSaveResultToString(s, l, doc._c_doc,
110193  *                                             self._xslt._c_style)
110194  *         if r == -1:             # <<<<<<<<<<<<<<
110195  *             python.PyErr_NoMemory()
110196  * 
110197  */
110198   __pyx_t_1 = (__pyx_v_r == -1);
110199   if (__pyx_t_1) {
110200
110201     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":680
110202  *                                             self._xslt._c_style)
110203  *         if r == -1:
110204  *             python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
110205  * 
110206  *     def __str__(self):
110207  */
110208     __pyx_t_2 = PyErr_NoMemory(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
110209     __Pyx_GOTREF(__pyx_t_2);
110210     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
110211     goto __pyx_L9;
110212   }
110213   __pyx_L9:;
110214
110215   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
110216   goto __pyx_L0;
110217   __pyx_L1_error:;
110218   __Pyx_XDECREF(__pyx_t_2);
110219   __Pyx_AddTraceback("lxml.etree._XSLTResultTree._saveToStringAndSize");
110220   __pyx_r = 0;
110221   __pyx_L0:;
110222   __Pyx_DECREF((PyObject *)__pyx_v_doc);
110223   __Pyx_XGIVEREF(__pyx_r);
110224   __Pyx_FinishRefcountContext();
110225   return __pyx_r;
110226 }
110227
110228 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":682
110229  *             python.PyErr_NoMemory()
110230  * 
110231  *     def __str__(self):             # <<<<<<<<<<<<<<
110232  *         cdef char* s
110233  *         cdef int l
110234  */
110235
110236 static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree___str__(PyObject *__pyx_v_self); /*proto*/
110237 static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree___str__(PyObject *__pyx_v_self) {
110238   char *__pyx_v_s;
110239   int __pyx_v_l;
110240   PyObject *__pyx_v_result;
110241   PyObject *__pyx_r = NULL;
110242   int __pyx_t_1;
110243   PyObject *__pyx_t_2 = NULL;
110244   PyObject *__pyx_t_3 = NULL;
110245   __Pyx_SetupRefcountContext("__str__");
110246   __pyx_v_result = Py_None; __Pyx_INCREF(Py_None);
110247
110248   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":685
110249  *         cdef char* s
110250  *         cdef int l
110251  *         if python.IS_PYTHON3:             # <<<<<<<<<<<<<<
110252  *             return self.__unicode__()
110253  *         self._saveToStringAndSize(&s, &l)
110254  */
110255   __pyx_t_1 = IS_PYTHON3;
110256   if (__pyx_t_1) {
110257
110258     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":686
110259  *         cdef int l
110260  *         if python.IS_PYTHON3:
110261  *             return self.__unicode__()             # <<<<<<<<<<<<<<
110262  *         self._saveToStringAndSize(&s, &l)
110263  *         if s is NULL:
110264  */
110265     __Pyx_XDECREF(__pyx_r);
110266     __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp___unicode__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
110267     __Pyx_GOTREF(__pyx_t_2);
110268     __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
110269     __Pyx_GOTREF(__pyx_t_3);
110270     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
110271     __pyx_r = __pyx_t_3;
110272     __pyx_t_3 = 0;
110273     goto __pyx_L0;
110274     goto __pyx_L5;
110275   }
110276   __pyx_L5:;
110277
110278   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":687
110279  *         if python.IS_PYTHON3:
110280  *             return self.__unicode__()
110281  *         self._saveToStringAndSize(&s, &l)             # <<<<<<<<<<<<<<
110282  *         if s is NULL:
110283  *             return ''
110284  */
110285   __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTResultTree *)((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->__pyx_base.__pyx_vtab)->_saveToStringAndSize(((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self), (&__pyx_v_s), (&__pyx_v_l)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
110286   __Pyx_GOTREF(__pyx_t_3);
110287   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
110288
110289   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":688
110290  *             return self.__unicode__()
110291  *         self._saveToStringAndSize(&s, &l)
110292  *         if s is NULL:             # <<<<<<<<<<<<<<
110293  *             return ''
110294  *         # we must not use 'funicode' here as this is not always UTF-8
110295  */
110296   __pyx_t_1 = (__pyx_v_s == NULL);
110297   if (__pyx_t_1) {
110298
110299     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":689
110300  *         self._saveToStringAndSize(&s, &l)
110301  *         if s is NULL:
110302  *             return ''             # <<<<<<<<<<<<<<
110303  *         # we must not use 'funicode' here as this is not always UTF-8
110304  *         try:
110305  */
110306     __Pyx_XDECREF(__pyx_r);
110307     __Pyx_INCREF(__pyx_kp_622);
110308     __pyx_r = __pyx_kp_622;
110309     goto __pyx_L0;
110310     goto __pyx_L6;
110311   }
110312   __pyx_L6:;
110313
110314   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":691
110315  *             return ''
110316  *         # we must not use 'funicode' here as this is not always UTF-8
110317  *         try:             # <<<<<<<<<<<<<<
110318  *             result = python.PyString_FromStringAndSize(s, l)
110319  *         finally:
110320  */
110321   /*try:*/ {
110322
110323     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":692
110324  *         # we must not use 'funicode' here as this is not always UTF-8
110325  *         try:
110326  *             result = python.PyString_FromStringAndSize(s, l)             # <<<<<<<<<<<<<<
110327  *         finally:
110328  *             tree.xmlFree(s)
110329  */
110330     __pyx_t_3 = PyString_FromStringAndSize(__pyx_v_s, __pyx_v_l); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L8;}
110331     __Pyx_GOTREF(__pyx_t_3);
110332     __Pyx_DECREF(__pyx_v_result);
110333     __pyx_v_result = __pyx_t_3;
110334     __pyx_t_3 = 0;
110335   }
110336   /*finally:*/ {
110337     int __pyx_why;
110338     PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
110339     int __pyx_exc_lineno;
110340     __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
110341     __pyx_why = 0; goto __pyx_L9;
110342     __pyx_L8: {
110343       __pyx_why = 4;
110344       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
110345       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
110346       __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
110347       __pyx_exc_lineno = __pyx_lineno;
110348       goto __pyx_L9;
110349     }
110350     __pyx_L9:;
110351
110352     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":694
110353  *             result = python.PyString_FromStringAndSize(s, l)
110354  *         finally:
110355  *             tree.xmlFree(s)             # <<<<<<<<<<<<<<
110356  *         return result
110357  * 
110358  */
110359     xmlFree(__pyx_v_s);
110360     switch (__pyx_why) {
110361       case 4: {
110362         __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
110363         __pyx_lineno = __pyx_exc_lineno;
110364         __pyx_exc_type = 0;
110365         __pyx_exc_value = 0;
110366         __pyx_exc_tb = 0;
110367         goto __pyx_L1_error;
110368       }
110369     }
110370   }
110371
110372   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":695
110373  *         finally:
110374  *             tree.xmlFree(s)
110375  *         return result             # <<<<<<<<<<<<<<
110376  * 
110377  *     def __unicode__(self):
110378  */
110379   __Pyx_XDECREF(__pyx_r);
110380   __Pyx_INCREF(__pyx_v_result);
110381   __pyx_r = __pyx_v_result;
110382   goto __pyx_L0;
110383
110384   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
110385   goto __pyx_L0;
110386   __pyx_L1_error:;
110387   __Pyx_XDECREF(__pyx_t_2);
110388   __Pyx_XDECREF(__pyx_t_3);
110389   __Pyx_AddTraceback("lxml.etree._XSLTResultTree.__str__");
110390   __pyx_r = NULL;
110391   __pyx_L0:;
110392   __Pyx_DECREF(__pyx_v_result);
110393   __Pyx_XGIVEREF(__pyx_r);
110394   __Pyx_FinishRefcountContext();
110395   return __pyx_r;
110396 }
110397
110398 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":697
110399  *         return result
110400  * 
110401  *     def __unicode__(self):             # <<<<<<<<<<<<<<
110402  *         cdef char* encoding
110403  *         cdef char* s
110404  */
110405
110406 static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree___unicode__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
110407 static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree___unicode__(PyObject *__pyx_v_self, PyObject *unused) {
110408   char *__pyx_v_encoding;
110409   char *__pyx_v_s;
110410   int __pyx_v_l;
110411   PyObject *__pyx_v_result;
110412   PyObject *__pyx_r = NULL;
110413   PyObject *__pyx_t_1 = NULL;
110414   int __pyx_t_2;
110415   __Pyx_SetupRefcountContext("__unicode__");
110416   __pyx_v_result = Py_None; __Pyx_INCREF(Py_None);
110417
110418   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":701
110419  *         cdef char* s
110420  *         cdef int l
110421  *         self._saveToStringAndSize(&s, &l)             # <<<<<<<<<<<<<<
110422  *         if s is NULL:
110423  *             return u''
110424  */
110425   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTResultTree *)((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->__pyx_base.__pyx_vtab)->_saveToStringAndSize(((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self), (&__pyx_v_s), (&__pyx_v_l)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
110426   __Pyx_GOTREF(__pyx_t_1);
110427   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
110428
110429   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":702
110430  *         cdef int l
110431  *         self._saveToStringAndSize(&s, &l)
110432  *         if s is NULL:             # <<<<<<<<<<<<<<
110433  *             return u''
110434  *         encoding = self._xslt._c_style.encoding
110435  */
110436   __pyx_t_2 = (__pyx_v_s == NULL);
110437   if (__pyx_t_2) {
110438
110439     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":703
110440  *         self._saveToStringAndSize(&s, &l)
110441  *         if s is NULL:
110442  *             return u''             # <<<<<<<<<<<<<<
110443  *         encoding = self._xslt._c_style.encoding
110444  *         if encoding is NULL:
110445  */
110446     __Pyx_XDECREF(__pyx_r);
110447     __Pyx_INCREF(((PyObject *)__pyx_kp_623));
110448     __pyx_r = ((PyObject *)__pyx_kp_623);
110449     goto __pyx_L0;
110450     goto __pyx_L5;
110451   }
110452   __pyx_L5:;
110453
110454   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":704
110455  *         if s is NULL:
110456  *             return u''
110457  *         encoding = self._xslt._c_style.encoding             # <<<<<<<<<<<<<<
110458  *         if encoding is NULL:
110459  *             encoding = 'ascii'
110460  */
110461   __pyx_v_encoding = ((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->_xslt->_c_style->encoding;
110462
110463   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":705
110464  *             return u''
110465  *         encoding = self._xslt._c_style.encoding
110466  *         if encoding is NULL:             # <<<<<<<<<<<<<<
110467  *             encoding = 'ascii'
110468  *         try:
110469  */
110470   __pyx_t_2 = (__pyx_v_encoding == NULL);
110471   if (__pyx_t_2) {
110472
110473     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":706
110474  *         encoding = self._xslt._c_style.encoding
110475  *         if encoding is NULL:
110476  *             encoding = 'ascii'             # <<<<<<<<<<<<<<
110477  *         try:
110478  *             result = python.PyUnicode_Decode(s, l, encoding, 'strict')
110479  */
110480     __pyx_v_encoding = __pyx_k_624;
110481     goto __pyx_L6;
110482   }
110483   __pyx_L6:;
110484
110485   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":707
110486  *         if encoding is NULL:
110487  *             encoding = 'ascii'
110488  *         try:             # <<<<<<<<<<<<<<
110489  *             result = python.PyUnicode_Decode(s, l, encoding, 'strict')
110490  *         finally:
110491  */
110492   /*try:*/ {
110493
110494     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":708
110495  *             encoding = 'ascii'
110496  *         try:
110497  *             result = python.PyUnicode_Decode(s, l, encoding, 'strict')             # <<<<<<<<<<<<<<
110498  *         finally:
110499  *             tree.xmlFree(s)
110500  */
110501     __pyx_t_1 = PyUnicode_Decode(__pyx_v_s, __pyx_v_l, __pyx_v_encoding, __pyx_k_625); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L8;}
110502     __Pyx_GOTREF(__pyx_t_1);
110503     __Pyx_DECREF(__pyx_v_result);
110504     __pyx_v_result = __pyx_t_1;
110505     __pyx_t_1 = 0;
110506   }
110507   /*finally:*/ {
110508     int __pyx_why;
110509     PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
110510     int __pyx_exc_lineno;
110511     __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
110512     __pyx_why = 0; goto __pyx_L9;
110513     __pyx_L8: {
110514       __pyx_why = 4;
110515       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
110516       __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
110517       __pyx_exc_lineno = __pyx_lineno;
110518       goto __pyx_L9;
110519     }
110520     __pyx_L9:;
110521
110522     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":710
110523  *             result = python.PyUnicode_Decode(s, l, encoding, 'strict')
110524  *         finally:
110525  *             tree.xmlFree(s)             # <<<<<<<<<<<<<<
110526  *         return _stripEncodingDeclaration(result)
110527  * 
110528  */
110529     xmlFree(__pyx_v_s);
110530     switch (__pyx_why) {
110531       case 4: {
110532         __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
110533         __pyx_lineno = __pyx_exc_lineno;
110534         __pyx_exc_type = 0;
110535         __pyx_exc_value = 0;
110536         __pyx_exc_tb = 0;
110537         goto __pyx_L1_error;
110538       }
110539     }
110540   }
110541
110542   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":711
110543  *         finally:
110544  *             tree.xmlFree(s)
110545  *         return _stripEncodingDeclaration(result)             # <<<<<<<<<<<<<<
110546  * 
110547  *     def __getbuffer__(self, Py_buffer* buffer, int flags):
110548  */
110549   __Pyx_XDECREF(__pyx_r);
110550   __pyx_t_1 = __pyx_f_4lxml_5etree__stripEncodingDeclaration(__pyx_v_result); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
110551   __Pyx_GOTREF(__pyx_t_1);
110552   __pyx_r = __pyx_t_1;
110553   __pyx_t_1 = 0;
110554   goto __pyx_L0;
110555
110556   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
110557   goto __pyx_L0;
110558   __pyx_L1_error:;
110559   __Pyx_XDECREF(__pyx_t_1);
110560   __Pyx_AddTraceback("lxml.etree._XSLTResultTree.__unicode__");
110561   __pyx_r = NULL;
110562   __pyx_L0:;
110563   __Pyx_DECREF(__pyx_v_result);
110564   __Pyx_XGIVEREF(__pyx_r);
110565   __Pyx_FinishRefcountContext();
110566   return __pyx_r;
110567 }
110568
110569 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":713
110570  *         return _stripEncodingDeclaration(result)
110571  * 
110572  *     def __getbuffer__(self, Py_buffer* buffer, int flags):             # <<<<<<<<<<<<<<
110573  *         cdef int l
110574  *         if buffer is NULL:
110575  */
110576
110577 static int __pyx_pf_4lxml_5etree_15_XSLTResultTree___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags); /*proto*/
110578 static int __pyx_pf_4lxml_5etree_15_XSLTResultTree___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags) {
110579   int __pyx_v_l;
110580   int __pyx_r;
110581   int __pyx_t_1;
110582   PyObject *__pyx_t_2 = NULL;
110583   int __pyx_t_3;
110584   __Pyx_SetupRefcountContext("__getbuffer__");
110585   if (__pyx_v_buffer == NULL) return 0;
110586   __pyx_v_buffer->obj = Py_None; __Pyx_INCREF(Py_None);
110587   __Pyx_GIVEREF(__pyx_v_buffer->obj);
110588
110589   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":715
110590  *     def __getbuffer__(self, Py_buffer* buffer, int flags):
110591  *         cdef int l
110592  *         if buffer is NULL:             # <<<<<<<<<<<<<<
110593  *             return # LOCK
110594  *         if self._buffer is NULL or flags & python.PyBUF_WRITABLE:
110595  */
110596   __pyx_t_1 = (__pyx_v_buffer == NULL);
110597   if (__pyx_t_1) {
110598
110599     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":716
110600  *         cdef int l
110601  *         if buffer is NULL:
110602  *             return # LOCK             # <<<<<<<<<<<<<<
110603  *         if self._buffer is NULL or flags & python.PyBUF_WRITABLE:
110604  *             self._saveToStringAndSize(<char**>&buffer.buf, &l)
110605  */
110606     __pyx_r = 0;
110607     goto __pyx_L0;
110608     goto __pyx_L5;
110609   }
110610   __pyx_L5:;
110611
110612   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":717
110613  *         if buffer is NULL:
110614  *             return # LOCK
110615  *         if self._buffer is NULL or flags & python.PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
110616  *             self._saveToStringAndSize(<char**>&buffer.buf, &l)
110617  *             buffer.len = l
110618  */
110619   if (!(((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->_buffer == NULL)) {
110620     __pyx_t_1 = (__pyx_v_flags & PyBUF_WRITABLE);
110621   } else {
110622     __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->_buffer == NULL);
110623   }
110624   if (__pyx_t_1) {
110625
110626     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":718
110627  *             return # LOCK
110628  *         if self._buffer is NULL or flags & python.PyBUF_WRITABLE:
110629  *             self._saveToStringAndSize(<char**>&buffer.buf, &l)             # <<<<<<<<<<<<<<
110630  *             buffer.len = l
110631  *             if self._buffer is NULL and not flags & python.PyBUF_WRITABLE:
110632  */
110633     __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTResultTree *)((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->__pyx_base.__pyx_vtab)->_saveToStringAndSize(((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self), ((char **)(&__pyx_v_buffer->buf)), (&__pyx_v_l)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
110634     __Pyx_GOTREF(__pyx_t_2);
110635     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
110636
110637     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":719
110638  *         if self._buffer is NULL or flags & python.PyBUF_WRITABLE:
110639  *             self._saveToStringAndSize(<char**>&buffer.buf, &l)
110640  *             buffer.len = l             # <<<<<<<<<<<<<<
110641  *             if self._buffer is NULL and not flags & python.PyBUF_WRITABLE:
110642  *                 self._buffer = <char*>buffer.buf
110643  */
110644     __pyx_v_buffer->len = __pyx_v_l;
110645
110646     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":720
110647  *             self._saveToStringAndSize(<char**>&buffer.buf, &l)
110648  *             buffer.len = l
110649  *             if self._buffer is NULL and not flags & python.PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
110650  *                 self._buffer = <char*>buffer.buf
110651  *                 self._buffer_len = l
110652  */
110653     if ((((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->_buffer == NULL)) {
110654       __pyx_t_1 = (!(__pyx_v_flags & PyBUF_WRITABLE));
110655     } else {
110656       __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->_buffer == NULL);
110657     }
110658     if (__pyx_t_1) {
110659
110660       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":721
110661  *             buffer.len = l
110662  *             if self._buffer is NULL and not flags & python.PyBUF_WRITABLE:
110663  *                 self._buffer = <char*>buffer.buf             # <<<<<<<<<<<<<<
110664  *                 self._buffer_len = l
110665  *                 self._buffer_refcnt = 1
110666  */
110667       ((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->_buffer = ((char *)__pyx_v_buffer->buf);
110668
110669       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":722
110670  *             if self._buffer is NULL and not flags & python.PyBUF_WRITABLE:
110671  *                 self._buffer = <char*>buffer.buf
110672  *                 self._buffer_len = l             # <<<<<<<<<<<<<<
110673  *                 self._buffer_refcnt = 1
110674  *         else:
110675  */
110676       ((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->_buffer_len = __pyx_v_l;
110677
110678       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":723
110679  *                 self._buffer = <char*>buffer.buf
110680  *                 self._buffer_len = l
110681  *                 self._buffer_refcnt = 1             # <<<<<<<<<<<<<<
110682  *         else:
110683  *             buffer.buf = <char*>self._buffer
110684  */
110685       ((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->_buffer_refcnt = 1;
110686       goto __pyx_L7;
110687     }
110688     __pyx_L7:;
110689     goto __pyx_L6;
110690   }
110691   /*else*/ {
110692
110693     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":725
110694  *                 self._buffer_refcnt = 1
110695  *         else:
110696  *             buffer.buf = <char*>self._buffer             # <<<<<<<<<<<<<<
110697  *             buffer.len = self._buffer_len
110698  *             self._buffer_refcnt += 1
110699  */
110700     __pyx_v_buffer->buf = ((char *)((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->_buffer);
110701
110702     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":726
110703  *         else:
110704  *             buffer.buf = <char*>self._buffer
110705  *             buffer.len = self._buffer_len             # <<<<<<<<<<<<<<
110706  *             self._buffer_refcnt += 1
110707  *         if flags & python.PyBUF_WRITABLE:
110708  */
110709     __pyx_v_buffer->len = ((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->_buffer_len;
110710
110711     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":727
110712  *             buffer.buf = <char*>self._buffer
110713  *             buffer.len = self._buffer_len
110714  *             self._buffer_refcnt += 1             # <<<<<<<<<<<<<<
110715  *         if flags & python.PyBUF_WRITABLE:
110716  *             buffer.readonly = 0
110717  */
110718     ((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->_buffer_refcnt += 1;
110719   }
110720   __pyx_L6:;
110721
110722   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":728
110723  *             buffer.len = self._buffer_len
110724  *             self._buffer_refcnt += 1
110725  *         if flags & python.PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
110726  *             buffer.readonly = 0
110727  *         else:
110728  */
110729   __pyx_t_3 = (__pyx_v_flags & PyBUF_WRITABLE);
110730   if (__pyx_t_3) {
110731
110732     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":729
110733  *             self._buffer_refcnt += 1
110734  *         if flags & python.PyBUF_WRITABLE:
110735  *             buffer.readonly = 0             # <<<<<<<<<<<<<<
110736  *         else:
110737  *             buffer.readonly = 1
110738  */
110739     __pyx_v_buffer->readonly = 0;
110740     goto __pyx_L8;
110741   }
110742   /*else*/ {
110743
110744     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":731
110745  *             buffer.readonly = 0
110746  *         else:
110747  *             buffer.readonly = 1             # <<<<<<<<<<<<<<
110748  *         if flags & python.PyBUF_FORMAT:
110749  *             buffer.format = "B"
110750  */
110751     __pyx_v_buffer->readonly = 1;
110752   }
110753   __pyx_L8:;
110754
110755   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":732
110756  *         else:
110757  *             buffer.readonly = 1
110758  *         if flags & python.PyBUF_FORMAT:             # <<<<<<<<<<<<<<
110759  *             buffer.format = "B"
110760  *         else:
110761  */
110762   __pyx_t_3 = (__pyx_v_flags & PyBUF_FORMAT);
110763   if (__pyx_t_3) {
110764
110765     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":733
110766  *             buffer.readonly = 1
110767  *         if flags & python.PyBUF_FORMAT:
110768  *             buffer.format = "B"             # <<<<<<<<<<<<<<
110769  *         else:
110770  *             buffer.format = NULL
110771  */
110772     __pyx_v_buffer->format = __pyx_k_626;
110773     goto __pyx_L9;
110774   }
110775   /*else*/ {
110776
110777     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":735
110778  *             buffer.format = "B"
110779  *         else:
110780  *             buffer.format = NULL             # <<<<<<<<<<<<<<
110781  *         buffer.ndim = 0
110782  *         buffer.shape = NULL
110783  */
110784     __pyx_v_buffer->format = NULL;
110785   }
110786   __pyx_L9:;
110787
110788   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":736
110789  *         else:
110790  *             buffer.format = NULL
110791  *         buffer.ndim = 0             # <<<<<<<<<<<<<<
110792  *         buffer.shape = NULL
110793  *         buffer.strides = NULL
110794  */
110795   __pyx_v_buffer->ndim = 0;
110796
110797   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":737
110798  *             buffer.format = NULL
110799  *         buffer.ndim = 0
110800  *         buffer.shape = NULL             # <<<<<<<<<<<<<<
110801  *         buffer.strides = NULL
110802  *         buffer.suboffsets = NULL
110803  */
110804   __pyx_v_buffer->shape = NULL;
110805
110806   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":738
110807  *         buffer.ndim = 0
110808  *         buffer.shape = NULL
110809  *         buffer.strides = NULL             # <<<<<<<<<<<<<<
110810  *         buffer.suboffsets = NULL
110811  *         buffer.itemsize = 1
110812  */
110813   __pyx_v_buffer->strides = NULL;
110814
110815   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":739
110816  *         buffer.shape = NULL
110817  *         buffer.strides = NULL
110818  *         buffer.suboffsets = NULL             # <<<<<<<<<<<<<<
110819  *         buffer.itemsize = 1
110820  *         buffer.internal = NULL
110821  */
110822   __pyx_v_buffer->suboffsets = NULL;
110823
110824   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":740
110825  *         buffer.strides = NULL
110826  *         buffer.suboffsets = NULL
110827  *         buffer.itemsize = 1             # <<<<<<<<<<<<<<
110828  *         buffer.internal = NULL
110829  * 
110830  */
110831   __pyx_v_buffer->itemsize = 1;
110832
110833   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":741
110834  *         buffer.suboffsets = NULL
110835  *         buffer.itemsize = 1
110836  *         buffer.internal = NULL             # <<<<<<<<<<<<<<
110837  * 
110838  *     def __releasebuffer__(self, Py_buffer* buffer):
110839  */
110840   __pyx_v_buffer->internal = NULL;
110841
110842   __pyx_r = 0;
110843   goto __pyx_L0;
110844   __pyx_L1_error:;
110845   __Pyx_XDECREF(__pyx_t_2);
110846   __Pyx_AddTraceback("lxml.etree._XSLTResultTree.__getbuffer__");
110847   __pyx_r = -1;
110848   __Pyx_GOTREF(__pyx_v_buffer->obj);
110849   __Pyx_DECREF(__pyx_v_buffer->obj); __pyx_v_buffer->obj = NULL;
110850   goto __pyx_L2;
110851   __pyx_L0:;
110852   if (__pyx_v_buffer->obj == Py_None) {
110853     __Pyx_GOTREF(Py_None);
110854     __Pyx_DECREF(Py_None); __pyx_v_buffer->obj = NULL;
110855   }
110856   __pyx_L2:;
110857   __Pyx_FinishRefcountContext();
110858   return __pyx_r;
110859 }
110860
110861 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":743
110862  *         buffer.internal = NULL
110863  * 
110864  *     def __releasebuffer__(self, Py_buffer* buffer):             # <<<<<<<<<<<<<<
110865  *         if buffer is NULL:
110866  *             return # UNLOCK
110867  */
110868
110869 static void __pyx_pf_4lxml_5etree_15_XSLTResultTree___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer); /*proto*/
110870 static void __pyx_pf_4lxml_5etree_15_XSLTResultTree___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer) {
110871   int __pyx_t_1;
110872   __Pyx_SetupRefcountContext("__releasebuffer__");
110873
110874   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":744
110875  * 
110876  *     def __releasebuffer__(self, Py_buffer* buffer):
110877  *         if buffer is NULL:             # <<<<<<<<<<<<<<
110878  *             return # UNLOCK
110879  *         if <char*>buffer.buf is self._buffer:
110880  */
110881   __pyx_t_1 = (__pyx_v_buffer == NULL);
110882   if (__pyx_t_1) {
110883
110884     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":745
110885  *     def __releasebuffer__(self, Py_buffer* buffer):
110886  *         if buffer is NULL:
110887  *             return # UNLOCK             # <<<<<<<<<<<<<<
110888  *         if <char*>buffer.buf is self._buffer:
110889  *             self._buffer_refcnt -= 1
110890  */
110891     goto __pyx_L0;
110892     goto __pyx_L5;
110893   }
110894   __pyx_L5:;
110895
110896   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":746
110897  *         if buffer is NULL:
110898  *             return # UNLOCK
110899  *         if <char*>buffer.buf is self._buffer:             # <<<<<<<<<<<<<<
110900  *             self._buffer_refcnt -= 1
110901  *             if self._buffer_refcnt == 0:
110902  */
110903   __pyx_t_1 = (((char *)__pyx_v_buffer->buf) == ((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->_buffer);
110904   if (__pyx_t_1) {
110905
110906     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":747
110907  *             return # UNLOCK
110908  *         if <char*>buffer.buf is self._buffer:
110909  *             self._buffer_refcnt -= 1             # <<<<<<<<<<<<<<
110910  *             if self._buffer_refcnt == 0:
110911  *                 tree.xmlFree(self._buffer)
110912  */
110913     ((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->_buffer_refcnt -= 1;
110914
110915     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":748
110916  *         if <char*>buffer.buf is self._buffer:
110917  *             self._buffer_refcnt -= 1
110918  *             if self._buffer_refcnt == 0:             # <<<<<<<<<<<<<<
110919  *                 tree.xmlFree(self._buffer)
110920  *                 self._buffer = NULL
110921  */
110922     __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->_buffer_refcnt == 0);
110923     if (__pyx_t_1) {
110924
110925       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":749
110926  *             self._buffer_refcnt -= 1
110927  *             if self._buffer_refcnt == 0:
110928  *                 tree.xmlFree(self._buffer)             # <<<<<<<<<<<<<<
110929  *                 self._buffer = NULL
110930  *         else:
110931  */
110932       xmlFree(((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->_buffer);
110933
110934       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":750
110935  *             if self._buffer_refcnt == 0:
110936  *                 tree.xmlFree(self._buffer)
110937  *                 self._buffer = NULL             # <<<<<<<<<<<<<<
110938  *         else:
110939  *             tree.xmlFree(<char*>buffer.buf)
110940  */
110941       ((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->_buffer = NULL;
110942       goto __pyx_L7;
110943     }
110944     __pyx_L7:;
110945     goto __pyx_L6;
110946   }
110947   /*else*/ {
110948
110949     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":752
110950  *                 self._buffer = NULL
110951  *         else:
110952  *             tree.xmlFree(<char*>buffer.buf)             # <<<<<<<<<<<<<<
110953  *         buffer.buf = NULL
110954  * 
110955  */
110956     xmlFree(((char *)__pyx_v_buffer->buf));
110957   }
110958   __pyx_L6:;
110959
110960   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":753
110961  *         else:
110962  *             tree.xmlFree(<char*>buffer.buf)
110963  *         buffer.buf = NULL             # <<<<<<<<<<<<<<
110964  * 
110965  *     property xslt_profile:
110966  */
110967   __pyx_v_buffer->buf = NULL;
110968
110969   __pyx_L0:;
110970   __Pyx_FinishRefcountContext();
110971 }
110972
110973 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":758
110974  *         u"""Return an ElementTree with profiling data for the stylesheet run.
110975  *         """
110976  *         def __get__(self):             # <<<<<<<<<<<<<<
110977  *             cdef object root
110978  *             if self._profile is None:
110979  */
110980
110981 static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree_12xslt_profile___get__(PyObject *__pyx_v_self); /*proto*/
110982 static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree_12xslt_profile___get__(PyObject *__pyx_v_self) {
110983   PyObject *__pyx_v_root;
110984   PyObject *__pyx_r = NULL;
110985   PyObject *__pyx_1 = 0;
110986   int __pyx_t_1;
110987   PyObject *__pyx_t_2 = NULL;
110988   PyObject *__pyx_t_3 = NULL;
110989   __Pyx_SetupRefcountContext("__get__");
110990   __pyx_v_root = Py_None; __Pyx_INCREF(Py_None);
110991
110992   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":760
110993  *         def __get__(self):
110994  *             cdef object root
110995  *             if self._profile is None:             # <<<<<<<<<<<<<<
110996  *                 return None
110997  *             root = self._profile.getroot()
110998  */
110999   __pyx_t_1 = (((PyObject *)((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->_profile) == Py_None);
111000   if (__pyx_t_1) {
111001
111002     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":761
111003  *             cdef object root
111004  *             if self._profile is None:
111005  *                 return None             # <<<<<<<<<<<<<<
111006  *             root = self._profile.getroot()
111007  *             if root is None:
111008  */
111009     __Pyx_XDECREF(__pyx_r);
111010     __Pyx_INCREF(Py_None);
111011     __pyx_r = Py_None;
111012     goto __pyx_L0;
111013     goto __pyx_L5;
111014   }
111015   __pyx_L5:;
111016
111017   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":762
111018  *             if self._profile is None:
111019  *                 return None
111020  *             root = self._profile.getroot()             # <<<<<<<<<<<<<<
111021  *             if root is None:
111022  *                 return None
111023  */
111024   __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->_profile->__pyx_vtab)->getroot(((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->_profile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111025   __Pyx_GOTREF(__pyx_t_2);
111026   __Pyx_DECREF(__pyx_v_root);
111027   __pyx_v_root = __pyx_t_2;
111028   __pyx_t_2 = 0;
111029
111030   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":763
111031  *                 return None
111032  *             root = self._profile.getroot()
111033  *             if root is None:             # <<<<<<<<<<<<<<
111034  *                 return None
111035  *             return ElementTree(root)
111036  */
111037   __pyx_t_1 = (__pyx_v_root == Py_None);
111038   if (__pyx_t_1) {
111039
111040     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":764
111041  *             root = self._profile.getroot()
111042  *             if root is None:
111043  *                 return None             # <<<<<<<<<<<<<<
111044  *             return ElementTree(root)
111045  * 
111046  */
111047     __Pyx_XDECREF(__pyx_r);
111048     __Pyx_INCREF(Py_None);
111049     __pyx_r = Py_None;
111050     goto __pyx_L0;
111051     goto __pyx_L6;
111052   }
111053   __pyx_L6:;
111054
111055   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":765
111056  *             if root is None:
111057  *                 return None
111058  *             return ElementTree(root)             # <<<<<<<<<<<<<<
111059  * 
111060  *         def __del__(self):
111061  */
111062   __Pyx_XDECREF(__pyx_r);
111063   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_ElementTree); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111064   __Pyx_GOTREF(__pyx_1);
111065   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111066   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
111067   __Pyx_INCREF(__pyx_v_root);
111068   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_root);
111069   __Pyx_GIVEREF(__pyx_v_root);
111070   __pyx_t_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111071   __Pyx_GOTREF(__pyx_t_3);
111072   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
111073   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
111074   __pyx_r = __pyx_t_3;
111075   __pyx_t_3 = 0;
111076   goto __pyx_L0;
111077
111078   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
111079   goto __pyx_L0;
111080   __pyx_L1_error:;
111081   __Pyx_XDECREF(__pyx_1);
111082   __Pyx_XDECREF(__pyx_t_2);
111083   __Pyx_XDECREF(__pyx_t_3);
111084   __Pyx_AddTraceback("lxml.etree._XSLTResultTree.xslt_profile.__get__");
111085   __pyx_r = NULL;
111086   __pyx_L0:;
111087   __Pyx_DECREF(__pyx_v_root);
111088   __Pyx_XGIVEREF(__pyx_r);
111089   __Pyx_FinishRefcountContext();
111090   return __pyx_r;
111091 }
111092
111093 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":767
111094  *             return ElementTree(root)
111095  * 
111096  *         def __del__(self):             # <<<<<<<<<<<<<<
111097  *             self._profile = None
111098  * 
111099  */
111100
111101 static int __pyx_pf_4lxml_5etree_15_XSLTResultTree_12xslt_profile___del__(PyObject *__pyx_v_self); /*proto*/
111102 static int __pyx_pf_4lxml_5etree_15_XSLTResultTree_12xslt_profile___del__(PyObject *__pyx_v_self) {
111103   int __pyx_r;
111104   __Pyx_SetupRefcountContext("__del__");
111105
111106   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":768
111107  * 
111108  *         def __del__(self):
111109  *             self._profile = None             # <<<<<<<<<<<<<<
111110  * 
111111  * cdef _xsltResultTreeFactory(_Document doc, XSLT xslt, _Document profile):
111112  */
111113   __Pyx_INCREF(Py_None);
111114   __Pyx_GIVEREF(Py_None);
111115   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->_profile);
111116   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->_profile));
111117   ((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->_profile = ((struct LxmlDocument *)Py_None);
111118
111119   __pyx_r = 0;
111120   __Pyx_FinishRefcountContext();
111121   return __pyx_r;
111122 }
111123
111124 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":770
111125  *             self._profile = None
111126  * 
111127  * cdef _xsltResultTreeFactory(_Document doc, XSLT xslt, _Document profile):             # <<<<<<<<<<<<<<
111128  *     cdef _XSLTResultTree result
111129  *     result = <_XSLTResultTree>_newElementTree(doc, None, _XSLTResultTree)
111130  */
111131
111132 static  PyObject *__pyx_f_4lxml_5etree__xsltResultTreeFactory(struct LxmlDocument *__pyx_v_doc, struct __pyx_obj_4lxml_5etree_XSLT *__pyx_v_xslt, struct LxmlDocument *__pyx_v_profile) {
111133   struct __pyx_obj_4lxml_5etree__XSLTResultTree *__pyx_v_result;
111134   PyObject *__pyx_r = NULL;
111135   PyObject *__pyx_t_1 = NULL;
111136   __Pyx_SetupRefcountContext("_xsltResultTreeFactory");
111137   __pyx_v_result = ((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)Py_None); __Pyx_INCREF(Py_None);
111138
111139   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":772
111140  * cdef _xsltResultTreeFactory(_Document doc, XSLT xslt, _Document profile):
111141  *     cdef _XSLTResultTree result
111142  *     result = <_XSLTResultTree>_newElementTree(doc, None, _XSLTResultTree)             # <<<<<<<<<<<<<<
111143  *     result._xslt = xslt
111144  *     result._profile = profile
111145  */
111146   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__newElementTree(__pyx_v_doc, ((struct LxmlElement *)Py_None), ((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__XSLTResultTree)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111147   __Pyx_GOTREF(__pyx_t_1);
111148   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_t_1)));
111149   __Pyx_DECREF(((PyObject *)__pyx_v_result));
111150   __pyx_v_result = ((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_t_1);
111151   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
111152
111153   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":773
111154  *     cdef _XSLTResultTree result
111155  *     result = <_XSLTResultTree>_newElementTree(doc, None, _XSLTResultTree)
111156  *     result._xslt = xslt             # <<<<<<<<<<<<<<
111157  *     result._profile = profile
111158  *     result._buffer = NULL
111159  */
111160   __Pyx_INCREF(((PyObject *)__pyx_v_xslt));
111161   __Pyx_GIVEREF(((PyObject *)__pyx_v_xslt));
111162   __Pyx_GOTREF(__pyx_v_result->_xslt);
111163   __Pyx_DECREF(((PyObject *)__pyx_v_result->_xslt));
111164   __pyx_v_result->_xslt = __pyx_v_xslt;
111165
111166   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":774
111167  *     result = <_XSLTResultTree>_newElementTree(doc, None, _XSLTResultTree)
111168  *     result._xslt = xslt
111169  *     result._profile = profile             # <<<<<<<<<<<<<<
111170  *     result._buffer = NULL
111171  *     result._buffer_refcnt = 0
111172  */
111173   __Pyx_INCREF(((PyObject *)__pyx_v_profile));
111174   __Pyx_GIVEREF(((PyObject *)__pyx_v_profile));
111175   __Pyx_GOTREF(__pyx_v_result->_profile);
111176   __Pyx_DECREF(((PyObject *)__pyx_v_result->_profile));
111177   __pyx_v_result->_profile = __pyx_v_profile;
111178
111179   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":775
111180  *     result._xslt = xslt
111181  *     result._profile = profile
111182  *     result._buffer = NULL             # <<<<<<<<<<<<<<
111183  *     result._buffer_refcnt = 0
111184  *     result._buffer_len = 0
111185  */
111186   __pyx_v_result->_buffer = NULL;
111187
111188   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":776
111189  *     result._profile = profile
111190  *     result._buffer = NULL
111191  *     result._buffer_refcnt = 0             # <<<<<<<<<<<<<<
111192  *     result._buffer_len = 0
111193  *     return result
111194  */
111195   __pyx_v_result->_buffer_refcnt = 0;
111196
111197   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":777
111198  *     result._buffer = NULL
111199  *     result._buffer_refcnt = 0
111200  *     result._buffer_len = 0             # <<<<<<<<<<<<<<
111201  *     return result
111202  * 
111203  */
111204   __pyx_v_result->_buffer_len = 0;
111205
111206   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":778
111207  *     result._buffer_refcnt = 0
111208  *     result._buffer_len = 0
111209  *     return result             # <<<<<<<<<<<<<<
111210  * 
111211  * # functions like "output" and "write" are a potential security risk, but we
111212  */
111213   __Pyx_XDECREF(__pyx_r);
111214   __Pyx_INCREF(((PyObject *)__pyx_v_result));
111215   __pyx_r = ((PyObject *)__pyx_v_result);
111216   goto __pyx_L0;
111217
111218   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
111219   goto __pyx_L0;
111220   __pyx_L1_error:;
111221   __Pyx_XDECREF(__pyx_t_1);
111222   __Pyx_AddTraceback("lxml.etree._xsltResultTreeFactory");
111223   __pyx_r = 0;
111224   __pyx_L0:;
111225   __Pyx_DECREF((PyObject *)__pyx_v_result);
111226   __Pyx_XGIVEREF(__pyx_r);
111227   __Pyx_FinishRefcountContext();
111228   return __pyx_r;
111229 }
111230
111231 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":806
111232  * __findStylesheetByID = None
111233  * 
111234  * cdef _findStylesheetByID(_Document doc, id):             # <<<<<<<<<<<<<<
111235  *     global __findStylesheetByID
111236  *     if __findStylesheetByID is None:
111237  */
111238
111239 static  PyObject *__pyx_f_4lxml_5etree__findStylesheetByID(struct LxmlDocument *__pyx_v_doc, PyObject *__pyx_v_id) {
111240   PyObject *__pyx_r = NULL;
111241   PyObject *__pyx_1 = 0;
111242   PyObject *__pyx_2 = 0;
111243   int __pyx_t_1;
111244   PyObject *__pyx_t_2 = NULL;
111245   PyObject *__pyx_t_3 = NULL;
111246   __Pyx_SetupRefcountContext("_findStylesheetByID");
111247
111248   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":808
111249  * cdef _findStylesheetByID(_Document doc, id):
111250  *     global __findStylesheetByID
111251  *     if __findStylesheetByID is None:             # <<<<<<<<<<<<<<
111252  *         __findStylesheetByID = XPath(
111253  *             u"//xsl:stylesheet[@xml:id = $id]",
111254  */
111255   __pyx_t_1 = (((PyObject *)__pyx_v_4lxml_5etree___findStylesheetByID) == Py_None);
111256   if (__pyx_t_1) {
111257
111258     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":810
111259  *     if __findStylesheetByID is None:
111260  *         __findStylesheetByID = XPath(
111261  *             u"//xsl:stylesheet[@xml:id = $id]",             # <<<<<<<<<<<<<<
111262  *             namespaces={u"xsl" : u"http://www.w3.org/1999/XSL/Transform"})
111263  *     return __findStylesheetByID(doc, id=id)
111264  */
111265     __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111266     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
111267     __Pyx_INCREF(((PyObject *)__pyx_kp_627));
111268     PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_627));
111269     __Pyx_GIVEREF(((PyObject *)__pyx_kp_627));
111270     __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111271     __Pyx_GOTREF(((PyObject *)__pyx_1));
111272
111273     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":811
111274  *         __findStylesheetByID = XPath(
111275  *             u"//xsl:stylesheet[@xml:id = $id]",
111276  *             namespaces={u"xsl" : u"http://www.w3.org/1999/XSL/Transform"})             # <<<<<<<<<<<<<<
111277  *     return __findStylesheetByID(doc, id=id)
111278  * 
111279  */
111280     __pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111281     __Pyx_GOTREF(((PyObject *)__pyx_2));
111282     if (PyDict_SetItem(__pyx_2, ((PyObject *)__pyx_kp_628), ((PyObject *)__pyx_kp_629)) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111283     if (PyDict_SetItem(__pyx_1, __pyx_kp_namespaces, ((PyObject *)__pyx_2)) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111284     __Pyx_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
111285     __pyx_t_3 = PyEval_CallObjectWithKeywords(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_XPath)), ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111286     __Pyx_GOTREF(__pyx_t_3);
111287     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
111288     __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
111289     if (!(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4lxml_5etree_XPath))) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111290     __Pyx_GOTREF(((PyObject *)__pyx_v_4lxml_5etree___findStylesheetByID));
111291     __Pyx_DECREF(((PyObject *)__pyx_v_4lxml_5etree___findStylesheetByID));
111292     __Pyx_GIVEREF(__pyx_t_3);
111293     __pyx_v_4lxml_5etree___findStylesheetByID = ((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_t_3);
111294     __pyx_t_3 = 0;
111295     goto __pyx_L3;
111296   }
111297   __pyx_L3:;
111298
111299   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":812
111300  *             u"//xsl:stylesheet[@xml:id = $id]",
111301  *             namespaces={u"xsl" : u"http://www.w3.org/1999/XSL/Transform"})
111302  *     return __findStylesheetByID(doc, id=id)             # <<<<<<<<<<<<<<
111303  * 
111304  * cdef class _XSLTProcessingInstruction(PIBase):
111305  */
111306   __Pyx_XDECREF(__pyx_r);
111307   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111308   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
111309   __Pyx_INCREF(((PyObject *)__pyx_v_doc));
111310   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_doc));
111311   __Pyx_GIVEREF(((PyObject *)__pyx_v_doc));
111312   __pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111313   __Pyx_GOTREF(((PyObject *)__pyx_2));
111314   if (PyDict_SetItem(__pyx_2, __pyx_kp_id, __pyx_v_id) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111315   __pyx_t_2 = PyEval_CallObjectWithKeywords(((PyObject *)__pyx_v_4lxml_5etree___findStylesheetByID), ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_2)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111316   __Pyx_GOTREF(__pyx_t_2);
111317   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
111318   __Pyx_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
111319   __pyx_r = __pyx_t_2;
111320   __pyx_t_2 = 0;
111321   goto __pyx_L0;
111322
111323   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
111324   goto __pyx_L0;
111325   __pyx_L1_error:;
111326   __Pyx_XDECREF(__pyx_1);
111327   __Pyx_XDECREF(__pyx_2);
111328   __Pyx_XDECREF(__pyx_t_2);
111329   __Pyx_XDECREF(__pyx_t_3);
111330   __Pyx_AddTraceback("lxml.etree._findStylesheetByID");
111331   __pyx_r = 0;
111332   __pyx_L0:;
111333   __Pyx_XGIVEREF(__pyx_r);
111334   __Pyx_FinishRefcountContext();
111335   return __pyx_r;
111336 }
111337
111338 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":815
111339  * 
111340  * cdef class _XSLTProcessingInstruction(PIBase):
111341  *     def parseXSL(self, parser=None):             # <<<<<<<<<<<<<<
111342  *         u"""Try to parse the stylesheet referenced by this PI and return an
111343  *         ElementTree for it.  If the stylesheet is embedded in the same
111344  */
111345
111346 static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
111347 static char __pyx_doc_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL[] = "Try to parse the stylesheet referenced by this PI and return an\n        ElementTree for it.  If the stylesheet is embedded in the same\n        document (referenced via xml:id), find and return an ElementTree for\n        the stylesheet Element.\n\n        The optional ``parser`` keyword argument can be passed to specify the\n        parser used to read from external stylesheet URLs.\n        ";
111348 static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
111349   PyObject *__pyx_v_parser = 0;
111350   struct LxmlDocument *__pyx_v_result_doc;
111351   struct LxmlElement *__pyx_v_result_node;
111352   char *__pyx_v_c_href;
111353   xmlAttr *__pyx_v_c_attr;
111354   PyObject *__pyx_v_hrefs;
111355   PyObject *__pyx_v_href_utf;
111356   PyObject *__pyx_v_root;
111357   PyObject *__pyx_r = NULL;
111358   PyObject *__pyx_1 = 0;
111359   int __pyx_t_1;
111360   PyObject *__pyx_t_2 = NULL;
111361   PyObject *__pyx_t_3 = NULL;
111362   Py_ssize_t __pyx_t_4;
111363   int __pyx_t_5;
111364   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_parser,0};
111365   __Pyx_SetupRefcountContext("parseXSL");
111366   if (unlikely(__pyx_kwds)) {
111367     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
111368     PyObject* values[1] = {0};
111369     values[0] = Py_None;
111370     switch (PyTuple_GET_SIZE(__pyx_args)) {
111371       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
111372       case  0: break;
111373       default: goto __pyx_L5_argtuple_error;
111374     }
111375     switch (PyTuple_GET_SIZE(__pyx_args)) {
111376       case  0:
111377       if (kw_args > 1) {
111378         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_parser);
111379         if (unlikely(value)) { values[0] = value; kw_args--; }
111380       }
111381     }
111382     if (unlikely(kw_args > 0)) {
111383       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "parseXSL") < 0)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
111384     }
111385     __pyx_v_parser = values[0];
111386   } else {
111387     __pyx_v_parser = Py_None;
111388     switch (PyTuple_GET_SIZE(__pyx_args)) {
111389       case  1: __pyx_v_parser = PyTuple_GET_ITEM(__pyx_args, 0);
111390       case  0: break;
111391       default: goto __pyx_L5_argtuple_error;
111392     }
111393   }
111394   goto __pyx_L4_argument_unpacking_done;
111395   __pyx_L5_argtuple_error:;
111396   __Pyx_RaiseArgtupleInvalid("parseXSL", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[18]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
111397   __pyx_L3_error:;
111398   __Pyx_AddTraceback("lxml.etree._XSLTProcessingInstruction.parseXSL");
111399   return NULL;
111400   __pyx_L4_argument_unpacking_done:;
111401   __pyx_v_result_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
111402   __pyx_v_result_node = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
111403   __pyx_v_hrefs = Py_None; __Pyx_INCREF(Py_None);
111404   __pyx_v_href_utf = Py_None; __Pyx_INCREF(Py_None);
111405   __pyx_v_root = Py_None; __Pyx_INCREF(Py_None);
111406
111407   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":828
111408  *         cdef char* c_href
111409  *         cdef xmlAttr* c_attr
111410  *         if self._c_node.content is NULL:             # <<<<<<<<<<<<<<
111411  *             raise ValueError, u"PI lacks content"
111412  *         hrefs = _FIND_PI_HREF(u' ' + funicode(self._c_node.content))
111413  */
111414   __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree__XSLTProcessingInstruction *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node->content == NULL);
111415   if (__pyx_t_1) {
111416
111417     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":829
111418  *         cdef xmlAttr* c_attr
111419  *         if self._c_node.content is NULL:
111420  *             raise ValueError, u"PI lacks content"             # <<<<<<<<<<<<<<
111421  *         hrefs = _FIND_PI_HREF(u' ' + funicode(self._c_node.content))
111422  *         if len(hrefs) != 1:
111423  */
111424     __Pyx_Raise(__pyx_builtin_ValueError, ((PyObject *)__pyx_kp_630), 0);
111425     {__pyx_filename = __pyx_f[18]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111426     goto __pyx_L6;
111427   }
111428   __pyx_L6:;
111429
111430   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":830
111431  *         if self._c_node.content is NULL:
111432  *             raise ValueError, u"PI lacks content"
111433  *         hrefs = _FIND_PI_HREF(u' ' + funicode(self._c_node.content))             # <<<<<<<<<<<<<<
111434  *         if len(hrefs) != 1:
111435  *             raise ValueError, u"malformed PI attributes"
111436  */
111437   __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(((struct __pyx_obj_4lxml_5etree__XSLTProcessingInstruction *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node->content); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111438   __Pyx_GOTREF(__pyx_t_2);
111439   __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_kp_631), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111440   __Pyx_GOTREF(__pyx_t_3);
111441   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
111442   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111443   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
111444   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
111445   __Pyx_GIVEREF(__pyx_t_3);
111446   __pyx_t_3 = 0;
111447   __pyx_t_3 = PyObject_Call(__pyx_v_4lxml_5etree__FIND_PI_HREF, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111448   __Pyx_GOTREF(__pyx_t_3);
111449   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
111450   __Pyx_DECREF(__pyx_v_hrefs);
111451   __pyx_v_hrefs = __pyx_t_3;
111452   __pyx_t_3 = 0;
111453
111454   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":831
111455  *             raise ValueError, u"PI lacks content"
111456  *         hrefs = _FIND_PI_HREF(u' ' + funicode(self._c_node.content))
111457  *         if len(hrefs) != 1:             # <<<<<<<<<<<<<<
111458  *             raise ValueError, u"malformed PI attributes"
111459  *         href_utf = utf8(hrefs[0])
111460  */
111461   __pyx_t_4 = PyObject_Length(__pyx_v_hrefs); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111462   __pyx_t_1 = (__pyx_t_4 != 1);
111463   if (__pyx_t_1) {
111464
111465     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":832
111466  *         hrefs = _FIND_PI_HREF(u' ' + funicode(self._c_node.content))
111467  *         if len(hrefs) != 1:
111468  *             raise ValueError, u"malformed PI attributes"             # <<<<<<<<<<<<<<
111469  *         href_utf = utf8(hrefs[0])
111470  *         c_href = _cstr(href_utf)
111471  */
111472     __Pyx_Raise(__pyx_builtin_ValueError, ((PyObject *)__pyx_kp_632), 0);
111473     {__pyx_filename = __pyx_f[18]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111474     goto __pyx_L7;
111475   }
111476   __pyx_L7:;
111477
111478   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":833
111479  *         if len(hrefs) != 1:
111480  *             raise ValueError, u"malformed PI attributes"
111481  *         href_utf = utf8(hrefs[0])             # <<<<<<<<<<<<<<
111482  *         c_href = _cstr(href_utf)
111483  * 
111484  */
111485   __pyx_1 = __Pyx_GetItemInt(__pyx_v_hrefs, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111486   __Pyx_GOTREF(__pyx_1);
111487   __pyx_t_3 = utf8(__pyx_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111488   __Pyx_GOTREF(__pyx_t_3);
111489   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
111490   __Pyx_DECREF(__pyx_v_href_utf);
111491   __pyx_v_href_utf = __pyx_t_3;
111492   __pyx_t_3 = 0;
111493
111494   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":834
111495  *             raise ValueError, u"malformed PI attributes"
111496  *         href_utf = utf8(hrefs[0])
111497  *         c_href = _cstr(href_utf)             # <<<<<<<<<<<<<<
111498  * 
111499  *         if c_href[0] != c'#':
111500  */
111501   __pyx_v_c_href = PyString_AS_STRING(__pyx_v_href_utf);
111502
111503   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":836
111504  *         c_href = _cstr(href_utf)
111505  * 
111506  *         if c_href[0] != c'#':             # <<<<<<<<<<<<<<
111507  *             # normal URL, try to parse from it
111508  *             c_href = tree.xmlBuildURI(
111509  */
111510   __pyx_t_1 = ((__pyx_v_c_href[0]) != '#');
111511   if (__pyx_t_1) {
111512
111513     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":840
111514  *             c_href = tree.xmlBuildURI(
111515  *                 c_href,
111516  *                 tree.xmlNodeGetBase(self._c_node.doc, self._c_node))             # <<<<<<<<<<<<<<
111517  *             if c_href is not NULL:
111518  *                 href_utf = c_href
111519  */
111520     __pyx_v_c_href = xmlBuildURI(__pyx_v_c_href, xmlNodeGetBase(((struct __pyx_obj_4lxml_5etree__XSLTProcessingInstruction *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node->doc, ((struct __pyx_obj_4lxml_5etree__XSLTProcessingInstruction *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node));
111521
111522     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":841
111523  *                 c_href,
111524  *                 tree.xmlNodeGetBase(self._c_node.doc, self._c_node))
111525  *             if c_href is not NULL:             # <<<<<<<<<<<<<<
111526  *                 href_utf = c_href
111527  *                 tree.xmlFree(c_href)
111528  */
111529     __pyx_t_1 = (__pyx_v_c_href != NULL);
111530     if (__pyx_t_1) {
111531
111532       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":842
111533  *                 tree.xmlNodeGetBase(self._c_node.doc, self._c_node))
111534  *             if c_href is not NULL:
111535  *                 href_utf = c_href             # <<<<<<<<<<<<<<
111536  *                 tree.xmlFree(c_href)
111537  *             result_doc = _parseDocumentFromURL(href_utf, parser)
111538  */
111539       __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_c_href); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111540       __Pyx_GOTREF(__pyx_t_3);
111541       __Pyx_DECREF(__pyx_v_href_utf);
111542       __pyx_v_href_utf = __pyx_t_3;
111543       __pyx_t_3 = 0;
111544
111545       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":843
111546  *             if c_href is not NULL:
111547  *                 href_utf = c_href
111548  *                 tree.xmlFree(c_href)             # <<<<<<<<<<<<<<
111549  *             result_doc = _parseDocumentFromURL(href_utf, parser)
111550  *             return _elementTreeFactory(result_doc, None)
111551  */
111552       xmlFree(__pyx_v_c_href);
111553       goto __pyx_L9;
111554     }
111555     __pyx_L9:;
111556
111557     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":844
111558  *                 href_utf = c_href
111559  *                 tree.xmlFree(c_href)
111560  *             result_doc = _parseDocumentFromURL(href_utf, parser)             # <<<<<<<<<<<<<<
111561  *             return _elementTreeFactory(result_doc, None)
111562  * 
111563  */
111564     if (!(__Pyx_TypeTest(__pyx_v_parser, __pyx_ptype_4lxml_5etree__BaseParser))) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111565     __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__parseDocumentFromURL(__pyx_v_href_utf, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111566     __Pyx_GOTREF(__pyx_t_3);
111567     __Pyx_DECREF(((PyObject *)__pyx_v_result_doc));
111568     __pyx_v_result_doc = ((struct LxmlDocument *)__pyx_t_3);
111569     __pyx_t_3 = 0;
111570
111571     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":845
111572  *                 tree.xmlFree(c_href)
111573  *             result_doc = _parseDocumentFromURL(href_utf, parser)
111574  *             return _elementTreeFactory(result_doc, None)             # <<<<<<<<<<<<<<
111575  * 
111576  *         # ID reference to embedded stylesheet
111577  */
111578     __Pyx_XDECREF(__pyx_r);
111579     __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(__pyx_v_result_doc, ((struct LxmlElement *)Py_None))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111580     __Pyx_GOTREF(__pyx_t_3);
111581     __pyx_r = __pyx_t_3;
111582     __pyx_t_3 = 0;
111583     goto __pyx_L0;
111584     goto __pyx_L8;
111585   }
111586   __pyx_L8:;
111587
111588   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":849
111589  *         # ID reference to embedded stylesheet
111590  *         # try XML:ID lookup
111591  *         c_href += 1 # skip leading '#'             # <<<<<<<<<<<<<<
111592  *         c_attr = tree.xmlGetID(self._c_node.doc, c_href)
111593  *         if c_attr is not NULL and c_attr.doc is self._c_node.doc:
111594  */
111595   __pyx_v_c_href += 1;
111596
111597   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":850
111598  *         # try XML:ID lookup
111599  *         c_href += 1 # skip leading '#'
111600  *         c_attr = tree.xmlGetID(self._c_node.doc, c_href)             # <<<<<<<<<<<<<<
111601  *         if c_attr is not NULL and c_attr.doc is self._c_node.doc:
111602  *             result_node = _elementFactory(self._doc, c_attr.parent)
111603  */
111604   __pyx_v_c_attr = xmlGetID(((struct __pyx_obj_4lxml_5etree__XSLTProcessingInstruction *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node->doc, __pyx_v_c_href);
111605
111606   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":851
111607  *         c_href += 1 # skip leading '#'
111608  *         c_attr = tree.xmlGetID(self._c_node.doc, c_href)
111609  *         if c_attr is not NULL and c_attr.doc is self._c_node.doc:             # <<<<<<<<<<<<<<
111610  *             result_node = _elementFactory(self._doc, c_attr.parent)
111611  *             return _elementTreeFactory(result_node._doc, result_node)
111612  */
111613   if ((__pyx_v_c_attr != NULL)) {
111614     __pyx_t_1 = (__pyx_v_c_attr->doc == ((struct __pyx_obj_4lxml_5etree__XSLTProcessingInstruction *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node->doc);
111615   } else {
111616     __pyx_t_1 = (__pyx_v_c_attr != NULL);
111617   }
111618   if (__pyx_t_1) {
111619
111620     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":852
111621  *         c_attr = tree.xmlGetID(self._c_node.doc, c_href)
111622  *         if c_attr is not NULL and c_attr.doc is self._c_node.doc:
111623  *             result_node = _elementFactory(self._doc, c_attr.parent)             # <<<<<<<<<<<<<<
111624  *             return _elementTreeFactory(result_node._doc, result_node)
111625  * 
111626  */
111627     __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct __pyx_obj_4lxml_5etree__XSLTProcessingInstruction *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._doc, __pyx_v_c_attr->parent)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111628     __Pyx_GOTREF(__pyx_t_3);
111629     __Pyx_DECREF(((PyObject *)__pyx_v_result_node));
111630     __pyx_v_result_node = ((struct LxmlElement *)__pyx_t_3);
111631     __pyx_t_3 = 0;
111632
111633     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":853
111634  *         if c_attr is not NULL and c_attr.doc is self._c_node.doc:
111635  *             result_node = _elementFactory(self._doc, c_attr.parent)
111636  *             return _elementTreeFactory(result_node._doc, result_node)             # <<<<<<<<<<<<<<
111637  * 
111638  *         # try XPath search
111639  */
111640     __Pyx_XDECREF(__pyx_r);
111641     __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(__pyx_v_result_node->_doc, __pyx_v_result_node)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111642     __Pyx_GOTREF(__pyx_t_3);
111643     __pyx_r = __pyx_t_3;
111644     __pyx_t_3 = 0;
111645     goto __pyx_L0;
111646     goto __pyx_L10;
111647   }
111648   __pyx_L10:;
111649
111650   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":856
111651  * 
111652  *         # try XPath search
111653  *         root = _findStylesheetByID(self._doc, funicode(c_href))             # <<<<<<<<<<<<<<
111654  *         if not root:
111655  *             raise ValueError, u"reference to non-existing embedded stylesheet"
111656  */
111657   __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_href); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111658   __Pyx_GOTREF(__pyx_t_3);
111659   __pyx_t_2 = __pyx_f_4lxml_5etree__findStylesheetByID(((struct __pyx_obj_4lxml_5etree__XSLTProcessingInstruction *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._doc, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111660   __Pyx_GOTREF(__pyx_t_2);
111661   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
111662   __Pyx_DECREF(__pyx_v_root);
111663   __pyx_v_root = __pyx_t_2;
111664   __pyx_t_2 = 0;
111665
111666   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":857
111667  *         # try XPath search
111668  *         root = _findStylesheetByID(self._doc, funicode(c_href))
111669  *         if not root:             # <<<<<<<<<<<<<<
111670  *             raise ValueError, u"reference to non-existing embedded stylesheet"
111671  *         elif len(root) > 1:
111672  */
111673   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_root); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111674   __pyx_t_5 = (!__pyx_t_1);
111675   if (__pyx_t_5) {
111676
111677     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":858
111678  *         root = _findStylesheetByID(self._doc, funicode(c_href))
111679  *         if not root:
111680  *             raise ValueError, u"reference to non-existing embedded stylesheet"             # <<<<<<<<<<<<<<
111681  *         elif len(root) > 1:
111682  *             raise ValueError, u"ambiguous reference to embedded stylesheet"
111683  */
111684     __Pyx_Raise(__pyx_builtin_ValueError, ((PyObject *)__pyx_kp_633), 0);
111685     {__pyx_filename = __pyx_f[18]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111686     goto __pyx_L11;
111687   }
111688
111689   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":859
111690  *         if not root:
111691  *             raise ValueError, u"reference to non-existing embedded stylesheet"
111692  *         elif len(root) > 1:             # <<<<<<<<<<<<<<
111693  *             raise ValueError, u"ambiguous reference to embedded stylesheet"
111694  *         result_node = root[0]
111695  */
111696   __pyx_t_4 = PyObject_Length(__pyx_v_root); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111697   __pyx_t_5 = (__pyx_t_4 > 1);
111698   if (__pyx_t_5) {
111699
111700     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":860
111701  *             raise ValueError, u"reference to non-existing embedded stylesheet"
111702  *         elif len(root) > 1:
111703  *             raise ValueError, u"ambiguous reference to embedded stylesheet"             # <<<<<<<<<<<<<<
111704  *         result_node = root[0]
111705  *         return _elementTreeFactory(result_node._doc, result_node)
111706  */
111707     __Pyx_Raise(__pyx_builtin_ValueError, ((PyObject *)__pyx_kp_634), 0);
111708     {__pyx_filename = __pyx_f[18]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111709     goto __pyx_L11;
111710   }
111711   __pyx_L11:;
111712
111713   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":861
111714  *         elif len(root) > 1:
111715  *             raise ValueError, u"ambiguous reference to embedded stylesheet"
111716  *         result_node = root[0]             # <<<<<<<<<<<<<<
111717  *         return _elementTreeFactory(result_node._doc, result_node)
111718  * 
111719  */
111720   __pyx_1 = __Pyx_GetItemInt(__pyx_v_root, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111721   __Pyx_GOTREF(__pyx_1);
111722   if (!(__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__Element))) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111723   __Pyx_DECREF(((PyObject *)__pyx_v_result_node));
111724   __pyx_v_result_node = ((struct LxmlElement *)__pyx_1);
111725   __pyx_1 = 0;
111726
111727   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":862
111728  *             raise ValueError, u"ambiguous reference to embedded stylesheet"
111729  *         result_node = root[0]
111730  *         return _elementTreeFactory(result_node._doc, result_node)             # <<<<<<<<<<<<<<
111731  * 
111732  *     def set(self, key, value):
111733  */
111734   __Pyx_XDECREF(__pyx_r);
111735   __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(__pyx_v_result_node->_doc, __pyx_v_result_node)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111736   __Pyx_GOTREF(__pyx_t_2);
111737   __pyx_r = __pyx_t_2;
111738   __pyx_t_2 = 0;
111739   goto __pyx_L0;
111740
111741   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
111742   goto __pyx_L0;
111743   __pyx_L1_error:;
111744   __Pyx_XDECREF(__pyx_1);
111745   __Pyx_XDECREF(__pyx_t_2);
111746   __Pyx_XDECREF(__pyx_t_3);
111747   __Pyx_AddTraceback("lxml.etree._XSLTProcessingInstruction.parseXSL");
111748   __pyx_r = NULL;
111749   __pyx_L0:;
111750   __Pyx_DECREF((PyObject *)__pyx_v_result_doc);
111751   __Pyx_DECREF((PyObject *)__pyx_v_result_node);
111752   __Pyx_DECREF(__pyx_v_hrefs);
111753   __Pyx_DECREF(__pyx_v_href_utf);
111754   __Pyx_DECREF(__pyx_v_root);
111755   __Pyx_XGIVEREF(__pyx_r);
111756   __Pyx_FinishRefcountContext();
111757   return __pyx_r;
111758 }
111759
111760 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":864
111761  *         return _elementTreeFactory(result_node._doc, result_node)
111762  * 
111763  *     def set(self, key, value):             # <<<<<<<<<<<<<<
111764  *         if key != u"href":
111765  *             raise AttributeError, \
111766  */
111767
111768 static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
111769 static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
111770   PyObject *__pyx_v_key = 0;
111771   PyObject *__pyx_v_value = 0;
111772   PyObject *__pyx_v_attrib;
111773   PyObject *__pyx_v_text;
111774   PyObject *__pyx_r = NULL;
111775   PyObject *__pyx_t_1 = NULL;
111776   int __pyx_t_2;
111777   int __pyx_t_3;
111778   int __pyx_t_4;
111779   PyObject *__pyx_t_5 = NULL;
111780   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_key,&__pyx_kp_value,0};
111781   __Pyx_SetupRefcountContext("set");
111782   if (unlikely(__pyx_kwds)) {
111783     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
111784     PyObject* values[2] = {0,0};
111785     switch (PyTuple_GET_SIZE(__pyx_args)) {
111786       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
111787       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
111788       case  0: break;
111789       default: goto __pyx_L5_argtuple_error;
111790     }
111791     switch (PyTuple_GET_SIZE(__pyx_args)) {
111792       case  0:
111793       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_key);
111794       if (likely(values[0])) kw_args--;
111795       else goto __pyx_L5_argtuple_error;
111796       case  1:
111797       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_value);
111798       if (likely(values[1])) kw_args--;
111799       else {
111800         __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, 1); {__pyx_filename = __pyx_f[18]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
111801       }
111802     }
111803     if (unlikely(kw_args > 0)) {
111804       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "set") < 0)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
111805     }
111806     __pyx_v_key = values[0];
111807     __pyx_v_value = values[1];
111808   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
111809     goto __pyx_L5_argtuple_error;
111810   } else {
111811     __pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 0);
111812     __pyx_v_value = PyTuple_GET_ITEM(__pyx_args, 1);
111813   }
111814   goto __pyx_L4_argument_unpacking_done;
111815   __pyx_L5_argtuple_error:;
111816   __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[18]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
111817   __pyx_L3_error:;
111818   __Pyx_AddTraceback("lxml.etree._XSLTProcessingInstruction.set");
111819   return NULL;
111820   __pyx_L4_argument_unpacking_done:;
111821   __pyx_v_attrib = Py_None; __Pyx_INCREF(Py_None);
111822   __pyx_v_text = Py_None; __Pyx_INCREF(Py_None);
111823
111824   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":865
111825  * 
111826  *     def set(self, key, value):
111827  *         if key != u"href":             # <<<<<<<<<<<<<<
111828  *             raise AttributeError, \
111829  *                 u"only setting the 'href' attribute is supported on XSLT-PIs"
111830  */
111831   __pyx_t_1 = PyObject_RichCompare(__pyx_v_key, ((PyObject *)__pyx_kp_635), Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111832   __Pyx_GOTREF(__pyx_t_1);
111833   __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111834   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
111835   if (__pyx_t_2) {
111836
111837     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":867
111838  *         if key != u"href":
111839  *             raise AttributeError, \
111840  *                 u"only setting the 'href' attribute is supported on XSLT-PIs"             # <<<<<<<<<<<<<<
111841  *         if value is None:
111842  *             attrib = u""
111843  */
111844     __Pyx_Raise(__pyx_builtin_AttributeError, ((PyObject *)__pyx_kp_636), 0);
111845     {__pyx_filename = __pyx_f[18]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111846     goto __pyx_L6;
111847   }
111848   __pyx_L6:;
111849
111850   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":868
111851  *             raise AttributeError, \
111852  *                 u"only setting the 'href' attribute is supported on XSLT-PIs"
111853  *         if value is None:             # <<<<<<<<<<<<<<
111854  *             attrib = u""
111855  *         elif u'"' in value or u'>' in value:
111856  */
111857   __pyx_t_2 = (__pyx_v_value == Py_None);
111858   if (__pyx_t_2) {
111859
111860     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":869
111861  *                 u"only setting the 'href' attribute is supported on XSLT-PIs"
111862  *         if value is None:
111863  *             attrib = u""             # <<<<<<<<<<<<<<
111864  *         elif u'"' in value or u'>' in value:
111865  *             raise ValueError, u"Invalid URL, must not contain '\"' or '>'"
111866  */
111867     __Pyx_INCREF(((PyObject *)__pyx_kp_637));
111868     __Pyx_DECREF(__pyx_v_attrib);
111869     __pyx_v_attrib = ((PyObject *)__pyx_kp_637);
111870     goto __pyx_L7;
111871   }
111872
111873   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":870
111874  *         if value is None:
111875  *             attrib = u""
111876  *         elif u'"' in value or u'>' in value:             # <<<<<<<<<<<<<<
111877  *             raise ValueError, u"Invalid URL, must not contain '\"' or '>'"
111878  *         else:
111879  */
111880   __pyx_t_2 = (PySequence_Contains(__pyx_v_value, ((PyObject *)__pyx_kp_638))); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111881   if (!__pyx_t_2) {
111882     __pyx_t_3 = (PySequence_Contains(__pyx_v_value, ((PyObject *)__pyx_kp_639))); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111883     __pyx_t_4 = __pyx_t_3;
111884   } else {
111885     __pyx_t_4 = __pyx_t_2;
111886   }
111887   if (__pyx_t_4) {
111888
111889     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":871
111890  *             attrib = u""
111891  *         elif u'"' in value or u'>' in value:
111892  *             raise ValueError, u"Invalid URL, must not contain '\"' or '>'"             # <<<<<<<<<<<<<<
111893  *         else:
111894  *             attrib = u' href="%s"' % value
111895  */
111896     __Pyx_Raise(__pyx_builtin_ValueError, ((PyObject *)__pyx_kp_640), 0);
111897     {__pyx_filename = __pyx_f[18]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111898     goto __pyx_L7;
111899   }
111900   /*else*/ {
111901
111902     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":873
111903  *             raise ValueError, u"Invalid URL, must not contain '\"' or '>'"
111904  *         else:
111905  *             attrib = u' href="%s"' % value             # <<<<<<<<<<<<<<
111906  *         text = u' ' + self.text
111907  *         if _FIND_PI_HREF(text):
111908  */
111909     __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_641), __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111910     __Pyx_GOTREF(__pyx_t_1);
111911     __Pyx_DECREF(__pyx_v_attrib);
111912     __pyx_v_attrib = __pyx_t_1;
111913     __pyx_t_1 = 0;
111914   }
111915   __pyx_L7:;
111916
111917   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":874
111918  *         else:
111919  *             attrib = u' href="%s"' % value
111920  *         text = u' ' + self.text             # <<<<<<<<<<<<<<
111921  *         if _FIND_PI_HREF(text):
111922  *             self.text = _REPLACE_PI_HREF(attrib, text)
111923  */
111924   __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_text); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111925   __Pyx_GOTREF(__pyx_t_1);
111926   __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_kp_642), __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111927   __Pyx_GOTREF(__pyx_t_5);
111928   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
111929   __Pyx_DECREF(__pyx_v_text);
111930   __pyx_v_text = __pyx_t_5;
111931   __pyx_t_5 = 0;
111932
111933   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":875
111934  *             attrib = u' href="%s"' % value
111935  *         text = u' ' + self.text
111936  *         if _FIND_PI_HREF(text):             # <<<<<<<<<<<<<<
111937  *             self.text = _REPLACE_PI_HREF(attrib, text)
111938  *         else:
111939  */
111940   __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111941   __Pyx_GOTREF(((PyObject *)__pyx_t_5));
111942   __Pyx_INCREF(__pyx_v_text);
111943   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_text);
111944   __Pyx_GIVEREF(__pyx_v_text);
111945   __pyx_t_1 = PyObject_Call(__pyx_v_4lxml_5etree__FIND_PI_HREF, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111946   __Pyx_GOTREF(__pyx_t_1);
111947   __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
111948   __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111949   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
111950   if (__pyx_t_4) {
111951
111952     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":876
111953  *         text = u' ' + self.text
111954  *         if _FIND_PI_HREF(text):
111955  *             self.text = _REPLACE_PI_HREF(attrib, text)             # <<<<<<<<<<<<<<
111956  *         else:
111957  *             self.text = text + attrib
111958  */
111959     __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111960     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
111961     __Pyx_INCREF(__pyx_v_attrib);
111962     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_attrib);
111963     __Pyx_GIVEREF(__pyx_v_attrib);
111964     __Pyx_INCREF(__pyx_v_text);
111965     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_text);
111966     __Pyx_GIVEREF(__pyx_v_text);
111967     __pyx_t_5 = PyObject_Call(__pyx_v_4lxml_5etree__REPLACE_PI_HREF, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111968     __Pyx_GOTREF(__pyx_t_5);
111969     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
111970     if (PyObject_SetAttr(__pyx_v_self, __pyx_kp_text, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111971     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
111972     goto __pyx_L8;
111973   }
111974   /*else*/ {
111975
111976     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":878
111977  *             self.text = _REPLACE_PI_HREF(attrib, text)
111978  *         else:
111979  *             self.text = text + attrib             # <<<<<<<<<<<<<<
111980  * 
111981  *     def get(self, key, default=None):
111982  */
111983     __pyx_t_5 = PyNumber_Add(__pyx_v_text, __pyx_v_attrib); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111984     __Pyx_GOTREF(__pyx_t_5);
111985     if (PyObject_SetAttr(__pyx_v_self, __pyx_kp_text, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
111986     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
111987   }
111988   __pyx_L8:;
111989
111990   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
111991   goto __pyx_L0;
111992   __pyx_L1_error:;
111993   __Pyx_XDECREF(__pyx_t_1);
111994   __Pyx_XDECREF(__pyx_t_5);
111995   __Pyx_AddTraceback("lxml.etree._XSLTProcessingInstruction.set");
111996   __pyx_r = NULL;
111997   __pyx_L0:;
111998   __Pyx_DECREF(__pyx_v_attrib);
111999   __Pyx_DECREF(__pyx_v_text);
112000   __Pyx_XGIVEREF(__pyx_r);
112001   __Pyx_FinishRefcountContext();
112002   return __pyx_r;
112003 }
112004
112005 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":880
112006  *             self.text = text + attrib
112007  * 
112008  *     def get(self, key, default=None):             # <<<<<<<<<<<<<<
112009  *         for attr, value in _FIND_PI_ATTRIBUTES(u' ' + self.text):
112010  *             if attr == key:
112011  */
112012
112013 static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
112014 static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
112015   PyObject *__pyx_v_key = 0;
112016   PyObject *__pyx_v_default = 0;
112017   PyObject *__pyx_v_attr;
112018   PyObject *__pyx_v_value;
112019   PyObject *__pyx_r = NULL;
112020   PyObject *__pyx_1 = 0;
112021   PyObject *__pyx_2 = 0;
112022   PyObject *__pyx_3 = 0;
112023   Py_ssize_t __pyx_t_1;
112024   PyObject *__pyx_t_2 = NULL;
112025   PyObject *__pyx_t_3 = NULL;
112026   int __pyx_t_4;
112027   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_key,&__pyx_kp_default,0};
112028   __Pyx_SetupRefcountContext("get");
112029   if (unlikely(__pyx_kwds)) {
112030     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
112031     PyObject* values[2] = {0,0};
112032     values[1] = Py_None;
112033     switch (PyTuple_GET_SIZE(__pyx_args)) {
112034       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
112035       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
112036       case  0: break;
112037       default: goto __pyx_L5_argtuple_error;
112038     }
112039     switch (PyTuple_GET_SIZE(__pyx_args)) {
112040       case  0:
112041       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_key);
112042       if (likely(values[0])) kw_args--;
112043       else goto __pyx_L5_argtuple_error;
112044       case  1:
112045       if (kw_args > 1) {
112046         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_default);
112047         if (unlikely(value)) { values[1] = value; kw_args--; }
112048       }
112049     }
112050     if (unlikely(kw_args > 0)) {
112051       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "get") < 0)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
112052     }
112053     __pyx_v_key = values[0];
112054     __pyx_v_default = values[1];
112055   } else {
112056     __pyx_v_default = Py_None;
112057     switch (PyTuple_GET_SIZE(__pyx_args)) {
112058       case  2: __pyx_v_default = PyTuple_GET_ITEM(__pyx_args, 1);
112059       case  1: __pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 0);
112060       break;
112061       default: goto __pyx_L5_argtuple_error;
112062     }
112063   }
112064   goto __pyx_L4_argument_unpacking_done;
112065   __pyx_L5_argtuple_error:;
112066   __Pyx_RaiseArgtupleInvalid("get", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[18]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
112067   __pyx_L3_error:;
112068   __Pyx_AddTraceback("lxml.etree._XSLTProcessingInstruction.get");
112069   return NULL;
112070   __pyx_L4_argument_unpacking_done:;
112071   __pyx_v_attr = Py_None; __Pyx_INCREF(Py_None);
112072   __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);
112073
112074   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":881
112075  * 
112076  *     def get(self, key, default=None):
112077  *         for attr, value in _FIND_PI_ATTRIBUTES(u' ' + self.text):             # <<<<<<<<<<<<<<
112078  *             if attr == key:
112079  *                 return value
112080  */
112081   __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_text); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
112082   __Pyx_GOTREF(__pyx_t_2);
112083   __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_kp_643), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
112084   __Pyx_GOTREF(__pyx_t_3);
112085   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
112086   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
112087   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
112088   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
112089   __Pyx_GIVEREF(__pyx_t_3);
112090   __pyx_t_3 = 0;
112091   __pyx_t_3 = PyObject_Call(__pyx_v_4lxml_5etree__FIND_PI_ATTRIBUTES, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
112092   __Pyx_GOTREF(__pyx_t_3);
112093   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
112094   if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
112095     __pyx_t_1 = 0; __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2);
112096   } else {
112097     __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
112098     __Pyx_GOTREF(__pyx_t_2);
112099   }
112100   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
112101   for (;;) {
112102     if (likely(PyList_CheckExact(__pyx_t_2))) {
112103       if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break;
112104       __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
112105     } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
112106       if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
112107       __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
112108     } else {
112109       __pyx_t_3 = PyIter_Next(__pyx_t_2);
112110       if (!__pyx_t_3) {
112111         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
112112         break;
112113       }
112114       __Pyx_GOTREF(__pyx_t_3);
112115     }
112116     if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) {
112117       PyObject* tuple = __pyx_t_3;
112118       __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
112119       __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
112120       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
112121       __Pyx_DECREF(__pyx_v_attr);
112122       __pyx_v_attr = __pyx_2;
112123       __pyx_2 = 0;
112124       __Pyx_DECREF(__pyx_v_value);
112125       __pyx_v_value = __pyx_3;
112126       __pyx_3 = 0;
112127     } else {
112128       __pyx_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
112129       __Pyx_GOTREF(__pyx_1);
112130       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
112131       __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
112132       __Pyx_GOTREF(__pyx_2);
112133       __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
112134       __Pyx_GOTREF(__pyx_3);
112135       if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
112136       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
112137       __Pyx_DECREF(__pyx_v_attr);
112138       __pyx_v_attr = __pyx_2;
112139       __pyx_2 = 0;
112140       __Pyx_DECREF(__pyx_v_value);
112141       __pyx_v_value = __pyx_3;
112142       __pyx_3 = 0;
112143     }
112144
112145     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":882
112146  *     def get(self, key, default=None):
112147  *         for attr, value in _FIND_PI_ATTRIBUTES(u' ' + self.text):
112148  *             if attr == key:             # <<<<<<<<<<<<<<
112149  *                 return value
112150  *         return default
112151  */
112152     __pyx_t_3 = PyObject_RichCompare(__pyx_v_attr, __pyx_v_key, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
112153     __Pyx_GOTREF(__pyx_t_3);
112154     __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
112155     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
112156     if (__pyx_t_4) {
112157
112158       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":883
112159  *         for attr, value in _FIND_PI_ATTRIBUTES(u' ' + self.text):
112160  *             if attr == key:
112161  *                 return value             # <<<<<<<<<<<<<<
112162  *         return default
112163  */
112164       __Pyx_XDECREF(__pyx_r);
112165       __Pyx_INCREF(__pyx_v_value);
112166       __pyx_r = __pyx_v_value;
112167       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
112168       goto __pyx_L0;
112169       goto __pyx_L8;
112170     }
112171     __pyx_L8:;
112172   }
112173   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
112174
112175   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":884
112176  *             if attr == key:
112177  *                 return value
112178  *         return default             # <<<<<<<<<<<<<<
112179  */
112180   __Pyx_XDECREF(__pyx_r);
112181   __Pyx_INCREF(__pyx_v_default);
112182   __pyx_r = __pyx_v_default;
112183   goto __pyx_L0;
112184
112185   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
112186   goto __pyx_L0;
112187   __pyx_L1_error:;
112188   __Pyx_XDECREF(__pyx_1);
112189   __Pyx_XDECREF(__pyx_2);
112190   __Pyx_XDECREF(__pyx_3);
112191   __Pyx_XDECREF(__pyx_t_2);
112192   __Pyx_XDECREF(__pyx_t_3);
112193   __Pyx_AddTraceback("lxml.etree._XSLTProcessingInstruction.get");
112194   __pyx_r = NULL;
112195   __pyx_L0:;
112196   __Pyx_DECREF(__pyx_v_attr);
112197   __Pyx_DECREF(__pyx_v_value);
112198   __Pyx_XGIVEREF(__pyx_r);
112199   __Pyx_FinishRefcountContext();
112200   return __pyx_r;
112201 }
112202
112203 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":6
112204  *     u"""Base class of an XSLT extension element.
112205  *     """
112206  *     def execute(self, context, self_node, input_node, output_parent):             # <<<<<<<<<<<<<<
112207  *         u"""execute(self, context, self_node, input_node, output_parent)
112208  *         Execute this extension element.
112209  */
112210
112211 static PyObject *__pyx_pf_4lxml_5etree_13XSLTExtension_execute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
112212 static char __pyx_doc_4lxml_5etree_13XSLTExtension_execute[] = "execute(self, context, self_node, input_node, output_parent)\n        Execute this extension element.\n\n        Subclasses must override this method.  They may append\n        elements to the `output_parent` element here, or set its text\n        content.  To this end, the `input_node` provides read-only\n        access to the current node in the input document, and the\n        `self_node` points to the extension element in the stylesheet.\n        ";
112213 static PyObject *__pyx_pf_4lxml_5etree_13XSLTExtension_execute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
112214   PyObject *__pyx_v_context = 0;
112215   PyObject *__pyx_v_self_node = 0;
112216   PyObject *__pyx_v_input_node = 0;
112217   PyObject *__pyx_v_output_parent = 0;
112218   PyObject *__pyx_r = NULL;
112219   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_context,&__pyx_kp_self_node,&__pyx_kp_input_node,&__pyx_kp_output_parent,0};
112220   __Pyx_SetupRefcountContext("execute");
112221   if (unlikely(__pyx_kwds)) {
112222     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
112223     PyObject* values[4] = {0,0,0,0};
112224     switch (PyTuple_GET_SIZE(__pyx_args)) {
112225       case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
112226       case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
112227       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
112228       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
112229       case  0: break;
112230       default: goto __pyx_L5_argtuple_error;
112231     }
112232     switch (PyTuple_GET_SIZE(__pyx_args)) {
112233       case  0:
112234       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_context);
112235       if (likely(values[0])) kw_args--;
112236       else goto __pyx_L5_argtuple_error;
112237       case  1:
112238       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_self_node);
112239       if (likely(values[1])) kw_args--;
112240       else {
112241         __Pyx_RaiseArgtupleInvalid("execute", 1, 4, 4, 1); {__pyx_filename = __pyx_f[19]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
112242       }
112243       case  2:
112244       values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_input_node);
112245       if (likely(values[2])) kw_args--;
112246       else {
112247         __Pyx_RaiseArgtupleInvalid("execute", 1, 4, 4, 2); {__pyx_filename = __pyx_f[19]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
112248       }
112249       case  3:
112250       values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_output_parent);
112251       if (likely(values[3])) kw_args--;
112252       else {
112253         __Pyx_RaiseArgtupleInvalid("execute", 1, 4, 4, 3); {__pyx_filename = __pyx_f[19]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
112254       }
112255     }
112256     if (unlikely(kw_args > 0)) {
112257       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "execute") < 0)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
112258     }
112259     __pyx_v_context = values[0];
112260     __pyx_v_self_node = values[1];
112261     __pyx_v_input_node = values[2];
112262     __pyx_v_output_parent = values[3];
112263   } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
112264     goto __pyx_L5_argtuple_error;
112265   } else {
112266     __pyx_v_context = PyTuple_GET_ITEM(__pyx_args, 0);
112267     __pyx_v_self_node = PyTuple_GET_ITEM(__pyx_args, 1);
112268     __pyx_v_input_node = PyTuple_GET_ITEM(__pyx_args, 2);
112269     __pyx_v_output_parent = PyTuple_GET_ITEM(__pyx_args, 3);
112270   }
112271   goto __pyx_L4_argument_unpacking_done;
112272   __pyx_L5_argtuple_error:;
112273   __Pyx_RaiseArgtupleInvalid("execute", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[19]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
112274   __pyx_L3_error:;
112275   __Pyx_AddTraceback("lxml.etree.XSLTExtension.execute");
112276   return NULL;
112277   __pyx_L4_argument_unpacking_done:;
112278
112279   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
112280   __Pyx_XGIVEREF(__pyx_r);
112281   __Pyx_FinishRefcountContext();
112282   return __pyx_r;
112283 }
112284
112285 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":18
112286  *         pass
112287  * 
112288  *     def apply_templates(self, _XSLTContext context not None, node):             # <<<<<<<<<<<<<<
112289  *         u"""apply_templates(self, context, node)
112290  * 
112291  */
112292
112293 static PyObject *__pyx_pf_4lxml_5etree_13XSLTExtension_apply_templates(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
112294 static char __pyx_doc_4lxml_5etree_13XSLTExtension_apply_templates[] = "apply_templates(self, context, node)\n\n        Call this method to retrieve the result of applying templates\n        to an element.\n\n        The return value is a list of elements or text strings that\n        were generated by the XSLT processor.\n        ";
112295 static PyObject *__pyx_pf_4lxml_5etree_13XSLTExtension_apply_templates(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
112296   struct __pyx_obj_4lxml_5etree__XSLTContext *__pyx_v_context = 0;
112297   PyObject *__pyx_v_node = 0;
112298   xmlNode *__pyx_v_c_parent;
112299   xmlNode *__pyx_v_c_node;
112300   xmlNode *__pyx_v_c_next;
112301   xmlNode *__pyx_v_c_context_node;
112302   struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *__pyx_v_proxy;
112303   PyObject *__pyx_v_results;
112304   PyObject *__pyx_r = NULL;
112305   xmlNode *__pyx_t_1;
112306   PyObject *__pyx_t_2 = NULL;
112307   int __pyx_t_3;
112308   int __pyx_t_4;
112309   PyObject *__pyx_t_5 = NULL;
112310   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_context,&__pyx_kp_node,0};
112311   __Pyx_SetupRefcountContext("apply_templates");
112312   if (unlikely(__pyx_kwds)) {
112313     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
112314     PyObject* values[2] = {0,0};
112315     switch (PyTuple_GET_SIZE(__pyx_args)) {
112316       case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
112317       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
112318       case  0: break;
112319       default: goto __pyx_L5_argtuple_error;
112320     }
112321     switch (PyTuple_GET_SIZE(__pyx_args)) {
112322       case  0:
112323       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_context);
112324       if (likely(values[0])) kw_args--;
112325       else goto __pyx_L5_argtuple_error;
112326       case  1:
112327       values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_node);
112328       if (likely(values[1])) kw_args--;
112329       else {
112330         __Pyx_RaiseArgtupleInvalid("apply_templates", 1, 2, 2, 1); {__pyx_filename = __pyx_f[19]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
112331       }
112332     }
112333     if (unlikely(kw_args > 0)) {
112334       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "apply_templates") < 0)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
112335     }
112336     __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__XSLTContext *)values[0]);
112337     __pyx_v_node = values[1];
112338   } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
112339     goto __pyx_L5_argtuple_error;
112340   } else {
112341     __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__XSLTContext *)PyTuple_GET_ITEM(__pyx_args, 0));
112342     __pyx_v_node = PyTuple_GET_ITEM(__pyx_args, 1);
112343   }
112344   goto __pyx_L4_argument_unpacking_done;
112345   __pyx_L5_argtuple_error:;
112346   __Pyx_RaiseArgtupleInvalid("apply_templates", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[19]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
112347   __pyx_L3_error:;
112348   __Pyx_AddTraceback("lxml.etree.XSLTExtension.apply_templates");
112349   return NULL;
112350   __pyx_L4_argument_unpacking_done:;
112351   __pyx_v_proxy = ((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)Py_None); __Pyx_INCREF(Py_None);
112352   __pyx_v_results = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
112353   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_4lxml_5etree__XSLTContext, 0, "context", 0))) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
112354
112355   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":33
112356  *         cdef _ReadOnlyElementProxy proxy
112357  *         cdef list results
112358  *         c_context_node = _roNodeOf(node)             # <<<<<<<<<<<<<<
112359  *         #assert c_context_node.doc is context._xsltContext.node.doc, \
112360  *         #    "switching input documents during transformation is not currently supported"
112361  */
112362   __pyx_t_1 = __pyx_f_4lxml_5etree__roNodeOf(__pyx_v_node); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
112363   __pyx_v_c_context_node = __pyx_t_1;
112364
112365   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":38
112366  * 
112367  *         c_parent = tree.xmlNewDocNode(
112368  *             context._xsltCtxt.output, NULL, "fake-parent", NULL)             # <<<<<<<<<<<<<<
112369  * 
112370  *         c_node = context._xsltCtxt.insert
112371  */
112372   __pyx_v_c_parent = xmlNewDocNode(__pyx_v_context->_xsltCtxt->output, NULL, __pyx_k_644, NULL);
112373
112374   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":40
112375  *             context._xsltCtxt.output, NULL, "fake-parent", NULL)
112376  * 
112377  *         c_node = context._xsltCtxt.insert             # <<<<<<<<<<<<<<
112378  *         context._xsltCtxt.insert = c_parent
112379  *         xslt.xsltProcessOneNode(
112380  */
112381   __pyx_v_c_node = __pyx_v_context->_xsltCtxt->insert;
112382
112383   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":41
112384  * 
112385  *         c_node = context._xsltCtxt.insert
112386  *         context._xsltCtxt.insert = c_parent             # <<<<<<<<<<<<<<
112387  *         xslt.xsltProcessOneNode(
112388  *             context._xsltCtxt, c_context_node, NULL)
112389  */
112390   __pyx_v_context->_xsltCtxt->insert = __pyx_v_c_parent;
112391
112392   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":43
112393  *         context._xsltCtxt.insert = c_parent
112394  *         xslt.xsltProcessOneNode(
112395  *             context._xsltCtxt, c_context_node, NULL)             # <<<<<<<<<<<<<<
112396  *         context._xsltCtxt.insert = c_node
112397  * 
112398  */
112399   xsltProcessOneNode(__pyx_v_context->_xsltCtxt, __pyx_v_c_context_node, NULL);
112400
112401   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":44
112402  *         xslt.xsltProcessOneNode(
112403  *             context._xsltCtxt, c_context_node, NULL)
112404  *         context._xsltCtxt.insert = c_node             # <<<<<<<<<<<<<<
112405  * 
112406  *         results = [] # or maybe _collectAttributes(c_parent, 2) ?
112407  */
112408   __pyx_v_context->_xsltCtxt->insert = __pyx_v_c_node;
112409
112410   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":46
112411  *         context._xsltCtxt.insert = c_node
112412  * 
112413  *         results = [] # or maybe _collectAttributes(c_parent, 2) ?             # <<<<<<<<<<<<<<
112414  *         c_node = c_parent.children
112415  *         try:
112416  */
112417   __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
112418   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
112419   __Pyx_DECREF(((PyObject *)__pyx_v_results));
112420   __pyx_v_results = __pyx_t_2;
112421   __pyx_t_2 = 0;
112422
112423   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":47
112424  * 
112425  *         results = [] # or maybe _collectAttributes(c_parent, 2) ?
112426  *         c_node = c_parent.children             # <<<<<<<<<<<<<<
112427  *         try:
112428  *             while c_node is not NULL:
112429  */
112430   __pyx_v_c_node = __pyx_v_c_parent->children;
112431
112432   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":48
112433  *         results = [] # or maybe _collectAttributes(c_parent, 2) ?
112434  *         c_node = c_parent.children
112435  *         try:             # <<<<<<<<<<<<<<
112436  *             while c_node is not NULL:
112437  *                 c_next = c_node.next
112438  */
112439   /*try:*/ {
112440
112441     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":49
112442  *         c_node = c_parent.children
112443  *         try:
112444  *             while c_node is not NULL:             # <<<<<<<<<<<<<<
112445  *                 c_next = c_node.next
112446  *                 if c_node.type == tree.XML_TEXT_NODE:
112447  */
112448     while (1) {
112449       __pyx_t_3 = (__pyx_v_c_node != NULL);
112450       if (!__pyx_t_3) break;
112451
112452       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":50
112453  *         try:
112454  *             while c_node is not NULL:
112455  *                 c_next = c_node.next             # <<<<<<<<<<<<<<
112456  *                 if c_node.type == tree.XML_TEXT_NODE:
112457  *                     results.append(funicode(c_node.content))
112458  */
112459       __pyx_v_c_next = __pyx_v_c_node->next;
112460
112461       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":51
112462  *             while c_node is not NULL:
112463  *                 c_next = c_node.next
112464  *                 if c_node.type == tree.XML_TEXT_NODE:             # <<<<<<<<<<<<<<
112465  *                     results.append(funicode(c_node.content))
112466  *                 elif c_node.type == tree.XML_ELEMENT_NODE:
112467  */
112468       __pyx_t_3 = (__pyx_v_c_node->type == XML_TEXT_NODE);
112469       if (__pyx_t_3) {
112470
112471         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":52
112472  *                 c_next = c_node.next
112473  *                 if c_node.type == tree.XML_TEXT_NODE:
112474  *                     results.append(funicode(c_node.content))             # <<<<<<<<<<<<<<
112475  *                 elif c_node.type == tree.XML_ELEMENT_NODE:
112476  *                     proxy = _newReadOnlyProxy(
112477  */
112478         __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_node->content); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L7;}
112479         __Pyx_GOTREF(__pyx_t_2);
112480         __pyx_t_4 = PyList_Append(((PyObject *)__pyx_v_results), __pyx_t_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L7;}
112481         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
112482         goto __pyx_L11;
112483       }
112484
112485       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":53
112486  *                 if c_node.type == tree.XML_TEXT_NODE:
112487  *                     results.append(funicode(c_node.content))
112488  *                 elif c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
112489  *                     proxy = _newReadOnlyProxy(
112490  *                         context._extension_element_proxy, c_node)
112491  */
112492       __pyx_t_3 = (__pyx_v_c_node->type == XML_ELEMENT_NODE);
112493       if (__pyx_t_3) {
112494
112495         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":55
112496  *                 elif c_node.type == tree.XML_ELEMENT_NODE:
112497  *                     proxy = _newReadOnlyProxy(
112498  *                         context._extension_element_proxy, c_node)             # <<<<<<<<<<<<<<
112499  *                     results.append(proxy)
112500  *                     # unlink node and make sure it will be freed later on
112501  */
112502         __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__newReadOnlyProxy(__pyx_v_context->_extension_element_proxy, __pyx_v_c_node)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L7;}
112503         __Pyx_GOTREF(__pyx_t_2);
112504         __Pyx_DECREF(((PyObject *)__pyx_v_proxy));
112505         __pyx_v_proxy = ((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_t_2);
112506         __pyx_t_2 = 0;
112507
112508         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":56
112509  *                     proxy = _newReadOnlyProxy(
112510  *                         context._extension_element_proxy, c_node)
112511  *                     results.append(proxy)             # <<<<<<<<<<<<<<
112512  *                     # unlink node and make sure it will be freed later on
112513  *                     tree.xmlUnlinkNode(c_node)
112514  */
112515         __pyx_t_4 = PyList_Append(((PyObject *)__pyx_v_results), ((PyObject *)__pyx_v_proxy)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L7;}
112516
112517         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":58
112518  *                     results.append(proxy)
112519  *                     # unlink node and make sure it will be freed later on
112520  *                     tree.xmlUnlinkNode(c_node)             # <<<<<<<<<<<<<<
112521  *                     proxy.free_after_use()
112522  *                 else:
112523  */
112524         xmlUnlinkNode(__pyx_v_c_node);
112525
112526         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":59
112527  *                     # unlink node and make sure it will be freed later on
112528  *                     tree.xmlUnlinkNode(c_node)
112529  *                     proxy.free_after_use()             # <<<<<<<<<<<<<<
112530  *                 else:
112531  *                     raise TypeError, \
112532  */
112533         ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_proxy->__pyx_vtab)->free_after_use(__pyx_v_proxy);
112534         goto __pyx_L11;
112535       }
112536       /*else*/ {
112537
112538         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":62
112539  *                 else:
112540  *                     raise TypeError, \
112541  *                         u"unsupported XSLT result type: %d" % c_node.type             # <<<<<<<<<<<<<<
112542  *                 c_node = c_next
112543  *         finally:
112544  */
112545         __pyx_t_2 = PyInt_FromLong(__pyx_v_c_node->type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L7;}
112546         __Pyx_GOTREF(__pyx_t_2);
112547         __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_645), __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L7;}
112548         __Pyx_GOTREF(__pyx_t_5);
112549         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
112550         __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_5, 0);
112551         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
112552         {__pyx_filename = __pyx_f[19]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L7;}
112553       }
112554       __pyx_L11:;
112555
112556       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":63
112557  *                     raise TypeError, \
112558  *                         u"unsupported XSLT result type: %d" % c_node.type
112559  *                 c_node = c_next             # <<<<<<<<<<<<<<
112560  *         finally:
112561  *             # free all intermediate nodes that will not be freed by proxies
112562  */
112563       __pyx_v_c_node = __pyx_v_c_next;
112564     }
112565   }
112566   /*finally:*/ {
112567     int __pyx_why;
112568     PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
112569     int __pyx_exc_lineno;
112570     __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
112571     __pyx_why = 0; goto __pyx_L8;
112572     __pyx_L7: {
112573       __pyx_why = 4;
112574       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
112575       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
112576       __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
112577       __pyx_exc_lineno = __pyx_lineno;
112578       goto __pyx_L8;
112579     }
112580     __pyx_L8:;
112581
112582     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":66
112583  *         finally:
112584  *             # free all intermediate nodes that will not be freed by proxies
112585  *             tree.xmlFreeNode(c_parent)             # <<<<<<<<<<<<<<
112586  *         return results
112587  * 
112588  */
112589     xmlFreeNode(__pyx_v_c_parent);
112590     switch (__pyx_why) {
112591       case 4: {
112592         __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
112593         __pyx_lineno = __pyx_exc_lineno;
112594         __pyx_exc_type = 0;
112595         __pyx_exc_value = 0;
112596         __pyx_exc_tb = 0;
112597         goto __pyx_L1_error;
112598       }
112599     }
112600   }
112601
112602   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":67
112603  *             # free all intermediate nodes that will not be freed by proxies
112604  *             tree.xmlFreeNode(c_parent)
112605  *         return results             # <<<<<<<<<<<<<<
112606  * 
112607  * 
112608  */
112609   __Pyx_XDECREF(__pyx_r);
112610   __Pyx_INCREF(((PyObject *)__pyx_v_results));
112611   __pyx_r = ((PyObject *)__pyx_v_results);
112612   goto __pyx_L0;
112613
112614   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
112615   goto __pyx_L0;
112616   __pyx_L1_error:;
112617   __Pyx_XDECREF(__pyx_t_2);
112618   __Pyx_XDECREF(__pyx_t_5);
112619   __Pyx_AddTraceback("lxml.etree.XSLTExtension.apply_templates");
112620   __pyx_r = NULL;
112621   __pyx_L0:;
112622   __Pyx_DECREF((PyObject *)__pyx_v_proxy);
112623   __Pyx_DECREF(__pyx_v_results);
112624   __Pyx_XGIVEREF(__pyx_r);
112625   __Pyx_FinishRefcountContext();
112626   return __pyx_r;
112627 }
112628
112629 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":70
112630  * 
112631  * 
112632  * cdef _registerXSLTExtensions(xslt.xsltTransformContext* c_ctxt,             # <<<<<<<<<<<<<<
112633  *                              extension_dict):
112634  *     for ns_utf, name_utf in extension_dict:
112635  */
112636
112637 static  PyObject *__pyx_f_4lxml_5etree__registerXSLTExtensions(xsltTransformContext *__pyx_v_c_ctxt, PyObject *__pyx_v_extension_dict) {
112638   PyObject *__pyx_v_ns_utf;
112639   PyObject *__pyx_v_name_utf;
112640   PyObject *__pyx_r = NULL;
112641   PyObject *__pyx_1 = 0;
112642   PyObject *__pyx_2 = 0;
112643   PyObject *__pyx_3 = 0;
112644   Py_ssize_t __pyx_t_1;
112645   PyObject *__pyx_t_2 = NULL;
112646   PyObject *__pyx_t_3 = NULL;
112647   __Pyx_SetupRefcountContext("_registerXSLTExtensions");
112648   __pyx_v_ns_utf = Py_None; __Pyx_INCREF(Py_None);
112649   __pyx_v_name_utf = Py_None; __Pyx_INCREF(Py_None);
112650
112651   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":72
112652  * cdef _registerXSLTExtensions(xslt.xsltTransformContext* c_ctxt,
112653  *                              extension_dict):
112654  *     for ns_utf, name_utf in extension_dict:             # <<<<<<<<<<<<<<
112655  *         xslt.xsltRegisterExtElement(
112656  *             c_ctxt, _cstr(name_utf), _cstr(ns_utf), _callExtensionElement)
112657  */
112658   if (PyList_CheckExact(__pyx_v_extension_dict) || PyTuple_CheckExact(__pyx_v_extension_dict)) {
112659     __pyx_t_1 = 0; __pyx_t_2 = __pyx_v_extension_dict; __Pyx_INCREF(__pyx_t_2);
112660   } else {
112661     __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_extension_dict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
112662     __Pyx_GOTREF(__pyx_t_2);
112663   }
112664   for (;;) {
112665     if (likely(PyList_CheckExact(__pyx_t_2))) {
112666       if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break;
112667       __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
112668     } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
112669       if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
112670       __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
112671     } else {
112672       __pyx_t_3 = PyIter_Next(__pyx_t_2);
112673       if (!__pyx_t_3) {
112674         if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
112675         break;
112676       }
112677       __Pyx_GOTREF(__pyx_t_3);
112678     }
112679     if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) {
112680       PyObject* tuple = __pyx_t_3;
112681       __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
112682       __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
112683       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
112684       __Pyx_DECREF(__pyx_v_ns_utf);
112685       __pyx_v_ns_utf = __pyx_2;
112686       __pyx_2 = 0;
112687       __Pyx_DECREF(__pyx_v_name_utf);
112688       __pyx_v_name_utf = __pyx_3;
112689       __pyx_3 = 0;
112690     } else {
112691       __pyx_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
112692       __Pyx_GOTREF(__pyx_1);
112693       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
112694       __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
112695       __Pyx_GOTREF(__pyx_2);
112696       __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
112697       __Pyx_GOTREF(__pyx_3);
112698       if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
112699       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
112700       __Pyx_DECREF(__pyx_v_ns_utf);
112701       __pyx_v_ns_utf = __pyx_2;
112702       __pyx_2 = 0;
112703       __Pyx_DECREF(__pyx_v_name_utf);
112704       __pyx_v_name_utf = __pyx_3;
112705       __pyx_3 = 0;
112706     }
112707
112708     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":74
112709  *     for ns_utf, name_utf in extension_dict:
112710  *         xslt.xsltRegisterExtElement(
112711  *             c_ctxt, _cstr(name_utf), _cstr(ns_utf), _callExtensionElement)             # <<<<<<<<<<<<<<
112712  * 
112713  * cdef void _callExtensionElement(xslt.xsltTransformContext* c_ctxt,
112714  */
112715     xsltRegisterExtElement(__pyx_v_c_ctxt, PyString_AS_STRING(__pyx_v_name_utf), PyString_AS_STRING(__pyx_v_ns_utf), __pyx_f_4lxml_5etree__callExtensionElement);
112716   }
112717   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
112718
112719   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
112720   goto __pyx_L0;
112721   __pyx_L1_error:;
112722   __Pyx_XDECREF(__pyx_1);
112723   __Pyx_XDECREF(__pyx_2);
112724   __Pyx_XDECREF(__pyx_3);
112725   __Pyx_XDECREF(__pyx_t_2);
112726   __Pyx_XDECREF(__pyx_t_3);
112727   __Pyx_AddTraceback("lxml.etree._registerXSLTExtensions");
112728   __pyx_r = 0;
112729   __pyx_L0:;
112730   __Pyx_DECREF(__pyx_v_ns_utf);
112731   __Pyx_DECREF(__pyx_v_name_utf);
112732   __Pyx_XGIVEREF(__pyx_r);
112733   __Pyx_FinishRefcountContext();
112734   return __pyx_r;
112735 }
112736
112737 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":76
112738  *             c_ctxt, _cstr(name_utf), _cstr(ns_utf), _callExtensionElement)
112739  * 
112740  * cdef void _callExtensionElement(xslt.xsltTransformContext* c_ctxt,             # <<<<<<<<<<<<<<
112741  *                                 xmlNode* c_context_node,
112742  *                                 xmlNode* c_inst_node,
112743  */
112744
112745 static  void __pyx_f_4lxml_5etree__callExtensionElement(xsltTransformContext *__pyx_v_c_ctxt, xmlNode *__pyx_v_c_context_node, xmlNode *__pyx_v_c_inst_node, void *__pyx_v_dummy) {
112746   struct __pyx_obj_4lxml_5etree__XSLTContext *__pyx_v_context;
112747   struct __pyx_obj_4lxml_5etree_XSLTExtension *__pyx_v_extension;
112748   PyObject *__pyx_v_dict_result;
112749   char *__pyx_v_c_uri;
112750   struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *__pyx_v_context_node;
112751   struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *__pyx_v_self_node;
112752   struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *__pyx_v_output_parent;
112753   PyObject *__pyx_v_e;
112754   PyObject *__pyx_v_message;
112755   int __pyx_1;
112756   PyObject *__pyx_2 = 0;
112757   PyObject *__pyx_3 = 0;
112758   PyObject *__pyx_4 = 0;
112759   int __pyx_t_1;
112760   PyObject *__pyx_t_2 = NULL;
112761   PyObject *__pyx_t_3 = NULL;
112762   PyObject *__pyx_t_4 = NULL;
112763   char *__pyx_t_5;
112764   PyObject *__pyx_t_6 = NULL;
112765   PyGILState_STATE _save = PyGILState_Ensure();
112766   __Pyx_SetupRefcountContext("_callExtensionElement");
112767   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__XSLTContext *)Py_None); __Pyx_INCREF(Py_None);
112768   __pyx_v_extension = ((struct __pyx_obj_4lxml_5etree_XSLTExtension *)Py_None); __Pyx_INCREF(Py_None);
112769   __pyx_v_context_node = ((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)Py_None); __Pyx_INCREF(Py_None);
112770   __pyx_v_self_node = ((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)Py_None); __Pyx_INCREF(Py_None);
112771   __pyx_v_output_parent = ((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)Py_None); __Pyx_INCREF(Py_None);
112772   __pyx_v_e = Py_None; __Pyx_INCREF(Py_None);
112773   __pyx_v_message = Py_None; __Pyx_INCREF(Py_None);
112774
112775   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":85
112776  *     cdef char* c_uri
112777  *     cdef _ReadOnlyElementProxy context_node, self_node, output_parent
112778  *     c_uri = _getNs(c_inst_node)             # <<<<<<<<<<<<<<
112779  *     if c_uri is NULL:
112780  *         # not allowed, and should never happen
112781  */
112782   __pyx_v_c_uri = _getNs(__pyx_v_c_inst_node);
112783
112784   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":86
112785  *     cdef _ReadOnlyElementProxy context_node, self_node, output_parent
112786  *     c_uri = _getNs(c_inst_node)
112787  *     if c_uri is NULL:             # <<<<<<<<<<<<<<
112788  *         # not allowed, and should never happen
112789  *         return
112790  */
112791   __pyx_t_1 = (__pyx_v_c_uri == NULL);
112792   if (__pyx_t_1) {
112793
112794     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":88
112795  *     if c_uri is NULL:
112796  *         # not allowed, and should never happen
112797  *         return             # <<<<<<<<<<<<<<
112798  *     if c_ctxt.xpathCtxt.userData is NULL:
112799  *         # just for safety, should never happen
112800  */
112801     goto __pyx_L0;
112802     goto __pyx_L3;
112803   }
112804   __pyx_L3:;
112805
112806   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":89
112807  *         # not allowed, and should never happen
112808  *         return
112809  *     if c_ctxt.xpathCtxt.userData is NULL:             # <<<<<<<<<<<<<<
112810  *         # just for safety, should never happen
112811  *         return
112812  */
112813   __pyx_t_1 = (__pyx_v_c_ctxt->xpathCtxt->userData == NULL);
112814   if (__pyx_t_1) {
112815
112816     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":91
112817  *     if c_ctxt.xpathCtxt.userData is NULL:
112818  *         # just for safety, should never happen
112819  *         return             # <<<<<<<<<<<<<<
112820  *     context = <_XSLTContext>c_ctxt.xpathCtxt.userData
112821  *     try:
112822  */
112823     goto __pyx_L0;
112824     goto __pyx_L4;
112825   }
112826   __pyx_L4:;
112827
112828   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":92
112829  *         # just for safety, should never happen
112830  *         return
112831  *     context = <_XSLTContext>c_ctxt.xpathCtxt.userData             # <<<<<<<<<<<<<<
112832  *     try:
112833  *         dict_result = python.PyDict_GetItem(
112834  */
112835   __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__XSLTContext *)__pyx_v_c_ctxt->xpathCtxt->userData)));
112836   __Pyx_DECREF(((PyObject *)__pyx_v_context));
112837   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__XSLTContext *)__pyx_v_c_ctxt->xpathCtxt->userData);
112838
112839   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":93
112840  *         return
112841  *     context = <_XSLTContext>c_ctxt.xpathCtxt.userData
112842  *     try:             # <<<<<<<<<<<<<<
112843  *         dict_result = python.PyDict_GetItem(
112844  *             context._extension_elements, (c_uri, c_inst_node.name))
112845  */
112846   {
112847     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
112848     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
112849     __Pyx_XGOTREF(__pyx_save_exc_type);
112850     __Pyx_XGOTREF(__pyx_save_exc_value);
112851     __Pyx_XGOTREF(__pyx_save_exc_tb);
112852     /*try:*/ {
112853
112854       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":95
112855  *     try:
112856  *         dict_result = python.PyDict_GetItem(
112857  *             context._extension_elements, (c_uri, c_inst_node.name))             # <<<<<<<<<<<<<<
112858  *         if dict_result is NULL:
112859  *             raise KeyError, \
112860  */
112861       __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_c_uri); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
112862       __Pyx_GOTREF(__pyx_t_2);
112863       __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_c_inst_node->name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
112864       __Pyx_GOTREF(__pyx_t_3);
112865       __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
112866       __Pyx_GOTREF(((PyObject *)__pyx_t_4));
112867       PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
112868       __Pyx_GIVEREF(__pyx_t_2);
112869       PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
112870       __Pyx_GIVEREF(__pyx_t_3);
112871       __pyx_t_2 = 0;
112872       __pyx_t_3 = 0;
112873       __pyx_v_dict_result = PyDict_GetItem(((PyObject *)__pyx_v_context->_extension_elements), ((PyObject *)__pyx_t_4));
112874       __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
112875
112876       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":96
112877  *         dict_result = python.PyDict_GetItem(
112878  *             context._extension_elements, (c_uri, c_inst_node.name))
112879  *         if dict_result is NULL:             # <<<<<<<<<<<<<<
112880  *             raise KeyError, \
112881  *                 u"extension element %s not found" % funicode(c_inst_node.name)
112882  */
112883       __pyx_t_1 = (__pyx_v_dict_result == NULL);
112884       if (__pyx_t_1) {
112885
112886         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":98
112887  *         if dict_result is NULL:
112888  *             raise KeyError, \
112889  *                 u"extension element %s not found" % funicode(c_inst_node.name)             # <<<<<<<<<<<<<<
112890  *         extension = <object>dict_result
112891  * 
112892  */
112893         __pyx_t_4 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_inst_node->name); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
112894         __Pyx_GOTREF(__pyx_t_4);
112895         __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_646), __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
112896         __Pyx_GOTREF(__pyx_t_3);
112897         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
112898         __Pyx_Raise(__pyx_builtin_KeyError, __pyx_t_3, 0);
112899         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
112900         {__pyx_filename = __pyx_f[19]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
112901         goto __pyx_L13;
112902       }
112903       __pyx_L13:;
112904
112905       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":99
112906  *             raise KeyError, \
112907  *                 u"extension element %s not found" % funicode(c_inst_node.name)
112908  *         extension = <object>dict_result             # <<<<<<<<<<<<<<
112909  * 
112910  *         try:
112911  */
112912       if (!(__Pyx_TypeTest(((PyObject *)__pyx_v_dict_result), __pyx_ptype_4lxml_5etree_XSLTExtension))) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
112913       __Pyx_INCREF(((PyObject *)__pyx_v_dict_result));
112914       __Pyx_DECREF(((PyObject *)__pyx_v_extension));
112915       __pyx_v_extension = ((struct __pyx_obj_4lxml_5etree_XSLTExtension *)((PyObject *)__pyx_v_dict_result));
112916
112917       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":101
112918  *         extension = <object>dict_result
112919  * 
112920  *         try:             # <<<<<<<<<<<<<<
112921  *             self_node     = _newReadOnlyProxy(None, c_inst_node)
112922  *             context_node  = _newReadOnlyProxy(self_node, c_context_node)
112923  */
112924       /*try:*/ {
112925
112926         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":102
112927  * 
112928  *         try:
112929  *             self_node     = _newReadOnlyProxy(None, c_inst_node)             # <<<<<<<<<<<<<<
112930  *             context_node  = _newReadOnlyProxy(self_node, c_context_node)
112931  *             output_parent = _newAppendOnlyProxy(self_node, c_ctxt.insert)
112932  */
112933         __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__newReadOnlyProxy(((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)Py_None), __pyx_v_c_inst_node)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L17;}
112934         __Pyx_GOTREF(__pyx_t_3);
112935         __Pyx_DECREF(((PyObject *)__pyx_v_self_node));
112936         __pyx_v_self_node = ((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_t_3);
112937         __pyx_t_3 = 0;
112938
112939         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":103
112940  *         try:
112941  *             self_node     = _newReadOnlyProxy(None, c_inst_node)
112942  *             context_node  = _newReadOnlyProxy(self_node, c_context_node)             # <<<<<<<<<<<<<<
112943  *             output_parent = _newAppendOnlyProxy(self_node, c_ctxt.insert)
112944  * 
112945  */
112946         __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__newReadOnlyProxy(__pyx_v_self_node, __pyx_v_c_context_node)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L17;}
112947         __Pyx_GOTREF(__pyx_t_3);
112948         __Pyx_DECREF(((PyObject *)__pyx_v_context_node));
112949         __pyx_v_context_node = ((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_t_3);
112950         __pyx_t_3 = 0;
112951
112952         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":104
112953  *             self_node     = _newReadOnlyProxy(None, c_inst_node)
112954  *             context_node  = _newReadOnlyProxy(self_node, c_context_node)
112955  *             output_parent = _newAppendOnlyProxy(self_node, c_ctxt.insert)             # <<<<<<<<<<<<<<
112956  * 
112957  *             context._extension_element_proxy = self_node
112958  */
112959         __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__newAppendOnlyProxy(__pyx_v_self_node, __pyx_v_c_ctxt->insert)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L17;}
112960         __Pyx_GOTREF(__pyx_t_3);
112961         __Pyx_DECREF(((PyObject *)__pyx_v_output_parent));
112962         __pyx_v_output_parent = ((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)__pyx_t_3);
112963         __pyx_t_3 = 0;
112964
112965         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":106
112966  *             output_parent = _newAppendOnlyProxy(self_node, c_ctxt.insert)
112967  * 
112968  *             context._extension_element_proxy = self_node             # <<<<<<<<<<<<<<
112969  *             extension.execute(context, self_node, context_node, output_parent)
112970  *         finally:
112971  */
112972         __Pyx_INCREF(((PyObject *)__pyx_v_self_node));
112973         __Pyx_GIVEREF(((PyObject *)__pyx_v_self_node));
112974         __Pyx_GOTREF(__pyx_v_context->_extension_element_proxy);
112975         __Pyx_DECREF(((PyObject *)__pyx_v_context->_extension_element_proxy));
112976         __pyx_v_context->_extension_element_proxy = __pyx_v_self_node;
112977
112978         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":107
112979  * 
112980  *             context._extension_element_proxy = self_node
112981  *             extension.execute(context, self_node, context_node, output_parent)             # <<<<<<<<<<<<<<
112982  *         finally:
112983  *             context._extension_element_proxy = None
112984  */
112985         __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_extension), __pyx_kp_execute); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L17;}
112986         __Pyx_GOTREF(__pyx_t_3);
112987         __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L17;}
112988         __Pyx_GOTREF(((PyObject *)__pyx_t_4));
112989         __Pyx_INCREF(((PyObject *)__pyx_v_context));
112990         PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_context));
112991         __Pyx_GIVEREF(((PyObject *)__pyx_v_context));
112992         __Pyx_INCREF(((PyObject *)__pyx_v_self_node));
112993         PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self_node));
112994         __Pyx_GIVEREF(((PyObject *)__pyx_v_self_node));
112995         __Pyx_INCREF(((PyObject *)__pyx_v_context_node));
112996         PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_context_node));
112997         __Pyx_GIVEREF(((PyObject *)__pyx_v_context_node));
112998         __Pyx_INCREF(((PyObject *)__pyx_v_output_parent));
112999         PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_v_output_parent));
113000         __Pyx_GIVEREF(((PyObject *)__pyx_v_output_parent));
113001         __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L17;}
113002         __Pyx_GOTREF(__pyx_t_2);
113003         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
113004         __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
113005         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
113006       }
113007       /*finally:*/ {
113008         int __pyx_why;
113009         PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
113010         int __pyx_exc_lineno;
113011         __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
113012         __pyx_why = 0; goto __pyx_L18;
113013         __pyx_L17: {
113014           __pyx_why = 4;
113015           __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
113016           __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
113017           __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
113018           __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
113019           __pyx_exc_lineno = __pyx_lineno;
113020           goto __pyx_L18;
113021         }
113022         __pyx_L18:;
113023
113024         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":109
113025  *             extension.execute(context, self_node, context_node, output_parent)
113026  *         finally:
113027  *             context._extension_element_proxy = None             # <<<<<<<<<<<<<<
113028  *             if self_node is not None:
113029  *                 _freeReadOnlyProxies(self_node)
113030  */
113031         __Pyx_INCREF(Py_None);
113032         __Pyx_GIVEREF(Py_None);
113033         __Pyx_GOTREF(__pyx_v_context->_extension_element_proxy);
113034         __Pyx_DECREF(((PyObject *)__pyx_v_context->_extension_element_proxy));
113035         __pyx_v_context->_extension_element_proxy = ((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)Py_None);
113036
113037         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":110
113038  *         finally:
113039  *             context._extension_element_proxy = None
113040  *             if self_node is not None:             # <<<<<<<<<<<<<<
113041  *                 _freeReadOnlyProxies(self_node)
113042  *     except Exception, e:
113043  */
113044         __pyx_t_1 = (((PyObject *)__pyx_v_self_node) != Py_None);
113045         if (__pyx_t_1) {
113046
113047           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":111
113048  *             context._extension_element_proxy = None
113049  *             if self_node is not None:
113050  *                 _freeReadOnlyProxies(self_node)             # <<<<<<<<<<<<<<
113051  *     except Exception, e:
113052  *         e = unicode(e).encode(u"UTF-8")
113053  */
113054           __pyx_t_2 = __pyx_f_4lxml_5etree__freeReadOnlyProxies(__pyx_v_self_node); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L19_error;}
113055           __Pyx_GOTREF(__pyx_t_2);
113056           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
113057           goto __pyx_L20;
113058         }
113059         __pyx_L20:;
113060         goto __pyx_L21;
113061         __pyx_L19_error:;
113062         if (__pyx_why == 4) {
113063           Py_XDECREF(__pyx_exc_type);
113064           Py_XDECREF(__pyx_exc_value);
113065           Py_XDECREF(__pyx_exc_tb);
113066         }
113067         goto __pyx_L5_error;
113068         __pyx_L21:;
113069         switch (__pyx_why) {
113070           case 4: {
113071             __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
113072             __pyx_lineno = __pyx_exc_lineno;
113073             __pyx_exc_type = 0;
113074             __pyx_exc_value = 0;
113075             __pyx_exc_tb = 0;
113076             goto __pyx_L5_error;
113077           }
113078         }
113079       }
113080     }
113081     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
113082     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
113083     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
113084     goto __pyx_L12_try_end;
113085     __pyx_L5_error:;
113086     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
113087     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
113088     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
113089
113090     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":112
113091  *             if self_node is not None:
113092  *                 _freeReadOnlyProxies(self_node)
113093  *     except Exception, e:             # <<<<<<<<<<<<<<
113094  *         e = unicode(e).encode(u"UTF-8")
113095  *         message = python.PyString_FromFormat(
113096  */
113097     __pyx_1 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
113098     if (__pyx_1) {
113099       __Pyx_AddTraceback("lxml.etree._callExtensionElement");
113100       if (__Pyx_GetException(&__pyx_2, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
113101       __Pyx_GOTREF(__pyx_2);
113102       __Pyx_GOTREF(__pyx_3);
113103       __Pyx_GOTREF(__pyx_4);
113104       __Pyx_INCREF(__pyx_3);
113105       __Pyx_DECREF(__pyx_v_e);
113106       __pyx_v_e = __pyx_3;
113107
113108       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":113
113109  *                 _freeReadOnlyProxies(self_node)
113110  *     except Exception, e:
113111  *         e = unicode(e).encode(u"UTF-8")             # <<<<<<<<<<<<<<
113112  *         message = python.PyString_FromFormat(
113113  *             "Error executing extension element '%s': %s",
113114  */
113115       __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
113116       __Pyx_GOTREF(((PyObject *)__pyx_t_2));
113117       __Pyx_INCREF(__pyx_v_e);
113118       PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_e);
113119       __Pyx_GIVEREF(__pyx_v_e);
113120       __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)&PyUnicode_Type)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
113121       __Pyx_GOTREF(__pyx_t_4);
113122       __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
113123       __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_kp_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
113124       __Pyx_GOTREF(__pyx_t_2);
113125       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
113126       __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
113127       __Pyx_GOTREF(((PyObject *)__pyx_t_4));
113128       __Pyx_INCREF(((PyObject *)__pyx_kp_647));
113129       PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_647));
113130       __Pyx_GIVEREF(((PyObject *)__pyx_kp_647));
113131       __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
113132       __Pyx_GOTREF(__pyx_t_3);
113133       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
113134       __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
113135       __Pyx_DECREF(__pyx_v_e);
113136       __pyx_v_e = __pyx_t_3;
113137       __pyx_t_3 = 0;
113138
113139       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":116
113140  *         message = python.PyString_FromFormat(
113141  *             "Error executing extension element '%s': %s",
113142  *             c_inst_node.name, _cstr(e))             # <<<<<<<<<<<<<<
113143  *         xslt.xsltTransformError(c_ctxt, NULL, c_inst_node, message)
113144  *         context._exc._store_raised()
113145  */
113146       __pyx_t_3 = PyString_FromFormat(__pyx_k_648, __pyx_v_c_inst_node->name, PyString_AS_STRING(__pyx_v_e)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
113147       __Pyx_GOTREF(__pyx_t_3);
113148       __Pyx_DECREF(__pyx_v_message);
113149       __pyx_v_message = __pyx_t_3;
113150       __pyx_t_3 = 0;
113151
113152       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":117
113153  *             "Error executing extension element '%s': %s",
113154  *             c_inst_node.name, _cstr(e))
113155  *         xslt.xsltTransformError(c_ctxt, NULL, c_inst_node, message)             # <<<<<<<<<<<<<<
113156  *         context._exc._store_raised()
113157  *     except:
113158  */
113159       __pyx_t_5 = __Pyx_PyBytes_AsString(__pyx_v_message); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
113160       xsltTransformError(__pyx_v_c_ctxt, NULL, __pyx_v_c_inst_node, __pyx_t_5);
113161
113162       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":118
113163  *             c_inst_node.name, _cstr(e))
113164  *         xslt.xsltTransformError(c_ctxt, NULL, c_inst_node, message)
113165  *         context._exc._store_raised()             # <<<<<<<<<<<<<<
113166  *     except:
113167  *         # just in case
113168  */
113169       ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_context->__pyx_base._exc->__pyx_vtab)->_store_raised(__pyx_v_context->__pyx_base._exc);
113170       __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
113171       __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
113172       __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
113173       goto __pyx_L6_exception_handled;
113174     }
113175
113176     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":119
113177  *         xslt.xsltTransformError(c_ctxt, NULL, c_inst_node, message)
113178  *         context._exc._store_raised()
113179  *     except:             # <<<<<<<<<<<<<<
113180  *         # just in case
113181  *         message = python.PyString_FromFormat(
113182  */
113183     /*except:*/ {
113184       __Pyx_AddTraceback("lxml.etree._callExtensionElement");
113185       if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
113186       __Pyx_GOTREF(__pyx_t_3);
113187       __Pyx_GOTREF(__pyx_t_4);
113188       __Pyx_GOTREF(__pyx_t_2);
113189
113190       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":122
113191  *         # just in case
113192  *         message = python.PyString_FromFormat(
113193  *             "Error executing extension element '%s'", c_inst_node.name)             # <<<<<<<<<<<<<<
113194  *         xslt.xsltTransformError(c_ctxt, NULL, c_inst_node, message)
113195  *         context._exc._store_raised()
113196  */
113197       __pyx_t_6 = PyString_FromFormat(__pyx_k_649, __pyx_v_c_inst_node->name); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
113198       __Pyx_GOTREF(__pyx_t_6);
113199       __Pyx_DECREF(__pyx_v_message);
113200       __pyx_v_message = __pyx_t_6;
113201       __pyx_t_6 = 0;
113202
113203       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":123
113204  *         message = python.PyString_FromFormat(
113205  *             "Error executing extension element '%s'", c_inst_node.name)
113206  *         xslt.xsltTransformError(c_ctxt, NULL, c_inst_node, message)             # <<<<<<<<<<<<<<
113207  *         context._exc._store_raised()
113208  */
113209       __pyx_t_5 = __Pyx_PyBytes_AsString(__pyx_v_message); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
113210       xsltTransformError(__pyx_v_c_ctxt, NULL, __pyx_v_c_inst_node, __pyx_t_5);
113211
113212       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xsltext.pxi":124
113213  *             "Error executing extension element '%s'", c_inst_node.name)
113214  *         xslt.xsltTransformError(c_ctxt, NULL, c_inst_node, message)
113215  *         context._exc._store_raised()             # <<<<<<<<<<<<<<
113216  */
113217       ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_context->__pyx_base._exc->__pyx_vtab)->_store_raised(__pyx_v_context->__pyx_base._exc);
113218       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
113219       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
113220       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
113221       goto __pyx_L6_exception_handled;
113222     }
113223     __pyx_L7_except_error:;
113224     __Pyx_XDECREF(__pyx_save_exc_type);
113225     __Pyx_XDECREF(__pyx_save_exc_value);
113226     __Pyx_XDECREF(__pyx_save_exc_tb);
113227     goto __pyx_L1_error;
113228     __pyx_L6_exception_handled:;
113229     __Pyx_XGIVEREF(__pyx_save_exc_type);
113230     __Pyx_XGIVEREF(__pyx_save_exc_value);
113231     __Pyx_XGIVEREF(__pyx_save_exc_tb);
113232     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
113233     __pyx_L12_try_end:;
113234   }
113235
113236   goto __pyx_L0;
113237   __pyx_L1_error:;
113238   __Pyx_XDECREF(__pyx_2);
113239   __Pyx_XDECREF(__pyx_3);
113240   __Pyx_XDECREF(__pyx_4);
113241   __Pyx_XDECREF(__pyx_t_2);
113242   __Pyx_XDECREF(__pyx_t_3);
113243   __Pyx_XDECREF(__pyx_t_4);
113244   __Pyx_XDECREF(__pyx_t_6);
113245   __Pyx_WriteUnraisable("lxml.etree._callExtensionElement");
113246   __pyx_L0:;
113247   __Pyx_DECREF((PyObject *)__pyx_v_context);
113248   __Pyx_DECREF((PyObject *)__pyx_v_extension);
113249   __Pyx_DECREF((PyObject *)__pyx_v_context_node);
113250   __Pyx_DECREF((PyObject *)__pyx_v_self_node);
113251   __Pyx_DECREF((PyObject *)__pyx_v_output_parent);
113252   __Pyx_DECREF(__pyx_v_e);
113253   __Pyx_DECREF(__pyx_v_message);
113254   __Pyx_FinishRefcountContext();
113255   PyGILState_Release(_save);
113256 }
113257
113258 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2738
113259  *     u"Base class for XML validators."
113260  *     cdef _ErrorLog _error_log
113261  *     def __init__(self):             # <<<<<<<<<<<<<<
113262  *         u"__init__(self)"
113263  *         self._error_log = _ErrorLog()
113264  */
113265
113266 static int __pyx_pf_4lxml_5etree_10_Validator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
113267 static char __pyx_doc_4lxml_5etree_10_Validator___init__[] = "__init__(self)";
113268 static int __pyx_pf_4lxml_5etree_10_Validator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
113269   int __pyx_r;
113270   PyObject *__pyx_t_1 = NULL;
113271   __Pyx_SetupRefcountContext("__init__");
113272   if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
113273     __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
113274   if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
113275
113276   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2740
113277  *     def __init__(self):
113278  *         u"__init__(self)"
113279  *         self._error_log = _ErrorLog()             # <<<<<<<<<<<<<<
113280  * 
113281  *     def validate(self, etree):
113282  */
113283   __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ErrorLog)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113284   __Pyx_GOTREF(__pyx_t_1);
113285   if (!(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__ErrorLog))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113286   __Pyx_GIVEREF(__pyx_t_1);
113287   __Pyx_GOTREF(((struct __pyx_obj_4lxml_5etree__Validator *)__pyx_v_self)->_error_log);
113288   __Pyx_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__Validator *)__pyx_v_self)->_error_log));
113289   ((struct __pyx_obj_4lxml_5etree__Validator *)__pyx_v_self)->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_t_1);
113290   __pyx_t_1 = 0;
113291
113292   __pyx_r = 0;
113293   goto __pyx_L0;
113294   __pyx_L1_error:;
113295   __Pyx_XDECREF(__pyx_t_1);
113296   __Pyx_AddTraceback("lxml.etree._Validator.__init__");
113297   __pyx_r = -1;
113298   __pyx_L0:;
113299   __Pyx_FinishRefcountContext();
113300   return __pyx_r;
113301 }
113302
113303 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2742
113304  *         self._error_log = _ErrorLog()
113305  * 
113306  *     def validate(self, etree):             # <<<<<<<<<<<<<<
113307  *         u"""validate(self, etree)
113308  * 
113309  */
113310
113311 static PyObject *__pyx_pf_4lxml_5etree_10_Validator_validate(PyObject *__pyx_v_self, PyObject *__pyx_v_etree); /*proto*/
113312 static char __pyx_doc_4lxml_5etree_10_Validator_validate[] = "validate(self, etree)\n\n        Validate the document using this schema.\n\n        Returns true if document is valid, false if not.\n        ";
113313 static PyObject *__pyx_pf_4lxml_5etree_10_Validator_validate(PyObject *__pyx_v_self, PyObject *__pyx_v_etree) {
113314   PyObject *__pyx_r = NULL;
113315   PyObject *__pyx_t_1 = NULL;
113316   PyObject *__pyx_t_2 = NULL;
113317   __Pyx_SetupRefcountContext("validate");
113318
113319   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2749
113320  *         Returns true if document is valid, false if not.
113321  *         """
113322  *         return self(etree)             # <<<<<<<<<<<<<<
113323  * 
113324  *     def assertValid(self, etree):
113325  */
113326   __Pyx_XDECREF(__pyx_r);
113327   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113328   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
113329   __Pyx_INCREF(__pyx_v_etree);
113330   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_etree);
113331   __Pyx_GIVEREF(__pyx_v_etree);
113332   __pyx_t_2 = PyObject_Call(__pyx_v_self, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113333   __Pyx_GOTREF(__pyx_t_2);
113334   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
113335   __pyx_r = __pyx_t_2;
113336   __pyx_t_2 = 0;
113337   goto __pyx_L0;
113338
113339   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
113340   goto __pyx_L0;
113341   __pyx_L1_error:;
113342   __Pyx_XDECREF(__pyx_t_1);
113343   __Pyx_XDECREF(__pyx_t_2);
113344   __Pyx_AddTraceback("lxml.etree._Validator.validate");
113345   __pyx_r = NULL;
113346   __pyx_L0:;
113347   __Pyx_XGIVEREF(__pyx_r);
113348   __Pyx_FinishRefcountContext();
113349   return __pyx_r;
113350 }
113351
113352 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2751
113353  *         return self(etree)
113354  * 
113355  *     def assertValid(self, etree):             # <<<<<<<<<<<<<<
113356  *         u"""assertValid(self, etree)
113357  * 
113358  */
113359
113360 static PyObject *__pyx_pf_4lxml_5etree_10_Validator_assertValid(PyObject *__pyx_v_self, PyObject *__pyx_v_etree); /*proto*/
113361 static char __pyx_doc_4lxml_5etree_10_Validator_assertValid[] = "assertValid(self, etree)\n\n        Raises `DocumentInvalid` if the document does not comply with the schema.\n        ";
113362 static PyObject *__pyx_pf_4lxml_5etree_10_Validator_assertValid(PyObject *__pyx_v_self, PyObject *__pyx_v_etree) {
113363   PyObject *__pyx_r = NULL;
113364   PyObject *__pyx_1 = 0;
113365   PyObject *__pyx_t_1 = NULL;
113366   PyObject *__pyx_t_2 = NULL;
113367   int __pyx_t_3;
113368   int __pyx_t_4;
113369   __Pyx_SetupRefcountContext("assertValid");
113370
113371   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2756
113372  *         Raises `DocumentInvalid` if the document does not comply with the schema.
113373  *         """
113374  *         if not self(etree):             # <<<<<<<<<<<<<<
113375  *             raise DocumentInvalid(self._error_log._buildExceptionMessage(
113376  *                     u"Document does not comply with schema"),
113377  */
113378   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113379   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
113380   __Pyx_INCREF(__pyx_v_etree);
113381   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_etree);
113382   __Pyx_GIVEREF(__pyx_v_etree);
113383   __pyx_t_2 = PyObject_Call(__pyx_v_self, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113384   __Pyx_GOTREF(__pyx_t_2);
113385   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
113386   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113387   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
113388   __pyx_t_4 = (!__pyx_t_3);
113389   if (__pyx_t_4) {
113390
113391     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2757
113392  *         """
113393  *         if not self(etree):
113394  *             raise DocumentInvalid(self._error_log._buildExceptionMessage(             # <<<<<<<<<<<<<<
113395  *                     u"Document does not comply with schema"),
113396  *                                   self._error_log)
113397  */
113398     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_DocumentInvalid); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113399     __Pyx_GOTREF(__pyx_1);
113400
113401     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2758
113402  *         if not self(etree):
113403  *             raise DocumentInvalid(self._error_log._buildExceptionMessage(
113404  *                     u"Document does not comply with schema"),             # <<<<<<<<<<<<<<
113405  *                                   self._error_log)
113406  * 
113407  */
113408     __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree__Validator *)__pyx_v_self)->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._buildExceptionMessage(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)((struct __pyx_obj_4lxml_5etree__Validator *)__pyx_v_self)->_error_log), ((PyObject *)__pyx_kp_650)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113409     __Pyx_GOTREF(__pyx_t_2);
113410
113411     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2759
113412  *             raise DocumentInvalid(self._error_log._buildExceptionMessage(
113413  *                     u"Document does not comply with schema"),
113414  *                                   self._error_log)             # <<<<<<<<<<<<<<
113415  * 
113416  *     def assert_(self, etree):
113417  */
113418     __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113419     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
113420     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
113421     __Pyx_GIVEREF(__pyx_t_2);
113422     __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__Validator *)__pyx_v_self)->_error_log));
113423     PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)((struct __pyx_obj_4lxml_5etree__Validator *)__pyx_v_self)->_error_log));
113424     __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__Validator *)__pyx_v_self)->_error_log));
113425     __pyx_t_2 = 0;
113426     __pyx_t_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113427     __Pyx_GOTREF(__pyx_t_2);
113428     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
113429     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
113430     __Pyx_Raise(__pyx_t_2, 0, 0);
113431     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
113432     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113433     goto __pyx_L5;
113434   }
113435   __pyx_L5:;
113436
113437   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
113438   goto __pyx_L0;
113439   __pyx_L1_error:;
113440   __Pyx_XDECREF(__pyx_1);
113441   __Pyx_XDECREF(__pyx_t_1);
113442   __Pyx_XDECREF(__pyx_t_2);
113443   __Pyx_AddTraceback("lxml.etree._Validator.assertValid");
113444   __pyx_r = NULL;
113445   __pyx_L0:;
113446   __Pyx_XGIVEREF(__pyx_r);
113447   __Pyx_FinishRefcountContext();
113448   return __pyx_r;
113449 }
113450
113451 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2761
113452  *                                   self._error_log)
113453  * 
113454  *     def assert_(self, etree):             # <<<<<<<<<<<<<<
113455  *         u"""assert_(self, etree)
113456  * 
113457  */
113458
113459 static PyObject *__pyx_pf_4lxml_5etree_10_Validator_assert_(PyObject *__pyx_v_self, PyObject *__pyx_v_etree); /*proto*/
113460 static char __pyx_doc_4lxml_5etree_10_Validator_assert_[] = "assert_(self, etree)\n\n        Raises `AssertionError` if the document does not comply with the schema.\n        ";
113461 static PyObject *__pyx_pf_4lxml_5etree_10_Validator_assert_(PyObject *__pyx_v_self, PyObject *__pyx_v_etree) {
113462   PyObject *__pyx_r = NULL;
113463   PyObject *__pyx_t_1 = NULL;
113464   PyObject *__pyx_t_2 = NULL;
113465   int __pyx_t_3;
113466   int __pyx_t_4;
113467   __Pyx_SetupRefcountContext("assert_");
113468
113469   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2766
113470  *         Raises `AssertionError` if the document does not comply with the schema.
113471  *         """
113472  *         if not self(etree):             # <<<<<<<<<<<<<<
113473  *             raise AssertionError, self._error_log._buildExceptionMessage(
113474  *                 u"Document does not comply with schema")
113475  */
113476   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113477   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
113478   __Pyx_INCREF(__pyx_v_etree);
113479   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_etree);
113480   __Pyx_GIVEREF(__pyx_v_etree);
113481   __pyx_t_2 = PyObject_Call(__pyx_v_self, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113482   __Pyx_GOTREF(__pyx_t_2);
113483   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
113484   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113485   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
113486   __pyx_t_4 = (!__pyx_t_3);
113487   if (__pyx_t_4) {
113488
113489     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2768
113490  *         if not self(etree):
113491  *             raise AssertionError, self._error_log._buildExceptionMessage(
113492  *                 u"Document does not comply with schema")             # <<<<<<<<<<<<<<
113493  * 
113494  *     property error_log:
113495  */
113496     __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree__Validator *)__pyx_v_self)->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._buildExceptionMessage(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)((struct __pyx_obj_4lxml_5etree__Validator *)__pyx_v_self)->_error_log), ((PyObject *)__pyx_kp_651)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113497     __Pyx_GOTREF(__pyx_t_2);
113498     __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_2, 0);
113499     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
113500     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113501     goto __pyx_L5;
113502   }
113503   __pyx_L5:;
113504
113505   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
113506   goto __pyx_L0;
113507   __pyx_L1_error:;
113508   __Pyx_XDECREF(__pyx_t_1);
113509   __Pyx_XDECREF(__pyx_t_2);
113510   __Pyx_AddTraceback("lxml.etree._Validator.assert_");
113511   __pyx_r = NULL;
113512   __pyx_L0:;
113513   __Pyx_XGIVEREF(__pyx_r);
113514   __Pyx_FinishRefcountContext();
113515   return __pyx_r;
113516 }
113517
113518 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2772
113519  *     property error_log:
113520  *         u"The log of validation errors and warnings."
113521  *         def __get__(self):             # <<<<<<<<<<<<<<
113522  *             return self._error_log.copy()
113523  * 
113524  */
113525
113526 static PyObject *__pyx_pf_4lxml_5etree_10_Validator_9error_log___get__(PyObject *__pyx_v_self); /*proto*/
113527 static PyObject *__pyx_pf_4lxml_5etree_10_Validator_9error_log___get__(PyObject *__pyx_v_self) {
113528   PyObject *__pyx_r = NULL;
113529   PyObject *__pyx_t_1 = NULL;
113530   PyObject *__pyx_t_2 = NULL;
113531   __Pyx_SetupRefcountContext("__get__");
113532
113533   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2773
113534  *         u"The log of validation errors and warnings."
113535  *         def __get__(self):
113536  *             return self._error_log.copy()             # <<<<<<<<<<<<<<
113537  * 
113538  * include "dtd.pxi"        # DTD
113539  */
113540   __Pyx_XDECREF(__pyx_r);
113541   __pyx_t_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_4lxml_5etree__Validator *)__pyx_v_self)->_error_log), __pyx_kp_copy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113542   __Pyx_GOTREF(__pyx_t_1);
113543   __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113544   __Pyx_GOTREF(__pyx_t_2);
113545   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
113546   __pyx_r = __pyx_t_2;
113547   __pyx_t_2 = 0;
113548   goto __pyx_L0;
113549
113550   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
113551   goto __pyx_L0;
113552   __pyx_L1_error:;
113553   __Pyx_XDECREF(__pyx_t_1);
113554   __Pyx_XDECREF(__pyx_t_2);
113555   __Pyx_AddTraceback("lxml.etree._Validator.error_log.__get__");
113556   __pyx_r = NULL;
113557   __pyx_L0:;
113558   __Pyx_XGIVEREF(__pyx_r);
113559   __Pyx_FinishRefcountContext();
113560   return __pyx_r;
113561 }
113562
113563 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":31
113564  *     """
113565  *     cdef tree.xmlDtd* _c_dtd
113566  *     def __init__(self, file=None, *, external_id=None):             # <<<<<<<<<<<<<<
113567  *         self._c_dtd = NULL
113568  *         _Validator.__init__(self)
113569  */
113570
113571 static int __pyx_pf_4lxml_5etree_3DTD___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
113572 static int __pyx_pf_4lxml_5etree_3DTD___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
113573   PyObject *__pyx_v_file = 0;
113574   PyObject *__pyx_v_external_id = 0;
113575   int __pyx_r;
113576   PyObject *__pyx_1 = 0;
113577   PyObject *__pyx_t_1 = NULL;
113578   PyObject *__pyx_t_2 = NULL;
113579   PyObject *__pyx_t_3 = NULL;
113580   int __pyx_t_4;
113581   xmlDtd *__pyx_t_5;
113582   char *__pyx_t_6;
113583   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_file,&__pyx_kp_external_id,0};
113584   __Pyx_SetupRefcountContext("__init__");
113585   if (unlikely(__pyx_kwds)) {
113586     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
113587     PyObject* values[2] = {0,0};
113588     values[0] = Py_None;
113589     values[1] = Py_None;
113590     switch (PyTuple_GET_SIZE(__pyx_args)) {
113591       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
113592       case  0: break;
113593       default: goto __pyx_L5_argtuple_error;
113594     }
113595     switch (PyTuple_GET_SIZE(__pyx_args)) {
113596       case  0:
113597       if (kw_args > 1) {
113598         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_file);
113599         if (unlikely(value)) { values[0] = value; kw_args--; }
113600       }
113601     }
113602     while (kw_args > 0) {
113603       PyObject* value;
113604       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_external_id);
113605       if (value) { values[1] = value; if (!(--kw_args)) break; }
113606       break;
113607     }
113608     if (unlikely(kw_args > 0)) {
113609       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
113610     }
113611     __pyx_v_file = values[0];
113612     __pyx_v_external_id = values[1];
113613   } else {
113614     __pyx_v_file = Py_None;
113615     __pyx_v_external_id = Py_None;
113616     switch (PyTuple_GET_SIZE(__pyx_args)) {
113617       case  1: __pyx_v_file = PyTuple_GET_ITEM(__pyx_args, 0);
113618       case  0: break;
113619       default: goto __pyx_L5_argtuple_error;
113620     }
113621   }
113622   goto __pyx_L4_argument_unpacking_done;
113623   __pyx_L5_argtuple_error:;
113624   __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[20]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
113625   __pyx_L3_error:;
113626   __Pyx_AddTraceback("lxml.etree.DTD.__init__");
113627   return -1;
113628   __pyx_L4_argument_unpacking_done:;
113629   __Pyx_INCREF(__pyx_v_file);
113630
113631   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":32
113632  *     cdef tree.xmlDtd* _c_dtd
113633  *     def __init__(self, file=None, *, external_id=None):
113634  *         self._c_dtd = NULL             # <<<<<<<<<<<<<<
113635  *         _Validator.__init__(self)
113636  *         if file is not None:
113637  */
113638   ((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->_c_dtd = NULL;
113639
113640   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":33
113641  *     def __init__(self, file=None, *, external_id=None):
113642  *         self._c_dtd = NULL
113643  *         _Validator.__init__(self)             # <<<<<<<<<<<<<<
113644  *         if file is not None:
113645  *             if _isString(file):
113646  */
113647   __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Validator)), __pyx_kp___init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113648   __Pyx_GOTREF(__pyx_t_1);
113649   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113650   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
113651   __Pyx_INCREF(__pyx_v_self);
113652   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
113653   __Pyx_GIVEREF(__pyx_v_self);
113654   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113655   __Pyx_GOTREF(__pyx_t_3);
113656   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
113657   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
113658   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
113659
113660   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":34
113661  *         self._c_dtd = NULL
113662  *         _Validator.__init__(self)
113663  *         if file is not None:             # <<<<<<<<<<<<<<
113664  *             if _isString(file):
113665  *                 file = _encodeFilename(file)
113666  */
113667   __pyx_t_4 = (__pyx_v_file != Py_None);
113668   if (__pyx_t_4) {
113669
113670     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":35
113671  *         _Validator.__init__(self)
113672  *         if file is not None:
113673  *             if _isString(file):             # <<<<<<<<<<<<<<
113674  *                 file = _encodeFilename(file)
113675  *                 self._error_log.connect()
113676  */
113677     __pyx_t_4 = _isString(__pyx_v_file);
113678     if (__pyx_t_4) {
113679
113680       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":36
113681  *         if file is not None:
113682  *             if _isString(file):
113683  *                 file = _encodeFilename(file)             # <<<<<<<<<<<<<<
113684  *                 self._error_log.connect()
113685  *                 self._c_dtd = xmlparser.xmlParseDTD(NULL, _cstr(file))
113686  */
113687       __pyx_t_3 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_file); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113688       __Pyx_GOTREF(__pyx_t_3);
113689       __Pyx_DECREF(__pyx_v_file);
113690       __pyx_v_file = __pyx_t_3;
113691       __pyx_t_3 = 0;
113692
113693       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":37
113694  *             if _isString(file):
113695  *                 file = _encodeFilename(file)
113696  *                 self._error_log.connect()             # <<<<<<<<<<<<<<
113697  *                 self._c_dtd = xmlparser.xmlParseDTD(NULL, _cstr(file))
113698  *                 self._error_log.disconnect()
113699  */
113700       ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->__pyx_base._error_log);
113701
113702       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":38
113703  *                 file = _encodeFilename(file)
113704  *                 self._error_log.connect()
113705  *                 self._c_dtd = xmlparser.xmlParseDTD(NULL, _cstr(file))             # <<<<<<<<<<<<<<
113706  *                 self._error_log.disconnect()
113707  *             elif hasattr(file, u'read'):
113708  */
113709       ((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->_c_dtd = xmlParseDTD(NULL, PyString_AS_STRING(__pyx_v_file));
113710
113711       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":39
113712  *                 self._error_log.connect()
113713  *                 self._c_dtd = xmlparser.xmlParseDTD(NULL, _cstr(file))
113714  *                 self._error_log.disconnect()             # <<<<<<<<<<<<<<
113715  *             elif hasattr(file, u'read'):
113716  *                 self._c_dtd = _parseDtdFromFilelike(file)
113717  */
113718       ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->__pyx_base._error_log);
113719       goto __pyx_L7;
113720     }
113721
113722     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":40
113723  *                 self._c_dtd = xmlparser.xmlParseDTD(NULL, _cstr(file))
113724  *                 self._error_log.disconnect()
113725  *             elif hasattr(file, u'read'):             # <<<<<<<<<<<<<<
113726  *                 self._c_dtd = _parseDtdFromFilelike(file)
113727  *             else:
113728  */
113729     __pyx_t_4 = PyObject_HasAttr(__pyx_v_file, ((PyObject *)__pyx_kp_652)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113730     if (__pyx_t_4) {
113731
113732       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":41
113733  *                 self._error_log.disconnect()
113734  *             elif hasattr(file, u'read'):
113735  *                 self._c_dtd = _parseDtdFromFilelike(file)             # <<<<<<<<<<<<<<
113736  *             else:
113737  *                 raise DTDParseError, u"file must be a filename or file-like object"
113738  */
113739       __pyx_t_5 = __pyx_f_4lxml_5etree__parseDtdFromFilelike(__pyx_v_file); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113740       ((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->_c_dtd = __pyx_t_5;
113741       goto __pyx_L7;
113742     }
113743     /*else*/ {
113744
113745       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":43
113746  *                 self._c_dtd = _parseDtdFromFilelike(file)
113747  *             else:
113748  *                 raise DTDParseError, u"file must be a filename or file-like object"             # <<<<<<<<<<<<<<
113749  *         elif external_id is not None:
113750  *             self._error_log.connect()
113751  */
113752       __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_DTDParseError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113753       __Pyx_GOTREF(__pyx_1);
113754       __Pyx_Raise(__pyx_1, ((PyObject *)__pyx_kp_653), 0);
113755       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
113756       {__pyx_filename = __pyx_f[20]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113757     }
113758     __pyx_L7:;
113759     goto __pyx_L6;
113760   }
113761
113762   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":44
113763  *             else:
113764  *                 raise DTDParseError, u"file must be a filename or file-like object"
113765  *         elif external_id is not None:             # <<<<<<<<<<<<<<
113766  *             self._error_log.connect()
113767  *             self._c_dtd = xmlparser.xmlParseDTD(external_id, NULL)
113768  */
113769   __pyx_t_4 = (__pyx_v_external_id != Py_None);
113770   if (__pyx_t_4) {
113771
113772     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":45
113773  *                 raise DTDParseError, u"file must be a filename or file-like object"
113774  *         elif external_id is not None:
113775  *             self._error_log.connect()             # <<<<<<<<<<<<<<
113776  *             self._c_dtd = xmlparser.xmlParseDTD(external_id, NULL)
113777  *             self._error_log.disconnect()
113778  */
113779     ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->__pyx_base._error_log);
113780
113781     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":46
113782  *         elif external_id is not None:
113783  *             self._error_log.connect()
113784  *             self._c_dtd = xmlparser.xmlParseDTD(external_id, NULL)             # <<<<<<<<<<<<<<
113785  *             self._error_log.disconnect()
113786  *         else:
113787  */
113788     __pyx_t_6 = __Pyx_PyBytes_AsString(__pyx_v_external_id); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113789     ((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->_c_dtd = xmlParseDTD(__pyx_t_6, NULL);
113790
113791     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":47
113792  *             self._error_log.connect()
113793  *             self._c_dtd = xmlparser.xmlParseDTD(external_id, NULL)
113794  *             self._error_log.disconnect()             # <<<<<<<<<<<<<<
113795  *         else:
113796  *             raise DTDParseError, u"either filename or external ID required"
113797  */
113798     ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->__pyx_base._error_log);
113799     goto __pyx_L6;
113800   }
113801   /*else*/ {
113802
113803     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":49
113804  *             self._error_log.disconnect()
113805  *         else:
113806  *             raise DTDParseError, u"either filename or external ID required"             # <<<<<<<<<<<<<<
113807  * 
113808  *         if self._c_dtd is NULL:
113809  */
113810     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_DTDParseError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113811     __Pyx_GOTREF(__pyx_1);
113812     __Pyx_Raise(__pyx_1, ((PyObject *)__pyx_kp_654), 0);
113813     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
113814     {__pyx_filename = __pyx_f[20]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113815   }
113816   __pyx_L6:;
113817
113818   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":51
113819  *             raise DTDParseError, u"either filename or external ID required"
113820  * 
113821  *         if self._c_dtd is NULL:             # <<<<<<<<<<<<<<
113822  *             raise DTDParseError(
113823  *                 self._error_log._buildExceptionMessage(u"error parsing DTD"),
113824  */
113825   __pyx_t_4 = (((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->_c_dtd == NULL);
113826   if (__pyx_t_4) {
113827
113828     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":52
113829  * 
113830  *         if self._c_dtd is NULL:
113831  *             raise DTDParseError(             # <<<<<<<<<<<<<<
113832  *                 self._error_log._buildExceptionMessage(u"error parsing DTD"),
113833  *                 self._error_log)
113834  */
113835     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_DTDParseError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113836     __Pyx_GOTREF(__pyx_1);
113837
113838     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":53
113839  *         if self._c_dtd is NULL:
113840  *             raise DTDParseError(
113841  *                 self._error_log._buildExceptionMessage(u"error parsing DTD"),             # <<<<<<<<<<<<<<
113842  *                 self._error_log)
113843  * 
113844  */
113845     __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._buildExceptionMessage(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->__pyx_base._error_log), ((PyObject *)__pyx_kp_655)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113846     __Pyx_GOTREF(__pyx_t_3);
113847
113848     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":54
113849  *             raise DTDParseError(
113850  *                 self._error_log._buildExceptionMessage(u"error parsing DTD"),
113851  *                 self._error_log)             # <<<<<<<<<<<<<<
113852  * 
113853  *     def __dealloc__(self):
113854  */
113855     __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113856     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
113857     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
113858     __Pyx_GIVEREF(__pyx_t_3);
113859     __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->__pyx_base._error_log));
113860     PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->__pyx_base._error_log));
113861     __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->__pyx_base._error_log));
113862     __pyx_t_3 = 0;
113863     __pyx_t_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113864     __Pyx_GOTREF(__pyx_t_3);
113865     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
113866     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
113867     __Pyx_Raise(__pyx_t_3, 0, 0);
113868     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
113869     {__pyx_filename = __pyx_f[20]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113870     goto __pyx_L8;
113871   }
113872   __pyx_L8:;
113873
113874   __pyx_r = 0;
113875   goto __pyx_L0;
113876   __pyx_L1_error:;
113877   __Pyx_XDECREF(__pyx_1);
113878   __Pyx_XDECREF(__pyx_t_1);
113879   __Pyx_XDECREF(__pyx_t_2);
113880   __Pyx_XDECREF(__pyx_t_3);
113881   __Pyx_AddTraceback("lxml.etree.DTD.__init__");
113882   __pyx_r = -1;
113883   __pyx_L0:;
113884   __Pyx_DECREF(__pyx_v_file);
113885   __Pyx_FinishRefcountContext();
113886   return __pyx_r;
113887 }
113888
113889 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":56
113890  *                 self._error_log)
113891  * 
113892  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
113893  *         tree.xmlFreeDtd(self._c_dtd)
113894  * 
113895  */
113896
113897 static void __pyx_pf_4lxml_5etree_3DTD___dealloc__(PyObject *__pyx_v_self); /*proto*/
113898 static void __pyx_pf_4lxml_5etree_3DTD___dealloc__(PyObject *__pyx_v_self) {
113899   __Pyx_SetupRefcountContext("__dealloc__");
113900
113901   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":57
113902  * 
113903  *     def __dealloc__(self):
113904  *         tree.xmlFreeDtd(self._c_dtd)             # <<<<<<<<<<<<<<
113905  * 
113906  *     def __call__(self, etree):
113907  */
113908   xmlFreeDtd(((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->_c_dtd);
113909
113910   __Pyx_FinishRefcountContext();
113911 }
113912
113913 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":59
113914  *         tree.xmlFreeDtd(self._c_dtd)
113915  * 
113916  *     def __call__(self, etree):             # <<<<<<<<<<<<<<
113917  *         u"""__call__(self, etree)
113918  * 
113919  */
113920
113921 static PyObject *__pyx_pf_4lxml_5etree_3DTD___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
113922 static char __pyx_doc_4lxml_5etree_3DTD___call__[] = "__call__(self, etree)\n\n        Validate doc using the DTD.\n\n        Returns true if the document is valid, false if not.\n        ";
113923 static PyObject *__pyx_pf_4lxml_5etree_3DTD___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
113924   PyObject *__pyx_v_etree = 0;
113925   struct LxmlDocument *__pyx_v_doc;
113926   struct LxmlElement *__pyx_v_root_node;
113927   xmlDoc *__pyx_v_c_doc;
113928   xmlValidCtxt *__pyx_v_valid_ctxt;
113929   int __pyx_v_ret;
113930   PyObject *__pyx_r = NULL;
113931   PyObject *__pyx_1 = 0;
113932   PyObject *__pyx_t_1 = NULL;
113933   int __pyx_t_2;
113934   PyObject *__pyx_t_3 = NULL;
113935   xmlDoc *__pyx_t_4;
113936   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_etree,0};
113937   __Pyx_SetupRefcountContext("__call__");
113938   if (unlikely(__pyx_kwds)) {
113939     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
113940     PyObject* values[1] = {0};
113941     switch (PyTuple_GET_SIZE(__pyx_args)) {
113942       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
113943       case  0: break;
113944       default: goto __pyx_L5_argtuple_error;
113945     }
113946     switch (PyTuple_GET_SIZE(__pyx_args)) {
113947       case  0:
113948       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_etree);
113949       if (likely(values[0])) kw_args--;
113950       else goto __pyx_L5_argtuple_error;
113951     }
113952     if (unlikely(kw_args > 0)) {
113953       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__call__") < 0)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
113954     }
113955     __pyx_v_etree = values[0];
113956   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
113957     goto __pyx_L5_argtuple_error;
113958   } else {
113959     __pyx_v_etree = PyTuple_GET_ITEM(__pyx_args, 0);
113960   }
113961   goto __pyx_L4_argument_unpacking_done;
113962   __pyx_L5_argtuple_error:;
113963   __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[20]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
113964   __pyx_L3_error:;
113965   __Pyx_AddTraceback("lxml.etree.DTD.__call__");
113966   return NULL;
113967   __pyx_L4_argument_unpacking_done:;
113968   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
113969   __pyx_v_root_node = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
113970
113971   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":72
113972  *         cdef int ret
113973  * 
113974  *         doc = _documentOrRaise(etree)             # <<<<<<<<<<<<<<
113975  *         root_node = _rootNodeOrRaise(etree)
113976  * 
113977  */
113978   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113979   __Pyx_GOTREF(__pyx_t_1);
113980   __Pyx_DECREF(((PyObject *)__pyx_v_doc));
113981   __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_1);
113982   __pyx_t_1 = 0;
113983
113984   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":73
113985  * 
113986  *         doc = _documentOrRaise(etree)
113987  *         root_node = _rootNodeOrRaise(etree)             # <<<<<<<<<<<<<<
113988  * 
113989  *         self._error_log.connect()
113990  */
113991   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
113992   __Pyx_GOTREF(__pyx_t_1);
113993   __Pyx_DECREF(((PyObject *)__pyx_v_root_node));
113994   __pyx_v_root_node = ((struct LxmlElement *)__pyx_t_1);
113995   __pyx_t_1 = 0;
113996
113997   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":75
113998  *         root_node = _rootNodeOrRaise(etree)
113999  * 
114000  *         self._error_log.connect()             # <<<<<<<<<<<<<<
114001  *         valid_ctxt = dtdvalid.xmlNewValidCtxt()
114002  *         if valid_ctxt is NULL:
114003  */
114004   ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->__pyx_base._error_log);
114005
114006   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":76
114007  * 
114008  *         self._error_log.connect()
114009  *         valid_ctxt = dtdvalid.xmlNewValidCtxt()             # <<<<<<<<<<<<<<
114010  *         if valid_ctxt is NULL:
114011  *             self._error_log.disconnect()
114012  */
114013   __pyx_v_valid_ctxt = xmlNewValidCtxt();
114014
114015   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":77
114016  *         self._error_log.connect()
114017  *         valid_ctxt = dtdvalid.xmlNewValidCtxt()
114018  *         if valid_ctxt is NULL:             # <<<<<<<<<<<<<<
114019  *             self._error_log.disconnect()
114020  *             raise DTDError(u"Failed to create validation context",
114021  */
114022   __pyx_t_2 = (__pyx_v_valid_ctxt == NULL);
114023   if (__pyx_t_2) {
114024
114025     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":78
114026  *         valid_ctxt = dtdvalid.xmlNewValidCtxt()
114027  *         if valid_ctxt is NULL:
114028  *             self._error_log.disconnect()             # <<<<<<<<<<<<<<
114029  *             raise DTDError(u"Failed to create validation context",
114030  *                            self._error_log)
114031  */
114032     ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->__pyx_base._error_log);
114033
114034     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":79
114035  *         if valid_ctxt is NULL:
114036  *             self._error_log.disconnect()
114037  *             raise DTDError(u"Failed to create validation context",             # <<<<<<<<<<<<<<
114038  *                            self._error_log)
114039  * 
114040  */
114041     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_DTDError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114042     __Pyx_GOTREF(__pyx_1);
114043
114044     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":80
114045  *             self._error_log.disconnect()
114046  *             raise DTDError(u"Failed to create validation context",
114047  *                            self._error_log)             # <<<<<<<<<<<<<<
114048  * 
114049  *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
114050  */
114051     __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114052     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
114053     __Pyx_INCREF(((PyObject *)__pyx_kp_656));
114054     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_656));
114055     __Pyx_GIVEREF(((PyObject *)__pyx_kp_656));
114056     __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->__pyx_base._error_log));
114057     PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->__pyx_base._error_log));
114058     __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->__pyx_base._error_log));
114059     __pyx_t_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114060     __Pyx_GOTREF(__pyx_t_3);
114061     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
114062     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
114063     __Pyx_Raise(__pyx_t_3, 0, 0);
114064     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
114065     {__pyx_filename = __pyx_f[20]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114066     goto __pyx_L6;
114067   }
114068   __pyx_L6:;
114069
114070   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":82
114071  *                            self._error_log)
114072  * 
114073  *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)             # <<<<<<<<<<<<<<
114074  *         with nogil:
114075  *             ret = dtdvalid.xmlValidateDtd(valid_ctxt, c_doc, self._c_dtd)
114076  */
114077   __pyx_t_4 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114078   __pyx_v_c_doc = __pyx_t_4;
114079
114080   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":83
114081  * 
114082  *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
114083  *         with nogil:             # <<<<<<<<<<<<<<
114084  *             ret = dtdvalid.xmlValidateDtd(valid_ctxt, c_doc, self._c_dtd)
114085  *         _destroyFakeDoc(doc._c_doc, c_doc)
114086  */
114087   { PyThreadState *_save;
114088     Py_UNBLOCK_THREADS
114089     /*try:*/ {
114090
114091       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":84
114092  *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
114093  *         with nogil:
114094  *             ret = dtdvalid.xmlValidateDtd(valid_ctxt, c_doc, self._c_dtd)             # <<<<<<<<<<<<<<
114095  *         _destroyFakeDoc(doc._c_doc, c_doc)
114096  * 
114097  */
114098       __pyx_v_ret = xmlValidateDtd(__pyx_v_valid_ctxt, __pyx_v_c_doc, ((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->_c_dtd);
114099     }
114100     /*finally:*/ {
114101       Py_BLOCK_THREADS
114102     }
114103   }
114104
114105   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":85
114106  *         with nogil:
114107  *             ret = dtdvalid.xmlValidateDtd(valid_ctxt, c_doc, self._c_dtd)
114108  *         _destroyFakeDoc(doc._c_doc, c_doc)             # <<<<<<<<<<<<<<
114109  * 
114110  *         dtdvalid.xmlFreeValidCtxt(valid_ctxt)
114111  */
114112   __pyx_f_4lxml_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc, __pyx_v_c_doc);
114113
114114   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":87
114115  *         _destroyFakeDoc(doc._c_doc, c_doc)
114116  * 
114117  *         dtdvalid.xmlFreeValidCtxt(valid_ctxt)             # <<<<<<<<<<<<<<
114118  * 
114119  *         self._error_log.disconnect()
114120  */
114121   xmlFreeValidCtxt(__pyx_v_valid_ctxt);
114122
114123   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":89
114124  *         dtdvalid.xmlFreeValidCtxt(valid_ctxt)
114125  * 
114126  *         self._error_log.disconnect()             # <<<<<<<<<<<<<<
114127  *         if ret == -1:
114128  *             raise DTDValidateError(u"Internal error in DTD validation",
114129  */
114130   ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->__pyx_base._error_log);
114131
114132   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":90
114133  * 
114134  *         self._error_log.disconnect()
114135  *         if ret == -1:             # <<<<<<<<<<<<<<
114136  *             raise DTDValidateError(u"Internal error in DTD validation",
114137  *                                    self._error_log)
114138  */
114139   __pyx_t_2 = (__pyx_v_ret == -1);
114140   if (__pyx_t_2) {
114141
114142     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":91
114143  *         self._error_log.disconnect()
114144  *         if ret == -1:
114145  *             raise DTDValidateError(u"Internal error in DTD validation",             # <<<<<<<<<<<<<<
114146  *                                    self._error_log)
114147  *         if ret == 1:
114148  */
114149     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_DTDValidateError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114150     __Pyx_GOTREF(__pyx_1);
114151
114152     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":92
114153  *         if ret == -1:
114154  *             raise DTDValidateError(u"Internal error in DTD validation",
114155  *                                    self._error_log)             # <<<<<<<<<<<<<<
114156  *         if ret == 1:
114157  *             return True
114158  */
114159     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114160     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
114161     __Pyx_INCREF(((PyObject *)__pyx_kp_657));
114162     PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_657));
114163     __Pyx_GIVEREF(((PyObject *)__pyx_kp_657));
114164     __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->__pyx_base._error_log));
114165     PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->__pyx_base._error_log));
114166     __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->__pyx_base._error_log));
114167     __pyx_t_1 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114168     __Pyx_GOTREF(__pyx_t_1);
114169     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
114170     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
114171     __Pyx_Raise(__pyx_t_1, 0, 0);
114172     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
114173     {__pyx_filename = __pyx_f[20]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114174     goto __pyx_L10;
114175   }
114176   __pyx_L10:;
114177
114178   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":93
114179  *             raise DTDValidateError(u"Internal error in DTD validation",
114180  *                                    self._error_log)
114181  *         if ret == 1:             # <<<<<<<<<<<<<<
114182  *             return True
114183  *         else:
114184  */
114185   __pyx_t_2 = (__pyx_v_ret == 1);
114186   if (__pyx_t_2) {
114187
114188     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":94
114189  *                                    self._error_log)
114190  *         if ret == 1:
114191  *             return True             # <<<<<<<<<<<<<<
114192  *         else:
114193  *             return False
114194  */
114195     __Pyx_XDECREF(__pyx_r);
114196     __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114197     __Pyx_GOTREF(__pyx_t_1);
114198     __pyx_r = __pyx_t_1;
114199     __pyx_t_1 = 0;
114200     goto __pyx_L0;
114201     goto __pyx_L11;
114202   }
114203   /*else*/ {
114204
114205     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":96
114206  *             return True
114207  *         else:
114208  *             return False             # <<<<<<<<<<<<<<
114209  * 
114210  * 
114211  */
114212     __Pyx_XDECREF(__pyx_r);
114213     __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114214     __Pyx_GOTREF(__pyx_t_1);
114215     __pyx_r = __pyx_t_1;
114216     __pyx_t_1 = 0;
114217     goto __pyx_L0;
114218   }
114219   __pyx_L11:;
114220
114221   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
114222   goto __pyx_L0;
114223   __pyx_L1_error:;
114224   __Pyx_XDECREF(__pyx_1);
114225   __Pyx_XDECREF(__pyx_t_1);
114226   __Pyx_XDECREF(__pyx_t_3);
114227   __Pyx_AddTraceback("lxml.etree.DTD.__call__");
114228   __pyx_r = NULL;
114229   __pyx_L0:;
114230   __Pyx_DECREF((PyObject *)__pyx_v_doc);
114231   __Pyx_DECREF((PyObject *)__pyx_v_root_node);
114232   __Pyx_XGIVEREF(__pyx_r);
114233   __Pyx_FinishRefcountContext();
114234   return __pyx_r;
114235 }
114236
114237 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":99
114238  * 
114239  * 
114240  * cdef tree.xmlDtd* _parseDtdFromFilelike(file) except NULL:             # <<<<<<<<<<<<<<
114241  *     cdef _ExceptionContext exc_context
114242  *     cdef _FileReaderContext dtd_parser
114243  */
114244
114245 static  xmlDtd *__pyx_f_4lxml_5etree__parseDtdFromFilelike(PyObject *__pyx_v_file) {
114246   struct __pyx_obj_4lxml_5etree__ExceptionContext *__pyx_v_exc_context;
114247   struct __pyx_obj_4lxml_5etree__FileReaderContext *__pyx_v_dtd_parser;
114248   struct __pyx_obj_4lxml_5etree__ErrorLog *__pyx_v_error_log;
114249   xmlDtd *__pyx_v_c_dtd;
114250   xmlDtd *__pyx_r;
114251   PyObject *__pyx_1 = 0;
114252   PyObject *__pyx_t_1 = NULL;
114253   PyObject *__pyx_t_2 = NULL;
114254   int __pyx_t_3;
114255   int __pyx_t_4;
114256   __Pyx_SetupRefcountContext("_parseDtdFromFilelike");
114257   __pyx_v_exc_context = ((struct __pyx_obj_4lxml_5etree__ExceptionContext *)Py_None); __Pyx_INCREF(Py_None);
114258   __pyx_v_dtd_parser = ((struct __pyx_obj_4lxml_5etree__FileReaderContext *)Py_None); __Pyx_INCREF(Py_None);
114259   __pyx_v_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)Py_None); __Pyx_INCREF(Py_None);
114260
114261   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":104
114262  *     cdef _ErrorLog error_log
114263  *     cdef tree.xmlDtd* c_dtd
114264  *     exc_context = _ExceptionContext()             # <<<<<<<<<<<<<<
114265  *     dtd_parser = _FileReaderContext(file, exc_context, None, None)
114266  *     error_log = _ErrorLog()
114267  */
114268   __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ExceptionContext)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114269   __Pyx_GOTREF(__pyx_t_1);
114270   if (!(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__ExceptionContext))) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114271   __Pyx_DECREF(((PyObject *)__pyx_v_exc_context));
114272   __pyx_v_exc_context = ((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_t_1);
114273   __pyx_t_1 = 0;
114274
114275   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":105
114276  *     cdef tree.xmlDtd* c_dtd
114277  *     exc_context = _ExceptionContext()
114278  *     dtd_parser = _FileReaderContext(file, exc_context, None, None)             # <<<<<<<<<<<<<<
114279  *     error_log = _ErrorLog()
114280  * 
114281  */
114282   __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114283   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
114284   __Pyx_INCREF(__pyx_v_file);
114285   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_file);
114286   __Pyx_GIVEREF(__pyx_v_file);
114287   __Pyx_INCREF(((PyObject *)__pyx_v_exc_context));
114288   PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_exc_context));
114289   __Pyx_GIVEREF(((PyObject *)__pyx_v_exc_context));
114290   __Pyx_INCREF(Py_None);
114291   PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
114292   __Pyx_GIVEREF(Py_None);
114293   __Pyx_INCREF(Py_None);
114294   PyTuple_SET_ITEM(__pyx_t_1, 3, Py_None);
114295   __Pyx_GIVEREF(Py_None);
114296   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__FileReaderContext)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114297   __Pyx_GOTREF(__pyx_t_2);
114298   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
114299   if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__FileReaderContext))) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114300   __Pyx_DECREF(((PyObject *)__pyx_v_dtd_parser));
114301   __pyx_v_dtd_parser = ((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_t_2);
114302   __pyx_t_2 = 0;
114303
114304   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":106
114305  *     exc_context = _ExceptionContext()
114306  *     dtd_parser = _FileReaderContext(file, exc_context, None, None)
114307  *     error_log = _ErrorLog()             # <<<<<<<<<<<<<<
114308  * 
114309  *     error_log.connect()
114310  */
114311   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ErrorLog)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114312   __Pyx_GOTREF(__pyx_t_2);
114313   if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__ErrorLog))) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114314   __Pyx_DECREF(((PyObject *)__pyx_v_error_log));
114315   __pyx_v_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_t_2);
114316   __pyx_t_2 = 0;
114317
114318   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":108
114319  *     error_log = _ErrorLog()
114320  * 
114321  *     error_log.connect()             # <<<<<<<<<<<<<<
114322  *     c_dtd = dtd_parser._readDtd()
114323  *     error_log.disconnect()
114324  */
114325   ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)__pyx_v_error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(__pyx_v_error_log);
114326
114327   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":109
114328  * 
114329  *     error_log.connect()
114330  *     c_dtd = dtd_parser._readDtd()             # <<<<<<<<<<<<<<
114331  *     error_log.disconnect()
114332  * 
114333  */
114334   __pyx_v_c_dtd = ((struct __pyx_vtabstruct_4lxml_5etree__FileReaderContext *)__pyx_v_dtd_parser->__pyx_vtab)->_readDtd(__pyx_v_dtd_parser);
114335
114336   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":110
114337  *     error_log.connect()
114338  *     c_dtd = dtd_parser._readDtd()
114339  *     error_log.disconnect()             # <<<<<<<<<<<<<<
114340  * 
114341  *     exc_context._raise_if_stored()
114342  */
114343   ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)__pyx_v_error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(__pyx_v_error_log);
114344
114345   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":112
114346  *     error_log.disconnect()
114347  * 
114348  *     exc_context._raise_if_stored()             # <<<<<<<<<<<<<<
114349  *     if c_dtd is NULL:
114350  *         raise DTDParseError(u"error parsing DTD", error_log)
114351  */
114352   __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_exc_context->__pyx_vtab)->_raise_if_stored(__pyx_v_exc_context); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114353
114354   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":113
114355  * 
114356  *     exc_context._raise_if_stored()
114357  *     if c_dtd is NULL:             # <<<<<<<<<<<<<<
114358  *         raise DTDParseError(u"error parsing DTD", error_log)
114359  *     return c_dtd
114360  */
114361   __pyx_t_4 = (__pyx_v_c_dtd == NULL);
114362   if (__pyx_t_4) {
114363
114364     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":114
114365  *     exc_context._raise_if_stored()
114366  *     if c_dtd is NULL:
114367  *         raise DTDParseError(u"error parsing DTD", error_log)             # <<<<<<<<<<<<<<
114368  *     return c_dtd
114369  * 
114370  */
114371     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_DTDParseError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114372     __Pyx_GOTREF(__pyx_1);
114373     __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114374     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
114375     __Pyx_INCREF(((PyObject *)__pyx_kp_658));
114376     PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_658));
114377     __Pyx_GIVEREF(((PyObject *)__pyx_kp_658));
114378     __Pyx_INCREF(((PyObject *)__pyx_v_error_log));
114379     PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_error_log));
114380     __Pyx_GIVEREF(((PyObject *)__pyx_v_error_log));
114381     __pyx_t_1 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114382     __Pyx_GOTREF(__pyx_t_1);
114383     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
114384     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
114385     __Pyx_Raise(__pyx_t_1, 0, 0);
114386     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
114387     {__pyx_filename = __pyx_f[20]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114388     goto __pyx_L3;
114389   }
114390   __pyx_L3:;
114391
114392   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":115
114393  *     if c_dtd is NULL:
114394  *         raise DTDParseError(u"error parsing DTD", error_log)
114395  *     return c_dtd             # <<<<<<<<<<<<<<
114396  * 
114397  * cdef extern from "etree_defs.h":
114398  */
114399   __pyx_r = __pyx_v_c_dtd;
114400   goto __pyx_L0;
114401
114402   __pyx_r = 0;
114403   goto __pyx_L0;
114404   __pyx_L1_error:;
114405   __Pyx_XDECREF(__pyx_1);
114406   __Pyx_XDECREF(__pyx_t_1);
114407   __Pyx_XDECREF(__pyx_t_2);
114408   __Pyx_AddTraceback("lxml.etree._parseDtdFromFilelike");
114409   __pyx_r = NULL;
114410   __pyx_L0:;
114411   __Pyx_DECREF((PyObject *)__pyx_v_exc_context);
114412   __Pyx_DECREF((PyObject *)__pyx_v_dtd_parser);
114413   __Pyx_DECREF((PyObject *)__pyx_v_error_log);
114414   __Pyx_FinishRefcountContext();
114415   return __pyx_r;
114416 }
114417
114418 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":121
114419  *     cdef DTD NEW_DTD "PY_NEW" (object t)
114420  * 
114421  * cdef DTD _dtdFactory(tree.xmlDtd* c_dtd):             # <<<<<<<<<<<<<<
114422  *     # do not run through DTD.__init__()!
114423  *     cdef DTD dtd
114424  */
114425
114426 static  struct __pyx_obj_4lxml_5etree_DTD *__pyx_f_4lxml_5etree__dtdFactory(xmlDtd *__pyx_v_c_dtd) {
114427   struct __pyx_obj_4lxml_5etree_DTD *__pyx_v_dtd;
114428   struct __pyx_obj_4lxml_5etree_DTD *__pyx_r = NULL;
114429   int __pyx_t_1;
114430   PyObject *__pyx_t_2 = NULL;
114431   PyObject *__pyx_t_3 = NULL;
114432   PyObject *__pyx_t_4 = NULL;
114433   __Pyx_SetupRefcountContext("_dtdFactory");
114434   __pyx_v_dtd = ((struct __pyx_obj_4lxml_5etree_DTD *)Py_None); __Pyx_INCREF(Py_None);
114435
114436   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":124
114437  *     # do not run through DTD.__init__()!
114438  *     cdef DTD dtd
114439  *     if c_dtd is NULL:             # <<<<<<<<<<<<<<
114440  *         return None
114441  *     dtd = NEW_DTD(DTD)
114442  */
114443   __pyx_t_1 = (__pyx_v_c_dtd == NULL);
114444   if (__pyx_t_1) {
114445
114446     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":125
114447  *     cdef DTD dtd
114448  *     if c_dtd is NULL:
114449  *         return None             # <<<<<<<<<<<<<<
114450  *     dtd = NEW_DTD(DTD)
114451  *     dtd._c_dtd = tree.xmlCopyDtd(c_dtd)
114452  */
114453     __Pyx_XDECREF(((PyObject *)__pyx_r));
114454     __Pyx_INCREF(Py_None);
114455     __pyx_r = ((struct __pyx_obj_4lxml_5etree_DTD *)Py_None);
114456     goto __pyx_L0;
114457     goto __pyx_L3;
114458   }
114459   __pyx_L3:;
114460
114461   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":126
114462  *     if c_dtd is NULL:
114463  *         return None
114464  *     dtd = NEW_DTD(DTD)             # <<<<<<<<<<<<<<
114465  *     dtd._c_dtd = tree.xmlCopyDtd(c_dtd)
114466  *     if dtd._c_dtd is NULL:
114467  */
114468   __pyx_t_2 = ((PyObject *)PY_NEW(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_DTD)))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114469   __Pyx_GOTREF(__pyx_t_2);
114470   __Pyx_DECREF(((PyObject *)__pyx_v_dtd));
114471   __pyx_v_dtd = ((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_t_2);
114472   __pyx_t_2 = 0;
114473
114474   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":127
114475  *         return None
114476  *     dtd = NEW_DTD(DTD)
114477  *     dtd._c_dtd = tree.xmlCopyDtd(c_dtd)             # <<<<<<<<<<<<<<
114478  *     if dtd._c_dtd is NULL:
114479  *         python.PyErr_NoMemory()
114480  */
114481   __pyx_v_dtd->_c_dtd = xmlCopyDtd(__pyx_v_c_dtd);
114482
114483   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":128
114484  *     dtd = NEW_DTD(DTD)
114485  *     dtd._c_dtd = tree.xmlCopyDtd(c_dtd)
114486  *     if dtd._c_dtd is NULL:             # <<<<<<<<<<<<<<
114487  *         python.PyErr_NoMemory()
114488  *     _Validator.__init__(dtd)
114489  */
114490   __pyx_t_1 = (__pyx_v_dtd->_c_dtd == NULL);
114491   if (__pyx_t_1) {
114492
114493     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":129
114494  *     dtd._c_dtd = tree.xmlCopyDtd(c_dtd)
114495  *     if dtd._c_dtd is NULL:
114496  *         python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
114497  *     _Validator.__init__(dtd)
114498  *     return dtd
114499  */
114500     __pyx_t_2 = PyErr_NoMemory(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114501     __Pyx_GOTREF(__pyx_t_2);
114502     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
114503     goto __pyx_L4;
114504   }
114505   __pyx_L4:;
114506
114507   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":130
114508  *     if dtd._c_dtd is NULL:
114509  *         python.PyErr_NoMemory()
114510  *     _Validator.__init__(dtd)             # <<<<<<<<<<<<<<
114511  *     return dtd
114512  */
114513   __pyx_t_2 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Validator)), __pyx_kp___init__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114514   __Pyx_GOTREF(__pyx_t_2);
114515   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114516   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
114517   __Pyx_INCREF(((PyObject *)__pyx_v_dtd));
114518   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_dtd));
114519   __Pyx_GIVEREF(((PyObject *)__pyx_v_dtd));
114520   __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114521   __Pyx_GOTREF(__pyx_t_4);
114522   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
114523   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
114524   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
114525
114526   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":131
114527  *         python.PyErr_NoMemory()
114528  *     _Validator.__init__(dtd)
114529  *     return dtd             # <<<<<<<<<<<<<<
114530  */
114531   __Pyx_XDECREF(((PyObject *)__pyx_r));
114532   __Pyx_INCREF(((PyObject *)__pyx_v_dtd));
114533   __pyx_r = __pyx_v_dtd;
114534   goto __pyx_L0;
114535
114536   __pyx_r = ((struct __pyx_obj_4lxml_5etree_DTD *)Py_None); __Pyx_INCREF(Py_None);
114537   goto __pyx_L0;
114538   __pyx_L1_error:;
114539   __Pyx_XDECREF(__pyx_t_2);
114540   __Pyx_XDECREF(__pyx_t_3);
114541   __Pyx_XDECREF(__pyx_t_4);
114542   __Pyx_AddTraceback("lxml.etree._dtdFactory");
114543   __pyx_r = 0;
114544   __pyx_L0:;
114545   __Pyx_DECREF((PyObject *)__pyx_v_dtd);
114546   __Pyx_XGIVEREF((PyObject *)__pyx_r);
114547   __Pyx_FinishRefcountContext();
114548   return __pyx_r;
114549 }
114550
114551 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":30
114552  *     """
114553  *     cdef relaxng.xmlRelaxNG* _c_schema
114554  *     def __init__(self, etree=None, *, file=None):             # <<<<<<<<<<<<<<
114555  *         cdef _Document doc
114556  *         cdef _Element root_node
114557  */
114558
114559 static int __pyx_pf_4lxml_5etree_7RelaxNG___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
114560 static int __pyx_pf_4lxml_5etree_7RelaxNG___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
114561   PyObject *__pyx_v_etree = 0;
114562   PyObject *__pyx_v_file = 0;
114563   struct LxmlDocument *__pyx_v_doc;
114564   struct LxmlElement *__pyx_v_root_node;
114565   xmlNode *__pyx_v_c_node;
114566   xmlDoc *__pyx_v_fake_c_doc;
114567   char *__pyx_v_c_href;
114568   xmlRelaxNGParserCtxt *__pyx_v_parser_ctxt;
114569   PyObject *__pyx_v_filename;
114570   int __pyx_r;
114571   PyObject *__pyx_1 = 0;
114572   PyObject *__pyx_t_1 = NULL;
114573   PyObject *__pyx_t_2 = NULL;
114574   PyObject *__pyx_t_3 = NULL;
114575   int __pyx_t_4;
114576   xmlDoc *__pyx_t_5;
114577   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_etree,&__pyx_kp_file,0};
114578   __Pyx_SetupRefcountContext("__init__");
114579   if (unlikely(__pyx_kwds)) {
114580     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
114581     PyObject* values[2] = {0,0};
114582     values[0] = Py_None;
114583     values[1] = Py_None;
114584     switch (PyTuple_GET_SIZE(__pyx_args)) {
114585       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
114586       case  0: break;
114587       default: goto __pyx_L5_argtuple_error;
114588     }
114589     switch (PyTuple_GET_SIZE(__pyx_args)) {
114590       case  0:
114591       if (kw_args > 1) {
114592         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_etree);
114593         if (unlikely(value)) { values[0] = value; kw_args--; }
114594       }
114595     }
114596     while (kw_args > 0) {
114597       PyObject* value;
114598       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_file);
114599       if (value) { values[1] = value; if (!(--kw_args)) break; }
114600       break;
114601     }
114602     if (unlikely(kw_args > 0)) {
114603       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
114604     }
114605     __pyx_v_etree = values[0];
114606     __pyx_v_file = values[1];
114607   } else {
114608     __pyx_v_etree = Py_None;
114609     __pyx_v_file = Py_None;
114610     switch (PyTuple_GET_SIZE(__pyx_args)) {
114611       case  1: __pyx_v_etree = PyTuple_GET_ITEM(__pyx_args, 0);
114612       case  0: break;
114613       default: goto __pyx_L5_argtuple_error;
114614     }
114615   }
114616   goto __pyx_L4_argument_unpacking_done;
114617   __pyx_L5_argtuple_error:;
114618   __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[21]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
114619   __pyx_L3_error:;
114620   __Pyx_AddTraceback("lxml.etree.RelaxNG.__init__");
114621   return -1;
114622   __pyx_L4_argument_unpacking_done:;
114623   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
114624   __pyx_v_root_node = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
114625   __pyx_v_filename = Py_None; __Pyx_INCREF(Py_None);
114626
114627   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":37
114628  *         cdef char* c_href
114629  *         cdef relaxng.xmlRelaxNGParserCtxt* parser_ctxt
114630  *         _Validator.__init__(self)             # <<<<<<<<<<<<<<
114631  *         self._c_schema = NULL
114632  *         fake_c_doc = NULL
114633  */
114634   __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Validator)), __pyx_kp___init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114635   __Pyx_GOTREF(__pyx_t_1);
114636   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114637   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
114638   __Pyx_INCREF(__pyx_v_self);
114639   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
114640   __Pyx_GIVEREF(__pyx_v_self);
114641   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114642   __Pyx_GOTREF(__pyx_t_3);
114643   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
114644   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
114645   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
114646
114647   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":38
114648  *         cdef relaxng.xmlRelaxNGParserCtxt* parser_ctxt
114649  *         _Validator.__init__(self)
114650  *         self._c_schema = NULL             # <<<<<<<<<<<<<<
114651  *         fake_c_doc = NULL
114652  *         if etree is not None:
114653  */
114654   ((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->_c_schema = NULL;
114655
114656   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":39
114657  *         _Validator.__init__(self)
114658  *         self._c_schema = NULL
114659  *         fake_c_doc = NULL             # <<<<<<<<<<<<<<
114660  *         if etree is not None:
114661  *             doc = _documentOrRaise(etree)
114662  */
114663   __pyx_v_fake_c_doc = NULL;
114664
114665   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":40
114666  *         self._c_schema = NULL
114667  *         fake_c_doc = NULL
114668  *         if etree is not None:             # <<<<<<<<<<<<<<
114669  *             doc = _documentOrRaise(etree)
114670  *             root_node = _rootNodeOrRaise(etree)
114671  */
114672   __pyx_t_4 = (__pyx_v_etree != Py_None);
114673   if (__pyx_t_4) {
114674
114675     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":41
114676  *         fake_c_doc = NULL
114677  *         if etree is not None:
114678  *             doc = _documentOrRaise(etree)             # <<<<<<<<<<<<<<
114679  *             root_node = _rootNodeOrRaise(etree)
114680  *             c_node = root_node._c_node
114681  */
114682     __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114683     __Pyx_GOTREF(__pyx_t_3);
114684     __Pyx_DECREF(((PyObject *)__pyx_v_doc));
114685     __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_3);
114686     __pyx_t_3 = 0;
114687
114688     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":42
114689  *         if etree is not None:
114690  *             doc = _documentOrRaise(etree)
114691  *             root_node = _rootNodeOrRaise(etree)             # <<<<<<<<<<<<<<
114692  *             c_node = root_node._c_node
114693  *             # work around for libxml2 crash bug if document is not RNG at all
114694  */
114695     __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114696     __Pyx_GOTREF(__pyx_t_3);
114697     __Pyx_DECREF(((PyObject *)__pyx_v_root_node));
114698     __pyx_v_root_node = ((struct LxmlElement *)__pyx_t_3);
114699     __pyx_t_3 = 0;
114700
114701     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":43
114702  *             doc = _documentOrRaise(etree)
114703  *             root_node = _rootNodeOrRaise(etree)
114704  *             c_node = root_node._c_node             # <<<<<<<<<<<<<<
114705  *             # work around for libxml2 crash bug if document is not RNG at all
114706  *             if _LIBXML_VERSION_INT < 20624:
114707  */
114708     __pyx_v_c_node = __pyx_v_root_node->_c_node;
114709
114710     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":45
114711  *             c_node = root_node._c_node
114712  *             # work around for libxml2 crash bug if document is not RNG at all
114713  *             if _LIBXML_VERSION_INT < 20624:             # <<<<<<<<<<<<<<
114714  *                 c_href = _getNs(c_node)
114715  *                 if c_href is NULL or \
114716  */
114717     __pyx_t_4 = (__pyx_v_4lxml_5etree__LIBXML_VERSION_INT < 20624);
114718     if (__pyx_t_4) {
114719
114720       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":46
114721  *             # work around for libxml2 crash bug if document is not RNG at all
114722  *             if _LIBXML_VERSION_INT < 20624:
114723  *                 c_href = _getNs(c_node)             # <<<<<<<<<<<<<<
114724  *                 if c_href is NULL or \
114725  *                        cstd.strcmp(c_href,
114726  */
114727       __pyx_v_c_href = _getNs(__pyx_v_c_node);
114728
114729       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":47
114730  *             if _LIBXML_VERSION_INT < 20624:
114731  *                 c_href = _getNs(c_node)
114732  *                 if c_href is NULL or \             # <<<<<<<<<<<<<<
114733  *                        cstd.strcmp(c_href,
114734  *                                    'http://relaxng.org/ns/structure/1.0') != 0:
114735  */
114736       if (!(__pyx_v_c_href == NULL)) {
114737
114738         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":49
114739  *                 if c_href is NULL or \
114740  *                        cstd.strcmp(c_href,
114741  *                                    'http://relaxng.org/ns/structure/1.0') != 0:             # <<<<<<<<<<<<<<
114742  *                     raise RelaxNGParseError, u"Document is not Relax NG"
114743  *             self._error_log.connect()
114744  */
114745         __pyx_t_4 = (strcmp(__pyx_v_c_href, __pyx_k_659) != 0);
114746       } else {
114747         __pyx_t_4 = (__pyx_v_c_href == NULL);
114748       }
114749       if (__pyx_t_4) {
114750
114751         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":50
114752  *                        cstd.strcmp(c_href,
114753  *                                    'http://relaxng.org/ns/structure/1.0') != 0:
114754  *                     raise RelaxNGParseError, u"Document is not Relax NG"             # <<<<<<<<<<<<<<
114755  *             self._error_log.connect()
114756  *             fake_c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
114757  */
114758         __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_RelaxNGParseError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114759         __Pyx_GOTREF(__pyx_1);
114760         __Pyx_Raise(__pyx_1, ((PyObject *)__pyx_kp_660), 0);
114761         __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
114762         {__pyx_filename = __pyx_f[21]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114763         goto __pyx_L8;
114764       }
114765       __pyx_L8:;
114766       goto __pyx_L7;
114767     }
114768     __pyx_L7:;
114769
114770     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":51
114771  *                                    'http://relaxng.org/ns/structure/1.0') != 0:
114772  *                     raise RelaxNGParseError, u"Document is not Relax NG"
114773  *             self._error_log.connect()             # <<<<<<<<<<<<<<
114774  *             fake_c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
114775  *             parser_ctxt = relaxng.xmlRelaxNGNewDocParserCtxt(fake_c_doc)
114776  */
114777     ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log);
114778
114779     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":52
114780  *                     raise RelaxNGParseError, u"Document is not Relax NG"
114781  *             self._error_log.connect()
114782  *             fake_c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)             # <<<<<<<<<<<<<<
114783  *             parser_ctxt = relaxng.xmlRelaxNGNewDocParserCtxt(fake_c_doc)
114784  *         elif file is not None:
114785  */
114786     __pyx_t_5 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114787     __pyx_v_fake_c_doc = __pyx_t_5;
114788
114789     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":53
114790  *             self._error_log.connect()
114791  *             fake_c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
114792  *             parser_ctxt = relaxng.xmlRelaxNGNewDocParserCtxt(fake_c_doc)             # <<<<<<<<<<<<<<
114793  *         elif file is not None:
114794  *             if _isString(file):
114795  */
114796     __pyx_v_parser_ctxt = xmlRelaxNGNewDocParserCtxt(__pyx_v_fake_c_doc);
114797     goto __pyx_L6;
114798   }
114799
114800   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":54
114801  *             fake_c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
114802  *             parser_ctxt = relaxng.xmlRelaxNGNewDocParserCtxt(fake_c_doc)
114803  *         elif file is not None:             # <<<<<<<<<<<<<<
114804  *             if _isString(file):
114805  *                 filename = _encodeFilename(file)
114806  */
114807   __pyx_t_4 = (__pyx_v_file != Py_None);
114808   if (__pyx_t_4) {
114809
114810     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":55
114811  *             parser_ctxt = relaxng.xmlRelaxNGNewDocParserCtxt(fake_c_doc)
114812  *         elif file is not None:
114813  *             if _isString(file):             # <<<<<<<<<<<<<<
114814  *                 filename = _encodeFilename(file)
114815  *                 self._error_log.connect()
114816  */
114817     __pyx_t_4 = _isString(__pyx_v_file);
114818     if (__pyx_t_4) {
114819
114820       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":56
114821  *         elif file is not None:
114822  *             if _isString(file):
114823  *                 filename = _encodeFilename(file)             # <<<<<<<<<<<<<<
114824  *                 self._error_log.connect()
114825  *                 parser_ctxt = relaxng.xmlRelaxNGNewParserCtxt(_cstr(filename))
114826  */
114827       __pyx_t_3 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_file); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114828       __Pyx_GOTREF(__pyx_t_3);
114829       __Pyx_DECREF(__pyx_v_filename);
114830       __pyx_v_filename = __pyx_t_3;
114831       __pyx_t_3 = 0;
114832
114833       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":57
114834  *             if _isString(file):
114835  *                 filename = _encodeFilename(file)
114836  *                 self._error_log.connect()             # <<<<<<<<<<<<<<
114837  *                 parser_ctxt = relaxng.xmlRelaxNGNewParserCtxt(_cstr(filename))
114838  *             else:
114839  */
114840       ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log);
114841
114842       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":58
114843  *                 filename = _encodeFilename(file)
114844  *                 self._error_log.connect()
114845  *                 parser_ctxt = relaxng.xmlRelaxNGNewParserCtxt(_cstr(filename))             # <<<<<<<<<<<<<<
114846  *             else:
114847  *                 doc = _parseDocument(file, None, None)
114848  */
114849       __pyx_v_parser_ctxt = xmlRelaxNGNewParserCtxt(PyString_AS_STRING(__pyx_v_filename));
114850       goto __pyx_L9;
114851     }
114852     /*else*/ {
114853
114854       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":60
114855  *                 parser_ctxt = relaxng.xmlRelaxNGNewParserCtxt(_cstr(filename))
114856  *             else:
114857  *                 doc = _parseDocument(file, None, None)             # <<<<<<<<<<<<<<
114858  *                 self._error_log.connect()
114859  *                 parser_ctxt = relaxng.xmlRelaxNGNewDocParserCtxt(doc._c_doc)
114860  */
114861       __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__parseDocument(__pyx_v_file, ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None), Py_None)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114862       __Pyx_GOTREF(__pyx_t_3);
114863       __Pyx_DECREF(((PyObject *)__pyx_v_doc));
114864       __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_3);
114865       __pyx_t_3 = 0;
114866
114867       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":61
114868  *             else:
114869  *                 doc = _parseDocument(file, None, None)
114870  *                 self._error_log.connect()             # <<<<<<<<<<<<<<
114871  *                 parser_ctxt = relaxng.xmlRelaxNGNewDocParserCtxt(doc._c_doc)
114872  *         else:
114873  */
114874       ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log);
114875
114876       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":62
114877  *                 doc = _parseDocument(file, None, None)
114878  *                 self._error_log.connect()
114879  *                 parser_ctxt = relaxng.xmlRelaxNGNewDocParserCtxt(doc._c_doc)             # <<<<<<<<<<<<<<
114880  *         else:
114881  *             raise RelaxNGParseError, u"No tree or file given"
114882  */
114883       __pyx_v_parser_ctxt = xmlRelaxNGNewDocParserCtxt(__pyx_v_doc->_c_doc);
114884     }
114885     __pyx_L9:;
114886     goto __pyx_L6;
114887   }
114888   /*else*/ {
114889
114890     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":64
114891  *                 parser_ctxt = relaxng.xmlRelaxNGNewDocParserCtxt(doc._c_doc)
114892  *         else:
114893  *             raise RelaxNGParseError, u"No tree or file given"             # <<<<<<<<<<<<<<
114894  * 
114895  *         if parser_ctxt is NULL:
114896  */
114897     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_RelaxNGParseError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114898     __Pyx_GOTREF(__pyx_1);
114899     __Pyx_Raise(__pyx_1, ((PyObject *)__pyx_kp_661), 0);
114900     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
114901     {__pyx_filename = __pyx_f[21]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114902   }
114903   __pyx_L6:;
114904
114905   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":66
114906  *             raise RelaxNGParseError, u"No tree or file given"
114907  * 
114908  *         if parser_ctxt is NULL:             # <<<<<<<<<<<<<<
114909  *             self._error_log.disconnect()
114910  *             if fake_c_doc is not NULL:
114911  */
114912   __pyx_t_4 = (__pyx_v_parser_ctxt == NULL);
114913   if (__pyx_t_4) {
114914
114915     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":67
114916  * 
114917  *         if parser_ctxt is NULL:
114918  *             self._error_log.disconnect()             # <<<<<<<<<<<<<<
114919  *             if fake_c_doc is not NULL:
114920  *                 _destroyFakeDoc(doc._c_doc, fake_c_doc)
114921  */
114922     ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log);
114923
114924     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":68
114925  *         if parser_ctxt is NULL:
114926  *             self._error_log.disconnect()
114927  *             if fake_c_doc is not NULL:             # <<<<<<<<<<<<<<
114928  *                 _destroyFakeDoc(doc._c_doc, fake_c_doc)
114929  *             raise RelaxNGParseError(
114930  */
114931     __pyx_t_4 = (__pyx_v_fake_c_doc != NULL);
114932     if (__pyx_t_4) {
114933
114934       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":69
114935  *             self._error_log.disconnect()
114936  *             if fake_c_doc is not NULL:
114937  *                 _destroyFakeDoc(doc._c_doc, fake_c_doc)             # <<<<<<<<<<<<<<
114938  *             raise RelaxNGParseError(
114939  *                 self._error_log._buildExceptionMessage(
114940  */
114941       __pyx_f_4lxml_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc, __pyx_v_fake_c_doc);
114942       goto __pyx_L11;
114943     }
114944     __pyx_L11:;
114945
114946     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":70
114947  *             if fake_c_doc is not NULL:
114948  *                 _destroyFakeDoc(doc._c_doc, fake_c_doc)
114949  *             raise RelaxNGParseError(             # <<<<<<<<<<<<<<
114950  *                 self._error_log._buildExceptionMessage(
114951  *                     u"Document is not parsable as Relax NG"),
114952  */
114953     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_RelaxNGParseError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114954     __Pyx_GOTREF(__pyx_1);
114955
114956     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":72
114957  *             raise RelaxNGParseError(
114958  *                 self._error_log._buildExceptionMessage(
114959  *                     u"Document is not parsable as Relax NG"),             # <<<<<<<<<<<<<<
114960  *                 self._error_log)
114961  *         self._c_schema = relaxng.xmlRelaxNGParse(parser_ctxt)
114962  */
114963     __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._buildExceptionMessage(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log), ((PyObject *)__pyx_kp_662)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114964     __Pyx_GOTREF(__pyx_t_3);
114965
114966     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":73
114967  *                 self._error_log._buildExceptionMessage(
114968  *                     u"Document is not parsable as Relax NG"),
114969  *                 self._error_log)             # <<<<<<<<<<<<<<
114970  *         self._c_schema = relaxng.xmlRelaxNGParse(parser_ctxt)
114971  *         self._error_log.disconnect()
114972  */
114973     __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114974     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
114975     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
114976     __Pyx_GIVEREF(__pyx_t_3);
114977     __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log));
114978     PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log));
114979     __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log));
114980     __pyx_t_3 = 0;
114981     __pyx_t_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114982     __Pyx_GOTREF(__pyx_t_3);
114983     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
114984     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
114985     __Pyx_Raise(__pyx_t_3, 0, 0);
114986     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
114987     {__pyx_filename = __pyx_f[21]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
114988     goto __pyx_L10;
114989   }
114990   __pyx_L10:;
114991
114992   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":74
114993  *                     u"Document is not parsable as Relax NG"),
114994  *                 self._error_log)
114995  *         self._c_schema = relaxng.xmlRelaxNGParse(parser_ctxt)             # <<<<<<<<<<<<<<
114996  *         self._error_log.disconnect()
114997  * 
114998  */
114999   ((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->_c_schema = xmlRelaxNGParse(__pyx_v_parser_ctxt);
115000
115001   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":75
115002  *                 self._error_log)
115003  *         self._c_schema = relaxng.xmlRelaxNGParse(parser_ctxt)
115004  *         self._error_log.disconnect()             # <<<<<<<<<<<<<<
115005  * 
115006  *         if _LIBXML_VERSION_INT >= 20624:
115007  */
115008   ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log);
115009
115010   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":77
115011  *         self._error_log.disconnect()
115012  * 
115013  *         if _LIBXML_VERSION_INT >= 20624:             # <<<<<<<<<<<<<<
115014  *             relaxng.xmlRelaxNGFreeParserCtxt(parser_ctxt)
115015  *         if self._c_schema is NULL:
115016  */
115017   __pyx_t_4 = (__pyx_v_4lxml_5etree__LIBXML_VERSION_INT >= 20624);
115018   if (__pyx_t_4) {
115019
115020     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":78
115021  * 
115022  *         if _LIBXML_VERSION_INT >= 20624:
115023  *             relaxng.xmlRelaxNGFreeParserCtxt(parser_ctxt)             # <<<<<<<<<<<<<<
115024  *         if self._c_schema is NULL:
115025  *             if fake_c_doc is not NULL:
115026  */
115027     xmlRelaxNGFreeParserCtxt(__pyx_v_parser_ctxt);
115028     goto __pyx_L12;
115029   }
115030   __pyx_L12:;
115031
115032   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":79
115033  *         if _LIBXML_VERSION_INT >= 20624:
115034  *             relaxng.xmlRelaxNGFreeParserCtxt(parser_ctxt)
115035  *         if self._c_schema is NULL:             # <<<<<<<<<<<<<<
115036  *             if fake_c_doc is not NULL:
115037  *                 if _LIBXML_VERSION_INT < 20624:
115038  */
115039   __pyx_t_4 = (((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->_c_schema == NULL);
115040   if (__pyx_t_4) {
115041
115042     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":80
115043  *             relaxng.xmlRelaxNGFreeParserCtxt(parser_ctxt)
115044  *         if self._c_schema is NULL:
115045  *             if fake_c_doc is not NULL:             # <<<<<<<<<<<<<<
115046  *                 if _LIBXML_VERSION_INT < 20624:
115047  *                     relaxng.xmlRelaxNGFreeParserCtxt(parser_ctxt)
115048  */
115049     __pyx_t_4 = (__pyx_v_fake_c_doc != NULL);
115050     if (__pyx_t_4) {
115051
115052       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":81
115053  *         if self._c_schema is NULL:
115054  *             if fake_c_doc is not NULL:
115055  *                 if _LIBXML_VERSION_INT < 20624:             # <<<<<<<<<<<<<<
115056  *                     relaxng.xmlRelaxNGFreeParserCtxt(parser_ctxt)
115057  *                 _destroyFakeDoc(doc._c_doc, fake_c_doc)
115058  */
115059       __pyx_t_4 = (__pyx_v_4lxml_5etree__LIBXML_VERSION_INT < 20624);
115060       if (__pyx_t_4) {
115061
115062         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":82
115063  *             if fake_c_doc is not NULL:
115064  *                 if _LIBXML_VERSION_INT < 20624:
115065  *                     relaxng.xmlRelaxNGFreeParserCtxt(parser_ctxt)             # <<<<<<<<<<<<<<
115066  *                 _destroyFakeDoc(doc._c_doc, fake_c_doc)
115067  *             raise RelaxNGParseError(
115068  */
115069         xmlRelaxNGFreeParserCtxt(__pyx_v_parser_ctxt);
115070         goto __pyx_L15;
115071       }
115072       __pyx_L15:;
115073
115074       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":83
115075  *                 if _LIBXML_VERSION_INT < 20624:
115076  *                     relaxng.xmlRelaxNGFreeParserCtxt(parser_ctxt)
115077  *                 _destroyFakeDoc(doc._c_doc, fake_c_doc)             # <<<<<<<<<<<<<<
115078  *             raise RelaxNGParseError(
115079  *                 self._error_log._buildExceptionMessage(
115080  */
115081       __pyx_f_4lxml_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc, __pyx_v_fake_c_doc);
115082       goto __pyx_L14;
115083     }
115084     __pyx_L14:;
115085
115086     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":84
115087  *                     relaxng.xmlRelaxNGFreeParserCtxt(parser_ctxt)
115088  *                 _destroyFakeDoc(doc._c_doc, fake_c_doc)
115089  *             raise RelaxNGParseError(             # <<<<<<<<<<<<<<
115090  *                 self._error_log._buildExceptionMessage(
115091  *                     u"Document is not valid Relax NG"),
115092  */
115093     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_RelaxNGParseError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
115094     __Pyx_GOTREF(__pyx_1);
115095
115096     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":86
115097  *             raise RelaxNGParseError(
115098  *                 self._error_log._buildExceptionMessage(
115099  *                     u"Document is not valid Relax NG"),             # <<<<<<<<<<<<<<
115100  *                 self._error_log)
115101  *         if fake_c_doc is not NULL:
115102  */
115103     __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._buildExceptionMessage(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log), ((PyObject *)__pyx_kp_663)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
115104     __Pyx_GOTREF(__pyx_t_3);
115105
115106     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":87
115107  *                 self._error_log._buildExceptionMessage(
115108  *                     u"Document is not valid Relax NG"),
115109  *                 self._error_log)             # <<<<<<<<<<<<<<
115110  *         if fake_c_doc is not NULL:
115111  *             _destroyFakeDoc(doc._c_doc, fake_c_doc)
115112  */
115113     __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
115114     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
115115     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
115116     __Pyx_GIVEREF(__pyx_t_3);
115117     __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log));
115118     PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log));
115119     __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log));
115120     __pyx_t_3 = 0;
115121     __pyx_t_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
115122     __Pyx_GOTREF(__pyx_t_3);
115123     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
115124     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
115125     __Pyx_Raise(__pyx_t_3, 0, 0);
115126     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
115127     {__pyx_filename = __pyx_f[21]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
115128     goto __pyx_L13;
115129   }
115130   __pyx_L13:;
115131
115132   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":88
115133  *                     u"Document is not valid Relax NG"),
115134  *                 self._error_log)
115135  *         if fake_c_doc is not NULL:             # <<<<<<<<<<<<<<
115136  *             _destroyFakeDoc(doc._c_doc, fake_c_doc)
115137  * 
115138  */
115139   __pyx_t_4 = (__pyx_v_fake_c_doc != NULL);
115140   if (__pyx_t_4) {
115141
115142     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":89
115143  *                 self._error_log)
115144  *         if fake_c_doc is not NULL:
115145  *             _destroyFakeDoc(doc._c_doc, fake_c_doc)             # <<<<<<<<<<<<<<
115146  * 
115147  *     def __dealloc__(self):
115148  */
115149     __pyx_f_4lxml_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc, __pyx_v_fake_c_doc);
115150     goto __pyx_L16;
115151   }
115152   __pyx_L16:;
115153
115154   __pyx_r = 0;
115155   goto __pyx_L0;
115156   __pyx_L1_error:;
115157   __Pyx_XDECREF(__pyx_1);
115158   __Pyx_XDECREF(__pyx_t_1);
115159   __Pyx_XDECREF(__pyx_t_2);
115160   __Pyx_XDECREF(__pyx_t_3);
115161   __Pyx_AddTraceback("lxml.etree.RelaxNG.__init__");
115162   __pyx_r = -1;
115163   __pyx_L0:;
115164   __Pyx_DECREF((PyObject *)__pyx_v_doc);
115165   __Pyx_DECREF((PyObject *)__pyx_v_root_node);
115166   __Pyx_DECREF(__pyx_v_filename);
115167   __Pyx_FinishRefcountContext();
115168   return __pyx_r;
115169 }
115170
115171 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":91
115172  *             _destroyFakeDoc(doc._c_doc, fake_c_doc)
115173  * 
115174  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
115175  *         relaxng.xmlRelaxNGFree(self._c_schema)
115176  * 
115177  */
115178
115179 static void __pyx_pf_4lxml_5etree_7RelaxNG___dealloc__(PyObject *__pyx_v_self); /*proto*/
115180 static void __pyx_pf_4lxml_5etree_7RelaxNG___dealloc__(PyObject *__pyx_v_self) {
115181   __Pyx_SetupRefcountContext("__dealloc__");
115182
115183   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":92
115184  * 
115185  *     def __dealloc__(self):
115186  *         relaxng.xmlRelaxNGFree(self._c_schema)             # <<<<<<<<<<<<<<
115187  * 
115188  *     def __call__(self, etree):
115189  */
115190   xmlRelaxNGFree(((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->_c_schema);
115191
115192   __Pyx_FinishRefcountContext();
115193 }
115194
115195 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":94
115196  *         relaxng.xmlRelaxNGFree(self._c_schema)
115197  * 
115198  *     def __call__(self, etree):             # <<<<<<<<<<<<<<
115199  *         u"""__call__(self, etree)
115200  * 
115201  */
115202
115203 static PyObject *__pyx_pf_4lxml_5etree_7RelaxNG___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
115204 static char __pyx_doc_4lxml_5etree_7RelaxNG___call__[] = "__call__(self, etree)\n\n        Validate doc using Relax NG.\n\n        Returns true if document is valid, false if not.";
115205 static PyObject *__pyx_pf_4lxml_5etree_7RelaxNG___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
115206   PyObject *__pyx_v_etree = 0;
115207   struct LxmlDocument *__pyx_v_doc;
115208   struct LxmlElement *__pyx_v_root_node;
115209   xmlDoc *__pyx_v_c_doc;
115210   xmlRelaxNGValidCtxt *__pyx_v_valid_ctxt;
115211   int __pyx_v_ret;
115212   PyObject *__pyx_r = NULL;
115213   PyObject *__pyx_1 = 0;
115214   PyObject *__pyx_t_1 = NULL;
115215   int __pyx_t_2;
115216   xmlDoc *__pyx_t_3;
115217   PyObject *__pyx_t_4 = NULL;
115218   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_etree,0};
115219   __Pyx_SetupRefcountContext("__call__");
115220   if (unlikely(__pyx_kwds)) {
115221     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
115222     PyObject* values[1] = {0};
115223     switch (PyTuple_GET_SIZE(__pyx_args)) {
115224       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
115225       case  0: break;
115226       default: goto __pyx_L5_argtuple_error;
115227     }
115228     switch (PyTuple_GET_SIZE(__pyx_args)) {
115229       case  0:
115230       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_etree);
115231       if (likely(values[0])) kw_args--;
115232       else goto __pyx_L5_argtuple_error;
115233     }
115234     if (unlikely(kw_args > 0)) {
115235       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__call__") < 0)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
115236     }
115237     __pyx_v_etree = values[0];
115238   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
115239     goto __pyx_L5_argtuple_error;
115240   } else {
115241     __pyx_v_etree = PyTuple_GET_ITEM(__pyx_args, 0);
115242   }
115243   goto __pyx_L4_argument_unpacking_done;
115244   __pyx_L5_argtuple_error:;
115245   __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[21]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
115246   __pyx_L3_error:;
115247   __Pyx_AddTraceback("lxml.etree.RelaxNG.__call__");
115248   return NULL;
115249   __pyx_L4_argument_unpacking_done:;
115250   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
115251   __pyx_v_root_node = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
115252
115253   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":106
115254  *         cdef int ret
115255  * 
115256  *         doc = _documentOrRaise(etree)             # <<<<<<<<<<<<<<
115257  *         root_node = _rootNodeOrRaise(etree)
115258  * 
115259  */
115260   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
115261   __Pyx_GOTREF(__pyx_t_1);
115262   __Pyx_DECREF(((PyObject *)__pyx_v_doc));
115263   __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_1);
115264   __pyx_t_1 = 0;
115265
115266   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":107
115267  * 
115268  *         doc = _documentOrRaise(etree)
115269  *         root_node = _rootNodeOrRaise(etree)             # <<<<<<<<<<<<<<
115270  * 
115271  *         self._error_log.connect()
115272  */
115273   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
115274   __Pyx_GOTREF(__pyx_t_1);
115275   __Pyx_DECREF(((PyObject *)__pyx_v_root_node));
115276   __pyx_v_root_node = ((struct LxmlElement *)__pyx_t_1);
115277   __pyx_t_1 = 0;
115278
115279   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":109
115280  *         root_node = _rootNodeOrRaise(etree)
115281  * 
115282  *         self._error_log.connect()             # <<<<<<<<<<<<<<
115283  *         valid_ctxt = relaxng.xmlRelaxNGNewValidCtxt(self._c_schema)
115284  *         if valid_ctxt is NULL:
115285  */
115286   ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log);
115287
115288   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":110
115289  * 
115290  *         self._error_log.connect()
115291  *         valid_ctxt = relaxng.xmlRelaxNGNewValidCtxt(self._c_schema)             # <<<<<<<<<<<<<<
115292  *         if valid_ctxt is NULL:
115293  *             self._error_log.disconnect()
115294  */
115295   __pyx_v_valid_ctxt = xmlRelaxNGNewValidCtxt(((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->_c_schema);
115296
115297   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":111
115298  *         self._error_log.connect()
115299  *         valid_ctxt = relaxng.xmlRelaxNGNewValidCtxt(self._c_schema)
115300  *         if valid_ctxt is NULL:             # <<<<<<<<<<<<<<
115301  *             self._error_log.disconnect()
115302  *             python.PyErr_NoMemory()
115303  */
115304   __pyx_t_2 = (__pyx_v_valid_ctxt == NULL);
115305   if (__pyx_t_2) {
115306
115307     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":112
115308  *         valid_ctxt = relaxng.xmlRelaxNGNewValidCtxt(self._c_schema)
115309  *         if valid_ctxt is NULL:
115310  *             self._error_log.disconnect()             # <<<<<<<<<<<<<<
115311  *             python.PyErr_NoMemory()
115312  * 
115313  */
115314     ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log);
115315
115316     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":113
115317  *         if valid_ctxt is NULL:
115318  *             self._error_log.disconnect()
115319  *             python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
115320  * 
115321  *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
115322  */
115323     __pyx_t_1 = PyErr_NoMemory(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
115324     __Pyx_GOTREF(__pyx_t_1);
115325     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
115326     goto __pyx_L6;
115327   }
115328   __pyx_L6:;
115329
115330   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":115
115331  *             python.PyErr_NoMemory()
115332  * 
115333  *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)             # <<<<<<<<<<<<<<
115334  *         with nogil:
115335  *             ret = relaxng.xmlRelaxNGValidateDoc(valid_ctxt, c_doc)
115336  */
115337   __pyx_t_3 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
115338   __pyx_v_c_doc = __pyx_t_3;
115339
115340   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":116
115341  * 
115342  *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
115343  *         with nogil:             # <<<<<<<<<<<<<<
115344  *             ret = relaxng.xmlRelaxNGValidateDoc(valid_ctxt, c_doc)
115345  *         _destroyFakeDoc(doc._c_doc, c_doc)
115346  */
115347   { PyThreadState *_save;
115348     Py_UNBLOCK_THREADS
115349     /*try:*/ {
115350
115351       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":117
115352  *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
115353  *         with nogil:
115354  *             ret = relaxng.xmlRelaxNGValidateDoc(valid_ctxt, c_doc)             # <<<<<<<<<<<<<<
115355  *         _destroyFakeDoc(doc._c_doc, c_doc)
115356  * 
115357  */
115358       __pyx_v_ret = xmlRelaxNGValidateDoc(__pyx_v_valid_ctxt, __pyx_v_c_doc);
115359     }
115360     /*finally:*/ {
115361       Py_BLOCK_THREADS
115362     }
115363   }
115364
115365   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":118
115366  *         with nogil:
115367  *             ret = relaxng.xmlRelaxNGValidateDoc(valid_ctxt, c_doc)
115368  *         _destroyFakeDoc(doc._c_doc, c_doc)             # <<<<<<<<<<<<<<
115369  * 
115370  *         relaxng.xmlRelaxNGFreeValidCtxt(valid_ctxt)
115371  */
115372   __pyx_f_4lxml_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc, __pyx_v_c_doc);
115373
115374   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":120
115375  *         _destroyFakeDoc(doc._c_doc, c_doc)
115376  * 
115377  *         relaxng.xmlRelaxNGFreeValidCtxt(valid_ctxt)             # <<<<<<<<<<<<<<
115378  * 
115379  *         self._error_log.disconnect()
115380  */
115381   xmlRelaxNGFreeValidCtxt(__pyx_v_valid_ctxt);
115382
115383   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":122
115384  *         relaxng.xmlRelaxNGFreeValidCtxt(valid_ctxt)
115385  * 
115386  *         self._error_log.disconnect()             # <<<<<<<<<<<<<<
115387  *         if ret == -1:
115388  *             raise RelaxNGValidateError(
115389  */
115390   ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log);
115391
115392   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":123
115393  * 
115394  *         self._error_log.disconnect()
115395  *         if ret == -1:             # <<<<<<<<<<<<<<
115396  *             raise RelaxNGValidateError(
115397  *                 u"Internal error in Relax NG validation",
115398  */
115399   __pyx_t_2 = (__pyx_v_ret == -1);
115400   if (__pyx_t_2) {
115401
115402     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":124
115403  *         self._error_log.disconnect()
115404  *         if ret == -1:
115405  *             raise RelaxNGValidateError(             # <<<<<<<<<<<<<<
115406  *                 u"Internal error in Relax NG validation",
115407  *                 self._error_log)
115408  */
115409     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_209); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
115410     __Pyx_GOTREF(__pyx_1);
115411
115412     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":126
115413  *             raise RelaxNGValidateError(
115414  *                 u"Internal error in Relax NG validation",
115415  *                 self._error_log)             # <<<<<<<<<<<<<<
115416  *         if ret == 0:
115417  *             return True
115418  */
115419     __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
115420     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
115421     __Pyx_INCREF(((PyObject *)__pyx_kp_664));
115422     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_664));
115423     __Pyx_GIVEREF(((PyObject *)__pyx_kp_664));
115424     __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log));
115425     PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log));
115426     __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log));
115427     __pyx_t_4 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
115428     __Pyx_GOTREF(__pyx_t_4);
115429     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
115430     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
115431     __Pyx_Raise(__pyx_t_4, 0, 0);
115432     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
115433     {__pyx_filename = __pyx_f[21]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
115434     goto __pyx_L10;
115435   }
115436   __pyx_L10:;
115437
115438   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":127
115439  *                 u"Internal error in Relax NG validation",
115440  *                 self._error_log)
115441  *         if ret == 0:             # <<<<<<<<<<<<<<
115442  *             return True
115443  *         else:
115444  */
115445   __pyx_t_2 = (__pyx_v_ret == 0);
115446   if (__pyx_t_2) {
115447
115448     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":128
115449  *                 self._error_log)
115450  *         if ret == 0:
115451  *             return True             # <<<<<<<<<<<<<<
115452  *         else:
115453  *             return False
115454  */
115455     __Pyx_XDECREF(__pyx_r);
115456     __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
115457     __Pyx_GOTREF(__pyx_t_4);
115458     __pyx_r = __pyx_t_4;
115459     __pyx_t_4 = 0;
115460     goto __pyx_L0;
115461     goto __pyx_L11;
115462   }
115463   /*else*/ {
115464
115465     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":130
115466  *             return True
115467  *         else:
115468  *             return False             # <<<<<<<<<<<<<<
115469  */
115470     __Pyx_XDECREF(__pyx_r);
115471     __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
115472     __Pyx_GOTREF(__pyx_t_4);
115473     __pyx_r = __pyx_t_4;
115474     __pyx_t_4 = 0;
115475     goto __pyx_L0;
115476   }
115477   __pyx_L11:;
115478
115479   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
115480   goto __pyx_L0;
115481   __pyx_L1_error:;
115482   __Pyx_XDECREF(__pyx_1);
115483   __Pyx_XDECREF(__pyx_t_1);
115484   __Pyx_XDECREF(__pyx_t_4);
115485   __Pyx_AddTraceback("lxml.etree.RelaxNG.__call__");
115486   __pyx_r = NULL;
115487   __pyx_L0:;
115488   __Pyx_DECREF((PyObject *)__pyx_v_doc);
115489   __Pyx_DECREF((PyObject *)__pyx_v_root_node);
115490   __Pyx_XGIVEREF(__pyx_r);
115491   __Pyx_FinishRefcountContext();
115492   return __pyx_r;
115493 }
115494
115495 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":40
115496  *     cdef bint _add_attribute_defaults
115497  * 
115498  *     def __init__(self, etree=None, *, file=None, attribute_defaults=False):             # <<<<<<<<<<<<<<
115499  *         cdef _Document doc
115500  *         cdef _Element root_node
115501  */
115502
115503 static int __pyx_pf_4lxml_5etree_9XMLSchema___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
115504 static int __pyx_pf_4lxml_5etree_9XMLSchema___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
115505   PyObject *__pyx_v_etree = 0;
115506   PyObject *__pyx_v_file = 0;
115507   PyObject *__pyx_v_attribute_defaults = 0;
115508   struct LxmlDocument *__pyx_v_doc;
115509   struct LxmlElement *__pyx_v_root_node;
115510   xmlDoc *__pyx_v_fake_c_doc;
115511   xmlNode *__pyx_v_c_node;
115512   char *__pyx_v_c_href;
115513   xmlSchemaParserCtxt *__pyx_v_parser_ctxt;
115514   PyObject *__pyx_v_filename;
115515   int __pyx_r;
115516   PyObject *__pyx_1 = 0;
115517   int __pyx_t_1;
115518   PyObject *__pyx_t_2 = NULL;
115519   PyObject *__pyx_t_3 = NULL;
115520   PyObject *__pyx_t_4 = NULL;
115521   xmlDoc *__pyx_t_5;
115522   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_etree,&__pyx_kp_file,&__pyx_kp_attribute_defaults,0};
115523   __Pyx_SetupRefcountContext("__init__");
115524   if (unlikely(__pyx_kwds)) {
115525     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
115526     PyObject* values[3] = {0,0,0};
115527     values[0] = Py_None;
115528     values[1] = Py_None;
115529     values[2] = __pyx_k_218;
115530     switch (PyTuple_GET_SIZE(__pyx_args)) {
115531       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
115532       case  0: break;
115533       default: goto __pyx_L5_argtuple_error;
115534     }
115535     switch (PyTuple_GET_SIZE(__pyx_args)) {
115536       case  0:
115537       if (kw_args > 1) {
115538         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_etree);
115539         if (unlikely(value)) { values[0] = value; kw_args--; }
115540       }
115541     }
115542     while (kw_args > 0) {
115543       PyObject* value;
115544       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_file);
115545       if (value) { values[1] = value; if (!(--kw_args)) break; }
115546       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_attribute_defaults);
115547       if (value) { values[2] = value; if (!(--kw_args)) break; }
115548       break;
115549     }
115550     if (unlikely(kw_args > 0)) {
115551       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
115552     }
115553     __pyx_v_etree = values[0];
115554     __pyx_v_file = values[1];
115555     __pyx_v_attribute_defaults = values[2];
115556   } else {
115557     __pyx_v_etree = Py_None;
115558     __pyx_v_file = Py_None;
115559     __pyx_v_attribute_defaults = __pyx_k_218;
115560     switch (PyTuple_GET_SIZE(__pyx_args)) {
115561       case  1: __pyx_v_etree = PyTuple_GET_ITEM(__pyx_args, 0);
115562       case  0: break;
115563       default: goto __pyx_L5_argtuple_error;
115564     }
115565   }
115566   goto __pyx_L4_argument_unpacking_done;
115567   __pyx_L5_argtuple_error:;
115568   __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[22]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
115569   __pyx_L3_error:;
115570   __Pyx_AddTraceback("lxml.etree.XMLSchema.__init__");
115571   return -1;
115572   __pyx_L4_argument_unpacking_done:;
115573   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
115574   __pyx_v_root_node = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
115575   __pyx_v_filename = Py_None; __Pyx_INCREF(Py_None);
115576
115577   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":48
115578  *         cdef xmlschema.xmlSchemaParserCtxt* parser_ctxt
115579  * 
115580  *         self._has_default_attributes = True # play safe             # <<<<<<<<<<<<<<
115581  *         self._add_attribute_defaults = attribute_defaults
115582  *         self._c_schema = NULL
115583  */
115584   ((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->_has_default_attributes = 1;
115585
115586   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":49
115587  * 
115588  *         self._has_default_attributes = True # play safe
115589  *         self._add_attribute_defaults = attribute_defaults             # <<<<<<<<<<<<<<
115590  *         self._c_schema = NULL
115591  *         _Validator.__init__(self)
115592  */
115593   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_attribute_defaults); if (unlikely((__pyx_t_1 == (int)-1))) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
115594   ((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->_add_attribute_defaults = __pyx_t_1;
115595
115596   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":50
115597  *         self._has_default_attributes = True # play safe
115598  *         self._add_attribute_defaults = attribute_defaults
115599  *         self._c_schema = NULL             # <<<<<<<<<<<<<<
115600  *         _Validator.__init__(self)
115601  *         fake_c_doc = NULL
115602  */
115603   ((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->_c_schema = NULL;
115604
115605   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":51
115606  *         self._add_attribute_defaults = attribute_defaults
115607  *         self._c_schema = NULL
115608  *         _Validator.__init__(self)             # <<<<<<<<<<<<<<
115609  *         fake_c_doc = NULL
115610  *         if etree is not None:
115611  */
115612   __pyx_t_2 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Validator)), __pyx_kp___init__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
115613   __Pyx_GOTREF(__pyx_t_2);
115614   __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
115615   __Pyx_GOTREF(((PyObject *)__pyx_t_3));
115616   __Pyx_INCREF(__pyx_v_self);
115617   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self);
115618   __Pyx_GIVEREF(__pyx_v_self);
115619   __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
115620   __Pyx_GOTREF(__pyx_t_4);
115621   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
115622   __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
115623   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
115624
115625   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":52
115626  *         self._c_schema = NULL
115627  *         _Validator.__init__(self)
115628  *         fake_c_doc = NULL             # <<<<<<<<<<<<<<
115629  *         if etree is not None:
115630  *             doc = _documentOrRaise(etree)
115631  */
115632   __pyx_v_fake_c_doc = NULL;
115633
115634   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":53
115635  *         _Validator.__init__(self)
115636  *         fake_c_doc = NULL
115637  *         if etree is not None:             # <<<<<<<<<<<<<<
115638  *             doc = _documentOrRaise(etree)
115639  *             root_node = _rootNodeOrRaise(etree)
115640  */
115641   __pyx_t_1 = (__pyx_v_etree != Py_None);
115642   if (__pyx_t_1) {
115643
115644     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":54
115645  *         fake_c_doc = NULL
115646  *         if etree is not None:
115647  *             doc = _documentOrRaise(etree)             # <<<<<<<<<<<<<<
115648  *             root_node = _rootNodeOrRaise(etree)
115649  * 
115650  */
115651     __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
115652     __Pyx_GOTREF(__pyx_t_4);
115653     __Pyx_DECREF(((PyObject *)__pyx_v_doc));
115654     __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_4);
115655     __pyx_t_4 = 0;
115656
115657     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":55
115658  *         if etree is not None:
115659  *             doc = _documentOrRaise(etree)
115660  *             root_node = _rootNodeOrRaise(etree)             # <<<<<<<<<<<<<<
115661  * 
115662  *             # work around for libxml2 bug if document is not XML schema at all
115663  */
115664     __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
115665     __Pyx_GOTREF(__pyx_t_4);
115666     __Pyx_DECREF(((PyObject *)__pyx_v_root_node));
115667     __pyx_v_root_node = ((struct LxmlElement *)__pyx_t_4);
115668     __pyx_t_4 = 0;
115669
115670     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":58
115671  * 
115672  *             # work around for libxml2 bug if document is not XML schema at all
115673  *             if _LIBXML_VERSION_INT < 20624:             # <<<<<<<<<<<<<<
115674  *                 c_node = root_node._c_node
115675  *                 c_href = _getNs(c_node)
115676  */
115677     __pyx_t_1 = (__pyx_v_4lxml_5etree__LIBXML_VERSION_INT < 20624);
115678     if (__pyx_t_1) {
115679
115680       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":59
115681  *             # work around for libxml2 bug if document is not XML schema at all
115682  *             if _LIBXML_VERSION_INT < 20624:
115683  *                 c_node = root_node._c_node             # <<<<<<<<<<<<<<
115684  *                 c_href = _getNs(c_node)
115685  *                 if c_href is NULL or \
115686  */
115687       __pyx_v_c_node = __pyx_v_root_node->_c_node;
115688
115689       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":60
115690  *             if _LIBXML_VERSION_INT < 20624:
115691  *                 c_node = root_node._c_node
115692  *                 c_href = _getNs(c_node)             # <<<<<<<<<<<<<<
115693  *                 if c_href is NULL or \
115694  *                        cstd.strcmp(c_href, 'http://www.w3.org/2001/XMLSchema') != 0:
115695  */
115696       __pyx_v_c_href = _getNs(__pyx_v_c_node);
115697
115698       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":61
115699  *                 c_node = root_node._c_node
115700  *                 c_href = _getNs(c_node)
115701  *                 if c_href is NULL or \             # <<<<<<<<<<<<<<
115702  *                        cstd.strcmp(c_href, 'http://www.w3.org/2001/XMLSchema') != 0:
115703  *                     raise XMLSchemaParseError, u"Document is not XML Schema"
115704  */
115705       if (!(__pyx_v_c_href == NULL)) {
115706
115707         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":62
115708  *                 c_href = _getNs(c_node)
115709  *                 if c_href is NULL or \
115710  *                        cstd.strcmp(c_href, 'http://www.w3.org/2001/XMLSchema') != 0:             # <<<<<<<<<<<<<<
115711  *                     raise XMLSchemaParseError, u"Document is not XML Schema"
115712  * 
115713  */
115714         __pyx_t_1 = (strcmp(__pyx_v_c_href, __pyx_k_665) != 0);
115715       } else {
115716         __pyx_t_1 = (__pyx_v_c_href == NULL);
115717       }
115718       if (__pyx_t_1) {
115719
115720         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":63
115721  *                 if c_href is NULL or \
115722  *                        cstd.strcmp(c_href, 'http://www.w3.org/2001/XMLSchema') != 0:
115723  *                     raise XMLSchemaParseError, u"Document is not XML Schema"             # <<<<<<<<<<<<<<
115724  * 
115725  *             fake_c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
115726  */
115727         __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XMLSchemaParseError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
115728         __Pyx_GOTREF(__pyx_1);
115729         __Pyx_Raise(__pyx_1, ((PyObject *)__pyx_kp_666), 0);
115730         __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
115731         {__pyx_filename = __pyx_f[22]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
115732         goto __pyx_L8;
115733       }
115734       __pyx_L8:;
115735       goto __pyx_L7;
115736     }
115737     __pyx_L7:;
115738
115739     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":65
115740  *                     raise XMLSchemaParseError, u"Document is not XML Schema"
115741  * 
115742  *             fake_c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)             # <<<<<<<<<<<<<<
115743  *             self._error_log.connect()
115744  *             parser_ctxt = xmlschema.xmlSchemaNewDocParserCtxt(fake_c_doc)
115745  */
115746     __pyx_t_5 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
115747     __pyx_v_fake_c_doc = __pyx_t_5;
115748
115749     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":66
115750  * 
115751  *             fake_c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
115752  *             self._error_log.connect()             # <<<<<<<<<<<<<<
115753  *             parser_ctxt = xmlschema.xmlSchemaNewDocParserCtxt(fake_c_doc)
115754  *         elif file is not None:
115755  */
115756     ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->__pyx_base._error_log);
115757
115758     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":67
115759  *             fake_c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
115760  *             self._error_log.connect()
115761  *             parser_ctxt = xmlschema.xmlSchemaNewDocParserCtxt(fake_c_doc)             # <<<<<<<<<<<<<<
115762  *         elif file is not None:
115763  *             if _isString(file):
115764  */
115765     __pyx_v_parser_ctxt = xmlSchemaNewDocParserCtxt(__pyx_v_fake_c_doc);
115766     goto __pyx_L6;
115767   }
115768
115769   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":68
115770  *             self._error_log.connect()
115771  *             parser_ctxt = xmlschema.xmlSchemaNewDocParserCtxt(fake_c_doc)
115772  *         elif file is not None:             # <<<<<<<<<<<<<<
115773  *             if _isString(file):
115774  *                 doc = None
115775  */
115776   __pyx_t_1 = (__pyx_v_file != Py_None);
115777   if (__pyx_t_1) {
115778
115779     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":69
115780  *             parser_ctxt = xmlschema.xmlSchemaNewDocParserCtxt(fake_c_doc)
115781  *         elif file is not None:
115782  *             if _isString(file):             # <<<<<<<<<<<<<<
115783  *                 doc = None
115784  *                 filename = _encodeFilename(file)
115785  */
115786     __pyx_t_1 = _isString(__pyx_v_file);
115787     if (__pyx_t_1) {
115788
115789       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":70
115790  *         elif file is not None:
115791  *             if _isString(file):
115792  *                 doc = None             # <<<<<<<<<<<<<<
115793  *                 filename = _encodeFilename(file)
115794  *                 self._error_log.connect()
115795  */
115796       __Pyx_INCREF(Py_None);
115797       __Pyx_DECREF(((PyObject *)__pyx_v_doc));
115798       __pyx_v_doc = ((struct LxmlDocument *)Py_None);
115799
115800       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":71
115801  *             if _isString(file):
115802  *                 doc = None
115803  *                 filename = _encodeFilename(file)             # <<<<<<<<<<<<<<
115804  *                 self._error_log.connect()
115805  *                 parser_ctxt = xmlschema.xmlSchemaNewParserCtxt(_cstr(filename))
115806  */
115807       __pyx_t_4 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_file); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
115808       __Pyx_GOTREF(__pyx_t_4);
115809       __Pyx_DECREF(__pyx_v_filename);
115810       __pyx_v_filename = __pyx_t_4;
115811       __pyx_t_4 = 0;
115812
115813       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":72
115814  *                 doc = None
115815  *                 filename = _encodeFilename(file)
115816  *                 self._error_log.connect()             # <<<<<<<<<<<<<<
115817  *                 parser_ctxt = xmlschema.xmlSchemaNewParserCtxt(_cstr(filename))
115818  *             else:
115819  */
115820       ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->__pyx_base._error_log);
115821
115822       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":73
115823  *                 filename = _encodeFilename(file)
115824  *                 self._error_log.connect()
115825  *                 parser_ctxt = xmlschema.xmlSchemaNewParserCtxt(_cstr(filename))             # <<<<<<<<<<<<<<
115826  *             else:
115827  *                 doc = _parseDocument(file, None, None)
115828  */
115829       __pyx_v_parser_ctxt = xmlSchemaNewParserCtxt(PyString_AS_STRING(__pyx_v_filename));
115830       goto __pyx_L9;
115831     }
115832     /*else*/ {
115833
115834       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":75
115835  *                 parser_ctxt = xmlschema.xmlSchemaNewParserCtxt(_cstr(filename))
115836  *             else:
115837  *                 doc = _parseDocument(file, None, None)             # <<<<<<<<<<<<<<
115838  *                 self._error_log.connect()
115839  *                 parser_ctxt = xmlschema.xmlSchemaNewDocParserCtxt(doc._c_doc)
115840  */
115841       __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__parseDocument(__pyx_v_file, ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None), Py_None)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
115842       __Pyx_GOTREF(__pyx_t_4);
115843       __Pyx_DECREF(((PyObject *)__pyx_v_doc));
115844       __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_4);
115845       __pyx_t_4 = 0;
115846
115847       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":76
115848  *             else:
115849  *                 doc = _parseDocument(file, None, None)
115850  *                 self._error_log.connect()             # <<<<<<<<<<<<<<
115851  *                 parser_ctxt = xmlschema.xmlSchemaNewDocParserCtxt(doc._c_doc)
115852  *         else:
115853  */
115854       ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->__pyx_base._error_log);
115855
115856       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":77
115857  *                 doc = _parseDocument(file, None, None)
115858  *                 self._error_log.connect()
115859  *                 parser_ctxt = xmlschema.xmlSchemaNewDocParserCtxt(doc._c_doc)             # <<<<<<<<<<<<<<
115860  *         else:
115861  *             raise XMLSchemaParseError, u"No tree or file given"
115862  */
115863       __pyx_v_parser_ctxt = xmlSchemaNewDocParserCtxt(__pyx_v_doc->_c_doc);
115864     }
115865     __pyx_L9:;
115866     goto __pyx_L6;
115867   }
115868   /*else*/ {
115869
115870     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":79
115871  *                 parser_ctxt = xmlschema.xmlSchemaNewDocParserCtxt(doc._c_doc)
115872  *         else:
115873  *             raise XMLSchemaParseError, u"No tree or file given"             # <<<<<<<<<<<<<<
115874  * 
115875  *         if parser_ctxt is not NULL:
115876  */
115877     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XMLSchemaParseError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
115878     __Pyx_GOTREF(__pyx_1);
115879     __Pyx_Raise(__pyx_1, ((PyObject *)__pyx_kp_667), 0);
115880     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
115881     {__pyx_filename = __pyx_f[22]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
115882   }
115883   __pyx_L6:;
115884
115885   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":81
115886  *             raise XMLSchemaParseError, u"No tree or file given"
115887  * 
115888  *         if parser_ctxt is not NULL:             # <<<<<<<<<<<<<<
115889  *             if doc is None:
115890  *                 with nogil:
115891  */
115892   __pyx_t_1 = (__pyx_v_parser_ctxt != NULL);
115893   if (__pyx_t_1) {
115894
115895     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":82
115896  * 
115897  *         if parser_ctxt is not NULL:
115898  *             if doc is None:             # <<<<<<<<<<<<<<
115899  *                 with nogil:
115900  *                     self._c_schema = xmlschema.xmlSchemaParse(parser_ctxt)
115901  */
115902     __pyx_t_1 = (((PyObject *)__pyx_v_doc) == Py_None);
115903     if (__pyx_t_1) {
115904
115905       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":83
115906  *         if parser_ctxt is not NULL:
115907  *             if doc is None:
115908  *                 with nogil:             # <<<<<<<<<<<<<<
115909  *                     self._c_schema = xmlschema.xmlSchemaParse(parser_ctxt)
115910  *             else:
115911  */
115912       { PyThreadState *_save;
115913         Py_UNBLOCK_THREADS
115914         /*try:*/ {
115915
115916           /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":84
115917  *             if doc is None:
115918  *                 with nogil:
115919  *                     self._c_schema = xmlschema.xmlSchemaParse(parser_ctxt)             # <<<<<<<<<<<<<<
115920  *             else:
115921  *                 # calling xmlSchemaParse on a schema with imports or
115922  */
115923           ((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->_c_schema = xmlSchemaParse(__pyx_v_parser_ctxt);
115924         }
115925         /*finally:*/ {
115926           Py_BLOCK_THREADS
115927         }
115928       }
115929       goto __pyx_L11;
115930     }
115931     /*else*/ {
115932
115933       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":90
115934  *                 # context for parsing, so push an implied context to route
115935  *                 # resolve requests to the document's parser
115936  *                 __GLOBAL_PARSER_CONTEXT.pushImpliedContextFromParser(doc._parser)             # <<<<<<<<<<<<<<
115937  *                 self._c_schema = xmlschema.xmlSchemaParse(parser_ctxt)
115938  *                 __GLOBAL_PARSER_CONTEXT.popImpliedContext()
115939  */
115940       ((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->pushImpliedContextFromParser(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT, __pyx_v_doc->_parser);
115941
115942       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":91
115943  *                 # resolve requests to the document's parser
115944  *                 __GLOBAL_PARSER_CONTEXT.pushImpliedContextFromParser(doc._parser)
115945  *                 self._c_schema = xmlschema.xmlSchemaParse(parser_ctxt)             # <<<<<<<<<<<<<<
115946  *                 __GLOBAL_PARSER_CONTEXT.popImpliedContext()
115947  * 
115948  */
115949       ((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->_c_schema = xmlSchemaParse(__pyx_v_parser_ctxt);
115950
115951       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":92
115952  *                 __GLOBAL_PARSER_CONTEXT.pushImpliedContextFromParser(doc._parser)
115953  *                 self._c_schema = xmlschema.xmlSchemaParse(parser_ctxt)
115954  *                 __GLOBAL_PARSER_CONTEXT.popImpliedContext()             # <<<<<<<<<<<<<<
115955  * 
115956  *             if _LIBXML_VERSION_INT >= 20624:
115957  */
115958       ((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->popImpliedContext(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT);
115959     }
115960     __pyx_L11:;
115961
115962     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":94
115963  *                 __GLOBAL_PARSER_CONTEXT.popImpliedContext()
115964  * 
115965  *             if _LIBXML_VERSION_INT >= 20624:             # <<<<<<<<<<<<<<
115966  *                 xmlschema.xmlSchemaFreeParserCtxt(parser_ctxt)
115967  * 
115968  */
115969     __pyx_t_1 = (__pyx_v_4lxml_5etree__LIBXML_VERSION_INT >= 20624);
115970     if (__pyx_t_1) {
115971
115972       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":95
115973  * 
115974  *             if _LIBXML_VERSION_INT >= 20624:
115975  *                 xmlschema.xmlSchemaFreeParserCtxt(parser_ctxt)             # <<<<<<<<<<<<<<
115976  * 
115977  *         self._error_log.disconnect()
115978  */
115979       xmlSchemaFreeParserCtxt(__pyx_v_parser_ctxt);
115980       goto __pyx_L15;
115981     }
115982     __pyx_L15:;
115983     goto __pyx_L10;
115984   }
115985   __pyx_L10:;
115986
115987   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":97
115988  *                 xmlschema.xmlSchemaFreeParserCtxt(parser_ctxt)
115989  * 
115990  *         self._error_log.disconnect()             # <<<<<<<<<<<<<<
115991  * 
115992  *         if fake_c_doc is not NULL:
115993  */
115994   ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->__pyx_base._error_log);
115995
115996   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":99
115997  *         self._error_log.disconnect()
115998  * 
115999  *         if fake_c_doc is not NULL:             # <<<<<<<<<<<<<<
116000  *             _destroyFakeDoc(doc._c_doc, fake_c_doc)
116001  * 
116002  */
116003   __pyx_t_1 = (__pyx_v_fake_c_doc != NULL);
116004   if (__pyx_t_1) {
116005
116006     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":100
116007  * 
116008  *         if fake_c_doc is not NULL:
116009  *             _destroyFakeDoc(doc._c_doc, fake_c_doc)             # <<<<<<<<<<<<<<
116010  * 
116011  *         if self._c_schema is NULL:
116012  */
116013     __pyx_f_4lxml_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc, __pyx_v_fake_c_doc);
116014     goto __pyx_L16;
116015   }
116016   __pyx_L16:;
116017
116018   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":102
116019  *             _destroyFakeDoc(doc._c_doc, fake_c_doc)
116020  * 
116021  *         if self._c_schema is NULL:             # <<<<<<<<<<<<<<
116022  *             raise XMLSchemaParseError(
116023  *                 self._error_log._buildExceptionMessage(
116024  */
116025   __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->_c_schema == NULL);
116026   if (__pyx_t_1) {
116027
116028     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":103
116029  * 
116030  *         if self._c_schema is NULL:
116031  *             raise XMLSchemaParseError(             # <<<<<<<<<<<<<<
116032  *                 self._error_log._buildExceptionMessage(
116033  *                     u"Document is not valid XML Schema"),
116034  */
116035     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XMLSchemaParseError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
116036     __Pyx_GOTREF(__pyx_1);
116037
116038     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":105
116039  *             raise XMLSchemaParseError(
116040  *                 self._error_log._buildExceptionMessage(
116041  *                     u"Document is not valid XML Schema"),             # <<<<<<<<<<<<<<
116042  *                 self._error_log)
116043  * 
116044  */
116045     __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._buildExceptionMessage(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->__pyx_base._error_log), ((PyObject *)__pyx_kp_668)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
116046     __Pyx_GOTREF(__pyx_t_4);
116047
116048     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":106
116049  *                 self._error_log._buildExceptionMessage(
116050  *                     u"Document is not valid XML Schema"),
116051  *                 self._error_log)             # <<<<<<<<<<<<<<
116052  * 
116053  *         if doc is not None:
116054  */
116055     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
116056     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
116057     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
116058     __Pyx_GIVEREF(__pyx_t_4);
116059     __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->__pyx_base._error_log));
116060     PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->__pyx_base._error_log));
116061     __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->__pyx_base._error_log));
116062     __pyx_t_4 = 0;
116063     __pyx_t_4 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
116064     __Pyx_GOTREF(__pyx_t_4);
116065     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
116066     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
116067     __Pyx_Raise(__pyx_t_4, 0, 0);
116068     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
116069     {__pyx_filename = __pyx_f[22]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
116070     goto __pyx_L17;
116071   }
116072   __pyx_L17:;
116073
116074   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":108
116075  *                 self._error_log)
116076  * 
116077  *         if doc is not None:             # <<<<<<<<<<<<<<
116078  *             self._has_default_attributes = _check_for_default_attributes(doc)
116079  *         self._add_attribute_defaults = attribute_defaults and \
116080  */
116081   __pyx_t_1 = (((PyObject *)__pyx_v_doc) != Py_None);
116082   if (__pyx_t_1) {
116083
116084     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":109
116085  * 
116086  *         if doc is not None:
116087  *             self._has_default_attributes = _check_for_default_attributes(doc)             # <<<<<<<<<<<<<<
116088  *         self._add_attribute_defaults = attribute_defaults and \
116089  *                                        self._has_default_attributes
116090  */
116091     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
116092     __Pyx_GOTREF(((PyObject *)__pyx_t_4));
116093     __Pyx_INCREF(((PyObject *)__pyx_v_doc));
116094     PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_doc));
116095     __Pyx_GIVEREF(((PyObject *)__pyx_v_doc));
116096     __pyx_t_3 = PyObject_Call(((PyObject *)__pyx_v_4lxml_5etree__check_for_default_attributes), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
116097     __Pyx_GOTREF(__pyx_t_3);
116098     __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
116099     __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 == (int)-1))) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
116100     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
116101     ((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->_has_default_attributes = __pyx_t_1;
116102     goto __pyx_L18;
116103   }
116104   __pyx_L18:;
116105
116106   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":110
116107  *         if doc is not None:
116108  *             self._has_default_attributes = _check_for_default_attributes(doc)
116109  *         self._add_attribute_defaults = attribute_defaults and \             # <<<<<<<<<<<<<<
116110  *                                        self._has_default_attributes
116111  * 
116112  */
116113   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_attribute_defaults); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
116114   if (__pyx_t_1) {
116115
116116     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":111
116117  *             self._has_default_attributes = _check_for_default_attributes(doc)
116118  *         self._add_attribute_defaults = attribute_defaults and \
116119  *                                        self._has_default_attributes             # <<<<<<<<<<<<<<
116120  * 
116121  *     def __dealloc__(self):
116122  */
116123     __pyx_t_3 = __Pyx_PyBool_FromLong(((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->_has_default_attributes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
116124     __Pyx_GOTREF(__pyx_t_3);
116125     __pyx_t_4 = __pyx_t_3;
116126     __pyx_t_3 = 0;
116127   } else {
116128     __Pyx_INCREF(__pyx_v_attribute_defaults);
116129     __pyx_t_4 = __pyx_v_attribute_defaults;
116130   }
116131   __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 == (int)-1))) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
116132   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
116133
116134   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":110
116135  *         if doc is not None:
116136  *             self._has_default_attributes = _check_for_default_attributes(doc)
116137  *         self._add_attribute_defaults = attribute_defaults and \             # <<<<<<<<<<<<<<
116138  *                                        self._has_default_attributes
116139  * 
116140  */
116141   ((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->_add_attribute_defaults = __pyx_t_1;
116142
116143   __pyx_r = 0;
116144   goto __pyx_L0;
116145   __pyx_L1_error:;
116146   __Pyx_XDECREF(__pyx_1);
116147   __Pyx_XDECREF(__pyx_t_2);
116148   __Pyx_XDECREF(__pyx_t_3);
116149   __Pyx_XDECREF(__pyx_t_4);
116150   __Pyx_AddTraceback("lxml.etree.XMLSchema.__init__");
116151   __pyx_r = -1;
116152   __pyx_L0:;
116153   __Pyx_DECREF((PyObject *)__pyx_v_doc);
116154   __Pyx_DECREF((PyObject *)__pyx_v_root_node);
116155   __Pyx_DECREF(__pyx_v_filename);
116156   __Pyx_FinishRefcountContext();
116157   return __pyx_r;
116158 }
116159
116160 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":113
116161  *                                        self._has_default_attributes
116162  * 
116163  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
116164  *         xmlschema.xmlSchemaFree(self._c_schema)
116165  * 
116166  */
116167
116168 static void __pyx_pf_4lxml_5etree_9XMLSchema___dealloc__(PyObject *__pyx_v_self); /*proto*/
116169 static void __pyx_pf_4lxml_5etree_9XMLSchema___dealloc__(PyObject *__pyx_v_self) {
116170   __Pyx_SetupRefcountContext("__dealloc__");
116171
116172   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":114
116173  * 
116174  *     def __dealloc__(self):
116175  *         xmlschema.xmlSchemaFree(self._c_schema)             # <<<<<<<<<<<<<<
116176  * 
116177  *     def __call__(self, etree):
116178  */
116179   xmlSchemaFree(((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->_c_schema);
116180
116181   __Pyx_FinishRefcountContext();
116182 }
116183
116184 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":116
116185  *         xmlschema.xmlSchemaFree(self._c_schema)
116186  * 
116187  *     def __call__(self, etree):             # <<<<<<<<<<<<<<
116188  *         u"""__call__(self, etree)
116189  * 
116190  */
116191
116192 static PyObject *__pyx_pf_4lxml_5etree_9XMLSchema___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
116193 static char __pyx_doc_4lxml_5etree_9XMLSchema___call__[] = "__call__(self, etree)\n\n        Validate doc using XML Schema.\n\n        Returns true if document is valid, false if not.\n        ";
116194 static PyObject *__pyx_pf_4lxml_5etree_9XMLSchema___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
116195   PyObject *__pyx_v_etree = 0;
116196   xmlSchemaValidCtxt *__pyx_v_valid_ctxt;
116197   struct LxmlDocument *__pyx_v_doc;
116198   struct LxmlElement *__pyx_v_root_node;
116199   xmlDoc *__pyx_v_c_doc;
116200   int __pyx_v_ret;
116201   PyObject *__pyx_r = NULL;
116202   PyObject *__pyx_1 = 0;
116203   PyObject *__pyx_t_1 = NULL;
116204   int __pyx_t_2;
116205   xmlDoc *__pyx_t_3;
116206   PyObject *__pyx_t_4 = NULL;
116207   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_etree,0};
116208   __Pyx_SetupRefcountContext("__call__");
116209   if (unlikely(__pyx_kwds)) {
116210     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
116211     PyObject* values[1] = {0};
116212     switch (PyTuple_GET_SIZE(__pyx_args)) {
116213       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
116214       case  0: break;
116215       default: goto __pyx_L5_argtuple_error;
116216     }
116217     switch (PyTuple_GET_SIZE(__pyx_args)) {
116218       case  0:
116219       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_etree);
116220       if (likely(values[0])) kw_args--;
116221       else goto __pyx_L5_argtuple_error;
116222     }
116223     if (unlikely(kw_args > 0)) {
116224       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__call__") < 0)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
116225     }
116226     __pyx_v_etree = values[0];
116227   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
116228     goto __pyx_L5_argtuple_error;
116229   } else {
116230     __pyx_v_etree = PyTuple_GET_ITEM(__pyx_args, 0);
116231   }
116232   goto __pyx_L4_argument_unpacking_done;
116233   __pyx_L5_argtuple_error:;
116234   __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[22]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
116235   __pyx_L3_error:;
116236   __Pyx_AddTraceback("lxml.etree.XMLSchema.__call__");
116237   return NULL;
116238   __pyx_L4_argument_unpacking_done:;
116239   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
116240   __pyx_v_root_node = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
116241
116242   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":129
116243  *         cdef int ret
116244  * 
116245  *         doc = _documentOrRaise(etree)             # <<<<<<<<<<<<<<
116246  *         root_node = _rootNodeOrRaise(etree)
116247  * 
116248  */
116249   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
116250   __Pyx_GOTREF(__pyx_t_1);
116251   __Pyx_DECREF(((PyObject *)__pyx_v_doc));
116252   __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_1);
116253   __pyx_t_1 = 0;
116254
116255   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":130
116256  * 
116257  *         doc = _documentOrRaise(etree)
116258  *         root_node = _rootNodeOrRaise(etree)             # <<<<<<<<<<<<<<
116259  * 
116260  *         self._error_log.connect()
116261  */
116262   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
116263   __Pyx_GOTREF(__pyx_t_1);
116264   __Pyx_DECREF(((PyObject *)__pyx_v_root_node));
116265   __pyx_v_root_node = ((struct LxmlElement *)__pyx_t_1);
116266   __pyx_t_1 = 0;
116267
116268   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":132
116269  *         root_node = _rootNodeOrRaise(etree)
116270  * 
116271  *         self._error_log.connect()             # <<<<<<<<<<<<<<
116272  *         valid_ctxt = xmlschema.xmlSchemaNewValidCtxt(self._c_schema)
116273  *         if valid_ctxt is NULL:
116274  */
116275   ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->__pyx_base._error_log);
116276
116277   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":133
116278  * 
116279  *         self._error_log.connect()
116280  *         valid_ctxt = xmlschema.xmlSchemaNewValidCtxt(self._c_schema)             # <<<<<<<<<<<<<<
116281  *         if valid_ctxt is NULL:
116282  *             self._error_log.disconnect()
116283  */
116284   __pyx_v_valid_ctxt = xmlSchemaNewValidCtxt(((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->_c_schema);
116285
116286   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":134
116287  *         self._error_log.connect()
116288  *         valid_ctxt = xmlschema.xmlSchemaNewValidCtxt(self._c_schema)
116289  *         if valid_ctxt is NULL:             # <<<<<<<<<<<<<<
116290  *             self._error_log.disconnect()
116291  *             return python.PyErr_NoMemory()
116292  */
116293   __pyx_t_2 = (__pyx_v_valid_ctxt == NULL);
116294   if (__pyx_t_2) {
116295
116296     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":135
116297  *         valid_ctxt = xmlschema.xmlSchemaNewValidCtxt(self._c_schema)
116298  *         if valid_ctxt is NULL:
116299  *             self._error_log.disconnect()             # <<<<<<<<<<<<<<
116300  *             return python.PyErr_NoMemory()
116301  * 
116302  */
116303     ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->__pyx_base._error_log);
116304
116305     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":136
116306  *         if valid_ctxt is NULL:
116307  *             self._error_log.disconnect()
116308  *             return python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
116309  * 
116310  *         if self._add_attribute_defaults:
116311  */
116312     __Pyx_XDECREF(__pyx_r);
116313     __pyx_t_1 = PyErr_NoMemory(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
116314     __Pyx_GOTREF(__pyx_t_1);
116315     __pyx_r = __pyx_t_1;
116316     __pyx_t_1 = 0;
116317     goto __pyx_L0;
116318     goto __pyx_L6;
116319   }
116320   __pyx_L6:;
116321
116322   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":138
116323  *             return python.PyErr_NoMemory()
116324  * 
116325  *         if self._add_attribute_defaults:             # <<<<<<<<<<<<<<
116326  *             xmlschema.xmlSchemaSetValidOptions(
116327  *                 valid_ctxt, xmlschema.XML_SCHEMA_VAL_VC_I_CREATE)
116328  */
116329   __pyx_t_2 = ((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->_add_attribute_defaults;
116330   if (__pyx_t_2) {
116331
116332     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":140
116333  *         if self._add_attribute_defaults:
116334  *             xmlschema.xmlSchemaSetValidOptions(
116335  *                 valid_ctxt, xmlschema.XML_SCHEMA_VAL_VC_I_CREATE)             # <<<<<<<<<<<<<<
116336  * 
116337  *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
116338  */
116339     xmlSchemaSetValidOptions(__pyx_v_valid_ctxt, XML_SCHEMA_VAL_VC_I_CREATE);
116340     goto __pyx_L7;
116341   }
116342   __pyx_L7:;
116343
116344   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":142
116345  *                 valid_ctxt, xmlschema.XML_SCHEMA_VAL_VC_I_CREATE)
116346  * 
116347  *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)             # <<<<<<<<<<<<<<
116348  *         with nogil:
116349  *             ret = xmlschema.xmlSchemaValidateDoc(valid_ctxt, c_doc)
116350  */
116351   __pyx_t_3 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
116352   __pyx_v_c_doc = __pyx_t_3;
116353
116354   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":143
116355  * 
116356  *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
116357  *         with nogil:             # <<<<<<<<<<<<<<
116358  *             ret = xmlschema.xmlSchemaValidateDoc(valid_ctxt, c_doc)
116359  *         _destroyFakeDoc(doc._c_doc, c_doc)
116360  */
116361   { PyThreadState *_save;
116362     Py_UNBLOCK_THREADS
116363     /*try:*/ {
116364
116365       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":144
116366  *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
116367  *         with nogil:
116368  *             ret = xmlschema.xmlSchemaValidateDoc(valid_ctxt, c_doc)             # <<<<<<<<<<<<<<
116369  *         _destroyFakeDoc(doc._c_doc, c_doc)
116370  * 
116371  */
116372       __pyx_v_ret = xmlSchemaValidateDoc(__pyx_v_valid_ctxt, __pyx_v_c_doc);
116373     }
116374     /*finally:*/ {
116375       Py_BLOCK_THREADS
116376     }
116377   }
116378
116379   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":145
116380  *         with nogil:
116381  *             ret = xmlschema.xmlSchemaValidateDoc(valid_ctxt, c_doc)
116382  *         _destroyFakeDoc(doc._c_doc, c_doc)             # <<<<<<<<<<<<<<
116383  * 
116384  *         xmlschema.xmlSchemaFreeValidCtxt(valid_ctxt)
116385  */
116386   __pyx_f_4lxml_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc, __pyx_v_c_doc);
116387
116388   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":147
116389  *         _destroyFakeDoc(doc._c_doc, c_doc)
116390  * 
116391  *         xmlschema.xmlSchemaFreeValidCtxt(valid_ctxt)             # <<<<<<<<<<<<<<
116392  * 
116393  *         self._error_log.disconnect()
116394  */
116395   xmlSchemaFreeValidCtxt(__pyx_v_valid_ctxt);
116396
116397   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":149
116398  *         xmlschema.xmlSchemaFreeValidCtxt(valid_ctxt)
116399  * 
116400  *         self._error_log.disconnect()             # <<<<<<<<<<<<<<
116401  *         if ret == -1:
116402  *             raise XMLSchemaValidateError(
116403  */
116404   ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->__pyx_base._error_log);
116405
116406   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":150
116407  * 
116408  *         self._error_log.disconnect()
116409  *         if ret == -1:             # <<<<<<<<<<<<<<
116410  *             raise XMLSchemaValidateError(
116411  *                 u"Internal error in XML Schema validation.",
116412  */
116413   __pyx_t_2 = (__pyx_v_ret == -1);
116414   if (__pyx_t_2) {
116415
116416     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":151
116417  *         self._error_log.disconnect()
116418  *         if ret == -1:
116419  *             raise XMLSchemaValidateError(             # <<<<<<<<<<<<<<
116420  *                 u"Internal error in XML Schema validation.",
116421  *                 self._error_log)
116422  */
116423     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_213); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
116424     __Pyx_GOTREF(__pyx_1);
116425
116426     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":153
116427  *             raise XMLSchemaValidateError(
116428  *                 u"Internal error in XML Schema validation.",
116429  *                 self._error_log)             # <<<<<<<<<<<<<<
116430  *         if ret == 0:
116431  *             return True
116432  */
116433     __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
116434     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
116435     __Pyx_INCREF(((PyObject *)__pyx_kp_669));
116436     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_669));
116437     __Pyx_GIVEREF(((PyObject *)__pyx_kp_669));
116438     __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->__pyx_base._error_log));
116439     PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->__pyx_base._error_log));
116440     __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->__pyx_base._error_log));
116441     __pyx_t_4 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
116442     __Pyx_GOTREF(__pyx_t_4);
116443     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
116444     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
116445     __Pyx_Raise(__pyx_t_4, 0, 0);
116446     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
116447     {__pyx_filename = __pyx_f[22]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
116448     goto __pyx_L11;
116449   }
116450   __pyx_L11:;
116451
116452   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":154
116453  *                 u"Internal error in XML Schema validation.",
116454  *                 self._error_log)
116455  *         if ret == 0:             # <<<<<<<<<<<<<<
116456  *             return True
116457  *         else:
116458  */
116459   __pyx_t_2 = (__pyx_v_ret == 0);
116460   if (__pyx_t_2) {
116461
116462     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":155
116463  *                 self._error_log)
116464  *         if ret == 0:
116465  *             return True             # <<<<<<<<<<<<<<
116466  *         else:
116467  *             return False
116468  */
116469     __Pyx_XDECREF(__pyx_r);
116470     __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
116471     __Pyx_GOTREF(__pyx_t_4);
116472     __pyx_r = __pyx_t_4;
116473     __pyx_t_4 = 0;
116474     goto __pyx_L0;
116475     goto __pyx_L12;
116476   }
116477   /*else*/ {
116478
116479     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":157
116480  *             return True
116481  *         else:
116482  *             return False             # <<<<<<<<<<<<<<
116483  * 
116484  *     cdef _ParserSchemaValidationContext _newSaxValidator(
116485  */
116486     __Pyx_XDECREF(__pyx_r);
116487     __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
116488     __Pyx_GOTREF(__pyx_t_4);
116489     __pyx_r = __pyx_t_4;
116490     __pyx_t_4 = 0;
116491     goto __pyx_L0;
116492   }
116493   __pyx_L12:;
116494
116495   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
116496   goto __pyx_L0;
116497   __pyx_L1_error:;
116498   __Pyx_XDECREF(__pyx_1);
116499   __Pyx_XDECREF(__pyx_t_1);
116500   __Pyx_XDECREF(__pyx_t_4);
116501   __Pyx_AddTraceback("lxml.etree.XMLSchema.__call__");
116502   __pyx_r = NULL;
116503   __pyx_L0:;
116504   __Pyx_DECREF((PyObject *)__pyx_v_doc);
116505   __Pyx_DECREF((PyObject *)__pyx_v_root_node);
116506   __Pyx_XGIVEREF(__pyx_r);
116507   __Pyx_FinishRefcountContext();
116508   return __pyx_r;
116509 }
116510
116511 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":159
116512  *             return False
116513  * 
116514  *     cdef _ParserSchemaValidationContext _newSaxValidator(             # <<<<<<<<<<<<<<
116515  *             self, bint add_default_attributes):
116516  *         cdef _ParserSchemaValidationContext context
116517  */
116518
116519 static  struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *__pyx_f_4lxml_5etree_9XMLSchema__newSaxValidator(struct __pyx_obj_4lxml_5etree_XMLSchema *__pyx_v_self, int __pyx_v_add_default_attributes) {
116520   struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *__pyx_v_context;
116521   struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *__pyx_r = NULL;
116522   PyObject *__pyx_t_1 = NULL;
116523   int __pyx_t_2;
116524   int __pyx_t_3;
116525   __Pyx_SetupRefcountContext("_newSaxValidator");
116526   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *)Py_None); __Pyx_INCREF(Py_None);
116527
116528   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":162
116529  *             self, bint add_default_attributes):
116530  *         cdef _ParserSchemaValidationContext context
116531  *         context = NEW_SCHEMA_CONTEXT(_ParserSchemaValidationContext)             # <<<<<<<<<<<<<<
116532  *         context._schema = self
116533  *         context._valid_ctxt = NULL
116534  */
116535   __pyx_t_1 = ((PyObject *)PY_NEW(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ParserSchemaValidationContext)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
116536   __Pyx_GOTREF(__pyx_t_1);
116537   __Pyx_DECREF(((PyObject *)__pyx_v_context));
116538   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *)__pyx_t_1);
116539   __pyx_t_1 = 0;
116540
116541   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":163
116542  *         cdef _ParserSchemaValidationContext context
116543  *         context = NEW_SCHEMA_CONTEXT(_ParserSchemaValidationContext)
116544  *         context._schema = self             # <<<<<<<<<<<<<<
116545  *         context._valid_ctxt = NULL
116546  *         context._sax_plug = NULL
116547  */
116548   __Pyx_INCREF(((PyObject *)__pyx_v_self));
116549   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
116550   __Pyx_GOTREF(__pyx_v_context->_schema);
116551   __Pyx_DECREF(((PyObject *)__pyx_v_context->_schema));
116552   __pyx_v_context->_schema = __pyx_v_self;
116553
116554   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":164
116555  *         context = NEW_SCHEMA_CONTEXT(_ParserSchemaValidationContext)
116556  *         context._schema = self
116557  *         context._valid_ctxt = NULL             # <<<<<<<<<<<<<<
116558  *         context._sax_plug = NULL
116559  *         context._add_default_attributes = (self._has_default_attributes and (
116560  */
116561   __pyx_v_context->_valid_ctxt = NULL;
116562
116563   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":165
116564  *         context._schema = self
116565  *         context._valid_ctxt = NULL
116566  *         context._sax_plug = NULL             # <<<<<<<<<<<<<<
116567  *         context._add_default_attributes = (self._has_default_attributes and (
116568  *             add_default_attributes or self._add_attribute_defaults))
116569  */
116570   __pyx_v_context->_sax_plug = NULL;
116571
116572   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":166
116573  *         context._valid_ctxt = NULL
116574  *         context._sax_plug = NULL
116575  *         context._add_default_attributes = (self._has_default_attributes and (             # <<<<<<<<<<<<<<
116576  *             add_default_attributes or self._add_attribute_defaults))
116577  *         return context
116578  */
116579   if (__pyx_v_self->_has_default_attributes) {
116580
116581     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":167
116582  *         context._sax_plug = NULL
116583  *         context._add_default_attributes = (self._has_default_attributes and (
116584  *             add_default_attributes or self._add_attribute_defaults))             # <<<<<<<<<<<<<<
116585  *         return context
116586  * 
116587  */
116588     if (!__pyx_v_add_default_attributes) {
116589       __pyx_t_2 = __pyx_v_self->_add_attribute_defaults;
116590     } else {
116591       __pyx_t_2 = __pyx_v_add_default_attributes;
116592     }
116593     __pyx_t_3 = __pyx_t_2;
116594   } else {
116595     __pyx_t_3 = __pyx_v_self->_has_default_attributes;
116596   }
116597
116598   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":166
116599  *         context._valid_ctxt = NULL
116600  *         context._sax_plug = NULL
116601  *         context._add_default_attributes = (self._has_default_attributes and (             # <<<<<<<<<<<<<<
116602  *             add_default_attributes or self._add_attribute_defaults))
116603  *         return context
116604  */
116605   __pyx_v_context->_add_default_attributes = __pyx_t_3;
116606
116607   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":168
116608  *         context._add_default_attributes = (self._has_default_attributes and (
116609  *             add_default_attributes or self._add_attribute_defaults))
116610  *         return context             # <<<<<<<<<<<<<<
116611  * 
116612  * cdef class _ParserSchemaValidationContext:
116613  */
116614   __Pyx_XDECREF(((PyObject *)__pyx_r));
116615   __Pyx_INCREF(((PyObject *)__pyx_v_context));
116616   __pyx_r = __pyx_v_context;
116617   goto __pyx_L0;
116618
116619   __pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *)Py_None); __Pyx_INCREF(Py_None);
116620   goto __pyx_L0;
116621   __pyx_L1_error:;
116622   __Pyx_XDECREF(__pyx_t_1);
116623   __Pyx_AddTraceback("lxml.etree.XMLSchema._newSaxValidator");
116624   __pyx_r = 0;
116625   __pyx_L0:;
116626   __Pyx_DECREF((PyObject *)__pyx_v_context);
116627   __Pyx_XGIVEREF((PyObject *)__pyx_r);
116628   __Pyx_FinishRefcountContext();
116629   return __pyx_r;
116630 }
116631
116632 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":176
116633  *     cdef bint _add_default_attributes
116634  * 
116635  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
116636  *         self.disconnect()
116637  *         if self._valid_ctxt:
116638  */
116639
116640 static void __pyx_pf_4lxml_5etree_30_ParserSchemaValidationContext___dealloc__(PyObject *__pyx_v_self); /*proto*/
116641 static void __pyx_pf_4lxml_5etree_30_ParserSchemaValidationContext___dealloc__(PyObject *__pyx_v_self) {
116642   int __pyx_t_1;
116643   __Pyx_SetupRefcountContext("__dealloc__");
116644
116645   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":177
116646  * 
116647  *     def __dealloc__(self):
116648  *         self.disconnect()             # <<<<<<<<<<<<<<
116649  *         if self._valid_ctxt:
116650  *             xmlschema.xmlSchemaFreeValidCtxt(self._valid_ctxt)
116651  */
116652   ((struct __pyx_vtabstruct_4lxml_5etree__ParserSchemaValidationContext *)((struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *)__pyx_v_self)->__pyx_vtab)->disconnect(((struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *)__pyx_v_self));
116653
116654   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":178
116655  *     def __dealloc__(self):
116656  *         self.disconnect()
116657  *         if self._valid_ctxt:             # <<<<<<<<<<<<<<
116658  *             xmlschema.xmlSchemaFreeValidCtxt(self._valid_ctxt)
116659  * 
116660  */
116661   __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *)__pyx_v_self)->_valid_ctxt != 0);
116662   if (__pyx_t_1) {
116663
116664     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":179
116665  *         self.disconnect()
116666  *         if self._valid_ctxt:
116667  *             xmlschema.xmlSchemaFreeValidCtxt(self._valid_ctxt)             # <<<<<<<<<<<<<<
116668  * 
116669  *     cdef _ParserSchemaValidationContext copy(self):
116670  */
116671     xmlSchemaFreeValidCtxt(((struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *)__pyx_v_self)->_valid_ctxt);
116672     goto __pyx_L5;
116673   }
116674   __pyx_L5:;
116675
116676   __Pyx_FinishRefcountContext();
116677 }
116678
116679 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":181
116680  *             xmlschema.xmlSchemaFreeValidCtxt(self._valid_ctxt)
116681  * 
116682  *     cdef _ParserSchemaValidationContext copy(self):             # <<<<<<<<<<<<<<
116683  *         return self._schema._newSaxValidator(
116684  *             self._add_default_attributes)
116685  */
116686
116687 static  struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *__pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_copy(struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *__pyx_v_self) {
116688   struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *__pyx_r = NULL;
116689   PyObject *__pyx_t_1 = NULL;
116690   __Pyx_SetupRefcountContext("copy");
116691
116692   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":182
116693  * 
116694  *     cdef _ParserSchemaValidationContext copy(self):
116695  *         return self._schema._newSaxValidator(             # <<<<<<<<<<<<<<
116696  *             self._add_default_attributes)
116697  * 
116698  */
116699   __Pyx_XDECREF(((PyObject *)__pyx_r));
116700
116701   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":183
116702  *     cdef _ParserSchemaValidationContext copy(self):
116703  *         return self._schema._newSaxValidator(
116704  *             self._add_default_attributes)             # <<<<<<<<<<<<<<
116705  * 
116706  *     cdef void inject_default_attributes(self, xmlDoc* c_doc):
116707  */
116708   __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree_XMLSchema *)__pyx_v_self->_schema->__pyx_vtab)->_newSaxValidator(__pyx_v_self->_schema, __pyx_v_self->_add_default_attributes)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
116709   __Pyx_GOTREF(__pyx_t_1);
116710   __pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *)__pyx_t_1);
116711   __pyx_t_1 = 0;
116712   goto __pyx_L0;
116713
116714   __pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *)Py_None); __Pyx_INCREF(Py_None);
116715   goto __pyx_L0;
116716   __pyx_L1_error:;
116717   __Pyx_XDECREF(__pyx_t_1);
116718   __Pyx_AddTraceback("lxml.etree._ParserSchemaValidationContext.copy");
116719   __pyx_r = 0;
116720   __pyx_L0:;
116721   __Pyx_XGIVEREF((PyObject *)__pyx_r);
116722   __Pyx_FinishRefcountContext();
116723   return __pyx_r;
116724 }
116725
116726 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":185
116727  *             self._add_default_attributes)
116728  * 
116729  *     cdef void inject_default_attributes(self, xmlDoc* c_doc):             # <<<<<<<<<<<<<<
116730  *         # we currently need to insert default attributes manually
116731  *         # after parsing, as libxml2 does not support this at parse
116732  */
116733
116734 static  void __pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_inject_default_attributes(struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *__pyx_v_self, xmlDoc *__pyx_v_c_doc) {
116735   int __pyx_t_1;
116736   __Pyx_SetupRefcountContext("inject_default_attributes");
116737
116738   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":189
116739  *         # after parsing, as libxml2 does not support this at parse
116740  *         # time
116741  *         if self._add_default_attributes:             # <<<<<<<<<<<<<<
116742  *             with nogil:
116743  *                 xmlschema.xmlSchemaValidateDoc(self._valid_ctxt, c_doc)
116744  */
116745   __pyx_t_1 = __pyx_v_self->_add_default_attributes;
116746   if (__pyx_t_1) {
116747
116748     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":190
116749  *         # time
116750  *         if self._add_default_attributes:
116751  *             with nogil:             # <<<<<<<<<<<<<<
116752  *                 xmlschema.xmlSchemaValidateDoc(self._valid_ctxt, c_doc)
116753  * 
116754  */
116755     { PyThreadState *_save;
116756       Py_UNBLOCK_THREADS
116757       /*try:*/ {
116758
116759         /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":191
116760  *         if self._add_default_attributes:
116761  *             with nogil:
116762  *                 xmlschema.xmlSchemaValidateDoc(self._valid_ctxt, c_doc)             # <<<<<<<<<<<<<<
116763  * 
116764  *     cdef int connect(self, xmlparser.xmlParserCtxt* c_ctxt) except -1:
116765  */
116766         xmlSchemaValidateDoc(__pyx_v_self->_valid_ctxt, __pyx_v_c_doc);
116767       }
116768       /*finally:*/ {
116769         Py_BLOCK_THREADS
116770       }
116771     }
116772     goto __pyx_L3;
116773   }
116774   __pyx_L3:;
116775
116776   __Pyx_FinishRefcountContext();
116777 }
116778
116779 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":193
116780  *                 xmlschema.xmlSchemaValidateDoc(self._valid_ctxt, c_doc)
116781  * 
116782  *     cdef int connect(self, xmlparser.xmlParserCtxt* c_ctxt) except -1:             # <<<<<<<<<<<<<<
116783  *         if self._valid_ctxt is NULL:
116784  *             self._valid_ctxt = xmlschema.xmlSchemaNewValidCtxt(
116785  */
116786
116787 static  int __pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_connect(struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *__pyx_v_self, xmlParserCtxt *__pyx_v_c_ctxt) {
116788   int __pyx_r;
116789   int __pyx_t_1;
116790   PyObject *__pyx_t_2 = NULL;
116791   int __pyx_t_3;
116792   __Pyx_SetupRefcountContext("connect");
116793
116794   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":194
116795  * 
116796  *     cdef int connect(self, xmlparser.xmlParserCtxt* c_ctxt) except -1:
116797  *         if self._valid_ctxt is NULL:             # <<<<<<<<<<<<<<
116798  *             self._valid_ctxt = xmlschema.xmlSchemaNewValidCtxt(
116799  *                 self._schema._c_schema)
116800  */
116801   __pyx_t_1 = (__pyx_v_self->_valid_ctxt == NULL);
116802   if (__pyx_t_1) {
116803
116804     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":195
116805  *     cdef int connect(self, xmlparser.xmlParserCtxt* c_ctxt) except -1:
116806  *         if self._valid_ctxt is NULL:
116807  *             self._valid_ctxt = xmlschema.xmlSchemaNewValidCtxt(             # <<<<<<<<<<<<<<
116808  *                 self._schema._c_schema)
116809  *             if self._valid_ctxt is NULL:
116810  */
116811     __pyx_v_self->_valid_ctxt = xmlSchemaNewValidCtxt(__pyx_v_self->_schema->_c_schema);
116812
116813     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":197
116814  *             self._valid_ctxt = xmlschema.xmlSchemaNewValidCtxt(
116815  *                 self._schema._c_schema)
116816  *             if self._valid_ctxt is NULL:             # <<<<<<<<<<<<<<
116817  *                 return python.PyErr_NoMemory()
116818  *             if self._add_default_attributes:
116819  */
116820     __pyx_t_1 = (__pyx_v_self->_valid_ctxt == NULL);
116821     if (__pyx_t_1) {
116822
116823       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":198
116824  *                 self._schema._c_schema)
116825  *             if self._valid_ctxt is NULL:
116826  *                 return python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
116827  *             if self._add_default_attributes:
116828  *                 xmlschema.xmlSchemaSetValidOptions(
116829  */
116830       __pyx_t_2 = PyErr_NoMemory(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
116831       __Pyx_GOTREF(__pyx_t_2);
116832       __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
116833       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
116834       __pyx_r = __pyx_t_3;
116835       goto __pyx_L0;
116836       goto __pyx_L4;
116837     }
116838     __pyx_L4:;
116839
116840     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":199
116841  *             if self._valid_ctxt is NULL:
116842  *                 return python.PyErr_NoMemory()
116843  *             if self._add_default_attributes:             # <<<<<<<<<<<<<<
116844  *                 xmlschema.xmlSchemaSetValidOptions(
116845  *                     self._valid_ctxt,
116846  */
116847     __pyx_t_1 = __pyx_v_self->_add_default_attributes;
116848     if (__pyx_t_1) {
116849
116850       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":202
116851  *                 xmlschema.xmlSchemaSetValidOptions(
116852  *                     self._valid_ctxt,
116853  *                     xmlschema.XML_SCHEMA_VAL_VC_I_CREATE)             # <<<<<<<<<<<<<<
116854  *         self._sax_plug = xmlschema.xmlSchemaSAXPlug(
116855  *             self._valid_ctxt, &c_ctxt.sax, &c_ctxt.userData)
116856  */
116857       xmlSchemaSetValidOptions(__pyx_v_self->_valid_ctxt, XML_SCHEMA_VAL_VC_I_CREATE);
116858       goto __pyx_L5;
116859     }
116860     __pyx_L5:;
116861     goto __pyx_L3;
116862   }
116863   __pyx_L3:;
116864
116865   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":203
116866  *                     self._valid_ctxt,
116867  *                     xmlschema.XML_SCHEMA_VAL_VC_I_CREATE)
116868  *         self._sax_plug = xmlschema.xmlSchemaSAXPlug(             # <<<<<<<<<<<<<<
116869  *             self._valid_ctxt, &c_ctxt.sax, &c_ctxt.userData)
116870  * 
116871  */
116872   __pyx_v_self->_sax_plug = xmlSchemaSAXPlug(__pyx_v_self->_valid_ctxt, (&__pyx_v_c_ctxt->sax), (&__pyx_v_c_ctxt->userData));
116873
116874   __pyx_r = 0;
116875   goto __pyx_L0;
116876   __pyx_L1_error:;
116877   __Pyx_XDECREF(__pyx_t_2);
116878   __Pyx_AddTraceback("lxml.etree._ParserSchemaValidationContext.connect");
116879   __pyx_r = -1;
116880   __pyx_L0:;
116881   __Pyx_FinishRefcountContext();
116882   return __pyx_r;
116883 }
116884
116885 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":206
116886  *             self._valid_ctxt, &c_ctxt.sax, &c_ctxt.userData)
116887  * 
116888  *     cdef void disconnect(self):             # <<<<<<<<<<<<<<
116889  *         if self._sax_plug is not NULL:
116890  *             xmlschema.xmlSchemaSAXUnplug(self._sax_plug)
116891  */
116892
116893 static  void __pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_disconnect(struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *__pyx_v_self) {
116894   int __pyx_t_1;
116895   __Pyx_SetupRefcountContext("disconnect");
116896
116897   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":207
116898  * 
116899  *     cdef void disconnect(self):
116900  *         if self._sax_plug is not NULL:             # <<<<<<<<<<<<<<
116901  *             xmlschema.xmlSchemaSAXUnplug(self._sax_plug)
116902  *             self._sax_plug = NULL
116903  */
116904   __pyx_t_1 = (__pyx_v_self->_sax_plug != NULL);
116905   if (__pyx_t_1) {
116906
116907     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":208
116908  *     cdef void disconnect(self):
116909  *         if self._sax_plug is not NULL:
116910  *             xmlschema.xmlSchemaSAXUnplug(self._sax_plug)             # <<<<<<<<<<<<<<
116911  *             self._sax_plug = NULL
116912  * 
116913  */
116914     xmlSchemaSAXUnplug(__pyx_v_self->_sax_plug);
116915
116916     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":209
116917  *         if self._sax_plug is not NULL:
116918  *             xmlschema.xmlSchemaSAXUnplug(self._sax_plug)
116919  *             self._sax_plug = NULL             # <<<<<<<<<<<<<<
116920  * 
116921  *     cdef bint isvalid(self):
116922  */
116923     __pyx_v_self->_sax_plug = NULL;
116924     goto __pyx_L3;
116925   }
116926   __pyx_L3:;
116927
116928   __Pyx_FinishRefcountContext();
116929 }
116930
116931 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":211
116932  *             self._sax_plug = NULL
116933  * 
116934  *     cdef bint isvalid(self):             # <<<<<<<<<<<<<<
116935  *         if self._valid_ctxt is NULL:
116936  *             return 1 # valid
116937  */
116938
116939 static  int __pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_isvalid(struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *__pyx_v_self) {
116940   int __pyx_r;
116941   int __pyx_t_1;
116942   __Pyx_SetupRefcountContext("isvalid");
116943
116944   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":212
116945  * 
116946  *     cdef bint isvalid(self):
116947  *         if self._valid_ctxt is NULL:             # <<<<<<<<<<<<<<
116948  *             return 1 # valid
116949  *         return xmlschema.xmlSchemaIsValid(self._valid_ctxt)
116950  */
116951   __pyx_t_1 = (__pyx_v_self->_valid_ctxt == NULL);
116952   if (__pyx_t_1) {
116953
116954     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":213
116955  *     cdef bint isvalid(self):
116956  *         if self._valid_ctxt is NULL:
116957  *             return 1 # valid             # <<<<<<<<<<<<<<
116958  *         return xmlschema.xmlSchemaIsValid(self._valid_ctxt)
116959  * 
116960  */
116961     __pyx_r = 1;
116962     goto __pyx_L0;
116963     goto __pyx_L3;
116964   }
116965   __pyx_L3:;
116966
116967   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":214
116968  *         if self._valid_ctxt is NULL:
116969  *             return 1 # valid
116970  *         return xmlschema.xmlSchemaIsValid(self._valid_ctxt)             # <<<<<<<<<<<<<<
116971  * 
116972  * cdef extern from "etree_defs.h":
116973  */
116974   __pyx_r = xmlSchemaIsValid(__pyx_v_self->_valid_ctxt);
116975   goto __pyx_L0;
116976
116977   __pyx_r = 0;
116978   __pyx_L0:;
116979   __Pyx_FinishRefcountContext();
116980   return __pyx_r;
116981 }
116982
116983 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":73
116984  *     cdef schematron.xmlSchematron* _c_schema
116985  *     cdef xmlDoc* _c_schema_doc
116986  *     def __init__(self, etree=None, *, file=None):             # <<<<<<<<<<<<<<
116987  *         cdef _Document doc
116988  *         cdef _Element root_node
116989  */
116990
116991 static int __pyx_pf_4lxml_5etree_10Schematron___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
116992 static int __pyx_pf_4lxml_5etree_10Schematron___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
116993   PyObject *__pyx_v_etree = 0;
116994   PyObject *__pyx_v_file = 0;
116995   struct LxmlDocument *__pyx_v_doc;
116996   struct LxmlElement *__pyx_v_root_node;
116997   xmlSchematronParserCtxt *__pyx_v_parser_ctxt;
116998   PyObject *__pyx_v_filename;
116999   int __pyx_r;
117000   PyObject *__pyx_1 = 0;
117001   PyObject *__pyx_t_1 = NULL;
117002   PyObject *__pyx_t_2 = NULL;
117003   PyObject *__pyx_t_3 = NULL;
117004   int __pyx_t_4;
117005   xmlDoc *__pyx_t_5;
117006   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_etree,&__pyx_kp_file,0};
117007   __Pyx_SetupRefcountContext("__init__");
117008   if (unlikely(__pyx_kwds)) {
117009     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
117010     PyObject* values[2] = {0,0};
117011     values[0] = Py_None;
117012     values[1] = Py_None;
117013     switch (PyTuple_GET_SIZE(__pyx_args)) {
117014       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
117015       case  0: break;
117016       default: goto __pyx_L5_argtuple_error;
117017     }
117018     switch (PyTuple_GET_SIZE(__pyx_args)) {
117019       case  0:
117020       if (kw_args > 1) {
117021         PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_etree);
117022         if (unlikely(value)) { values[0] = value; kw_args--; }
117023       }
117024     }
117025     while (kw_args > 0) {
117026       PyObject* value;
117027       value = PyDict_GetItem(__pyx_kwds, __pyx_kp_file);
117028       if (value) { values[1] = value; if (!(--kw_args)) break; }
117029       break;
117030     }
117031     if (unlikely(kw_args > 0)) {
117032       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
117033     }
117034     __pyx_v_etree = values[0];
117035     __pyx_v_file = values[1];
117036   } else {
117037     __pyx_v_etree = Py_None;
117038     __pyx_v_file = Py_None;
117039     switch (PyTuple_GET_SIZE(__pyx_args)) {
117040       case  1: __pyx_v_etree = PyTuple_GET_ITEM(__pyx_args, 0);
117041       case  0: break;
117042       default: goto __pyx_L5_argtuple_error;
117043     }
117044   }
117045   goto __pyx_L4_argument_unpacking_done;
117046   __pyx_L5_argtuple_error:;
117047   __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[23]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
117048   __pyx_L3_error:;
117049   __Pyx_AddTraceback("lxml.etree.Schematron.__init__");
117050   return -1;
117051   __pyx_L4_argument_unpacking_done:;
117052   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
117053   __pyx_v_root_node = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
117054   __pyx_v_filename = Py_None; __Pyx_INCREF(Py_None);
117055
117056   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":79
117057  *         cdef char* c_href
117058  *         cdef schematron.xmlSchematronParserCtxt* parser_ctxt
117059  *         self._c_schema = NULL             # <<<<<<<<<<<<<<
117060  *         self._c_schema_doc = NULL
117061  *         _Validator.__init__(self)
117062  */
117063   ((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->_c_schema = NULL;
117064
117065   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":80
117066  *         cdef schematron.xmlSchematronParserCtxt* parser_ctxt
117067  *         self._c_schema = NULL
117068  *         self._c_schema_doc = NULL             # <<<<<<<<<<<<<<
117069  *         _Validator.__init__(self)
117070  *         if not config.ENABLE_SCHEMATRON:
117071  */
117072   ((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->_c_schema_doc = NULL;
117073
117074   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":81
117075  *         self._c_schema = NULL
117076  *         self._c_schema_doc = NULL
117077  *         _Validator.__init__(self)             # <<<<<<<<<<<<<<
117078  *         if not config.ENABLE_SCHEMATRON:
117079  *             raise SchematronError, \
117080  */
117081   __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__Validator)), __pyx_kp___init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117082   __Pyx_GOTREF(__pyx_t_1);
117083   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117084   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
117085   __Pyx_INCREF(__pyx_v_self);
117086   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
117087   __Pyx_GIVEREF(__pyx_v_self);
117088   __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117089   __Pyx_GOTREF(__pyx_t_3);
117090   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
117091   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
117092   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
117093
117094   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":82
117095  *         self._c_schema_doc = NULL
117096  *         _Validator.__init__(self)
117097  *         if not config.ENABLE_SCHEMATRON:             # <<<<<<<<<<<<<<
117098  *             raise SchematronError, \
117099  *                 u"lxml.etree was compiled without Schematron support."
117100  */
117101   __pyx_t_4 = (!ENABLE_SCHEMATRON);
117102   if (__pyx_t_4) {
117103
117104     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":83
117105  *         _Validator.__init__(self)
117106  *         if not config.ENABLE_SCHEMATRON:
117107  *             raise SchematronError, \             # <<<<<<<<<<<<<<
117108  *                 u"lxml.etree was compiled without Schematron support."
117109  *         if etree is not None:
117110  */
117111     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_SchematronError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117112     __Pyx_GOTREF(__pyx_1);
117113
117114     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":84
117115  *         if not config.ENABLE_SCHEMATRON:
117116  *             raise SchematronError, \
117117  *                 u"lxml.etree was compiled without Schematron support."             # <<<<<<<<<<<<<<
117118  *         if etree is not None:
117119  *             doc = _documentOrRaise(etree)
117120  */
117121     __Pyx_Raise(__pyx_1, ((PyObject *)__pyx_kp_670), 0);
117122     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
117123     {__pyx_filename = __pyx_f[23]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117124     goto __pyx_L6;
117125   }
117126   __pyx_L6:;
117127
117128   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":85
117129  *             raise SchematronError, \
117130  *                 u"lxml.etree was compiled without Schematron support."
117131  *         if etree is not None:             # <<<<<<<<<<<<<<
117132  *             doc = _documentOrRaise(etree)
117133  *             root_node = _rootNodeOrRaise(etree)
117134  */
117135   __pyx_t_4 = (__pyx_v_etree != Py_None);
117136   if (__pyx_t_4) {
117137
117138     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":86
117139  *                 u"lxml.etree was compiled without Schematron support."
117140  *         if etree is not None:
117141  *             doc = _documentOrRaise(etree)             # <<<<<<<<<<<<<<
117142  *             root_node = _rootNodeOrRaise(etree)
117143  *             self._c_schema_doc = _copyDocRoot(doc._c_doc, root_node._c_node)
117144  */
117145     __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117146     __Pyx_GOTREF(__pyx_t_3);
117147     __Pyx_DECREF(((PyObject *)__pyx_v_doc));
117148     __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_3);
117149     __pyx_t_3 = 0;
117150
117151     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":87
117152  *         if etree is not None:
117153  *             doc = _documentOrRaise(etree)
117154  *             root_node = _rootNodeOrRaise(etree)             # <<<<<<<<<<<<<<
117155  *             self._c_schema_doc = _copyDocRoot(doc._c_doc, root_node._c_node)
117156  *             self._error_log.connect()
117157  */
117158     __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117159     __Pyx_GOTREF(__pyx_t_3);
117160     __Pyx_DECREF(((PyObject *)__pyx_v_root_node));
117161     __pyx_v_root_node = ((struct LxmlElement *)__pyx_t_3);
117162     __pyx_t_3 = 0;
117163
117164     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":88
117165  *             doc = _documentOrRaise(etree)
117166  *             root_node = _rootNodeOrRaise(etree)
117167  *             self._c_schema_doc = _copyDocRoot(doc._c_doc, root_node._c_node)             # <<<<<<<<<<<<<<
117168  *             self._error_log.connect()
117169  *             parser_ctxt = schematron.xmlSchematronNewDocParserCtxt(
117170  */
117171     __pyx_t_5 = __pyx_f_4lxml_5etree__copyDocRoot(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117172     ((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->_c_schema_doc = __pyx_t_5;
117173
117174     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":89
117175  *             root_node = _rootNodeOrRaise(etree)
117176  *             self._c_schema_doc = _copyDocRoot(doc._c_doc, root_node._c_node)
117177  *             self._error_log.connect()             # <<<<<<<<<<<<<<
117178  *             parser_ctxt = schematron.xmlSchematronNewDocParserCtxt(
117179  *                 self._c_schema_doc)
117180  */
117181     ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->__pyx_base._error_log);
117182
117183     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":91
117184  *             self._error_log.connect()
117185  *             parser_ctxt = schematron.xmlSchematronNewDocParserCtxt(
117186  *                 self._c_schema_doc)             # <<<<<<<<<<<<<<
117187  *         elif file is not None:
117188  *             filename = _getFilenameForFile(file)
117189  */
117190     __pyx_v_parser_ctxt = xmlSchematronNewDocParserCtxt(((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->_c_schema_doc);
117191     goto __pyx_L7;
117192   }
117193
117194   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":92
117195  *             parser_ctxt = schematron.xmlSchematronNewDocParserCtxt(
117196  *                 self._c_schema_doc)
117197  *         elif file is not None:             # <<<<<<<<<<<<<<
117198  *             filename = _getFilenameForFile(file)
117199  *             if filename is None:
117200  */
117201   __pyx_t_4 = (__pyx_v_file != Py_None);
117202   if (__pyx_t_4) {
117203
117204     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":93
117205  *                 self._c_schema_doc)
117206  *         elif file is not None:
117207  *             filename = _getFilenameForFile(file)             # <<<<<<<<<<<<<<
117208  *             if filename is None:
117209  *                 # XXX assume a string object
117210  */
117211     __pyx_t_3 = __pyx_f_4lxml_5etree__getFilenameForFile(__pyx_v_file); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117212     __Pyx_GOTREF(__pyx_t_3);
117213     __Pyx_DECREF(__pyx_v_filename);
117214     __pyx_v_filename = __pyx_t_3;
117215     __pyx_t_3 = 0;
117216
117217     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":94
117218  *         elif file is not None:
117219  *             filename = _getFilenameForFile(file)
117220  *             if filename is None:             # <<<<<<<<<<<<<<
117221  *                 # XXX assume a string object
117222  *                 filename = file
117223  */
117224     __pyx_t_4 = (__pyx_v_filename == Py_None);
117225     if (__pyx_t_4) {
117226
117227       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":96
117228  *             if filename is None:
117229  *                 # XXX assume a string object
117230  *                 filename = file             # <<<<<<<<<<<<<<
117231  *             filename = _encodeFilename(filename)
117232  *             self._error_log.connect()
117233  */
117234       __Pyx_INCREF(__pyx_v_file);
117235       __Pyx_DECREF(__pyx_v_filename);
117236       __pyx_v_filename = __pyx_v_file;
117237       goto __pyx_L8;
117238     }
117239     __pyx_L8:;
117240
117241     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":97
117242  *                 # XXX assume a string object
117243  *                 filename = file
117244  *             filename = _encodeFilename(filename)             # <<<<<<<<<<<<<<
117245  *             self._error_log.connect()
117246  *             parser_ctxt = schematron.xmlSchematronNewParserCtxt(_cstr(filename))
117247  */
117248     __pyx_t_3 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_filename); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117249     __Pyx_GOTREF(__pyx_t_3);
117250     __Pyx_DECREF(__pyx_v_filename);
117251     __pyx_v_filename = __pyx_t_3;
117252     __pyx_t_3 = 0;
117253
117254     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":98
117255  *                 filename = file
117256  *             filename = _encodeFilename(filename)
117257  *             self._error_log.connect()             # <<<<<<<<<<<<<<
117258  *             parser_ctxt = schematron.xmlSchematronNewParserCtxt(_cstr(filename))
117259  *         else:
117260  */
117261     ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->__pyx_base._error_log);
117262
117263     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":99
117264  *             filename = _encodeFilename(filename)
117265  *             self._error_log.connect()
117266  *             parser_ctxt = schematron.xmlSchematronNewParserCtxt(_cstr(filename))             # <<<<<<<<<<<<<<
117267  *         else:
117268  *             raise SchematronParseError, u"No tree or file given"
117269  */
117270     __pyx_v_parser_ctxt = xmlSchematronNewParserCtxt(PyString_AS_STRING(__pyx_v_filename));
117271     goto __pyx_L7;
117272   }
117273   /*else*/ {
117274
117275     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":101
117276  *             parser_ctxt = schematron.xmlSchematronNewParserCtxt(_cstr(filename))
117277  *         else:
117278  *             raise SchematronParseError, u"No tree or file given"             # <<<<<<<<<<<<<<
117279  * 
117280  *         if parser_ctxt is NULL:
117281  */
117282     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_220); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117283     __Pyx_GOTREF(__pyx_1);
117284     __Pyx_Raise(__pyx_1, ((PyObject *)__pyx_kp_671), 0);
117285     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
117286     {__pyx_filename = __pyx_f[23]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117287   }
117288   __pyx_L7:;
117289
117290   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":103
117291  *             raise SchematronParseError, u"No tree or file given"
117292  * 
117293  *         if parser_ctxt is NULL:             # <<<<<<<<<<<<<<
117294  *             self._error_log.disconnect()
117295  *             if self._c_schema_doc is not NULL:
117296  */
117297   __pyx_t_4 = (__pyx_v_parser_ctxt == NULL);
117298   if (__pyx_t_4) {
117299
117300     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":104
117301  * 
117302  *         if parser_ctxt is NULL:
117303  *             self._error_log.disconnect()             # <<<<<<<<<<<<<<
117304  *             if self._c_schema_doc is not NULL:
117305  *                 tree.xmlFreeDoc(self._c_schema_doc)
117306  */
117307     ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->__pyx_base._error_log);
117308
117309     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":105
117310  *         if parser_ctxt is NULL:
117311  *             self._error_log.disconnect()
117312  *             if self._c_schema_doc is not NULL:             # <<<<<<<<<<<<<<
117313  *                 tree.xmlFreeDoc(self._c_schema_doc)
117314  *                 self._c_schema_doc = NULL
117315  */
117316     __pyx_t_4 = (((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->_c_schema_doc != NULL);
117317     if (__pyx_t_4) {
117318
117319       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":106
117320  *             self._error_log.disconnect()
117321  *             if self._c_schema_doc is not NULL:
117322  *                 tree.xmlFreeDoc(self._c_schema_doc)             # <<<<<<<<<<<<<<
117323  *                 self._c_schema_doc = NULL
117324  *             python.PyErr_NoMemory()
117325  */
117326       xmlFreeDoc(((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->_c_schema_doc);
117327
117328       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":107
117329  *             if self._c_schema_doc is not NULL:
117330  *                 tree.xmlFreeDoc(self._c_schema_doc)
117331  *                 self._c_schema_doc = NULL             # <<<<<<<<<<<<<<
117332  *             python.PyErr_NoMemory()
117333  *             return
117334  */
117335       ((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->_c_schema_doc = NULL;
117336       goto __pyx_L10;
117337     }
117338     __pyx_L10:;
117339
117340     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":108
117341  *                 tree.xmlFreeDoc(self._c_schema_doc)
117342  *                 self._c_schema_doc = NULL
117343  *             python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
117344  *             return
117345  * 
117346  */
117347     __pyx_t_3 = PyErr_NoMemory(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117348     __Pyx_GOTREF(__pyx_t_3);
117349     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
117350
117351     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":109
117352  *                 self._c_schema_doc = NULL
117353  *             python.PyErr_NoMemory()
117354  *             return             # <<<<<<<<<<<<<<
117355  * 
117356  *         self._c_schema = schematron.xmlSchematronParse(parser_ctxt)
117357  */
117358     __pyx_r = 0;
117359     goto __pyx_L0;
117360     goto __pyx_L9;
117361   }
117362   __pyx_L9:;
117363
117364   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":111
117365  *             return
117366  * 
117367  *         self._c_schema = schematron.xmlSchematronParse(parser_ctxt)             # <<<<<<<<<<<<<<
117368  *         self._error_log.disconnect()
117369  * 
117370  */
117371   ((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->_c_schema = xmlSchematronParse(__pyx_v_parser_ctxt);
117372
117373   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":112
117374  * 
117375  *         self._c_schema = schematron.xmlSchematronParse(parser_ctxt)
117376  *         self._error_log.disconnect()             # <<<<<<<<<<<<<<
117377  * 
117378  *         schematron.xmlSchematronFreeParserCtxt(parser_ctxt)
117379  */
117380   ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->__pyx_base._error_log);
117381
117382   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":114
117383  *         self._error_log.disconnect()
117384  * 
117385  *         schematron.xmlSchematronFreeParserCtxt(parser_ctxt)             # <<<<<<<<<<<<<<
117386  *         if self._c_schema is NULL:
117387  *             raise SchematronParseError(
117388  */
117389   xmlSchematronFreeParserCtxt(__pyx_v_parser_ctxt);
117390
117391   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":115
117392  * 
117393  *         schematron.xmlSchematronFreeParserCtxt(parser_ctxt)
117394  *         if self._c_schema is NULL:             # <<<<<<<<<<<<<<
117395  *             raise SchematronParseError(
117396  *                 u"Document is not a valid Schematron schema",
117397  */
117398   __pyx_t_4 = (((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->_c_schema == NULL);
117399   if (__pyx_t_4) {
117400
117401     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":116
117402  *         schematron.xmlSchematronFreeParserCtxt(parser_ctxt)
117403  *         if self._c_schema is NULL:
117404  *             raise SchematronParseError(             # <<<<<<<<<<<<<<
117405  *                 u"Document is not a valid Schematron schema",
117406  *                 self._error_log)
117407  */
117408     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_220); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117409     __Pyx_GOTREF(__pyx_1);
117410
117411     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":118
117412  *             raise SchematronParseError(
117413  *                 u"Document is not a valid Schematron schema",
117414  *                 self._error_log)             # <<<<<<<<<<<<<<
117415  * 
117416  *     def __dealloc__(self):
117417  */
117418     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117419     __Pyx_GOTREF(((PyObject *)__pyx_t_3));
117420     __Pyx_INCREF(((PyObject *)__pyx_kp_672));
117421     PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_672));
117422     __Pyx_GIVEREF(((PyObject *)__pyx_kp_672));
117423     __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->__pyx_base._error_log));
117424     PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->__pyx_base._error_log));
117425     __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->__pyx_base._error_log));
117426     __pyx_t_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117427     __Pyx_GOTREF(__pyx_t_2);
117428     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
117429     __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
117430     __Pyx_Raise(__pyx_t_2, 0, 0);
117431     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
117432     {__pyx_filename = __pyx_f[23]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117433     goto __pyx_L11;
117434   }
117435   __pyx_L11:;
117436
117437   __pyx_r = 0;
117438   goto __pyx_L0;
117439   __pyx_L1_error:;
117440   __Pyx_XDECREF(__pyx_1);
117441   __Pyx_XDECREF(__pyx_t_1);
117442   __Pyx_XDECREF(__pyx_t_2);
117443   __Pyx_XDECREF(__pyx_t_3);
117444   __Pyx_AddTraceback("lxml.etree.Schematron.__init__");
117445   __pyx_r = -1;
117446   __pyx_L0:;
117447   __Pyx_DECREF((PyObject *)__pyx_v_doc);
117448   __Pyx_DECREF((PyObject *)__pyx_v_root_node);
117449   __Pyx_DECREF(__pyx_v_filename);
117450   __Pyx_FinishRefcountContext();
117451   return __pyx_r;
117452 }
117453
117454 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":120
117455  *                 self._error_log)
117456  * 
117457  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
117458  *         schematron.xmlSchematronFree(self._c_schema)
117459  *         if _LIBXML_VERSION_INT >= 20631:
117460  */
117461
117462 static void __pyx_pf_4lxml_5etree_10Schematron___dealloc__(PyObject *__pyx_v_self); /*proto*/
117463 static void __pyx_pf_4lxml_5etree_10Schematron___dealloc__(PyObject *__pyx_v_self) {
117464   int __pyx_t_1;
117465   __Pyx_SetupRefcountContext("__dealloc__");
117466
117467   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":121
117468  * 
117469  *     def __dealloc__(self):
117470  *         schematron.xmlSchematronFree(self._c_schema)             # <<<<<<<<<<<<<<
117471  *         if _LIBXML_VERSION_INT >= 20631:
117472  *             # earlier libxml2 versions may have freed the document in
117473  */
117474   xmlSchematronFree(((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->_c_schema);
117475
117476   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":122
117477  *     def __dealloc__(self):
117478  *         schematron.xmlSchematronFree(self._c_schema)
117479  *         if _LIBXML_VERSION_INT >= 20631:             # <<<<<<<<<<<<<<
117480  *             # earlier libxml2 versions may have freed the document in
117481  *             # xmlSchematronFree() already, we don't know ...
117482  */
117483   __pyx_t_1 = (__pyx_v_4lxml_5etree__LIBXML_VERSION_INT >= 20631);
117484   if (__pyx_t_1) {
117485
117486     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":125
117487  *             # earlier libxml2 versions may have freed the document in
117488  *             # xmlSchematronFree() already, we don't know ...
117489  *             if self._c_schema_doc is not NULL:             # <<<<<<<<<<<<<<
117490  *                 tree.xmlFreeDoc(self._c_schema_doc)
117491  * 
117492  */
117493     __pyx_t_1 = (((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->_c_schema_doc != NULL);
117494     if (__pyx_t_1) {
117495
117496       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":126
117497  *             # xmlSchematronFree() already, we don't know ...
117498  *             if self._c_schema_doc is not NULL:
117499  *                 tree.xmlFreeDoc(self._c_schema_doc)             # <<<<<<<<<<<<<<
117500  * 
117501  *     def __call__(self, etree):
117502  */
117503       xmlFreeDoc(((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->_c_schema_doc);
117504       goto __pyx_L6;
117505     }
117506     __pyx_L6:;
117507     goto __pyx_L5;
117508   }
117509   __pyx_L5:;
117510
117511   __Pyx_FinishRefcountContext();
117512 }
117513
117514 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":128
117515  *                 tree.xmlFreeDoc(self._c_schema_doc)
117516  * 
117517  *     def __call__(self, etree):             # <<<<<<<<<<<<<<
117518  *         u"""__call__(self, etree)
117519  * 
117520  */
117521
117522 static PyObject *__pyx_pf_4lxml_5etree_10Schematron___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
117523 static char __pyx_doc_4lxml_5etree_10Schematron___call__[] = "__call__(self, etree)\n\n        Validate doc using Schematron.\n\n        Returns true if document is valid, false if not.";
117524 static PyObject *__pyx_pf_4lxml_5etree_10Schematron___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
117525   PyObject *__pyx_v_etree = 0;
117526   struct LxmlDocument *__pyx_v_doc;
117527   struct LxmlElement *__pyx_v_root_node;
117528   xmlDoc *__pyx_v_c_doc;
117529   xmlSchematronValidCtxt *__pyx_v_valid_ctxt;
117530   int __pyx_v_ret;
117531   int __pyx_v_options;
117532   PyObject *__pyx_r = NULL;
117533   PyObject *__pyx_1 = 0;
117534   PyObject *__pyx_t_1 = NULL;
117535   int __pyx_t_2;
117536   xmlDoc *__pyx_t_3;
117537   PyObject *__pyx_t_4 = NULL;
117538   static PyObject **__pyx_pyargnames[] = {&__pyx_kp_etree,0};
117539   __Pyx_SetupRefcountContext("__call__");
117540   if (unlikely(__pyx_kwds)) {
117541     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
117542     PyObject* values[1] = {0};
117543     switch (PyTuple_GET_SIZE(__pyx_args)) {
117544       case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
117545       case  0: break;
117546       default: goto __pyx_L5_argtuple_error;
117547     }
117548     switch (PyTuple_GET_SIZE(__pyx_args)) {
117549       case  0:
117550       values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_etree);
117551       if (likely(values[0])) kw_args--;
117552       else goto __pyx_L5_argtuple_error;
117553     }
117554     if (unlikely(kw_args > 0)) {
117555       if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__call__") < 0)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
117556     }
117557     __pyx_v_etree = values[0];
117558   } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
117559     goto __pyx_L5_argtuple_error;
117560   } else {
117561     __pyx_v_etree = PyTuple_GET_ITEM(__pyx_args, 0);
117562   }
117563   goto __pyx_L4_argument_unpacking_done;
117564   __pyx_L5_argtuple_error:;
117565   __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[23]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
117566   __pyx_L3_error:;
117567   __Pyx_AddTraceback("lxml.etree.Schematron.__call__");
117568   return NULL;
117569   __pyx_L4_argument_unpacking_done:;
117570   __pyx_v_doc = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
117571   __pyx_v_root_node = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
117572
117573   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":141
117574  *         cdef int options
117575  * 
117576  *         doc = _documentOrRaise(etree)             # <<<<<<<<<<<<<<
117577  *         root_node = _rootNodeOrRaise(etree)
117578  * 
117579  */
117580   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117581   __Pyx_GOTREF(__pyx_t_1);
117582   __Pyx_DECREF(((PyObject *)__pyx_v_doc));
117583   __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_1);
117584   __pyx_t_1 = 0;
117585
117586   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":142
117587  * 
117588  *         doc = _documentOrRaise(etree)
117589  *         root_node = _rootNodeOrRaise(etree)             # <<<<<<<<<<<<<<
117590  * 
117591  *         if _LIBXML_VERSION_INT >= 20632 and \
117592  */
117593   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117594   __Pyx_GOTREF(__pyx_t_1);
117595   __Pyx_DECREF(((PyObject *)__pyx_v_root_node));
117596   __pyx_v_root_node = ((struct LxmlElement *)__pyx_t_1);
117597   __pyx_t_1 = 0;
117598
117599   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":144
117600  *         root_node = _rootNodeOrRaise(etree)
117601  * 
117602  *         if _LIBXML_VERSION_INT >= 20632 and \             # <<<<<<<<<<<<<<
117603  *                 schematron.XML_SCHEMATRON_OUT_ERROR != 0:
117604  *             options = schematron.XML_SCHEMATRON_OUT_ERROR
117605  */
117606   if ((__pyx_v_4lxml_5etree__LIBXML_VERSION_INT >= 20632)) {
117607
117608     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":145
117609  * 
117610  *         if _LIBXML_VERSION_INT >= 20632 and \
117611  *                 schematron.XML_SCHEMATRON_OUT_ERROR != 0:             # <<<<<<<<<<<<<<
117612  *             options = schematron.XML_SCHEMATRON_OUT_ERROR
117613  *         else:
117614  */
117615     __pyx_t_2 = (XML_SCHEMATRON_OUT_ERROR != 0);
117616   } else {
117617     __pyx_t_2 = (__pyx_v_4lxml_5etree__LIBXML_VERSION_INT >= 20632);
117618   }
117619   if (__pyx_t_2) {
117620
117621     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":146
117622  *         if _LIBXML_VERSION_INT >= 20632 and \
117623  *                 schematron.XML_SCHEMATRON_OUT_ERROR != 0:
117624  *             options = schematron.XML_SCHEMATRON_OUT_ERROR             # <<<<<<<<<<<<<<
117625  *         else:
117626  *             options = schematron.XML_SCHEMATRON_OUT_QUIET
117627  */
117628     __pyx_v_options = XML_SCHEMATRON_OUT_ERROR;
117629     goto __pyx_L6;
117630   }
117631   /*else*/ {
117632
117633     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":148
117634  *             options = schematron.XML_SCHEMATRON_OUT_ERROR
117635  *         else:
117636  *             options = schematron.XML_SCHEMATRON_OUT_QUIET             # <<<<<<<<<<<<<<
117637  *             # hack to switch off stderr output
117638  *             options = options | schematron.XML_SCHEMATRON_OUT_XML
117639  */
117640     __pyx_v_options = XML_SCHEMATRON_OUT_QUIET;
117641
117642     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":150
117643  *             options = schematron.XML_SCHEMATRON_OUT_QUIET
117644  *             # hack to switch off stderr output
117645  *             options = options | schematron.XML_SCHEMATRON_OUT_XML             # <<<<<<<<<<<<<<
117646  * 
117647  *         valid_ctxt = schematron.xmlSchematronNewValidCtxt(
117648  */
117649     __pyx_v_options = (__pyx_v_options | XML_SCHEMATRON_OUT_XML);
117650   }
117651   __pyx_L6:;
117652
117653   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":153
117654  * 
117655  *         valid_ctxt = schematron.xmlSchematronNewValidCtxt(
117656  *             self._c_schema, options)             # <<<<<<<<<<<<<<
117657  *         if valid_ctxt is NULL:
117658  *             return python.PyErr_NoMemory()
117659  */
117660   __pyx_v_valid_ctxt = xmlSchematronNewValidCtxt(((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->_c_schema, __pyx_v_options);
117661
117662   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":154
117663  *         valid_ctxt = schematron.xmlSchematronNewValidCtxt(
117664  *             self._c_schema, options)
117665  *         if valid_ctxt is NULL:             # <<<<<<<<<<<<<<
117666  *             return python.PyErr_NoMemory()
117667  * 
117668  */
117669   __pyx_t_2 = (__pyx_v_valid_ctxt == NULL);
117670   if (__pyx_t_2) {
117671
117672     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":155
117673  *             self._c_schema, options)
117674  *         if valid_ctxt is NULL:
117675  *             return python.PyErr_NoMemory()             # <<<<<<<<<<<<<<
117676  * 
117677  *         self._error_log.connect()
117678  */
117679     __Pyx_XDECREF(__pyx_r);
117680     __pyx_t_1 = PyErr_NoMemory(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117681     __Pyx_GOTREF(__pyx_t_1);
117682     __pyx_r = __pyx_t_1;
117683     __pyx_t_1 = 0;
117684     goto __pyx_L0;
117685     goto __pyx_L7;
117686   }
117687   __pyx_L7:;
117688
117689   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":157
117690  *             return python.PyErr_NoMemory()
117691  * 
117692  *         self._error_log.connect()             # <<<<<<<<<<<<<<
117693  *         if _LIBXML_VERSION_INT >= 20632:
117694  *             schematron.xmlSchematronSetValidStructuredErrors(
117695  */
117696   ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->__pyx_base._error_log);
117697
117698   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":158
117699  * 
117700  *         self._error_log.connect()
117701  *         if _LIBXML_VERSION_INT >= 20632:             # <<<<<<<<<<<<<<
117702  *             schematron.xmlSchematronSetValidStructuredErrors(
117703  *                 valid_ctxt, _receiveError, <void*>self._error_log)
117704  */
117705   __pyx_t_2 = (__pyx_v_4lxml_5etree__LIBXML_VERSION_INT >= 20632);
117706   if (__pyx_t_2) {
117707
117708     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":160
117709  *         if _LIBXML_VERSION_INT >= 20632:
117710  *             schematron.xmlSchematronSetValidStructuredErrors(
117711  *                 valid_ctxt, _receiveError, <void*>self._error_log)             # <<<<<<<<<<<<<<
117712  *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
117713  *         with nogil:
117714  */
117715     xmlSchematronSetValidStructuredErrors(__pyx_v_valid_ctxt, __pyx_f_4lxml_5etree__receiveError, ((void *)((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->__pyx_base._error_log));
117716     goto __pyx_L8;
117717   }
117718   __pyx_L8:;
117719
117720   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":161
117721  *             schematron.xmlSchematronSetValidStructuredErrors(
117722  *                 valid_ctxt, _receiveError, <void*>self._error_log)
117723  *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)             # <<<<<<<<<<<<<<
117724  *         with nogil:
117725  *             ret = schematron.xmlSchematronValidateDoc(valid_ctxt, c_doc)
117726  */
117727   __pyx_t_3 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117728   __pyx_v_c_doc = __pyx_t_3;
117729
117730   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":162
117731  *                 valid_ctxt, _receiveError, <void*>self._error_log)
117732  *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
117733  *         with nogil:             # <<<<<<<<<<<<<<
117734  *             ret = schematron.xmlSchematronValidateDoc(valid_ctxt, c_doc)
117735  *         _destroyFakeDoc(doc._c_doc, c_doc)
117736  */
117737   { PyThreadState *_save;
117738     Py_UNBLOCK_THREADS
117739     /*try:*/ {
117740
117741       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":163
117742  *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
117743  *         with nogil:
117744  *             ret = schematron.xmlSchematronValidateDoc(valid_ctxt, c_doc)             # <<<<<<<<<<<<<<
117745  *         _destroyFakeDoc(doc._c_doc, c_doc)
117746  *         self._error_log.disconnect()
117747  */
117748       __pyx_v_ret = xmlSchematronValidateDoc(__pyx_v_valid_ctxt, __pyx_v_c_doc);
117749     }
117750     /*finally:*/ {
117751       Py_BLOCK_THREADS
117752     }
117753   }
117754
117755   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":164
117756  *         with nogil:
117757  *             ret = schematron.xmlSchematronValidateDoc(valid_ctxt, c_doc)
117758  *         _destroyFakeDoc(doc._c_doc, c_doc)             # <<<<<<<<<<<<<<
117759  *         self._error_log.disconnect()
117760  * 
117761  */
117762   __pyx_f_4lxml_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc, __pyx_v_c_doc);
117763
117764   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":165
117765  *             ret = schematron.xmlSchematronValidateDoc(valid_ctxt, c_doc)
117766  *         _destroyFakeDoc(doc._c_doc, c_doc)
117767  *         self._error_log.disconnect()             # <<<<<<<<<<<<<<
117768  * 
117769  *         schematron.xmlSchematronFreeValidCtxt(valid_ctxt)
117770  */
117771   ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->__pyx_base._error_log);
117772
117773   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":167
117774  *         self._error_log.disconnect()
117775  * 
117776  *         schematron.xmlSchematronFreeValidCtxt(valid_ctxt)             # <<<<<<<<<<<<<<
117777  * 
117778  *         if ret == -1:
117779  */
117780   xmlSchematronFreeValidCtxt(__pyx_v_valid_ctxt);
117781
117782   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":169
117783  *         schematron.xmlSchematronFreeValidCtxt(valid_ctxt)
117784  * 
117785  *         if ret == -1:             # <<<<<<<<<<<<<<
117786  *             raise SchematronValidateError(
117787  *                 u"Internal error in Schematron validation",
117788  */
117789   __pyx_t_2 = (__pyx_v_ret == -1);
117790   if (__pyx_t_2) {
117791
117792     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":170
117793  * 
117794  *         if ret == -1:
117795  *             raise SchematronValidateError(             # <<<<<<<<<<<<<<
117796  *                 u"Internal error in Schematron validation",
117797  *                 self._error_log)
117798  */
117799     __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_222); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117800     __Pyx_GOTREF(__pyx_1);
117801
117802     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":172
117803  *             raise SchematronValidateError(
117804  *                 u"Internal error in Schematron validation",
117805  *                 self._error_log)             # <<<<<<<<<<<<<<
117806  *         if ret == 0:
117807  *             return True
117808  */
117809     __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117810     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
117811     __Pyx_INCREF(((PyObject *)__pyx_kp_673));
117812     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_673));
117813     __Pyx_GIVEREF(((PyObject *)__pyx_kp_673));
117814     __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->__pyx_base._error_log));
117815     PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->__pyx_base._error_log));
117816     __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->__pyx_base._error_log));
117817     __pyx_t_4 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117818     __Pyx_GOTREF(__pyx_t_4);
117819     __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
117820     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
117821     __Pyx_Raise(__pyx_t_4, 0, 0);
117822     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
117823     {__pyx_filename = __pyx_f[23]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117824     goto __pyx_L12;
117825   }
117826   __pyx_L12:;
117827
117828   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":173
117829  *                 u"Internal error in Schematron validation",
117830  *                 self._error_log)
117831  *         if ret == 0:             # <<<<<<<<<<<<<<
117832  *             return True
117833  *         else:
117834  */
117835   __pyx_t_2 = (__pyx_v_ret == 0);
117836   if (__pyx_t_2) {
117837
117838     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":174
117839  *                 self._error_log)
117840  *         if ret == 0:
117841  *             return True             # <<<<<<<<<<<<<<
117842  *         else:
117843  *             return False
117844  */
117845     __Pyx_XDECREF(__pyx_r);
117846     __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117847     __Pyx_GOTREF(__pyx_t_4);
117848     __pyx_r = __pyx_t_4;
117849     __pyx_t_4 = 0;
117850     goto __pyx_L0;
117851     goto __pyx_L13;
117852   }
117853   /*else*/ {
117854
117855     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":176
117856  *             return True
117857  *         else:
117858  *             return False             # <<<<<<<<<<<<<<
117859  */
117860     __Pyx_XDECREF(__pyx_r);
117861     __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117862     __Pyx_GOTREF(__pyx_t_4);
117863     __pyx_r = __pyx_t_4;
117864     __pyx_t_4 = 0;
117865     goto __pyx_L0;
117866   }
117867   __pyx_L13:;
117868
117869   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
117870   goto __pyx_L0;
117871   __pyx_L1_error:;
117872   __Pyx_XDECREF(__pyx_1);
117873   __Pyx_XDECREF(__pyx_t_1);
117874   __Pyx_XDECREF(__pyx_t_4);
117875   __Pyx_AddTraceback("lxml.etree.Schematron.__call__");
117876   __pyx_r = NULL;
117877   __pyx_L0:;
117878   __Pyx_DECREF((PyObject *)__pyx_v_doc);
117879   __Pyx_DECREF((PyObject *)__pyx_v_root_node);
117880   __Pyx_XGIVEREF(__pyx_r);
117881   __Pyx_FinishRefcountContext();
117882   return __pyx_r;
117883 }
117884
117885 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":3
117886  * # Public C API for lxml.etree
117887  * 
117888  * cdef public api _Element deepcopyNodeToDocument(_Document doc, xmlNode* c_root):             # <<<<<<<<<<<<<<
117889  *     u"Recursively copy the element into the document. doc is not modified."
117890  *     cdef xmlNode* c_node
117891  */
117892
117893  DL_EXPORT(struct LxmlElement) *deepcopyNodeToDocument(struct LxmlDocument *__pyx_v_doc, xmlNode *__pyx_v_c_root) {
117894   xmlNode *__pyx_v_c_node;
117895   struct LxmlElement *__pyx_r = NULL;
117896   xmlNode *__pyx_t_1;
117897   PyObject *__pyx_t_2 = NULL;
117898   __Pyx_SetupRefcountContext("deepcopyNodeToDocument");
117899
117900   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":6
117901  *     u"Recursively copy the element into the document. doc is not modified."
117902  *     cdef xmlNode* c_node
117903  *     c_node = _copyNodeToDoc(c_root, doc._c_doc)             # <<<<<<<<<<<<<<
117904  *     return _elementFactory(doc, c_node)
117905  * 
117906  */
117907   __pyx_t_1 = __pyx_f_4lxml_5etree__copyNodeToDoc(__pyx_v_c_root, __pyx_v_doc->_c_doc); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117908   __pyx_v_c_node = __pyx_t_1;
117909
117910   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":7
117911  *     cdef xmlNode* c_node
117912  *     c_node = _copyNodeToDoc(c_root, doc._c_doc)
117913  *     return _elementFactory(doc, c_node)             # <<<<<<<<<<<<<<
117914  * 
117915  * cdef public api _ElementTree elementTreeFactory(_Element context_node):
117916  */
117917   __Pyx_XDECREF(((PyObject *)__pyx_r));
117918   __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117919   __Pyx_GOTREF(__pyx_t_2);
117920   __pyx_r = ((struct LxmlElement *)__pyx_t_2);
117921   __pyx_t_2 = 0;
117922   goto __pyx_L0;
117923
117924   __pyx_r = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
117925   goto __pyx_L0;
117926   __pyx_L1_error:;
117927   __Pyx_XDECREF(__pyx_t_2);
117928   __Pyx_AddTraceback("lxml.etree.deepcopyNodeToDocument");
117929   __pyx_r = 0;
117930   __pyx_L0:;
117931   __Pyx_XGIVEREF((PyObject *)__pyx_r);
117932   __Pyx_FinishRefcountContext();
117933   return __pyx_r;
117934 }
117935
117936 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":9
117937  *     return _elementFactory(doc, c_node)
117938  * 
117939  * cdef public api _ElementTree elementTreeFactory(_Element context_node):             # <<<<<<<<<<<<<<
117940  *     return newElementTree(context_node, _ElementTree)
117941  * 
117942  */
117943
117944  DL_EXPORT(struct LxmlElementTree) *elementTreeFactory(struct LxmlElement *__pyx_v_context_node) {
117945   struct LxmlElementTree *__pyx_r = NULL;
117946   PyObject *__pyx_t_1 = NULL;
117947   __Pyx_SetupRefcountContext("elementTreeFactory");
117948
117949   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":10
117950  * 
117951  * cdef public api _ElementTree elementTreeFactory(_Element context_node):
117952  *     return newElementTree(context_node, _ElementTree)             # <<<<<<<<<<<<<<
117953  * 
117954  * cdef public api _ElementTree newElementTree(_Element context_node,
117955  */
117956   __Pyx_XDECREF(((PyObject *)__pyx_r));
117957   __pyx_t_1 = ((PyObject *)newElementTree(__pyx_v_context_node, ((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ElementTree)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
117958   __Pyx_GOTREF(__pyx_t_1);
117959   __pyx_r = ((struct LxmlElementTree *)__pyx_t_1);
117960   __pyx_t_1 = 0;
117961   goto __pyx_L0;
117962
117963   __pyx_r = ((struct LxmlElementTree *)Py_None); __Pyx_INCREF(Py_None);
117964   goto __pyx_L0;
117965   __pyx_L1_error:;
117966   __Pyx_XDECREF(__pyx_t_1);
117967   __Pyx_AddTraceback("lxml.etree.elementTreeFactory");
117968   __pyx_r = 0;
117969   __pyx_L0:;
117970   __Pyx_XGIVEREF((PyObject *)__pyx_r);
117971   __Pyx_FinishRefcountContext();
117972   return __pyx_r;
117973 }
117974
117975 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":12
117976  *     return newElementTree(context_node, _ElementTree)
117977  * 
117978  * cdef public api _ElementTree newElementTree(_Element context_node,             # <<<<<<<<<<<<<<
117979  *                                         object subclass):
117980  *     if <void*>context_node is NULL or context_node is None:
117981  */
117982
117983  DL_EXPORT(struct LxmlElementTree) *newElementTree(struct LxmlElement *__pyx_v_context_node, PyObject *__pyx_v_subclass) {
117984   struct LxmlElementTree *__pyx_r = NULL;
117985   int __pyx_t_1;
117986   int __pyx_t_2;
117987   PyObject *__pyx_t_3 = NULL;
117988   __Pyx_SetupRefcountContext("newElementTree");
117989
117990   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":14
117991  * cdef public api _ElementTree newElementTree(_Element context_node,
117992  *                                         object subclass):
117993  *     if <void*>context_node is NULL or context_node is None:             # <<<<<<<<<<<<<<
117994  *         raise TypeError
117995  * 
117996  */
117997   if (!(((void *)__pyx_v_context_node) == NULL)) {
117998     __pyx_t_1 = (((PyObject *)__pyx_v_context_node) == Py_None);
117999     __pyx_t_2 = __pyx_t_1;
118000   } else {
118001     __pyx_t_2 = (((void *)__pyx_v_context_node) == NULL);
118002   }
118003   if (__pyx_t_2) {
118004
118005     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":15
118006  *                                         object subclass):
118007  *     if <void*>context_node is NULL or context_node is None:
118008  *         raise TypeError             # <<<<<<<<<<<<<<
118009  * 
118010  *     return _newElementTree(context_node._doc, context_node, subclass)
118011  */
118012     __Pyx_Raise(__pyx_builtin_TypeError, 0, 0);
118013     {__pyx_filename = __pyx_f[24]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
118014     goto __pyx_L3;
118015   }
118016   __pyx_L3:;
118017
118018   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":17
118019  *         raise TypeError
118020  * 
118021  *     return _newElementTree(context_node._doc, context_node, subclass)             # <<<<<<<<<<<<<<
118022  * 
118023  * cdef public api _Element elementFactory(_Document doc, xmlNode* c_node):
118024  */
118025   __Pyx_XDECREF(((PyObject *)__pyx_r));
118026   __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__newElementTree(__pyx_v_context_node->_doc, __pyx_v_context_node, __pyx_v_subclass)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
118027   __Pyx_GOTREF(__pyx_t_3);
118028   __pyx_r = ((struct LxmlElementTree *)__pyx_t_3);
118029   __pyx_t_3 = 0;
118030   goto __pyx_L0;
118031
118032   __pyx_r = ((struct LxmlElementTree *)Py_None); __Pyx_INCREF(Py_None);
118033   goto __pyx_L0;
118034   __pyx_L1_error:;
118035   __Pyx_XDECREF(__pyx_t_3);
118036   __Pyx_AddTraceback("lxml.etree.newElementTree");
118037   __pyx_r = 0;
118038   __pyx_L0:;
118039   __Pyx_XGIVEREF((PyObject *)__pyx_r);
118040   __Pyx_FinishRefcountContext();
118041   return __pyx_r;
118042 }
118043
118044 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":19
118045  *     return _newElementTree(context_node._doc, context_node, subclass)
118046  * 
118047  * cdef public api _Element elementFactory(_Document doc, xmlNode* c_node):             # <<<<<<<<<<<<<<
118048  *     if c_node is NULL or doc is None:
118049  *         raise TypeError
118050  */
118051
118052  DL_EXPORT(struct LxmlElement) *elementFactory(struct LxmlDocument *__pyx_v_doc, xmlNode *__pyx_v_c_node) {
118053   struct LxmlElement *__pyx_r = NULL;
118054   int __pyx_t_1;
118055   int __pyx_t_2;
118056   PyObject *__pyx_t_3 = NULL;
118057   __Pyx_SetupRefcountContext("elementFactory");
118058
118059   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":20
118060  * 
118061  * cdef public api _Element elementFactory(_Document doc, xmlNode* c_node):
118062  *     if c_node is NULL or doc is None:             # <<<<<<<<<<<<<<
118063  *         raise TypeError
118064  *     return _elementFactory(doc, c_node)
118065  */
118066   if (!(__pyx_v_c_node == NULL)) {
118067     __pyx_t_1 = (((PyObject *)__pyx_v_doc) == Py_None);
118068     __pyx_t_2 = __pyx_t_1;
118069   } else {
118070     __pyx_t_2 = (__pyx_v_c_node == NULL);
118071   }
118072   if (__pyx_t_2) {
118073
118074     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":21
118075  * cdef public api _Element elementFactory(_Document doc, xmlNode* c_node):
118076  *     if c_node is NULL or doc is None:
118077  *         raise TypeError             # <<<<<<<<<<<<<<
118078  *     return _elementFactory(doc, c_node)
118079  * 
118080  */
118081     __Pyx_Raise(__pyx_builtin_TypeError, 0, 0);
118082     {__pyx_filename = __pyx_f[24]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
118083     goto __pyx_L3;
118084   }
118085   __pyx_L3:;
118086
118087   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":22
118088  *     if c_node is NULL or doc is None:
118089  *         raise TypeError
118090  *     return _elementFactory(doc, c_node)             # <<<<<<<<<<<<<<
118091  * 
118092  * cdef public api _Element makeElement(tag, _Document doc, parser,
118093  */
118094   __Pyx_XDECREF(((PyObject *)__pyx_r));
118095   __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
118096   __Pyx_GOTREF(__pyx_t_3);
118097   __pyx_r = ((struct LxmlElement *)__pyx_t_3);
118098   __pyx_t_3 = 0;
118099   goto __pyx_L0;
118100
118101   __pyx_r = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
118102   goto __pyx_L0;
118103   __pyx_L1_error:;
118104   __Pyx_XDECREF(__pyx_t_3);
118105   __Pyx_AddTraceback("lxml.etree.elementFactory");
118106   __pyx_r = 0;
118107   __pyx_L0:;
118108   __Pyx_XGIVEREF((PyObject *)__pyx_r);
118109   __Pyx_FinishRefcountContext();
118110   return __pyx_r;
118111 }
118112
118113 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":24
118114  *     return _elementFactory(doc, c_node)
118115  * 
118116  * cdef public api _Element makeElement(tag, _Document doc, parser,             # <<<<<<<<<<<<<<
118117  *                                  text, tail, attrib, nsmap):
118118  *     return _makeElement(tag, NULL, doc, parser, text, tail, attrib, nsmap, None)
118119  */
118120
118121  DL_EXPORT(struct LxmlElement) *makeElement(PyObject *__pyx_v_tag, struct LxmlDocument *__pyx_v_doc, PyObject *__pyx_v_parser, PyObject *__pyx_v_text, PyObject *__pyx_v_tail, PyObject *__pyx_v_attrib, PyObject *__pyx_v_nsmap) {
118122   struct LxmlElement *__pyx_r = NULL;
118123   PyObject *__pyx_t_1 = NULL;
118124   __Pyx_SetupRefcountContext("makeElement");
118125
118126   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":26
118127  * cdef public api _Element makeElement(tag, _Document doc, parser,
118128  *                                  text, tail, attrib, nsmap):
118129  *     return _makeElement(tag, NULL, doc, parser, text, tail, attrib, nsmap, None)             # <<<<<<<<<<<<<<
118130  * 
118131  * cdef public api _Element makeSubElement(_Element parent, tag, text, tail,
118132  */
118133   __Pyx_XDECREF(((PyObject *)__pyx_r));
118134   if (!(__Pyx_TypeTest(__pyx_v_parser, __pyx_ptype_4lxml_5etree__BaseParser))) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
118135   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__makeElement(__pyx_v_tag, NULL, __pyx_v_doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser), __pyx_v_text, __pyx_v_tail, __pyx_v_attrib, __pyx_v_nsmap, Py_None)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
118136   __Pyx_GOTREF(__pyx_t_1);
118137   __pyx_r = ((struct LxmlElement *)__pyx_t_1);
118138   __pyx_t_1 = 0;
118139   goto __pyx_L0;
118140
118141   __pyx_r = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
118142   goto __pyx_L0;
118143   __pyx_L1_error:;
118144   __Pyx_XDECREF(__pyx_t_1);
118145   __Pyx_AddTraceback("lxml.etree.makeElement");
118146   __pyx_r = 0;
118147   __pyx_L0:;
118148   __Pyx_XGIVEREF((PyObject *)__pyx_r);
118149   __Pyx_FinishRefcountContext();
118150   return __pyx_r;
118151 }
118152
118153 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":28
118154  *     return _makeElement(tag, NULL, doc, parser, text, tail, attrib, nsmap, None)
118155  * 
118156  * cdef public api _Element makeSubElement(_Element parent, tag, text, tail,             # <<<<<<<<<<<<<<
118157  *                                     attrib, nsmap):
118158  *     return _makeSubElement(parent, tag, text, tail, attrib, nsmap, None)
118159  */
118160
118161  DL_EXPORT(struct LxmlElement) *makeSubElement(struct LxmlElement *__pyx_v_parent, PyObject *__pyx_v_tag, PyObject *__pyx_v_text, PyObject *__pyx_v_tail, PyObject *__pyx_v_attrib, PyObject *__pyx_v_nsmap) {
118162   struct LxmlElement *__pyx_r = NULL;
118163   PyObject *__pyx_t_1 = NULL;
118164   __Pyx_SetupRefcountContext("makeSubElement");
118165
118166   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":30
118167  * cdef public api _Element makeSubElement(_Element parent, tag, text, tail,
118168  *                                     attrib, nsmap):
118169  *     return _makeSubElement(parent, tag, text, tail, attrib, nsmap, None)             # <<<<<<<<<<<<<<
118170  * 
118171  * cdef public api void setElementClassLookupFunction(
118172  */
118173   __Pyx_XDECREF(((PyObject *)__pyx_r));
118174   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__makeSubElement(__pyx_v_parent, __pyx_v_tag, __pyx_v_text, __pyx_v_tail, __pyx_v_attrib, __pyx_v_nsmap, Py_None)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
118175   __Pyx_GOTREF(__pyx_t_1);
118176   __pyx_r = ((struct LxmlElement *)__pyx_t_1);
118177   __pyx_t_1 = 0;
118178   goto __pyx_L0;
118179
118180   __pyx_r = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
118181   goto __pyx_L0;
118182   __pyx_L1_error:;
118183   __Pyx_XDECREF(__pyx_t_1);
118184   __Pyx_AddTraceback("lxml.etree.makeSubElement");
118185   __pyx_r = 0;
118186   __pyx_L0:;
118187   __Pyx_XGIVEREF((PyObject *)__pyx_r);
118188   __Pyx_FinishRefcountContext();
118189   return __pyx_r;
118190 }
118191
118192 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":32
118193  *     return _makeSubElement(parent, tag, text, tail, attrib, nsmap, None)
118194  * 
118195  * cdef public api void setElementClassLookupFunction(             # <<<<<<<<<<<<<<
118196  *     _element_class_lookup_function function, state):
118197  *     _setElementClassLookupFunction(function, state)
118198  */
118199
118200  DL_EXPORT(void) setElementClassLookupFunction(_element_class_lookup_function __pyx_v_function, PyObject *__pyx_v_state) {
118201   __Pyx_SetupRefcountContext("setElementClassLookupFunction");
118202
118203   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":34
118204  * cdef public api void setElementClassLookupFunction(
118205  *     _element_class_lookup_function function, state):
118206  *     _setElementClassLookupFunction(function, state)             # <<<<<<<<<<<<<<
118207  * 
118208  * cdef public api object lookupDefaultElementClass(state, doc, xmlNode* c_node):
118209  */
118210   __pyx_f_4lxml_5etree__setElementClassLookupFunction(__pyx_v_function, __pyx_v_state);
118211
118212   __Pyx_FinishRefcountContext();
118213 }
118214
118215 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":36
118216  *     _setElementClassLookupFunction(function, state)
118217  * 
118218  * cdef public api object lookupDefaultElementClass(state, doc, xmlNode* c_node):             # <<<<<<<<<<<<<<
118219  *     return _lookupDefaultElementClass(state, doc, c_node)
118220  * 
118221  */
118222
118223  DL_EXPORT(PyObject) *lookupDefaultElementClass(PyObject *__pyx_v_state, PyObject *__pyx_v_doc, xmlNode *__pyx_v_c_node) {
118224   PyObject *__pyx_r = NULL;
118225   PyObject *__pyx_t_1 = NULL;
118226   __Pyx_SetupRefcountContext("lookupDefaultElementClass");
118227
118228   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":37
118229  * 
118230  * cdef public api object lookupDefaultElementClass(state, doc, xmlNode* c_node):
118231  *     return _lookupDefaultElementClass(state, doc, c_node)             # <<<<<<<<<<<<<<
118232  * 
118233  * cdef public api object lookupNamespaceElementClass(state, doc, xmlNode* c_node):
118234  */
118235   __Pyx_XDECREF(__pyx_r);
118236   if (!(__Pyx_TypeTest(__pyx_v_doc, __pyx_ptype_4lxml_5etree__Document))) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
118237   __pyx_t_1 = __pyx_f_4lxml_5etree__lookupDefaultElementClass(__pyx_v_state, ((struct LxmlDocument *)__pyx_v_doc), __pyx_v_c_node); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
118238   __Pyx_GOTREF(__pyx_t_1);
118239   __pyx_r = __pyx_t_1;
118240   __pyx_t_1 = 0;
118241   goto __pyx_L0;
118242
118243   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
118244   goto __pyx_L0;
118245   __pyx_L1_error:;
118246   __Pyx_XDECREF(__pyx_t_1);
118247   __Pyx_AddTraceback("lxml.etree.lookupDefaultElementClass");
118248   __pyx_r = 0;
118249   __pyx_L0:;
118250   __Pyx_XGIVEREF(__pyx_r);
118251   __Pyx_FinishRefcountContext();
118252   return __pyx_r;
118253 }
118254
118255 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":39
118256  *     return _lookupDefaultElementClass(state, doc, c_node)
118257  * 
118258  * cdef public api object lookupNamespaceElementClass(state, doc, xmlNode* c_node):             # <<<<<<<<<<<<<<
118259  *     return _find_nselement_class(state, doc, c_node)
118260  * 
118261  */
118262
118263  DL_EXPORT(PyObject) *lookupNamespaceElementClass(PyObject *__pyx_v_state, PyObject *__pyx_v_doc, xmlNode *__pyx_v_c_node) {
118264   PyObject *__pyx_r = NULL;
118265   PyObject *__pyx_t_1 = NULL;
118266   __Pyx_SetupRefcountContext("lookupNamespaceElementClass");
118267
118268   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":40
118269  * 
118270  * cdef public api object lookupNamespaceElementClass(state, doc, xmlNode* c_node):
118271  *     return _find_nselement_class(state, doc, c_node)             # <<<<<<<<<<<<<<
118272  * 
118273  * cdef public api object callLookupFallback(FallbackElementClassLookup lookup,
118274  */
118275   __Pyx_XDECREF(__pyx_r);
118276   if (!(__Pyx_TypeTest(__pyx_v_doc, __pyx_ptype_4lxml_5etree__Document))) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
118277   __pyx_t_1 = __pyx_f_4lxml_5etree__find_nselement_class(__pyx_v_state, ((struct LxmlDocument *)__pyx_v_doc), __pyx_v_c_node); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
118278   __Pyx_GOTREF(__pyx_t_1);
118279   __pyx_r = __pyx_t_1;
118280   __pyx_t_1 = 0;
118281   goto __pyx_L0;
118282
118283   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
118284   goto __pyx_L0;
118285   __pyx_L1_error:;
118286   __Pyx_XDECREF(__pyx_t_1);
118287   __Pyx_AddTraceback("lxml.etree.lookupNamespaceElementClass");
118288   __pyx_r = 0;
118289   __pyx_L0:;
118290   __Pyx_XGIVEREF(__pyx_r);
118291   __Pyx_FinishRefcountContext();
118292   return __pyx_r;
118293 }
118294
118295 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":42
118296  *     return _find_nselement_class(state, doc, c_node)
118297  * 
118298  * cdef public api object callLookupFallback(FallbackElementClassLookup lookup,             # <<<<<<<<<<<<<<
118299  *                                       _Document doc, xmlNode* c_node):
118300  *     return _callLookupFallback(lookup, doc, c_node)
118301  */
118302
118303  DL_EXPORT(PyObject) *callLookupFallback(struct LxmlFallbackElementClassLookup *__pyx_v_lookup, struct LxmlDocument *__pyx_v_doc, xmlNode *__pyx_v_c_node) {
118304   PyObject *__pyx_r = NULL;
118305   PyObject *__pyx_t_1 = NULL;
118306   __Pyx_SetupRefcountContext("callLookupFallback");
118307
118308   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":44
118309  * cdef public api object callLookupFallback(FallbackElementClassLookup lookup,
118310  *                                       _Document doc, xmlNode* c_node):
118311  *     return _callLookupFallback(lookup, doc, c_node)             # <<<<<<<<<<<<<<
118312  * 
118313  * cdef public api int tagMatches(xmlNode* c_node, char* c_href, char* c_name):
118314  */
118315   __Pyx_XDECREF(__pyx_r);
118316   __pyx_t_1 = __pyx_f_4lxml_5etree__callLookupFallback(__pyx_v_lookup, __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
118317   __Pyx_GOTREF(__pyx_t_1);
118318   __pyx_r = __pyx_t_1;
118319   __pyx_t_1 = 0;
118320   goto __pyx_L0;
118321
118322   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
118323   goto __pyx_L0;
118324   __pyx_L1_error:;
118325   __Pyx_XDECREF(__pyx_t_1);
118326   __Pyx_AddTraceback("lxml.etree.callLookupFallback");
118327   __pyx_r = 0;
118328   __pyx_L0:;
118329   __Pyx_XGIVEREF(__pyx_r);
118330   __Pyx_FinishRefcountContext();
118331   return __pyx_r;
118332 }
118333
118334 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":46
118335  *     return _callLookupFallback(lookup, doc, c_node)
118336  * 
118337  * cdef public api int tagMatches(xmlNode* c_node, char* c_href, char* c_name):             # <<<<<<<<<<<<<<
118338  *     if c_node is NULL:
118339  *         return -1
118340  */
118341
118342  DL_EXPORT(int) tagMatches(xmlNode *__pyx_v_c_node, char *__pyx_v_c_href, char *__pyx_v_c_name) {
118343   int __pyx_r;
118344   int __pyx_t_1;
118345   __Pyx_SetupRefcountContext("tagMatches");
118346
118347   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":47
118348  * 
118349  * cdef public api int tagMatches(xmlNode* c_node, char* c_href, char* c_name):
118350  *     if c_node is NULL:             # <<<<<<<<<<<<<<
118351  *         return -1
118352  *     return _tagMatches(c_node, c_href, c_name)
118353  */
118354   __pyx_t_1 = (__pyx_v_c_node == NULL);
118355   if (__pyx_t_1) {
118356
118357     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":48
118358  * cdef public api int tagMatches(xmlNode* c_node, char* c_href, char* c_name):
118359  *     if c_node is NULL:
118360  *         return -1             # <<<<<<<<<<<<<<
118361  *     return _tagMatches(c_node, c_href, c_name)
118362  * 
118363  */
118364     __pyx_r = -1;
118365     goto __pyx_L0;
118366     goto __pyx_L3;
118367   }
118368   __pyx_L3:;
118369
118370   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":49
118371  *     if c_node is NULL:
118372  *         return -1
118373  *     return _tagMatches(c_node, c_href, c_name)             # <<<<<<<<<<<<<<
118374  * 
118375  * cdef public api _Document documentOrRaise(object input):
118376  */
118377   __pyx_r = __pyx_f_4lxml_5etree__tagMatches(__pyx_v_c_node, __pyx_v_c_href, __pyx_v_c_name);
118378   goto __pyx_L0;
118379
118380   __pyx_r = 0;
118381   __pyx_L0:;
118382   __Pyx_FinishRefcountContext();
118383   return __pyx_r;
118384 }
118385
118386 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":51
118387  *     return _tagMatches(c_node, c_href, c_name)
118388  * 
118389  * cdef public api _Document documentOrRaise(object input):             # <<<<<<<<<<<<<<
118390  *     return _documentOrRaise(input)
118391  * 
118392  */
118393
118394  DL_EXPORT(struct LxmlDocument) *documentOrRaise(PyObject *__pyx_v_input) {
118395   struct LxmlDocument *__pyx_r = NULL;
118396   PyObject *__pyx_t_1 = NULL;
118397   __Pyx_SetupRefcountContext("documentOrRaise");
118398
118399   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":52
118400  * 
118401  * cdef public api _Document documentOrRaise(object input):
118402  *     return _documentOrRaise(input)             # <<<<<<<<<<<<<<
118403  * 
118404  * cdef public api _Element rootNodeOrRaise(object input):
118405  */
118406   __Pyx_XDECREF(((PyObject *)__pyx_r));
118407   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v_input)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
118408   __Pyx_GOTREF(__pyx_t_1);
118409   __pyx_r = ((struct LxmlDocument *)__pyx_t_1);
118410   __pyx_t_1 = 0;
118411   goto __pyx_L0;
118412
118413   __pyx_r = ((struct LxmlDocument *)Py_None); __Pyx_INCREF(Py_None);
118414   goto __pyx_L0;
118415   __pyx_L1_error:;
118416   __Pyx_XDECREF(__pyx_t_1);
118417   __Pyx_AddTraceback("lxml.etree.documentOrRaise");
118418   __pyx_r = 0;
118419   __pyx_L0:;
118420   __Pyx_XGIVEREF((PyObject *)__pyx_r);
118421   __Pyx_FinishRefcountContext();
118422   return __pyx_r;
118423 }
118424
118425 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":54
118426  *     return _documentOrRaise(input)
118427  * 
118428  * cdef public api _Element rootNodeOrRaise(object input):             # <<<<<<<<<<<<<<
118429  *     return _rootNodeOrRaise(input)
118430  * 
118431  */
118432
118433  DL_EXPORT(struct LxmlElement) *rootNodeOrRaise(PyObject *__pyx_v_input) {
118434   struct LxmlElement *__pyx_r = NULL;
118435   PyObject *__pyx_t_1 = NULL;
118436   __Pyx_SetupRefcountContext("rootNodeOrRaise");
118437
118438   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":55
118439  * 
118440  * cdef public api _Element rootNodeOrRaise(object input):
118441  *     return _rootNodeOrRaise(input)             # <<<<<<<<<<<<<<
118442  * 
118443  * cdef public api bint hasText(xmlNode* c_node):
118444  */
118445   __Pyx_XDECREF(((PyObject *)__pyx_r));
118446   __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v_input)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
118447   __Pyx_GOTREF(__pyx_t_1);
118448   __pyx_r = ((struct LxmlElement *)__pyx_t_1);
118449   __pyx_t_1 = 0;
118450   goto __pyx_L0;
118451
118452   __pyx_r = ((struct LxmlElement *)Py_None); __Pyx_INCREF(Py_None);
118453   goto __pyx_L0;
118454   __pyx_L1_error:;
118455   __Pyx_XDECREF(__pyx_t_1);
118456   __Pyx_AddTraceback("lxml.etree.rootNodeOrRaise");
118457   __pyx_r = 0;
118458   __pyx_L0:;
118459   __Pyx_XGIVEREF((PyObject *)__pyx_r);
118460   __Pyx_FinishRefcountContext();
118461   return __pyx_r;
118462 }
118463
118464 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":57
118465  *     return _rootNodeOrRaise(input)
118466  * 
118467  * cdef public api bint hasText(xmlNode* c_node):             # <<<<<<<<<<<<<<
118468  *     return _hasText(c_node)
118469  * 
118470  */
118471
118472  DL_EXPORT(int) hasText(xmlNode *__pyx_v_c_node) {
118473   int __pyx_r;
118474   __Pyx_SetupRefcountContext("hasText");
118475
118476   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":58
118477  * 
118478  * cdef public api bint hasText(xmlNode* c_node):
118479  *     return _hasText(c_node)             # <<<<<<<<<<<<<<
118480  * 
118481  * cdef public api bint hasTail(xmlNode* c_node):
118482  */
118483   __pyx_r = __pyx_f_4lxml_5etree__hasText(__pyx_v_c_node);
118484   goto __pyx_L0;
118485
118486   __pyx_r = 0;
118487   __pyx_L0:;
118488   __Pyx_FinishRefcountContext();
118489   return __pyx_r;
118490 }
118491
118492 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":60
118493  *     return _hasText(c_node)
118494  * 
118495  * cdef public api bint hasTail(xmlNode* c_node):             # <<<<<<<<<<<<<<
118496  *     return _hasTail(c_node)
118497  * 
118498  */
118499
118500  DL_EXPORT(int) hasTail(xmlNode *__pyx_v_c_node) {
118501   int __pyx_r;
118502   __Pyx_SetupRefcountContext("hasTail");
118503
118504   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":61
118505  * 
118506  * cdef public api bint hasTail(xmlNode* c_node):
118507  *     return _hasTail(c_node)             # <<<<<<<<<<<<<<
118508  * 
118509  * cdef public api object textOf(xmlNode* c_node):
118510  */
118511   __pyx_r = __pyx_f_4lxml_5etree__hasTail(__pyx_v_c_node);
118512   goto __pyx_L0;
118513
118514   __pyx_r = 0;
118515   __pyx_L0:;
118516   __Pyx_FinishRefcountContext();
118517   return __pyx_r;
118518 }
118519
118520 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":63
118521  *     return _hasTail(c_node)
118522  * 
118523  * cdef public api object textOf(xmlNode* c_node):             # <<<<<<<<<<<<<<
118524  *     if c_node is NULL:
118525  *         return None
118526  */
118527
118528  DL_EXPORT(PyObject) *textOf(xmlNode *__pyx_v_c_node) {
118529   PyObject *__pyx_r = NULL;
118530   int __pyx_t_1;
118531   PyObject *__pyx_t_2 = NULL;
118532   __Pyx_SetupRefcountContext("textOf");
118533
118534   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":64
118535  * 
118536  * cdef public api object textOf(xmlNode* c_node):
118537  *     if c_node is NULL:             # <<<<<<<<<<<<<<
118538  *         return None
118539  *     return _collectText(c_node.children)
118540  */
118541   __pyx_t_1 = (__pyx_v_c_node == NULL);
118542   if (__pyx_t_1) {
118543
118544     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":65
118545  * cdef public api object textOf(xmlNode* c_node):
118546  *     if c_node is NULL:
118547  *         return None             # <<<<<<<<<<<<<<
118548  *     return _collectText(c_node.children)
118549  * 
118550  */
118551     __Pyx_XDECREF(__pyx_r);
118552     __Pyx_INCREF(Py_None);
118553     __pyx_r = Py_None;
118554     goto __pyx_L0;
118555     goto __pyx_L3;
118556   }
118557   __pyx_L3:;
118558
118559   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":66
118560  *     if c_node is NULL:
118561  *         return None
118562  *     return _collectText(c_node.children)             # <<<<<<<<<<<<<<
118563  * 
118564  * cdef public api object tailOf(xmlNode* c_node):
118565  */
118566   __Pyx_XDECREF(__pyx_r);
118567   __pyx_t_2 = __pyx_f_4lxml_5etree__collectText(__pyx_v_c_node->children); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
118568   __Pyx_GOTREF(__pyx_t_2);
118569   __pyx_r = __pyx_t_2;
118570   __pyx_t_2 = 0;
118571   goto __pyx_L0;
118572
118573   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
118574   goto __pyx_L0;
118575   __pyx_L1_error:;
118576   __Pyx_XDECREF(__pyx_t_2);
118577   __Pyx_AddTraceback("lxml.etree.textOf");
118578   __pyx_r = 0;
118579   __pyx_L0:;
118580   __Pyx_XGIVEREF(__pyx_r);
118581   __Pyx_FinishRefcountContext();
118582   return __pyx_r;
118583 }
118584
118585 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":68
118586  *     return _collectText(c_node.children)
118587  * 
118588  * cdef public api object tailOf(xmlNode* c_node):             # <<<<<<<<<<<<<<
118589  *     if c_node is NULL:
118590  *         return None
118591  */
118592
118593  DL_EXPORT(PyObject) *tailOf(xmlNode *__pyx_v_c_node) {
118594   PyObject *__pyx_r = NULL;
118595   int __pyx_t_1;
118596   PyObject *__pyx_t_2 = NULL;
118597   __Pyx_SetupRefcountContext("tailOf");
118598
118599   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":69
118600  * 
118601  * cdef public api object tailOf(xmlNode* c_node):
118602  *     if c_node is NULL:             # <<<<<<<<<<<<<<
118603  *         return None
118604  *     return _collectText(c_node.next)
118605  */
118606   __pyx_t_1 = (__pyx_v_c_node == NULL);
118607   if (__pyx_t_1) {
118608
118609     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":70
118610  * cdef public api object tailOf(xmlNode* c_node):
118611  *     if c_node is NULL:
118612  *         return None             # <<<<<<<<<<<<<<
118613  *     return _collectText(c_node.next)
118614  * 
118615  */
118616     __Pyx_XDECREF(__pyx_r);
118617     __Pyx_INCREF(Py_None);
118618     __pyx_r = Py_None;
118619     goto __pyx_L0;
118620     goto __pyx_L3;
118621   }
118622   __pyx_L3:;
118623
118624   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":71
118625  *     if c_node is NULL:
118626  *         return None
118627  *     return _collectText(c_node.next)             # <<<<<<<<<<<<<<
118628  * 
118629  * cdef public api int setNodeText(xmlNode* c_node, text) except -1:
118630  */
118631   __Pyx_XDECREF(__pyx_r);
118632   __pyx_t_2 = __pyx_f_4lxml_5etree__collectText(__pyx_v_c_node->next); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
118633   __Pyx_GOTREF(__pyx_t_2);
118634   __pyx_r = __pyx_t_2;
118635   __pyx_t_2 = 0;
118636   goto __pyx_L0;
118637
118638   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
118639   goto __pyx_L0;
118640   __pyx_L1_error:;
118641   __Pyx_XDECREF(__pyx_t_2);
118642   __Pyx_AddTraceback("lxml.etree.tailOf");
118643   __pyx_r = 0;
118644   __pyx_L0:;
118645   __Pyx_XGIVEREF(__pyx_r);
118646   __Pyx_FinishRefcountContext();
118647   return __pyx_r;
118648 }
118649
118650 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":73
118651  *     return _collectText(c_node.next)
118652  * 
118653  * cdef public api int setNodeText(xmlNode* c_node, text) except -1:             # <<<<<<<<<<<<<<
118654  *     if c_node is NULL:
118655  *         raise ValueError
118656  */
118657
118658  DL_EXPORT(int) setNodeText(xmlNode *__pyx_v_c_node, PyObject *__pyx_v_text) {
118659   int __pyx_r;
118660   int __pyx_t_1;
118661   int __pyx_t_2;
118662   __Pyx_SetupRefcountContext("setNodeText");
118663
118664   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":74
118665  * 
118666  * cdef public api int setNodeText(xmlNode* c_node, text) except -1:
118667  *     if c_node is NULL:             # <<<<<<<<<<<<<<
118668  *         raise ValueError
118669  *     return _setNodeText(c_node, text)
118670  */
118671   __pyx_t_1 = (__pyx_v_c_node == NULL);
118672   if (__pyx_t_1) {
118673
118674     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":75
118675  * cdef public api int setNodeText(xmlNode* c_node, text) except -1:
118676  *     if c_node is NULL:
118677  *         raise ValueError             # <<<<<<<<<<<<<<
118678  *     return _setNodeText(c_node, text)
118679  * 
118680  */
118681     __Pyx_Raise(__pyx_builtin_ValueError, 0, 0);
118682     {__pyx_filename = __pyx_f[24]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
118683     goto __pyx_L3;
118684   }
118685   __pyx_L3:;
118686
118687   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":76
118688  *     if c_node is NULL:
118689  *         raise ValueError
118690  *     return _setNodeText(c_node, text)             # <<<<<<<<<<<<<<
118691  * 
118692  * cdef public api int setTailText(xmlNode* c_node, text) except -1:
118693  */
118694   __pyx_t_2 = __pyx_f_4lxml_5etree__setNodeText(__pyx_v_c_node, __pyx_v_text); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
118695   __pyx_r = __pyx_t_2;
118696   goto __pyx_L0;
118697
118698   __pyx_r = 0;
118699   goto __pyx_L0;
118700   __pyx_L1_error:;
118701   __Pyx_AddTraceback("lxml.etree.setNodeText");
118702   __pyx_r = -1;
118703   __pyx_L0:;
118704   __Pyx_FinishRefcountContext();
118705   return __pyx_r;
118706 }
118707
118708 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":78
118709  *     return _setNodeText(c_node, text)
118710  * 
118711  * cdef public api int setTailText(xmlNode* c_node, text) except -1:             # <<<<<<<<<<<<<<
118712  *     if c_node is NULL:
118713  *         raise ValueError
118714  */
118715
118716  DL_EXPORT(int) setTailText(xmlNode *__pyx_v_c_node, PyObject *__pyx_v_text) {
118717   int __pyx_r;
118718   int __pyx_t_1;
118719   int __pyx_t_2;
118720   __Pyx_SetupRefcountContext("setTailText");
118721
118722   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":79
118723  * 
118724  * cdef public api int setTailText(xmlNode* c_node, text) except -1:
118725  *     if c_node is NULL:             # <<<<<<<<<<<<<<
118726  *         raise ValueError
118727  *     return _setTailText(c_node, text)
118728  */
118729   __pyx_t_1 = (__pyx_v_c_node == NULL);
118730   if (__pyx_t_1) {
118731
118732     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":80
118733  * cdef public api int setTailText(xmlNode* c_node, text) except -1:
118734  *     if c_node is NULL:
118735  *         raise ValueError             # <<<<<<<<<<<<<<
118736  *     return _setTailText(c_node, text)
118737  * 
118738  */
118739     __Pyx_Raise(__pyx_builtin_ValueError, 0, 0);
118740     {__pyx_filename = __pyx_f[24]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
118741     goto __pyx_L3;
118742   }
118743   __pyx_L3:;
118744
118745   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":81
118746  *     if c_node is NULL:
118747  *         raise ValueError
118748  *     return _setTailText(c_node, text)             # <<<<<<<<<<<<<<
118749  * 
118750  * cdef public api object attributeValue(xmlNode* c_element, xmlAttr* c_attrib_node):
118751  */
118752   __pyx_t_2 = __pyx_f_4lxml_5etree__setTailText(__pyx_v_c_node, __pyx_v_text); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
118753   __pyx_r = __pyx_t_2;
118754   goto __pyx_L0;
118755
118756   __pyx_r = 0;
118757   goto __pyx_L0;
118758   __pyx_L1_error:;
118759   __Pyx_AddTraceback("lxml.etree.setTailText");
118760   __pyx_r = -1;
118761   __pyx_L0:;
118762   __Pyx_FinishRefcountContext();
118763   return __pyx_r;
118764 }
118765
118766 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":83
118767  *     return _setTailText(c_node, text)
118768  * 
118769  * cdef public api object attributeValue(xmlNode* c_element, xmlAttr* c_attrib_node):             # <<<<<<<<<<<<<<
118770  *     return _attributeValue(c_element, c_attrib_node)
118771  * 
118772  */
118773
118774  DL_EXPORT(PyObject) *attributeValue(xmlNode *__pyx_v_c_element, xmlAttr *__pyx_v_c_attrib_node) {
118775   PyObject *__pyx_r = NULL;
118776   PyObject *__pyx_t_1 = NULL;
118777   __Pyx_SetupRefcountContext("attributeValue");
118778
118779   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":84
118780  * 
118781  * cdef public api object attributeValue(xmlNode* c_element, xmlAttr* c_attrib_node):
118782  *     return _attributeValue(c_element, c_attrib_node)             # <<<<<<<<<<<<<<
118783  * 
118784  * cdef public api object attributeValueFromNsName(xmlNode* c_element,
118785  */
118786   __Pyx_XDECREF(__pyx_r);
118787   __pyx_t_1 = __pyx_f_4lxml_5etree__attributeValue(__pyx_v_c_element, __pyx_v_c_attrib_node); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
118788   __Pyx_GOTREF(__pyx_t_1);
118789   __pyx_r = __pyx_t_1;
118790   __pyx_t_1 = 0;
118791   goto __pyx_L0;
118792
118793   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
118794   goto __pyx_L0;
118795   __pyx_L1_error:;
118796   __Pyx_XDECREF(__pyx_t_1);
118797   __Pyx_AddTraceback("lxml.etree.attributeValue");
118798   __pyx_r = 0;
118799   __pyx_L0:;
118800   __Pyx_XGIVEREF(__pyx_r);
118801   __Pyx_FinishRefcountContext();
118802   return __pyx_r;
118803 }
118804
118805 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":86
118806  *     return _attributeValue(c_element, c_attrib_node)
118807  * 
118808  * cdef public api object attributeValueFromNsName(xmlNode* c_element,             # <<<<<<<<<<<<<<
118809  *                                             char* ns, char* name):
118810  *     return _attributeValueFromNsName(c_element, ns, name)
118811  */
118812
118813  DL_EXPORT(PyObject) *attributeValueFromNsName(xmlNode *__pyx_v_c_element, char *__pyx_v_ns, char *__pyx_v_name) {
118814   PyObject *__pyx_r = NULL;
118815   PyObject *__pyx_t_1 = NULL;
118816   __Pyx_SetupRefcountContext("attributeValueFromNsName");
118817
118818   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":88
118819  * cdef public api object attributeValueFromNsName(xmlNode* c_element,
118820  *                                             char* ns, char* name):
118821  *     return _attributeValueFromNsName(c_element, ns, name)             # <<<<<<<<<<<<<<
118822  * 
118823  * cdef public api object getAttributeValue(_Element element, key, default):
118824  */
118825   __Pyx_XDECREF(__pyx_r);
118826   __pyx_t_1 = __pyx_f_4lxml_5etree__attributeValueFromNsName(__pyx_v_c_element, __pyx_v_ns, __pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
118827   __Pyx_GOTREF(__pyx_t_1);
118828   __pyx_r = __pyx_t_1;
118829   __pyx_t_1 = 0;
118830   goto __pyx_L0;
118831
118832   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
118833   goto __pyx_L0;
118834   __pyx_L1_error:;
118835   __Pyx_XDECREF(__pyx_t_1);
118836   __Pyx_AddTraceback("lxml.etree.attributeValueFromNsName");
118837   __pyx_r = 0;
118838   __pyx_L0:;
118839   __Pyx_XGIVEREF(__pyx_r);
118840   __Pyx_FinishRefcountContext();
118841   return __pyx_r;
118842 }
118843
118844 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":90
118845  *     return _attributeValueFromNsName(c_element, ns, name)
118846  * 
118847  * cdef public api object getAttributeValue(_Element element, key, default):             # <<<<<<<<<<<<<<
118848  *     return _getAttributeValue(element, key, default)
118849  * 
118850  */
118851
118852  DL_EXPORT(PyObject) *getAttributeValue(struct LxmlElement *__pyx_v_element, PyObject *__pyx_v_key, PyObject *__pyx_v_default) {
118853   PyObject *__pyx_r = NULL;
118854   PyObject *__pyx_t_1 = NULL;
118855   __Pyx_SetupRefcountContext("getAttributeValue");
118856
118857   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":91
118858  * 
118859  * cdef public api object getAttributeValue(_Element element, key, default):
118860  *     return _getAttributeValue(element, key, default)             # <<<<<<<<<<<<<<
118861  * 
118862  * cdef public api object iterattributes(_Element element, int keysvalues):
118863  */
118864   __Pyx_XDECREF(__pyx_r);
118865   __pyx_t_1 = __pyx_f_4lxml_5etree__getAttributeValue(__pyx_v_element, __pyx_v_key, __pyx_v_default); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
118866   __Pyx_GOTREF(__pyx_t_1);
118867   __pyx_r = __pyx_t_1;
118868   __pyx_t_1 = 0;
118869   goto __pyx_L0;
118870
118871   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
118872   goto __pyx_L0;
118873   __pyx_L1_error:;
118874   __Pyx_XDECREF(__pyx_t_1);
118875   __Pyx_AddTraceback("lxml.etree.getAttributeValue");
118876   __pyx_r = 0;
118877   __pyx_L0:;
118878   __Pyx_XGIVEREF(__pyx_r);
118879   __Pyx_FinishRefcountContext();
118880   return __pyx_r;
118881 }
118882
118883 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":93
118884  *     return _getAttributeValue(element, key, default)
118885  * 
118886  * cdef public api object iterattributes(_Element element, int keysvalues):             # <<<<<<<<<<<<<<
118887  *     return _attributeIteratorFactory(element, keysvalues)
118888  * 
118889  */
118890
118891  DL_EXPORT(PyObject) *iterattributes(struct LxmlElement *__pyx_v_element, int __pyx_v_keysvalues) {
118892   PyObject *__pyx_r = NULL;
118893   PyObject *__pyx_t_1 = NULL;
118894   __Pyx_SetupRefcountContext("iterattributes");
118895
118896   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":94
118897  * 
118898  * cdef public api object iterattributes(_Element element, int keysvalues):
118899  *     return _attributeIteratorFactory(element, keysvalues)             # <<<<<<<<<<<<<<
118900  * 
118901  * cdef public api object collectAttributes(xmlNode* c_element, int keysvalues):
118902  */
118903   __Pyx_XDECREF(__pyx_r);
118904   __pyx_t_1 = __pyx_f_4lxml_5etree__attributeIteratorFactory(__pyx_v_element, __pyx_v_keysvalues); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
118905   __Pyx_GOTREF(__pyx_t_1);
118906   __pyx_r = __pyx_t_1;
118907   __pyx_t_1 = 0;
118908   goto __pyx_L0;
118909
118910   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
118911   goto __pyx_L0;
118912   __pyx_L1_error:;
118913   __Pyx_XDECREF(__pyx_t_1);
118914   __Pyx_AddTraceback("lxml.etree.iterattributes");
118915   __pyx_r = 0;
118916   __pyx_L0:;
118917   __Pyx_XGIVEREF(__pyx_r);
118918   __Pyx_FinishRefcountContext();
118919   return __pyx_r;
118920 }
118921
118922 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":96
118923  *     return _attributeIteratorFactory(element, keysvalues)
118924  * 
118925  * cdef public api object collectAttributes(xmlNode* c_element, int keysvalues):             # <<<<<<<<<<<<<<
118926  *     return _collectAttributes(c_element, keysvalues)
118927  * 
118928  */
118929
118930  DL_EXPORT(PyObject) *collectAttributes(xmlNode *__pyx_v_c_element, int __pyx_v_keysvalues) {
118931   PyObject *__pyx_r = NULL;
118932   PyObject *__pyx_t_1 = NULL;
118933   __Pyx_SetupRefcountContext("collectAttributes");
118934
118935   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":97
118936  * 
118937  * cdef public api object collectAttributes(xmlNode* c_element, int keysvalues):
118938  *     return _collectAttributes(c_element, keysvalues)             # <<<<<<<<<<<<<<
118939  * 
118940  * cdef public api int setAttributeValue(_Element element, key, value) except -1:
118941  */
118942   __Pyx_XDECREF(__pyx_r);
118943   __pyx_t_1 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_c_element, __pyx_v_keysvalues); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
118944   __Pyx_GOTREF(__pyx_t_1);
118945   __pyx_r = __pyx_t_1;
118946   __pyx_t_1 = 0;
118947   goto __pyx_L0;
118948
118949   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
118950   goto __pyx_L0;
118951   __pyx_L1_error:;
118952   __Pyx_XDECREF(__pyx_t_1);
118953   __Pyx_AddTraceback("lxml.etree.collectAttributes");
118954   __pyx_r = 0;
118955   __pyx_L0:;
118956   __Pyx_XGIVEREF(__pyx_r);
118957   __Pyx_FinishRefcountContext();
118958   return __pyx_r;
118959 }
118960
118961 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":99
118962  *     return _collectAttributes(c_element, keysvalues)
118963  * 
118964  * cdef public api int setAttributeValue(_Element element, key, value) except -1:             # <<<<<<<<<<<<<<
118965  *     return _setAttributeValue(element, key, value)
118966  * 
118967  */
118968
118969  DL_EXPORT(int) setAttributeValue(struct LxmlElement *__pyx_v_element, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
118970   int __pyx_r;
118971   int __pyx_t_1;
118972   __Pyx_SetupRefcountContext("setAttributeValue");
118973
118974   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":100
118975  * 
118976  * cdef public api int setAttributeValue(_Element element, key, value) except -1:
118977  *     return _setAttributeValue(element, key, value)             # <<<<<<<<<<<<<<
118978  * 
118979  * cdef public api int delAttribute(_Element element, key) except -1:
118980  */
118981   __pyx_t_1 = __pyx_f_4lxml_5etree__setAttributeValue(__pyx_v_element, __pyx_v_key, __pyx_v_value); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
118982   __pyx_r = __pyx_t_1;
118983   goto __pyx_L0;
118984
118985   __pyx_r = 0;
118986   goto __pyx_L0;
118987   __pyx_L1_error:;
118988   __Pyx_AddTraceback("lxml.etree.setAttributeValue");
118989   __pyx_r = -1;
118990   __pyx_L0:;
118991   __Pyx_FinishRefcountContext();
118992   return __pyx_r;
118993 }
118994
118995 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":102
118996  *     return _setAttributeValue(element, key, value)
118997  * 
118998  * cdef public api int delAttribute(_Element element, key) except -1:             # <<<<<<<<<<<<<<
118999  *     return _delAttribute(element, key)
119000  * 
119001  */
119002
119003  DL_EXPORT(int) delAttribute(struct LxmlElement *__pyx_v_element, PyObject *__pyx_v_key) {
119004   int __pyx_r;
119005   int __pyx_t_1;
119006   __Pyx_SetupRefcountContext("delAttribute");
119007
119008   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":103
119009  * 
119010  * cdef public api int delAttribute(_Element element, key) except -1:
119011  *     return _delAttribute(element, key)             # <<<<<<<<<<<<<<
119012  * 
119013  * cdef public api int delAttributeFromNsName(tree.xmlNode* c_element,
119014  */
119015   __pyx_t_1 = __pyx_f_4lxml_5etree__delAttribute(__pyx_v_element, __pyx_v_key); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
119016   __pyx_r = __pyx_t_1;
119017   goto __pyx_L0;
119018
119019   __pyx_r = 0;
119020   goto __pyx_L0;
119021   __pyx_L1_error:;
119022   __Pyx_AddTraceback("lxml.etree.delAttribute");
119023   __pyx_r = -1;
119024   __pyx_L0:;
119025   __Pyx_FinishRefcountContext();
119026   return __pyx_r;
119027 }
119028
119029 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":105
119030  *     return _delAttribute(element, key)
119031  * 
119032  * cdef public api int delAttributeFromNsName(tree.xmlNode* c_element,             # <<<<<<<<<<<<<<
119033  *                                        char* c_href, char* c_name):
119034  *     return _delAttributeFromNsName(c_element, c_href, c_name)
119035  */
119036
119037  DL_EXPORT(int) delAttributeFromNsName(xmlNode *__pyx_v_c_element, char *__pyx_v_c_href, char *__pyx_v_c_name) {
119038   int __pyx_r;
119039   __Pyx_SetupRefcountContext("delAttributeFromNsName");
119040
119041   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":107
119042  * cdef public api int delAttributeFromNsName(tree.xmlNode* c_element,
119043  *                                        char* c_href, char* c_name):
119044  *     return _delAttributeFromNsName(c_element, c_href, c_name)             # <<<<<<<<<<<<<<
119045  * 
119046  * cdef public api bint hasChild(xmlNode* c_node):
119047  */
119048   __pyx_r = __pyx_f_4lxml_5etree__delAttributeFromNsName(__pyx_v_c_element, __pyx_v_c_href, __pyx_v_c_name);
119049   goto __pyx_L0;
119050
119051   __pyx_r = 0;
119052   __pyx_L0:;
119053   __Pyx_FinishRefcountContext();
119054   return __pyx_r;
119055 }
119056
119057 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":109
119058  *     return _delAttributeFromNsName(c_element, c_href, c_name)
119059  * 
119060  * cdef public api bint hasChild(xmlNode* c_node):             # <<<<<<<<<<<<<<
119061  *     return _hasChild(c_node)
119062  * 
119063  */
119064
119065  DL_EXPORT(int) hasChild(xmlNode *__pyx_v_c_node) {
119066   int __pyx_r;
119067   __Pyx_SetupRefcountContext("hasChild");
119068
119069   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":110
119070  * 
119071  * cdef public api bint hasChild(xmlNode* c_node):
119072  *     return _hasChild(c_node)             # <<<<<<<<<<<<<<
119073  * 
119074  * cdef public api xmlNode* findChild(xmlNode* c_node, Py_ssize_t index):
119075  */
119076   __pyx_r = __pyx_f_4lxml_5etree__hasChild(__pyx_v_c_node);
119077   goto __pyx_L0;
119078
119079   __pyx_r = 0;
119080   __pyx_L0:;
119081   __Pyx_FinishRefcountContext();
119082   return __pyx_r;
119083 }
119084
119085 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":112
119086  *     return _hasChild(c_node)
119087  * 
119088  * cdef public api xmlNode* findChild(xmlNode* c_node, Py_ssize_t index):             # <<<<<<<<<<<<<<
119089  *     return _findChild(c_node, index)
119090  * 
119091  */
119092
119093  DL_EXPORT(xmlNode) *findChild(xmlNode *__pyx_v_c_node, Py_ssize_t __pyx_v_index) {
119094   xmlNode *__pyx_r;
119095   __Pyx_SetupRefcountContext("findChild");
119096
119097   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":113
119098  * 
119099  * cdef public api xmlNode* findChild(xmlNode* c_node, Py_ssize_t index):
119100  *     return _findChild(c_node, index)             # <<<<<<<<<<<<<<
119101  * 
119102  * cdef public api xmlNode* findChildForwards(xmlNode* c_node, Py_ssize_t index):
119103  */
119104   __pyx_r = __pyx_f_4lxml_5etree__findChild(__pyx_v_c_node, __pyx_v_index);
119105   goto __pyx_L0;
119106
119107   __pyx_r = 0;
119108   __pyx_L0:;
119109   __Pyx_FinishRefcountContext();
119110   return __pyx_r;
119111 }
119112
119113 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":115
119114  *     return _findChild(c_node, index)
119115  * 
119116  * cdef public api xmlNode* findChildForwards(xmlNode* c_node, Py_ssize_t index):             # <<<<<<<<<<<<<<
119117  *     return _findChildForwards(c_node, index)
119118  * 
119119  */
119120
119121  DL_EXPORT(xmlNode) *findChildForwards(xmlNode *__pyx_v_c_node, Py_ssize_t __pyx_v_index) {
119122   xmlNode *__pyx_r;
119123   __Pyx_SetupRefcountContext("findChildForwards");
119124
119125   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":116
119126  * 
119127  * cdef public api xmlNode* findChildForwards(xmlNode* c_node, Py_ssize_t index):
119128  *     return _findChildForwards(c_node, index)             # <<<<<<<<<<<<<<
119129  * 
119130  * cdef public api xmlNode* findChildBackwards(xmlNode* c_node, Py_ssize_t index):
119131  */
119132   __pyx_r = __pyx_f_4lxml_5etree__findChildForwards(__pyx_v_c_node, __pyx_v_index);
119133   goto __pyx_L0;
119134
119135   __pyx_r = 0;
119136   __pyx_L0:;
119137   __Pyx_FinishRefcountContext();
119138   return __pyx_r;
119139 }
119140
119141 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":118
119142  *     return _findChildForwards(c_node, index)
119143  * 
119144  * cdef public api xmlNode* findChildBackwards(xmlNode* c_node, Py_ssize_t index):             # <<<<<<<<<<<<<<
119145  *     return _findChildBackwards(c_node, index)
119146  * 
119147  */
119148
119149  DL_EXPORT(xmlNode) *findChildBackwards(xmlNode *__pyx_v_c_node, Py_ssize_t __pyx_v_index) {
119150   xmlNode *__pyx_r;
119151   __Pyx_SetupRefcountContext("findChildBackwards");
119152
119153   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":119
119154  * 
119155  * cdef public api xmlNode* findChildBackwards(xmlNode* c_node, Py_ssize_t index):
119156  *     return _findChildBackwards(c_node, index)             # <<<<<<<<<<<<<<
119157  * 
119158  * cdef public api xmlNode* nextElement(xmlNode* c_node):
119159  */
119160   __pyx_r = __pyx_f_4lxml_5etree__findChildBackwards(__pyx_v_c_node, __pyx_v_index);
119161   goto __pyx_L0;
119162
119163   __pyx_r = 0;
119164   __pyx_L0:;
119165   __Pyx_FinishRefcountContext();
119166   return __pyx_r;
119167 }
119168
119169 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":121
119170  *     return _findChildBackwards(c_node, index)
119171  * 
119172  * cdef public api xmlNode* nextElement(xmlNode* c_node):             # <<<<<<<<<<<<<<
119173  *     return _nextElement(c_node)
119174  * 
119175  */
119176
119177  DL_EXPORT(xmlNode) *nextElement(xmlNode *__pyx_v_c_node) {
119178   xmlNode *__pyx_r;
119179   __Pyx_SetupRefcountContext("nextElement");
119180
119181   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":122
119182  * 
119183  * cdef public api xmlNode* nextElement(xmlNode* c_node):
119184  *     return _nextElement(c_node)             # <<<<<<<<<<<<<<
119185  * 
119186  * cdef public api xmlNode* previousElement(xmlNode* c_node):
119187  */
119188   __pyx_r = __pyx_f_4lxml_5etree__nextElement(__pyx_v_c_node);
119189   goto __pyx_L0;
119190
119191   __pyx_r = 0;
119192   __pyx_L0:;
119193   __Pyx_FinishRefcountContext();
119194   return __pyx_r;
119195 }
119196
119197 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":124
119198  *     return _nextElement(c_node)
119199  * 
119200  * cdef public api xmlNode* previousElement(xmlNode* c_node):             # <<<<<<<<<<<<<<
119201  *     return _previousElement(c_node)
119202  * 
119203  */
119204
119205  DL_EXPORT(xmlNode) *previousElement(xmlNode *__pyx_v_c_node) {
119206   xmlNode *__pyx_r;
119207   __Pyx_SetupRefcountContext("previousElement");
119208
119209   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":125
119210  * 
119211  * cdef public api xmlNode* previousElement(xmlNode* c_node):
119212  *     return _previousElement(c_node)             # <<<<<<<<<<<<<<
119213  * 
119214  * cdef public api void appendChild(_Element parent, _Element child):
119215  */
119216   __pyx_r = __pyx_f_4lxml_5etree__previousElement(__pyx_v_c_node);
119217   goto __pyx_L0;
119218
119219   __pyx_r = 0;
119220   __pyx_L0:;
119221   __Pyx_FinishRefcountContext();
119222   return __pyx_r;
119223 }
119224
119225 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":127
119226  *     return _previousElement(c_node)
119227  * 
119228  * cdef public api void appendChild(_Element parent, _Element child):             # <<<<<<<<<<<<<<
119229  *     _appendChild(parent, child)
119230  * 
119231  */
119232
119233  DL_EXPORT(void) appendChild(struct LxmlElement *__pyx_v_parent, struct LxmlElement *__pyx_v_child) {
119234   int __pyx_t_1;
119235   __Pyx_SetupRefcountContext("appendChild");
119236
119237   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":128
119238  * 
119239  * cdef public api void appendChild(_Element parent, _Element child):
119240  *     _appendChild(parent, child)             # <<<<<<<<<<<<<<
119241  * 
119242  * cdef public api object pyunicode(char* s):
119243  */
119244   __pyx_t_1 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_parent, __pyx_v_child); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
119245
119246   goto __pyx_L0;
119247   __pyx_L1_error:;
119248   __Pyx_WriteUnraisable("lxml.etree.appendChild");
119249   __pyx_L0:;
119250   __Pyx_FinishRefcountContext();
119251 }
119252
119253 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":130
119254  *     _appendChild(parent, child)
119255  * 
119256  * cdef public api object pyunicode(char* s):             # <<<<<<<<<<<<<<
119257  *     if s is NULL:
119258  *         raise TypeError
119259  */
119260
119261  DL_EXPORT(PyObject) *pyunicode(char *__pyx_v_s) {
119262   PyObject *__pyx_r = NULL;
119263   int __pyx_t_1;
119264   PyObject *__pyx_t_2 = NULL;
119265   __Pyx_SetupRefcountContext("pyunicode");
119266
119267   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":131
119268  * 
119269  * cdef public api object pyunicode(char* s):
119270  *     if s is NULL:             # <<<<<<<<<<<<<<
119271  *         raise TypeError
119272  *     return funicode(s)
119273  */
119274   __pyx_t_1 = (__pyx_v_s == NULL);
119275   if (__pyx_t_1) {
119276
119277     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":132
119278  * cdef public api object pyunicode(char* s):
119279  *     if s is NULL:
119280  *         raise TypeError             # <<<<<<<<<<<<<<
119281  *     return funicode(s)
119282  * 
119283  */
119284     __Pyx_Raise(__pyx_builtin_TypeError, 0, 0);
119285     {__pyx_filename = __pyx_f[24]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
119286     goto __pyx_L3;
119287   }
119288   __pyx_L3:;
119289
119290   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":133
119291  *     if s is NULL:
119292  *         raise TypeError
119293  *     return funicode(s)             # <<<<<<<<<<<<<<
119294  * 
119295  * cdef public api object utf8(object s):
119296  */
119297   __Pyx_XDECREF(__pyx_r);
119298   __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_s); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
119299   __Pyx_GOTREF(__pyx_t_2);
119300   __pyx_r = __pyx_t_2;
119301   __pyx_t_2 = 0;
119302   goto __pyx_L0;
119303
119304   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
119305   goto __pyx_L0;
119306   __pyx_L1_error:;
119307   __Pyx_XDECREF(__pyx_t_2);
119308   __Pyx_AddTraceback("lxml.etree.pyunicode");
119309   __pyx_r = 0;
119310   __pyx_L0:;
119311   __Pyx_XGIVEREF(__pyx_r);
119312   __Pyx_FinishRefcountContext();
119313   return __pyx_r;
119314 }
119315
119316 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":135
119317  *     return funicode(s)
119318  * 
119319  * cdef public api object utf8(object s):             # <<<<<<<<<<<<<<
119320  *     return _utf8(s)
119321  * 
119322  */
119323
119324  DL_EXPORT(PyObject) *utf8(PyObject *__pyx_v_s) {
119325   PyObject *__pyx_r = NULL;
119326   PyObject *__pyx_t_1 = NULL;
119327   __Pyx_SetupRefcountContext("utf8");
119328
119329   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":136
119330  * 
119331  * cdef public api object utf8(object s):
119332  *     return _utf8(s)             # <<<<<<<<<<<<<<
119333  * 
119334  * cdef public api object getNsTag(object tag):
119335  */
119336   __Pyx_XDECREF(__pyx_r);
119337   __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_s); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
119338   __Pyx_GOTREF(__pyx_t_1);
119339   __pyx_r = __pyx_t_1;
119340   __pyx_t_1 = 0;
119341   goto __pyx_L0;
119342
119343   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
119344   goto __pyx_L0;
119345   __pyx_L1_error:;
119346   __Pyx_XDECREF(__pyx_t_1);
119347   __Pyx_AddTraceback("lxml.etree.utf8");
119348   __pyx_r = 0;
119349   __pyx_L0:;
119350   __Pyx_XGIVEREF(__pyx_r);
119351   __Pyx_FinishRefcountContext();
119352   return __pyx_r;
119353 }
119354
119355 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":138
119356  *     return _utf8(s)
119357  * 
119358  * cdef public api object getNsTag(object tag):             # <<<<<<<<<<<<<<
119359  *     return _getNsTag(tag)
119360  * 
119361  */
119362
119363  DL_EXPORT(PyObject) *getNsTag(PyObject *__pyx_v_tag) {
119364   PyObject *__pyx_r = NULL;
119365   PyObject *__pyx_t_1 = NULL;
119366   __Pyx_SetupRefcountContext("getNsTag");
119367
119368   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":139
119369  * 
119370  * cdef public api object getNsTag(object tag):
119371  *     return _getNsTag(tag)             # <<<<<<<<<<<<<<
119372  * 
119373  * cdef public api object namespacedName(xmlNode* c_node):
119374  */
119375   __Pyx_XDECREF(__pyx_r);
119376   __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_tag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
119377   __Pyx_GOTREF(__pyx_t_1);
119378   __pyx_r = __pyx_t_1;
119379   __pyx_t_1 = 0;
119380   goto __pyx_L0;
119381
119382   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
119383   goto __pyx_L0;
119384   __pyx_L1_error:;
119385   __Pyx_XDECREF(__pyx_t_1);
119386   __Pyx_AddTraceback("lxml.etree.getNsTag");
119387   __pyx_r = 0;
119388   __pyx_L0:;
119389   __Pyx_XGIVEREF(__pyx_r);
119390   __Pyx_FinishRefcountContext();
119391   return __pyx_r;
119392 }
119393
119394 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":141
119395  *     return _getNsTag(tag)
119396  * 
119397  * cdef public api object namespacedName(xmlNode* c_node):             # <<<<<<<<<<<<<<
119398  *     return _namespacedName(c_node)
119399  * 
119400  */
119401
119402  DL_EXPORT(PyObject) *namespacedName(xmlNode *__pyx_v_c_node) {
119403   PyObject *__pyx_r = NULL;
119404   PyObject *__pyx_t_1 = NULL;
119405   __Pyx_SetupRefcountContext("namespacedName");
119406
119407   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":142
119408  * 
119409  * cdef public api object namespacedName(xmlNode* c_node):
119410  *     return _namespacedName(c_node)             # <<<<<<<<<<<<<<
119411  * 
119412  * cdef public api object namespacedNameFromNsName(char* href, char* name):
119413  */
119414   __Pyx_XDECREF(__pyx_r);
119415   __pyx_t_1 = __pyx_f_4lxml_5etree__namespacedName(__pyx_v_c_node); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
119416   __Pyx_GOTREF(__pyx_t_1);
119417   __pyx_r = __pyx_t_1;
119418   __pyx_t_1 = 0;
119419   goto __pyx_L0;
119420
119421   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
119422   goto __pyx_L0;
119423   __pyx_L1_error:;
119424   __Pyx_XDECREF(__pyx_t_1);
119425   __Pyx_AddTraceback("lxml.etree.namespacedName");
119426   __pyx_r = 0;
119427   __pyx_L0:;
119428   __Pyx_XGIVEREF(__pyx_r);
119429   __Pyx_FinishRefcountContext();
119430   return __pyx_r;
119431 }
119432
119433 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":144
119434  *     return _namespacedName(c_node)
119435  * 
119436  * cdef public api object namespacedNameFromNsName(char* href, char* name):             # <<<<<<<<<<<<<<
119437  *     return _namespacedNameFromNsName(href, name)
119438  * 
119439  */
119440
119441  DL_EXPORT(PyObject) *namespacedNameFromNsName(char *__pyx_v_href, char *__pyx_v_name) {
119442   PyObject *__pyx_r = NULL;
119443   PyObject *__pyx_t_1 = NULL;
119444   __Pyx_SetupRefcountContext("namespacedNameFromNsName");
119445
119446   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":145
119447  * 
119448  * cdef public api object namespacedNameFromNsName(char* href, char* name):
119449  *     return _namespacedNameFromNsName(href, name)             # <<<<<<<<<<<<<<
119450  * 
119451  * cdef public api void iteratorStoreNext(_ElementIterator iterator, _Element node):
119452  */
119453   __Pyx_XDECREF(__pyx_r);
119454   __pyx_t_1 = __pyx_f_4lxml_5etree__namespacedNameFromNsName(__pyx_v_href, __pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
119455   __Pyx_GOTREF(__pyx_t_1);
119456   __pyx_r = __pyx_t_1;
119457   __pyx_t_1 = 0;
119458   goto __pyx_L0;
119459
119460   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
119461   goto __pyx_L0;
119462   __pyx_L1_error:;
119463   __Pyx_XDECREF(__pyx_t_1);
119464   __Pyx_AddTraceback("lxml.etree.namespacedNameFromNsName");
119465   __pyx_r = 0;
119466   __pyx_L0:;
119467   __Pyx_XGIVEREF(__pyx_r);
119468   __Pyx_FinishRefcountContext();
119469   return __pyx_r;
119470 }
119471
119472 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":147
119473  *     return _namespacedNameFromNsName(href, name)
119474  * 
119475  * cdef public api void iteratorStoreNext(_ElementIterator iterator, _Element node):             # <<<<<<<<<<<<<<
119476  *     iterator._storeNext(node)
119477  * 
119478  */
119479
119480  DL_EXPORT(void) iteratorStoreNext(struct LxmlElementIterator *__pyx_v_iterator, struct LxmlElement *__pyx_v_node) {
119481   __Pyx_SetupRefcountContext("iteratorStoreNext");
119482
119483   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":148
119484  * 
119485  * cdef public api void iteratorStoreNext(_ElementIterator iterator, _Element node):
119486  *     iterator._storeNext(node)             # <<<<<<<<<<<<<<
119487  * 
119488  * cdef public api void initTagMatch(_ElementTagMatcher matcher, tag):
119489  */
119490   ((struct __pyx_vtabstruct_4lxml_5etree__ElementIterator *)__pyx_v_iterator->__pyx_base.__pyx_vtab)->_storeNext(__pyx_v_iterator, __pyx_v_node);
119491
119492   __Pyx_FinishRefcountContext();
119493 }
119494
119495 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":150
119496  *     iterator._storeNext(node)
119497  * 
119498  * cdef public api void initTagMatch(_ElementTagMatcher matcher, tag):             # <<<<<<<<<<<<<<
119499  *     matcher._initTagMatch(tag)
119500  * 
119501  */
119502
119503  DL_EXPORT(void) initTagMatch(struct LxmlElementTagMatcher *__pyx_v_matcher, PyObject *__pyx_v_tag) {
119504   PyObject *__pyx_t_1 = NULL;
119505   __Pyx_SetupRefcountContext("initTagMatch");
119506
119507   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":151
119508  * 
119509  * cdef public api void initTagMatch(_ElementTagMatcher matcher, tag):
119510  *     matcher._initTagMatch(tag)             # <<<<<<<<<<<<<<
119511  * 
119512  * cdef public api tree.xmlNs* findOrBuildNodeNsPrefix(
119513  */
119514   __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ElementTagMatcher *)__pyx_v_matcher->__pyx_vtab)->_initTagMatch(__pyx_v_matcher, __pyx_v_tag); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
119515   __Pyx_GOTREF(__pyx_t_1);
119516   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
119517
119518   goto __pyx_L0;
119519   __pyx_L1_error:;
119520   __Pyx_XDECREF(__pyx_t_1);
119521   __Pyx_WriteUnraisable("lxml.etree.initTagMatch");
119522   __pyx_L0:;
119523   __Pyx_FinishRefcountContext();
119524 }
119525
119526 /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":153
119527  *     matcher._initTagMatch(tag)
119528  * 
119529  * cdef public api tree.xmlNs* findOrBuildNodeNsPrefix(             # <<<<<<<<<<<<<<
119530  *     _Document doc, xmlNode* c_node, char* href, char* prefix) except NULL:
119531  *     if doc is None:
119532  */
119533
119534  DL_EXPORT(xmlNs) *findOrBuildNodeNsPrefix(struct LxmlDocument *__pyx_v_doc, xmlNode *__pyx_v_c_node, char *__pyx_v_href, char *__pyx_v_prefix) {
119535   xmlNs *__pyx_r;
119536   int __pyx_t_1;
119537   xmlNs *__pyx_t_2;
119538   __Pyx_SetupRefcountContext("findOrBuildNodeNsPrefix");
119539
119540   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":155
119541  * cdef public api tree.xmlNs* findOrBuildNodeNsPrefix(
119542  *     _Document doc, xmlNode* c_node, char* href, char* prefix) except NULL:
119543  *     if doc is None:             # <<<<<<<<<<<<<<
119544  *         raise TypeError
119545  *     return doc._findOrBuildNodeNs(c_node, href, prefix)
119546  */
119547   __pyx_t_1 = (((PyObject *)__pyx_v_doc) == Py_None);
119548   if (__pyx_t_1) {
119549
119550     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":156
119551  *     _Document doc, xmlNode* c_node, char* href, char* prefix) except NULL:
119552  *     if doc is None:
119553  *         raise TypeError             # <<<<<<<<<<<<<<
119554  *     return doc._findOrBuildNodeNs(c_node, href, prefix)
119555  */
119556     __Pyx_Raise(__pyx_builtin_TypeError, 0, 0);
119557     {__pyx_filename = __pyx_f[24]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
119558     goto __pyx_L3;
119559   }
119560   __pyx_L3:;
119561
119562   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/public-api.pxi":157
119563  *     if doc is None:
119564  *         raise TypeError
119565  *     return doc._findOrBuildNodeNs(c_node, href, prefix)             # <<<<<<<<<<<<<<
119566  */
119567   __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_doc->__pyx_vtab)->_findOrBuildNodeNs(__pyx_v_doc, __pyx_v_c_node, __pyx_v_href, __pyx_v_prefix); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[24]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
119568   __pyx_r = __pyx_t_2;
119569   goto __pyx_L0;
119570
119571   __pyx_r = 0;
119572   goto __pyx_L0;
119573   __pyx_L1_error:;
119574   __Pyx_AddTraceback("lxml.etree.findOrBuildNodeNsPrefix");
119575   __pyx_r = NULL;
119576   __pyx_L0:;
119577   __Pyx_FinishRefcountContext();
119578   return __pyx_r;
119579 }
119580 static struct __pyx_vtabstruct_4lxml_5etree__TempStore __pyx_vtable_4lxml_5etree__TempStore;
119581
119582 static PyObject *__pyx_tp_new_4lxml_5etree__TempStore(PyTypeObject *t, PyObject *a, PyObject *k) {
119583   struct __pyx_obj_4lxml_5etree__TempStore *p;
119584   PyObject *o = (*t->tp_alloc)(t, 0);
119585   if (!o) return 0;
119586   p = ((struct __pyx_obj_4lxml_5etree__TempStore *)o);
119587   p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__TempStore;
119588   p->_storage = ((PyObject *)Py_None); Py_INCREF(Py_None);
119589   return o;
119590 }
119591
119592 static void __pyx_tp_dealloc_4lxml_5etree__TempStore(PyObject *o) {
119593   struct __pyx_obj_4lxml_5etree__TempStore *p = (struct __pyx_obj_4lxml_5etree__TempStore *)o;
119594   Py_XDECREF(((PyObject *)p->_storage));
119595   (*Py_TYPE(o)->tp_free)(o);
119596 }
119597
119598 static int __pyx_tp_traverse_4lxml_5etree__TempStore(PyObject *o, visitproc v, void *a) {
119599   int e;
119600   struct __pyx_obj_4lxml_5etree__TempStore *p = (struct __pyx_obj_4lxml_5etree__TempStore *)o;
119601   if (p->_storage) {
119602     e = (*v)(p->_storage, a); if (e) return e;
119603   }
119604   return 0;
119605 }
119606
119607 static int __pyx_tp_clear_4lxml_5etree__TempStore(PyObject *o) {
119608   struct __pyx_obj_4lxml_5etree__TempStore *p = (struct __pyx_obj_4lxml_5etree__TempStore *)o;
119609   PyObject* tmp;
119610   tmp = ((PyObject*)p->_storage);
119611   p->_storage = ((PyObject *)Py_None); Py_INCREF(Py_None);
119612   Py_XDECREF(tmp);
119613   return 0;
119614 }
119615
119616 static struct PyMethodDef __pyx_methods_4lxml_5etree__TempStore[] = {
119617   {0, 0, 0, 0}
119618 };
119619
119620 static PyNumberMethods __pyx_tp_as_number__TempStore = {
119621   0, /*nb_add*/
119622   0, /*nb_subtract*/
119623   0, /*nb_multiply*/
119624   #if PY_MAJOR_VERSION < 3
119625   0, /*nb_divide*/
119626   #endif
119627   0, /*nb_remainder*/
119628   0, /*nb_divmod*/
119629   0, /*nb_power*/
119630   0, /*nb_negative*/
119631   0, /*nb_positive*/
119632   0, /*nb_absolute*/
119633   0, /*nb_nonzero*/
119634   0, /*nb_invert*/
119635   0, /*nb_lshift*/
119636   0, /*nb_rshift*/
119637   0, /*nb_and*/
119638   0, /*nb_xor*/
119639   0, /*nb_or*/
119640   #if PY_MAJOR_VERSION < 3
119641   0, /*nb_coerce*/
119642   #endif
119643   0, /*nb_int*/
119644   #if PY_MAJOR_VERSION >= 3
119645   0, /*reserved*/
119646   #else
119647   0, /*nb_long*/
119648   #endif
119649   0, /*nb_float*/
119650   #if PY_MAJOR_VERSION < 3
119651   0, /*nb_oct*/
119652   #endif
119653   #if PY_MAJOR_VERSION < 3
119654   0, /*nb_hex*/
119655   #endif
119656   0, /*nb_inplace_add*/
119657   0, /*nb_inplace_subtract*/
119658   0, /*nb_inplace_multiply*/
119659   #if PY_MAJOR_VERSION < 3
119660   0, /*nb_inplace_divide*/
119661   #endif
119662   0, /*nb_inplace_remainder*/
119663   0, /*nb_inplace_power*/
119664   0, /*nb_inplace_lshift*/
119665   0, /*nb_inplace_rshift*/
119666   0, /*nb_inplace_and*/
119667   0, /*nb_inplace_xor*/
119668   0, /*nb_inplace_or*/
119669   0, /*nb_floor_divide*/
119670   0, /*nb_true_divide*/
119671   0, /*nb_inplace_floor_divide*/
119672   0, /*nb_inplace_true_divide*/
119673   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
119674   0, /*nb_index*/
119675   #endif
119676 };
119677
119678 static PySequenceMethods __pyx_tp_as_sequence__TempStore = {
119679   0, /*sq_length*/
119680   0, /*sq_concat*/
119681   0, /*sq_repeat*/
119682   0, /*sq_item*/
119683   0, /*sq_slice*/
119684   0, /*sq_ass_item*/
119685   0, /*sq_ass_slice*/
119686   0, /*sq_contains*/
119687   0, /*sq_inplace_concat*/
119688   0, /*sq_inplace_repeat*/
119689 };
119690
119691 static PyMappingMethods __pyx_tp_as_mapping__TempStore = {
119692   0, /*mp_length*/
119693   0, /*mp_subscript*/
119694   0, /*mp_ass_subscript*/
119695 };
119696
119697 static PyBufferProcs __pyx_tp_as_buffer__TempStore = {
119698   #if PY_MAJOR_VERSION < 3
119699   0, /*bf_getreadbuffer*/
119700   #endif
119701   #if PY_MAJOR_VERSION < 3
119702   0, /*bf_getwritebuffer*/
119703   #endif
119704   #if PY_MAJOR_VERSION < 3
119705   0, /*bf_getsegcount*/
119706   #endif
119707   #if PY_MAJOR_VERSION < 3
119708   0, /*bf_getcharbuffer*/
119709   #endif
119710   #if PY_VERSION_HEX >= 0x02060000
119711   0, /*bf_getbuffer*/
119712   #endif
119713   #if PY_VERSION_HEX >= 0x02060000
119714   0, /*bf_releasebuffer*/
119715   #endif
119716 };
119717
119718 PyTypeObject __pyx_type_4lxml_5etree__TempStore = {
119719   PyVarObject_HEAD_INIT(0, 0)
119720   __Pyx_NAMESTR("lxml.etree._TempStore"), /*tp_name*/
119721   sizeof(struct __pyx_obj_4lxml_5etree__TempStore), /*tp_basicsize*/
119722   0, /*tp_itemsize*/
119723   __pyx_tp_dealloc_4lxml_5etree__TempStore, /*tp_dealloc*/
119724   0, /*tp_print*/
119725   0, /*tp_getattr*/
119726   0, /*tp_setattr*/
119727   0, /*tp_compare*/
119728   0, /*tp_repr*/
119729   &__pyx_tp_as_number__TempStore, /*tp_as_number*/
119730   &__pyx_tp_as_sequence__TempStore, /*tp_as_sequence*/
119731   &__pyx_tp_as_mapping__TempStore, /*tp_as_mapping*/
119732   0, /*tp_hash*/
119733   0, /*tp_call*/
119734   0, /*tp_str*/
119735   0, /*tp_getattro*/
119736   0, /*tp_setattro*/
119737   &__pyx_tp_as_buffer__TempStore, /*tp_as_buffer*/
119738   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
119739   0, /*tp_doc*/
119740   __pyx_tp_traverse_4lxml_5etree__TempStore, /*tp_traverse*/
119741   __pyx_tp_clear_4lxml_5etree__TempStore, /*tp_clear*/
119742   0, /*tp_richcompare*/
119743   0, /*tp_weaklistoffset*/
119744   0, /*tp_iter*/
119745   0, /*tp_iternext*/
119746   __pyx_methods_4lxml_5etree__TempStore, /*tp_methods*/
119747   0, /*tp_members*/
119748   0, /*tp_getset*/
119749   0, /*tp_base*/
119750   0, /*tp_dict*/
119751   0, /*tp_descr_get*/
119752   0, /*tp_descr_set*/
119753   0, /*tp_dictoffset*/
119754   __pyx_pf_4lxml_5etree_10_TempStore___init__, /*tp_init*/
119755   0, /*tp_alloc*/
119756   __pyx_tp_new_4lxml_5etree__TempStore, /*tp_new*/
119757   0, /*tp_free*/
119758   0, /*tp_is_gc*/
119759   0, /*tp_bases*/
119760   0, /*tp_mro*/
119761   0, /*tp_cache*/
119762   0, /*tp_subclasses*/
119763   0, /*tp_weaklist*/
119764 };
119765 static struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext __pyx_vtable_4lxml_5etree__ExceptionContext;
119766
119767 static PyObject *__pyx_tp_new_4lxml_5etree__ExceptionContext(PyTypeObject *t, PyObject *a, PyObject *k) {
119768   struct __pyx_obj_4lxml_5etree__ExceptionContext *p;
119769   PyObject *o = (*t->tp_alloc)(t, 0);
119770   if (!o) return 0;
119771   p = ((struct __pyx_obj_4lxml_5etree__ExceptionContext *)o);
119772   p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__ExceptionContext;
119773   p->_exc_info = Py_None; Py_INCREF(Py_None);
119774   return o;
119775 }
119776
119777 static void __pyx_tp_dealloc_4lxml_5etree__ExceptionContext(PyObject *o) {
119778   struct __pyx_obj_4lxml_5etree__ExceptionContext *p = (struct __pyx_obj_4lxml_5etree__ExceptionContext *)o;
119779   Py_XDECREF(p->_exc_info);
119780   (*Py_TYPE(o)->tp_free)(o);
119781 }
119782
119783 static int __pyx_tp_traverse_4lxml_5etree__ExceptionContext(PyObject *o, visitproc v, void *a) {
119784   int e;
119785   struct __pyx_obj_4lxml_5etree__ExceptionContext *p = (struct __pyx_obj_4lxml_5etree__ExceptionContext *)o;
119786   if (p->_exc_info) {
119787     e = (*v)(p->_exc_info, a); if (e) return e;
119788   }
119789   return 0;
119790 }
119791
119792 static int __pyx_tp_clear_4lxml_5etree__ExceptionContext(PyObject *o) {
119793   struct __pyx_obj_4lxml_5etree__ExceptionContext *p = (struct __pyx_obj_4lxml_5etree__ExceptionContext *)o;
119794   PyObject* tmp;
119795   tmp = ((PyObject*)p->_exc_info);
119796   p->_exc_info = Py_None; Py_INCREF(Py_None);
119797   Py_XDECREF(tmp);
119798   return 0;
119799 }
119800
119801 static struct PyMethodDef __pyx_methods_4lxml_5etree__ExceptionContext[] = {
119802   {0, 0, 0, 0}
119803 };
119804
119805 static PyNumberMethods __pyx_tp_as_number__ExceptionContext = {
119806   0, /*nb_add*/
119807   0, /*nb_subtract*/
119808   0, /*nb_multiply*/
119809   #if PY_MAJOR_VERSION < 3
119810   0, /*nb_divide*/
119811   #endif
119812   0, /*nb_remainder*/
119813   0, /*nb_divmod*/
119814   0, /*nb_power*/
119815   0, /*nb_negative*/
119816   0, /*nb_positive*/
119817   0, /*nb_absolute*/
119818   0, /*nb_nonzero*/
119819   0, /*nb_invert*/
119820   0, /*nb_lshift*/
119821   0, /*nb_rshift*/
119822   0, /*nb_and*/
119823   0, /*nb_xor*/
119824   0, /*nb_or*/
119825   #if PY_MAJOR_VERSION < 3
119826   0, /*nb_coerce*/
119827   #endif
119828   0, /*nb_int*/
119829   #if PY_MAJOR_VERSION >= 3
119830   0, /*reserved*/
119831   #else
119832   0, /*nb_long*/
119833   #endif
119834   0, /*nb_float*/
119835   #if PY_MAJOR_VERSION < 3
119836   0, /*nb_oct*/
119837   #endif
119838   #if PY_MAJOR_VERSION < 3
119839   0, /*nb_hex*/
119840   #endif
119841   0, /*nb_inplace_add*/
119842   0, /*nb_inplace_subtract*/
119843   0, /*nb_inplace_multiply*/
119844   #if PY_MAJOR_VERSION < 3
119845   0, /*nb_inplace_divide*/
119846   #endif
119847   0, /*nb_inplace_remainder*/
119848   0, /*nb_inplace_power*/
119849   0, /*nb_inplace_lshift*/
119850   0, /*nb_inplace_rshift*/
119851   0, /*nb_inplace_and*/
119852   0, /*nb_inplace_xor*/
119853   0, /*nb_inplace_or*/
119854   0, /*nb_floor_divide*/
119855   0, /*nb_true_divide*/
119856   0, /*nb_inplace_floor_divide*/
119857   0, /*nb_inplace_true_divide*/
119858   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
119859   0, /*nb_index*/
119860   #endif
119861 };
119862
119863 static PySequenceMethods __pyx_tp_as_sequence__ExceptionContext = {
119864   0, /*sq_length*/
119865   0, /*sq_concat*/
119866   0, /*sq_repeat*/
119867   0, /*sq_item*/
119868   0, /*sq_slice*/
119869   0, /*sq_ass_item*/
119870   0, /*sq_ass_slice*/
119871   0, /*sq_contains*/
119872   0, /*sq_inplace_concat*/
119873   0, /*sq_inplace_repeat*/
119874 };
119875
119876 static PyMappingMethods __pyx_tp_as_mapping__ExceptionContext = {
119877   0, /*mp_length*/
119878   0, /*mp_subscript*/
119879   0, /*mp_ass_subscript*/
119880 };
119881
119882 static PyBufferProcs __pyx_tp_as_buffer__ExceptionContext = {
119883   #if PY_MAJOR_VERSION < 3
119884   0, /*bf_getreadbuffer*/
119885   #endif
119886   #if PY_MAJOR_VERSION < 3
119887   0, /*bf_getwritebuffer*/
119888   #endif
119889   #if PY_MAJOR_VERSION < 3
119890   0, /*bf_getsegcount*/
119891   #endif
119892   #if PY_MAJOR_VERSION < 3
119893   0, /*bf_getcharbuffer*/
119894   #endif
119895   #if PY_VERSION_HEX >= 0x02060000
119896   0, /*bf_getbuffer*/
119897   #endif
119898   #if PY_VERSION_HEX >= 0x02060000
119899   0, /*bf_releasebuffer*/
119900   #endif
119901 };
119902
119903 PyTypeObject __pyx_type_4lxml_5etree__ExceptionContext = {
119904   PyVarObject_HEAD_INIT(0, 0)
119905   __Pyx_NAMESTR("lxml.etree._ExceptionContext"), /*tp_name*/
119906   sizeof(struct __pyx_obj_4lxml_5etree__ExceptionContext), /*tp_basicsize*/
119907   0, /*tp_itemsize*/
119908   __pyx_tp_dealloc_4lxml_5etree__ExceptionContext, /*tp_dealloc*/
119909   0, /*tp_print*/
119910   0, /*tp_getattr*/
119911   0, /*tp_setattr*/
119912   0, /*tp_compare*/
119913   0, /*tp_repr*/
119914   &__pyx_tp_as_number__ExceptionContext, /*tp_as_number*/
119915   &__pyx_tp_as_sequence__ExceptionContext, /*tp_as_sequence*/
119916   &__pyx_tp_as_mapping__ExceptionContext, /*tp_as_mapping*/
119917   0, /*tp_hash*/
119918   0, /*tp_call*/
119919   0, /*tp_str*/
119920   0, /*tp_getattro*/
119921   0, /*tp_setattro*/
119922   &__pyx_tp_as_buffer__ExceptionContext, /*tp_as_buffer*/
119923   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
119924   0, /*tp_doc*/
119925   __pyx_tp_traverse_4lxml_5etree__ExceptionContext, /*tp_traverse*/
119926   __pyx_tp_clear_4lxml_5etree__ExceptionContext, /*tp_clear*/
119927   0, /*tp_richcompare*/
119928   0, /*tp_weaklistoffset*/
119929   0, /*tp_iter*/
119930   0, /*tp_iternext*/
119931   __pyx_methods_4lxml_5etree__ExceptionContext, /*tp_methods*/
119932   0, /*tp_members*/
119933   0, /*tp_getset*/
119934   0, /*tp_base*/
119935   0, /*tp_dict*/
119936   0, /*tp_descr_get*/
119937   0, /*tp_descr_set*/
119938   0, /*tp_dictoffset*/
119939   0, /*tp_init*/
119940   0, /*tp_alloc*/
119941   __pyx_tp_new_4lxml_5etree__ExceptionContext, /*tp_new*/
119942   0, /*tp_free*/
119943   0, /*tp_is_gc*/
119944   0, /*tp_bases*/
119945   0, /*tp_mro*/
119946   0, /*tp_cache*/
119947   0, /*tp_subclasses*/
119948   0, /*tp_weaklist*/
119949 };
119950 static struct __pyx_vtabstruct_4lxml_5etree__Document __pyx_vtable_4lxml_5etree__Document;
119951
119952 static PyObject *__pyx_tp_new_4lxml_5etree__Document(PyTypeObject *t, PyObject *a, PyObject *k) {
119953   struct LxmlDocument *p;
119954   PyObject *o = (*t->tp_alloc)(t, 0);
119955   if (!o) return 0;
119956   p = ((struct LxmlDocument *)o);
119957   p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__Document;
119958   p->_prefix_tail = Py_None; Py_INCREF(Py_None);
119959   p->_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);
119960   return o;
119961 }
119962
119963 static void __pyx_tp_dealloc_4lxml_5etree__Document(PyObject *o) {
119964   struct LxmlDocument *p = (struct LxmlDocument *)o;
119965   {
119966     PyObject *etype, *eval, *etb;
119967     PyErr_Fetch(&etype, &eval, &etb);
119968     ++Py_REFCNT(o);
119969     __pyx_pf_4lxml_5etree_9_Document___dealloc__(o);
119970     if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
119971     --Py_REFCNT(o);
119972     PyErr_Restore(etype, eval, etb);
119973   }
119974   Py_XDECREF(p->_prefix_tail);
119975   Py_XDECREF(((PyObject *)p->_parser));
119976   (*Py_TYPE(o)->tp_free)(o);
119977 }
119978
119979 static int __pyx_tp_traverse_4lxml_5etree__Document(PyObject *o, visitproc v, void *a) {
119980   int e;
119981   struct LxmlDocument *p = (struct LxmlDocument *)o;
119982   if (p->_prefix_tail) {
119983     e = (*v)(p->_prefix_tail, a); if (e) return e;
119984   }
119985   if (p->_parser) {
119986     e = (*v)(((PyObject*)p->_parser), a); if (e) return e;
119987   }
119988   return 0;
119989 }
119990
119991 static int __pyx_tp_clear_4lxml_5etree__Document(PyObject *o) {
119992   struct LxmlDocument *p = (struct LxmlDocument *)o;
119993   PyObject* tmp;
119994   tmp = ((PyObject*)p->_prefix_tail);
119995   p->_prefix_tail = Py_None; Py_INCREF(Py_None);
119996   Py_XDECREF(tmp);
119997   tmp = ((PyObject*)p->_parser);
119998   p->_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);
119999   Py_XDECREF(tmp);
120000   return 0;
120001 }
120002
120003 static struct PyMethodDef __pyx_methods_4lxml_5etree__Document[] = {
120004   {0, 0, 0, 0}
120005 };
120006
120007 static PyNumberMethods __pyx_tp_as_number__Document = {
120008   0, /*nb_add*/
120009   0, /*nb_subtract*/
120010   0, /*nb_multiply*/
120011   #if PY_MAJOR_VERSION < 3
120012   0, /*nb_divide*/
120013   #endif
120014   0, /*nb_remainder*/
120015   0, /*nb_divmod*/
120016   0, /*nb_power*/
120017   0, /*nb_negative*/
120018   0, /*nb_positive*/
120019   0, /*nb_absolute*/
120020   0, /*nb_nonzero*/
120021   0, /*nb_invert*/
120022   0, /*nb_lshift*/
120023   0, /*nb_rshift*/
120024   0, /*nb_and*/
120025   0, /*nb_xor*/
120026   0, /*nb_or*/
120027   #if PY_MAJOR_VERSION < 3
120028   0, /*nb_coerce*/
120029   #endif
120030   0, /*nb_int*/
120031   #if PY_MAJOR_VERSION >= 3
120032   0, /*reserved*/
120033   #else
120034   0, /*nb_long*/
120035   #endif
120036   0, /*nb_float*/
120037   #if PY_MAJOR_VERSION < 3
120038   0, /*nb_oct*/
120039   #endif
120040   #if PY_MAJOR_VERSION < 3
120041   0, /*nb_hex*/
120042   #endif
120043   0, /*nb_inplace_add*/
120044   0, /*nb_inplace_subtract*/
120045   0, /*nb_inplace_multiply*/
120046   #if PY_MAJOR_VERSION < 3
120047   0, /*nb_inplace_divide*/
120048   #endif
120049   0, /*nb_inplace_remainder*/
120050   0, /*nb_inplace_power*/
120051   0, /*nb_inplace_lshift*/
120052   0, /*nb_inplace_rshift*/
120053   0, /*nb_inplace_and*/
120054   0, /*nb_inplace_xor*/
120055   0, /*nb_inplace_or*/
120056   0, /*nb_floor_divide*/
120057   0, /*nb_true_divide*/
120058   0, /*nb_inplace_floor_divide*/
120059   0, /*nb_inplace_true_divide*/
120060   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
120061   0, /*nb_index*/
120062   #endif
120063 };
120064
120065 static PySequenceMethods __pyx_tp_as_sequence__Document = {
120066   0, /*sq_length*/
120067   0, /*sq_concat*/
120068   0, /*sq_repeat*/
120069   0, /*sq_item*/
120070   0, /*sq_slice*/
120071   0, /*sq_ass_item*/
120072   0, /*sq_ass_slice*/
120073   0, /*sq_contains*/
120074   0, /*sq_inplace_concat*/
120075   0, /*sq_inplace_repeat*/
120076 };
120077
120078 static PyMappingMethods __pyx_tp_as_mapping__Document = {
120079   0, /*mp_length*/
120080   0, /*mp_subscript*/
120081   0, /*mp_ass_subscript*/
120082 };
120083
120084 static PyBufferProcs __pyx_tp_as_buffer__Document = {
120085   #if PY_MAJOR_VERSION < 3
120086   0, /*bf_getreadbuffer*/
120087   #endif
120088   #if PY_MAJOR_VERSION < 3
120089   0, /*bf_getwritebuffer*/
120090   #endif
120091   #if PY_MAJOR_VERSION < 3
120092   0, /*bf_getsegcount*/
120093   #endif
120094   #if PY_MAJOR_VERSION < 3
120095   0, /*bf_getcharbuffer*/
120096   #endif
120097   #if PY_VERSION_HEX >= 0x02060000
120098   0, /*bf_getbuffer*/
120099   #endif
120100   #if PY_VERSION_HEX >= 0x02060000
120101   0, /*bf_releasebuffer*/
120102   #endif
120103 };
120104
120105 DL_EXPORT(PyTypeObject) LxmlDocumentType = {
120106   PyVarObject_HEAD_INIT(0, 0)
120107   __Pyx_NAMESTR("lxml.etree._Document"), /*tp_name*/
120108   sizeof(struct LxmlDocument), /*tp_basicsize*/
120109   0, /*tp_itemsize*/
120110   __pyx_tp_dealloc_4lxml_5etree__Document, /*tp_dealloc*/
120111   0, /*tp_print*/
120112   0, /*tp_getattr*/
120113   0, /*tp_setattr*/
120114   0, /*tp_compare*/
120115   0, /*tp_repr*/
120116   &__pyx_tp_as_number__Document, /*tp_as_number*/
120117   &__pyx_tp_as_sequence__Document, /*tp_as_sequence*/
120118   &__pyx_tp_as_mapping__Document, /*tp_as_mapping*/
120119   0, /*tp_hash*/
120120   0, /*tp_call*/
120121   0, /*tp_str*/
120122   0, /*tp_getattro*/
120123   0, /*tp_setattro*/
120124   &__pyx_tp_as_buffer__Document, /*tp_as_buffer*/
120125   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
120126   __Pyx_DOCSTR("Internal base class to reference a libxml document.\n\n    When instances of this class are garbage collected, the libxml\n    document is cleaned up.\n    "), /*tp_doc*/
120127   __pyx_tp_traverse_4lxml_5etree__Document, /*tp_traverse*/
120128   __pyx_tp_clear_4lxml_5etree__Document, /*tp_clear*/
120129   0, /*tp_richcompare*/
120130   0, /*tp_weaklistoffset*/
120131   0, /*tp_iter*/
120132   0, /*tp_iternext*/
120133   __pyx_methods_4lxml_5etree__Document, /*tp_methods*/
120134   0, /*tp_members*/
120135   0, /*tp_getset*/
120136   0, /*tp_base*/
120137   0, /*tp_dict*/
120138   0, /*tp_descr_get*/
120139   0, /*tp_descr_set*/
120140   0, /*tp_dictoffset*/
120141   0, /*tp_init*/
120142   0, /*tp_alloc*/
120143   __pyx_tp_new_4lxml_5etree__Document, /*tp_new*/
120144   0, /*tp_free*/
120145   0, /*tp_is_gc*/
120146   0, /*tp_bases*/
120147   0, /*tp_mro*/
120148   0, /*tp_cache*/
120149   0, /*tp_subclasses*/
120150   0, /*tp_weaklist*/
120151 };
120152
120153 static PyObject *__pyx_tp_new_4lxml_5etree__Element(PyTypeObject *t, PyObject *a, PyObject *k) {
120154   struct LxmlElement *p;
120155   PyObject *o = (*t->tp_alloc)(t, 0);
120156   if (!o) return 0;
120157   p = ((struct LxmlElement *)o);
120158   p->_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
120159   p->_tag = Py_None; Py_INCREF(Py_None);
120160   p->_attrib = Py_None; Py_INCREF(Py_None);
120161   return o;
120162 }
120163
120164 static void __pyx_tp_dealloc_4lxml_5etree__Element(PyObject *o) {
120165   struct LxmlElement *p = (struct LxmlElement *)o;
120166   {
120167     PyObject *etype, *eval, *etb;
120168     PyErr_Fetch(&etype, &eval, &etb);
120169     ++Py_REFCNT(o);
120170     __pyx_pf_4lxml_5etree_8_Element___dealloc__(o);
120171     if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
120172     --Py_REFCNT(o);
120173     PyErr_Restore(etype, eval, etb);
120174   }
120175   Py_XDECREF(((PyObject *)p->_doc));
120176   Py_XDECREF(p->_tag);
120177   Py_XDECREF(p->_attrib);
120178   (*Py_TYPE(o)->tp_free)(o);
120179 }
120180
120181 static int __pyx_tp_traverse_4lxml_5etree__Element(PyObject *o, visitproc v, void *a) {
120182   int e;
120183   struct LxmlElement *p = (struct LxmlElement *)o;
120184   if (p->_doc) {
120185     e = (*v)(((PyObject*)p->_doc), a); if (e) return e;
120186   }
120187   if (p->_tag) {
120188     e = (*v)(p->_tag, a); if (e) return e;
120189   }
120190   if (p->_attrib) {
120191     e = (*v)(p->_attrib, a); if (e) return e;
120192   }
120193   return 0;
120194 }
120195
120196 static int __pyx_tp_clear_4lxml_5etree__Element(PyObject *o) {
120197   struct LxmlElement *p = (struct LxmlElement *)o;
120198   PyObject* tmp;
120199   tmp = ((PyObject*)p->_doc);
120200   p->_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
120201   Py_XDECREF(tmp);
120202   tmp = ((PyObject*)p->_tag);
120203   p->_tag = Py_None; Py_INCREF(Py_None);
120204   Py_XDECREF(tmp);
120205   tmp = ((PyObject*)p->_attrib);
120206   p->_attrib = Py_None; Py_INCREF(Py_None);
120207   Py_XDECREF(tmp);
120208   return 0;
120209 }
120210 static PyObject *__pyx_sq_item_4lxml_5etree__Element(PyObject *o, Py_ssize_t i) {
120211   PyObject *r;
120212   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
120213   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
120214   Py_DECREF(x);
120215   return r;
120216 }
120217
120218 static int __pyx_mp_ass_subscript_4lxml_5etree__Element(PyObject *o, PyObject *i, PyObject *v) {
120219   if (v) {
120220     return __pyx_pf_4lxml_5etree_8_Element___setitem__(o, i, v);
120221   }
120222   else {
120223     return __pyx_pf_4lxml_5etree_8_Element___delitem__(o, i);
120224   }
120225 }
120226
120227 static PyObject *__pyx_getprop_4lxml_5etree_8_Element_tag(PyObject *o, void *x) {
120228   return __pyx_pf_4lxml_5etree_8_Element_3tag___get__(o);
120229 }
120230
120231 static int __pyx_setprop_4lxml_5etree_8_Element_tag(PyObject *o, PyObject *v, void *x) {
120232   if (v) {
120233     return __pyx_pf_4lxml_5etree_8_Element_3tag___set__(o, v);
120234   }
120235   else {
120236     PyErr_SetString(PyExc_NotImplementedError, "__del__");
120237     return -1;
120238   }
120239 }
120240
120241 static PyObject *__pyx_getprop_4lxml_5etree_8_Element_attrib(PyObject *o, void *x) {
120242   return __pyx_pf_4lxml_5etree_8_Element_6attrib___get__(o);
120243 }
120244
120245 static PyObject *__pyx_getprop_4lxml_5etree_8_Element_text(PyObject *o, void *x) {
120246   return __pyx_pf_4lxml_5etree_8_Element_4text___get__(o);
120247 }
120248
120249 static int __pyx_setprop_4lxml_5etree_8_Element_text(PyObject *o, PyObject *v, void *x) {
120250   if (v) {
120251     return __pyx_pf_4lxml_5etree_8_Element_4text___set__(o, v);
120252   }
120253   else {
120254     PyErr_SetString(PyExc_NotImplementedError, "__del__");
120255     return -1;
120256   }
120257 }
120258
120259 static PyObject *__pyx_getprop_4lxml_5etree_8_Element_tail(PyObject *o, void *x) {
120260   return __pyx_pf_4lxml_5etree_8_Element_4tail___get__(o);
120261 }
120262
120263 static int __pyx_setprop_4lxml_5etree_8_Element_tail(PyObject *o, PyObject *v, void *x) {
120264   if (v) {
120265     return __pyx_pf_4lxml_5etree_8_Element_4tail___set__(o, v);
120266   }
120267   else {
120268     PyErr_SetString(PyExc_NotImplementedError, "__del__");
120269     return -1;
120270   }
120271 }
120272
120273 static PyObject *__pyx_getprop_4lxml_5etree_8_Element_prefix(PyObject *o, void *x) {
120274   return __pyx_pf_4lxml_5etree_8_Element_6prefix___get__(o);
120275 }
120276
120277 static PyObject *__pyx_getprop_4lxml_5etree_8_Element_sourceline(PyObject *o, void *x) {
120278   return __pyx_pf_4lxml_5etree_8_Element_10sourceline___get__(o);
120279 }
120280
120281 static int __pyx_setprop_4lxml_5etree_8_Element_sourceline(PyObject *o, PyObject *v, void *x) {
120282   if (v) {
120283     return __pyx_pf_4lxml_5etree_8_Element_10sourceline___set__(o, v);
120284   }
120285   else {
120286     PyErr_SetString(PyExc_NotImplementedError, "__del__");
120287     return -1;
120288   }
120289 }
120290
120291 static PyObject *__pyx_getprop_4lxml_5etree_8_Element_nsmap(PyObject *o, void *x) {
120292   return __pyx_pf_4lxml_5etree_8_Element_5nsmap___get__(o);
120293 }
120294
120295 static PyObject *__pyx_getprop_4lxml_5etree_8_Element_base(PyObject *o, void *x) {
120296   return __pyx_pf_4lxml_5etree_8_Element_4base___get__(o);
120297 }
120298
120299 static int __pyx_setprop_4lxml_5etree_8_Element_base(PyObject *o, PyObject *v, void *x) {
120300   if (v) {
120301     return __pyx_pf_4lxml_5etree_8_Element_4base___set__(o, v);
120302   }
120303   else {
120304     PyErr_SetString(PyExc_NotImplementedError, "__del__");
120305     return -1;
120306   }
120307 }
120308
120309 static struct PyMethodDef __pyx_methods_4lxml_5etree__Element[] = {
120310   {__Pyx_NAMESTR("_init"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element__init, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element__init)},
120311   {__Pyx_NAMESTR("__deepcopy__"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element___deepcopy__, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element___deepcopy__)},
120312   {__Pyx_NAMESTR("__copy__"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element___copy__, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element___copy__)},
120313   {__Pyx_NAMESTR("set"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_set, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_set)},
120314   {__Pyx_NAMESTR("append"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_append, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_append)},
120315   {__Pyx_NAMESTR("addnext"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_addnext, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_addnext)},
120316   {__Pyx_NAMESTR("addprevious"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_addprevious, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_addprevious)},
120317   {__Pyx_NAMESTR("extend"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_extend, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_extend)},
120318   {__Pyx_NAMESTR("clear"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_clear, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_clear)},
120319   {__Pyx_NAMESTR("insert"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_insert, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_insert)},
120320   {__Pyx_NAMESTR("remove"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_remove, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_remove)},
120321   {__Pyx_NAMESTR("replace"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_replace, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_replace)},
120322   {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element___repr__)},
120323   {__Pyx_NAMESTR("__getitem__"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element___getitem__, METH_O|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element___getitem__)},
120324   {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element___iter__)},
120325   {__Pyx_NAMESTR("__reversed__"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element___reversed__, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element___reversed__)},
120326   {__Pyx_NAMESTR("index"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_index, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_index)},
120327   {__Pyx_NAMESTR("get"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_get, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_get)},
120328   {__Pyx_NAMESTR("keys"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_keys, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_keys)},
120329   {__Pyx_NAMESTR("values"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_values, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_values)},
120330   {__Pyx_NAMESTR("items"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_items, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_items)},
120331   {__Pyx_NAMESTR("getchildren"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_getchildren, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_getchildren)},
120332   {__Pyx_NAMESTR("getparent"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_getparent, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_getparent)},
120333   {__Pyx_NAMESTR("getnext"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_getnext, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_getnext)},
120334   {__Pyx_NAMESTR("getprevious"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_getprevious, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_getprevious)},
120335   {__Pyx_NAMESTR("itersiblings"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_itersiblings, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_itersiblings)},
120336   {__Pyx_NAMESTR("iterancestors"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_iterancestors, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_iterancestors)},
120337   {__Pyx_NAMESTR("iterdescendants"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_iterdescendants, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_iterdescendants)},
120338   {__Pyx_NAMESTR("iterchildren"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_iterchildren, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_iterchildren)},
120339   {__Pyx_NAMESTR("getroottree"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_getroottree, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_getroottree)},
120340   {__Pyx_NAMESTR("getiterator"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_getiterator, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_getiterator)},
120341   {__Pyx_NAMESTR("iter"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_iter, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_iter)},
120342   {__Pyx_NAMESTR("itertext"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_itertext, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_itertext)},
120343   {__Pyx_NAMESTR("makeelement"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_makeelement, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_makeelement)},
120344   {__Pyx_NAMESTR("find"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_find, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_find)},
120345   {__Pyx_NAMESTR("findtext"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_findtext, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_findtext)},
120346   {__Pyx_NAMESTR("findall"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_findall, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_findall)},
120347   {__Pyx_NAMESTR("iterfind"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_iterfind, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_iterfind)},
120348   {__Pyx_NAMESTR("xpath"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_xpath, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8_Element_xpath)},
120349   {0, 0, 0, 0}
120350 };
120351
120352 static struct PyGetSetDef __pyx_getsets_4lxml_5etree__Element[] = {
120353   {(char *)"tag", __pyx_getprop_4lxml_5etree_8_Element_tag, __pyx_setprop_4lxml_5etree_8_Element_tag, __pyx_k_12, 0},
120354   {(char *)"attrib", __pyx_getprop_4lxml_5etree_8_Element_attrib, 0, __pyx_k_13, 0},
120355   {(char *)"text", __pyx_getprop_4lxml_5etree_8_Element_text, __pyx_setprop_4lxml_5etree_8_Element_text, __pyx_k_14, 0},
120356   {(char *)"tail", __pyx_getprop_4lxml_5etree_8_Element_tail, __pyx_setprop_4lxml_5etree_8_Element_tail, __pyx_k_15, 0},
120357   {(char *)"prefix", __pyx_getprop_4lxml_5etree_8_Element_prefix, 0, __pyx_k_16, 0},
120358   {(char *)"sourceline", __pyx_getprop_4lxml_5etree_8_Element_sourceline, __pyx_setprop_4lxml_5etree_8_Element_sourceline, __pyx_k_17, 0},
120359   {(char *)"nsmap", __pyx_getprop_4lxml_5etree_8_Element_nsmap, 0, __pyx_k_18, 0},
120360   {(char *)"base", __pyx_getprop_4lxml_5etree_8_Element_base, __pyx_setprop_4lxml_5etree_8_Element_base, __pyx_k_19, 0},
120361   {0, 0, 0, 0, 0}
120362 };
120363
120364 static PyNumberMethods __pyx_tp_as_number__Element = {
120365   0, /*nb_add*/
120366   0, /*nb_subtract*/
120367   0, /*nb_multiply*/
120368   #if PY_MAJOR_VERSION < 3
120369   0, /*nb_divide*/
120370   #endif
120371   0, /*nb_remainder*/
120372   0, /*nb_divmod*/
120373   0, /*nb_power*/
120374   0, /*nb_negative*/
120375   0, /*nb_positive*/
120376   0, /*nb_absolute*/
120377   __pyx_pf_4lxml_5etree_8_Element___nonzero__, /*nb_nonzero*/
120378   0, /*nb_invert*/
120379   0, /*nb_lshift*/
120380   0, /*nb_rshift*/
120381   0, /*nb_and*/
120382   0, /*nb_xor*/
120383   0, /*nb_or*/
120384   #if PY_MAJOR_VERSION < 3
120385   0, /*nb_coerce*/
120386   #endif
120387   0, /*nb_int*/
120388   #if PY_MAJOR_VERSION >= 3
120389   0, /*reserved*/
120390   #else
120391   0, /*nb_long*/
120392   #endif
120393   0, /*nb_float*/
120394   #if PY_MAJOR_VERSION < 3
120395   0, /*nb_oct*/
120396   #endif
120397   #if PY_MAJOR_VERSION < 3
120398   0, /*nb_hex*/
120399   #endif
120400   0, /*nb_inplace_add*/
120401   0, /*nb_inplace_subtract*/
120402   0, /*nb_inplace_multiply*/
120403   #if PY_MAJOR_VERSION < 3
120404   0, /*nb_inplace_divide*/
120405   #endif
120406   0, /*nb_inplace_remainder*/
120407   0, /*nb_inplace_power*/
120408   0, /*nb_inplace_lshift*/
120409   0, /*nb_inplace_rshift*/
120410   0, /*nb_inplace_and*/
120411   0, /*nb_inplace_xor*/
120412   0, /*nb_inplace_or*/
120413   0, /*nb_floor_divide*/
120414   0, /*nb_true_divide*/
120415   0, /*nb_inplace_floor_divide*/
120416   0, /*nb_inplace_true_divide*/
120417   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
120418   0, /*nb_index*/
120419   #endif
120420 };
120421
120422 static PySequenceMethods __pyx_tp_as_sequence__Element = {
120423   __pyx_pf_4lxml_5etree_8_Element___len__, /*sq_length*/
120424   0, /*sq_concat*/
120425   0, /*sq_repeat*/
120426   __pyx_sq_item_4lxml_5etree__Element, /*sq_item*/
120427   0, /*sq_slice*/
120428   0, /*sq_ass_item*/
120429   0, /*sq_ass_slice*/
120430   __pyx_pf_4lxml_5etree_8_Element___contains__, /*sq_contains*/
120431   0, /*sq_inplace_concat*/
120432   0, /*sq_inplace_repeat*/
120433 };
120434
120435 static PyMappingMethods __pyx_tp_as_mapping__Element = {
120436   __pyx_pf_4lxml_5etree_8_Element___len__, /*mp_length*/
120437   __pyx_pf_4lxml_5etree_8_Element___getitem__, /*mp_subscript*/
120438   __pyx_mp_ass_subscript_4lxml_5etree__Element, /*mp_ass_subscript*/
120439 };
120440
120441 static PyBufferProcs __pyx_tp_as_buffer__Element = {
120442   #if PY_MAJOR_VERSION < 3
120443   0, /*bf_getreadbuffer*/
120444   #endif
120445   #if PY_MAJOR_VERSION < 3
120446   0, /*bf_getwritebuffer*/
120447   #endif
120448   #if PY_MAJOR_VERSION < 3
120449   0, /*bf_getsegcount*/
120450   #endif
120451   #if PY_MAJOR_VERSION < 3
120452   0, /*bf_getcharbuffer*/
120453   #endif
120454   #if PY_VERSION_HEX >= 0x02060000
120455   0, /*bf_getbuffer*/
120456   #endif
120457   #if PY_VERSION_HEX >= 0x02060000
120458   0, /*bf_releasebuffer*/
120459   #endif
120460 };
120461
120462 DL_EXPORT(PyTypeObject) LxmlElementType = {
120463   PyVarObject_HEAD_INIT(0, 0)
120464   __Pyx_NAMESTR("lxml.etree._Element"), /*tp_name*/
120465   sizeof(struct LxmlElement), /*tp_basicsize*/
120466   0, /*tp_itemsize*/
120467   __pyx_tp_dealloc_4lxml_5etree__Element, /*tp_dealloc*/
120468   0, /*tp_print*/
120469   0, /*tp_getattr*/
120470   0, /*tp_setattr*/
120471   0, /*tp_compare*/
120472   __pyx_pf_4lxml_5etree_8_Element___repr__, /*tp_repr*/
120473   &__pyx_tp_as_number__Element, /*tp_as_number*/
120474   &__pyx_tp_as_sequence__Element, /*tp_as_sequence*/
120475   &__pyx_tp_as_mapping__Element, /*tp_as_mapping*/
120476   0, /*tp_hash*/
120477   0, /*tp_call*/
120478   0, /*tp_str*/
120479   0, /*tp_getattro*/
120480   0, /*tp_setattro*/
120481   &__pyx_tp_as_buffer__Element, /*tp_as_buffer*/
120482   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
120483   __Pyx_DOCSTR("Element class.\n\n    References a document object and a libxml node.\n\n    By pointing to a Document instance, a reference is kept to\n    _Document as long as there is some pointer to a node in it.\n    "), /*tp_doc*/
120484   __pyx_tp_traverse_4lxml_5etree__Element, /*tp_traverse*/
120485   __pyx_tp_clear_4lxml_5etree__Element, /*tp_clear*/
120486   0, /*tp_richcompare*/
120487   0, /*tp_weaklistoffset*/
120488   __pyx_pf_4lxml_5etree_8_Element___iter__, /*tp_iter*/
120489   0, /*tp_iternext*/
120490   __pyx_methods_4lxml_5etree__Element, /*tp_methods*/
120491   0, /*tp_members*/
120492   __pyx_getsets_4lxml_5etree__Element, /*tp_getset*/
120493   0, /*tp_base*/
120494   0, /*tp_dict*/
120495   0, /*tp_descr_get*/
120496   0, /*tp_descr_set*/
120497   0, /*tp_dictoffset*/
120498   0, /*tp_init*/
120499   0, /*tp_alloc*/
120500   __pyx_tp_new_4lxml_5etree__Element, /*tp_new*/
120501   0, /*tp_free*/
120502   0, /*tp_is_gc*/
120503   0, /*tp_bases*/
120504   0, /*tp_mro*/
120505   0, /*tp_cache*/
120506   0, /*tp_subclasses*/
120507   0, /*tp_weaklist*/
120508 };
120509 static struct __pyx_vtabstruct_4lxml_5etree__BaseParser __pyx_vtable_4lxml_5etree__BaseParser;
120510
120511 static PyObject *__pyx_tp_new_4lxml_5etree__BaseParser(PyTypeObject *t, PyObject *a, PyObject *k) {
120512   struct __pyx_obj_4lxml_5etree__BaseParser *p;
120513   PyObject *o = (*t->tp_alloc)(t, 0);
120514   if (!o) return 0;
120515   p = ((struct __pyx_obj_4lxml_5etree__BaseParser *)o);
120516   p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__BaseParser;
120517   p->_class_lookup = ((struct LxmlElementClassLookup *)Py_None); Py_INCREF(Py_None);
120518   p->_resolvers = ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)Py_None); Py_INCREF(Py_None);
120519   p->_parser_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);
120520   p->_push_parser_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);
120521   p->_schema = ((struct __pyx_obj_4lxml_5etree_XMLSchema *)Py_None); Py_INCREF(Py_None);
120522   p->_filename = Py_None; Py_INCREF(Py_None);
120523   p->_target = Py_None; Py_INCREF(Py_None);
120524   p->_default_encoding = Py_None; Py_INCREF(Py_None);
120525   return o;
120526 }
120527
120528 static void __pyx_tp_dealloc_4lxml_5etree__BaseParser(PyObject *o) {
120529   struct __pyx_obj_4lxml_5etree__BaseParser *p = (struct __pyx_obj_4lxml_5etree__BaseParser *)o;
120530   Py_XDECREF(((PyObject *)p->_class_lookup));
120531   Py_XDECREF(((PyObject *)p->_resolvers));
120532   Py_XDECREF(((PyObject *)p->_parser_context));
120533   Py_XDECREF(((PyObject *)p->_push_parser_context));
120534   Py_XDECREF(((PyObject *)p->_schema));
120535   Py_XDECREF(p->_filename);
120536   Py_XDECREF(p->_target);
120537   Py_XDECREF(p->_default_encoding);
120538   (*Py_TYPE(o)->tp_free)(o);
120539 }
120540
120541 static int __pyx_tp_traverse_4lxml_5etree__BaseParser(PyObject *o, visitproc v, void *a) {
120542   int e;
120543   struct __pyx_obj_4lxml_5etree__BaseParser *p = (struct __pyx_obj_4lxml_5etree__BaseParser *)o;
120544   if (p->_class_lookup) {
120545     e = (*v)(((PyObject*)p->_class_lookup), a); if (e) return e;
120546   }
120547   if (p->_resolvers) {
120548     e = (*v)(((PyObject*)p->_resolvers), a); if (e) return e;
120549   }
120550   if (p->_parser_context) {
120551     e = (*v)(((PyObject*)p->_parser_context), a); if (e) return e;
120552   }
120553   if (p->_push_parser_context) {
120554     e = (*v)(((PyObject*)p->_push_parser_context), a); if (e) return e;
120555   }
120556   if (p->_schema) {
120557     e = (*v)(((PyObject*)p->_schema), a); if (e) return e;
120558   }
120559   if (p->_filename) {
120560     e = (*v)(p->_filename, a); if (e) return e;
120561   }
120562   if (p->_target) {
120563     e = (*v)(p->_target, a); if (e) return e;
120564   }
120565   if (p->_default_encoding) {
120566     e = (*v)(p->_default_encoding, a); if (e) return e;
120567   }
120568   return 0;
120569 }
120570
120571 static int __pyx_tp_clear_4lxml_5etree__BaseParser(PyObject *o) {
120572   struct __pyx_obj_4lxml_5etree__BaseParser *p = (struct __pyx_obj_4lxml_5etree__BaseParser *)o;
120573   PyObject* tmp;
120574   tmp = ((PyObject*)p->_class_lookup);
120575   p->_class_lookup = ((struct LxmlElementClassLookup *)Py_None); Py_INCREF(Py_None);
120576   Py_XDECREF(tmp);
120577   tmp = ((PyObject*)p->_resolvers);
120578   p->_resolvers = ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)Py_None); Py_INCREF(Py_None);
120579   Py_XDECREF(tmp);
120580   tmp = ((PyObject*)p->_parser_context);
120581   p->_parser_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);
120582   Py_XDECREF(tmp);
120583   tmp = ((PyObject*)p->_push_parser_context);
120584   p->_push_parser_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);
120585   Py_XDECREF(tmp);
120586   tmp = ((PyObject*)p->_schema);
120587   p->_schema = ((struct __pyx_obj_4lxml_5etree_XMLSchema *)Py_None); Py_INCREF(Py_None);
120588   Py_XDECREF(tmp);
120589   tmp = ((PyObject*)p->_filename);
120590   p->_filename = Py_None; Py_INCREF(Py_None);
120591   Py_XDECREF(tmp);
120592   tmp = ((PyObject*)p->_target);
120593   p->_target = Py_None; Py_INCREF(Py_None);
120594   Py_XDECREF(tmp);
120595   tmp = ((PyObject*)p->_default_encoding);
120596   p->_default_encoding = Py_None; Py_INCREF(Py_None);
120597   Py_XDECREF(tmp);
120598   return 0;
120599 }
120600
120601 static PyObject *__pyx_getprop_4lxml_5etree_11_BaseParser_error_log(PyObject *o, void *x) {
120602   return __pyx_pf_4lxml_5etree_11_BaseParser_9error_log___get__(o);
120603 }
120604
120605 static PyObject *__pyx_getprop_4lxml_5etree_11_BaseParser_resolvers(PyObject *o, void *x) {
120606   return __pyx_pf_4lxml_5etree_11_BaseParser_9resolvers___get__(o);
120607 }
120608
120609 static PyObject *__pyx_getprop_4lxml_5etree_11_BaseParser_version(PyObject *o, void *x) {
120610   return __pyx_pf_4lxml_5etree_11_BaseParser_7version___get__(o);
120611 }
120612
120613 static struct PyMethodDef __pyx_methods_4lxml_5etree__BaseParser[] = {
120614   {__Pyx_NAMESTR("setElementClassLookup"), (PyCFunction)__pyx_pf_4lxml_5etree_11_BaseParser_setElementClassLookup, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_11_BaseParser_setElementClassLookup)},
120615   {__Pyx_NAMESTR("set_element_class_lookup"), (PyCFunction)__pyx_pf_4lxml_5etree_11_BaseParser_set_element_class_lookup, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_11_BaseParser_set_element_class_lookup)},
120616   {__Pyx_NAMESTR("copy"), (PyCFunction)__pyx_pf_4lxml_5etree_11_BaseParser_copy, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_11_BaseParser_copy)},
120617   {__Pyx_NAMESTR("makeelement"), (PyCFunction)__pyx_pf_4lxml_5etree_11_BaseParser_makeelement, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_11_BaseParser_makeelement)},
120618   {0, 0, 0, 0}
120619 };
120620
120621 static struct PyGetSetDef __pyx_getsets_4lxml_5etree__BaseParser[] = {
120622   {(char *)"error_log", __pyx_getprop_4lxml_5etree_11_BaseParser_error_log, 0, __pyx_k_25, 0},
120623   {(char *)"resolvers", __pyx_getprop_4lxml_5etree_11_BaseParser_resolvers, 0, __pyx_k_26, 0},
120624   {(char *)"version", __pyx_getprop_4lxml_5etree_11_BaseParser_version, 0, __pyx_k_27, 0},
120625   {0, 0, 0, 0, 0}
120626 };
120627
120628 static PyNumberMethods __pyx_tp_as_number__BaseParser = {
120629   0, /*nb_add*/
120630   0, /*nb_subtract*/
120631   0, /*nb_multiply*/
120632   #if PY_MAJOR_VERSION < 3
120633   0, /*nb_divide*/
120634   #endif
120635   0, /*nb_remainder*/
120636   0, /*nb_divmod*/
120637   0, /*nb_power*/
120638   0, /*nb_negative*/
120639   0, /*nb_positive*/
120640   0, /*nb_absolute*/
120641   0, /*nb_nonzero*/
120642   0, /*nb_invert*/
120643   0, /*nb_lshift*/
120644   0, /*nb_rshift*/
120645   0, /*nb_and*/
120646   0, /*nb_xor*/
120647   0, /*nb_or*/
120648   #if PY_MAJOR_VERSION < 3
120649   0, /*nb_coerce*/
120650   #endif
120651   0, /*nb_int*/
120652   #if PY_MAJOR_VERSION >= 3
120653   0, /*reserved*/
120654   #else
120655   0, /*nb_long*/
120656   #endif
120657   0, /*nb_float*/
120658   #if PY_MAJOR_VERSION < 3
120659   0, /*nb_oct*/
120660   #endif
120661   #if PY_MAJOR_VERSION < 3
120662   0, /*nb_hex*/
120663   #endif
120664   0, /*nb_inplace_add*/
120665   0, /*nb_inplace_subtract*/
120666   0, /*nb_inplace_multiply*/
120667   #if PY_MAJOR_VERSION < 3
120668   0, /*nb_inplace_divide*/
120669   #endif
120670   0, /*nb_inplace_remainder*/
120671   0, /*nb_inplace_power*/
120672   0, /*nb_inplace_lshift*/
120673   0, /*nb_inplace_rshift*/
120674   0, /*nb_inplace_and*/
120675   0, /*nb_inplace_xor*/
120676   0, /*nb_inplace_or*/
120677   0, /*nb_floor_divide*/
120678   0, /*nb_true_divide*/
120679   0, /*nb_inplace_floor_divide*/
120680   0, /*nb_inplace_true_divide*/
120681   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
120682   0, /*nb_index*/
120683   #endif
120684 };
120685
120686 static PySequenceMethods __pyx_tp_as_sequence__BaseParser = {
120687   0, /*sq_length*/
120688   0, /*sq_concat*/
120689   0, /*sq_repeat*/
120690   0, /*sq_item*/
120691   0, /*sq_slice*/
120692   0, /*sq_ass_item*/
120693   0, /*sq_ass_slice*/
120694   0, /*sq_contains*/
120695   0, /*sq_inplace_concat*/
120696   0, /*sq_inplace_repeat*/
120697 };
120698
120699 static PyMappingMethods __pyx_tp_as_mapping__BaseParser = {
120700   0, /*mp_length*/
120701   0, /*mp_subscript*/
120702   0, /*mp_ass_subscript*/
120703 };
120704
120705 static PyBufferProcs __pyx_tp_as_buffer__BaseParser = {
120706   #if PY_MAJOR_VERSION < 3
120707   0, /*bf_getreadbuffer*/
120708   #endif
120709   #if PY_MAJOR_VERSION < 3
120710   0, /*bf_getwritebuffer*/
120711   #endif
120712   #if PY_MAJOR_VERSION < 3
120713   0, /*bf_getsegcount*/
120714   #endif
120715   #if PY_MAJOR_VERSION < 3
120716   0, /*bf_getcharbuffer*/
120717   #endif
120718   #if PY_VERSION_HEX >= 0x02060000
120719   0, /*bf_getbuffer*/
120720   #endif
120721   #if PY_VERSION_HEX >= 0x02060000
120722   0, /*bf_releasebuffer*/
120723   #endif
120724 };
120725
120726 PyTypeObject __pyx_type_4lxml_5etree__BaseParser = {
120727   PyVarObject_HEAD_INIT(0, 0)
120728   __Pyx_NAMESTR("lxml.etree._BaseParser"), /*tp_name*/
120729   sizeof(struct __pyx_obj_4lxml_5etree__BaseParser), /*tp_basicsize*/
120730   0, /*tp_itemsize*/
120731   __pyx_tp_dealloc_4lxml_5etree__BaseParser, /*tp_dealloc*/
120732   0, /*tp_print*/
120733   0, /*tp_getattr*/
120734   0, /*tp_setattr*/
120735   0, /*tp_compare*/
120736   0, /*tp_repr*/
120737   &__pyx_tp_as_number__BaseParser, /*tp_as_number*/
120738   &__pyx_tp_as_sequence__BaseParser, /*tp_as_sequence*/
120739   &__pyx_tp_as_mapping__BaseParser, /*tp_as_mapping*/
120740   0, /*tp_hash*/
120741   0, /*tp_call*/
120742   0, /*tp_str*/
120743   0, /*tp_getattro*/
120744   0, /*tp_setattro*/
120745   &__pyx_tp_as_buffer__BaseParser, /*tp_as_buffer*/
120746   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
120747   0, /*tp_doc*/
120748   __pyx_tp_traverse_4lxml_5etree__BaseParser, /*tp_traverse*/
120749   __pyx_tp_clear_4lxml_5etree__BaseParser, /*tp_clear*/
120750   0, /*tp_richcompare*/
120751   0, /*tp_weaklistoffset*/
120752   0, /*tp_iter*/
120753   0, /*tp_iternext*/
120754   __pyx_methods_4lxml_5etree__BaseParser, /*tp_methods*/
120755   0, /*tp_members*/
120756   __pyx_getsets_4lxml_5etree__BaseParser, /*tp_getset*/
120757   0, /*tp_base*/
120758   0, /*tp_dict*/
120759   0, /*tp_descr_get*/
120760   0, /*tp_descr_set*/
120761   0, /*tp_dictoffset*/
120762   __pyx_pf_4lxml_5etree_11_BaseParser___init__, /*tp_init*/
120763   0, /*tp_alloc*/
120764   __pyx_tp_new_4lxml_5etree__BaseParser, /*tp_new*/
120765   0, /*tp_free*/
120766   0, /*tp_is_gc*/
120767   0, /*tp_bases*/
120768   0, /*tp_mro*/
120769   0, /*tp_cache*/
120770   0, /*tp_subclasses*/
120771   0, /*tp_weaklist*/
120772 };
120773
120774 static PyObject *__pyx_tp_new_4lxml_5etree_QName(PyTypeObject *t, PyObject *a, PyObject *k) {
120775   struct __pyx_obj_4lxml_5etree_QName *p;
120776   PyObject *o = (*t->tp_alloc)(t, 0);
120777   if (!o) return 0;
120778   p = ((struct __pyx_obj_4lxml_5etree_QName *)o);
120779   p->text = Py_None; Py_INCREF(Py_None);
120780   p->localname = Py_None; Py_INCREF(Py_None);
120781   p->namespace = Py_None; Py_INCREF(Py_None);
120782   return o;
120783 }
120784
120785 static void __pyx_tp_dealloc_4lxml_5etree_QName(PyObject *o) {
120786   struct __pyx_obj_4lxml_5etree_QName *p = (struct __pyx_obj_4lxml_5etree_QName *)o;
120787   Py_XDECREF(p->text);
120788   Py_XDECREF(p->localname);
120789   Py_XDECREF(p->namespace);
120790   (*Py_TYPE(o)->tp_free)(o);
120791 }
120792
120793 static int __pyx_tp_traverse_4lxml_5etree_QName(PyObject *o, visitproc v, void *a) {
120794   int e;
120795   struct __pyx_obj_4lxml_5etree_QName *p = (struct __pyx_obj_4lxml_5etree_QName *)o;
120796   if (p->text) {
120797     e = (*v)(p->text, a); if (e) return e;
120798   }
120799   if (p->localname) {
120800     e = (*v)(p->localname, a); if (e) return e;
120801   }
120802   if (p->namespace) {
120803     e = (*v)(p->namespace, a); if (e) return e;
120804   }
120805   return 0;
120806 }
120807
120808 static int __pyx_tp_clear_4lxml_5etree_QName(PyObject *o) {
120809   struct __pyx_obj_4lxml_5etree_QName *p = (struct __pyx_obj_4lxml_5etree_QName *)o;
120810   PyObject* tmp;
120811   tmp = ((PyObject*)p->text);
120812   p->text = Py_None; Py_INCREF(Py_None);
120813   Py_XDECREF(tmp);
120814   tmp = ((PyObject*)p->localname);
120815   p->localname = Py_None; Py_INCREF(Py_None);
120816   Py_XDECREF(tmp);
120817   tmp = ((PyObject*)p->namespace);
120818   p->namespace = Py_None; Py_INCREF(Py_None);
120819   Py_XDECREF(tmp);
120820   return 0;
120821 }
120822
120823 static struct PyMethodDef __pyx_methods_4lxml_5etree_QName[] = {
120824   {__Pyx_NAMESTR("__str__"), (PyCFunction)__pyx_pf_4lxml_5etree_5QName___str__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
120825   {0, 0, 0, 0}
120826 };
120827
120828 static struct PyMemberDef __pyx_members_4lxml_5etree_QName[] = {
120829   {(char *)"text", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree_QName, text), READONLY, 0},
120830   {(char *)"localname", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree_QName, localname), READONLY, 0},
120831   {(char *)"namespace", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree_QName, namespace), READONLY, 0},
120832   {0, 0, 0, 0, 0}
120833 };
120834
120835 static PyNumberMethods __pyx_tp_as_number_QName = {
120836   0, /*nb_add*/
120837   0, /*nb_subtract*/
120838   0, /*nb_multiply*/
120839   #if PY_MAJOR_VERSION < 3
120840   0, /*nb_divide*/
120841   #endif
120842   0, /*nb_remainder*/
120843   0, /*nb_divmod*/
120844   0, /*nb_power*/
120845   0, /*nb_negative*/
120846   0, /*nb_positive*/
120847   0, /*nb_absolute*/
120848   0, /*nb_nonzero*/
120849   0, /*nb_invert*/
120850   0, /*nb_lshift*/
120851   0, /*nb_rshift*/
120852   0, /*nb_and*/
120853   0, /*nb_xor*/
120854   0, /*nb_or*/
120855   #if PY_MAJOR_VERSION < 3
120856   0, /*nb_coerce*/
120857   #endif
120858   0, /*nb_int*/
120859   #if PY_MAJOR_VERSION >= 3
120860   0, /*reserved*/
120861   #else
120862   0, /*nb_long*/
120863   #endif
120864   0, /*nb_float*/
120865   #if PY_MAJOR_VERSION < 3
120866   0, /*nb_oct*/
120867   #endif
120868   #if PY_MAJOR_VERSION < 3
120869   0, /*nb_hex*/
120870   #endif
120871   0, /*nb_inplace_add*/
120872   0, /*nb_inplace_subtract*/
120873   0, /*nb_inplace_multiply*/
120874   #if PY_MAJOR_VERSION < 3
120875   0, /*nb_inplace_divide*/
120876   #endif
120877   0, /*nb_inplace_remainder*/
120878   0, /*nb_inplace_power*/
120879   0, /*nb_inplace_lshift*/
120880   0, /*nb_inplace_rshift*/
120881   0, /*nb_inplace_and*/
120882   0, /*nb_inplace_xor*/
120883   0, /*nb_inplace_or*/
120884   0, /*nb_floor_divide*/
120885   0, /*nb_true_divide*/
120886   0, /*nb_inplace_floor_divide*/
120887   0, /*nb_inplace_true_divide*/
120888   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
120889   0, /*nb_index*/
120890   #endif
120891 };
120892
120893 static PySequenceMethods __pyx_tp_as_sequence_QName = {
120894   0, /*sq_length*/
120895   0, /*sq_concat*/
120896   0, /*sq_repeat*/
120897   0, /*sq_item*/
120898   0, /*sq_slice*/
120899   0, /*sq_ass_item*/
120900   0, /*sq_ass_slice*/
120901   0, /*sq_contains*/
120902   0, /*sq_inplace_concat*/
120903   0, /*sq_inplace_repeat*/
120904 };
120905
120906 static PyMappingMethods __pyx_tp_as_mapping_QName = {
120907   0, /*mp_length*/
120908   0, /*mp_subscript*/
120909   0, /*mp_ass_subscript*/
120910 };
120911
120912 static PyBufferProcs __pyx_tp_as_buffer_QName = {
120913   #if PY_MAJOR_VERSION < 3
120914   0, /*bf_getreadbuffer*/
120915   #endif
120916   #if PY_MAJOR_VERSION < 3
120917   0, /*bf_getwritebuffer*/
120918   #endif
120919   #if PY_MAJOR_VERSION < 3
120920   0, /*bf_getsegcount*/
120921   #endif
120922   #if PY_MAJOR_VERSION < 3
120923   0, /*bf_getcharbuffer*/
120924   #endif
120925   #if PY_VERSION_HEX >= 0x02060000
120926   0, /*bf_getbuffer*/
120927   #endif
120928   #if PY_VERSION_HEX >= 0x02060000
120929   0, /*bf_releasebuffer*/
120930   #endif
120931 };
120932
120933 PyTypeObject __pyx_type_4lxml_5etree_QName = {
120934   PyVarObject_HEAD_INIT(0, 0)
120935   __Pyx_NAMESTR("lxml.etree.QName"), /*tp_name*/
120936   sizeof(struct __pyx_obj_4lxml_5etree_QName), /*tp_basicsize*/
120937   0, /*tp_itemsize*/
120938   __pyx_tp_dealloc_4lxml_5etree_QName, /*tp_dealloc*/
120939   0, /*tp_print*/
120940   0, /*tp_getattr*/
120941   0, /*tp_setattr*/
120942   0, /*tp_compare*/
120943   0, /*tp_repr*/
120944   &__pyx_tp_as_number_QName, /*tp_as_number*/
120945   &__pyx_tp_as_sequence_QName, /*tp_as_sequence*/
120946   &__pyx_tp_as_mapping_QName, /*tp_as_mapping*/
120947   __pyx_pf_4lxml_5etree_5QName___hash__, /*tp_hash*/
120948   0, /*tp_call*/
120949   __pyx_pf_4lxml_5etree_5QName___str__, /*tp_str*/
120950   0, /*tp_getattro*/
120951   0, /*tp_setattro*/
120952   &__pyx_tp_as_buffer_QName, /*tp_as_buffer*/
120953   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
120954   __Pyx_DOCSTR("QName(text_or_uri, tag=None)\n\n    QName wrapper for qualified XML names.\n\n    Pass a tag name by itself or a namespace URI and a tag name to\n    create a qualified name.\n\n    The ``text`` property holds the qualified name in\n    ``{namespace}tagname`` notation.  The ``namespace`` and\n    ``localname`` properties hold the respective parts of the tag\n    name.\n\n    You can pass QName objects wherever a tag name is expected.  Also,\n    setting Element text from a QName will resolve the namespace\n    prefix and set a qualified text value.\n    "), /*tp_doc*/
120955   __pyx_tp_traverse_4lxml_5etree_QName, /*tp_traverse*/
120956   __pyx_tp_clear_4lxml_5etree_QName, /*tp_clear*/
120957   __pyx_pf_4lxml_5etree_5QName___richcmp__, /*tp_richcompare*/
120958   0, /*tp_weaklistoffset*/
120959   0, /*tp_iter*/
120960   0, /*tp_iternext*/
120961   __pyx_methods_4lxml_5etree_QName, /*tp_methods*/
120962   __pyx_members_4lxml_5etree_QName, /*tp_members*/
120963   0, /*tp_getset*/
120964   0, /*tp_base*/
120965   0, /*tp_dict*/
120966   0, /*tp_descr_get*/
120967   0, /*tp_descr_set*/
120968   0, /*tp_dictoffset*/
120969   __pyx_pf_4lxml_5etree_5QName___init__, /*tp_init*/
120970   0, /*tp_alloc*/
120971   __pyx_tp_new_4lxml_5etree_QName, /*tp_new*/
120972   0, /*tp_free*/
120973   0, /*tp_is_gc*/
120974   0, /*tp_bases*/
120975   0, /*tp_mro*/
120976   0, /*tp_cache*/
120977   0, /*tp_subclasses*/
120978   0, /*tp_weaklist*/
120979 };
120980 static struct __pyx_vtabstruct_4lxml_5etree__LogEntry __pyx_vtable_4lxml_5etree__LogEntry;
120981
120982 static PyObject *__pyx_tp_new_4lxml_5etree__LogEntry(PyTypeObject *t, PyObject *a, PyObject *k) {
120983   struct __pyx_obj_4lxml_5etree__LogEntry *p;
120984   PyObject *o = (*t->tp_alloc)(t, 0);
120985   if (!o) return 0;
120986   p = ((struct __pyx_obj_4lxml_5etree__LogEntry *)o);
120987   p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__LogEntry;
120988   p->domain = Py_None; Py_INCREF(Py_None);
120989   p->type = Py_None; Py_INCREF(Py_None);
120990   p->level = Py_None; Py_INCREF(Py_None);
120991   p->line = Py_None; Py_INCREF(Py_None);
120992   p->column = Py_None; Py_INCREF(Py_None);
120993   p->message = Py_None; Py_INCREF(Py_None);
120994   p->filename = Py_None; Py_INCREF(Py_None);
120995   return o;
120996 }
120997
120998 static void __pyx_tp_dealloc_4lxml_5etree__LogEntry(PyObject *o) {
120999   struct __pyx_obj_4lxml_5etree__LogEntry *p = (struct __pyx_obj_4lxml_5etree__LogEntry *)o;
121000   Py_XDECREF(p->domain);
121001   Py_XDECREF(p->type);
121002   Py_XDECREF(p->level);
121003   Py_XDECREF(p->line);
121004   Py_XDECREF(p->column);
121005   Py_XDECREF(p->message);
121006   Py_XDECREF(p->filename);
121007   (*Py_TYPE(o)->tp_free)(o);
121008 }
121009
121010 static int __pyx_tp_traverse_4lxml_5etree__LogEntry(PyObject *o, visitproc v, void *a) {
121011   int e;
121012   struct __pyx_obj_4lxml_5etree__LogEntry *p = (struct __pyx_obj_4lxml_5etree__LogEntry *)o;
121013   if (p->domain) {
121014     e = (*v)(p->domain, a); if (e) return e;
121015   }
121016   if (p->type) {
121017     e = (*v)(p->type, a); if (e) return e;
121018   }
121019   if (p->level) {
121020     e = (*v)(p->level, a); if (e) return e;
121021   }
121022   if (p->line) {
121023     e = (*v)(p->line, a); if (e) return e;
121024   }
121025   if (p->column) {
121026     e = (*v)(p->column, a); if (e) return e;
121027   }
121028   if (p->message) {
121029     e = (*v)(p->message, a); if (e) return e;
121030   }
121031   if (p->filename) {
121032     e = (*v)(p->filename, a); if (e) return e;
121033   }
121034   return 0;
121035 }
121036
121037 static int __pyx_tp_clear_4lxml_5etree__LogEntry(PyObject *o) {
121038   struct __pyx_obj_4lxml_5etree__LogEntry *p = (struct __pyx_obj_4lxml_5etree__LogEntry *)o;
121039   PyObject* tmp;
121040   tmp = ((PyObject*)p->domain);
121041   p->domain = Py_None; Py_INCREF(Py_None);
121042   Py_XDECREF(tmp);
121043   tmp = ((PyObject*)p->type);
121044   p->type = Py_None; Py_INCREF(Py_None);
121045   Py_XDECREF(tmp);
121046   tmp = ((PyObject*)p->level);
121047   p->level = Py_None; Py_INCREF(Py_None);
121048   Py_XDECREF(tmp);
121049   tmp = ((PyObject*)p->line);
121050   p->line = Py_None; Py_INCREF(Py_None);
121051   Py_XDECREF(tmp);
121052   tmp = ((PyObject*)p->column);
121053   p->column = Py_None; Py_INCREF(Py_None);
121054   Py_XDECREF(tmp);
121055   tmp = ((PyObject*)p->message);
121056   p->message = Py_None; Py_INCREF(Py_None);
121057   Py_XDECREF(tmp);
121058   tmp = ((PyObject*)p->filename);
121059   p->filename = Py_None; Py_INCREF(Py_None);
121060   Py_XDECREF(tmp);
121061   return 0;
121062 }
121063
121064 static PyObject *__pyx_getprop_4lxml_5etree_9_LogEntry_domain_name(PyObject *o, void *x) {
121065   return __pyx_pf_4lxml_5etree_9_LogEntry_11domain_name___get__(o);
121066 }
121067
121068 static PyObject *__pyx_getprop_4lxml_5etree_9_LogEntry_type_name(PyObject *o, void *x) {
121069   return __pyx_pf_4lxml_5etree_9_LogEntry_9type_name___get__(o);
121070 }
121071
121072 static PyObject *__pyx_getprop_4lxml_5etree_9_LogEntry_level_name(PyObject *o, void *x) {
121073   return __pyx_pf_4lxml_5etree_9_LogEntry_10level_name___get__(o);
121074 }
121075
121076 static struct PyMethodDef __pyx_methods_4lxml_5etree__LogEntry[] = {
121077   {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_4lxml_5etree_9_LogEntry___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
121078   {0, 0, 0, 0}
121079 };
121080
121081 static struct PyMemberDef __pyx_members_4lxml_5etree__LogEntry[] = {
121082   {(char *)"domain", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree__LogEntry, domain), READONLY, 0},
121083   {(char *)"type", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree__LogEntry, type), READONLY, 0},
121084   {(char *)"level", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree__LogEntry, level), READONLY, 0},
121085   {(char *)"line", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree__LogEntry, line), READONLY, 0},
121086   {(char *)"column", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree__LogEntry, column), READONLY, 0},
121087   {(char *)"message", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree__LogEntry, message), READONLY, 0},
121088   {(char *)"filename", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree__LogEntry, filename), READONLY, 0},
121089   {0, 0, 0, 0, 0}
121090 };
121091
121092 static struct PyGetSetDef __pyx_getsets_4lxml_5etree__LogEntry[] = {
121093   {(char *)"domain_name", __pyx_getprop_4lxml_5etree_9_LogEntry_domain_name, 0, 0, 0},
121094   {(char *)"type_name", __pyx_getprop_4lxml_5etree_9_LogEntry_type_name, 0, 0, 0},
121095   {(char *)"level_name", __pyx_getprop_4lxml_5etree_9_LogEntry_level_name, 0, 0, 0},
121096   {0, 0, 0, 0, 0}
121097 };
121098
121099 static PyNumberMethods __pyx_tp_as_number__LogEntry = {
121100   0, /*nb_add*/
121101   0, /*nb_subtract*/
121102   0, /*nb_multiply*/
121103   #if PY_MAJOR_VERSION < 3
121104   0, /*nb_divide*/
121105   #endif
121106   0, /*nb_remainder*/
121107   0, /*nb_divmod*/
121108   0, /*nb_power*/
121109   0, /*nb_negative*/
121110   0, /*nb_positive*/
121111   0, /*nb_absolute*/
121112   0, /*nb_nonzero*/
121113   0, /*nb_invert*/
121114   0, /*nb_lshift*/
121115   0, /*nb_rshift*/
121116   0, /*nb_and*/
121117   0, /*nb_xor*/
121118   0, /*nb_or*/
121119   #if PY_MAJOR_VERSION < 3
121120   0, /*nb_coerce*/
121121   #endif
121122   0, /*nb_int*/
121123   #if PY_MAJOR_VERSION >= 3
121124   0, /*reserved*/
121125   #else
121126   0, /*nb_long*/
121127   #endif
121128   0, /*nb_float*/
121129   #if PY_MAJOR_VERSION < 3
121130   0, /*nb_oct*/
121131   #endif
121132   #if PY_MAJOR_VERSION < 3
121133   0, /*nb_hex*/
121134   #endif
121135   0, /*nb_inplace_add*/
121136   0, /*nb_inplace_subtract*/
121137   0, /*nb_inplace_multiply*/
121138   #if PY_MAJOR_VERSION < 3
121139   0, /*nb_inplace_divide*/
121140   #endif
121141   0, /*nb_inplace_remainder*/
121142   0, /*nb_inplace_power*/
121143   0, /*nb_inplace_lshift*/
121144   0, /*nb_inplace_rshift*/
121145   0, /*nb_inplace_and*/
121146   0, /*nb_inplace_xor*/
121147   0, /*nb_inplace_or*/
121148   0, /*nb_floor_divide*/
121149   0, /*nb_true_divide*/
121150   0, /*nb_inplace_floor_divide*/
121151   0, /*nb_inplace_true_divide*/
121152   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
121153   0, /*nb_index*/
121154   #endif
121155 };
121156
121157 static PySequenceMethods __pyx_tp_as_sequence__LogEntry = {
121158   0, /*sq_length*/
121159   0, /*sq_concat*/
121160   0, /*sq_repeat*/
121161   0, /*sq_item*/
121162   0, /*sq_slice*/
121163   0, /*sq_ass_item*/
121164   0, /*sq_ass_slice*/
121165   0, /*sq_contains*/
121166   0, /*sq_inplace_concat*/
121167   0, /*sq_inplace_repeat*/
121168 };
121169
121170 static PyMappingMethods __pyx_tp_as_mapping__LogEntry = {
121171   0, /*mp_length*/
121172   0, /*mp_subscript*/
121173   0, /*mp_ass_subscript*/
121174 };
121175
121176 static PyBufferProcs __pyx_tp_as_buffer__LogEntry = {
121177   #if PY_MAJOR_VERSION < 3
121178   0, /*bf_getreadbuffer*/
121179   #endif
121180   #if PY_MAJOR_VERSION < 3
121181   0, /*bf_getwritebuffer*/
121182   #endif
121183   #if PY_MAJOR_VERSION < 3
121184   0, /*bf_getsegcount*/
121185   #endif
121186   #if PY_MAJOR_VERSION < 3
121187   0, /*bf_getcharbuffer*/
121188   #endif
121189   #if PY_VERSION_HEX >= 0x02060000
121190   0, /*bf_getbuffer*/
121191   #endif
121192   #if PY_VERSION_HEX >= 0x02060000
121193   0, /*bf_releasebuffer*/
121194   #endif
121195 };
121196
121197 PyTypeObject __pyx_type_4lxml_5etree__LogEntry = {
121198   PyVarObject_HEAD_INIT(0, 0)
121199   __Pyx_NAMESTR("lxml.etree._LogEntry"), /*tp_name*/
121200   sizeof(struct __pyx_obj_4lxml_5etree__LogEntry), /*tp_basicsize*/
121201   0, /*tp_itemsize*/
121202   __pyx_tp_dealloc_4lxml_5etree__LogEntry, /*tp_dealloc*/
121203   0, /*tp_print*/
121204   0, /*tp_getattr*/
121205   0, /*tp_setattr*/
121206   0, /*tp_compare*/
121207   __pyx_pf_4lxml_5etree_9_LogEntry___repr__, /*tp_repr*/
121208   &__pyx_tp_as_number__LogEntry, /*tp_as_number*/
121209   &__pyx_tp_as_sequence__LogEntry, /*tp_as_sequence*/
121210   &__pyx_tp_as_mapping__LogEntry, /*tp_as_mapping*/
121211   0, /*tp_hash*/
121212   0, /*tp_call*/
121213   0, /*tp_str*/
121214   0, /*tp_getattro*/
121215   0, /*tp_setattro*/
121216   &__pyx_tp_as_buffer__LogEntry, /*tp_as_buffer*/
121217   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
121218   0, /*tp_doc*/
121219   __pyx_tp_traverse_4lxml_5etree__LogEntry, /*tp_traverse*/
121220   __pyx_tp_clear_4lxml_5etree__LogEntry, /*tp_clear*/
121221   0, /*tp_richcompare*/
121222   0, /*tp_weaklistoffset*/
121223   0, /*tp_iter*/
121224   0, /*tp_iternext*/
121225   __pyx_methods_4lxml_5etree__LogEntry, /*tp_methods*/
121226   __pyx_members_4lxml_5etree__LogEntry, /*tp_members*/
121227   __pyx_getsets_4lxml_5etree__LogEntry, /*tp_getset*/
121228   0, /*tp_base*/
121229   0, /*tp_dict*/
121230   0, /*tp_descr_get*/
121231   0, /*tp_descr_set*/
121232   0, /*tp_dictoffset*/
121233   0, /*tp_init*/
121234   0, /*tp_alloc*/
121235   __pyx_tp_new_4lxml_5etree__LogEntry, /*tp_new*/
121236   0, /*tp_free*/
121237   0, /*tp_is_gc*/
121238   0, /*tp_bases*/
121239   0, /*tp_mro*/
121240   0, /*tp_cache*/
121241   0, /*tp_subclasses*/
121242   0, /*tp_weaklist*/
121243 };
121244 static struct __pyx_vtabstruct_4lxml_5etree__BaseErrorLog __pyx_vtable_4lxml_5etree__BaseErrorLog;
121245
121246 static PyObject *__pyx_tp_new_4lxml_5etree__BaseErrorLog(PyTypeObject *t, PyObject *a, PyObject *k) {
121247   struct __pyx_obj_4lxml_5etree__BaseErrorLog *p;
121248   PyObject *o = (*t->tp_alloc)(t, 0);
121249   if (!o) return 0;
121250   p = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)o);
121251   p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__BaseErrorLog;
121252   p->_first_error = ((struct __pyx_obj_4lxml_5etree__LogEntry *)Py_None); Py_INCREF(Py_None);
121253   p->last_error = Py_None; Py_INCREF(Py_None);
121254   return o;
121255 }
121256
121257 static void __pyx_tp_dealloc_4lxml_5etree__BaseErrorLog(PyObject *o) {
121258   struct __pyx_obj_4lxml_5etree__BaseErrorLog *p = (struct __pyx_obj_4lxml_5etree__BaseErrorLog *)o;
121259   Py_XDECREF(((PyObject *)p->_first_error));
121260   Py_XDECREF(p->last_error);
121261   (*Py_TYPE(o)->tp_free)(o);
121262 }
121263
121264 static int __pyx_tp_traverse_4lxml_5etree__BaseErrorLog(PyObject *o, visitproc v, void *a) {
121265   int e;
121266   struct __pyx_obj_4lxml_5etree__BaseErrorLog *p = (struct __pyx_obj_4lxml_5etree__BaseErrorLog *)o;
121267   if (p->_first_error) {
121268     e = (*v)(((PyObject*)p->_first_error), a); if (e) return e;
121269   }
121270   if (p->last_error) {
121271     e = (*v)(p->last_error, a); if (e) return e;
121272   }
121273   return 0;
121274 }
121275
121276 static int __pyx_tp_clear_4lxml_5etree__BaseErrorLog(PyObject *o) {
121277   struct __pyx_obj_4lxml_5etree__BaseErrorLog *p = (struct __pyx_obj_4lxml_5etree__BaseErrorLog *)o;
121278   PyObject* tmp;
121279   tmp = ((PyObject*)p->_first_error);
121280   p->_first_error = ((struct __pyx_obj_4lxml_5etree__LogEntry *)Py_None); Py_INCREF(Py_None);
121281   Py_XDECREF(tmp);
121282   tmp = ((PyObject*)p->last_error);
121283   p->last_error = Py_None; Py_INCREF(Py_None);
121284   Py_XDECREF(tmp);
121285   return 0;
121286 }
121287
121288 static struct PyMethodDef __pyx_methods_4lxml_5etree__BaseErrorLog[] = {
121289   {__Pyx_NAMESTR("copy"), (PyCFunction)__pyx_pf_4lxml_5etree_13_BaseErrorLog_copy, METH_NOARGS, __Pyx_DOCSTR(0)},
121290   {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_4lxml_5etree_13_BaseErrorLog___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
121291   {0, 0, 0, 0}
121292 };
121293
121294 static struct PyMemberDef __pyx_members_4lxml_5etree__BaseErrorLog[] = {
121295   {(char *)"last_error", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree__BaseErrorLog, last_error), READONLY, 0},
121296   {0, 0, 0, 0, 0}
121297 };
121298
121299 static PyNumberMethods __pyx_tp_as_number__BaseErrorLog = {
121300   0, /*nb_add*/
121301   0, /*nb_subtract*/
121302   0, /*nb_multiply*/
121303   #if PY_MAJOR_VERSION < 3
121304   0, /*nb_divide*/
121305   #endif
121306   0, /*nb_remainder*/
121307   0, /*nb_divmod*/
121308   0, /*nb_power*/
121309   0, /*nb_negative*/
121310   0, /*nb_positive*/
121311   0, /*nb_absolute*/
121312   0, /*nb_nonzero*/
121313   0, /*nb_invert*/
121314   0, /*nb_lshift*/
121315   0, /*nb_rshift*/
121316   0, /*nb_and*/
121317   0, /*nb_xor*/
121318   0, /*nb_or*/
121319   #if PY_MAJOR_VERSION < 3
121320   0, /*nb_coerce*/
121321   #endif
121322   0, /*nb_int*/
121323   #if PY_MAJOR_VERSION >= 3
121324   0, /*reserved*/
121325   #else
121326   0, /*nb_long*/
121327   #endif
121328   0, /*nb_float*/
121329   #if PY_MAJOR_VERSION < 3
121330   0, /*nb_oct*/
121331   #endif
121332   #if PY_MAJOR_VERSION < 3
121333   0, /*nb_hex*/
121334   #endif
121335   0, /*nb_inplace_add*/
121336   0, /*nb_inplace_subtract*/
121337   0, /*nb_inplace_multiply*/
121338   #if PY_MAJOR_VERSION < 3
121339   0, /*nb_inplace_divide*/
121340   #endif
121341   0, /*nb_inplace_remainder*/
121342   0, /*nb_inplace_power*/
121343   0, /*nb_inplace_lshift*/
121344   0, /*nb_inplace_rshift*/
121345   0, /*nb_inplace_and*/
121346   0, /*nb_inplace_xor*/
121347   0, /*nb_inplace_or*/
121348   0, /*nb_floor_divide*/
121349   0, /*nb_true_divide*/
121350   0, /*nb_inplace_floor_divide*/
121351   0, /*nb_inplace_true_divide*/
121352   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
121353   0, /*nb_index*/
121354   #endif
121355 };
121356
121357 static PySequenceMethods __pyx_tp_as_sequence__BaseErrorLog = {
121358   0, /*sq_length*/
121359   0, /*sq_concat*/
121360   0, /*sq_repeat*/
121361   0, /*sq_item*/
121362   0, /*sq_slice*/
121363   0, /*sq_ass_item*/
121364   0, /*sq_ass_slice*/
121365   0, /*sq_contains*/
121366   0, /*sq_inplace_concat*/
121367   0, /*sq_inplace_repeat*/
121368 };
121369
121370 static PyMappingMethods __pyx_tp_as_mapping__BaseErrorLog = {
121371   0, /*mp_length*/
121372   0, /*mp_subscript*/
121373   0, /*mp_ass_subscript*/
121374 };
121375
121376 static PyBufferProcs __pyx_tp_as_buffer__BaseErrorLog = {
121377   #if PY_MAJOR_VERSION < 3
121378   0, /*bf_getreadbuffer*/
121379   #endif
121380   #if PY_MAJOR_VERSION < 3
121381   0, /*bf_getwritebuffer*/
121382   #endif
121383   #if PY_MAJOR_VERSION < 3
121384   0, /*bf_getsegcount*/
121385   #endif
121386   #if PY_MAJOR_VERSION < 3
121387   0, /*bf_getcharbuffer*/
121388   #endif
121389   #if PY_VERSION_HEX >= 0x02060000
121390   0, /*bf_getbuffer*/
121391   #endif
121392   #if PY_VERSION_HEX >= 0x02060000
121393   0, /*bf_releasebuffer*/
121394   #endif
121395 };
121396
121397 PyTypeObject __pyx_type_4lxml_5etree__BaseErrorLog = {
121398   PyVarObject_HEAD_INIT(0, 0)
121399   __Pyx_NAMESTR("lxml.etree._BaseErrorLog"), /*tp_name*/
121400   sizeof(struct __pyx_obj_4lxml_5etree__BaseErrorLog), /*tp_basicsize*/
121401   0, /*tp_itemsize*/
121402   __pyx_tp_dealloc_4lxml_5etree__BaseErrorLog, /*tp_dealloc*/
121403   0, /*tp_print*/
121404   0, /*tp_getattr*/
121405   0, /*tp_setattr*/
121406   0, /*tp_compare*/
121407   __pyx_pf_4lxml_5etree_13_BaseErrorLog___repr__, /*tp_repr*/
121408   &__pyx_tp_as_number__BaseErrorLog, /*tp_as_number*/
121409   &__pyx_tp_as_sequence__BaseErrorLog, /*tp_as_sequence*/
121410   &__pyx_tp_as_mapping__BaseErrorLog, /*tp_as_mapping*/
121411   0, /*tp_hash*/
121412   0, /*tp_call*/
121413   0, /*tp_str*/
121414   0, /*tp_getattro*/
121415   0, /*tp_setattro*/
121416   &__pyx_tp_as_buffer__BaseErrorLog, /*tp_as_buffer*/
121417   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
121418   0, /*tp_doc*/
121419   __pyx_tp_traverse_4lxml_5etree__BaseErrorLog, /*tp_traverse*/
121420   __pyx_tp_clear_4lxml_5etree__BaseErrorLog, /*tp_clear*/
121421   0, /*tp_richcompare*/
121422   0, /*tp_weaklistoffset*/
121423   0, /*tp_iter*/
121424   0, /*tp_iternext*/
121425   __pyx_methods_4lxml_5etree__BaseErrorLog, /*tp_methods*/
121426   __pyx_members_4lxml_5etree__BaseErrorLog, /*tp_members*/
121427   0, /*tp_getset*/
121428   0, /*tp_base*/
121429   0, /*tp_dict*/
121430   0, /*tp_descr_get*/
121431   0, /*tp_descr_set*/
121432   0, /*tp_dictoffset*/
121433   __pyx_pf_4lxml_5etree_13_BaseErrorLog___init__, /*tp_init*/
121434   0, /*tp_alloc*/
121435   __pyx_tp_new_4lxml_5etree__BaseErrorLog, /*tp_new*/
121436   0, /*tp_free*/
121437   0, /*tp_is_gc*/
121438   0, /*tp_bases*/
121439   0, /*tp_mro*/
121440   0, /*tp_cache*/
121441   0, /*tp_subclasses*/
121442   0, /*tp_weaklist*/
121443 };
121444 static struct __pyx_vtabstruct_4lxml_5etree__ListErrorLog __pyx_vtable_4lxml_5etree__ListErrorLog;
121445
121446 static PyObject *__pyx_tp_new_4lxml_5etree__ListErrorLog(PyTypeObject *t, PyObject *a, PyObject *k) {
121447   struct __pyx_obj_4lxml_5etree__ListErrorLog *p;
121448   PyObject *o = __pyx_tp_new_4lxml_5etree__BaseErrorLog(t, a, k);
121449   if (!o) return 0;
121450   p = ((struct __pyx_obj_4lxml_5etree__ListErrorLog *)o);
121451   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__BaseErrorLog*)__pyx_vtabptr_4lxml_5etree__ListErrorLog;
121452   p->_entries = ((PyObject *)Py_None); Py_INCREF(Py_None);
121453   return o;
121454 }
121455
121456 static void __pyx_tp_dealloc_4lxml_5etree__ListErrorLog(PyObject *o) {
121457   struct __pyx_obj_4lxml_5etree__ListErrorLog *p = (struct __pyx_obj_4lxml_5etree__ListErrorLog *)o;
121458   Py_XDECREF(((PyObject *)p->_entries));
121459   __pyx_tp_dealloc_4lxml_5etree__BaseErrorLog(o);
121460 }
121461
121462 static int __pyx_tp_traverse_4lxml_5etree__ListErrorLog(PyObject *o, visitproc v, void *a) {
121463   int e;
121464   struct __pyx_obj_4lxml_5etree__ListErrorLog *p = (struct __pyx_obj_4lxml_5etree__ListErrorLog *)o;
121465   e = __pyx_tp_traverse_4lxml_5etree__BaseErrorLog(o, v, a); if (e) return e;
121466   if (p->_entries) {
121467     e = (*v)(p->_entries, a); if (e) return e;
121468   }
121469   return 0;
121470 }
121471
121472 static int __pyx_tp_clear_4lxml_5etree__ListErrorLog(PyObject *o) {
121473   struct __pyx_obj_4lxml_5etree__ListErrorLog *p = (struct __pyx_obj_4lxml_5etree__ListErrorLog *)o;
121474   PyObject* tmp;
121475   __pyx_tp_clear_4lxml_5etree__BaseErrorLog(o);
121476   tmp = ((PyObject*)p->_entries);
121477   p->_entries = ((PyObject *)Py_None); Py_INCREF(Py_None);
121478   Py_XDECREF(tmp);
121479   return 0;
121480 }
121481 static PyObject *__pyx_sq_item_4lxml_5etree__ListErrorLog(PyObject *o, Py_ssize_t i) {
121482   PyObject *r;
121483   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
121484   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
121485   Py_DECREF(x);
121486   return r;
121487 }
121488
121489 static struct PyMethodDef __pyx_methods_4lxml_5etree__ListErrorLog[] = {
121490   {__Pyx_NAMESTR("copy"), (PyCFunction)__pyx_pf_4lxml_5etree_13_ListErrorLog_copy, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_13_ListErrorLog_copy)},
121491   {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_4lxml_5etree_13_ListErrorLog___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
121492   {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_4lxml_5etree_13_ListErrorLog___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
121493   {__Pyx_NAMESTR("__getitem__"), (PyCFunction)__pyx_pf_4lxml_5etree_13_ListErrorLog___getitem__, METH_O|METH_COEXIST, __Pyx_DOCSTR(0)},
121494   {__Pyx_NAMESTR("filter_domains"), (PyCFunction)__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_domains, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_13_ListErrorLog_filter_domains)},
121495   {__Pyx_NAMESTR("filter_types"), (PyCFunction)__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_types, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_13_ListErrorLog_filter_types)},
121496   {__Pyx_NAMESTR("filter_levels"), (PyCFunction)__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_levels, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_13_ListErrorLog_filter_levels)},
121497   {__Pyx_NAMESTR("filter_from_level"), (PyCFunction)__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_from_level, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_13_ListErrorLog_filter_from_level)},
121498   {__Pyx_NAMESTR("filter_from_fatals"), (PyCFunction)__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_from_fatals, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_13_ListErrorLog_filter_from_fatals)},
121499   {__Pyx_NAMESTR("filter_from_errors"), (PyCFunction)__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_from_errors, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_13_ListErrorLog_filter_from_errors)},
121500   {__Pyx_NAMESTR("filter_from_warnings"), (PyCFunction)__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_from_warnings, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_13_ListErrorLog_filter_from_warnings)},
121501   {0, 0, 0, 0}
121502 };
121503
121504 static PyNumberMethods __pyx_tp_as_number__ListErrorLog = {
121505   0, /*nb_add*/
121506   0, /*nb_subtract*/
121507   0, /*nb_multiply*/
121508   #if PY_MAJOR_VERSION < 3
121509   0, /*nb_divide*/
121510   #endif
121511   0, /*nb_remainder*/
121512   0, /*nb_divmod*/
121513   0, /*nb_power*/
121514   0, /*nb_negative*/
121515   0, /*nb_positive*/
121516   0, /*nb_absolute*/
121517   __pyx_pf_4lxml_5etree_13_ListErrorLog___nonzero__, /*nb_nonzero*/
121518   0, /*nb_invert*/
121519   0, /*nb_lshift*/
121520   0, /*nb_rshift*/
121521   0, /*nb_and*/
121522   0, /*nb_xor*/
121523   0, /*nb_or*/
121524   #if PY_MAJOR_VERSION < 3
121525   0, /*nb_coerce*/
121526   #endif
121527   0, /*nb_int*/
121528   #if PY_MAJOR_VERSION >= 3
121529   0, /*reserved*/
121530   #else
121531   0, /*nb_long*/
121532   #endif
121533   0, /*nb_float*/
121534   #if PY_MAJOR_VERSION < 3
121535   0, /*nb_oct*/
121536   #endif
121537   #if PY_MAJOR_VERSION < 3
121538   0, /*nb_hex*/
121539   #endif
121540   0, /*nb_inplace_add*/
121541   0, /*nb_inplace_subtract*/
121542   0, /*nb_inplace_multiply*/
121543   #if PY_MAJOR_VERSION < 3
121544   0, /*nb_inplace_divide*/
121545   #endif
121546   0, /*nb_inplace_remainder*/
121547   0, /*nb_inplace_power*/
121548   0, /*nb_inplace_lshift*/
121549   0, /*nb_inplace_rshift*/
121550   0, /*nb_inplace_and*/
121551   0, /*nb_inplace_xor*/
121552   0, /*nb_inplace_or*/
121553   0, /*nb_floor_divide*/
121554   0, /*nb_true_divide*/
121555   0, /*nb_inplace_floor_divide*/
121556   0, /*nb_inplace_true_divide*/
121557   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
121558   0, /*nb_index*/
121559   #endif
121560 };
121561
121562 static PySequenceMethods __pyx_tp_as_sequence__ListErrorLog = {
121563   __pyx_pf_4lxml_5etree_13_ListErrorLog___len__, /*sq_length*/
121564   0, /*sq_concat*/
121565   0, /*sq_repeat*/
121566   __pyx_sq_item_4lxml_5etree__ListErrorLog, /*sq_item*/
121567   0, /*sq_slice*/
121568   0, /*sq_ass_item*/
121569   0, /*sq_ass_slice*/
121570   __pyx_pf_4lxml_5etree_13_ListErrorLog___contains__, /*sq_contains*/
121571   0, /*sq_inplace_concat*/
121572   0, /*sq_inplace_repeat*/
121573 };
121574
121575 static PyMappingMethods __pyx_tp_as_mapping__ListErrorLog = {
121576   __pyx_pf_4lxml_5etree_13_ListErrorLog___len__, /*mp_length*/
121577   __pyx_pf_4lxml_5etree_13_ListErrorLog___getitem__, /*mp_subscript*/
121578   0, /*mp_ass_subscript*/
121579 };
121580
121581 static PyBufferProcs __pyx_tp_as_buffer__ListErrorLog = {
121582   #if PY_MAJOR_VERSION < 3
121583   0, /*bf_getreadbuffer*/
121584   #endif
121585   #if PY_MAJOR_VERSION < 3
121586   0, /*bf_getwritebuffer*/
121587   #endif
121588   #if PY_MAJOR_VERSION < 3
121589   0, /*bf_getsegcount*/
121590   #endif
121591   #if PY_MAJOR_VERSION < 3
121592   0, /*bf_getcharbuffer*/
121593   #endif
121594   #if PY_VERSION_HEX >= 0x02060000
121595   0, /*bf_getbuffer*/
121596   #endif
121597   #if PY_VERSION_HEX >= 0x02060000
121598   0, /*bf_releasebuffer*/
121599   #endif
121600 };
121601
121602 PyTypeObject __pyx_type_4lxml_5etree__ListErrorLog = {
121603   PyVarObject_HEAD_INIT(0, 0)
121604   __Pyx_NAMESTR("lxml.etree._ListErrorLog"), /*tp_name*/
121605   sizeof(struct __pyx_obj_4lxml_5etree__ListErrorLog), /*tp_basicsize*/
121606   0, /*tp_itemsize*/
121607   __pyx_tp_dealloc_4lxml_5etree__ListErrorLog, /*tp_dealloc*/
121608   0, /*tp_print*/
121609   0, /*tp_getattr*/
121610   0, /*tp_setattr*/
121611   0, /*tp_compare*/
121612   __pyx_pf_4lxml_5etree_13_ListErrorLog___repr__, /*tp_repr*/
121613   &__pyx_tp_as_number__ListErrorLog, /*tp_as_number*/
121614   &__pyx_tp_as_sequence__ListErrorLog, /*tp_as_sequence*/
121615   &__pyx_tp_as_mapping__ListErrorLog, /*tp_as_mapping*/
121616   0, /*tp_hash*/
121617   0, /*tp_call*/
121618   0, /*tp_str*/
121619   0, /*tp_getattro*/
121620   0, /*tp_setattro*/
121621   &__pyx_tp_as_buffer__ListErrorLog, /*tp_as_buffer*/
121622   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
121623   __Pyx_DOCSTR("Immutable base version of a list based error log."), /*tp_doc*/
121624   __pyx_tp_traverse_4lxml_5etree__ListErrorLog, /*tp_traverse*/
121625   __pyx_tp_clear_4lxml_5etree__ListErrorLog, /*tp_clear*/
121626   0, /*tp_richcompare*/
121627   0, /*tp_weaklistoffset*/
121628   __pyx_pf_4lxml_5etree_13_ListErrorLog___iter__, /*tp_iter*/
121629   0, /*tp_iternext*/
121630   __pyx_methods_4lxml_5etree__ListErrorLog, /*tp_methods*/
121631   0, /*tp_members*/
121632   0, /*tp_getset*/
121633   0, /*tp_base*/
121634   0, /*tp_dict*/
121635   0, /*tp_descr_get*/
121636   0, /*tp_descr_set*/
121637   0, /*tp_dictoffset*/
121638   __pyx_pf_4lxml_5etree_13_ListErrorLog___init__, /*tp_init*/
121639   0, /*tp_alloc*/
121640   __pyx_tp_new_4lxml_5etree__ListErrorLog, /*tp_new*/
121641   0, /*tp_free*/
121642   0, /*tp_is_gc*/
121643   0, /*tp_bases*/
121644   0, /*tp_mro*/
121645   0, /*tp_cache*/
121646   0, /*tp_subclasses*/
121647   0, /*tp_weaklist*/
121648 };
121649 static struct __pyx_vtabstruct_4lxml_5etree__ErrorLog __pyx_vtable_4lxml_5etree__ErrorLog;
121650
121651 static PyObject *__pyx_tp_new_4lxml_5etree__ErrorLog(PyTypeObject *t, PyObject *a, PyObject *k) {
121652   struct __pyx_obj_4lxml_5etree__ErrorLog *p;
121653   PyObject *o = __pyx_tp_new_4lxml_5etree__ListErrorLog(t, a, k);
121654   if (!o) return 0;
121655   p = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)o);
121656   p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__BaseErrorLog*)__pyx_vtabptr_4lxml_5etree__ErrorLog;
121657   return o;
121658 }
121659
121660 static struct PyMethodDef __pyx_methods_4lxml_5etree__ErrorLog[] = {
121661   {__Pyx_NAMESTR("clear"), (PyCFunction)__pyx_pf_4lxml_5etree_9_ErrorLog_clear, METH_NOARGS, __Pyx_DOCSTR(0)},
121662   {__Pyx_NAMESTR("copy"), (PyCFunction)__pyx_pf_4lxml_5etree_9_ErrorLog_copy, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_9_ErrorLog_copy)},
121663   {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_4lxml_5etree_9_ErrorLog___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
121664   {__Pyx_NAMESTR("receive"), (PyCFunction)__pyx_pf_4lxml_5etree_9_ErrorLog_receive, METH_O, __Pyx_DOCSTR(0)},
121665   {0, 0, 0, 0}
121666 };
121667
121668 static PyNumberMethods __pyx_tp_as_number__ErrorLog = {
121669   0, /*nb_add*/
121670   0, /*nb_subtract*/
121671   0, /*nb_multiply*/
121672   #if PY_MAJOR_VERSION < 3
121673   0, /*nb_divide*/
121674   #endif
121675   0, /*nb_remainder*/
121676   0, /*nb_divmod*/
121677   0, /*nb_power*/
121678   0, /*nb_negative*/
121679   0, /*nb_positive*/
121680   0, /*nb_absolute*/
121681   0, /*nb_nonzero*/
121682   0, /*nb_invert*/
121683   0, /*nb_lshift*/
121684   0, /*nb_rshift*/
121685   0, /*nb_and*/
121686   0, /*nb_xor*/
121687   0, /*nb_or*/
121688   #if PY_MAJOR_VERSION < 3
121689   0, /*nb_coerce*/
121690   #endif
121691   0, /*nb_int*/
121692   #if PY_MAJOR_VERSION >= 3
121693   0, /*reserved*/
121694   #else
121695   0, /*nb_long*/
121696   #endif
121697   0, /*nb_float*/
121698   #if PY_MAJOR_VERSION < 3
121699   0, /*nb_oct*/
121700   #endif
121701   #if PY_MAJOR_VERSION < 3
121702   0, /*nb_hex*/
121703   #endif
121704   0, /*nb_inplace_add*/
121705   0, /*nb_inplace_subtract*/
121706   0, /*nb_inplace_multiply*/
121707   #if PY_MAJOR_VERSION < 3
121708   0, /*nb_inplace_divide*/
121709   #endif
121710   0, /*nb_inplace_remainder*/
121711   0, /*nb_inplace_power*/
121712   0, /*nb_inplace_lshift*/
121713   0, /*nb_inplace_rshift*/
121714   0, /*nb_inplace_and*/
121715   0, /*nb_inplace_xor*/
121716   0, /*nb_inplace_or*/
121717   0, /*nb_floor_divide*/
121718   0, /*nb_true_divide*/
121719   0, /*nb_inplace_floor_divide*/
121720   0, /*nb_inplace_true_divide*/
121721   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
121722   0, /*nb_index*/
121723   #endif
121724 };
121725
121726 static PySequenceMethods __pyx_tp_as_sequence__ErrorLog = {
121727   0, /*sq_length*/
121728   0, /*sq_concat*/
121729   0, /*sq_repeat*/
121730   0, /*sq_item*/
121731   0, /*sq_slice*/
121732   0, /*sq_ass_item*/
121733   0, /*sq_ass_slice*/
121734   0, /*sq_contains*/
121735   0, /*sq_inplace_concat*/
121736   0, /*sq_inplace_repeat*/
121737 };
121738
121739 static PyMappingMethods __pyx_tp_as_mapping__ErrorLog = {
121740   0, /*mp_length*/
121741   0, /*mp_subscript*/
121742   0, /*mp_ass_subscript*/
121743 };
121744
121745 static PyBufferProcs __pyx_tp_as_buffer__ErrorLog = {
121746   #if PY_MAJOR_VERSION < 3
121747   0, /*bf_getreadbuffer*/
121748   #endif
121749   #if PY_MAJOR_VERSION < 3
121750   0, /*bf_getwritebuffer*/
121751   #endif
121752   #if PY_MAJOR_VERSION < 3
121753   0, /*bf_getsegcount*/
121754   #endif
121755   #if PY_MAJOR_VERSION < 3
121756   0, /*bf_getcharbuffer*/
121757   #endif
121758   #if PY_VERSION_HEX >= 0x02060000
121759   0, /*bf_getbuffer*/
121760   #endif
121761   #if PY_VERSION_HEX >= 0x02060000
121762   0, /*bf_releasebuffer*/
121763   #endif
121764 };
121765
121766 PyTypeObject __pyx_type_4lxml_5etree__ErrorLog = {
121767   PyVarObject_HEAD_INIT(0, 0)
121768   __Pyx_NAMESTR("lxml.etree._ErrorLog"), /*tp_name*/
121769   sizeof(struct __pyx_obj_4lxml_5etree__ErrorLog), /*tp_basicsize*/
121770   0, /*tp_itemsize*/
121771   __pyx_tp_dealloc_4lxml_5etree__ListErrorLog, /*tp_dealloc*/
121772   0, /*tp_print*/
121773   0, /*tp_getattr*/
121774   0, /*tp_setattr*/
121775   0, /*tp_compare*/
121776   0, /*tp_repr*/
121777   &__pyx_tp_as_number__ErrorLog, /*tp_as_number*/
121778   &__pyx_tp_as_sequence__ErrorLog, /*tp_as_sequence*/
121779   &__pyx_tp_as_mapping__ErrorLog, /*tp_as_mapping*/
121780   0, /*tp_hash*/
121781   0, /*tp_call*/
121782   0, /*tp_str*/
121783   0, /*tp_getattro*/
121784   0, /*tp_setattro*/
121785   &__pyx_tp_as_buffer__ErrorLog, /*tp_as_buffer*/
121786   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
121787   0, /*tp_doc*/
121788   __pyx_tp_traverse_4lxml_5etree__ListErrorLog, /*tp_traverse*/
121789   __pyx_tp_clear_4lxml_5etree__ListErrorLog, /*tp_clear*/
121790   0, /*tp_richcompare*/
121791   0, /*tp_weaklistoffset*/
121792   __pyx_pf_4lxml_5etree_9_ErrorLog___iter__, /*tp_iter*/
121793   0, /*tp_iternext*/
121794   __pyx_methods_4lxml_5etree__ErrorLog, /*tp_methods*/
121795   0, /*tp_members*/
121796   0, /*tp_getset*/
121797   0, /*tp_base*/
121798   0, /*tp_dict*/
121799   0, /*tp_descr_get*/
121800   0, /*tp_descr_set*/
121801   0, /*tp_dictoffset*/
121802   __pyx_pf_4lxml_5etree_9_ErrorLog___init__, /*tp_init*/
121803   0, /*tp_alloc*/
121804   __pyx_tp_new_4lxml_5etree__ErrorLog, /*tp_new*/
121805   0, /*tp_free*/
121806   0, /*tp_is_gc*/
121807   0, /*tp_bases*/
121808   0, /*tp_mro*/
121809   0, /*tp_cache*/
121810   0, /*tp_subclasses*/
121811   0, /*tp_weaklist*/
121812 };
121813 static struct __pyx_vtabstruct_4lxml_5etree__DomainErrorLog __pyx_vtable_4lxml_5etree__DomainErrorLog;
121814
121815 static PyObject *__pyx_tp_new_4lxml_5etree__DomainErrorLog(PyTypeObject *t, PyObject *a, PyObject *k) {
121816   struct __pyx_obj_4lxml_5etree__DomainErrorLog *p;
121817   PyObject *o = __pyx_tp_new_4lxml_5etree__ListErrorLog(t, a, k);
121818   if (!o) return 0;
121819   p = ((struct __pyx_obj_4lxml_5etree__DomainErrorLog *)o);
121820   p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__BaseErrorLog*)__pyx_vtabptr_4lxml_5etree__DomainErrorLog;
121821   return o;
121822 }
121823
121824 static struct PyMethodDef __pyx_methods_4lxml_5etree__DomainErrorLog[] = {
121825   {__Pyx_NAMESTR("receive"), (PyCFunction)__pyx_pf_4lxml_5etree_15_DomainErrorLog_receive, METH_O, __Pyx_DOCSTR(0)},
121826   {0, 0, 0, 0}
121827 };
121828
121829 static PyNumberMethods __pyx_tp_as_number__DomainErrorLog = {
121830   0, /*nb_add*/
121831   0, /*nb_subtract*/
121832   0, /*nb_multiply*/
121833   #if PY_MAJOR_VERSION < 3
121834   0, /*nb_divide*/
121835   #endif
121836   0, /*nb_remainder*/
121837   0, /*nb_divmod*/
121838   0, /*nb_power*/
121839   0, /*nb_negative*/
121840   0, /*nb_positive*/
121841   0, /*nb_absolute*/
121842   0, /*nb_nonzero*/
121843   0, /*nb_invert*/
121844   0, /*nb_lshift*/
121845   0, /*nb_rshift*/
121846   0, /*nb_and*/
121847   0, /*nb_xor*/
121848   0, /*nb_or*/
121849   #if PY_MAJOR_VERSION < 3
121850   0, /*nb_coerce*/
121851   #endif
121852   0, /*nb_int*/
121853   #if PY_MAJOR_VERSION >= 3
121854   0, /*reserved*/
121855   #else
121856   0, /*nb_long*/
121857   #endif
121858   0, /*nb_float*/
121859   #if PY_MAJOR_VERSION < 3
121860   0, /*nb_oct*/
121861   #endif
121862   #if PY_MAJOR_VERSION < 3
121863   0, /*nb_hex*/
121864   #endif
121865   0, /*nb_inplace_add*/
121866   0, /*nb_inplace_subtract*/
121867   0, /*nb_inplace_multiply*/
121868   #if PY_MAJOR_VERSION < 3
121869   0, /*nb_inplace_divide*/
121870   #endif
121871   0, /*nb_inplace_remainder*/
121872   0, /*nb_inplace_power*/
121873   0, /*nb_inplace_lshift*/
121874   0, /*nb_inplace_rshift*/
121875   0, /*nb_inplace_and*/
121876   0, /*nb_inplace_xor*/
121877   0, /*nb_inplace_or*/
121878   0, /*nb_floor_divide*/
121879   0, /*nb_true_divide*/
121880   0, /*nb_inplace_floor_divide*/
121881   0, /*nb_inplace_true_divide*/
121882   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
121883   0, /*nb_index*/
121884   #endif
121885 };
121886
121887 static PySequenceMethods __pyx_tp_as_sequence__DomainErrorLog = {
121888   0, /*sq_length*/
121889   0, /*sq_concat*/
121890   0, /*sq_repeat*/
121891   0, /*sq_item*/
121892   0, /*sq_slice*/
121893   0, /*sq_ass_item*/
121894   0, /*sq_ass_slice*/
121895   0, /*sq_contains*/
121896   0, /*sq_inplace_concat*/
121897   0, /*sq_inplace_repeat*/
121898 };
121899
121900 static PyMappingMethods __pyx_tp_as_mapping__DomainErrorLog = {
121901   0, /*mp_length*/
121902   0, /*mp_subscript*/
121903   0, /*mp_ass_subscript*/
121904 };
121905
121906 static PyBufferProcs __pyx_tp_as_buffer__DomainErrorLog = {
121907   #if PY_MAJOR_VERSION < 3
121908   0, /*bf_getreadbuffer*/
121909   #endif
121910   #if PY_MAJOR_VERSION < 3
121911   0, /*bf_getwritebuffer*/
121912   #endif
121913   #if PY_MAJOR_VERSION < 3
121914   0, /*bf_getsegcount*/
121915   #endif
121916   #if PY_MAJOR_VERSION < 3
121917   0, /*bf_getcharbuffer*/
121918   #endif
121919   #if PY_VERSION_HEX >= 0x02060000
121920   0, /*bf_getbuffer*/
121921   #endif
121922   #if PY_VERSION_HEX >= 0x02060000
121923   0, /*bf_releasebuffer*/
121924   #endif
121925 };
121926
121927 PyTypeObject __pyx_type_4lxml_5etree__DomainErrorLog = {
121928   PyVarObject_HEAD_INIT(0, 0)
121929   __Pyx_NAMESTR("lxml.etree._DomainErrorLog"), /*tp_name*/
121930   sizeof(struct __pyx_obj_4lxml_5etree__DomainErrorLog), /*tp_basicsize*/
121931   0, /*tp_itemsize*/
121932   __pyx_tp_dealloc_4lxml_5etree__ListErrorLog, /*tp_dealloc*/
121933   0, /*tp_print*/
121934   0, /*tp_getattr*/
121935   0, /*tp_setattr*/
121936   0, /*tp_compare*/
121937   0, /*tp_repr*/
121938   &__pyx_tp_as_number__DomainErrorLog, /*tp_as_number*/
121939   &__pyx_tp_as_sequence__DomainErrorLog, /*tp_as_sequence*/
121940   &__pyx_tp_as_mapping__DomainErrorLog, /*tp_as_mapping*/
121941   0, /*tp_hash*/
121942   0, /*tp_call*/
121943   0, /*tp_str*/
121944   0, /*tp_getattro*/
121945   0, /*tp_setattro*/
121946   &__pyx_tp_as_buffer__DomainErrorLog, /*tp_as_buffer*/
121947   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
121948   0, /*tp_doc*/
121949   __pyx_tp_traverse_4lxml_5etree__ListErrorLog, /*tp_traverse*/
121950   __pyx_tp_clear_4lxml_5etree__ListErrorLog, /*tp_clear*/
121951   0, /*tp_richcompare*/
121952   0, /*tp_weaklistoffset*/
121953   0, /*tp_iter*/
121954   0, /*tp_iternext*/
121955   __pyx_methods_4lxml_5etree__DomainErrorLog, /*tp_methods*/
121956   0, /*tp_members*/
121957   0, /*tp_getset*/
121958   0, /*tp_base*/
121959   0, /*tp_dict*/
121960   0, /*tp_descr_get*/
121961   0, /*tp_descr_set*/
121962   0, /*tp_dictoffset*/
121963   __pyx_pf_4lxml_5etree_15_DomainErrorLog___init__, /*tp_init*/
121964   0, /*tp_alloc*/
121965   __pyx_tp_new_4lxml_5etree__DomainErrorLog, /*tp_new*/
121966   0, /*tp_free*/
121967   0, /*tp_is_gc*/
121968   0, /*tp_bases*/
121969   0, /*tp_mro*/
121970   0, /*tp_cache*/
121971   0, /*tp_subclasses*/
121972   0, /*tp_weaklist*/
121973 };
121974 static struct __pyx_vtabstruct_4lxml_5etree__RotatingErrorLog __pyx_vtable_4lxml_5etree__RotatingErrorLog;
121975
121976 static PyObject *__pyx_tp_new_4lxml_5etree__RotatingErrorLog(PyTypeObject *t, PyObject *a, PyObject *k) {
121977   struct __pyx_obj_4lxml_5etree__RotatingErrorLog *p;
121978   PyObject *o = __pyx_tp_new_4lxml_5etree__ListErrorLog(t, a, k);
121979   if (!o) return 0;
121980   p = ((struct __pyx_obj_4lxml_5etree__RotatingErrorLog *)o);
121981   p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__BaseErrorLog*)__pyx_vtabptr_4lxml_5etree__RotatingErrorLog;
121982   return o;
121983 }
121984
121985 static struct PyMethodDef __pyx_methods_4lxml_5etree__RotatingErrorLog[] = {
121986   {__Pyx_NAMESTR("receive"), (PyCFunction)__pyx_pf_4lxml_5etree_17_RotatingErrorLog_receive, METH_O, __Pyx_DOCSTR(0)},
121987   {0, 0, 0, 0}
121988 };
121989
121990 static PyNumberMethods __pyx_tp_as_number__RotatingErrorLog = {
121991   0, /*nb_add*/
121992   0, /*nb_subtract*/
121993   0, /*nb_multiply*/
121994   #if PY_MAJOR_VERSION < 3
121995   0, /*nb_divide*/
121996   #endif
121997   0, /*nb_remainder*/
121998   0, /*nb_divmod*/
121999   0, /*nb_power*/
122000   0, /*nb_negative*/
122001   0, /*nb_positive*/
122002   0, /*nb_absolute*/
122003   0, /*nb_nonzero*/
122004   0, /*nb_invert*/
122005   0, /*nb_lshift*/
122006   0, /*nb_rshift*/
122007   0, /*nb_and*/
122008   0, /*nb_xor*/
122009   0, /*nb_or*/
122010   #if PY_MAJOR_VERSION < 3
122011   0, /*nb_coerce*/
122012   #endif
122013   0, /*nb_int*/
122014   #if PY_MAJOR_VERSION >= 3
122015   0, /*reserved*/
122016   #else
122017   0, /*nb_long*/
122018   #endif
122019   0, /*nb_float*/
122020   #if PY_MAJOR_VERSION < 3
122021   0, /*nb_oct*/
122022   #endif
122023   #if PY_MAJOR_VERSION < 3
122024   0, /*nb_hex*/
122025   #endif
122026   0, /*nb_inplace_add*/
122027   0, /*nb_inplace_subtract*/
122028   0, /*nb_inplace_multiply*/
122029   #if PY_MAJOR_VERSION < 3
122030   0, /*nb_inplace_divide*/
122031   #endif
122032   0, /*nb_inplace_remainder*/
122033   0, /*nb_inplace_power*/
122034   0, /*nb_inplace_lshift*/
122035   0, /*nb_inplace_rshift*/
122036   0, /*nb_inplace_and*/
122037   0, /*nb_inplace_xor*/
122038   0, /*nb_inplace_or*/
122039   0, /*nb_floor_divide*/
122040   0, /*nb_true_divide*/
122041   0, /*nb_inplace_floor_divide*/
122042   0, /*nb_inplace_true_divide*/
122043   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
122044   0, /*nb_index*/
122045   #endif
122046 };
122047
122048 static PySequenceMethods __pyx_tp_as_sequence__RotatingErrorLog = {
122049   0, /*sq_length*/
122050   0, /*sq_concat*/
122051   0, /*sq_repeat*/
122052   0, /*sq_item*/
122053   0, /*sq_slice*/
122054   0, /*sq_ass_item*/
122055   0, /*sq_ass_slice*/
122056   0, /*sq_contains*/
122057   0, /*sq_inplace_concat*/
122058   0, /*sq_inplace_repeat*/
122059 };
122060
122061 static PyMappingMethods __pyx_tp_as_mapping__RotatingErrorLog = {
122062   0, /*mp_length*/
122063   0, /*mp_subscript*/
122064   0, /*mp_ass_subscript*/
122065 };
122066
122067 static PyBufferProcs __pyx_tp_as_buffer__RotatingErrorLog = {
122068   #if PY_MAJOR_VERSION < 3
122069   0, /*bf_getreadbuffer*/
122070   #endif
122071   #if PY_MAJOR_VERSION < 3
122072   0, /*bf_getwritebuffer*/
122073   #endif
122074   #if PY_MAJOR_VERSION < 3
122075   0, /*bf_getsegcount*/
122076   #endif
122077   #if PY_MAJOR_VERSION < 3
122078   0, /*bf_getcharbuffer*/
122079   #endif
122080   #if PY_VERSION_HEX >= 0x02060000
122081   0, /*bf_getbuffer*/
122082   #endif
122083   #if PY_VERSION_HEX >= 0x02060000
122084   0, /*bf_releasebuffer*/
122085   #endif
122086 };
122087
122088 PyTypeObject __pyx_type_4lxml_5etree__RotatingErrorLog = {
122089   PyVarObject_HEAD_INIT(0, 0)
122090   __Pyx_NAMESTR("lxml.etree._RotatingErrorLog"), /*tp_name*/
122091   sizeof(struct __pyx_obj_4lxml_5etree__RotatingErrorLog), /*tp_basicsize*/
122092   0, /*tp_itemsize*/
122093   __pyx_tp_dealloc_4lxml_5etree__ListErrorLog, /*tp_dealloc*/
122094   0, /*tp_print*/
122095   0, /*tp_getattr*/
122096   0, /*tp_setattr*/
122097   0, /*tp_compare*/
122098   0, /*tp_repr*/
122099   &__pyx_tp_as_number__RotatingErrorLog, /*tp_as_number*/
122100   &__pyx_tp_as_sequence__RotatingErrorLog, /*tp_as_sequence*/
122101   &__pyx_tp_as_mapping__RotatingErrorLog, /*tp_as_mapping*/
122102   0, /*tp_hash*/
122103   0, /*tp_call*/
122104   0, /*tp_str*/
122105   0, /*tp_getattro*/
122106   0, /*tp_setattro*/
122107   &__pyx_tp_as_buffer__RotatingErrorLog, /*tp_as_buffer*/
122108   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
122109   0, /*tp_doc*/
122110   __pyx_tp_traverse_4lxml_5etree__ListErrorLog, /*tp_traverse*/
122111   __pyx_tp_clear_4lxml_5etree__ListErrorLog, /*tp_clear*/
122112   0, /*tp_richcompare*/
122113   0, /*tp_weaklistoffset*/
122114   0, /*tp_iter*/
122115   0, /*tp_iternext*/
122116   __pyx_methods_4lxml_5etree__RotatingErrorLog, /*tp_methods*/
122117   0, /*tp_members*/
122118   0, /*tp_getset*/
122119   0, /*tp_base*/
122120   0, /*tp_dict*/
122121   0, /*tp_descr_get*/
122122   0, /*tp_descr_set*/
122123   0, /*tp_dictoffset*/
122124   __pyx_pf_4lxml_5etree_17_RotatingErrorLog___init__, /*tp_init*/
122125   0, /*tp_alloc*/
122126   __pyx_tp_new_4lxml_5etree__RotatingErrorLog, /*tp_new*/
122127   0, /*tp_free*/
122128   0, /*tp_is_gc*/
122129   0, /*tp_bases*/
122130   0, /*tp_mro*/
122131   0, /*tp_cache*/
122132   0, /*tp_subclasses*/
122133   0, /*tp_weaklist*/
122134 };
122135 static struct __pyx_vtabstruct_4lxml_5etree_PyErrorLog __pyx_vtable_4lxml_5etree_PyErrorLog;
122136
122137 static PyObject *__pyx_tp_new_4lxml_5etree_PyErrorLog(PyTypeObject *t, PyObject *a, PyObject *k) {
122138   struct __pyx_obj_4lxml_5etree_PyErrorLog *p;
122139   PyObject *o = __pyx_tp_new_4lxml_5etree__BaseErrorLog(t, a, k);
122140   if (!o) return 0;
122141   p = ((struct __pyx_obj_4lxml_5etree_PyErrorLog *)o);
122142   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__BaseErrorLog*)__pyx_vtabptr_4lxml_5etree_PyErrorLog;
122143   p->level_map = Py_None; Py_INCREF(Py_None);
122144   p->_map_level = Py_None; Py_INCREF(Py_None);
122145   p->_log = Py_None; Py_INCREF(Py_None);
122146   return o;
122147 }
122148
122149 static void __pyx_tp_dealloc_4lxml_5etree_PyErrorLog(PyObject *o) {
122150   struct __pyx_obj_4lxml_5etree_PyErrorLog *p = (struct __pyx_obj_4lxml_5etree_PyErrorLog *)o;
122151   Py_XDECREF(p->level_map);
122152   Py_XDECREF(p->_map_level);
122153   Py_XDECREF(p->_log);
122154   __pyx_tp_dealloc_4lxml_5etree__BaseErrorLog(o);
122155 }
122156
122157 static int __pyx_tp_traverse_4lxml_5etree_PyErrorLog(PyObject *o, visitproc v, void *a) {
122158   int e;
122159   struct __pyx_obj_4lxml_5etree_PyErrorLog *p = (struct __pyx_obj_4lxml_5etree_PyErrorLog *)o;
122160   e = __pyx_tp_traverse_4lxml_5etree__BaseErrorLog(o, v, a); if (e) return e;
122161   if (p->level_map) {
122162     e = (*v)(p->level_map, a); if (e) return e;
122163   }
122164   if (p->_map_level) {
122165     e = (*v)(p->_map_level, a); if (e) return e;
122166   }
122167   if (p->_log) {
122168     e = (*v)(p->_log, a); if (e) return e;
122169   }
122170   return 0;
122171 }
122172
122173 static int __pyx_tp_clear_4lxml_5etree_PyErrorLog(PyObject *o) {
122174   struct __pyx_obj_4lxml_5etree_PyErrorLog *p = (struct __pyx_obj_4lxml_5etree_PyErrorLog *)o;
122175   PyObject* tmp;
122176   __pyx_tp_clear_4lxml_5etree__BaseErrorLog(o);
122177   tmp = ((PyObject*)p->level_map);
122178   p->level_map = Py_None; Py_INCREF(Py_None);
122179   Py_XDECREF(tmp);
122180   tmp = ((PyObject*)p->_map_level);
122181   p->_map_level = Py_None; Py_INCREF(Py_None);
122182   Py_XDECREF(tmp);
122183   tmp = ((PyObject*)p->_log);
122184   p->_log = Py_None; Py_INCREF(Py_None);
122185   Py_XDECREF(tmp);
122186   return 0;
122187 }
122188
122189 static struct PyMethodDef __pyx_methods_4lxml_5etree_PyErrorLog[] = {
122190   {__Pyx_NAMESTR("copy"), (PyCFunction)__pyx_pf_4lxml_5etree_10PyErrorLog_copy, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_10PyErrorLog_copy)},
122191   {__Pyx_NAMESTR("log"), (PyCFunction)__pyx_pf_4lxml_5etree_10PyErrorLog_log, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_10PyErrorLog_log)},
122192   {__Pyx_NAMESTR("receive"), (PyCFunction)__pyx_pf_4lxml_5etree_10PyErrorLog_receive, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_10PyErrorLog_receive)},
122193   {0, 0, 0, 0}
122194 };
122195
122196 static struct PyMemberDef __pyx_members_4lxml_5etree_PyErrorLog[] = {
122197   {(char *)"level_map", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree_PyErrorLog, level_map), READONLY, 0},
122198   {0, 0, 0, 0, 0}
122199 };
122200
122201 static PyNumberMethods __pyx_tp_as_number_PyErrorLog = {
122202   0, /*nb_add*/
122203   0, /*nb_subtract*/
122204   0, /*nb_multiply*/
122205   #if PY_MAJOR_VERSION < 3
122206   0, /*nb_divide*/
122207   #endif
122208   0, /*nb_remainder*/
122209   0, /*nb_divmod*/
122210   0, /*nb_power*/
122211   0, /*nb_negative*/
122212   0, /*nb_positive*/
122213   0, /*nb_absolute*/
122214   0, /*nb_nonzero*/
122215   0, /*nb_invert*/
122216   0, /*nb_lshift*/
122217   0, /*nb_rshift*/
122218   0, /*nb_and*/
122219   0, /*nb_xor*/
122220   0, /*nb_or*/
122221   #if PY_MAJOR_VERSION < 3
122222   0, /*nb_coerce*/
122223   #endif
122224   0, /*nb_int*/
122225   #if PY_MAJOR_VERSION >= 3
122226   0, /*reserved*/
122227   #else
122228   0, /*nb_long*/
122229   #endif
122230   0, /*nb_float*/
122231   #if PY_MAJOR_VERSION < 3
122232   0, /*nb_oct*/
122233   #endif
122234   #if PY_MAJOR_VERSION < 3
122235   0, /*nb_hex*/
122236   #endif
122237   0, /*nb_inplace_add*/
122238   0, /*nb_inplace_subtract*/
122239   0, /*nb_inplace_multiply*/
122240   #if PY_MAJOR_VERSION < 3
122241   0, /*nb_inplace_divide*/
122242   #endif
122243   0, /*nb_inplace_remainder*/
122244   0, /*nb_inplace_power*/
122245   0, /*nb_inplace_lshift*/
122246   0, /*nb_inplace_rshift*/
122247   0, /*nb_inplace_and*/
122248   0, /*nb_inplace_xor*/
122249   0, /*nb_inplace_or*/
122250   0, /*nb_floor_divide*/
122251   0, /*nb_true_divide*/
122252   0, /*nb_inplace_floor_divide*/
122253   0, /*nb_inplace_true_divide*/
122254   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
122255   0, /*nb_index*/
122256   #endif
122257 };
122258
122259 static PySequenceMethods __pyx_tp_as_sequence_PyErrorLog = {
122260   0, /*sq_length*/
122261   0, /*sq_concat*/
122262   0, /*sq_repeat*/
122263   0, /*sq_item*/
122264   0, /*sq_slice*/
122265   0, /*sq_ass_item*/
122266   0, /*sq_ass_slice*/
122267   0, /*sq_contains*/
122268   0, /*sq_inplace_concat*/
122269   0, /*sq_inplace_repeat*/
122270 };
122271
122272 static PyMappingMethods __pyx_tp_as_mapping_PyErrorLog = {
122273   0, /*mp_length*/
122274   0, /*mp_subscript*/
122275   0, /*mp_ass_subscript*/
122276 };
122277
122278 static PyBufferProcs __pyx_tp_as_buffer_PyErrorLog = {
122279   #if PY_MAJOR_VERSION < 3
122280   0, /*bf_getreadbuffer*/
122281   #endif
122282   #if PY_MAJOR_VERSION < 3
122283   0, /*bf_getwritebuffer*/
122284   #endif
122285   #if PY_MAJOR_VERSION < 3
122286   0, /*bf_getsegcount*/
122287   #endif
122288   #if PY_MAJOR_VERSION < 3
122289   0, /*bf_getcharbuffer*/
122290   #endif
122291   #if PY_VERSION_HEX >= 0x02060000
122292   0, /*bf_getbuffer*/
122293   #endif
122294   #if PY_VERSION_HEX >= 0x02060000
122295   0, /*bf_releasebuffer*/
122296   #endif
122297 };
122298
122299 PyTypeObject __pyx_type_4lxml_5etree_PyErrorLog = {
122300   PyVarObject_HEAD_INIT(0, 0)
122301   __Pyx_NAMESTR("lxml.etree.PyErrorLog"), /*tp_name*/
122302   sizeof(struct __pyx_obj_4lxml_5etree_PyErrorLog), /*tp_basicsize*/
122303   0, /*tp_itemsize*/
122304   __pyx_tp_dealloc_4lxml_5etree_PyErrorLog, /*tp_dealloc*/
122305   0, /*tp_print*/
122306   0, /*tp_getattr*/
122307   0, /*tp_setattr*/
122308   0, /*tp_compare*/
122309   0, /*tp_repr*/
122310   &__pyx_tp_as_number_PyErrorLog, /*tp_as_number*/
122311   &__pyx_tp_as_sequence_PyErrorLog, /*tp_as_sequence*/
122312   &__pyx_tp_as_mapping_PyErrorLog, /*tp_as_mapping*/
122313   0, /*tp_hash*/
122314   0, /*tp_call*/
122315   0, /*tp_str*/
122316   0, /*tp_getattro*/
122317   0, /*tp_setattro*/
122318   &__pyx_tp_as_buffer_PyErrorLog, /*tp_as_buffer*/
122319   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
122320   __Pyx_DOCSTR("PyErrorLog(self, logger_name=None)\n    A global error log that connects to the Python stdlib logging package.\n\n    The constructor accepts an optional logger name.\n\n    If you want to change the mapping between libxml2's ErrorLevels and Python\n    logging levels, you can modify the level_map dictionary from a subclass.\n\n    The default mapping is::\n\n            ErrorLevels.WARNING = logging.WARNING\n            ErrorLevels.ERROR   = logging.ERROR\n            ErrorLevels.FATAL   = logging.CRITICAL\n\n    You can also override the method ``receive()`` that takes a LogEntry\n    object and calls ``self.log(log_entry, format_string, arg1, arg2, ...)``\n    with appropriate data.\n    "), /*tp_doc*/
122321   __pyx_tp_traverse_4lxml_5etree_PyErrorLog, /*tp_traverse*/
122322   __pyx_tp_clear_4lxml_5etree_PyErrorLog, /*tp_clear*/
122323   0, /*tp_richcompare*/
122324   0, /*tp_weaklistoffset*/
122325   0, /*tp_iter*/
122326   0, /*tp_iternext*/
122327   __pyx_methods_4lxml_5etree_PyErrorLog, /*tp_methods*/
122328   __pyx_members_4lxml_5etree_PyErrorLog, /*tp_members*/
122329   0, /*tp_getset*/
122330   0, /*tp_base*/
122331   0, /*tp_dict*/
122332   0, /*tp_descr_get*/
122333   0, /*tp_descr_set*/
122334   0, /*tp_dictoffset*/
122335   __pyx_pf_4lxml_5etree_10PyErrorLog___init__, /*tp_init*/
122336   0, /*tp_alloc*/
122337   __pyx_tp_new_4lxml_5etree_PyErrorLog, /*tp_new*/
122338   0, /*tp_free*/
122339   0, /*tp_is_gc*/
122340   0, /*tp_bases*/
122341   0, /*tp_mro*/
122342   0, /*tp_cache*/
122343   0, /*tp_subclasses*/
122344   0, /*tp_weaklist*/
122345 };
122346
122347 static PyObject *__pyx_tp_new_4lxml_5etree_DocInfo(PyTypeObject *t, PyObject *a, PyObject *k) {
122348   struct __pyx_obj_4lxml_5etree_DocInfo *p;
122349   PyObject *o = (*t->tp_alloc)(t, 0);
122350   if (!o) return 0;
122351   p = ((struct __pyx_obj_4lxml_5etree_DocInfo *)o);
122352   p->_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
122353   return o;
122354 }
122355
122356 static void __pyx_tp_dealloc_4lxml_5etree_DocInfo(PyObject *o) {
122357   struct __pyx_obj_4lxml_5etree_DocInfo *p = (struct __pyx_obj_4lxml_5etree_DocInfo *)o;
122358   Py_XDECREF(((PyObject *)p->_doc));
122359   (*Py_TYPE(o)->tp_free)(o);
122360 }
122361
122362 static int __pyx_tp_traverse_4lxml_5etree_DocInfo(PyObject *o, visitproc v, void *a) {
122363   int e;
122364   struct __pyx_obj_4lxml_5etree_DocInfo *p = (struct __pyx_obj_4lxml_5etree_DocInfo *)o;
122365   if (p->_doc) {
122366     e = (*v)(((PyObject*)p->_doc), a); if (e) return e;
122367   }
122368   return 0;
122369 }
122370
122371 static int __pyx_tp_clear_4lxml_5etree_DocInfo(PyObject *o) {
122372   struct __pyx_obj_4lxml_5etree_DocInfo *p = (struct __pyx_obj_4lxml_5etree_DocInfo *)o;
122373   PyObject* tmp;
122374   tmp = ((PyObject*)p->_doc);
122375   p->_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
122376   Py_XDECREF(tmp);
122377   return 0;
122378 }
122379
122380 static PyObject *__pyx_getprop_4lxml_5etree_7DocInfo_root_name(PyObject *o, void *x) {
122381   return __pyx_pf_4lxml_5etree_7DocInfo_9root_name___get__(o);
122382 }
122383
122384 static PyObject *__pyx_getprop_4lxml_5etree_7DocInfo_public_id(PyObject *o, void *x) {
122385   return __pyx_pf_4lxml_5etree_7DocInfo_9public_id___get__(o);
122386 }
122387
122388 static PyObject *__pyx_getprop_4lxml_5etree_7DocInfo_system_url(PyObject *o, void *x) {
122389   return __pyx_pf_4lxml_5etree_7DocInfo_10system_url___get__(o);
122390 }
122391
122392 static PyObject *__pyx_getprop_4lxml_5etree_7DocInfo_xml_version(PyObject *o, void *x) {
122393   return __pyx_pf_4lxml_5etree_7DocInfo_11xml_version___get__(o);
122394 }
122395
122396 static PyObject *__pyx_getprop_4lxml_5etree_7DocInfo_encoding(PyObject *o, void *x) {
122397   return __pyx_pf_4lxml_5etree_7DocInfo_8encoding___get__(o);
122398 }
122399
122400 static PyObject *__pyx_getprop_4lxml_5etree_7DocInfo_standalone(PyObject *o, void *x) {
122401   return __pyx_pf_4lxml_5etree_7DocInfo_10standalone___get__(o);
122402 }
122403
122404 static PyObject *__pyx_getprop_4lxml_5etree_7DocInfo_URL(PyObject *o, void *x) {
122405   return __pyx_pf_4lxml_5etree_7DocInfo_3URL___get__(o);
122406 }
122407
122408 static int __pyx_setprop_4lxml_5etree_7DocInfo_URL(PyObject *o, PyObject *v, void *x) {
122409   if (v) {
122410     return __pyx_pf_4lxml_5etree_7DocInfo_3URL___set__(o, v);
122411   }
122412   else {
122413     PyErr_SetString(PyExc_NotImplementedError, "__del__");
122414     return -1;
122415   }
122416 }
122417
122418 static PyObject *__pyx_getprop_4lxml_5etree_7DocInfo_doctype(PyObject *o, void *x) {
122419   return __pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(o);
122420 }
122421
122422 static PyObject *__pyx_getprop_4lxml_5etree_7DocInfo_internalDTD(PyObject *o, void *x) {
122423   return __pyx_pf_4lxml_5etree_7DocInfo_11internalDTD___get__(o);
122424 }
122425
122426 static PyObject *__pyx_getprop_4lxml_5etree_7DocInfo_externalDTD(PyObject *o, void *x) {
122427   return __pyx_pf_4lxml_5etree_7DocInfo_11externalDTD___get__(o);
122428 }
122429
122430 static struct PyMethodDef __pyx_methods_4lxml_5etree_DocInfo[] = {
122431   {0, 0, 0, 0}
122432 };
122433
122434 static struct PyGetSetDef __pyx_getsets_4lxml_5etree_DocInfo[] = {
122435   {(char *)"root_name", __pyx_getprop_4lxml_5etree_7DocInfo_root_name, 0, __pyx_k_2, 0},
122436   {(char *)"public_id", __pyx_getprop_4lxml_5etree_7DocInfo_public_id, 0, __pyx_k_3, 0},
122437   {(char *)"system_url", __pyx_getprop_4lxml_5etree_7DocInfo_system_url, 0, __pyx_k_4, 0},
122438   {(char *)"xml_version", __pyx_getprop_4lxml_5etree_7DocInfo_xml_version, 0, __pyx_k_5, 0},
122439   {(char *)"encoding", __pyx_getprop_4lxml_5etree_7DocInfo_encoding, 0, __pyx_k_6, 0},
122440   {(char *)"standalone", __pyx_getprop_4lxml_5etree_7DocInfo_standalone, 0, __pyx_k_7, 0},
122441   {(char *)"URL", __pyx_getprop_4lxml_5etree_7DocInfo_URL, __pyx_setprop_4lxml_5etree_7DocInfo_URL, __pyx_k_8, 0},
122442   {(char *)"doctype", __pyx_getprop_4lxml_5etree_7DocInfo_doctype, 0, __pyx_k_9, 0},
122443   {(char *)"internalDTD", __pyx_getprop_4lxml_5etree_7DocInfo_internalDTD, 0, __pyx_k_10, 0},
122444   {(char *)"externalDTD", __pyx_getprop_4lxml_5etree_7DocInfo_externalDTD, 0, __pyx_k_11, 0},
122445   {0, 0, 0, 0, 0}
122446 };
122447
122448 static PyNumberMethods __pyx_tp_as_number_DocInfo = {
122449   0, /*nb_add*/
122450   0, /*nb_subtract*/
122451   0, /*nb_multiply*/
122452   #if PY_MAJOR_VERSION < 3
122453   0, /*nb_divide*/
122454   #endif
122455   0, /*nb_remainder*/
122456   0, /*nb_divmod*/
122457   0, /*nb_power*/
122458   0, /*nb_negative*/
122459   0, /*nb_positive*/
122460   0, /*nb_absolute*/
122461   0, /*nb_nonzero*/
122462   0, /*nb_invert*/
122463   0, /*nb_lshift*/
122464   0, /*nb_rshift*/
122465   0, /*nb_and*/
122466   0, /*nb_xor*/
122467   0, /*nb_or*/
122468   #if PY_MAJOR_VERSION < 3
122469   0, /*nb_coerce*/
122470   #endif
122471   0, /*nb_int*/
122472   #if PY_MAJOR_VERSION >= 3
122473   0, /*reserved*/
122474   #else
122475   0, /*nb_long*/
122476   #endif
122477   0, /*nb_float*/
122478   #if PY_MAJOR_VERSION < 3
122479   0, /*nb_oct*/
122480   #endif
122481   #if PY_MAJOR_VERSION < 3
122482   0, /*nb_hex*/
122483   #endif
122484   0, /*nb_inplace_add*/
122485   0, /*nb_inplace_subtract*/
122486   0, /*nb_inplace_multiply*/
122487   #if PY_MAJOR_VERSION < 3
122488   0, /*nb_inplace_divide*/
122489   #endif
122490   0, /*nb_inplace_remainder*/
122491   0, /*nb_inplace_power*/
122492   0, /*nb_inplace_lshift*/
122493   0, /*nb_inplace_rshift*/
122494   0, /*nb_inplace_and*/
122495   0, /*nb_inplace_xor*/
122496   0, /*nb_inplace_or*/
122497   0, /*nb_floor_divide*/
122498   0, /*nb_true_divide*/
122499   0, /*nb_inplace_floor_divide*/
122500   0, /*nb_inplace_true_divide*/
122501   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
122502   0, /*nb_index*/
122503   #endif
122504 };
122505
122506 static PySequenceMethods __pyx_tp_as_sequence_DocInfo = {
122507   0, /*sq_length*/
122508   0, /*sq_concat*/
122509   0, /*sq_repeat*/
122510   0, /*sq_item*/
122511   0, /*sq_slice*/
122512   0, /*sq_ass_item*/
122513   0, /*sq_ass_slice*/
122514   0, /*sq_contains*/
122515   0, /*sq_inplace_concat*/
122516   0, /*sq_inplace_repeat*/
122517 };
122518
122519 static PyMappingMethods __pyx_tp_as_mapping_DocInfo = {
122520   0, /*mp_length*/
122521   0, /*mp_subscript*/
122522   0, /*mp_ass_subscript*/
122523 };
122524
122525 static PyBufferProcs __pyx_tp_as_buffer_DocInfo = {
122526   #if PY_MAJOR_VERSION < 3
122527   0, /*bf_getreadbuffer*/
122528   #endif
122529   #if PY_MAJOR_VERSION < 3
122530   0, /*bf_getwritebuffer*/
122531   #endif
122532   #if PY_MAJOR_VERSION < 3
122533   0, /*bf_getsegcount*/
122534   #endif
122535   #if PY_MAJOR_VERSION < 3
122536   0, /*bf_getcharbuffer*/
122537   #endif
122538   #if PY_VERSION_HEX >= 0x02060000
122539   0, /*bf_getbuffer*/
122540   #endif
122541   #if PY_VERSION_HEX >= 0x02060000
122542   0, /*bf_releasebuffer*/
122543   #endif
122544 };
122545
122546 PyTypeObject __pyx_type_4lxml_5etree_DocInfo = {
122547   PyVarObject_HEAD_INIT(0, 0)
122548   __Pyx_NAMESTR("lxml.etree.DocInfo"), /*tp_name*/
122549   sizeof(struct __pyx_obj_4lxml_5etree_DocInfo), /*tp_basicsize*/
122550   0, /*tp_itemsize*/
122551   __pyx_tp_dealloc_4lxml_5etree_DocInfo, /*tp_dealloc*/
122552   0, /*tp_print*/
122553   0, /*tp_getattr*/
122554   0, /*tp_setattr*/
122555   0, /*tp_compare*/
122556   0, /*tp_repr*/
122557   &__pyx_tp_as_number_DocInfo, /*tp_as_number*/
122558   &__pyx_tp_as_sequence_DocInfo, /*tp_as_sequence*/
122559   &__pyx_tp_as_mapping_DocInfo, /*tp_as_mapping*/
122560   0, /*tp_hash*/
122561   0, /*tp_call*/
122562   0, /*tp_str*/
122563   0, /*tp_getattro*/
122564   0, /*tp_setattro*/
122565   &__pyx_tp_as_buffer_DocInfo, /*tp_as_buffer*/
122566   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
122567   __Pyx_DOCSTR("Document information provided by parser and DTD."), /*tp_doc*/
122568   __pyx_tp_traverse_4lxml_5etree_DocInfo, /*tp_traverse*/
122569   __pyx_tp_clear_4lxml_5etree_DocInfo, /*tp_clear*/
122570   0, /*tp_richcompare*/
122571   0, /*tp_weaklistoffset*/
122572   0, /*tp_iter*/
122573   0, /*tp_iternext*/
122574   __pyx_methods_4lxml_5etree_DocInfo, /*tp_methods*/
122575   0, /*tp_members*/
122576   __pyx_getsets_4lxml_5etree_DocInfo, /*tp_getset*/
122577   0, /*tp_base*/
122578   0, /*tp_dict*/
122579   0, /*tp_descr_get*/
122580   0, /*tp_descr_set*/
122581   0, /*tp_dictoffset*/
122582   __pyx_pf_4lxml_5etree_7DocInfo___init__, /*tp_init*/
122583   0, /*tp_alloc*/
122584   __pyx_tp_new_4lxml_5etree_DocInfo, /*tp_new*/
122585   0, /*tp_free*/
122586   0, /*tp_is_gc*/
122587   0, /*tp_bases*/
122588   0, /*tp_mro*/
122589   0, /*tp_cache*/
122590   0, /*tp_subclasses*/
122591   0, /*tp_weaklist*/
122592 };
122593 static struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement __pyx_vtable_4lxml_5etree___ContentOnlyElement;
122594
122595 static PyObject *__pyx_tp_new_4lxml_5etree___ContentOnlyElement(PyTypeObject *t, PyObject *a, PyObject *k) {
122596   struct __pyx_obj_4lxml_5etree___ContentOnlyElement *p;
122597   PyObject *o = __pyx_tp_new_4lxml_5etree__Element(t, a, k);
122598   if (!o) return 0;
122599   p = ((struct __pyx_obj_4lxml_5etree___ContentOnlyElement *)o);
122600   p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree___ContentOnlyElement;
122601   return o;
122602 }
122603 static PyObject *__pyx_sq_item_4lxml_5etree___ContentOnlyElement(PyObject *o, Py_ssize_t i) {
122604   PyObject *r;
122605   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
122606   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
122607   Py_DECREF(x);
122608   return r;
122609 }
122610
122611 static int __pyx_mp_ass_subscript_4lxml_5etree___ContentOnlyElement(PyObject *o, PyObject *i, PyObject *v) {
122612   if (v) {
122613     return __pyx_pf_4lxml_5etree_20__ContentOnlyElement___setitem__(o, i, v);
122614   }
122615   else {
122616     if (__pyx_ptype_4lxml_5etree__Element->tp_as_mapping && __pyx_ptype_4lxml_5etree__Element->tp_as_mapping->mp_ass_subscript)
122617       return __pyx_ptype_4lxml_5etree__Element->tp_as_mapping->mp_ass_subscript(o, i, v);
122618     PyErr_Format(PyExc_NotImplementedError,
122619       "Subscript deletion not supported by %s", Py_TYPE(o)->tp_name);
122620     return -1;
122621   }
122622 }
122623
122624 static PyObject *__pyx_getprop_4lxml_5etree_20__ContentOnlyElement_attrib(PyObject *o, void *x) {
122625   return __pyx_pf_4lxml_5etree_20__ContentOnlyElement_6attrib___get__(o);
122626 }
122627
122628 static PyObject *__pyx_getprop_4lxml_5etree_20__ContentOnlyElement_text(PyObject *o, void *x) {
122629   return __pyx_pf_4lxml_5etree_20__ContentOnlyElement_4text___get__(o);
122630 }
122631
122632 static int __pyx_setprop_4lxml_5etree_20__ContentOnlyElement_text(PyObject *o, PyObject *v, void *x) {
122633   if (v) {
122634     return __pyx_pf_4lxml_5etree_20__ContentOnlyElement_4text___set__(o, v);
122635   }
122636   else {
122637     PyErr_SetString(PyExc_NotImplementedError, "__del__");
122638     return -1;
122639   }
122640 }
122641
122642 static struct PyMethodDef __pyx_methods_4lxml_5etree___ContentOnlyElement[] = {
122643   {__Pyx_NAMESTR("set"), (PyCFunction)__pyx_pf_4lxml_5etree_20__ContentOnlyElement_set, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_20__ContentOnlyElement_set)},
122644   {__Pyx_NAMESTR("append"), (PyCFunction)__pyx_pf_4lxml_5etree_20__ContentOnlyElement_append, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_20__ContentOnlyElement_append)},
122645   {__Pyx_NAMESTR("insert"), (PyCFunction)__pyx_pf_4lxml_5etree_20__ContentOnlyElement_insert, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_20__ContentOnlyElement_insert)},
122646   {__Pyx_NAMESTR("__getitem__"), (PyCFunction)__pyx_pf_4lxml_5etree_20__ContentOnlyElement___getitem__, METH_O|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_20__ContentOnlyElement___getitem__)},
122647   {__Pyx_NAMESTR("get"), (PyCFunction)__pyx_pf_4lxml_5etree_20__ContentOnlyElement_get, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_20__ContentOnlyElement_get)},
122648   {__Pyx_NAMESTR("keys"), (PyCFunction)__pyx_pf_4lxml_5etree_20__ContentOnlyElement_keys, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_20__ContentOnlyElement_keys)},
122649   {__Pyx_NAMESTR("items"), (PyCFunction)__pyx_pf_4lxml_5etree_20__ContentOnlyElement_items, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_20__ContentOnlyElement_items)},
122650   {__Pyx_NAMESTR("values"), (PyCFunction)__pyx_pf_4lxml_5etree_20__ContentOnlyElement_values, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_20__ContentOnlyElement_values)},
122651   {0, 0, 0, 0}
122652 };
122653
122654 static struct PyGetSetDef __pyx_getsets_4lxml_5etree___ContentOnlyElement[] = {
122655   {(char *)"attrib", __pyx_getprop_4lxml_5etree_20__ContentOnlyElement_attrib, 0, 0, 0},
122656   {(char *)"text", __pyx_getprop_4lxml_5etree_20__ContentOnlyElement_text, __pyx_setprop_4lxml_5etree_20__ContentOnlyElement_text, 0, 0},
122657   {0, 0, 0, 0, 0}
122658 };
122659
122660 static PyNumberMethods __pyx_tp_as_number___ContentOnlyElement = {
122661   0, /*nb_add*/
122662   0, /*nb_subtract*/
122663   0, /*nb_multiply*/
122664   #if PY_MAJOR_VERSION < 3
122665   0, /*nb_divide*/
122666   #endif
122667   0, /*nb_remainder*/
122668   0, /*nb_divmod*/
122669   0, /*nb_power*/
122670   0, /*nb_negative*/
122671   0, /*nb_positive*/
122672   0, /*nb_absolute*/
122673   0, /*nb_nonzero*/
122674   0, /*nb_invert*/
122675   0, /*nb_lshift*/
122676   0, /*nb_rshift*/
122677   0, /*nb_and*/
122678   0, /*nb_xor*/
122679   0, /*nb_or*/
122680   #if PY_MAJOR_VERSION < 3
122681   0, /*nb_coerce*/
122682   #endif
122683   0, /*nb_int*/
122684   #if PY_MAJOR_VERSION >= 3
122685   0, /*reserved*/
122686   #else
122687   0, /*nb_long*/
122688   #endif
122689   0, /*nb_float*/
122690   #if PY_MAJOR_VERSION < 3
122691   0, /*nb_oct*/
122692   #endif
122693   #if PY_MAJOR_VERSION < 3
122694   0, /*nb_hex*/
122695   #endif
122696   0, /*nb_inplace_add*/
122697   0, /*nb_inplace_subtract*/
122698   0, /*nb_inplace_multiply*/
122699   #if PY_MAJOR_VERSION < 3
122700   0, /*nb_inplace_divide*/
122701   #endif
122702   0, /*nb_inplace_remainder*/
122703   0, /*nb_inplace_power*/
122704   0, /*nb_inplace_lshift*/
122705   0, /*nb_inplace_rshift*/
122706   0, /*nb_inplace_and*/
122707   0, /*nb_inplace_xor*/
122708   0, /*nb_inplace_or*/
122709   0, /*nb_floor_divide*/
122710   0, /*nb_true_divide*/
122711   0, /*nb_inplace_floor_divide*/
122712   0, /*nb_inplace_true_divide*/
122713   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
122714   0, /*nb_index*/
122715   #endif
122716 };
122717
122718 static PySequenceMethods __pyx_tp_as_sequence___ContentOnlyElement = {
122719   __pyx_pf_4lxml_5etree_20__ContentOnlyElement___len__, /*sq_length*/
122720   0, /*sq_concat*/
122721   0, /*sq_repeat*/
122722   __pyx_sq_item_4lxml_5etree___ContentOnlyElement, /*sq_item*/
122723   0, /*sq_slice*/
122724   0, /*sq_ass_item*/
122725   0, /*sq_ass_slice*/
122726   0, /*sq_contains*/
122727   0, /*sq_inplace_concat*/
122728   0, /*sq_inplace_repeat*/
122729 };
122730
122731 static PyMappingMethods __pyx_tp_as_mapping___ContentOnlyElement = {
122732   __pyx_pf_4lxml_5etree_20__ContentOnlyElement___len__, /*mp_length*/
122733   __pyx_pf_4lxml_5etree_20__ContentOnlyElement___getitem__, /*mp_subscript*/
122734   __pyx_mp_ass_subscript_4lxml_5etree___ContentOnlyElement, /*mp_ass_subscript*/
122735 };
122736
122737 static PyBufferProcs __pyx_tp_as_buffer___ContentOnlyElement = {
122738   #if PY_MAJOR_VERSION < 3
122739   0, /*bf_getreadbuffer*/
122740   #endif
122741   #if PY_MAJOR_VERSION < 3
122742   0, /*bf_getwritebuffer*/
122743   #endif
122744   #if PY_MAJOR_VERSION < 3
122745   0, /*bf_getsegcount*/
122746   #endif
122747   #if PY_MAJOR_VERSION < 3
122748   0, /*bf_getcharbuffer*/
122749   #endif
122750   #if PY_VERSION_HEX >= 0x02060000
122751   0, /*bf_getbuffer*/
122752   #endif
122753   #if PY_VERSION_HEX >= 0x02060000
122754   0, /*bf_releasebuffer*/
122755   #endif
122756 };
122757
122758 PyTypeObject __pyx_type_4lxml_5etree___ContentOnlyElement = {
122759   PyVarObject_HEAD_INIT(0, 0)
122760   __Pyx_NAMESTR("lxml.etree.__ContentOnlyElement"), /*tp_name*/
122761   sizeof(struct __pyx_obj_4lxml_5etree___ContentOnlyElement), /*tp_basicsize*/
122762   0, /*tp_itemsize*/
122763   __pyx_tp_dealloc_4lxml_5etree__Element, /*tp_dealloc*/
122764   0, /*tp_print*/
122765   0, /*tp_getattr*/
122766   0, /*tp_setattr*/
122767   0, /*tp_compare*/
122768   0, /*tp_repr*/
122769   &__pyx_tp_as_number___ContentOnlyElement, /*tp_as_number*/
122770   &__pyx_tp_as_sequence___ContentOnlyElement, /*tp_as_sequence*/
122771   &__pyx_tp_as_mapping___ContentOnlyElement, /*tp_as_mapping*/
122772   0, /*tp_hash*/
122773   0, /*tp_call*/
122774   0, /*tp_str*/
122775   0, /*tp_getattro*/
122776   0, /*tp_setattro*/
122777   &__pyx_tp_as_buffer___ContentOnlyElement, /*tp_as_buffer*/
122778   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
122779   0, /*tp_doc*/
122780   __pyx_tp_traverse_4lxml_5etree__Element, /*tp_traverse*/
122781   __pyx_tp_clear_4lxml_5etree__Element, /*tp_clear*/
122782   0, /*tp_richcompare*/
122783   0, /*tp_weaklistoffset*/
122784   0, /*tp_iter*/
122785   0, /*tp_iternext*/
122786   __pyx_methods_4lxml_5etree___ContentOnlyElement, /*tp_methods*/
122787   0, /*tp_members*/
122788   __pyx_getsets_4lxml_5etree___ContentOnlyElement, /*tp_getset*/
122789   0, /*tp_base*/
122790   0, /*tp_dict*/
122791   0, /*tp_descr_get*/
122792   0, /*tp_descr_set*/
122793   0, /*tp_dictoffset*/
122794   0, /*tp_init*/
122795   0, /*tp_alloc*/
122796   __pyx_tp_new_4lxml_5etree___ContentOnlyElement, /*tp_new*/
122797   0, /*tp_free*/
122798   0, /*tp_is_gc*/
122799   0, /*tp_bases*/
122800   0, /*tp_mro*/
122801   0, /*tp_cache*/
122802   0, /*tp_subclasses*/
122803   0, /*tp_weaklist*/
122804 };
122805 static struct __pyx_vtabstruct_4lxml_5etree__Comment __pyx_vtable_4lxml_5etree__Comment;
122806
122807 static PyObject *__pyx_tp_new_4lxml_5etree__Comment(PyTypeObject *t, PyObject *a, PyObject *k) {
122808   struct __pyx_obj_4lxml_5etree__Comment *p;
122809   PyObject *o = __pyx_tp_new_4lxml_5etree__Element(t, a, k);
122810   if (!o) return 0;
122811   p = ((struct __pyx_obj_4lxml_5etree__Comment *)o);
122812   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement*)__pyx_vtabptr_4lxml_5etree__Comment;
122813   return o;
122814 }
122815
122816 static PyObject *__pyx_getprop_4lxml_5etree_8_Comment_tag(PyObject *o, void *x) {
122817   return __pyx_pf_4lxml_5etree_8_Comment_3tag___get__(o);
122818 }
122819
122820 static struct PyMethodDef __pyx_methods_4lxml_5etree__Comment[] = {
122821   {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_4lxml_5etree_8_Comment___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
122822   {0, 0, 0, 0}
122823 };
122824
122825 static struct PyGetSetDef __pyx_getsets_4lxml_5etree__Comment[] = {
122826   {(char *)"tag", __pyx_getprop_4lxml_5etree_8_Comment_tag, 0, 0, 0},
122827   {0, 0, 0, 0, 0}
122828 };
122829
122830 static PyNumberMethods __pyx_tp_as_number__Comment = {
122831   0, /*nb_add*/
122832   0, /*nb_subtract*/
122833   0, /*nb_multiply*/
122834   #if PY_MAJOR_VERSION < 3
122835   0, /*nb_divide*/
122836   #endif
122837   0, /*nb_remainder*/
122838   0, /*nb_divmod*/
122839   0, /*nb_power*/
122840   0, /*nb_negative*/
122841   0, /*nb_positive*/
122842   0, /*nb_absolute*/
122843   0, /*nb_nonzero*/
122844   0, /*nb_invert*/
122845   0, /*nb_lshift*/
122846   0, /*nb_rshift*/
122847   0, /*nb_and*/
122848   0, /*nb_xor*/
122849   0, /*nb_or*/
122850   #if PY_MAJOR_VERSION < 3
122851   0, /*nb_coerce*/
122852   #endif
122853   0, /*nb_int*/
122854   #if PY_MAJOR_VERSION >= 3
122855   0, /*reserved*/
122856   #else
122857   0, /*nb_long*/
122858   #endif
122859   0, /*nb_float*/
122860   #if PY_MAJOR_VERSION < 3
122861   0, /*nb_oct*/
122862   #endif
122863   #if PY_MAJOR_VERSION < 3
122864   0, /*nb_hex*/
122865   #endif
122866   0, /*nb_inplace_add*/
122867   0, /*nb_inplace_subtract*/
122868   0, /*nb_inplace_multiply*/
122869   #if PY_MAJOR_VERSION < 3
122870   0, /*nb_inplace_divide*/
122871   #endif
122872   0, /*nb_inplace_remainder*/
122873   0, /*nb_inplace_power*/
122874   0, /*nb_inplace_lshift*/
122875   0, /*nb_inplace_rshift*/
122876   0, /*nb_inplace_and*/
122877   0, /*nb_inplace_xor*/
122878   0, /*nb_inplace_or*/
122879   0, /*nb_floor_divide*/
122880   0, /*nb_true_divide*/
122881   0, /*nb_inplace_floor_divide*/
122882   0, /*nb_inplace_true_divide*/
122883   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
122884   0, /*nb_index*/
122885   #endif
122886 };
122887
122888 static PySequenceMethods __pyx_tp_as_sequence__Comment = {
122889   0, /*sq_length*/
122890   0, /*sq_concat*/
122891   0, /*sq_repeat*/
122892   0, /*sq_item*/
122893   0, /*sq_slice*/
122894   0, /*sq_ass_item*/
122895   0, /*sq_ass_slice*/
122896   0, /*sq_contains*/
122897   0, /*sq_inplace_concat*/
122898   0, /*sq_inplace_repeat*/
122899 };
122900
122901 static PyMappingMethods __pyx_tp_as_mapping__Comment = {
122902   0, /*mp_length*/
122903   0, /*mp_subscript*/
122904   0, /*mp_ass_subscript*/
122905 };
122906
122907 static PyBufferProcs __pyx_tp_as_buffer__Comment = {
122908   #if PY_MAJOR_VERSION < 3
122909   0, /*bf_getreadbuffer*/
122910   #endif
122911   #if PY_MAJOR_VERSION < 3
122912   0, /*bf_getwritebuffer*/
122913   #endif
122914   #if PY_MAJOR_VERSION < 3
122915   0, /*bf_getsegcount*/
122916   #endif
122917   #if PY_MAJOR_VERSION < 3
122918   0, /*bf_getcharbuffer*/
122919   #endif
122920   #if PY_VERSION_HEX >= 0x02060000
122921   0, /*bf_getbuffer*/
122922   #endif
122923   #if PY_VERSION_HEX >= 0x02060000
122924   0, /*bf_releasebuffer*/
122925   #endif
122926 };
122927
122928 PyTypeObject __pyx_type_4lxml_5etree__Comment = {
122929   PyVarObject_HEAD_INIT(0, 0)
122930   __Pyx_NAMESTR("lxml.etree._Comment"), /*tp_name*/
122931   sizeof(struct __pyx_obj_4lxml_5etree__Comment), /*tp_basicsize*/
122932   0, /*tp_itemsize*/
122933   __pyx_tp_dealloc_4lxml_5etree__Element, /*tp_dealloc*/
122934   0, /*tp_print*/
122935   0, /*tp_getattr*/
122936   0, /*tp_setattr*/
122937   0, /*tp_compare*/
122938   __pyx_pf_4lxml_5etree_8_Comment___repr__, /*tp_repr*/
122939   &__pyx_tp_as_number__Comment, /*tp_as_number*/
122940   &__pyx_tp_as_sequence__Comment, /*tp_as_sequence*/
122941   &__pyx_tp_as_mapping__Comment, /*tp_as_mapping*/
122942   0, /*tp_hash*/
122943   0, /*tp_call*/
122944   0, /*tp_str*/
122945   0, /*tp_getattro*/
122946   0, /*tp_setattro*/
122947   &__pyx_tp_as_buffer__Comment, /*tp_as_buffer*/
122948   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
122949   0, /*tp_doc*/
122950   __pyx_tp_traverse_4lxml_5etree__Element, /*tp_traverse*/
122951   __pyx_tp_clear_4lxml_5etree__Element, /*tp_clear*/
122952   0, /*tp_richcompare*/
122953   0, /*tp_weaklistoffset*/
122954   0, /*tp_iter*/
122955   0, /*tp_iternext*/
122956   __pyx_methods_4lxml_5etree__Comment, /*tp_methods*/
122957   0, /*tp_members*/
122958   __pyx_getsets_4lxml_5etree__Comment, /*tp_getset*/
122959   0, /*tp_base*/
122960   0, /*tp_dict*/
122961   0, /*tp_descr_get*/
122962   0, /*tp_descr_set*/
122963   0, /*tp_dictoffset*/
122964   0, /*tp_init*/
122965   0, /*tp_alloc*/
122966   __pyx_tp_new_4lxml_5etree__Comment, /*tp_new*/
122967   0, /*tp_free*/
122968   0, /*tp_is_gc*/
122969   0, /*tp_bases*/
122970   0, /*tp_mro*/
122971   0, /*tp_cache*/
122972   0, /*tp_subclasses*/
122973   0, /*tp_weaklist*/
122974 };
122975 static struct __pyx_vtabstruct_4lxml_5etree__ProcessingInstruction __pyx_vtable_4lxml_5etree__ProcessingInstruction;
122976
122977 static PyObject *__pyx_tp_new_4lxml_5etree__ProcessingInstruction(PyTypeObject *t, PyObject *a, PyObject *k) {
122978   struct __pyx_obj_4lxml_5etree__ProcessingInstruction *p;
122979   PyObject *o = __pyx_tp_new_4lxml_5etree__Element(t, a, k);
122980   if (!o) return 0;
122981   p = ((struct __pyx_obj_4lxml_5etree__ProcessingInstruction *)o);
122982   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement*)__pyx_vtabptr_4lxml_5etree__ProcessingInstruction;
122983   return o;
122984 }
122985
122986 static PyObject *__pyx_getprop_4lxml_5etree_22_ProcessingInstruction_tag(PyObject *o, void *x) {
122987   return __pyx_pf_4lxml_5etree_22_ProcessingInstruction_3tag___get__(o);
122988 }
122989
122990 static PyObject *__pyx_getprop_4lxml_5etree_22_ProcessingInstruction_target(PyObject *o, void *x) {
122991   return __pyx_pf_4lxml_5etree_22_ProcessingInstruction_6target___get__(o);
122992 }
122993
122994 static int __pyx_setprop_4lxml_5etree_22_ProcessingInstruction_target(PyObject *o, PyObject *v, void *x) {
122995   if (v) {
122996     return __pyx_pf_4lxml_5etree_22_ProcessingInstruction_6target___set__(o, v);
122997   }
122998   else {
122999     PyErr_SetString(PyExc_NotImplementedError, "__del__");
123000     return -1;
123001   }
123002 }
123003
123004 static struct PyMethodDef __pyx_methods_4lxml_5etree__ProcessingInstruction[] = {
123005   {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_4lxml_5etree_22_ProcessingInstruction___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
123006   {0, 0, 0, 0}
123007 };
123008
123009 static struct PyGetSetDef __pyx_getsets_4lxml_5etree__ProcessingInstruction[] = {
123010   {(char *)"tag", __pyx_getprop_4lxml_5etree_22_ProcessingInstruction_tag, 0, 0, 0},
123011   {(char *)"target", __pyx_getprop_4lxml_5etree_22_ProcessingInstruction_target, __pyx_setprop_4lxml_5etree_22_ProcessingInstruction_target, 0, 0},
123012   {0, 0, 0, 0, 0}
123013 };
123014
123015 static PyNumberMethods __pyx_tp_as_number__ProcessingInstruction = {
123016   0, /*nb_add*/
123017   0, /*nb_subtract*/
123018   0, /*nb_multiply*/
123019   #if PY_MAJOR_VERSION < 3
123020   0, /*nb_divide*/
123021   #endif
123022   0, /*nb_remainder*/
123023   0, /*nb_divmod*/
123024   0, /*nb_power*/
123025   0, /*nb_negative*/
123026   0, /*nb_positive*/
123027   0, /*nb_absolute*/
123028   0, /*nb_nonzero*/
123029   0, /*nb_invert*/
123030   0, /*nb_lshift*/
123031   0, /*nb_rshift*/
123032   0, /*nb_and*/
123033   0, /*nb_xor*/
123034   0, /*nb_or*/
123035   #if PY_MAJOR_VERSION < 3
123036   0, /*nb_coerce*/
123037   #endif
123038   0, /*nb_int*/
123039   #if PY_MAJOR_VERSION >= 3
123040   0, /*reserved*/
123041   #else
123042   0, /*nb_long*/
123043   #endif
123044   0, /*nb_float*/
123045   #if PY_MAJOR_VERSION < 3
123046   0, /*nb_oct*/
123047   #endif
123048   #if PY_MAJOR_VERSION < 3
123049   0, /*nb_hex*/
123050   #endif
123051   0, /*nb_inplace_add*/
123052   0, /*nb_inplace_subtract*/
123053   0, /*nb_inplace_multiply*/
123054   #if PY_MAJOR_VERSION < 3
123055   0, /*nb_inplace_divide*/
123056   #endif
123057   0, /*nb_inplace_remainder*/
123058   0, /*nb_inplace_power*/
123059   0, /*nb_inplace_lshift*/
123060   0, /*nb_inplace_rshift*/
123061   0, /*nb_inplace_and*/
123062   0, /*nb_inplace_xor*/
123063   0, /*nb_inplace_or*/
123064   0, /*nb_floor_divide*/
123065   0, /*nb_true_divide*/
123066   0, /*nb_inplace_floor_divide*/
123067   0, /*nb_inplace_true_divide*/
123068   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
123069   0, /*nb_index*/
123070   #endif
123071 };
123072
123073 static PySequenceMethods __pyx_tp_as_sequence__ProcessingInstruction = {
123074   0, /*sq_length*/
123075   0, /*sq_concat*/
123076   0, /*sq_repeat*/
123077   0, /*sq_item*/
123078   0, /*sq_slice*/
123079   0, /*sq_ass_item*/
123080   0, /*sq_ass_slice*/
123081   0, /*sq_contains*/
123082   0, /*sq_inplace_concat*/
123083   0, /*sq_inplace_repeat*/
123084 };
123085
123086 static PyMappingMethods __pyx_tp_as_mapping__ProcessingInstruction = {
123087   0, /*mp_length*/
123088   0, /*mp_subscript*/
123089   0, /*mp_ass_subscript*/
123090 };
123091
123092 static PyBufferProcs __pyx_tp_as_buffer__ProcessingInstruction = {
123093   #if PY_MAJOR_VERSION < 3
123094   0, /*bf_getreadbuffer*/
123095   #endif
123096   #if PY_MAJOR_VERSION < 3
123097   0, /*bf_getwritebuffer*/
123098   #endif
123099   #if PY_MAJOR_VERSION < 3
123100   0, /*bf_getsegcount*/
123101   #endif
123102   #if PY_MAJOR_VERSION < 3
123103   0, /*bf_getcharbuffer*/
123104   #endif
123105   #if PY_VERSION_HEX >= 0x02060000
123106   0, /*bf_getbuffer*/
123107   #endif
123108   #if PY_VERSION_HEX >= 0x02060000
123109   0, /*bf_releasebuffer*/
123110   #endif
123111 };
123112
123113 PyTypeObject __pyx_type_4lxml_5etree__ProcessingInstruction = {
123114   PyVarObject_HEAD_INIT(0, 0)
123115   __Pyx_NAMESTR("lxml.etree._ProcessingInstruction"), /*tp_name*/
123116   sizeof(struct __pyx_obj_4lxml_5etree__ProcessingInstruction), /*tp_basicsize*/
123117   0, /*tp_itemsize*/
123118   __pyx_tp_dealloc_4lxml_5etree__Element, /*tp_dealloc*/
123119   0, /*tp_print*/
123120   0, /*tp_getattr*/
123121   0, /*tp_setattr*/
123122   0, /*tp_compare*/
123123   __pyx_pf_4lxml_5etree_22_ProcessingInstruction___repr__, /*tp_repr*/
123124   &__pyx_tp_as_number__ProcessingInstruction, /*tp_as_number*/
123125   &__pyx_tp_as_sequence__ProcessingInstruction, /*tp_as_sequence*/
123126   &__pyx_tp_as_mapping__ProcessingInstruction, /*tp_as_mapping*/
123127   0, /*tp_hash*/
123128   0, /*tp_call*/
123129   0, /*tp_str*/
123130   0, /*tp_getattro*/
123131   0, /*tp_setattro*/
123132   &__pyx_tp_as_buffer__ProcessingInstruction, /*tp_as_buffer*/
123133   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
123134   0, /*tp_doc*/
123135   __pyx_tp_traverse_4lxml_5etree__Element, /*tp_traverse*/
123136   __pyx_tp_clear_4lxml_5etree__Element, /*tp_clear*/
123137   0, /*tp_richcompare*/
123138   0, /*tp_weaklistoffset*/
123139   0, /*tp_iter*/
123140   0, /*tp_iternext*/
123141   __pyx_methods_4lxml_5etree__ProcessingInstruction, /*tp_methods*/
123142   0, /*tp_members*/
123143   __pyx_getsets_4lxml_5etree__ProcessingInstruction, /*tp_getset*/
123144   0, /*tp_base*/
123145   0, /*tp_dict*/
123146   0, /*tp_descr_get*/
123147   0, /*tp_descr_set*/
123148   0, /*tp_dictoffset*/
123149   0, /*tp_init*/
123150   0, /*tp_alloc*/
123151   __pyx_tp_new_4lxml_5etree__ProcessingInstruction, /*tp_new*/
123152   0, /*tp_free*/
123153   0, /*tp_is_gc*/
123154   0, /*tp_bases*/
123155   0, /*tp_mro*/
123156   0, /*tp_cache*/
123157   0, /*tp_subclasses*/
123158   0, /*tp_weaklist*/
123159 };
123160 static struct __pyx_vtabstruct_4lxml_5etree__Entity __pyx_vtable_4lxml_5etree__Entity;
123161
123162 static PyObject *__pyx_tp_new_4lxml_5etree__Entity(PyTypeObject *t, PyObject *a, PyObject *k) {
123163   struct __pyx_obj_4lxml_5etree__Entity *p;
123164   PyObject *o = __pyx_tp_new_4lxml_5etree__Element(t, a, k);
123165   if (!o) return 0;
123166   p = ((struct __pyx_obj_4lxml_5etree__Entity *)o);
123167   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement*)__pyx_vtabptr_4lxml_5etree__Entity;
123168   return o;
123169 }
123170
123171 static PyObject *__pyx_getprop_4lxml_5etree_7_Entity_tag(PyObject *o, void *x) {
123172   return __pyx_pf_4lxml_5etree_7_Entity_3tag___get__(o);
123173 }
123174
123175 static PyObject *__pyx_getprop_4lxml_5etree_7_Entity_name(PyObject *o, void *x) {
123176   return __pyx_pf_4lxml_5etree_7_Entity_4name___get__(o);
123177 }
123178
123179 static int __pyx_setprop_4lxml_5etree_7_Entity_name(PyObject *o, PyObject *v, void *x) {
123180   if (v) {
123181     return __pyx_pf_4lxml_5etree_7_Entity_4name___set__(o, v);
123182   }
123183   else {
123184     PyErr_SetString(PyExc_NotImplementedError, "__del__");
123185     return -1;
123186   }
123187 }
123188
123189 static PyObject *__pyx_getprop_4lxml_5etree_7_Entity_text(PyObject *o, void *x) {
123190   return __pyx_pf_4lxml_5etree_7_Entity_4text___get__(o);
123191 }
123192
123193 static struct PyMethodDef __pyx_methods_4lxml_5etree__Entity[] = {
123194   {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_4lxml_5etree_7_Entity___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
123195   {0, 0, 0, 0}
123196 };
123197
123198 static struct PyGetSetDef __pyx_getsets_4lxml_5etree__Entity[] = {
123199   {(char *)"tag", __pyx_getprop_4lxml_5etree_7_Entity_tag, 0, 0, 0},
123200   {(char *)"name", __pyx_getprop_4lxml_5etree_7_Entity_name, __pyx_setprop_4lxml_5etree_7_Entity_name, 0, 0},
123201   {(char *)"text", __pyx_getprop_4lxml_5etree_7_Entity_text, 0, 0, 0},
123202   {0, 0, 0, 0, 0}
123203 };
123204
123205 static PyNumberMethods __pyx_tp_as_number__Entity = {
123206   0, /*nb_add*/
123207   0, /*nb_subtract*/
123208   0, /*nb_multiply*/
123209   #if PY_MAJOR_VERSION < 3
123210   0, /*nb_divide*/
123211   #endif
123212   0, /*nb_remainder*/
123213   0, /*nb_divmod*/
123214   0, /*nb_power*/
123215   0, /*nb_negative*/
123216   0, /*nb_positive*/
123217   0, /*nb_absolute*/
123218   0, /*nb_nonzero*/
123219   0, /*nb_invert*/
123220   0, /*nb_lshift*/
123221   0, /*nb_rshift*/
123222   0, /*nb_and*/
123223   0, /*nb_xor*/
123224   0, /*nb_or*/
123225   #if PY_MAJOR_VERSION < 3
123226   0, /*nb_coerce*/
123227   #endif
123228   0, /*nb_int*/
123229   #if PY_MAJOR_VERSION >= 3
123230   0, /*reserved*/
123231   #else
123232   0, /*nb_long*/
123233   #endif
123234   0, /*nb_float*/
123235   #if PY_MAJOR_VERSION < 3
123236   0, /*nb_oct*/
123237   #endif
123238   #if PY_MAJOR_VERSION < 3
123239   0, /*nb_hex*/
123240   #endif
123241   0, /*nb_inplace_add*/
123242   0, /*nb_inplace_subtract*/
123243   0, /*nb_inplace_multiply*/
123244   #if PY_MAJOR_VERSION < 3
123245   0, /*nb_inplace_divide*/
123246   #endif
123247   0, /*nb_inplace_remainder*/
123248   0, /*nb_inplace_power*/
123249   0, /*nb_inplace_lshift*/
123250   0, /*nb_inplace_rshift*/
123251   0, /*nb_inplace_and*/
123252   0, /*nb_inplace_xor*/
123253   0, /*nb_inplace_or*/
123254   0, /*nb_floor_divide*/
123255   0, /*nb_true_divide*/
123256   0, /*nb_inplace_floor_divide*/
123257   0, /*nb_inplace_true_divide*/
123258   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
123259   0, /*nb_index*/
123260   #endif
123261 };
123262
123263 static PySequenceMethods __pyx_tp_as_sequence__Entity = {
123264   0, /*sq_length*/
123265   0, /*sq_concat*/
123266   0, /*sq_repeat*/
123267   0, /*sq_item*/
123268   0, /*sq_slice*/
123269   0, /*sq_ass_item*/
123270   0, /*sq_ass_slice*/
123271   0, /*sq_contains*/
123272   0, /*sq_inplace_concat*/
123273   0, /*sq_inplace_repeat*/
123274 };
123275
123276 static PyMappingMethods __pyx_tp_as_mapping__Entity = {
123277   0, /*mp_length*/
123278   0, /*mp_subscript*/
123279   0, /*mp_ass_subscript*/
123280 };
123281
123282 static PyBufferProcs __pyx_tp_as_buffer__Entity = {
123283   #if PY_MAJOR_VERSION < 3
123284   0, /*bf_getreadbuffer*/
123285   #endif
123286   #if PY_MAJOR_VERSION < 3
123287   0, /*bf_getwritebuffer*/
123288   #endif
123289   #if PY_MAJOR_VERSION < 3
123290   0, /*bf_getsegcount*/
123291   #endif
123292   #if PY_MAJOR_VERSION < 3
123293   0, /*bf_getcharbuffer*/
123294   #endif
123295   #if PY_VERSION_HEX >= 0x02060000
123296   0, /*bf_getbuffer*/
123297   #endif
123298   #if PY_VERSION_HEX >= 0x02060000
123299   0, /*bf_releasebuffer*/
123300   #endif
123301 };
123302
123303 PyTypeObject __pyx_type_4lxml_5etree__Entity = {
123304   PyVarObject_HEAD_INIT(0, 0)
123305   __Pyx_NAMESTR("lxml.etree._Entity"), /*tp_name*/
123306   sizeof(struct __pyx_obj_4lxml_5etree__Entity), /*tp_basicsize*/
123307   0, /*tp_itemsize*/
123308   __pyx_tp_dealloc_4lxml_5etree__Element, /*tp_dealloc*/
123309   0, /*tp_print*/
123310   0, /*tp_getattr*/
123311   0, /*tp_setattr*/
123312   0, /*tp_compare*/
123313   __pyx_pf_4lxml_5etree_7_Entity___repr__, /*tp_repr*/
123314   &__pyx_tp_as_number__Entity, /*tp_as_number*/
123315   &__pyx_tp_as_sequence__Entity, /*tp_as_sequence*/
123316   &__pyx_tp_as_mapping__Entity, /*tp_as_mapping*/
123317   0, /*tp_hash*/
123318   0, /*tp_call*/
123319   0, /*tp_str*/
123320   0, /*tp_getattro*/
123321   0, /*tp_setattro*/
123322   &__pyx_tp_as_buffer__Entity, /*tp_as_buffer*/
123323   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
123324   0, /*tp_doc*/
123325   __pyx_tp_traverse_4lxml_5etree__Element, /*tp_traverse*/
123326   __pyx_tp_clear_4lxml_5etree__Element, /*tp_clear*/
123327   0, /*tp_richcompare*/
123328   0, /*tp_weaklistoffset*/
123329   0, /*tp_iter*/
123330   0, /*tp_iternext*/
123331   __pyx_methods_4lxml_5etree__Entity, /*tp_methods*/
123332   0, /*tp_members*/
123333   __pyx_getsets_4lxml_5etree__Entity, /*tp_getset*/
123334   0, /*tp_base*/
123335   0, /*tp_dict*/
123336   0, /*tp_descr_get*/
123337   0, /*tp_descr_set*/
123338   0, /*tp_dictoffset*/
123339   0, /*tp_init*/
123340   0, /*tp_alloc*/
123341   __pyx_tp_new_4lxml_5etree__Entity, /*tp_new*/
123342   0, /*tp_free*/
123343   0, /*tp_is_gc*/
123344   0, /*tp_bases*/
123345   0, /*tp_mro*/
123346   0, /*tp_cache*/
123347   0, /*tp_subclasses*/
123348   0, /*tp_weaklist*/
123349 };
123350 static struct __pyx_vtabstruct_4lxml_5etree__ElementTree __pyx_vtable_4lxml_5etree__ElementTree;
123351
123352 static PyObject *__pyx_tp_new_4lxml_5etree__ElementTree(PyTypeObject *t, PyObject *a, PyObject *k) {
123353   struct LxmlElementTree *p;
123354   PyObject *o = (*t->tp_alloc)(t, 0);
123355   if (!o) return 0;
123356   p = ((struct LxmlElementTree *)o);
123357   p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__ElementTree;
123358   p->_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
123359   p->_context_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
123360   return o;
123361 }
123362
123363 static void __pyx_tp_dealloc_4lxml_5etree__ElementTree(PyObject *o) {
123364   struct LxmlElementTree *p = (struct LxmlElementTree *)o;
123365   Py_XDECREF(((PyObject *)p->_doc));
123366   Py_XDECREF(((PyObject *)p->_context_node));
123367   (*Py_TYPE(o)->tp_free)(o);
123368 }
123369
123370 static int __pyx_tp_traverse_4lxml_5etree__ElementTree(PyObject *o, visitproc v, void *a) {
123371   int e;
123372   struct LxmlElementTree *p = (struct LxmlElementTree *)o;
123373   if (p->_doc) {
123374     e = (*v)(((PyObject*)p->_doc), a); if (e) return e;
123375   }
123376   if (p->_context_node) {
123377     e = (*v)(((PyObject*)p->_context_node), a); if (e) return e;
123378   }
123379   return 0;
123380 }
123381
123382 static int __pyx_tp_clear_4lxml_5etree__ElementTree(PyObject *o) {
123383   struct LxmlElementTree *p = (struct LxmlElementTree *)o;
123384   PyObject* tmp;
123385   tmp = ((PyObject*)p->_doc);
123386   p->_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
123387   Py_XDECREF(tmp);
123388   tmp = ((PyObject*)p->_context_node);
123389   p->_context_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
123390   Py_XDECREF(tmp);
123391   return 0;
123392 }
123393
123394 static PyObject *__pyx_getprop_4lxml_5etree_12_ElementTree_docinfo(PyObject *o, void *x) {
123395   return __pyx_pf_4lxml_5etree_12_ElementTree_7docinfo___get__(o);
123396 }
123397
123398 static PyObject *__pyx_getprop_4lxml_5etree_12_ElementTree_parser(PyObject *o, void *x) {
123399   return __pyx_pf_4lxml_5etree_12_ElementTree_6parser___get__(o);
123400 }
123401
123402 static struct PyMethodDef __pyx_methods_4lxml_5etree__ElementTree[] = {
123403   {__Pyx_NAMESTR("parse"), (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_parse, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_12_ElementTree_parse)},
123404   {__Pyx_NAMESTR("_setroot"), (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree__setroot, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_12_ElementTree__setroot)},
123405   {__Pyx_NAMESTR("getroot"), (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_getroot, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_12_ElementTree_getroot)},
123406   {__Pyx_NAMESTR("__copy__"), (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree___copy__, METH_NOARGS, __Pyx_DOCSTR(0)},
123407   {__Pyx_NAMESTR("__deepcopy__"), (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree___deepcopy__, METH_O, __Pyx_DOCSTR(0)},
123408   {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_write, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_12_ElementTree_write)},
123409   {__Pyx_NAMESTR("getpath"), (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_getpath, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_12_ElementTree_getpath)},
123410   {__Pyx_NAMESTR("getiterator"), (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_getiterator, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_12_ElementTree_getiterator)},
123411   {__Pyx_NAMESTR("iter"), (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_iter, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_12_ElementTree_iter)},
123412   {__Pyx_NAMESTR("find"), (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_find, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_12_ElementTree_find)},
123413   {__Pyx_NAMESTR("findtext"), (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_findtext, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_12_ElementTree_findtext)},
123414   {__Pyx_NAMESTR("findall"), (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_findall, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_12_ElementTree_findall)},
123415   {__Pyx_NAMESTR("iterfind"), (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_iterfind, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_12_ElementTree_iterfind)},
123416   {__Pyx_NAMESTR("xpath"), (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_xpath, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_12_ElementTree_xpath)},
123417   {__Pyx_NAMESTR("xslt"), (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_xslt, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_12_ElementTree_xslt)},
123418   {__Pyx_NAMESTR("relaxng"), (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_relaxng, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_12_ElementTree_relaxng)},
123419   {__Pyx_NAMESTR("xmlschema"), (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_xmlschema, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_12_ElementTree_xmlschema)},
123420   {__Pyx_NAMESTR("xinclude"), (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_xinclude, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_12_ElementTree_xinclude)},
123421   {__Pyx_NAMESTR("write_c14n"), (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_write_c14n, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_12_ElementTree_write_c14n)},
123422   {0, 0, 0, 0}
123423 };
123424
123425 static struct PyGetSetDef __pyx_getsets_4lxml_5etree__ElementTree[] = {
123426   {(char *)"docinfo", __pyx_getprop_4lxml_5etree_12_ElementTree_docinfo, 0, __pyx_k_20, 0},
123427   {(char *)"parser", __pyx_getprop_4lxml_5etree_12_ElementTree_parser, 0, __pyx_k_21, 0},
123428   {0, 0, 0, 0, 0}
123429 };
123430
123431 static PyNumberMethods __pyx_tp_as_number__ElementTree = {
123432   0, /*nb_add*/
123433   0, /*nb_subtract*/
123434   0, /*nb_multiply*/
123435   #if PY_MAJOR_VERSION < 3
123436   0, /*nb_divide*/
123437   #endif
123438   0, /*nb_remainder*/
123439   0, /*nb_divmod*/
123440   0, /*nb_power*/
123441   0, /*nb_negative*/
123442   0, /*nb_positive*/
123443   0, /*nb_absolute*/
123444   0, /*nb_nonzero*/
123445   0, /*nb_invert*/
123446   0, /*nb_lshift*/
123447   0, /*nb_rshift*/
123448   0, /*nb_and*/
123449   0, /*nb_xor*/
123450   0, /*nb_or*/
123451   #if PY_MAJOR_VERSION < 3
123452   0, /*nb_coerce*/
123453   #endif
123454   0, /*nb_int*/
123455   #if PY_MAJOR_VERSION >= 3
123456   0, /*reserved*/
123457   #else
123458   0, /*nb_long*/
123459   #endif
123460   0, /*nb_float*/
123461   #if PY_MAJOR_VERSION < 3
123462   0, /*nb_oct*/
123463   #endif
123464   #if PY_MAJOR_VERSION < 3
123465   0, /*nb_hex*/
123466   #endif
123467   0, /*nb_inplace_add*/
123468   0, /*nb_inplace_subtract*/
123469   0, /*nb_inplace_multiply*/
123470   #if PY_MAJOR_VERSION < 3
123471   0, /*nb_inplace_divide*/
123472   #endif
123473   0, /*nb_inplace_remainder*/
123474   0, /*nb_inplace_power*/
123475   0, /*nb_inplace_lshift*/
123476   0, /*nb_inplace_rshift*/
123477   0, /*nb_inplace_and*/
123478   0, /*nb_inplace_xor*/
123479   0, /*nb_inplace_or*/
123480   0, /*nb_floor_divide*/
123481   0, /*nb_true_divide*/
123482   0, /*nb_inplace_floor_divide*/
123483   0, /*nb_inplace_true_divide*/
123484   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
123485   0, /*nb_index*/
123486   #endif
123487 };
123488
123489 static PySequenceMethods __pyx_tp_as_sequence__ElementTree = {
123490   0, /*sq_length*/
123491   0, /*sq_concat*/
123492   0, /*sq_repeat*/
123493   0, /*sq_item*/
123494   0, /*sq_slice*/
123495   0, /*sq_ass_item*/
123496   0, /*sq_ass_slice*/
123497   0, /*sq_contains*/
123498   0, /*sq_inplace_concat*/
123499   0, /*sq_inplace_repeat*/
123500 };
123501
123502 static PyMappingMethods __pyx_tp_as_mapping__ElementTree = {
123503   0, /*mp_length*/
123504   0, /*mp_subscript*/
123505   0, /*mp_ass_subscript*/
123506 };
123507
123508 static PyBufferProcs __pyx_tp_as_buffer__ElementTree = {
123509   #if PY_MAJOR_VERSION < 3
123510   0, /*bf_getreadbuffer*/
123511   #endif
123512   #if PY_MAJOR_VERSION < 3
123513   0, /*bf_getwritebuffer*/
123514   #endif
123515   #if PY_MAJOR_VERSION < 3
123516   0, /*bf_getsegcount*/
123517   #endif
123518   #if PY_MAJOR_VERSION < 3
123519   0, /*bf_getcharbuffer*/
123520   #endif
123521   #if PY_VERSION_HEX >= 0x02060000
123522   0, /*bf_getbuffer*/
123523   #endif
123524   #if PY_VERSION_HEX >= 0x02060000
123525   0, /*bf_releasebuffer*/
123526   #endif
123527 };
123528
123529 DL_EXPORT(PyTypeObject) LxmlElementTreeType = {
123530   PyVarObject_HEAD_INIT(0, 0)
123531   __Pyx_NAMESTR("lxml.etree._ElementTree"), /*tp_name*/
123532   sizeof(struct LxmlElementTree), /*tp_basicsize*/
123533   0, /*tp_itemsize*/
123534   __pyx_tp_dealloc_4lxml_5etree__ElementTree, /*tp_dealloc*/
123535   0, /*tp_print*/
123536   0, /*tp_getattr*/
123537   0, /*tp_setattr*/
123538   0, /*tp_compare*/
123539   0, /*tp_repr*/
123540   &__pyx_tp_as_number__ElementTree, /*tp_as_number*/
123541   &__pyx_tp_as_sequence__ElementTree, /*tp_as_sequence*/
123542   &__pyx_tp_as_mapping__ElementTree, /*tp_as_mapping*/
123543   0, /*tp_hash*/
123544   0, /*tp_call*/
123545   0, /*tp_str*/
123546   0, /*tp_getattro*/
123547   0, /*tp_setattro*/
123548   &__pyx_tp_as_buffer__ElementTree, /*tp_as_buffer*/
123549   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
123550   0, /*tp_doc*/
123551   __pyx_tp_traverse_4lxml_5etree__ElementTree, /*tp_traverse*/
123552   __pyx_tp_clear_4lxml_5etree__ElementTree, /*tp_clear*/
123553   0, /*tp_richcompare*/
123554   0, /*tp_weaklistoffset*/
123555   0, /*tp_iter*/
123556   0, /*tp_iternext*/
123557   __pyx_methods_4lxml_5etree__ElementTree, /*tp_methods*/
123558   0, /*tp_members*/
123559   __pyx_getsets_4lxml_5etree__ElementTree, /*tp_getset*/
123560   0, /*tp_base*/
123561   0, /*tp_dict*/
123562   0, /*tp_descr_get*/
123563   0, /*tp_descr_set*/
123564   0, /*tp_dictoffset*/
123565   0, /*tp_init*/
123566   0, /*tp_alloc*/
123567   __pyx_tp_new_4lxml_5etree__ElementTree, /*tp_new*/
123568   0, /*tp_free*/
123569   0, /*tp_is_gc*/
123570   0, /*tp_bases*/
123571   0, /*tp_mro*/
123572   0, /*tp_cache*/
123573   0, /*tp_subclasses*/
123574   0, /*tp_weaklist*/
123575 };
123576
123577 static PyObject *__pyx_tp_new_4lxml_5etree__Attrib(PyTypeObject *t, PyObject *a, PyObject *k) {
123578   struct __pyx_obj_4lxml_5etree__Attrib *p;
123579   PyObject *o = (*t->tp_alloc)(t, 0);
123580   if (!o) return 0;
123581   p = ((struct __pyx_obj_4lxml_5etree__Attrib *)o);
123582   p->_element = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
123583   return o;
123584 }
123585
123586 static void __pyx_tp_dealloc_4lxml_5etree__Attrib(PyObject *o) {
123587   struct __pyx_obj_4lxml_5etree__Attrib *p = (struct __pyx_obj_4lxml_5etree__Attrib *)o;
123588   Py_XDECREF(((PyObject *)p->_element));
123589   (*Py_TYPE(o)->tp_free)(o);
123590 }
123591
123592 static int __pyx_tp_traverse_4lxml_5etree__Attrib(PyObject *o, visitproc v, void *a) {
123593   int e;
123594   struct __pyx_obj_4lxml_5etree__Attrib *p = (struct __pyx_obj_4lxml_5etree__Attrib *)o;
123595   if (p->_element) {
123596     e = (*v)(((PyObject*)p->_element), a); if (e) return e;
123597   }
123598   return 0;
123599 }
123600
123601 static int __pyx_tp_clear_4lxml_5etree__Attrib(PyObject *o) {
123602   struct __pyx_obj_4lxml_5etree__Attrib *p = (struct __pyx_obj_4lxml_5etree__Attrib *)o;
123603   PyObject* tmp;
123604   tmp = ((PyObject*)p->_element);
123605   p->_element = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
123606   Py_XDECREF(tmp);
123607   return 0;
123608 }
123609 static PyObject *__pyx_sq_item_4lxml_5etree__Attrib(PyObject *o, Py_ssize_t i) {
123610   PyObject *r;
123611   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
123612   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
123613   Py_DECREF(x);
123614   return r;
123615 }
123616
123617 static int __pyx_mp_ass_subscript_4lxml_5etree__Attrib(PyObject *o, PyObject *i, PyObject *v) {
123618   if (v) {
123619     return __pyx_pf_4lxml_5etree_7_Attrib___setitem__(o, i, v);
123620   }
123621   else {
123622     return __pyx_pf_4lxml_5etree_7_Attrib___delitem__(o, i);
123623   }
123624 }
123625
123626 static struct PyMethodDef __pyx_methods_4lxml_5etree__Attrib[] = {
123627   {__Pyx_NAMESTR("update"), (PyCFunction)__pyx_pf_4lxml_5etree_7_Attrib_update, METH_O, __Pyx_DOCSTR(0)},
123628   {__Pyx_NAMESTR("pop"), (PyCFunction)__pyx_pf_4lxml_5etree_7_Attrib_pop, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
123629   {__Pyx_NAMESTR("clear"), (PyCFunction)__pyx_pf_4lxml_5etree_7_Attrib_clear, METH_NOARGS, __Pyx_DOCSTR(0)},
123630   {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_4lxml_5etree_7_Attrib___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
123631   {__Pyx_NAMESTR("__getitem__"), (PyCFunction)__pyx_pf_4lxml_5etree_7_Attrib___getitem__, METH_O|METH_COEXIST, __Pyx_DOCSTR(0)},
123632   {__Pyx_NAMESTR("get"), (PyCFunction)__pyx_pf_4lxml_5etree_7_Attrib_get, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
123633   {__Pyx_NAMESTR("keys"), (PyCFunction)__pyx_pf_4lxml_5etree_7_Attrib_keys, METH_NOARGS, __Pyx_DOCSTR(0)},
123634   {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_4lxml_5etree_7_Attrib___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
123635   {__Pyx_NAMESTR("iterkeys"), (PyCFunction)__pyx_pf_4lxml_5etree_7_Attrib_iterkeys, METH_NOARGS, __Pyx_DOCSTR(0)},
123636   {__Pyx_NAMESTR("values"), (PyCFunction)__pyx_pf_4lxml_5etree_7_Attrib_values, METH_NOARGS, __Pyx_DOCSTR(0)},
123637   {__Pyx_NAMESTR("itervalues"), (PyCFunction)__pyx_pf_4lxml_5etree_7_Attrib_itervalues, METH_NOARGS, __Pyx_DOCSTR(0)},
123638   {__Pyx_NAMESTR("items"), (PyCFunction)__pyx_pf_4lxml_5etree_7_Attrib_items, METH_NOARGS, __Pyx_DOCSTR(0)},
123639   {__Pyx_NAMESTR("iteritems"), (PyCFunction)__pyx_pf_4lxml_5etree_7_Attrib_iteritems, METH_NOARGS, __Pyx_DOCSTR(0)},
123640   {__Pyx_NAMESTR("has_key"), (PyCFunction)__pyx_pf_4lxml_5etree_7_Attrib_has_key, METH_O, __Pyx_DOCSTR(0)},
123641   {0, 0, 0, 0}
123642 };
123643
123644 static PyNumberMethods __pyx_tp_as_number__Attrib = {
123645   0, /*nb_add*/
123646   0, /*nb_subtract*/
123647   0, /*nb_multiply*/
123648   #if PY_MAJOR_VERSION < 3
123649   0, /*nb_divide*/
123650   #endif
123651   0, /*nb_remainder*/
123652   0, /*nb_divmod*/
123653   0, /*nb_power*/
123654   0, /*nb_negative*/
123655   0, /*nb_positive*/
123656   0, /*nb_absolute*/
123657   __pyx_pf_4lxml_5etree_7_Attrib___nonzero__, /*nb_nonzero*/
123658   0, /*nb_invert*/
123659   0, /*nb_lshift*/
123660   0, /*nb_rshift*/
123661   0, /*nb_and*/
123662   0, /*nb_xor*/
123663   0, /*nb_or*/
123664   #if PY_MAJOR_VERSION < 3
123665   0, /*nb_coerce*/
123666   #endif
123667   0, /*nb_int*/
123668   #if PY_MAJOR_VERSION >= 3
123669   0, /*reserved*/
123670   #else
123671   0, /*nb_long*/
123672   #endif
123673   0, /*nb_float*/
123674   #if PY_MAJOR_VERSION < 3
123675   0, /*nb_oct*/
123676   #endif
123677   #if PY_MAJOR_VERSION < 3
123678   0, /*nb_hex*/
123679   #endif
123680   0, /*nb_inplace_add*/
123681   0, /*nb_inplace_subtract*/
123682   0, /*nb_inplace_multiply*/
123683   #if PY_MAJOR_VERSION < 3
123684   0, /*nb_inplace_divide*/
123685   #endif
123686   0, /*nb_inplace_remainder*/
123687   0, /*nb_inplace_power*/
123688   0, /*nb_inplace_lshift*/
123689   0, /*nb_inplace_rshift*/
123690   0, /*nb_inplace_and*/
123691   0, /*nb_inplace_xor*/
123692   0, /*nb_inplace_or*/
123693   0, /*nb_floor_divide*/
123694   0, /*nb_true_divide*/
123695   0, /*nb_inplace_floor_divide*/
123696   0, /*nb_inplace_true_divide*/
123697   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
123698   0, /*nb_index*/
123699   #endif
123700 };
123701
123702 static PySequenceMethods __pyx_tp_as_sequence__Attrib = {
123703   __pyx_pf_4lxml_5etree_7_Attrib___len__, /*sq_length*/
123704   0, /*sq_concat*/
123705   0, /*sq_repeat*/
123706   __pyx_sq_item_4lxml_5etree__Attrib, /*sq_item*/
123707   0, /*sq_slice*/
123708   0, /*sq_ass_item*/
123709   0, /*sq_ass_slice*/
123710   __pyx_pf_4lxml_5etree_7_Attrib___contains__, /*sq_contains*/
123711   0, /*sq_inplace_concat*/
123712   0, /*sq_inplace_repeat*/
123713 };
123714
123715 static PyMappingMethods __pyx_tp_as_mapping__Attrib = {
123716   __pyx_pf_4lxml_5etree_7_Attrib___len__, /*mp_length*/
123717   __pyx_pf_4lxml_5etree_7_Attrib___getitem__, /*mp_subscript*/
123718   __pyx_mp_ass_subscript_4lxml_5etree__Attrib, /*mp_ass_subscript*/
123719 };
123720
123721 static PyBufferProcs __pyx_tp_as_buffer__Attrib = {
123722   #if PY_MAJOR_VERSION < 3
123723   0, /*bf_getreadbuffer*/
123724   #endif
123725   #if PY_MAJOR_VERSION < 3
123726   0, /*bf_getwritebuffer*/
123727   #endif
123728   #if PY_MAJOR_VERSION < 3
123729   0, /*bf_getsegcount*/
123730   #endif
123731   #if PY_MAJOR_VERSION < 3
123732   0, /*bf_getcharbuffer*/
123733   #endif
123734   #if PY_VERSION_HEX >= 0x02060000
123735   0, /*bf_getbuffer*/
123736   #endif
123737   #if PY_VERSION_HEX >= 0x02060000
123738   0, /*bf_releasebuffer*/
123739   #endif
123740 };
123741
123742 PyTypeObject __pyx_type_4lxml_5etree__Attrib = {
123743   PyVarObject_HEAD_INIT(0, 0)
123744   __Pyx_NAMESTR("lxml.etree._Attrib"), /*tp_name*/
123745   sizeof(struct __pyx_obj_4lxml_5etree__Attrib), /*tp_basicsize*/
123746   0, /*tp_itemsize*/
123747   __pyx_tp_dealloc_4lxml_5etree__Attrib, /*tp_dealloc*/
123748   0, /*tp_print*/
123749   0, /*tp_getattr*/
123750   0, /*tp_setattr*/
123751   0, /*tp_compare*/
123752   __pyx_pf_4lxml_5etree_7_Attrib___repr__, /*tp_repr*/
123753   &__pyx_tp_as_number__Attrib, /*tp_as_number*/
123754   &__pyx_tp_as_sequence__Attrib, /*tp_as_sequence*/
123755   &__pyx_tp_as_mapping__Attrib, /*tp_as_mapping*/
123756   0, /*tp_hash*/
123757   0, /*tp_call*/
123758   0, /*tp_str*/
123759   0, /*tp_getattro*/
123760   0, /*tp_setattro*/
123761   &__pyx_tp_as_buffer__Attrib, /*tp_as_buffer*/
123762   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
123763   __Pyx_DOCSTR("A dict-like proxy for the ``Element.attrib`` property.\n    "), /*tp_doc*/
123764   __pyx_tp_traverse_4lxml_5etree__Attrib, /*tp_traverse*/
123765   __pyx_tp_clear_4lxml_5etree__Attrib, /*tp_clear*/
123766   __pyx_pf_4lxml_5etree_7_Attrib___richcmp__, /*tp_richcompare*/
123767   0, /*tp_weaklistoffset*/
123768   __pyx_pf_4lxml_5etree_7_Attrib___iter__, /*tp_iter*/
123769   0, /*tp_iternext*/
123770   __pyx_methods_4lxml_5etree__Attrib, /*tp_methods*/
123771   0, /*tp_members*/
123772   0, /*tp_getset*/
123773   0, /*tp_base*/
123774   0, /*tp_dict*/
123775   0, /*tp_descr_get*/
123776   0, /*tp_descr_set*/
123777   0, /*tp_dictoffset*/
123778   __pyx_pf_4lxml_5etree_7_Attrib___init__, /*tp_init*/
123779   0, /*tp_alloc*/
123780   __pyx_tp_new_4lxml_5etree__Attrib, /*tp_new*/
123781   0, /*tp_free*/
123782   0, /*tp_is_gc*/
123783   0, /*tp_bases*/
123784   0, /*tp_mro*/
123785   0, /*tp_cache*/
123786   0, /*tp_subclasses*/
123787   0, /*tp_weaklist*/
123788 };
123789
123790 static PyObject *__pyx_tp_new_4lxml_5etree__AttribIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
123791   struct __pyx_obj_4lxml_5etree__AttribIterator *p;
123792   PyObject *o = (*t->tp_alloc)(t, 0);
123793   if (!o) return 0;
123794   p = ((struct __pyx_obj_4lxml_5etree__AttribIterator *)o);
123795   p->_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
123796   return o;
123797 }
123798
123799 static void __pyx_tp_dealloc_4lxml_5etree__AttribIterator(PyObject *o) {
123800   struct __pyx_obj_4lxml_5etree__AttribIterator *p = (struct __pyx_obj_4lxml_5etree__AttribIterator *)o;
123801   Py_XDECREF(((PyObject *)p->_node));
123802   (*Py_TYPE(o)->tp_free)(o);
123803 }
123804
123805 static int __pyx_tp_traverse_4lxml_5etree__AttribIterator(PyObject *o, visitproc v, void *a) {
123806   int e;
123807   struct __pyx_obj_4lxml_5etree__AttribIterator *p = (struct __pyx_obj_4lxml_5etree__AttribIterator *)o;
123808   if (p->_node) {
123809     e = (*v)(((PyObject*)p->_node), a); if (e) return e;
123810   }
123811   return 0;
123812 }
123813
123814 static int __pyx_tp_clear_4lxml_5etree__AttribIterator(PyObject *o) {
123815   struct __pyx_obj_4lxml_5etree__AttribIterator *p = (struct __pyx_obj_4lxml_5etree__AttribIterator *)o;
123816   PyObject* tmp;
123817   tmp = ((PyObject*)p->_node);
123818   p->_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
123819   Py_XDECREF(tmp);
123820   return 0;
123821 }
123822
123823 static struct PyMethodDef __pyx_methods_4lxml_5etree__AttribIterator[] = {
123824   {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_4lxml_5etree_15_AttribIterator___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
123825   {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_4lxml_5etree_15_AttribIterator___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
123826   {0, 0, 0, 0}
123827 };
123828
123829 static PyNumberMethods __pyx_tp_as_number__AttribIterator = {
123830   0, /*nb_add*/
123831   0, /*nb_subtract*/
123832   0, /*nb_multiply*/
123833   #if PY_MAJOR_VERSION < 3
123834   0, /*nb_divide*/
123835   #endif
123836   0, /*nb_remainder*/
123837   0, /*nb_divmod*/
123838   0, /*nb_power*/
123839   0, /*nb_negative*/
123840   0, /*nb_positive*/
123841   0, /*nb_absolute*/
123842   0, /*nb_nonzero*/
123843   0, /*nb_invert*/
123844   0, /*nb_lshift*/
123845   0, /*nb_rshift*/
123846   0, /*nb_and*/
123847   0, /*nb_xor*/
123848   0, /*nb_or*/
123849   #if PY_MAJOR_VERSION < 3
123850   0, /*nb_coerce*/
123851   #endif
123852   0, /*nb_int*/
123853   #if PY_MAJOR_VERSION >= 3
123854   0, /*reserved*/
123855   #else
123856   0, /*nb_long*/
123857   #endif
123858   0, /*nb_float*/
123859   #if PY_MAJOR_VERSION < 3
123860   0, /*nb_oct*/
123861   #endif
123862   #if PY_MAJOR_VERSION < 3
123863   0, /*nb_hex*/
123864   #endif
123865   0, /*nb_inplace_add*/
123866   0, /*nb_inplace_subtract*/
123867   0, /*nb_inplace_multiply*/
123868   #if PY_MAJOR_VERSION < 3
123869   0, /*nb_inplace_divide*/
123870   #endif
123871   0, /*nb_inplace_remainder*/
123872   0, /*nb_inplace_power*/
123873   0, /*nb_inplace_lshift*/
123874   0, /*nb_inplace_rshift*/
123875   0, /*nb_inplace_and*/
123876   0, /*nb_inplace_xor*/
123877   0, /*nb_inplace_or*/
123878   0, /*nb_floor_divide*/
123879   0, /*nb_true_divide*/
123880   0, /*nb_inplace_floor_divide*/
123881   0, /*nb_inplace_true_divide*/
123882   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
123883   0, /*nb_index*/
123884   #endif
123885 };
123886
123887 static PySequenceMethods __pyx_tp_as_sequence__AttribIterator = {
123888   0, /*sq_length*/
123889   0, /*sq_concat*/
123890   0, /*sq_repeat*/
123891   0, /*sq_item*/
123892   0, /*sq_slice*/
123893   0, /*sq_ass_item*/
123894   0, /*sq_ass_slice*/
123895   0, /*sq_contains*/
123896   0, /*sq_inplace_concat*/
123897   0, /*sq_inplace_repeat*/
123898 };
123899
123900 static PyMappingMethods __pyx_tp_as_mapping__AttribIterator = {
123901   0, /*mp_length*/
123902   0, /*mp_subscript*/
123903   0, /*mp_ass_subscript*/
123904 };
123905
123906 static PyBufferProcs __pyx_tp_as_buffer__AttribIterator = {
123907   #if PY_MAJOR_VERSION < 3
123908   0, /*bf_getreadbuffer*/
123909   #endif
123910   #if PY_MAJOR_VERSION < 3
123911   0, /*bf_getwritebuffer*/
123912   #endif
123913   #if PY_MAJOR_VERSION < 3
123914   0, /*bf_getsegcount*/
123915   #endif
123916   #if PY_MAJOR_VERSION < 3
123917   0, /*bf_getcharbuffer*/
123918   #endif
123919   #if PY_VERSION_HEX >= 0x02060000
123920   0, /*bf_getbuffer*/
123921   #endif
123922   #if PY_VERSION_HEX >= 0x02060000
123923   0, /*bf_releasebuffer*/
123924   #endif
123925 };
123926
123927 PyTypeObject __pyx_type_4lxml_5etree__AttribIterator = {
123928   PyVarObject_HEAD_INIT(0, 0)
123929   __Pyx_NAMESTR("lxml.etree._AttribIterator"), /*tp_name*/
123930   sizeof(struct __pyx_obj_4lxml_5etree__AttribIterator), /*tp_basicsize*/
123931   0, /*tp_itemsize*/
123932   __pyx_tp_dealloc_4lxml_5etree__AttribIterator, /*tp_dealloc*/
123933   0, /*tp_print*/
123934   0, /*tp_getattr*/
123935   0, /*tp_setattr*/
123936   0, /*tp_compare*/
123937   0, /*tp_repr*/
123938   &__pyx_tp_as_number__AttribIterator, /*tp_as_number*/
123939   &__pyx_tp_as_sequence__AttribIterator, /*tp_as_sequence*/
123940   &__pyx_tp_as_mapping__AttribIterator, /*tp_as_mapping*/
123941   0, /*tp_hash*/
123942   0, /*tp_call*/
123943   0, /*tp_str*/
123944   0, /*tp_getattro*/
123945   0, /*tp_setattro*/
123946   &__pyx_tp_as_buffer__AttribIterator, /*tp_as_buffer*/
123947   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
123948   __Pyx_DOCSTR("Attribute iterator - for internal use only!\n    "), /*tp_doc*/
123949   __pyx_tp_traverse_4lxml_5etree__AttribIterator, /*tp_traverse*/
123950   __pyx_tp_clear_4lxml_5etree__AttribIterator, /*tp_clear*/
123951   0, /*tp_richcompare*/
123952   0, /*tp_weaklistoffset*/
123953   __pyx_pf_4lxml_5etree_15_AttribIterator___iter__, /*tp_iter*/
123954   __pyx_pf_4lxml_5etree_15_AttribIterator___next__, /*tp_iternext*/
123955   __pyx_methods_4lxml_5etree__AttribIterator, /*tp_methods*/
123956   0, /*tp_members*/
123957   0, /*tp_getset*/
123958   0, /*tp_base*/
123959   0, /*tp_dict*/
123960   0, /*tp_descr_get*/
123961   0, /*tp_descr_set*/
123962   0, /*tp_dictoffset*/
123963   0, /*tp_init*/
123964   0, /*tp_alloc*/
123965   __pyx_tp_new_4lxml_5etree__AttribIterator, /*tp_new*/
123966   0, /*tp_free*/
123967   0, /*tp_is_gc*/
123968   0, /*tp_bases*/
123969   0, /*tp_mro*/
123970   0, /*tp_cache*/
123971   0, /*tp_subclasses*/
123972   0, /*tp_weaklist*/
123973 };
123974 static struct __pyx_vtabstruct_4lxml_5etree__ElementTagMatcher __pyx_vtable_4lxml_5etree__ElementTagMatcher;
123975
123976 static PyObject *__pyx_tp_new_4lxml_5etree__ElementTagMatcher(PyTypeObject *t, PyObject *a, PyObject *k) {
123977   struct LxmlElementTagMatcher *p;
123978   PyObject *o = (*t->tp_alloc)(t, 0);
123979   if (!o) return 0;
123980   p = ((struct LxmlElementTagMatcher *)o);
123981   p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__ElementTagMatcher;
123982   p->_pystrings = Py_None; Py_INCREF(Py_None);
123983   return o;
123984 }
123985
123986 static void __pyx_tp_dealloc_4lxml_5etree__ElementTagMatcher(PyObject *o) {
123987   struct LxmlElementTagMatcher *p = (struct LxmlElementTagMatcher *)o;
123988   Py_XDECREF(p->_pystrings);
123989   (*Py_TYPE(o)->tp_free)(o);
123990 }
123991
123992 static int __pyx_tp_traverse_4lxml_5etree__ElementTagMatcher(PyObject *o, visitproc v, void *a) {
123993   int e;
123994   struct LxmlElementTagMatcher *p = (struct LxmlElementTagMatcher *)o;
123995   if (p->_pystrings) {
123996     e = (*v)(p->_pystrings, a); if (e) return e;
123997   }
123998   return 0;
123999 }
124000
124001 static int __pyx_tp_clear_4lxml_5etree__ElementTagMatcher(PyObject *o) {
124002   struct LxmlElementTagMatcher *p = (struct LxmlElementTagMatcher *)o;
124003   PyObject* tmp;
124004   tmp = ((PyObject*)p->_pystrings);
124005   p->_pystrings = Py_None; Py_INCREF(Py_None);
124006   Py_XDECREF(tmp);
124007   return 0;
124008 }
124009
124010 static struct PyMethodDef __pyx_methods_4lxml_5etree__ElementTagMatcher[] = {
124011   {0, 0, 0, 0}
124012 };
124013
124014 static PyNumberMethods __pyx_tp_as_number__ElementTagMatcher = {
124015   0, /*nb_add*/
124016   0, /*nb_subtract*/
124017   0, /*nb_multiply*/
124018   #if PY_MAJOR_VERSION < 3
124019   0, /*nb_divide*/
124020   #endif
124021   0, /*nb_remainder*/
124022   0, /*nb_divmod*/
124023   0, /*nb_power*/
124024   0, /*nb_negative*/
124025   0, /*nb_positive*/
124026   0, /*nb_absolute*/
124027   0, /*nb_nonzero*/
124028   0, /*nb_invert*/
124029   0, /*nb_lshift*/
124030   0, /*nb_rshift*/
124031   0, /*nb_and*/
124032   0, /*nb_xor*/
124033   0, /*nb_or*/
124034   #if PY_MAJOR_VERSION < 3
124035   0, /*nb_coerce*/
124036   #endif
124037   0, /*nb_int*/
124038   #if PY_MAJOR_VERSION >= 3
124039   0, /*reserved*/
124040   #else
124041   0, /*nb_long*/
124042   #endif
124043   0, /*nb_float*/
124044   #if PY_MAJOR_VERSION < 3
124045   0, /*nb_oct*/
124046   #endif
124047   #if PY_MAJOR_VERSION < 3
124048   0, /*nb_hex*/
124049   #endif
124050   0, /*nb_inplace_add*/
124051   0, /*nb_inplace_subtract*/
124052   0, /*nb_inplace_multiply*/
124053   #if PY_MAJOR_VERSION < 3
124054   0, /*nb_inplace_divide*/
124055   #endif
124056   0, /*nb_inplace_remainder*/
124057   0, /*nb_inplace_power*/
124058   0, /*nb_inplace_lshift*/
124059   0, /*nb_inplace_rshift*/
124060   0, /*nb_inplace_and*/
124061   0, /*nb_inplace_xor*/
124062   0, /*nb_inplace_or*/
124063   0, /*nb_floor_divide*/
124064   0, /*nb_true_divide*/
124065   0, /*nb_inplace_floor_divide*/
124066   0, /*nb_inplace_true_divide*/
124067   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
124068   0, /*nb_index*/
124069   #endif
124070 };
124071
124072 static PySequenceMethods __pyx_tp_as_sequence__ElementTagMatcher = {
124073   0, /*sq_length*/
124074   0, /*sq_concat*/
124075   0, /*sq_repeat*/
124076   0, /*sq_item*/
124077   0, /*sq_slice*/
124078   0, /*sq_ass_item*/
124079   0, /*sq_ass_slice*/
124080   0, /*sq_contains*/
124081   0, /*sq_inplace_concat*/
124082   0, /*sq_inplace_repeat*/
124083 };
124084
124085 static PyMappingMethods __pyx_tp_as_mapping__ElementTagMatcher = {
124086   0, /*mp_length*/
124087   0, /*mp_subscript*/
124088   0, /*mp_ass_subscript*/
124089 };
124090
124091 static PyBufferProcs __pyx_tp_as_buffer__ElementTagMatcher = {
124092   #if PY_MAJOR_VERSION < 3
124093   0, /*bf_getreadbuffer*/
124094   #endif
124095   #if PY_MAJOR_VERSION < 3
124096   0, /*bf_getwritebuffer*/
124097   #endif
124098   #if PY_MAJOR_VERSION < 3
124099   0, /*bf_getsegcount*/
124100   #endif
124101   #if PY_MAJOR_VERSION < 3
124102   0, /*bf_getcharbuffer*/
124103   #endif
124104   #if PY_VERSION_HEX >= 0x02060000
124105   0, /*bf_getbuffer*/
124106   #endif
124107   #if PY_VERSION_HEX >= 0x02060000
124108   0, /*bf_releasebuffer*/
124109   #endif
124110 };
124111
124112 DL_EXPORT(PyTypeObject) LxmlElementTagMatcherType = {
124113   PyVarObject_HEAD_INIT(0, 0)
124114   __Pyx_NAMESTR("lxml.etree._ElementTagMatcher"), /*tp_name*/
124115   sizeof(struct LxmlElementTagMatcher), /*tp_basicsize*/
124116   0, /*tp_itemsize*/
124117   __pyx_tp_dealloc_4lxml_5etree__ElementTagMatcher, /*tp_dealloc*/
124118   0, /*tp_print*/
124119   0, /*tp_getattr*/
124120   0, /*tp_setattr*/
124121   0, /*tp_compare*/
124122   0, /*tp_repr*/
124123   &__pyx_tp_as_number__ElementTagMatcher, /*tp_as_number*/
124124   &__pyx_tp_as_sequence__ElementTagMatcher, /*tp_as_sequence*/
124125   &__pyx_tp_as_mapping__ElementTagMatcher, /*tp_as_mapping*/
124126   0, /*tp_hash*/
124127   0, /*tp_call*/
124128   0, /*tp_str*/
124129   0, /*tp_getattro*/
124130   0, /*tp_setattro*/
124131   &__pyx_tp_as_buffer__ElementTagMatcher, /*tp_as_buffer*/
124132   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
124133   0, /*tp_doc*/
124134   __pyx_tp_traverse_4lxml_5etree__ElementTagMatcher, /*tp_traverse*/
124135   __pyx_tp_clear_4lxml_5etree__ElementTagMatcher, /*tp_clear*/
124136   0, /*tp_richcompare*/
124137   0, /*tp_weaklistoffset*/
124138   0, /*tp_iter*/
124139   0, /*tp_iternext*/
124140   __pyx_methods_4lxml_5etree__ElementTagMatcher, /*tp_methods*/
124141   0, /*tp_members*/
124142   0, /*tp_getset*/
124143   0, /*tp_base*/
124144   0, /*tp_dict*/
124145   0, /*tp_descr_get*/
124146   0, /*tp_descr_set*/
124147   0, /*tp_dictoffset*/
124148   0, /*tp_init*/
124149   0, /*tp_alloc*/
124150   __pyx_tp_new_4lxml_5etree__ElementTagMatcher, /*tp_new*/
124151   0, /*tp_free*/
124152   0, /*tp_is_gc*/
124153   0, /*tp_bases*/
124154   0, /*tp_mro*/
124155   0, /*tp_cache*/
124156   0, /*tp_subclasses*/
124157   0, /*tp_weaklist*/
124158 };
124159 static struct __pyx_vtabstruct_4lxml_5etree__ElementIterator __pyx_vtable_4lxml_5etree__ElementIterator;
124160
124161 static PyObject *__pyx_tp_new_4lxml_5etree__ElementIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
124162   struct LxmlElementIterator *p;
124163   PyObject *o = __pyx_tp_new_4lxml_5etree__ElementTagMatcher(t, a, k);
124164   if (!o) return 0;
124165   p = ((struct LxmlElementIterator *)o);
124166   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__ElementTagMatcher*)__pyx_vtabptr_4lxml_5etree__ElementIterator;
124167   p->_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
124168   return o;
124169 }
124170
124171 static void __pyx_tp_dealloc_4lxml_5etree__ElementIterator(PyObject *o) {
124172   struct LxmlElementIterator *p = (struct LxmlElementIterator *)o;
124173   Py_XDECREF(((PyObject *)p->_node));
124174   __pyx_tp_dealloc_4lxml_5etree__ElementTagMatcher(o);
124175 }
124176
124177 static int __pyx_tp_traverse_4lxml_5etree__ElementIterator(PyObject *o, visitproc v, void *a) {
124178   int e;
124179   struct LxmlElementIterator *p = (struct LxmlElementIterator *)o;
124180   e = __pyx_tp_traverse_4lxml_5etree__ElementTagMatcher(o, v, a); if (e) return e;
124181   if (p->_node) {
124182     e = (*v)(((PyObject*)p->_node), a); if (e) return e;
124183   }
124184   return 0;
124185 }
124186
124187 static int __pyx_tp_clear_4lxml_5etree__ElementIterator(PyObject *o) {
124188   struct LxmlElementIterator *p = (struct LxmlElementIterator *)o;
124189   PyObject* tmp;
124190   __pyx_tp_clear_4lxml_5etree__ElementTagMatcher(o);
124191   tmp = ((PyObject*)p->_node);
124192   p->_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
124193   Py_XDECREF(tmp);
124194   return 0;
124195 }
124196
124197 static struct PyMethodDef __pyx_methods_4lxml_5etree__ElementIterator[] = {
124198   {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_4lxml_5etree_16_ElementIterator___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
124199   {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_4lxml_5etree_16_ElementIterator___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
124200   {0, 0, 0, 0}
124201 };
124202
124203 static PyNumberMethods __pyx_tp_as_number__ElementIterator = {
124204   0, /*nb_add*/
124205   0, /*nb_subtract*/
124206   0, /*nb_multiply*/
124207   #if PY_MAJOR_VERSION < 3
124208   0, /*nb_divide*/
124209   #endif
124210   0, /*nb_remainder*/
124211   0, /*nb_divmod*/
124212   0, /*nb_power*/
124213   0, /*nb_negative*/
124214   0, /*nb_positive*/
124215   0, /*nb_absolute*/
124216   0, /*nb_nonzero*/
124217   0, /*nb_invert*/
124218   0, /*nb_lshift*/
124219   0, /*nb_rshift*/
124220   0, /*nb_and*/
124221   0, /*nb_xor*/
124222   0, /*nb_or*/
124223   #if PY_MAJOR_VERSION < 3
124224   0, /*nb_coerce*/
124225   #endif
124226   0, /*nb_int*/
124227   #if PY_MAJOR_VERSION >= 3
124228   0, /*reserved*/
124229   #else
124230   0, /*nb_long*/
124231   #endif
124232   0, /*nb_float*/
124233   #if PY_MAJOR_VERSION < 3
124234   0, /*nb_oct*/
124235   #endif
124236   #if PY_MAJOR_VERSION < 3
124237   0, /*nb_hex*/
124238   #endif
124239   0, /*nb_inplace_add*/
124240   0, /*nb_inplace_subtract*/
124241   0, /*nb_inplace_multiply*/
124242   #if PY_MAJOR_VERSION < 3
124243   0, /*nb_inplace_divide*/
124244   #endif
124245   0, /*nb_inplace_remainder*/
124246   0, /*nb_inplace_power*/
124247   0, /*nb_inplace_lshift*/
124248   0, /*nb_inplace_rshift*/
124249   0, /*nb_inplace_and*/
124250   0, /*nb_inplace_xor*/
124251   0, /*nb_inplace_or*/
124252   0, /*nb_floor_divide*/
124253   0, /*nb_true_divide*/
124254   0, /*nb_inplace_floor_divide*/
124255   0, /*nb_inplace_true_divide*/
124256   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
124257   0, /*nb_index*/
124258   #endif
124259 };
124260
124261 static PySequenceMethods __pyx_tp_as_sequence__ElementIterator = {
124262   0, /*sq_length*/
124263   0, /*sq_concat*/
124264   0, /*sq_repeat*/
124265   0, /*sq_item*/
124266   0, /*sq_slice*/
124267   0, /*sq_ass_item*/
124268   0, /*sq_ass_slice*/
124269   0, /*sq_contains*/
124270   0, /*sq_inplace_concat*/
124271   0, /*sq_inplace_repeat*/
124272 };
124273
124274 static PyMappingMethods __pyx_tp_as_mapping__ElementIterator = {
124275   0, /*mp_length*/
124276   0, /*mp_subscript*/
124277   0, /*mp_ass_subscript*/
124278 };
124279
124280 static PyBufferProcs __pyx_tp_as_buffer__ElementIterator = {
124281   #if PY_MAJOR_VERSION < 3
124282   0, /*bf_getreadbuffer*/
124283   #endif
124284   #if PY_MAJOR_VERSION < 3
124285   0, /*bf_getwritebuffer*/
124286   #endif
124287   #if PY_MAJOR_VERSION < 3
124288   0, /*bf_getsegcount*/
124289   #endif
124290   #if PY_MAJOR_VERSION < 3
124291   0, /*bf_getcharbuffer*/
124292   #endif
124293   #if PY_VERSION_HEX >= 0x02060000
124294   0, /*bf_getbuffer*/
124295   #endif
124296   #if PY_VERSION_HEX >= 0x02060000
124297   0, /*bf_releasebuffer*/
124298   #endif
124299 };
124300
124301 DL_EXPORT(PyTypeObject) LxmlElementIteratorType = {
124302   PyVarObject_HEAD_INIT(0, 0)
124303   __Pyx_NAMESTR("lxml.etree._ElementIterator"), /*tp_name*/
124304   sizeof(struct LxmlElementIterator), /*tp_basicsize*/
124305   0, /*tp_itemsize*/
124306   __pyx_tp_dealloc_4lxml_5etree__ElementIterator, /*tp_dealloc*/
124307   0, /*tp_print*/
124308   0, /*tp_getattr*/
124309   0, /*tp_setattr*/
124310   0, /*tp_compare*/
124311   0, /*tp_repr*/
124312   &__pyx_tp_as_number__ElementIterator, /*tp_as_number*/
124313   &__pyx_tp_as_sequence__ElementIterator, /*tp_as_sequence*/
124314   &__pyx_tp_as_mapping__ElementIterator, /*tp_as_mapping*/
124315   0, /*tp_hash*/
124316   0, /*tp_call*/
124317   0, /*tp_str*/
124318   0, /*tp_getattro*/
124319   0, /*tp_setattro*/
124320   &__pyx_tp_as_buffer__ElementIterator, /*tp_as_buffer*/
124321   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
124322   0, /*tp_doc*/
124323   __pyx_tp_traverse_4lxml_5etree__ElementIterator, /*tp_traverse*/
124324   __pyx_tp_clear_4lxml_5etree__ElementIterator, /*tp_clear*/
124325   0, /*tp_richcompare*/
124326   0, /*tp_weaklistoffset*/
124327   __pyx_pf_4lxml_5etree_16_ElementIterator___iter__, /*tp_iter*/
124328   __pyx_pf_4lxml_5etree_16_ElementIterator___next__, /*tp_iternext*/
124329   __pyx_methods_4lxml_5etree__ElementIterator, /*tp_methods*/
124330   0, /*tp_members*/
124331   0, /*tp_getset*/
124332   0, /*tp_base*/
124333   0, /*tp_dict*/
124334   0, /*tp_descr_get*/
124335   0, /*tp_descr_set*/
124336   0, /*tp_dictoffset*/
124337   0, /*tp_init*/
124338   0, /*tp_alloc*/
124339   __pyx_tp_new_4lxml_5etree__ElementIterator, /*tp_new*/
124340   0, /*tp_free*/
124341   0, /*tp_is_gc*/
124342   0, /*tp_bases*/
124343   0, /*tp_mro*/
124344   0, /*tp_cache*/
124345   0, /*tp_subclasses*/
124346   0, /*tp_weaklist*/
124347 };
124348 static struct __pyx_vtabstruct_4lxml_5etree_ElementChildIterator __pyx_vtable_4lxml_5etree_ElementChildIterator;
124349
124350 static PyObject *__pyx_tp_new_4lxml_5etree_ElementChildIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
124351   struct __pyx_obj_4lxml_5etree_ElementChildIterator *p;
124352   PyObject *o = __pyx_tp_new_4lxml_5etree__ElementIterator(t, a, k);
124353   if (!o) return 0;
124354   p = ((struct __pyx_obj_4lxml_5etree_ElementChildIterator *)o);
124355   p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__ElementTagMatcher*)__pyx_vtabptr_4lxml_5etree_ElementChildIterator;
124356   return o;
124357 }
124358
124359 static struct PyMethodDef __pyx_methods_4lxml_5etree_ElementChildIterator[] = {
124360   {0, 0, 0, 0}
124361 };
124362
124363 static PyNumberMethods __pyx_tp_as_number_ElementChildIterator = {
124364   0, /*nb_add*/
124365   0, /*nb_subtract*/
124366   0, /*nb_multiply*/
124367   #if PY_MAJOR_VERSION < 3
124368   0, /*nb_divide*/
124369   #endif
124370   0, /*nb_remainder*/
124371   0, /*nb_divmod*/
124372   0, /*nb_power*/
124373   0, /*nb_negative*/
124374   0, /*nb_positive*/
124375   0, /*nb_absolute*/
124376   0, /*nb_nonzero*/
124377   0, /*nb_invert*/
124378   0, /*nb_lshift*/
124379   0, /*nb_rshift*/
124380   0, /*nb_and*/
124381   0, /*nb_xor*/
124382   0, /*nb_or*/
124383   #if PY_MAJOR_VERSION < 3
124384   0, /*nb_coerce*/
124385   #endif
124386   0, /*nb_int*/
124387   #if PY_MAJOR_VERSION >= 3
124388   0, /*reserved*/
124389   #else
124390   0, /*nb_long*/
124391   #endif
124392   0, /*nb_float*/
124393   #if PY_MAJOR_VERSION < 3
124394   0, /*nb_oct*/
124395   #endif
124396   #if PY_MAJOR_VERSION < 3
124397   0, /*nb_hex*/
124398   #endif
124399   0, /*nb_inplace_add*/
124400   0, /*nb_inplace_subtract*/
124401   0, /*nb_inplace_multiply*/
124402   #if PY_MAJOR_VERSION < 3
124403   0, /*nb_inplace_divide*/
124404   #endif
124405   0, /*nb_inplace_remainder*/
124406   0, /*nb_inplace_power*/
124407   0, /*nb_inplace_lshift*/
124408   0, /*nb_inplace_rshift*/
124409   0, /*nb_inplace_and*/
124410   0, /*nb_inplace_xor*/
124411   0, /*nb_inplace_or*/
124412   0, /*nb_floor_divide*/
124413   0, /*nb_true_divide*/
124414   0, /*nb_inplace_floor_divide*/
124415   0, /*nb_inplace_true_divide*/
124416   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
124417   0, /*nb_index*/
124418   #endif
124419 };
124420
124421 static PySequenceMethods __pyx_tp_as_sequence_ElementChildIterator = {
124422   0, /*sq_length*/
124423   0, /*sq_concat*/
124424   0, /*sq_repeat*/
124425   0, /*sq_item*/
124426   0, /*sq_slice*/
124427   0, /*sq_ass_item*/
124428   0, /*sq_ass_slice*/
124429   0, /*sq_contains*/
124430   0, /*sq_inplace_concat*/
124431   0, /*sq_inplace_repeat*/
124432 };
124433
124434 static PyMappingMethods __pyx_tp_as_mapping_ElementChildIterator = {
124435   0, /*mp_length*/
124436   0, /*mp_subscript*/
124437   0, /*mp_ass_subscript*/
124438 };
124439
124440 static PyBufferProcs __pyx_tp_as_buffer_ElementChildIterator = {
124441   #if PY_MAJOR_VERSION < 3
124442   0, /*bf_getreadbuffer*/
124443   #endif
124444   #if PY_MAJOR_VERSION < 3
124445   0, /*bf_getwritebuffer*/
124446   #endif
124447   #if PY_MAJOR_VERSION < 3
124448   0, /*bf_getsegcount*/
124449   #endif
124450   #if PY_MAJOR_VERSION < 3
124451   0, /*bf_getcharbuffer*/
124452   #endif
124453   #if PY_VERSION_HEX >= 0x02060000
124454   0, /*bf_getbuffer*/
124455   #endif
124456   #if PY_VERSION_HEX >= 0x02060000
124457   0, /*bf_releasebuffer*/
124458   #endif
124459 };
124460
124461 PyTypeObject __pyx_type_4lxml_5etree_ElementChildIterator = {
124462   PyVarObject_HEAD_INIT(0, 0)
124463   __Pyx_NAMESTR("lxml.etree.ElementChildIterator"), /*tp_name*/
124464   sizeof(struct __pyx_obj_4lxml_5etree_ElementChildIterator), /*tp_basicsize*/
124465   0, /*tp_itemsize*/
124466   __pyx_tp_dealloc_4lxml_5etree__ElementIterator, /*tp_dealloc*/
124467   0, /*tp_print*/
124468   0, /*tp_getattr*/
124469   0, /*tp_setattr*/
124470   0, /*tp_compare*/
124471   0, /*tp_repr*/
124472   &__pyx_tp_as_number_ElementChildIterator, /*tp_as_number*/
124473   &__pyx_tp_as_sequence_ElementChildIterator, /*tp_as_sequence*/
124474   &__pyx_tp_as_mapping_ElementChildIterator, /*tp_as_mapping*/
124475   0, /*tp_hash*/
124476   0, /*tp_call*/
124477   0, /*tp_str*/
124478   0, /*tp_getattro*/
124479   0, /*tp_setattro*/
124480   &__pyx_tp_as_buffer_ElementChildIterator, /*tp_as_buffer*/
124481   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
124482   __Pyx_DOCSTR("ElementChildIterator(self, node, tag=None, reversed=False)\n    Iterates over the children of an element.\n    "), /*tp_doc*/
124483   __pyx_tp_traverse_4lxml_5etree__ElementIterator, /*tp_traverse*/
124484   __pyx_tp_clear_4lxml_5etree__ElementIterator, /*tp_clear*/
124485   0, /*tp_richcompare*/
124486   0, /*tp_weaklistoffset*/
124487   0, /*tp_iter*/
124488   0, /*tp_iternext*/
124489   __pyx_methods_4lxml_5etree_ElementChildIterator, /*tp_methods*/
124490   0, /*tp_members*/
124491   0, /*tp_getset*/
124492   0, /*tp_base*/
124493   0, /*tp_dict*/
124494   0, /*tp_descr_get*/
124495   0, /*tp_descr_set*/
124496   0, /*tp_dictoffset*/
124497   __pyx_pf_4lxml_5etree_20ElementChildIterator___init__, /*tp_init*/
124498   0, /*tp_alloc*/
124499   __pyx_tp_new_4lxml_5etree_ElementChildIterator, /*tp_new*/
124500   0, /*tp_free*/
124501   0, /*tp_is_gc*/
124502   0, /*tp_bases*/
124503   0, /*tp_mro*/
124504   0, /*tp_cache*/
124505   0, /*tp_subclasses*/
124506   0, /*tp_weaklist*/
124507 };
124508 static struct __pyx_vtabstruct_4lxml_5etree_SiblingsIterator __pyx_vtable_4lxml_5etree_SiblingsIterator;
124509
124510 static PyObject *__pyx_tp_new_4lxml_5etree_SiblingsIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
124511   struct __pyx_obj_4lxml_5etree_SiblingsIterator *p;
124512   PyObject *o = __pyx_tp_new_4lxml_5etree__ElementIterator(t, a, k);
124513   if (!o) return 0;
124514   p = ((struct __pyx_obj_4lxml_5etree_SiblingsIterator *)o);
124515   p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__ElementTagMatcher*)__pyx_vtabptr_4lxml_5etree_SiblingsIterator;
124516   return o;
124517 }
124518
124519 static struct PyMethodDef __pyx_methods_4lxml_5etree_SiblingsIterator[] = {
124520   {0, 0, 0, 0}
124521 };
124522
124523 static PyNumberMethods __pyx_tp_as_number_SiblingsIterator = {
124524   0, /*nb_add*/
124525   0, /*nb_subtract*/
124526   0, /*nb_multiply*/
124527   #if PY_MAJOR_VERSION < 3
124528   0, /*nb_divide*/
124529   #endif
124530   0, /*nb_remainder*/
124531   0, /*nb_divmod*/
124532   0, /*nb_power*/
124533   0, /*nb_negative*/
124534   0, /*nb_positive*/
124535   0, /*nb_absolute*/
124536   0, /*nb_nonzero*/
124537   0, /*nb_invert*/
124538   0, /*nb_lshift*/
124539   0, /*nb_rshift*/
124540   0, /*nb_and*/
124541   0, /*nb_xor*/
124542   0, /*nb_or*/
124543   #if PY_MAJOR_VERSION < 3
124544   0, /*nb_coerce*/
124545   #endif
124546   0, /*nb_int*/
124547   #if PY_MAJOR_VERSION >= 3
124548   0, /*reserved*/
124549   #else
124550   0, /*nb_long*/
124551   #endif
124552   0, /*nb_float*/
124553   #if PY_MAJOR_VERSION < 3
124554   0, /*nb_oct*/
124555   #endif
124556   #if PY_MAJOR_VERSION < 3
124557   0, /*nb_hex*/
124558   #endif
124559   0, /*nb_inplace_add*/
124560   0, /*nb_inplace_subtract*/
124561   0, /*nb_inplace_multiply*/
124562   #if PY_MAJOR_VERSION < 3
124563   0, /*nb_inplace_divide*/
124564   #endif
124565   0, /*nb_inplace_remainder*/
124566   0, /*nb_inplace_power*/
124567   0, /*nb_inplace_lshift*/
124568   0, /*nb_inplace_rshift*/
124569   0, /*nb_inplace_and*/
124570   0, /*nb_inplace_xor*/
124571   0, /*nb_inplace_or*/
124572   0, /*nb_floor_divide*/
124573   0, /*nb_true_divide*/
124574   0, /*nb_inplace_floor_divide*/
124575   0, /*nb_inplace_true_divide*/
124576   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
124577   0, /*nb_index*/
124578   #endif
124579 };
124580
124581 static PySequenceMethods __pyx_tp_as_sequence_SiblingsIterator = {
124582   0, /*sq_length*/
124583   0, /*sq_concat*/
124584   0, /*sq_repeat*/
124585   0, /*sq_item*/
124586   0, /*sq_slice*/
124587   0, /*sq_ass_item*/
124588   0, /*sq_ass_slice*/
124589   0, /*sq_contains*/
124590   0, /*sq_inplace_concat*/
124591   0, /*sq_inplace_repeat*/
124592 };
124593
124594 static PyMappingMethods __pyx_tp_as_mapping_SiblingsIterator = {
124595   0, /*mp_length*/
124596   0, /*mp_subscript*/
124597   0, /*mp_ass_subscript*/
124598 };
124599
124600 static PyBufferProcs __pyx_tp_as_buffer_SiblingsIterator = {
124601   #if PY_MAJOR_VERSION < 3
124602   0, /*bf_getreadbuffer*/
124603   #endif
124604   #if PY_MAJOR_VERSION < 3
124605   0, /*bf_getwritebuffer*/
124606   #endif
124607   #if PY_MAJOR_VERSION < 3
124608   0, /*bf_getsegcount*/
124609   #endif
124610   #if PY_MAJOR_VERSION < 3
124611   0, /*bf_getcharbuffer*/
124612   #endif
124613   #if PY_VERSION_HEX >= 0x02060000
124614   0, /*bf_getbuffer*/
124615   #endif
124616   #if PY_VERSION_HEX >= 0x02060000
124617   0, /*bf_releasebuffer*/
124618   #endif
124619 };
124620
124621 PyTypeObject __pyx_type_4lxml_5etree_SiblingsIterator = {
124622   PyVarObject_HEAD_INIT(0, 0)
124623   __Pyx_NAMESTR("lxml.etree.SiblingsIterator"), /*tp_name*/
124624   sizeof(struct __pyx_obj_4lxml_5etree_SiblingsIterator), /*tp_basicsize*/
124625   0, /*tp_itemsize*/
124626   __pyx_tp_dealloc_4lxml_5etree__ElementIterator, /*tp_dealloc*/
124627   0, /*tp_print*/
124628   0, /*tp_getattr*/
124629   0, /*tp_setattr*/
124630   0, /*tp_compare*/
124631   0, /*tp_repr*/
124632   &__pyx_tp_as_number_SiblingsIterator, /*tp_as_number*/
124633   &__pyx_tp_as_sequence_SiblingsIterator, /*tp_as_sequence*/
124634   &__pyx_tp_as_mapping_SiblingsIterator, /*tp_as_mapping*/
124635   0, /*tp_hash*/
124636   0, /*tp_call*/
124637   0, /*tp_str*/
124638   0, /*tp_getattro*/
124639   0, /*tp_setattro*/
124640   &__pyx_tp_as_buffer_SiblingsIterator, /*tp_as_buffer*/
124641   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
124642   __Pyx_DOCSTR("SiblingsIterator(self, node, tag=None, preceding=False)\n    Iterates over the siblings of an element.\n\n    You can pass the boolean keyword ``preceding`` to specify the direction.\n    "), /*tp_doc*/
124643   __pyx_tp_traverse_4lxml_5etree__ElementIterator, /*tp_traverse*/
124644   __pyx_tp_clear_4lxml_5etree__ElementIterator, /*tp_clear*/
124645   0, /*tp_richcompare*/
124646   0, /*tp_weaklistoffset*/
124647   0, /*tp_iter*/
124648   0, /*tp_iternext*/
124649   __pyx_methods_4lxml_5etree_SiblingsIterator, /*tp_methods*/
124650   0, /*tp_members*/
124651   0, /*tp_getset*/
124652   0, /*tp_base*/
124653   0, /*tp_dict*/
124654   0, /*tp_descr_get*/
124655   0, /*tp_descr_set*/
124656   0, /*tp_dictoffset*/
124657   __pyx_pf_4lxml_5etree_16SiblingsIterator___init__, /*tp_init*/
124658   0, /*tp_alloc*/
124659   __pyx_tp_new_4lxml_5etree_SiblingsIterator, /*tp_new*/
124660   0, /*tp_free*/
124661   0, /*tp_is_gc*/
124662   0, /*tp_bases*/
124663   0, /*tp_mro*/
124664   0, /*tp_cache*/
124665   0, /*tp_subclasses*/
124666   0, /*tp_weaklist*/
124667 };
124668 static struct __pyx_vtabstruct_4lxml_5etree_AncestorsIterator __pyx_vtable_4lxml_5etree_AncestorsIterator;
124669
124670 static PyObject *__pyx_tp_new_4lxml_5etree_AncestorsIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
124671   struct __pyx_obj_4lxml_5etree_AncestorsIterator *p;
124672   PyObject *o = __pyx_tp_new_4lxml_5etree__ElementIterator(t, a, k);
124673   if (!o) return 0;
124674   p = ((struct __pyx_obj_4lxml_5etree_AncestorsIterator *)o);
124675   p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__ElementTagMatcher*)__pyx_vtabptr_4lxml_5etree_AncestorsIterator;
124676   return o;
124677 }
124678
124679 static struct PyMethodDef __pyx_methods_4lxml_5etree_AncestorsIterator[] = {
124680   {0, 0, 0, 0}
124681 };
124682
124683 static PyNumberMethods __pyx_tp_as_number_AncestorsIterator = {
124684   0, /*nb_add*/
124685   0, /*nb_subtract*/
124686   0, /*nb_multiply*/
124687   #if PY_MAJOR_VERSION < 3
124688   0, /*nb_divide*/
124689   #endif
124690   0, /*nb_remainder*/
124691   0, /*nb_divmod*/
124692   0, /*nb_power*/
124693   0, /*nb_negative*/
124694   0, /*nb_positive*/
124695   0, /*nb_absolute*/
124696   0, /*nb_nonzero*/
124697   0, /*nb_invert*/
124698   0, /*nb_lshift*/
124699   0, /*nb_rshift*/
124700   0, /*nb_and*/
124701   0, /*nb_xor*/
124702   0, /*nb_or*/
124703   #if PY_MAJOR_VERSION < 3
124704   0, /*nb_coerce*/
124705   #endif
124706   0, /*nb_int*/
124707   #if PY_MAJOR_VERSION >= 3
124708   0, /*reserved*/
124709   #else
124710   0, /*nb_long*/
124711   #endif
124712   0, /*nb_float*/
124713   #if PY_MAJOR_VERSION < 3
124714   0, /*nb_oct*/
124715   #endif
124716   #if PY_MAJOR_VERSION < 3
124717   0, /*nb_hex*/
124718   #endif
124719   0, /*nb_inplace_add*/
124720   0, /*nb_inplace_subtract*/
124721   0, /*nb_inplace_multiply*/
124722   #if PY_MAJOR_VERSION < 3
124723   0, /*nb_inplace_divide*/
124724   #endif
124725   0, /*nb_inplace_remainder*/
124726   0, /*nb_inplace_power*/
124727   0, /*nb_inplace_lshift*/
124728   0, /*nb_inplace_rshift*/
124729   0, /*nb_inplace_and*/
124730   0, /*nb_inplace_xor*/
124731   0, /*nb_inplace_or*/
124732   0, /*nb_floor_divide*/
124733   0, /*nb_true_divide*/
124734   0, /*nb_inplace_floor_divide*/
124735   0, /*nb_inplace_true_divide*/
124736   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
124737   0, /*nb_index*/
124738   #endif
124739 };
124740
124741 static PySequenceMethods __pyx_tp_as_sequence_AncestorsIterator = {
124742   0, /*sq_length*/
124743   0, /*sq_concat*/
124744   0, /*sq_repeat*/
124745   0, /*sq_item*/
124746   0, /*sq_slice*/
124747   0, /*sq_ass_item*/
124748   0, /*sq_ass_slice*/
124749   0, /*sq_contains*/
124750   0, /*sq_inplace_concat*/
124751   0, /*sq_inplace_repeat*/
124752 };
124753
124754 static PyMappingMethods __pyx_tp_as_mapping_AncestorsIterator = {
124755   0, /*mp_length*/
124756   0, /*mp_subscript*/
124757   0, /*mp_ass_subscript*/
124758 };
124759
124760 static PyBufferProcs __pyx_tp_as_buffer_AncestorsIterator = {
124761   #if PY_MAJOR_VERSION < 3
124762   0, /*bf_getreadbuffer*/
124763   #endif
124764   #if PY_MAJOR_VERSION < 3
124765   0, /*bf_getwritebuffer*/
124766   #endif
124767   #if PY_MAJOR_VERSION < 3
124768   0, /*bf_getsegcount*/
124769   #endif
124770   #if PY_MAJOR_VERSION < 3
124771   0, /*bf_getcharbuffer*/
124772   #endif
124773   #if PY_VERSION_HEX >= 0x02060000
124774   0, /*bf_getbuffer*/
124775   #endif
124776   #if PY_VERSION_HEX >= 0x02060000
124777   0, /*bf_releasebuffer*/
124778   #endif
124779 };
124780
124781 PyTypeObject __pyx_type_4lxml_5etree_AncestorsIterator = {
124782   PyVarObject_HEAD_INIT(0, 0)
124783   __Pyx_NAMESTR("lxml.etree.AncestorsIterator"), /*tp_name*/
124784   sizeof(struct __pyx_obj_4lxml_5etree_AncestorsIterator), /*tp_basicsize*/
124785   0, /*tp_itemsize*/
124786   __pyx_tp_dealloc_4lxml_5etree__ElementIterator, /*tp_dealloc*/
124787   0, /*tp_print*/
124788   0, /*tp_getattr*/
124789   0, /*tp_setattr*/
124790   0, /*tp_compare*/
124791   0, /*tp_repr*/
124792   &__pyx_tp_as_number_AncestorsIterator, /*tp_as_number*/
124793   &__pyx_tp_as_sequence_AncestorsIterator, /*tp_as_sequence*/
124794   &__pyx_tp_as_mapping_AncestorsIterator, /*tp_as_mapping*/
124795   0, /*tp_hash*/
124796   0, /*tp_call*/
124797   0, /*tp_str*/
124798   0, /*tp_getattro*/
124799   0, /*tp_setattro*/
124800   &__pyx_tp_as_buffer_AncestorsIterator, /*tp_as_buffer*/
124801   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
124802   __Pyx_DOCSTR("AncestorsIterator(self, node, tag=None)\n    Iterates over the ancestors of an element (from parent to parent).\n    "), /*tp_doc*/
124803   __pyx_tp_traverse_4lxml_5etree__ElementIterator, /*tp_traverse*/
124804   __pyx_tp_clear_4lxml_5etree__ElementIterator, /*tp_clear*/
124805   0, /*tp_richcompare*/
124806   0, /*tp_weaklistoffset*/
124807   0, /*tp_iter*/
124808   0, /*tp_iternext*/
124809   __pyx_methods_4lxml_5etree_AncestorsIterator, /*tp_methods*/
124810   0, /*tp_members*/
124811   0, /*tp_getset*/
124812   0, /*tp_base*/
124813   0, /*tp_dict*/
124814   0, /*tp_descr_get*/
124815   0, /*tp_descr_set*/
124816   0, /*tp_dictoffset*/
124817   __pyx_pf_4lxml_5etree_17AncestorsIterator___init__, /*tp_init*/
124818   0, /*tp_alloc*/
124819   __pyx_tp_new_4lxml_5etree_AncestorsIterator, /*tp_new*/
124820   0, /*tp_free*/
124821   0, /*tp_is_gc*/
124822   0, /*tp_bases*/
124823   0, /*tp_mro*/
124824   0, /*tp_cache*/
124825   0, /*tp_subclasses*/
124826   0, /*tp_weaklist*/
124827 };
124828 static struct __pyx_vtabstruct_4lxml_5etree_ElementDepthFirstIterator __pyx_vtable_4lxml_5etree_ElementDepthFirstIterator;
124829
124830 static PyObject *__pyx_tp_new_4lxml_5etree_ElementDepthFirstIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
124831   struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *p;
124832   PyObject *o = __pyx_tp_new_4lxml_5etree__ElementTagMatcher(t, a, k);
124833   if (!o) return 0;
124834   p = ((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)o);
124835   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__ElementTagMatcher*)__pyx_vtabptr_4lxml_5etree_ElementDepthFirstIterator;
124836   p->_next_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
124837   p->_top_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
124838   return o;
124839 }
124840
124841 static void __pyx_tp_dealloc_4lxml_5etree_ElementDepthFirstIterator(PyObject *o) {
124842   struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *p = (struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)o;
124843   Py_XDECREF(((PyObject *)p->_next_node));
124844   Py_XDECREF(((PyObject *)p->_top_node));
124845   __pyx_tp_dealloc_4lxml_5etree__ElementTagMatcher(o);
124846 }
124847
124848 static int __pyx_tp_traverse_4lxml_5etree_ElementDepthFirstIterator(PyObject *o, visitproc v, void *a) {
124849   int e;
124850   struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *p = (struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)o;
124851   e = __pyx_tp_traverse_4lxml_5etree__ElementTagMatcher(o, v, a); if (e) return e;
124852   if (p->_next_node) {
124853     e = (*v)(((PyObject*)p->_next_node), a); if (e) return e;
124854   }
124855   if (p->_top_node) {
124856     e = (*v)(((PyObject*)p->_top_node), a); if (e) return e;
124857   }
124858   return 0;
124859 }
124860
124861 static int __pyx_tp_clear_4lxml_5etree_ElementDepthFirstIterator(PyObject *o) {
124862   struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *p = (struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)o;
124863   PyObject* tmp;
124864   __pyx_tp_clear_4lxml_5etree__ElementTagMatcher(o);
124865   tmp = ((PyObject*)p->_next_node);
124866   p->_next_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
124867   Py_XDECREF(tmp);
124868   tmp = ((PyObject*)p->_top_node);
124869   p->_top_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
124870   Py_XDECREF(tmp);
124871   return 0;
124872 }
124873
124874 static struct PyMethodDef __pyx_methods_4lxml_5etree_ElementDepthFirstIterator[] = {
124875   {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
124876   {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
124877   {0, 0, 0, 0}
124878 };
124879
124880 static PyNumberMethods __pyx_tp_as_number_ElementDepthFirstIterator = {
124881   0, /*nb_add*/
124882   0, /*nb_subtract*/
124883   0, /*nb_multiply*/
124884   #if PY_MAJOR_VERSION < 3
124885   0, /*nb_divide*/
124886   #endif
124887   0, /*nb_remainder*/
124888   0, /*nb_divmod*/
124889   0, /*nb_power*/
124890   0, /*nb_negative*/
124891   0, /*nb_positive*/
124892   0, /*nb_absolute*/
124893   0, /*nb_nonzero*/
124894   0, /*nb_invert*/
124895   0, /*nb_lshift*/
124896   0, /*nb_rshift*/
124897   0, /*nb_and*/
124898   0, /*nb_xor*/
124899   0, /*nb_or*/
124900   #if PY_MAJOR_VERSION < 3
124901   0, /*nb_coerce*/
124902   #endif
124903   0, /*nb_int*/
124904   #if PY_MAJOR_VERSION >= 3
124905   0, /*reserved*/
124906   #else
124907   0, /*nb_long*/
124908   #endif
124909   0, /*nb_float*/
124910   #if PY_MAJOR_VERSION < 3
124911   0, /*nb_oct*/
124912   #endif
124913   #if PY_MAJOR_VERSION < 3
124914   0, /*nb_hex*/
124915   #endif
124916   0, /*nb_inplace_add*/
124917   0, /*nb_inplace_subtract*/
124918   0, /*nb_inplace_multiply*/
124919   #if PY_MAJOR_VERSION < 3
124920   0, /*nb_inplace_divide*/
124921   #endif
124922   0, /*nb_inplace_remainder*/
124923   0, /*nb_inplace_power*/
124924   0, /*nb_inplace_lshift*/
124925   0, /*nb_inplace_rshift*/
124926   0, /*nb_inplace_and*/
124927   0, /*nb_inplace_xor*/
124928   0, /*nb_inplace_or*/
124929   0, /*nb_floor_divide*/
124930   0, /*nb_true_divide*/
124931   0, /*nb_inplace_floor_divide*/
124932   0, /*nb_inplace_true_divide*/
124933   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
124934   0, /*nb_index*/
124935   #endif
124936 };
124937
124938 static PySequenceMethods __pyx_tp_as_sequence_ElementDepthFirstIterator = {
124939   0, /*sq_length*/
124940   0, /*sq_concat*/
124941   0, /*sq_repeat*/
124942   0, /*sq_item*/
124943   0, /*sq_slice*/
124944   0, /*sq_ass_item*/
124945   0, /*sq_ass_slice*/
124946   0, /*sq_contains*/
124947   0, /*sq_inplace_concat*/
124948   0, /*sq_inplace_repeat*/
124949 };
124950
124951 static PyMappingMethods __pyx_tp_as_mapping_ElementDepthFirstIterator = {
124952   0, /*mp_length*/
124953   0, /*mp_subscript*/
124954   0, /*mp_ass_subscript*/
124955 };
124956
124957 static PyBufferProcs __pyx_tp_as_buffer_ElementDepthFirstIterator = {
124958   #if PY_MAJOR_VERSION < 3
124959   0, /*bf_getreadbuffer*/
124960   #endif
124961   #if PY_MAJOR_VERSION < 3
124962   0, /*bf_getwritebuffer*/
124963   #endif
124964   #if PY_MAJOR_VERSION < 3
124965   0, /*bf_getsegcount*/
124966   #endif
124967   #if PY_MAJOR_VERSION < 3
124968   0, /*bf_getcharbuffer*/
124969   #endif
124970   #if PY_VERSION_HEX >= 0x02060000
124971   0, /*bf_getbuffer*/
124972   #endif
124973   #if PY_VERSION_HEX >= 0x02060000
124974   0, /*bf_releasebuffer*/
124975   #endif
124976 };
124977
124978 PyTypeObject __pyx_type_4lxml_5etree_ElementDepthFirstIterator = {
124979   PyVarObject_HEAD_INIT(0, 0)
124980   __Pyx_NAMESTR("lxml.etree.ElementDepthFirstIterator"), /*tp_name*/
124981   sizeof(struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator), /*tp_basicsize*/
124982   0, /*tp_itemsize*/
124983   __pyx_tp_dealloc_4lxml_5etree_ElementDepthFirstIterator, /*tp_dealloc*/
124984   0, /*tp_print*/
124985   0, /*tp_getattr*/
124986   0, /*tp_setattr*/
124987   0, /*tp_compare*/
124988   0, /*tp_repr*/
124989   &__pyx_tp_as_number_ElementDepthFirstIterator, /*tp_as_number*/
124990   &__pyx_tp_as_sequence_ElementDepthFirstIterator, /*tp_as_sequence*/
124991   &__pyx_tp_as_mapping_ElementDepthFirstIterator, /*tp_as_mapping*/
124992   0, /*tp_hash*/
124993   0, /*tp_call*/
124994   0, /*tp_str*/
124995   0, /*tp_getattro*/
124996   0, /*tp_setattro*/
124997   &__pyx_tp_as_buffer_ElementDepthFirstIterator, /*tp_as_buffer*/
124998   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
124999   __Pyx_DOCSTR("ElementDepthFirstIterator(self, node, tag=None, inclusive=True)\n    Iterates over an element and its sub-elements in document order (depth\n    first pre-order).\n\n    Note that this also includes comments, entities and processing\n    instructions.  To filter them out, check if the ``tag`` property\n    of the returned element is a string (i.e. not None and not a\n    factory function), or pass the ``Element`` factory for the ``tag``\n    keyword.\n\n    If the optional ``tag`` argument is not None, the iterator returns only\n    the elements that match the respective name and namespace.\n\n    The optional boolean argument 'inclusive' defaults to True and can be set\n    to False to exclude the start element itself.\n\n    Note that the behaviour of this iterator is completely undefined if the\n    tree it traverses is modified during iteration.\n    "), /*tp_doc*/
125000   __pyx_tp_traverse_4lxml_5etree_ElementDepthFirstIterator, /*tp_traverse*/
125001   __pyx_tp_clear_4lxml_5etree_ElementDepthFirstIterator, /*tp_clear*/
125002   0, /*tp_richcompare*/
125003   0, /*tp_weaklistoffset*/
125004   __pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___iter__, /*tp_iter*/
125005   __pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___next__, /*tp_iternext*/
125006   __pyx_methods_4lxml_5etree_ElementDepthFirstIterator, /*tp_methods*/
125007   0, /*tp_members*/
125008   0, /*tp_getset*/
125009   0, /*tp_base*/
125010   0, /*tp_dict*/
125011   0, /*tp_descr_get*/
125012   0, /*tp_descr_set*/
125013   0, /*tp_dictoffset*/
125014   __pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___init__, /*tp_init*/
125015   0, /*tp_alloc*/
125016   __pyx_tp_new_4lxml_5etree_ElementDepthFirstIterator, /*tp_new*/
125017   0, /*tp_free*/
125018   0, /*tp_is_gc*/
125019   0, /*tp_bases*/
125020   0, /*tp_mro*/
125021   0, /*tp_cache*/
125022   0, /*tp_subclasses*/
125023   0, /*tp_weaklist*/
125024 };
125025
125026 static PyObject *__pyx_tp_new_4lxml_5etree_ElementTextIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
125027   struct __pyx_obj_4lxml_5etree_ElementTextIterator *p;
125028   PyObject *o = (*t->tp_alloc)(t, 0);
125029   if (!o) return 0;
125030   p = ((struct __pyx_obj_4lxml_5etree_ElementTextIterator *)o);
125031   p->_nextEvent = Py_None; Py_INCREF(Py_None);
125032   p->_start_element = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
125033   return o;
125034 }
125035
125036 static void __pyx_tp_dealloc_4lxml_5etree_ElementTextIterator(PyObject *o) {
125037   struct __pyx_obj_4lxml_5etree_ElementTextIterator *p = (struct __pyx_obj_4lxml_5etree_ElementTextIterator *)o;
125038   Py_XDECREF(p->_nextEvent);
125039   Py_XDECREF(((PyObject *)p->_start_element));
125040   (*Py_TYPE(o)->tp_free)(o);
125041 }
125042
125043 static int __pyx_tp_traverse_4lxml_5etree_ElementTextIterator(PyObject *o, visitproc v, void *a) {
125044   int e;
125045   struct __pyx_obj_4lxml_5etree_ElementTextIterator *p = (struct __pyx_obj_4lxml_5etree_ElementTextIterator *)o;
125046   if (p->_nextEvent) {
125047     e = (*v)(p->_nextEvent, a); if (e) return e;
125048   }
125049   if (p->_start_element) {
125050     e = (*v)(((PyObject*)p->_start_element), a); if (e) return e;
125051   }
125052   return 0;
125053 }
125054
125055 static int __pyx_tp_clear_4lxml_5etree_ElementTextIterator(PyObject *o) {
125056   struct __pyx_obj_4lxml_5etree_ElementTextIterator *p = (struct __pyx_obj_4lxml_5etree_ElementTextIterator *)o;
125057   PyObject* tmp;
125058   tmp = ((PyObject*)p->_nextEvent);
125059   p->_nextEvent = Py_None; Py_INCREF(Py_None);
125060   Py_XDECREF(tmp);
125061   tmp = ((PyObject*)p->_start_element);
125062   p->_start_element = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
125063   Py_XDECREF(tmp);
125064   return 0;
125065 }
125066
125067 static struct PyMethodDef __pyx_methods_4lxml_5etree_ElementTextIterator[] = {
125068   {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_4lxml_5etree_19ElementTextIterator___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
125069   {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_4lxml_5etree_19ElementTextIterator___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
125070   {0, 0, 0, 0}
125071 };
125072
125073 static PyNumberMethods __pyx_tp_as_number_ElementTextIterator = {
125074   0, /*nb_add*/
125075   0, /*nb_subtract*/
125076   0, /*nb_multiply*/
125077   #if PY_MAJOR_VERSION < 3
125078   0, /*nb_divide*/
125079   #endif
125080   0, /*nb_remainder*/
125081   0, /*nb_divmod*/
125082   0, /*nb_power*/
125083   0, /*nb_negative*/
125084   0, /*nb_positive*/
125085   0, /*nb_absolute*/
125086   0, /*nb_nonzero*/
125087   0, /*nb_invert*/
125088   0, /*nb_lshift*/
125089   0, /*nb_rshift*/
125090   0, /*nb_and*/
125091   0, /*nb_xor*/
125092   0, /*nb_or*/
125093   #if PY_MAJOR_VERSION < 3
125094   0, /*nb_coerce*/
125095   #endif
125096   0, /*nb_int*/
125097   #if PY_MAJOR_VERSION >= 3
125098   0, /*reserved*/
125099   #else
125100   0, /*nb_long*/
125101   #endif
125102   0, /*nb_float*/
125103   #if PY_MAJOR_VERSION < 3
125104   0, /*nb_oct*/
125105   #endif
125106   #if PY_MAJOR_VERSION < 3
125107   0, /*nb_hex*/
125108   #endif
125109   0, /*nb_inplace_add*/
125110   0, /*nb_inplace_subtract*/
125111   0, /*nb_inplace_multiply*/
125112   #if PY_MAJOR_VERSION < 3
125113   0, /*nb_inplace_divide*/
125114   #endif
125115   0, /*nb_inplace_remainder*/
125116   0, /*nb_inplace_power*/
125117   0, /*nb_inplace_lshift*/
125118   0, /*nb_inplace_rshift*/
125119   0, /*nb_inplace_and*/
125120   0, /*nb_inplace_xor*/
125121   0, /*nb_inplace_or*/
125122   0, /*nb_floor_divide*/
125123   0, /*nb_true_divide*/
125124   0, /*nb_inplace_floor_divide*/
125125   0, /*nb_inplace_true_divide*/
125126   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
125127   0, /*nb_index*/
125128   #endif
125129 };
125130
125131 static PySequenceMethods __pyx_tp_as_sequence_ElementTextIterator = {
125132   0, /*sq_length*/
125133   0, /*sq_concat*/
125134   0, /*sq_repeat*/
125135   0, /*sq_item*/
125136   0, /*sq_slice*/
125137   0, /*sq_ass_item*/
125138   0, /*sq_ass_slice*/
125139   0, /*sq_contains*/
125140   0, /*sq_inplace_concat*/
125141   0, /*sq_inplace_repeat*/
125142 };
125143
125144 static PyMappingMethods __pyx_tp_as_mapping_ElementTextIterator = {
125145   0, /*mp_length*/
125146   0, /*mp_subscript*/
125147   0, /*mp_ass_subscript*/
125148 };
125149
125150 static PyBufferProcs __pyx_tp_as_buffer_ElementTextIterator = {
125151   #if PY_MAJOR_VERSION < 3
125152   0, /*bf_getreadbuffer*/
125153   #endif
125154   #if PY_MAJOR_VERSION < 3
125155   0, /*bf_getwritebuffer*/
125156   #endif
125157   #if PY_MAJOR_VERSION < 3
125158   0, /*bf_getsegcount*/
125159   #endif
125160   #if PY_MAJOR_VERSION < 3
125161   0, /*bf_getcharbuffer*/
125162   #endif
125163   #if PY_VERSION_HEX >= 0x02060000
125164   0, /*bf_getbuffer*/
125165   #endif
125166   #if PY_VERSION_HEX >= 0x02060000
125167   0, /*bf_releasebuffer*/
125168   #endif
125169 };
125170
125171 PyTypeObject __pyx_type_4lxml_5etree_ElementTextIterator = {
125172   PyVarObject_HEAD_INIT(0, 0)
125173   __Pyx_NAMESTR("lxml.etree.ElementTextIterator"), /*tp_name*/
125174   sizeof(struct __pyx_obj_4lxml_5etree_ElementTextIterator), /*tp_basicsize*/
125175   0, /*tp_itemsize*/
125176   __pyx_tp_dealloc_4lxml_5etree_ElementTextIterator, /*tp_dealloc*/
125177   0, /*tp_print*/
125178   0, /*tp_getattr*/
125179   0, /*tp_setattr*/
125180   0, /*tp_compare*/
125181   0, /*tp_repr*/
125182   &__pyx_tp_as_number_ElementTextIterator, /*tp_as_number*/
125183   &__pyx_tp_as_sequence_ElementTextIterator, /*tp_as_sequence*/
125184   &__pyx_tp_as_mapping_ElementTextIterator, /*tp_as_mapping*/
125185   0, /*tp_hash*/
125186   0, /*tp_call*/
125187   0, /*tp_str*/
125188   0, /*tp_getattro*/
125189   0, /*tp_setattro*/
125190   &__pyx_tp_as_buffer_ElementTextIterator, /*tp_as_buffer*/
125191   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
125192   __Pyx_DOCSTR("ElementTextIterator(self, element, tag=None, with_tail=True)\n    Iterates over the text content of a subtree.\n\n    You can pass the ``tag`` keyword argument to restrict text content to a\n    specific tag name.\n\n    You can set the ``with_tail`` keyword argument to ``False`` to skip over\n    tail text.\n    "), /*tp_doc*/
125193   __pyx_tp_traverse_4lxml_5etree_ElementTextIterator, /*tp_traverse*/
125194   __pyx_tp_clear_4lxml_5etree_ElementTextIterator, /*tp_clear*/
125195   0, /*tp_richcompare*/
125196   0, /*tp_weaklistoffset*/
125197   __pyx_pf_4lxml_5etree_19ElementTextIterator___iter__, /*tp_iter*/
125198   __pyx_pf_4lxml_5etree_19ElementTextIterator___next__, /*tp_iternext*/
125199   __pyx_methods_4lxml_5etree_ElementTextIterator, /*tp_methods*/
125200   0, /*tp_members*/
125201   0, /*tp_getset*/
125202   0, /*tp_base*/
125203   0, /*tp_dict*/
125204   0, /*tp_descr_get*/
125205   0, /*tp_descr_set*/
125206   0, /*tp_dictoffset*/
125207   __pyx_pf_4lxml_5etree_19ElementTextIterator___init__, /*tp_init*/
125208   0, /*tp_alloc*/
125209   __pyx_tp_new_4lxml_5etree_ElementTextIterator, /*tp_new*/
125210   0, /*tp_free*/
125211   0, /*tp_is_gc*/
125212   0, /*tp_bases*/
125213   0, /*tp_mro*/
125214   0, /*tp_cache*/
125215   0, /*tp_subclasses*/
125216   0, /*tp_weaklist*/
125217 };
125218
125219 static PyObject *__pyx_tp_new_4lxml_5etree_CDATA(PyTypeObject *t, PyObject *a, PyObject *k) {
125220   struct __pyx_obj_4lxml_5etree_CDATA *p;
125221   PyObject *o = (*t->tp_alloc)(t, 0);
125222   if (!o) return 0;
125223   p = ((struct __pyx_obj_4lxml_5etree_CDATA *)o);
125224   p->_utf8_data = Py_None; Py_INCREF(Py_None);
125225   return o;
125226 }
125227
125228 static void __pyx_tp_dealloc_4lxml_5etree_CDATA(PyObject *o) {
125229   struct __pyx_obj_4lxml_5etree_CDATA *p = (struct __pyx_obj_4lxml_5etree_CDATA *)o;
125230   Py_XDECREF(p->_utf8_data);
125231   (*Py_TYPE(o)->tp_free)(o);
125232 }
125233
125234 static int __pyx_tp_traverse_4lxml_5etree_CDATA(PyObject *o, visitproc v, void *a) {
125235   int e;
125236   struct __pyx_obj_4lxml_5etree_CDATA *p = (struct __pyx_obj_4lxml_5etree_CDATA *)o;
125237   if (p->_utf8_data) {
125238     e = (*v)(p->_utf8_data, a); if (e) return e;
125239   }
125240   return 0;
125241 }
125242
125243 static int __pyx_tp_clear_4lxml_5etree_CDATA(PyObject *o) {
125244   struct __pyx_obj_4lxml_5etree_CDATA *p = (struct __pyx_obj_4lxml_5etree_CDATA *)o;
125245   PyObject* tmp;
125246   tmp = ((PyObject*)p->_utf8_data);
125247   p->_utf8_data = Py_None; Py_INCREF(Py_None);
125248   Py_XDECREF(tmp);
125249   return 0;
125250 }
125251
125252 static struct PyMethodDef __pyx_methods_4lxml_5etree_CDATA[] = {
125253   {0, 0, 0, 0}
125254 };
125255
125256 static PyNumberMethods __pyx_tp_as_number_CDATA = {
125257   0, /*nb_add*/
125258   0, /*nb_subtract*/
125259   0, /*nb_multiply*/
125260   #if PY_MAJOR_VERSION < 3
125261   0, /*nb_divide*/
125262   #endif
125263   0, /*nb_remainder*/
125264   0, /*nb_divmod*/
125265   0, /*nb_power*/
125266   0, /*nb_negative*/
125267   0, /*nb_positive*/
125268   0, /*nb_absolute*/
125269   0, /*nb_nonzero*/
125270   0, /*nb_invert*/
125271   0, /*nb_lshift*/
125272   0, /*nb_rshift*/
125273   0, /*nb_and*/
125274   0, /*nb_xor*/
125275   0, /*nb_or*/
125276   #if PY_MAJOR_VERSION < 3
125277   0, /*nb_coerce*/
125278   #endif
125279   0, /*nb_int*/
125280   #if PY_MAJOR_VERSION >= 3
125281   0, /*reserved*/
125282   #else
125283   0, /*nb_long*/
125284   #endif
125285   0, /*nb_float*/
125286   #if PY_MAJOR_VERSION < 3
125287   0, /*nb_oct*/
125288   #endif
125289   #if PY_MAJOR_VERSION < 3
125290   0, /*nb_hex*/
125291   #endif
125292   0, /*nb_inplace_add*/
125293   0, /*nb_inplace_subtract*/
125294   0, /*nb_inplace_multiply*/
125295   #if PY_MAJOR_VERSION < 3
125296   0, /*nb_inplace_divide*/
125297   #endif
125298   0, /*nb_inplace_remainder*/
125299   0, /*nb_inplace_power*/
125300   0, /*nb_inplace_lshift*/
125301   0, /*nb_inplace_rshift*/
125302   0, /*nb_inplace_and*/
125303   0, /*nb_inplace_xor*/
125304   0, /*nb_inplace_or*/
125305   0, /*nb_floor_divide*/
125306   0, /*nb_true_divide*/
125307   0, /*nb_inplace_floor_divide*/
125308   0, /*nb_inplace_true_divide*/
125309   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
125310   0, /*nb_index*/
125311   #endif
125312 };
125313
125314 static PySequenceMethods __pyx_tp_as_sequence_CDATA = {
125315   0, /*sq_length*/
125316   0, /*sq_concat*/
125317   0, /*sq_repeat*/
125318   0, /*sq_item*/
125319   0, /*sq_slice*/
125320   0, /*sq_ass_item*/
125321   0, /*sq_ass_slice*/
125322   0, /*sq_contains*/
125323   0, /*sq_inplace_concat*/
125324   0, /*sq_inplace_repeat*/
125325 };
125326
125327 static PyMappingMethods __pyx_tp_as_mapping_CDATA = {
125328   0, /*mp_length*/
125329   0, /*mp_subscript*/
125330   0, /*mp_ass_subscript*/
125331 };
125332
125333 static PyBufferProcs __pyx_tp_as_buffer_CDATA = {
125334   #if PY_MAJOR_VERSION < 3
125335   0, /*bf_getreadbuffer*/
125336   #endif
125337   #if PY_MAJOR_VERSION < 3
125338   0, /*bf_getwritebuffer*/
125339   #endif
125340   #if PY_MAJOR_VERSION < 3
125341   0, /*bf_getsegcount*/
125342   #endif
125343   #if PY_MAJOR_VERSION < 3
125344   0, /*bf_getcharbuffer*/
125345   #endif
125346   #if PY_VERSION_HEX >= 0x02060000
125347   0, /*bf_getbuffer*/
125348   #endif
125349   #if PY_VERSION_HEX >= 0x02060000
125350   0, /*bf_releasebuffer*/
125351   #endif
125352 };
125353
125354 PyTypeObject __pyx_type_4lxml_5etree_CDATA = {
125355   PyVarObject_HEAD_INIT(0, 0)
125356   __Pyx_NAMESTR("lxml.etree.CDATA"), /*tp_name*/
125357   sizeof(struct __pyx_obj_4lxml_5etree_CDATA), /*tp_basicsize*/
125358   0, /*tp_itemsize*/
125359   __pyx_tp_dealloc_4lxml_5etree_CDATA, /*tp_dealloc*/
125360   0, /*tp_print*/
125361   0, /*tp_getattr*/
125362   0, /*tp_setattr*/
125363   0, /*tp_compare*/
125364   0, /*tp_repr*/
125365   &__pyx_tp_as_number_CDATA, /*tp_as_number*/
125366   &__pyx_tp_as_sequence_CDATA, /*tp_as_sequence*/
125367   &__pyx_tp_as_mapping_CDATA, /*tp_as_mapping*/
125368   0, /*tp_hash*/
125369   0, /*tp_call*/
125370   0, /*tp_str*/
125371   0, /*tp_getattro*/
125372   0, /*tp_setattro*/
125373   &__pyx_tp_as_buffer_CDATA, /*tp_as_buffer*/
125374   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
125375   __Pyx_DOCSTR("CDATA(data)\n\n    CDATA factory.  This factory creates an opaque data object that\n    can be used to set Element text.  The usual way to use it is::\n\n        >>> from lxml import etree\n        >>> el = etree.Element('content')\n        >>> el.text = etree.CDATA('a string')\n    "), /*tp_doc*/
125376   __pyx_tp_traverse_4lxml_5etree_CDATA, /*tp_traverse*/
125377   __pyx_tp_clear_4lxml_5etree_CDATA, /*tp_clear*/
125378   0, /*tp_richcompare*/
125379   0, /*tp_weaklistoffset*/
125380   0, /*tp_iter*/
125381   0, /*tp_iternext*/
125382   __pyx_methods_4lxml_5etree_CDATA, /*tp_methods*/
125383   0, /*tp_members*/
125384   0, /*tp_getset*/
125385   0, /*tp_base*/
125386   0, /*tp_dict*/
125387   0, /*tp_descr_get*/
125388   0, /*tp_descr_set*/
125389   0, /*tp_dictoffset*/
125390   __pyx_pf_4lxml_5etree_5CDATA___init__, /*tp_init*/
125391   0, /*tp_alloc*/
125392   __pyx_tp_new_4lxml_5etree_CDATA, /*tp_new*/
125393   0, /*tp_free*/
125394   0, /*tp_is_gc*/
125395   0, /*tp_bases*/
125396   0, /*tp_mro*/
125397   0, /*tp_cache*/
125398   0, /*tp_subclasses*/
125399   0, /*tp_weaklist*/
125400 };
125401 static struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy __pyx_vtable_4lxml_5etree__ReadOnlyElementProxy;
125402
125403 static PyObject *__pyx_tp_new_4lxml_5etree__ReadOnlyElementProxy(PyTypeObject *t, PyObject *a, PyObject *k) {
125404   struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *p;
125405   PyObject *o = (*t->tp_alloc)(t, 0);
125406   if (!o) return 0;
125407   p = ((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)o);
125408   p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__ReadOnlyElementProxy;
125409   p->_source_proxy = Py_None; Py_INCREF(Py_None);
125410   p->_dependent_proxies = ((PyObject *)Py_None); Py_INCREF(Py_None);
125411   return o;
125412 }
125413
125414 static void __pyx_tp_dealloc_4lxml_5etree__ReadOnlyElementProxy(PyObject *o) {
125415   struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *p = (struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)o;
125416   Py_XDECREF(p->_source_proxy);
125417   Py_XDECREF(((PyObject *)p->_dependent_proxies));
125418   (*Py_TYPE(o)->tp_free)(o);
125419 }
125420
125421 static int __pyx_tp_traverse_4lxml_5etree__ReadOnlyElementProxy(PyObject *o, visitproc v, void *a) {
125422   int e;
125423   struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *p = (struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)o;
125424   if (p->_source_proxy) {
125425     e = (*v)(p->_source_proxy, a); if (e) return e;
125426   }
125427   if (p->_dependent_proxies) {
125428     e = (*v)(p->_dependent_proxies, a); if (e) return e;
125429   }
125430   return 0;
125431 }
125432
125433 static int __pyx_tp_clear_4lxml_5etree__ReadOnlyElementProxy(PyObject *o) {
125434   struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *p = (struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)o;
125435   PyObject* tmp;
125436   tmp = ((PyObject*)p->_source_proxy);
125437   p->_source_proxy = Py_None; Py_INCREF(Py_None);
125438   Py_XDECREF(tmp);
125439   tmp = ((PyObject*)p->_dependent_proxies);
125440   p->_dependent_proxies = ((PyObject *)Py_None); Py_INCREF(Py_None);
125441   Py_XDECREF(tmp);
125442   return 0;
125443 }
125444 static PyObject *__pyx_sq_item_4lxml_5etree__ReadOnlyElementProxy(PyObject *o, Py_ssize_t i) {
125445   PyObject *r;
125446   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
125447   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
125448   Py_DECREF(x);
125449   return r;
125450 }
125451
125452 static PyObject *__pyx_getprop_4lxml_5etree_21_ReadOnlyElementProxy_tag(PyObject *o, void *x) {
125453   return __pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_3tag___get__(o);
125454 }
125455
125456 static PyObject *__pyx_getprop_4lxml_5etree_21_ReadOnlyElementProxy_text(PyObject *o, void *x) {
125457   return __pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_4text___get__(o);
125458 }
125459
125460 static PyObject *__pyx_getprop_4lxml_5etree_21_ReadOnlyElementProxy_tail(PyObject *o, void *x) {
125461   return __pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_4tail___get__(o);
125462 }
125463
125464 static PyObject *__pyx_getprop_4lxml_5etree_21_ReadOnlyElementProxy_attrib(PyObject *o, void *x) {
125465   return __pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_6attrib___get__(o);
125466 }
125467
125468 static PyObject *__pyx_getprop_4lxml_5etree_21_ReadOnlyElementProxy_prefix(PyObject *o, void *x) {
125469   return __pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_6prefix___get__(o);
125470 }
125471
125472 static PyObject *__pyx_getprop_4lxml_5etree_21_ReadOnlyElementProxy_sourceline(PyObject *o, void *x) {
125473   return __pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_10sourceline___get__(o);
125474 }
125475
125476 static struct PyMethodDef __pyx_methods_4lxml_5etree__ReadOnlyElementProxy[] = {
125477   {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
125478   {__Pyx_NAMESTR("__getitem__"), (PyCFunction)__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy___getitem__, METH_O|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_21_ReadOnlyElementProxy___getitem__)},
125479   {__Pyx_NAMESTR("__deepcopy__"), (PyCFunction)__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy___deepcopy__, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_21_ReadOnlyElementProxy___deepcopy__)},
125480   {__Pyx_NAMESTR("__copy__"), (PyCFunction)__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy___copy__, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_21_ReadOnlyElementProxy___copy__)},
125481   {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
125482   {__Pyx_NAMESTR("iterchildren"), (PyCFunction)__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_iterchildren, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_21_ReadOnlyElementProxy_iterchildren)},
125483   {__Pyx_NAMESTR("get"), (PyCFunction)__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_get, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_21_ReadOnlyElementProxy_get)},
125484   {__Pyx_NAMESTR("keys"), (PyCFunction)__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_keys, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_21_ReadOnlyElementProxy_keys)},
125485   {__Pyx_NAMESTR("values"), (PyCFunction)__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_values, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_21_ReadOnlyElementProxy_values)},
125486   {__Pyx_NAMESTR("items"), (PyCFunction)__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_items, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_21_ReadOnlyElementProxy_items)},
125487   {__Pyx_NAMESTR("getchildren"), (PyCFunction)__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_getchildren, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_21_ReadOnlyElementProxy_getchildren)},
125488   {__Pyx_NAMESTR("getparent"), (PyCFunction)__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_getparent, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_21_ReadOnlyElementProxy_getparent)},
125489   {__Pyx_NAMESTR("getnext"), (PyCFunction)__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_getnext, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_21_ReadOnlyElementProxy_getnext)},
125490   {__Pyx_NAMESTR("getprevious"), (PyCFunction)__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_getprevious, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_21_ReadOnlyElementProxy_getprevious)},
125491   {0, 0, 0, 0}
125492 };
125493
125494 static struct PyGetSetDef __pyx_getsets_4lxml_5etree__ReadOnlyElementProxy[] = {
125495   {(char *)"tag", __pyx_getprop_4lxml_5etree_21_ReadOnlyElementProxy_tag, 0, __pyx_k_12, 0},
125496   {(char *)"text", __pyx_getprop_4lxml_5etree_21_ReadOnlyElementProxy_text, 0, __pyx_k_14, 0},
125497   {(char *)"tail", __pyx_getprop_4lxml_5etree_21_ReadOnlyElementProxy_tail, 0, __pyx_k_15, 0},
125498   {(char *)"attrib", __pyx_getprop_4lxml_5etree_21_ReadOnlyElementProxy_attrib, 0, 0, 0},
125499   {(char *)"prefix", __pyx_getprop_4lxml_5etree_21_ReadOnlyElementProxy_prefix, 0, __pyx_k_16, 0},
125500   {(char *)"sourceline", __pyx_getprop_4lxml_5etree_21_ReadOnlyElementProxy_sourceline, 0, __pyx_k_17, 0},
125501   {0, 0, 0, 0, 0}
125502 };
125503
125504 static PyNumberMethods __pyx_tp_as_number__ReadOnlyElementProxy = {
125505   0, /*nb_add*/
125506   0, /*nb_subtract*/
125507   0, /*nb_multiply*/
125508   #if PY_MAJOR_VERSION < 3
125509   0, /*nb_divide*/
125510   #endif
125511   0, /*nb_remainder*/
125512   0, /*nb_divmod*/
125513   0, /*nb_power*/
125514   0, /*nb_negative*/
125515   0, /*nb_positive*/
125516   0, /*nb_absolute*/
125517   __pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy___nonzero__, /*nb_nonzero*/
125518   0, /*nb_invert*/
125519   0, /*nb_lshift*/
125520   0, /*nb_rshift*/
125521   0, /*nb_and*/
125522   0, /*nb_xor*/
125523   0, /*nb_or*/
125524   #if PY_MAJOR_VERSION < 3
125525   0, /*nb_coerce*/
125526   #endif
125527   0, /*nb_int*/
125528   #if PY_MAJOR_VERSION >= 3
125529   0, /*reserved*/
125530   #else
125531   0, /*nb_long*/
125532   #endif
125533   0, /*nb_float*/
125534   #if PY_MAJOR_VERSION < 3
125535   0, /*nb_oct*/
125536   #endif
125537   #if PY_MAJOR_VERSION < 3
125538   0, /*nb_hex*/
125539   #endif
125540   0, /*nb_inplace_add*/
125541   0, /*nb_inplace_subtract*/
125542   0, /*nb_inplace_multiply*/
125543   #if PY_MAJOR_VERSION < 3
125544   0, /*nb_inplace_divide*/
125545   #endif
125546   0, /*nb_inplace_remainder*/
125547   0, /*nb_inplace_power*/
125548   0, /*nb_inplace_lshift*/
125549   0, /*nb_inplace_rshift*/
125550   0, /*nb_inplace_and*/
125551   0, /*nb_inplace_xor*/
125552   0, /*nb_inplace_or*/
125553   0, /*nb_floor_divide*/
125554   0, /*nb_true_divide*/
125555   0, /*nb_inplace_floor_divide*/
125556   0, /*nb_inplace_true_divide*/
125557   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
125558   0, /*nb_index*/
125559   #endif
125560 };
125561
125562 static PySequenceMethods __pyx_tp_as_sequence__ReadOnlyElementProxy = {
125563   __pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy___len__, /*sq_length*/
125564   0, /*sq_concat*/
125565   0, /*sq_repeat*/
125566   __pyx_sq_item_4lxml_5etree__ReadOnlyElementProxy, /*sq_item*/
125567   0, /*sq_slice*/
125568   0, /*sq_ass_item*/
125569   0, /*sq_ass_slice*/
125570   0, /*sq_contains*/
125571   0, /*sq_inplace_concat*/
125572   0, /*sq_inplace_repeat*/
125573 };
125574
125575 static PyMappingMethods __pyx_tp_as_mapping__ReadOnlyElementProxy = {
125576   __pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy___len__, /*mp_length*/
125577   __pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy___getitem__, /*mp_subscript*/
125578   0, /*mp_ass_subscript*/
125579 };
125580
125581 static PyBufferProcs __pyx_tp_as_buffer__ReadOnlyElementProxy = {
125582   #if PY_MAJOR_VERSION < 3
125583   0, /*bf_getreadbuffer*/
125584   #endif
125585   #if PY_MAJOR_VERSION < 3
125586   0, /*bf_getwritebuffer*/
125587   #endif
125588   #if PY_MAJOR_VERSION < 3
125589   0, /*bf_getsegcount*/
125590   #endif
125591   #if PY_MAJOR_VERSION < 3
125592   0, /*bf_getcharbuffer*/
125593   #endif
125594   #if PY_VERSION_HEX >= 0x02060000
125595   0, /*bf_getbuffer*/
125596   #endif
125597   #if PY_VERSION_HEX >= 0x02060000
125598   0, /*bf_releasebuffer*/
125599   #endif
125600 };
125601
125602 PyTypeObject __pyx_type_4lxml_5etree__ReadOnlyElementProxy = {
125603   PyVarObject_HEAD_INIT(0, 0)
125604   __Pyx_NAMESTR("lxml.etree._ReadOnlyElementProxy"), /*tp_name*/
125605   sizeof(struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy), /*tp_basicsize*/
125606   0, /*tp_itemsize*/
125607   __pyx_tp_dealloc_4lxml_5etree__ReadOnlyElementProxy, /*tp_dealloc*/
125608   0, /*tp_print*/
125609   0, /*tp_getattr*/
125610   0, /*tp_setattr*/
125611   0, /*tp_compare*/
125612   __pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy___repr__, /*tp_repr*/
125613   &__pyx_tp_as_number__ReadOnlyElementProxy, /*tp_as_number*/
125614   &__pyx_tp_as_sequence__ReadOnlyElementProxy, /*tp_as_sequence*/
125615   &__pyx_tp_as_mapping__ReadOnlyElementProxy, /*tp_as_mapping*/
125616   0, /*tp_hash*/
125617   0, /*tp_call*/
125618   0, /*tp_str*/
125619   0, /*tp_getattro*/
125620   0, /*tp_setattro*/
125621   &__pyx_tp_as_buffer__ReadOnlyElementProxy, /*tp_as_buffer*/
125622   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
125623   __Pyx_DOCSTR("The main read-only Element proxy class (for internal use only!)."), /*tp_doc*/
125624   __pyx_tp_traverse_4lxml_5etree__ReadOnlyElementProxy, /*tp_traverse*/
125625   __pyx_tp_clear_4lxml_5etree__ReadOnlyElementProxy, /*tp_clear*/
125626   0, /*tp_richcompare*/
125627   0, /*tp_weaklistoffset*/
125628   __pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy___iter__, /*tp_iter*/
125629   0, /*tp_iternext*/
125630   __pyx_methods_4lxml_5etree__ReadOnlyElementProxy, /*tp_methods*/
125631   0, /*tp_members*/
125632   __pyx_getsets_4lxml_5etree__ReadOnlyElementProxy, /*tp_getset*/
125633   0, /*tp_base*/
125634   0, /*tp_dict*/
125635   0, /*tp_descr_get*/
125636   0, /*tp_descr_set*/
125637   0, /*tp_dictoffset*/
125638   0, /*tp_init*/
125639   0, /*tp_alloc*/
125640   __pyx_tp_new_4lxml_5etree__ReadOnlyElementProxy, /*tp_new*/
125641   0, /*tp_free*/
125642   0, /*tp_is_gc*/
125643   0, /*tp_bases*/
125644   0, /*tp_mro*/
125645   0, /*tp_cache*/
125646   0, /*tp_subclasses*/
125647   0, /*tp_weaklist*/
125648 };
125649 static struct __pyx_vtabstruct_4lxml_5etree__AppendOnlyElementProxy __pyx_vtable_4lxml_5etree__AppendOnlyElementProxy;
125650
125651 static PyObject *__pyx_tp_new_4lxml_5etree__AppendOnlyElementProxy(PyTypeObject *t, PyObject *a, PyObject *k) {
125652   struct __pyx_obj_4lxml_5etree__AppendOnlyElementProxy *p;
125653   PyObject *o = __pyx_tp_new_4lxml_5etree__ReadOnlyElementProxy(t, a, k);
125654   if (!o) return 0;
125655   p = ((struct __pyx_obj_4lxml_5etree__AppendOnlyElementProxy *)o);
125656   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy*)__pyx_vtabptr_4lxml_5etree__AppendOnlyElementProxy;
125657   return o;
125658 }
125659
125660 static PyObject *__pyx_getprop_4lxml_5etree_23_AppendOnlyElementProxy_text(PyObject *o, void *x) {
125661   return __pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_4text___get__(o);
125662 }
125663
125664 static int __pyx_setprop_4lxml_5etree_23_AppendOnlyElementProxy_text(PyObject *o, PyObject *v, void *x) {
125665   if (v) {
125666     return __pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_4text___set__(o, v);
125667   }
125668   else {
125669     PyErr_SetString(PyExc_NotImplementedError, "__del__");
125670     return -1;
125671   }
125672 }
125673
125674 static struct PyMethodDef __pyx_methods_4lxml_5etree__AppendOnlyElementProxy[] = {
125675   {__Pyx_NAMESTR("append"), (PyCFunction)__pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_append, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_23_AppendOnlyElementProxy_append)},
125676   {__Pyx_NAMESTR("extend"), (PyCFunction)__pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_extend, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_23_AppendOnlyElementProxy_extend)},
125677   {0, 0, 0, 0}
125678 };
125679
125680 static struct PyGetSetDef __pyx_getsets_4lxml_5etree__AppendOnlyElementProxy[] = {
125681   {(char *)"text", __pyx_getprop_4lxml_5etree_23_AppendOnlyElementProxy_text, __pyx_setprop_4lxml_5etree_23_AppendOnlyElementProxy_text, __pyx_k_23, 0},
125682   {0, 0, 0, 0, 0}
125683 };
125684
125685 static PyNumberMethods __pyx_tp_as_number__AppendOnlyElementProxy = {
125686   0, /*nb_add*/
125687   0, /*nb_subtract*/
125688   0, /*nb_multiply*/
125689   #if PY_MAJOR_VERSION < 3
125690   0, /*nb_divide*/
125691   #endif
125692   0, /*nb_remainder*/
125693   0, /*nb_divmod*/
125694   0, /*nb_power*/
125695   0, /*nb_negative*/
125696   0, /*nb_positive*/
125697   0, /*nb_absolute*/
125698   0, /*nb_nonzero*/
125699   0, /*nb_invert*/
125700   0, /*nb_lshift*/
125701   0, /*nb_rshift*/
125702   0, /*nb_and*/
125703   0, /*nb_xor*/
125704   0, /*nb_or*/
125705   #if PY_MAJOR_VERSION < 3
125706   0, /*nb_coerce*/
125707   #endif
125708   0, /*nb_int*/
125709   #if PY_MAJOR_VERSION >= 3
125710   0, /*reserved*/
125711   #else
125712   0, /*nb_long*/
125713   #endif
125714   0, /*nb_float*/
125715   #if PY_MAJOR_VERSION < 3
125716   0, /*nb_oct*/
125717   #endif
125718   #if PY_MAJOR_VERSION < 3
125719   0, /*nb_hex*/
125720   #endif
125721   0, /*nb_inplace_add*/
125722   0, /*nb_inplace_subtract*/
125723   0, /*nb_inplace_multiply*/
125724   #if PY_MAJOR_VERSION < 3
125725   0, /*nb_inplace_divide*/
125726   #endif
125727   0, /*nb_inplace_remainder*/
125728   0, /*nb_inplace_power*/
125729   0, /*nb_inplace_lshift*/
125730   0, /*nb_inplace_rshift*/
125731   0, /*nb_inplace_and*/
125732   0, /*nb_inplace_xor*/
125733   0, /*nb_inplace_or*/
125734   0, /*nb_floor_divide*/
125735   0, /*nb_true_divide*/
125736   0, /*nb_inplace_floor_divide*/
125737   0, /*nb_inplace_true_divide*/
125738   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
125739   0, /*nb_index*/
125740   #endif
125741 };
125742
125743 static PySequenceMethods __pyx_tp_as_sequence__AppendOnlyElementProxy = {
125744   0, /*sq_length*/
125745   0, /*sq_concat*/
125746   0, /*sq_repeat*/
125747   0, /*sq_item*/
125748   0, /*sq_slice*/
125749   0, /*sq_ass_item*/
125750   0, /*sq_ass_slice*/
125751   0, /*sq_contains*/
125752   0, /*sq_inplace_concat*/
125753   0, /*sq_inplace_repeat*/
125754 };
125755
125756 static PyMappingMethods __pyx_tp_as_mapping__AppendOnlyElementProxy = {
125757   0, /*mp_length*/
125758   0, /*mp_subscript*/
125759   0, /*mp_ass_subscript*/
125760 };
125761
125762 static PyBufferProcs __pyx_tp_as_buffer__AppendOnlyElementProxy = {
125763   #if PY_MAJOR_VERSION < 3
125764   0, /*bf_getreadbuffer*/
125765   #endif
125766   #if PY_MAJOR_VERSION < 3
125767   0, /*bf_getwritebuffer*/
125768   #endif
125769   #if PY_MAJOR_VERSION < 3
125770   0, /*bf_getsegcount*/
125771   #endif
125772   #if PY_MAJOR_VERSION < 3
125773   0, /*bf_getcharbuffer*/
125774   #endif
125775   #if PY_VERSION_HEX >= 0x02060000
125776   0, /*bf_getbuffer*/
125777   #endif
125778   #if PY_VERSION_HEX >= 0x02060000
125779   0, /*bf_releasebuffer*/
125780   #endif
125781 };
125782
125783 PyTypeObject __pyx_type_4lxml_5etree__AppendOnlyElementProxy = {
125784   PyVarObject_HEAD_INIT(0, 0)
125785   __Pyx_NAMESTR("lxml.etree._AppendOnlyElementProxy"), /*tp_name*/
125786   sizeof(struct __pyx_obj_4lxml_5etree__AppendOnlyElementProxy), /*tp_basicsize*/
125787   0, /*tp_itemsize*/
125788   __pyx_tp_dealloc_4lxml_5etree__ReadOnlyElementProxy, /*tp_dealloc*/
125789   0, /*tp_print*/
125790   0, /*tp_getattr*/
125791   0, /*tp_setattr*/
125792   0, /*tp_compare*/
125793   0, /*tp_repr*/
125794   &__pyx_tp_as_number__AppendOnlyElementProxy, /*tp_as_number*/
125795   &__pyx_tp_as_sequence__AppendOnlyElementProxy, /*tp_as_sequence*/
125796   &__pyx_tp_as_mapping__AppendOnlyElementProxy, /*tp_as_mapping*/
125797   0, /*tp_hash*/
125798   0, /*tp_call*/
125799   0, /*tp_str*/
125800   0, /*tp_getattro*/
125801   0, /*tp_setattro*/
125802   &__pyx_tp_as_buffer__AppendOnlyElementProxy, /*tp_as_buffer*/
125803   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
125804   __Pyx_DOCSTR("A read-only element that allows adding children and changing the\n    text content (i.e. everything that adds to the subtree).\n    "), /*tp_doc*/
125805   __pyx_tp_traverse_4lxml_5etree__ReadOnlyElementProxy, /*tp_traverse*/
125806   __pyx_tp_clear_4lxml_5etree__ReadOnlyElementProxy, /*tp_clear*/
125807   0, /*tp_richcompare*/
125808   0, /*tp_weaklistoffset*/
125809   0, /*tp_iter*/
125810   0, /*tp_iternext*/
125811   __pyx_methods_4lxml_5etree__AppendOnlyElementProxy, /*tp_methods*/
125812   0, /*tp_members*/
125813   __pyx_getsets_4lxml_5etree__AppendOnlyElementProxy, /*tp_getset*/
125814   0, /*tp_base*/
125815   0, /*tp_dict*/
125816   0, /*tp_descr_get*/
125817   0, /*tp_descr_set*/
125818   0, /*tp_dictoffset*/
125819   0, /*tp_init*/
125820   0, /*tp_alloc*/
125821   __pyx_tp_new_4lxml_5etree__AppendOnlyElementProxy, /*tp_new*/
125822   0, /*tp_free*/
125823   0, /*tp_is_gc*/
125824   0, /*tp_bases*/
125825   0, /*tp_mro*/
125826   0, /*tp_cache*/
125827   0, /*tp_subclasses*/
125828   0, /*tp_weaklist*/
125829 };
125830
125831 static PyObject *__pyx_tp_new_4lxml_5etree_ElementBase(PyTypeObject *t, PyObject *a, PyObject *k) {
125832   PyObject *o = __pyx_tp_new_4lxml_5etree__Element(t, a, k);
125833   if (!o) return 0;
125834   return o;
125835 }
125836
125837 static struct PyMethodDef __pyx_methods_4lxml_5etree_ElementBase[] = {
125838   {0, 0, 0, 0}
125839 };
125840
125841 static PyNumberMethods __pyx_tp_as_number_ElementBase = {
125842   0, /*nb_add*/
125843   0, /*nb_subtract*/
125844   0, /*nb_multiply*/
125845   #if PY_MAJOR_VERSION < 3
125846   0, /*nb_divide*/
125847   #endif
125848   0, /*nb_remainder*/
125849   0, /*nb_divmod*/
125850   0, /*nb_power*/
125851   0, /*nb_negative*/
125852   0, /*nb_positive*/
125853   0, /*nb_absolute*/
125854   0, /*nb_nonzero*/
125855   0, /*nb_invert*/
125856   0, /*nb_lshift*/
125857   0, /*nb_rshift*/
125858   0, /*nb_and*/
125859   0, /*nb_xor*/
125860   0, /*nb_or*/
125861   #if PY_MAJOR_VERSION < 3
125862   0, /*nb_coerce*/
125863   #endif
125864   0, /*nb_int*/
125865   #if PY_MAJOR_VERSION >= 3
125866   0, /*reserved*/
125867   #else
125868   0, /*nb_long*/
125869   #endif
125870   0, /*nb_float*/
125871   #if PY_MAJOR_VERSION < 3
125872   0, /*nb_oct*/
125873   #endif
125874   #if PY_MAJOR_VERSION < 3
125875   0, /*nb_hex*/
125876   #endif
125877   0, /*nb_inplace_add*/
125878   0, /*nb_inplace_subtract*/
125879   0, /*nb_inplace_multiply*/
125880   #if PY_MAJOR_VERSION < 3
125881   0, /*nb_inplace_divide*/
125882   #endif
125883   0, /*nb_inplace_remainder*/
125884   0, /*nb_inplace_power*/
125885   0, /*nb_inplace_lshift*/
125886   0, /*nb_inplace_rshift*/
125887   0, /*nb_inplace_and*/
125888   0, /*nb_inplace_xor*/
125889   0, /*nb_inplace_or*/
125890   0, /*nb_floor_divide*/
125891   0, /*nb_true_divide*/
125892   0, /*nb_inplace_floor_divide*/
125893   0, /*nb_inplace_true_divide*/
125894   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
125895   0, /*nb_index*/
125896   #endif
125897 };
125898
125899 static PySequenceMethods __pyx_tp_as_sequence_ElementBase = {
125900   0, /*sq_length*/
125901   0, /*sq_concat*/
125902   0, /*sq_repeat*/
125903   0, /*sq_item*/
125904   0, /*sq_slice*/
125905   0, /*sq_ass_item*/
125906   0, /*sq_ass_slice*/
125907   0, /*sq_contains*/
125908   0, /*sq_inplace_concat*/
125909   0, /*sq_inplace_repeat*/
125910 };
125911
125912 static PyMappingMethods __pyx_tp_as_mapping_ElementBase = {
125913   0, /*mp_length*/
125914   0, /*mp_subscript*/
125915   0, /*mp_ass_subscript*/
125916 };
125917
125918 static PyBufferProcs __pyx_tp_as_buffer_ElementBase = {
125919   #if PY_MAJOR_VERSION < 3
125920   0, /*bf_getreadbuffer*/
125921   #endif
125922   #if PY_MAJOR_VERSION < 3
125923   0, /*bf_getwritebuffer*/
125924   #endif
125925   #if PY_MAJOR_VERSION < 3
125926   0, /*bf_getsegcount*/
125927   #endif
125928   #if PY_MAJOR_VERSION < 3
125929   0, /*bf_getcharbuffer*/
125930   #endif
125931   #if PY_VERSION_HEX >= 0x02060000
125932   0, /*bf_getbuffer*/
125933   #endif
125934   #if PY_VERSION_HEX >= 0x02060000
125935   0, /*bf_releasebuffer*/
125936   #endif
125937 };
125938
125939 DL_EXPORT(PyTypeObject) LxmlElementBaseType = {
125940   PyVarObject_HEAD_INIT(0, 0)
125941   __Pyx_NAMESTR("lxml.etree.ElementBase"), /*tp_name*/
125942   sizeof(struct LxmlElementBase), /*tp_basicsize*/
125943   0, /*tp_itemsize*/
125944   __pyx_tp_dealloc_4lxml_5etree__Element, /*tp_dealloc*/
125945   0, /*tp_print*/
125946   0, /*tp_getattr*/
125947   0, /*tp_setattr*/
125948   0, /*tp_compare*/
125949   0, /*tp_repr*/
125950   &__pyx_tp_as_number_ElementBase, /*tp_as_number*/
125951   &__pyx_tp_as_sequence_ElementBase, /*tp_as_sequence*/
125952   &__pyx_tp_as_mapping_ElementBase, /*tp_as_mapping*/
125953   0, /*tp_hash*/
125954   0, /*tp_call*/
125955   0, /*tp_str*/
125956   0, /*tp_getattro*/
125957   0, /*tp_setattro*/
125958   &__pyx_tp_as_buffer_ElementBase, /*tp_as_buffer*/
125959   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
125960   __Pyx_DOCSTR("ElementBase(*children, attrib=None, nsmap=None, **_extra)\n\n    The public Element class.  All custom Element classes must inherit\n    from this one.  To create an Element, use the `Element()` factory.\n\n    BIG FAT WARNING: Subclasses *must not* override __init__ or\n    __new__ as it is absolutely undefined when these objects will be\n    created or destroyed.  All persistent state of Elements must be\n    stored in the underlying XML.  If you really need to initialize\n    the object after creation, you can implement an ``_init(self)``\n    method that will be called directly after object creation.\n\n    Subclasses of this class can be instantiated to create a new\n    Element.  By default, the tag name will be the class name and the\n    namespace will be empty.  You can modify this with the following\n    class attributes:\n\n    * TAG - the tag name, possibly containing a namespace in Clark\n      notation\n\n    * NAMESPACE - the default namespace URI, unless provided as part\n      of the TAG attribute.\n\n    * HTML - flag if the class is an HTML tag, as opposed to an XML\n      tag.  This only applies to un-namespaced tags and defaults to\n      false (i.e. XML).\n\n    * PARSER - the parser that provides the configuration for the\n      newly created document.  Providing an HTML parser here will\n      default to creating an HTML element.\n\n    In user code, the latter three are commonly inherited in class\n    hierarchies that implement a common namespace.\n    "), /*tp_doc*/
125961   __pyx_tp_traverse_4lxml_5etree__Element, /*tp_traverse*/
125962   __pyx_tp_clear_4lxml_5etree__Element, /*tp_clear*/
125963   0, /*tp_richcompare*/
125964   0, /*tp_weaklistoffset*/
125965   0, /*tp_iter*/
125966   0, /*tp_iternext*/
125967   __pyx_methods_4lxml_5etree_ElementBase, /*tp_methods*/
125968   0, /*tp_members*/
125969   0, /*tp_getset*/
125970   0, /*tp_base*/
125971   0, /*tp_dict*/
125972   0, /*tp_descr_get*/
125973   0, /*tp_descr_set*/
125974   0, /*tp_dictoffset*/
125975   __pyx_pf_4lxml_5etree_11ElementBase___init__, /*tp_init*/
125976   0, /*tp_alloc*/
125977   __pyx_tp_new_4lxml_5etree_ElementBase, /*tp_new*/
125978   0, /*tp_free*/
125979   0, /*tp_is_gc*/
125980   0, /*tp_bases*/
125981   0, /*tp_mro*/
125982   0, /*tp_cache*/
125983   0, /*tp_subclasses*/
125984   0, /*tp_weaklist*/
125985 };
125986 static struct __pyx_vtabstruct_4lxml_5etree_CommentBase __pyx_vtable_4lxml_5etree_CommentBase;
125987
125988 static PyObject *__pyx_tp_new_4lxml_5etree_CommentBase(PyTypeObject *t, PyObject *a, PyObject *k) {
125989   struct __pyx_obj_4lxml_5etree_CommentBase *p;
125990   PyObject *o = __pyx_tp_new_4lxml_5etree__Element(t, a, k);
125991   if (!o) return 0;
125992   p = ((struct __pyx_obj_4lxml_5etree_CommentBase *)o);
125993   p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement*)__pyx_vtabptr_4lxml_5etree_CommentBase;
125994   return o;
125995 }
125996
125997 static struct PyMethodDef __pyx_methods_4lxml_5etree_CommentBase[] = {
125998   {0, 0, 0, 0}
125999 };
126000
126001 static PyNumberMethods __pyx_tp_as_number_CommentBase = {
126002   0, /*nb_add*/
126003   0, /*nb_subtract*/
126004   0, /*nb_multiply*/
126005   #if PY_MAJOR_VERSION < 3
126006   0, /*nb_divide*/
126007   #endif
126008   0, /*nb_remainder*/
126009   0, /*nb_divmod*/
126010   0, /*nb_power*/
126011   0, /*nb_negative*/
126012   0, /*nb_positive*/
126013   0, /*nb_absolute*/
126014   0, /*nb_nonzero*/
126015   0, /*nb_invert*/
126016   0, /*nb_lshift*/
126017   0, /*nb_rshift*/
126018   0, /*nb_and*/
126019   0, /*nb_xor*/
126020   0, /*nb_or*/
126021   #if PY_MAJOR_VERSION < 3
126022   0, /*nb_coerce*/
126023   #endif
126024   0, /*nb_int*/
126025   #if PY_MAJOR_VERSION >= 3
126026   0, /*reserved*/
126027   #else
126028   0, /*nb_long*/
126029   #endif
126030   0, /*nb_float*/
126031   #if PY_MAJOR_VERSION < 3
126032   0, /*nb_oct*/
126033   #endif
126034   #if PY_MAJOR_VERSION < 3
126035   0, /*nb_hex*/
126036   #endif
126037   0, /*nb_inplace_add*/
126038   0, /*nb_inplace_subtract*/
126039   0, /*nb_inplace_multiply*/
126040   #if PY_MAJOR_VERSION < 3
126041   0, /*nb_inplace_divide*/
126042   #endif
126043   0, /*nb_inplace_remainder*/
126044   0, /*nb_inplace_power*/
126045   0, /*nb_inplace_lshift*/
126046   0, /*nb_inplace_rshift*/
126047   0, /*nb_inplace_and*/
126048   0, /*nb_inplace_xor*/
126049   0, /*nb_inplace_or*/
126050   0, /*nb_floor_divide*/
126051   0, /*nb_true_divide*/
126052   0, /*nb_inplace_floor_divide*/
126053   0, /*nb_inplace_true_divide*/
126054   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
126055   0, /*nb_index*/
126056   #endif
126057 };
126058
126059 static PySequenceMethods __pyx_tp_as_sequence_CommentBase = {
126060   0, /*sq_length*/
126061   0, /*sq_concat*/
126062   0, /*sq_repeat*/
126063   0, /*sq_item*/
126064   0, /*sq_slice*/
126065   0, /*sq_ass_item*/
126066   0, /*sq_ass_slice*/
126067   0, /*sq_contains*/
126068   0, /*sq_inplace_concat*/
126069   0, /*sq_inplace_repeat*/
126070 };
126071
126072 static PyMappingMethods __pyx_tp_as_mapping_CommentBase = {
126073   0, /*mp_length*/
126074   0, /*mp_subscript*/
126075   0, /*mp_ass_subscript*/
126076 };
126077
126078 static PyBufferProcs __pyx_tp_as_buffer_CommentBase = {
126079   #if PY_MAJOR_VERSION < 3
126080   0, /*bf_getreadbuffer*/
126081   #endif
126082   #if PY_MAJOR_VERSION < 3
126083   0, /*bf_getwritebuffer*/
126084   #endif
126085   #if PY_MAJOR_VERSION < 3
126086   0, /*bf_getsegcount*/
126087   #endif
126088   #if PY_MAJOR_VERSION < 3
126089   0, /*bf_getcharbuffer*/
126090   #endif
126091   #if PY_VERSION_HEX >= 0x02060000
126092   0, /*bf_getbuffer*/
126093   #endif
126094   #if PY_VERSION_HEX >= 0x02060000
126095   0, /*bf_releasebuffer*/
126096   #endif
126097 };
126098
126099 PyTypeObject __pyx_type_4lxml_5etree_CommentBase = {
126100   PyVarObject_HEAD_INIT(0, 0)
126101   __Pyx_NAMESTR("lxml.etree.CommentBase"), /*tp_name*/
126102   sizeof(struct __pyx_obj_4lxml_5etree_CommentBase), /*tp_basicsize*/
126103   0, /*tp_itemsize*/
126104   __pyx_tp_dealloc_4lxml_5etree__Element, /*tp_dealloc*/
126105   0, /*tp_print*/
126106   0, /*tp_getattr*/
126107   0, /*tp_setattr*/
126108   0, /*tp_compare*/
126109   0, /*tp_repr*/
126110   &__pyx_tp_as_number_CommentBase, /*tp_as_number*/
126111   &__pyx_tp_as_sequence_CommentBase, /*tp_as_sequence*/
126112   &__pyx_tp_as_mapping_CommentBase, /*tp_as_mapping*/
126113   0, /*tp_hash*/
126114   0, /*tp_call*/
126115   0, /*tp_str*/
126116   0, /*tp_getattro*/
126117   0, /*tp_setattro*/
126118   &__pyx_tp_as_buffer_CommentBase, /*tp_as_buffer*/
126119   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
126120   __Pyx_DOCSTR("All custom Comment classes must inherit from this one.\n\n    Note that you cannot (and must not) instantiate this class or its\n    subclasses.\n\n    Subclasses *must not* override __init__ or __new__ as it is\n    absolutely undefined when these objects will be created or\n    destroyed.  All persistent state of Comments must be stored in the\n    underlying XML.  If you really need to initialize the object after\n    creation, you can implement an ``_init(self)`` method that will be\n    called after object creation.\n    "), /*tp_doc*/
126121   __pyx_tp_traverse_4lxml_5etree__Element, /*tp_traverse*/
126122   __pyx_tp_clear_4lxml_5etree__Element, /*tp_clear*/
126123   0, /*tp_richcompare*/
126124   0, /*tp_weaklistoffset*/
126125   0, /*tp_iter*/
126126   0, /*tp_iternext*/
126127   __pyx_methods_4lxml_5etree_CommentBase, /*tp_methods*/
126128   0, /*tp_members*/
126129   0, /*tp_getset*/
126130   0, /*tp_base*/
126131   0, /*tp_dict*/
126132   0, /*tp_descr_get*/
126133   0, /*tp_descr_set*/
126134   0, /*tp_dictoffset*/
126135   0, /*tp_init*/
126136   0, /*tp_alloc*/
126137   __pyx_tp_new_4lxml_5etree_CommentBase, /*tp_new*/
126138   0, /*tp_free*/
126139   0, /*tp_is_gc*/
126140   0, /*tp_bases*/
126141   0, /*tp_mro*/
126142   0, /*tp_cache*/
126143   0, /*tp_subclasses*/
126144   0, /*tp_weaklist*/
126145 };
126146 static struct __pyx_vtabstruct_4lxml_5etree_PIBase __pyx_vtable_4lxml_5etree_PIBase;
126147
126148 static PyObject *__pyx_tp_new_4lxml_5etree_PIBase(PyTypeObject *t, PyObject *a, PyObject *k) {
126149   struct __pyx_obj_4lxml_5etree_PIBase *p;
126150   PyObject *o = __pyx_tp_new_4lxml_5etree__Element(t, a, k);
126151   if (!o) return 0;
126152   p = ((struct __pyx_obj_4lxml_5etree_PIBase *)o);
126153   p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement*)__pyx_vtabptr_4lxml_5etree_PIBase;
126154   return o;
126155 }
126156
126157 static struct PyMethodDef __pyx_methods_4lxml_5etree_PIBase[] = {
126158   {0, 0, 0, 0}
126159 };
126160
126161 static PyNumberMethods __pyx_tp_as_number_PIBase = {
126162   0, /*nb_add*/
126163   0, /*nb_subtract*/
126164   0, /*nb_multiply*/
126165   #if PY_MAJOR_VERSION < 3
126166   0, /*nb_divide*/
126167   #endif
126168   0, /*nb_remainder*/
126169   0, /*nb_divmod*/
126170   0, /*nb_power*/
126171   0, /*nb_negative*/
126172   0, /*nb_positive*/
126173   0, /*nb_absolute*/
126174   0, /*nb_nonzero*/
126175   0, /*nb_invert*/
126176   0, /*nb_lshift*/
126177   0, /*nb_rshift*/
126178   0, /*nb_and*/
126179   0, /*nb_xor*/
126180   0, /*nb_or*/
126181   #if PY_MAJOR_VERSION < 3
126182   0, /*nb_coerce*/
126183   #endif
126184   0, /*nb_int*/
126185   #if PY_MAJOR_VERSION >= 3
126186   0, /*reserved*/
126187   #else
126188   0, /*nb_long*/
126189   #endif
126190   0, /*nb_float*/
126191   #if PY_MAJOR_VERSION < 3
126192   0, /*nb_oct*/
126193   #endif
126194   #if PY_MAJOR_VERSION < 3
126195   0, /*nb_hex*/
126196   #endif
126197   0, /*nb_inplace_add*/
126198   0, /*nb_inplace_subtract*/
126199   0, /*nb_inplace_multiply*/
126200   #if PY_MAJOR_VERSION < 3
126201   0, /*nb_inplace_divide*/
126202   #endif
126203   0, /*nb_inplace_remainder*/
126204   0, /*nb_inplace_power*/
126205   0, /*nb_inplace_lshift*/
126206   0, /*nb_inplace_rshift*/
126207   0, /*nb_inplace_and*/
126208   0, /*nb_inplace_xor*/
126209   0, /*nb_inplace_or*/
126210   0, /*nb_floor_divide*/
126211   0, /*nb_true_divide*/
126212   0, /*nb_inplace_floor_divide*/
126213   0, /*nb_inplace_true_divide*/
126214   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
126215   0, /*nb_index*/
126216   #endif
126217 };
126218
126219 static PySequenceMethods __pyx_tp_as_sequence_PIBase = {
126220   0, /*sq_length*/
126221   0, /*sq_concat*/
126222   0, /*sq_repeat*/
126223   0, /*sq_item*/
126224   0, /*sq_slice*/
126225   0, /*sq_ass_item*/
126226   0, /*sq_ass_slice*/
126227   0, /*sq_contains*/
126228   0, /*sq_inplace_concat*/
126229   0, /*sq_inplace_repeat*/
126230 };
126231
126232 static PyMappingMethods __pyx_tp_as_mapping_PIBase = {
126233   0, /*mp_length*/
126234   0, /*mp_subscript*/
126235   0, /*mp_ass_subscript*/
126236 };
126237
126238 static PyBufferProcs __pyx_tp_as_buffer_PIBase = {
126239   #if PY_MAJOR_VERSION < 3
126240   0, /*bf_getreadbuffer*/
126241   #endif
126242   #if PY_MAJOR_VERSION < 3
126243   0, /*bf_getwritebuffer*/
126244   #endif
126245   #if PY_MAJOR_VERSION < 3
126246   0, /*bf_getsegcount*/
126247   #endif
126248   #if PY_MAJOR_VERSION < 3
126249   0, /*bf_getcharbuffer*/
126250   #endif
126251   #if PY_VERSION_HEX >= 0x02060000
126252   0, /*bf_getbuffer*/
126253   #endif
126254   #if PY_VERSION_HEX >= 0x02060000
126255   0, /*bf_releasebuffer*/
126256   #endif
126257 };
126258
126259 PyTypeObject __pyx_type_4lxml_5etree_PIBase = {
126260   PyVarObject_HEAD_INIT(0, 0)
126261   __Pyx_NAMESTR("lxml.etree.PIBase"), /*tp_name*/
126262   sizeof(struct __pyx_obj_4lxml_5etree_PIBase), /*tp_basicsize*/
126263   0, /*tp_itemsize*/
126264   __pyx_tp_dealloc_4lxml_5etree__Element, /*tp_dealloc*/
126265   0, /*tp_print*/
126266   0, /*tp_getattr*/
126267   0, /*tp_setattr*/
126268   0, /*tp_compare*/
126269   0, /*tp_repr*/
126270   &__pyx_tp_as_number_PIBase, /*tp_as_number*/
126271   &__pyx_tp_as_sequence_PIBase, /*tp_as_sequence*/
126272   &__pyx_tp_as_mapping_PIBase, /*tp_as_mapping*/
126273   0, /*tp_hash*/
126274   0, /*tp_call*/
126275   0, /*tp_str*/
126276   0, /*tp_getattro*/
126277   0, /*tp_setattro*/
126278   &__pyx_tp_as_buffer_PIBase, /*tp_as_buffer*/
126279   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
126280   __Pyx_DOCSTR("All custom Processing Instruction classes must inherit from this one.\n\n    Note that you cannot (and must not) instantiate this class or its\n    subclasses.\n\n    Subclasses *must not* override __init__ or __new__ as it is\n    absolutely undefined when these objects will be created or\n    destroyed.  All persistent state of PIs must be stored in the\n    underlying XML.  If you really need to initialize the object after\n    creation, you can implement an ``_init(self)`` method that will be\n    called after object creation.\n    "), /*tp_doc*/
126281   __pyx_tp_traverse_4lxml_5etree__Element, /*tp_traverse*/
126282   __pyx_tp_clear_4lxml_5etree__Element, /*tp_clear*/
126283   0, /*tp_richcompare*/
126284   0, /*tp_weaklistoffset*/
126285   0, /*tp_iter*/
126286   0, /*tp_iternext*/
126287   __pyx_methods_4lxml_5etree_PIBase, /*tp_methods*/
126288   0, /*tp_members*/
126289   0, /*tp_getset*/
126290   0, /*tp_base*/
126291   0, /*tp_dict*/
126292   0, /*tp_descr_get*/
126293   0, /*tp_descr_set*/
126294   0, /*tp_dictoffset*/
126295   0, /*tp_init*/
126296   0, /*tp_alloc*/
126297   __pyx_tp_new_4lxml_5etree_PIBase, /*tp_new*/
126298   0, /*tp_free*/
126299   0, /*tp_is_gc*/
126300   0, /*tp_bases*/
126301   0, /*tp_mro*/
126302   0, /*tp_cache*/
126303   0, /*tp_subclasses*/
126304   0, /*tp_weaklist*/
126305 };
126306 static struct __pyx_vtabstruct_4lxml_5etree_EntityBase __pyx_vtable_4lxml_5etree_EntityBase;
126307
126308 static PyObject *__pyx_tp_new_4lxml_5etree_EntityBase(PyTypeObject *t, PyObject *a, PyObject *k) {
126309   struct __pyx_obj_4lxml_5etree_EntityBase *p;
126310   PyObject *o = __pyx_tp_new_4lxml_5etree__Element(t, a, k);
126311   if (!o) return 0;
126312   p = ((struct __pyx_obj_4lxml_5etree_EntityBase *)o);
126313   p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement*)__pyx_vtabptr_4lxml_5etree_EntityBase;
126314   return o;
126315 }
126316
126317 static struct PyMethodDef __pyx_methods_4lxml_5etree_EntityBase[] = {
126318   {0, 0, 0, 0}
126319 };
126320
126321 static PyNumberMethods __pyx_tp_as_number_EntityBase = {
126322   0, /*nb_add*/
126323   0, /*nb_subtract*/
126324   0, /*nb_multiply*/
126325   #if PY_MAJOR_VERSION < 3
126326   0, /*nb_divide*/
126327   #endif
126328   0, /*nb_remainder*/
126329   0, /*nb_divmod*/
126330   0, /*nb_power*/
126331   0, /*nb_negative*/
126332   0, /*nb_positive*/
126333   0, /*nb_absolute*/
126334   0, /*nb_nonzero*/
126335   0, /*nb_invert*/
126336   0, /*nb_lshift*/
126337   0, /*nb_rshift*/
126338   0, /*nb_and*/
126339   0, /*nb_xor*/
126340   0, /*nb_or*/
126341   #if PY_MAJOR_VERSION < 3
126342   0, /*nb_coerce*/
126343   #endif
126344   0, /*nb_int*/
126345   #if PY_MAJOR_VERSION >= 3
126346   0, /*reserved*/
126347   #else
126348   0, /*nb_long*/
126349   #endif
126350   0, /*nb_float*/
126351   #if PY_MAJOR_VERSION < 3
126352   0, /*nb_oct*/
126353   #endif
126354   #if PY_MAJOR_VERSION < 3
126355   0, /*nb_hex*/
126356   #endif
126357   0, /*nb_inplace_add*/
126358   0, /*nb_inplace_subtract*/
126359   0, /*nb_inplace_multiply*/
126360   #if PY_MAJOR_VERSION < 3
126361   0, /*nb_inplace_divide*/
126362   #endif
126363   0, /*nb_inplace_remainder*/
126364   0, /*nb_inplace_power*/
126365   0, /*nb_inplace_lshift*/
126366   0, /*nb_inplace_rshift*/
126367   0, /*nb_inplace_and*/
126368   0, /*nb_inplace_xor*/
126369   0, /*nb_inplace_or*/
126370   0, /*nb_floor_divide*/
126371   0, /*nb_true_divide*/
126372   0, /*nb_inplace_floor_divide*/
126373   0, /*nb_inplace_true_divide*/
126374   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
126375   0, /*nb_index*/
126376   #endif
126377 };
126378
126379 static PySequenceMethods __pyx_tp_as_sequence_EntityBase = {
126380   0, /*sq_length*/
126381   0, /*sq_concat*/
126382   0, /*sq_repeat*/
126383   0, /*sq_item*/
126384   0, /*sq_slice*/
126385   0, /*sq_ass_item*/
126386   0, /*sq_ass_slice*/
126387   0, /*sq_contains*/
126388   0, /*sq_inplace_concat*/
126389   0, /*sq_inplace_repeat*/
126390 };
126391
126392 static PyMappingMethods __pyx_tp_as_mapping_EntityBase = {
126393   0, /*mp_length*/
126394   0, /*mp_subscript*/
126395   0, /*mp_ass_subscript*/
126396 };
126397
126398 static PyBufferProcs __pyx_tp_as_buffer_EntityBase = {
126399   #if PY_MAJOR_VERSION < 3
126400   0, /*bf_getreadbuffer*/
126401   #endif
126402   #if PY_MAJOR_VERSION < 3
126403   0, /*bf_getwritebuffer*/
126404   #endif
126405   #if PY_MAJOR_VERSION < 3
126406   0, /*bf_getsegcount*/
126407   #endif
126408   #if PY_MAJOR_VERSION < 3
126409   0, /*bf_getcharbuffer*/
126410   #endif
126411   #if PY_VERSION_HEX >= 0x02060000
126412   0, /*bf_getbuffer*/
126413   #endif
126414   #if PY_VERSION_HEX >= 0x02060000
126415   0, /*bf_releasebuffer*/
126416   #endif
126417 };
126418
126419 PyTypeObject __pyx_type_4lxml_5etree_EntityBase = {
126420   PyVarObject_HEAD_INIT(0, 0)
126421   __Pyx_NAMESTR("lxml.etree.EntityBase"), /*tp_name*/
126422   sizeof(struct __pyx_obj_4lxml_5etree_EntityBase), /*tp_basicsize*/
126423   0, /*tp_itemsize*/
126424   __pyx_tp_dealloc_4lxml_5etree__Element, /*tp_dealloc*/
126425   0, /*tp_print*/
126426   0, /*tp_getattr*/
126427   0, /*tp_setattr*/
126428   0, /*tp_compare*/
126429   0, /*tp_repr*/
126430   &__pyx_tp_as_number_EntityBase, /*tp_as_number*/
126431   &__pyx_tp_as_sequence_EntityBase, /*tp_as_sequence*/
126432   &__pyx_tp_as_mapping_EntityBase, /*tp_as_mapping*/
126433   0, /*tp_hash*/
126434   0, /*tp_call*/
126435   0, /*tp_str*/
126436   0, /*tp_getattro*/
126437   0, /*tp_setattro*/
126438   &__pyx_tp_as_buffer_EntityBase, /*tp_as_buffer*/
126439   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
126440   __Pyx_DOCSTR("All custom Entity classes must inherit from this one.\n\n    Note that you cannot (and must not) instantiate this class or its\n    subclasses.\n\n    Subclasses *must not* override __init__ or __new__ as it is\n    absolutely undefined when these objects will be created or\n    destroyed.  All persistent state of Entities must be stored in the\n    underlying XML.  If you really need to initialize the object after\n    creation, you can implement an ``_init(self)`` method that will be\n    called after object creation.\n    "), /*tp_doc*/
126441   __pyx_tp_traverse_4lxml_5etree__Element, /*tp_traverse*/
126442   __pyx_tp_clear_4lxml_5etree__Element, /*tp_clear*/
126443   0, /*tp_richcompare*/
126444   0, /*tp_weaklistoffset*/
126445   0, /*tp_iter*/
126446   0, /*tp_iternext*/
126447   __pyx_methods_4lxml_5etree_EntityBase, /*tp_methods*/
126448   0, /*tp_members*/
126449   0, /*tp_getset*/
126450   0, /*tp_base*/
126451   0, /*tp_dict*/
126452   0, /*tp_descr_get*/
126453   0, /*tp_descr_set*/
126454   0, /*tp_dictoffset*/
126455   0, /*tp_init*/
126456   0, /*tp_alloc*/
126457   __pyx_tp_new_4lxml_5etree_EntityBase, /*tp_new*/
126458   0, /*tp_free*/
126459   0, /*tp_is_gc*/
126460   0, /*tp_bases*/
126461   0, /*tp_mro*/
126462   0, /*tp_cache*/
126463   0, /*tp_subclasses*/
126464   0, /*tp_weaklist*/
126465 };
126466
126467 static PyObject *__pyx_tp_new_4lxml_5etree_ElementClassLookup(PyTypeObject *t, PyObject *a, PyObject *k) {
126468   PyObject *o = (*t->tp_alloc)(t, 0);
126469   if (!o) return 0;
126470   if (__pyx_pf_4lxml_5etree_18ElementClassLookup___cinit__(o, __pyx_empty_tuple, NULL) < 0) {
126471     Py_DECREF(o); o = 0;
126472   }
126473   return o;
126474 }
126475
126476 static void __pyx_tp_dealloc_4lxml_5etree_ElementClassLookup(PyObject *o) {
126477   (*Py_TYPE(o)->tp_free)(o);
126478 }
126479
126480 static struct PyMethodDef __pyx_methods_4lxml_5etree_ElementClassLookup[] = {
126481   {0, 0, 0, 0}
126482 };
126483
126484 static PyNumberMethods __pyx_tp_as_number_ElementClassLookup = {
126485   0, /*nb_add*/
126486   0, /*nb_subtract*/
126487   0, /*nb_multiply*/
126488   #if PY_MAJOR_VERSION < 3
126489   0, /*nb_divide*/
126490   #endif
126491   0, /*nb_remainder*/
126492   0, /*nb_divmod*/
126493   0, /*nb_power*/
126494   0, /*nb_negative*/
126495   0, /*nb_positive*/
126496   0, /*nb_absolute*/
126497   0, /*nb_nonzero*/
126498   0, /*nb_invert*/
126499   0, /*nb_lshift*/
126500   0, /*nb_rshift*/
126501   0, /*nb_and*/
126502   0, /*nb_xor*/
126503   0, /*nb_or*/
126504   #if PY_MAJOR_VERSION < 3
126505   0, /*nb_coerce*/
126506   #endif
126507   0, /*nb_int*/
126508   #if PY_MAJOR_VERSION >= 3
126509   0, /*reserved*/
126510   #else
126511   0, /*nb_long*/
126512   #endif
126513   0, /*nb_float*/
126514   #if PY_MAJOR_VERSION < 3
126515   0, /*nb_oct*/
126516   #endif
126517   #if PY_MAJOR_VERSION < 3
126518   0, /*nb_hex*/
126519   #endif
126520   0, /*nb_inplace_add*/
126521   0, /*nb_inplace_subtract*/
126522   0, /*nb_inplace_multiply*/
126523   #if PY_MAJOR_VERSION < 3
126524   0, /*nb_inplace_divide*/
126525   #endif
126526   0, /*nb_inplace_remainder*/
126527   0, /*nb_inplace_power*/
126528   0, /*nb_inplace_lshift*/
126529   0, /*nb_inplace_rshift*/
126530   0, /*nb_inplace_and*/
126531   0, /*nb_inplace_xor*/
126532   0, /*nb_inplace_or*/
126533   0, /*nb_floor_divide*/
126534   0, /*nb_true_divide*/
126535   0, /*nb_inplace_floor_divide*/
126536   0, /*nb_inplace_true_divide*/
126537   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
126538   0, /*nb_index*/
126539   #endif
126540 };
126541
126542 static PySequenceMethods __pyx_tp_as_sequence_ElementClassLookup = {
126543   0, /*sq_length*/
126544   0, /*sq_concat*/
126545   0, /*sq_repeat*/
126546   0, /*sq_item*/
126547   0, /*sq_slice*/
126548   0, /*sq_ass_item*/
126549   0, /*sq_ass_slice*/
126550   0, /*sq_contains*/
126551   0, /*sq_inplace_concat*/
126552   0, /*sq_inplace_repeat*/
126553 };
126554
126555 static PyMappingMethods __pyx_tp_as_mapping_ElementClassLookup = {
126556   0, /*mp_length*/
126557   0, /*mp_subscript*/
126558   0, /*mp_ass_subscript*/
126559 };
126560
126561 static PyBufferProcs __pyx_tp_as_buffer_ElementClassLookup = {
126562   #if PY_MAJOR_VERSION < 3
126563   0, /*bf_getreadbuffer*/
126564   #endif
126565   #if PY_MAJOR_VERSION < 3
126566   0, /*bf_getwritebuffer*/
126567   #endif
126568   #if PY_MAJOR_VERSION < 3
126569   0, /*bf_getsegcount*/
126570   #endif
126571   #if PY_MAJOR_VERSION < 3
126572   0, /*bf_getcharbuffer*/
126573   #endif
126574   #if PY_VERSION_HEX >= 0x02060000
126575   0, /*bf_getbuffer*/
126576   #endif
126577   #if PY_VERSION_HEX >= 0x02060000
126578   0, /*bf_releasebuffer*/
126579   #endif
126580 };
126581
126582 DL_EXPORT(PyTypeObject) LxmlElementClassLookupType = {
126583   PyVarObject_HEAD_INIT(0, 0)
126584   __Pyx_NAMESTR("lxml.etree.ElementClassLookup"), /*tp_name*/
126585   sizeof(struct LxmlElementClassLookup), /*tp_basicsize*/
126586   0, /*tp_itemsize*/
126587   __pyx_tp_dealloc_4lxml_5etree_ElementClassLookup, /*tp_dealloc*/
126588   0, /*tp_print*/
126589   0, /*tp_getattr*/
126590   0, /*tp_setattr*/
126591   0, /*tp_compare*/
126592   0, /*tp_repr*/
126593   &__pyx_tp_as_number_ElementClassLookup, /*tp_as_number*/
126594   &__pyx_tp_as_sequence_ElementClassLookup, /*tp_as_sequence*/
126595   &__pyx_tp_as_mapping_ElementClassLookup, /*tp_as_mapping*/
126596   0, /*tp_hash*/
126597   0, /*tp_call*/
126598   0, /*tp_str*/
126599   0, /*tp_getattro*/
126600   0, /*tp_setattro*/
126601   &__pyx_tp_as_buffer_ElementClassLookup, /*tp_as_buffer*/
126602   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
126603   __Pyx_DOCSTR("ElementClassLookup(self)\n    Superclass of Element class lookups.\n    "), /*tp_doc*/
126604   0, /*tp_traverse*/
126605   0, /*tp_clear*/
126606   0, /*tp_richcompare*/
126607   0, /*tp_weaklistoffset*/
126608   0, /*tp_iter*/
126609   0, /*tp_iternext*/
126610   __pyx_methods_4lxml_5etree_ElementClassLookup, /*tp_methods*/
126611   0, /*tp_members*/
126612   0, /*tp_getset*/
126613   0, /*tp_base*/
126614   0, /*tp_dict*/
126615   0, /*tp_descr_get*/
126616   0, /*tp_descr_set*/
126617   0, /*tp_dictoffset*/
126618   0, /*tp_init*/
126619   0, /*tp_alloc*/
126620   __pyx_tp_new_4lxml_5etree_ElementClassLookup, /*tp_new*/
126621   0, /*tp_free*/
126622   0, /*tp_is_gc*/
126623   0, /*tp_bases*/
126624   0, /*tp_mro*/
126625   0, /*tp_cache*/
126626   0, /*tp_subclasses*/
126627   0, /*tp_weaklist*/
126628 };
126629 static struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup __pyx_vtable_4lxml_5etree_FallbackElementClassLookup;
126630
126631 static PyObject *__pyx_tp_new_4lxml_5etree_FallbackElementClassLookup(PyTypeObject *t, PyObject *a, PyObject *k) {
126632   struct LxmlFallbackElementClassLookup *p;
126633   PyObject *o = __pyx_tp_new_4lxml_5etree_ElementClassLookup(t, a, k);
126634   if (!o) return 0;
126635   p = ((struct LxmlFallbackElementClassLookup *)o);
126636   p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup;
126637   p->fallback = ((struct LxmlElementClassLookup *)Py_None); Py_INCREF(Py_None);
126638   if (__pyx_pf_4lxml_5etree_26FallbackElementClassLookup___cinit__(o, __pyx_empty_tuple, NULL) < 0) {
126639     Py_DECREF(o); o = 0;
126640   }
126641   return o;
126642 }
126643
126644 static void __pyx_tp_dealloc_4lxml_5etree_FallbackElementClassLookup(PyObject *o) {
126645   struct LxmlFallbackElementClassLookup *p = (struct LxmlFallbackElementClassLookup *)o;
126646   Py_XDECREF(((PyObject *)p->fallback));
126647   __pyx_tp_dealloc_4lxml_5etree_ElementClassLookup(o);
126648 }
126649
126650 static int __pyx_tp_traverse_4lxml_5etree_FallbackElementClassLookup(PyObject *o, visitproc v, void *a) {
126651   int e;
126652   struct LxmlFallbackElementClassLookup *p = (struct LxmlFallbackElementClassLookup *)o;
126653   if (__pyx_ptype_4lxml_5etree_ElementClassLookup->tp_traverse) {
126654     e = __pyx_ptype_4lxml_5etree_ElementClassLookup->tp_traverse(o, v, a); if (e) return e;
126655   }
126656   if (p->fallback) {
126657     e = (*v)(((PyObject*)p->fallback), a); if (e) return e;
126658   }
126659   return 0;
126660 }
126661
126662 static int __pyx_tp_clear_4lxml_5etree_FallbackElementClassLookup(PyObject *o) {
126663   struct LxmlFallbackElementClassLookup *p = (struct LxmlFallbackElementClassLookup *)o;
126664   PyObject* tmp;
126665   if (__pyx_ptype_4lxml_5etree_ElementClassLookup->tp_clear) {
126666     __pyx_ptype_4lxml_5etree_ElementClassLookup->tp_clear(o);
126667   }
126668   tmp = ((PyObject*)p->fallback);
126669   p->fallback = ((struct LxmlElementClassLookup *)Py_None); Py_INCREF(Py_None);
126670   Py_XDECREF(tmp);
126671   return 0;
126672 }
126673
126674 static struct PyMethodDef __pyx_methods_4lxml_5etree_FallbackElementClassLookup[] = {
126675   {__Pyx_NAMESTR("set_fallback"), (PyCFunction)__pyx_pf_4lxml_5etree_26FallbackElementClassLookup_set_fallback, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_26FallbackElementClassLookup_set_fallback)},
126676   {0, 0, 0, 0}
126677 };
126678
126679 static struct PyMemberDef __pyx_members_4lxml_5etree_FallbackElementClassLookup[] = {
126680   {(char *)"fallback", T_OBJECT, offsetof(struct LxmlFallbackElementClassLookup, fallback), READONLY, 0},
126681   {0, 0, 0, 0, 0}
126682 };
126683
126684 static PyNumberMethods __pyx_tp_as_number_FallbackElementClassLookup = {
126685   0, /*nb_add*/
126686   0, /*nb_subtract*/
126687   0, /*nb_multiply*/
126688   #if PY_MAJOR_VERSION < 3
126689   0, /*nb_divide*/
126690   #endif
126691   0, /*nb_remainder*/
126692   0, /*nb_divmod*/
126693   0, /*nb_power*/
126694   0, /*nb_negative*/
126695   0, /*nb_positive*/
126696   0, /*nb_absolute*/
126697   0, /*nb_nonzero*/
126698   0, /*nb_invert*/
126699   0, /*nb_lshift*/
126700   0, /*nb_rshift*/
126701   0, /*nb_and*/
126702   0, /*nb_xor*/
126703   0, /*nb_or*/
126704   #if PY_MAJOR_VERSION < 3
126705   0, /*nb_coerce*/
126706   #endif
126707   0, /*nb_int*/
126708   #if PY_MAJOR_VERSION >= 3
126709   0, /*reserved*/
126710   #else
126711   0, /*nb_long*/
126712   #endif
126713   0, /*nb_float*/
126714   #if PY_MAJOR_VERSION < 3
126715   0, /*nb_oct*/
126716   #endif
126717   #if PY_MAJOR_VERSION < 3
126718   0, /*nb_hex*/
126719   #endif
126720   0, /*nb_inplace_add*/
126721   0, /*nb_inplace_subtract*/
126722   0, /*nb_inplace_multiply*/
126723   #if PY_MAJOR_VERSION < 3
126724   0, /*nb_inplace_divide*/
126725   #endif
126726   0, /*nb_inplace_remainder*/
126727   0, /*nb_inplace_power*/
126728   0, /*nb_inplace_lshift*/
126729   0, /*nb_inplace_rshift*/
126730   0, /*nb_inplace_and*/
126731   0, /*nb_inplace_xor*/
126732   0, /*nb_inplace_or*/
126733   0, /*nb_floor_divide*/
126734   0, /*nb_true_divide*/
126735   0, /*nb_inplace_floor_divide*/
126736   0, /*nb_inplace_true_divide*/
126737   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
126738   0, /*nb_index*/
126739   #endif
126740 };
126741
126742 static PySequenceMethods __pyx_tp_as_sequence_FallbackElementClassLookup = {
126743   0, /*sq_length*/
126744   0, /*sq_concat*/
126745   0, /*sq_repeat*/
126746   0, /*sq_item*/
126747   0, /*sq_slice*/
126748   0, /*sq_ass_item*/
126749   0, /*sq_ass_slice*/
126750   0, /*sq_contains*/
126751   0, /*sq_inplace_concat*/
126752   0, /*sq_inplace_repeat*/
126753 };
126754
126755 static PyMappingMethods __pyx_tp_as_mapping_FallbackElementClassLookup = {
126756   0, /*mp_length*/
126757   0, /*mp_subscript*/
126758   0, /*mp_ass_subscript*/
126759 };
126760
126761 static PyBufferProcs __pyx_tp_as_buffer_FallbackElementClassLookup = {
126762   #if PY_MAJOR_VERSION < 3
126763   0, /*bf_getreadbuffer*/
126764   #endif
126765   #if PY_MAJOR_VERSION < 3
126766   0, /*bf_getwritebuffer*/
126767   #endif
126768   #if PY_MAJOR_VERSION < 3
126769   0, /*bf_getsegcount*/
126770   #endif
126771   #if PY_MAJOR_VERSION < 3
126772   0, /*bf_getcharbuffer*/
126773   #endif
126774   #if PY_VERSION_HEX >= 0x02060000
126775   0, /*bf_getbuffer*/
126776   #endif
126777   #if PY_VERSION_HEX >= 0x02060000
126778   0, /*bf_releasebuffer*/
126779   #endif
126780 };
126781
126782 DL_EXPORT(PyTypeObject) LxmlFallbackElementClassLookupType = {
126783   PyVarObject_HEAD_INIT(0, 0)
126784   __Pyx_NAMESTR("lxml.etree.FallbackElementClassLookup"), /*tp_name*/
126785   sizeof(struct LxmlFallbackElementClassLookup), /*tp_basicsize*/
126786   0, /*tp_itemsize*/
126787   __pyx_tp_dealloc_4lxml_5etree_FallbackElementClassLookup, /*tp_dealloc*/
126788   0, /*tp_print*/
126789   0, /*tp_getattr*/
126790   0, /*tp_setattr*/
126791   0, /*tp_compare*/
126792   0, /*tp_repr*/
126793   &__pyx_tp_as_number_FallbackElementClassLookup, /*tp_as_number*/
126794   &__pyx_tp_as_sequence_FallbackElementClassLookup, /*tp_as_sequence*/
126795   &__pyx_tp_as_mapping_FallbackElementClassLookup, /*tp_as_mapping*/
126796   0, /*tp_hash*/
126797   0, /*tp_call*/
126798   0, /*tp_str*/
126799   0, /*tp_getattro*/
126800   0, /*tp_setattro*/
126801   &__pyx_tp_as_buffer_FallbackElementClassLookup, /*tp_as_buffer*/
126802   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
126803   __Pyx_DOCSTR("FallbackElementClassLookup(self, fallback=None)\n\n    Superclass of Element class lookups with additional fallback.\n    "), /*tp_doc*/
126804   __pyx_tp_traverse_4lxml_5etree_FallbackElementClassLookup, /*tp_traverse*/
126805   __pyx_tp_clear_4lxml_5etree_FallbackElementClassLookup, /*tp_clear*/
126806   0, /*tp_richcompare*/
126807   0, /*tp_weaklistoffset*/
126808   0, /*tp_iter*/
126809   0, /*tp_iternext*/
126810   __pyx_methods_4lxml_5etree_FallbackElementClassLookup, /*tp_methods*/
126811   __pyx_members_4lxml_5etree_FallbackElementClassLookup, /*tp_members*/
126812   0, /*tp_getset*/
126813   0, /*tp_base*/
126814   0, /*tp_dict*/
126815   0, /*tp_descr_get*/
126816   0, /*tp_descr_set*/
126817   0, /*tp_dictoffset*/
126818   __pyx_pf_4lxml_5etree_26FallbackElementClassLookup___init__, /*tp_init*/
126819   0, /*tp_alloc*/
126820   __pyx_tp_new_4lxml_5etree_FallbackElementClassLookup, /*tp_new*/
126821   0, /*tp_free*/
126822   0, /*tp_is_gc*/
126823   0, /*tp_bases*/
126824   0, /*tp_mro*/
126825   0, /*tp_cache*/
126826   0, /*tp_subclasses*/
126827   0, /*tp_weaklist*/
126828 };
126829
126830 static PyObject *__pyx_tp_new_4lxml_5etree_ElementDefaultClassLookup(PyTypeObject *t, PyObject *a, PyObject *k) {
126831   struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *p;
126832   PyObject *o = __pyx_tp_new_4lxml_5etree_ElementClassLookup(t, a, k);
126833   if (!o) return 0;
126834   p = ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)o);
126835   p->element_class = Py_None; Py_INCREF(Py_None);
126836   p->comment_class = Py_None; Py_INCREF(Py_None);
126837   p->pi_class = Py_None; Py_INCREF(Py_None);
126838   p->entity_class = Py_None; Py_INCREF(Py_None);
126839   if (__pyx_pf_4lxml_5etree_25ElementDefaultClassLookup___cinit__(o, __pyx_empty_tuple, NULL) < 0) {
126840     Py_DECREF(o); o = 0;
126841   }
126842   return o;
126843 }
126844
126845 static void __pyx_tp_dealloc_4lxml_5etree_ElementDefaultClassLookup(PyObject *o) {
126846   struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *p = (struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)o;
126847   Py_XDECREF(p->element_class);
126848   Py_XDECREF(p->comment_class);
126849   Py_XDECREF(p->pi_class);
126850   Py_XDECREF(p->entity_class);
126851   __pyx_tp_dealloc_4lxml_5etree_ElementClassLookup(o);
126852 }
126853
126854 static int __pyx_tp_traverse_4lxml_5etree_ElementDefaultClassLookup(PyObject *o, visitproc v, void *a) {
126855   int e;
126856   struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *p = (struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)o;
126857   if (__pyx_ptype_4lxml_5etree_ElementClassLookup->tp_traverse) {
126858     e = __pyx_ptype_4lxml_5etree_ElementClassLookup->tp_traverse(o, v, a); if (e) return e;
126859   }
126860   if (p->element_class) {
126861     e = (*v)(p->element_class, a); if (e) return e;
126862   }
126863   if (p->comment_class) {
126864     e = (*v)(p->comment_class, a); if (e) return e;
126865   }
126866   if (p->pi_class) {
126867     e = (*v)(p->pi_class, a); if (e) return e;
126868   }
126869   if (p->entity_class) {
126870     e = (*v)(p->entity_class, a); if (e) return e;
126871   }
126872   return 0;
126873 }
126874
126875 static int __pyx_tp_clear_4lxml_5etree_ElementDefaultClassLookup(PyObject *o) {
126876   struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *p = (struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)o;
126877   PyObject* tmp;
126878   if (__pyx_ptype_4lxml_5etree_ElementClassLookup->tp_clear) {
126879     __pyx_ptype_4lxml_5etree_ElementClassLookup->tp_clear(o);
126880   }
126881   tmp = ((PyObject*)p->element_class);
126882   p->element_class = Py_None; Py_INCREF(Py_None);
126883   Py_XDECREF(tmp);
126884   tmp = ((PyObject*)p->comment_class);
126885   p->comment_class = Py_None; Py_INCREF(Py_None);
126886   Py_XDECREF(tmp);
126887   tmp = ((PyObject*)p->pi_class);
126888   p->pi_class = Py_None; Py_INCREF(Py_None);
126889   Py_XDECREF(tmp);
126890   tmp = ((PyObject*)p->entity_class);
126891   p->entity_class = Py_None; Py_INCREF(Py_None);
126892   Py_XDECREF(tmp);
126893   return 0;
126894 }
126895
126896 static struct PyMethodDef __pyx_methods_4lxml_5etree_ElementDefaultClassLookup[] = {
126897   {0, 0, 0, 0}
126898 };
126899
126900 static struct PyMemberDef __pyx_members_4lxml_5etree_ElementDefaultClassLookup[] = {
126901   {(char *)"element_class", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup, element_class), READONLY, 0},
126902   {(char *)"comment_class", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup, comment_class), READONLY, 0},
126903   {(char *)"pi_class", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup, pi_class), READONLY, 0},
126904   {(char *)"entity_class", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup, entity_class), READONLY, 0},
126905   {0, 0, 0, 0, 0}
126906 };
126907
126908 static PyNumberMethods __pyx_tp_as_number_ElementDefaultClassLookup = {
126909   0, /*nb_add*/
126910   0, /*nb_subtract*/
126911   0, /*nb_multiply*/
126912   #if PY_MAJOR_VERSION < 3
126913   0, /*nb_divide*/
126914   #endif
126915   0, /*nb_remainder*/
126916   0, /*nb_divmod*/
126917   0, /*nb_power*/
126918   0, /*nb_negative*/
126919   0, /*nb_positive*/
126920   0, /*nb_absolute*/
126921   0, /*nb_nonzero*/
126922   0, /*nb_invert*/
126923   0, /*nb_lshift*/
126924   0, /*nb_rshift*/
126925   0, /*nb_and*/
126926   0, /*nb_xor*/
126927   0, /*nb_or*/
126928   #if PY_MAJOR_VERSION < 3
126929   0, /*nb_coerce*/
126930   #endif
126931   0, /*nb_int*/
126932   #if PY_MAJOR_VERSION >= 3
126933   0, /*reserved*/
126934   #else
126935   0, /*nb_long*/
126936   #endif
126937   0, /*nb_float*/
126938   #if PY_MAJOR_VERSION < 3
126939   0, /*nb_oct*/
126940   #endif
126941   #if PY_MAJOR_VERSION < 3
126942   0, /*nb_hex*/
126943   #endif
126944   0, /*nb_inplace_add*/
126945   0, /*nb_inplace_subtract*/
126946   0, /*nb_inplace_multiply*/
126947   #if PY_MAJOR_VERSION < 3
126948   0, /*nb_inplace_divide*/
126949   #endif
126950   0, /*nb_inplace_remainder*/
126951   0, /*nb_inplace_power*/
126952   0, /*nb_inplace_lshift*/
126953   0, /*nb_inplace_rshift*/
126954   0, /*nb_inplace_and*/
126955   0, /*nb_inplace_xor*/
126956   0, /*nb_inplace_or*/
126957   0, /*nb_floor_divide*/
126958   0, /*nb_true_divide*/
126959   0, /*nb_inplace_floor_divide*/
126960   0, /*nb_inplace_true_divide*/
126961   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
126962   0, /*nb_index*/
126963   #endif
126964 };
126965
126966 static PySequenceMethods __pyx_tp_as_sequence_ElementDefaultClassLookup = {
126967   0, /*sq_length*/
126968   0, /*sq_concat*/
126969   0, /*sq_repeat*/
126970   0, /*sq_item*/
126971   0, /*sq_slice*/
126972   0, /*sq_ass_item*/
126973   0, /*sq_ass_slice*/
126974   0, /*sq_contains*/
126975   0, /*sq_inplace_concat*/
126976   0, /*sq_inplace_repeat*/
126977 };
126978
126979 static PyMappingMethods __pyx_tp_as_mapping_ElementDefaultClassLookup = {
126980   0, /*mp_length*/
126981   0, /*mp_subscript*/
126982   0, /*mp_ass_subscript*/
126983 };
126984
126985 static PyBufferProcs __pyx_tp_as_buffer_ElementDefaultClassLookup = {
126986   #if PY_MAJOR_VERSION < 3
126987   0, /*bf_getreadbuffer*/
126988   #endif
126989   #if PY_MAJOR_VERSION < 3
126990   0, /*bf_getwritebuffer*/
126991   #endif
126992   #if PY_MAJOR_VERSION < 3
126993   0, /*bf_getsegcount*/
126994   #endif
126995   #if PY_MAJOR_VERSION < 3
126996   0, /*bf_getcharbuffer*/
126997   #endif
126998   #if PY_VERSION_HEX >= 0x02060000
126999   0, /*bf_getbuffer*/
127000   #endif
127001   #if PY_VERSION_HEX >= 0x02060000
127002   0, /*bf_releasebuffer*/
127003   #endif
127004 };
127005
127006 PyTypeObject __pyx_type_4lxml_5etree_ElementDefaultClassLookup = {
127007   PyVarObject_HEAD_INIT(0, 0)
127008   __Pyx_NAMESTR("lxml.etree.ElementDefaultClassLookup"), /*tp_name*/
127009   sizeof(struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup), /*tp_basicsize*/
127010   0, /*tp_itemsize*/
127011   __pyx_tp_dealloc_4lxml_5etree_ElementDefaultClassLookup, /*tp_dealloc*/
127012   0, /*tp_print*/
127013   0, /*tp_getattr*/
127014   0, /*tp_setattr*/
127015   0, /*tp_compare*/
127016   0, /*tp_repr*/
127017   &__pyx_tp_as_number_ElementDefaultClassLookup, /*tp_as_number*/
127018   &__pyx_tp_as_sequence_ElementDefaultClassLookup, /*tp_as_sequence*/
127019   &__pyx_tp_as_mapping_ElementDefaultClassLookup, /*tp_as_mapping*/
127020   0, /*tp_hash*/
127021   0, /*tp_call*/
127022   0, /*tp_str*/
127023   0, /*tp_getattro*/
127024   0, /*tp_setattro*/
127025   &__pyx_tp_as_buffer_ElementDefaultClassLookup, /*tp_as_buffer*/
127026   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
127027   __Pyx_DOCSTR("ElementDefaultClassLookup(self, element=None, comment=None, pi=None, entity=None)\n    Element class lookup scheme that always returns the default Element\n    class.\n\n    The keyword arguments ``element``, ``comment``, ``pi`` and ``entity``\n    accept the respective Element classes.\n    "), /*tp_doc*/
127028   __pyx_tp_traverse_4lxml_5etree_ElementDefaultClassLookup, /*tp_traverse*/
127029   __pyx_tp_clear_4lxml_5etree_ElementDefaultClassLookup, /*tp_clear*/
127030   0, /*tp_richcompare*/
127031   0, /*tp_weaklistoffset*/
127032   0, /*tp_iter*/
127033   0, /*tp_iternext*/
127034   __pyx_methods_4lxml_5etree_ElementDefaultClassLookup, /*tp_methods*/
127035   __pyx_members_4lxml_5etree_ElementDefaultClassLookup, /*tp_members*/
127036   0, /*tp_getset*/
127037   0, /*tp_base*/
127038   0, /*tp_dict*/
127039   0, /*tp_descr_get*/
127040   0, /*tp_descr_set*/
127041   0, /*tp_dictoffset*/
127042   __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup___init__, /*tp_init*/
127043   0, /*tp_alloc*/
127044   __pyx_tp_new_4lxml_5etree_ElementDefaultClassLookup, /*tp_new*/
127045   0, /*tp_free*/
127046   0, /*tp_is_gc*/
127047   0, /*tp_bases*/
127048   0, /*tp_mro*/
127049   0, /*tp_cache*/
127050   0, /*tp_subclasses*/
127051   0, /*tp_weaklist*/
127052 };
127053 static struct __pyx_vtabstruct_4lxml_5etree_AttributeBasedElementClassLookup __pyx_vtable_4lxml_5etree_AttributeBasedElementClassLookup;
127054
127055 static PyObject *__pyx_tp_new_4lxml_5etree_AttributeBasedElementClassLookup(PyTypeObject *t, PyObject *a, PyObject *k) {
127056   struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *p;
127057   PyObject *o = __pyx_tp_new_4lxml_5etree_FallbackElementClassLookup(t, a, k);
127058   if (!o) return 0;
127059   p = ((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)o);
127060   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup*)__pyx_vtabptr_4lxml_5etree_AttributeBasedElementClassLookup;
127061   p->_class_mapping = Py_None; Py_INCREF(Py_None);
127062   p->_pytag = Py_None; Py_INCREF(Py_None);
127063   if (__pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup___cinit__(o, __pyx_empty_tuple, NULL) < 0) {
127064     Py_DECREF(o); o = 0;
127065   }
127066   return o;
127067 }
127068
127069 static void __pyx_tp_dealloc_4lxml_5etree_AttributeBasedElementClassLookup(PyObject *o) {
127070   struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *p = (struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)o;
127071   Py_XDECREF(p->_class_mapping);
127072   Py_XDECREF(p->_pytag);
127073   __pyx_tp_dealloc_4lxml_5etree_FallbackElementClassLookup(o);
127074 }
127075
127076 static int __pyx_tp_traverse_4lxml_5etree_AttributeBasedElementClassLookup(PyObject *o, visitproc v, void *a) {
127077   int e;
127078   struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *p = (struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)o;
127079   e = __pyx_tp_traverse_4lxml_5etree_FallbackElementClassLookup(o, v, a); if (e) return e;
127080   if (p->_class_mapping) {
127081     e = (*v)(p->_class_mapping, a); if (e) return e;
127082   }
127083   if (p->_pytag) {
127084     e = (*v)(p->_pytag, a); if (e) return e;
127085   }
127086   return 0;
127087 }
127088
127089 static int __pyx_tp_clear_4lxml_5etree_AttributeBasedElementClassLookup(PyObject *o) {
127090   struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *p = (struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)o;
127091   PyObject* tmp;
127092   __pyx_tp_clear_4lxml_5etree_FallbackElementClassLookup(o);
127093   tmp = ((PyObject*)p->_class_mapping);
127094   p->_class_mapping = Py_None; Py_INCREF(Py_None);
127095   Py_XDECREF(tmp);
127096   tmp = ((PyObject*)p->_pytag);
127097   p->_pytag = Py_None; Py_INCREF(Py_None);
127098   Py_XDECREF(tmp);
127099   return 0;
127100 }
127101
127102 static struct PyMethodDef __pyx_methods_4lxml_5etree_AttributeBasedElementClassLookup[] = {
127103   {0, 0, 0, 0}
127104 };
127105
127106 static PyNumberMethods __pyx_tp_as_number_AttributeBasedElementClassLookup = {
127107   0, /*nb_add*/
127108   0, /*nb_subtract*/
127109   0, /*nb_multiply*/
127110   #if PY_MAJOR_VERSION < 3
127111   0, /*nb_divide*/
127112   #endif
127113   0, /*nb_remainder*/
127114   0, /*nb_divmod*/
127115   0, /*nb_power*/
127116   0, /*nb_negative*/
127117   0, /*nb_positive*/
127118   0, /*nb_absolute*/
127119   0, /*nb_nonzero*/
127120   0, /*nb_invert*/
127121   0, /*nb_lshift*/
127122   0, /*nb_rshift*/
127123   0, /*nb_and*/
127124   0, /*nb_xor*/
127125   0, /*nb_or*/
127126   #if PY_MAJOR_VERSION < 3
127127   0, /*nb_coerce*/
127128   #endif
127129   0, /*nb_int*/
127130   #if PY_MAJOR_VERSION >= 3
127131   0, /*reserved*/
127132   #else
127133   0, /*nb_long*/
127134   #endif
127135   0, /*nb_float*/
127136   #if PY_MAJOR_VERSION < 3
127137   0, /*nb_oct*/
127138   #endif
127139   #if PY_MAJOR_VERSION < 3
127140   0, /*nb_hex*/
127141   #endif
127142   0, /*nb_inplace_add*/
127143   0, /*nb_inplace_subtract*/
127144   0, /*nb_inplace_multiply*/
127145   #if PY_MAJOR_VERSION < 3
127146   0, /*nb_inplace_divide*/
127147   #endif
127148   0, /*nb_inplace_remainder*/
127149   0, /*nb_inplace_power*/
127150   0, /*nb_inplace_lshift*/
127151   0, /*nb_inplace_rshift*/
127152   0, /*nb_inplace_and*/
127153   0, /*nb_inplace_xor*/
127154   0, /*nb_inplace_or*/
127155   0, /*nb_floor_divide*/
127156   0, /*nb_true_divide*/
127157   0, /*nb_inplace_floor_divide*/
127158   0, /*nb_inplace_true_divide*/
127159   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
127160   0, /*nb_index*/
127161   #endif
127162 };
127163
127164 static PySequenceMethods __pyx_tp_as_sequence_AttributeBasedElementClassLookup = {
127165   0, /*sq_length*/
127166   0, /*sq_concat*/
127167   0, /*sq_repeat*/
127168   0, /*sq_item*/
127169   0, /*sq_slice*/
127170   0, /*sq_ass_item*/
127171   0, /*sq_ass_slice*/
127172   0, /*sq_contains*/
127173   0, /*sq_inplace_concat*/
127174   0, /*sq_inplace_repeat*/
127175 };
127176
127177 static PyMappingMethods __pyx_tp_as_mapping_AttributeBasedElementClassLookup = {
127178   0, /*mp_length*/
127179   0, /*mp_subscript*/
127180   0, /*mp_ass_subscript*/
127181 };
127182
127183 static PyBufferProcs __pyx_tp_as_buffer_AttributeBasedElementClassLookup = {
127184   #if PY_MAJOR_VERSION < 3
127185   0, /*bf_getreadbuffer*/
127186   #endif
127187   #if PY_MAJOR_VERSION < 3
127188   0, /*bf_getwritebuffer*/
127189   #endif
127190   #if PY_MAJOR_VERSION < 3
127191   0, /*bf_getsegcount*/
127192   #endif
127193   #if PY_MAJOR_VERSION < 3
127194   0, /*bf_getcharbuffer*/
127195   #endif
127196   #if PY_VERSION_HEX >= 0x02060000
127197   0, /*bf_getbuffer*/
127198   #endif
127199   #if PY_VERSION_HEX >= 0x02060000
127200   0, /*bf_releasebuffer*/
127201   #endif
127202 };
127203
127204 PyTypeObject __pyx_type_4lxml_5etree_AttributeBasedElementClassLookup = {
127205   PyVarObject_HEAD_INIT(0, 0)
127206   __Pyx_NAMESTR("lxml.etree.AttributeBasedElementClassLookup"), /*tp_name*/
127207   sizeof(struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup), /*tp_basicsize*/
127208   0, /*tp_itemsize*/
127209   __pyx_tp_dealloc_4lxml_5etree_AttributeBasedElementClassLookup, /*tp_dealloc*/
127210   0, /*tp_print*/
127211   0, /*tp_getattr*/
127212   0, /*tp_setattr*/
127213   0, /*tp_compare*/
127214   0, /*tp_repr*/
127215   &__pyx_tp_as_number_AttributeBasedElementClassLookup, /*tp_as_number*/
127216   &__pyx_tp_as_sequence_AttributeBasedElementClassLookup, /*tp_as_sequence*/
127217   &__pyx_tp_as_mapping_AttributeBasedElementClassLookup, /*tp_as_mapping*/
127218   0, /*tp_hash*/
127219   0, /*tp_call*/
127220   0, /*tp_str*/
127221   0, /*tp_getattro*/
127222   0, /*tp_setattro*/
127223   &__pyx_tp_as_buffer_AttributeBasedElementClassLookup, /*tp_as_buffer*/
127224   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
127225   __Pyx_DOCSTR("AttributeBasedElementClassLookup(self, attribute_name, class_mapping, fallback=None)\n    Checks an attribute of an Element and looks up the value in a\n    class dictionary.\n\n    Arguments:\n      - attribute name - '{ns}name' style string\n      - class mapping  - Python dict mapping attribute values to Element classes\n      - fallback       - optional fallback lookup mechanism\n\n    A None key in the class mapping will be checked if the attribute is\n    missing.\n    "), /*tp_doc*/
127226   __pyx_tp_traverse_4lxml_5etree_AttributeBasedElementClassLookup, /*tp_traverse*/
127227   __pyx_tp_clear_4lxml_5etree_AttributeBasedElementClassLookup, /*tp_clear*/
127228   0, /*tp_richcompare*/
127229   0, /*tp_weaklistoffset*/
127230   0, /*tp_iter*/
127231   0, /*tp_iternext*/
127232   __pyx_methods_4lxml_5etree_AttributeBasedElementClassLookup, /*tp_methods*/
127233   0, /*tp_members*/
127234   0, /*tp_getset*/
127235   0, /*tp_base*/
127236   0, /*tp_dict*/
127237   0, /*tp_descr_get*/
127238   0, /*tp_descr_set*/
127239   0, /*tp_dictoffset*/
127240   __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup___init__, /*tp_init*/
127241   0, /*tp_alloc*/
127242   __pyx_tp_new_4lxml_5etree_AttributeBasedElementClassLookup, /*tp_new*/
127243   0, /*tp_free*/
127244   0, /*tp_is_gc*/
127245   0, /*tp_bases*/
127246   0, /*tp_mro*/
127247   0, /*tp_cache*/
127248   0, /*tp_subclasses*/
127249   0, /*tp_weaklist*/
127250 };
127251 static struct __pyx_vtabstruct_4lxml_5etree_ParserBasedElementClassLookup __pyx_vtable_4lxml_5etree_ParserBasedElementClassLookup;
127252
127253 static PyObject *__pyx_tp_new_4lxml_5etree_ParserBasedElementClassLookup(PyTypeObject *t, PyObject *a, PyObject *k) {
127254   struct __pyx_obj_4lxml_5etree_ParserBasedElementClassLookup *p;
127255   PyObject *o = __pyx_tp_new_4lxml_5etree_FallbackElementClassLookup(t, a, k);
127256   if (!o) return 0;
127257   p = ((struct __pyx_obj_4lxml_5etree_ParserBasedElementClassLookup *)o);
127258   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup*)__pyx_vtabptr_4lxml_5etree_ParserBasedElementClassLookup;
127259   if (__pyx_pf_4lxml_5etree_29ParserBasedElementClassLookup___cinit__(o, __pyx_empty_tuple, NULL) < 0) {
127260     Py_DECREF(o); o = 0;
127261   }
127262   return o;
127263 }
127264
127265 static struct PyMethodDef __pyx_methods_4lxml_5etree_ParserBasedElementClassLookup[] = {
127266   {0, 0, 0, 0}
127267 };
127268
127269 static PyNumberMethods __pyx_tp_as_number_ParserBasedElementClassLookup = {
127270   0, /*nb_add*/
127271   0, /*nb_subtract*/
127272   0, /*nb_multiply*/
127273   #if PY_MAJOR_VERSION < 3
127274   0, /*nb_divide*/
127275   #endif
127276   0, /*nb_remainder*/
127277   0, /*nb_divmod*/
127278   0, /*nb_power*/
127279   0, /*nb_negative*/
127280   0, /*nb_positive*/
127281   0, /*nb_absolute*/
127282   0, /*nb_nonzero*/
127283   0, /*nb_invert*/
127284   0, /*nb_lshift*/
127285   0, /*nb_rshift*/
127286   0, /*nb_and*/
127287   0, /*nb_xor*/
127288   0, /*nb_or*/
127289   #if PY_MAJOR_VERSION < 3
127290   0, /*nb_coerce*/
127291   #endif
127292   0, /*nb_int*/
127293   #if PY_MAJOR_VERSION >= 3
127294   0, /*reserved*/
127295   #else
127296   0, /*nb_long*/
127297   #endif
127298   0, /*nb_float*/
127299   #if PY_MAJOR_VERSION < 3
127300   0, /*nb_oct*/
127301   #endif
127302   #if PY_MAJOR_VERSION < 3
127303   0, /*nb_hex*/
127304   #endif
127305   0, /*nb_inplace_add*/
127306   0, /*nb_inplace_subtract*/
127307   0, /*nb_inplace_multiply*/
127308   #if PY_MAJOR_VERSION < 3
127309   0, /*nb_inplace_divide*/
127310   #endif
127311   0, /*nb_inplace_remainder*/
127312   0, /*nb_inplace_power*/
127313   0, /*nb_inplace_lshift*/
127314   0, /*nb_inplace_rshift*/
127315   0, /*nb_inplace_and*/
127316   0, /*nb_inplace_xor*/
127317   0, /*nb_inplace_or*/
127318   0, /*nb_floor_divide*/
127319   0, /*nb_true_divide*/
127320   0, /*nb_inplace_floor_divide*/
127321   0, /*nb_inplace_true_divide*/
127322   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
127323   0, /*nb_index*/
127324   #endif
127325 };
127326
127327 static PySequenceMethods __pyx_tp_as_sequence_ParserBasedElementClassLookup = {
127328   0, /*sq_length*/
127329   0, /*sq_concat*/
127330   0, /*sq_repeat*/
127331   0, /*sq_item*/
127332   0, /*sq_slice*/
127333   0, /*sq_ass_item*/
127334   0, /*sq_ass_slice*/
127335   0, /*sq_contains*/
127336   0, /*sq_inplace_concat*/
127337   0, /*sq_inplace_repeat*/
127338 };
127339
127340 static PyMappingMethods __pyx_tp_as_mapping_ParserBasedElementClassLookup = {
127341   0, /*mp_length*/
127342   0, /*mp_subscript*/
127343   0, /*mp_ass_subscript*/
127344 };
127345
127346 static PyBufferProcs __pyx_tp_as_buffer_ParserBasedElementClassLookup = {
127347   #if PY_MAJOR_VERSION < 3
127348   0, /*bf_getreadbuffer*/
127349   #endif
127350   #if PY_MAJOR_VERSION < 3
127351   0, /*bf_getwritebuffer*/
127352   #endif
127353   #if PY_MAJOR_VERSION < 3
127354   0, /*bf_getsegcount*/
127355   #endif
127356   #if PY_MAJOR_VERSION < 3
127357   0, /*bf_getcharbuffer*/
127358   #endif
127359   #if PY_VERSION_HEX >= 0x02060000
127360   0, /*bf_getbuffer*/
127361   #endif
127362   #if PY_VERSION_HEX >= 0x02060000
127363   0, /*bf_releasebuffer*/
127364   #endif
127365 };
127366
127367 PyTypeObject __pyx_type_4lxml_5etree_ParserBasedElementClassLookup = {
127368   PyVarObject_HEAD_INIT(0, 0)
127369   __Pyx_NAMESTR("lxml.etree.ParserBasedElementClassLookup"), /*tp_name*/
127370   sizeof(struct __pyx_obj_4lxml_5etree_ParserBasedElementClassLookup), /*tp_basicsize*/
127371   0, /*tp_itemsize*/
127372   __pyx_tp_dealloc_4lxml_5etree_FallbackElementClassLookup, /*tp_dealloc*/
127373   0, /*tp_print*/
127374   0, /*tp_getattr*/
127375   0, /*tp_setattr*/
127376   0, /*tp_compare*/
127377   0, /*tp_repr*/
127378   &__pyx_tp_as_number_ParserBasedElementClassLookup, /*tp_as_number*/
127379   &__pyx_tp_as_sequence_ParserBasedElementClassLookup, /*tp_as_sequence*/
127380   &__pyx_tp_as_mapping_ParserBasedElementClassLookup, /*tp_as_mapping*/
127381   0, /*tp_hash*/
127382   0, /*tp_call*/
127383   0, /*tp_str*/
127384   0, /*tp_getattro*/
127385   0, /*tp_setattro*/
127386   &__pyx_tp_as_buffer_ParserBasedElementClassLookup, /*tp_as_buffer*/
127387   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
127388   __Pyx_DOCSTR("ParserBasedElementClassLookup(self, fallback=None)\n    Element class lookup based on the XML parser.\n    "), /*tp_doc*/
127389   __pyx_tp_traverse_4lxml_5etree_FallbackElementClassLookup, /*tp_traverse*/
127390   __pyx_tp_clear_4lxml_5etree_FallbackElementClassLookup, /*tp_clear*/
127391   0, /*tp_richcompare*/
127392   0, /*tp_weaklistoffset*/
127393   0, /*tp_iter*/
127394   0, /*tp_iternext*/
127395   __pyx_methods_4lxml_5etree_ParserBasedElementClassLookup, /*tp_methods*/
127396   0, /*tp_members*/
127397   0, /*tp_getset*/
127398   0, /*tp_base*/
127399   0, /*tp_dict*/
127400   0, /*tp_descr_get*/
127401   0, /*tp_descr_set*/
127402   0, /*tp_dictoffset*/
127403   0, /*tp_init*/
127404   0, /*tp_alloc*/
127405   __pyx_tp_new_4lxml_5etree_ParserBasedElementClassLookup, /*tp_new*/
127406   0, /*tp_free*/
127407   0, /*tp_is_gc*/
127408   0, /*tp_bases*/
127409   0, /*tp_mro*/
127410   0, /*tp_cache*/
127411   0, /*tp_subclasses*/
127412   0, /*tp_weaklist*/
127413 };
127414 static struct __pyx_vtabstruct_4lxml_5etree_CustomElementClassLookup __pyx_vtable_4lxml_5etree_CustomElementClassLookup;
127415
127416 static PyObject *__pyx_tp_new_4lxml_5etree_CustomElementClassLookup(PyTypeObject *t, PyObject *a, PyObject *k) {
127417   struct __pyx_obj_4lxml_5etree_CustomElementClassLookup *p;
127418   PyObject *o = __pyx_tp_new_4lxml_5etree_FallbackElementClassLookup(t, a, k);
127419   if (!o) return 0;
127420   p = ((struct __pyx_obj_4lxml_5etree_CustomElementClassLookup *)o);
127421   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup*)__pyx_vtabptr_4lxml_5etree_CustomElementClassLookup;
127422   if (__pyx_pf_4lxml_5etree_24CustomElementClassLookup___cinit__(o, __pyx_empty_tuple, NULL) < 0) {
127423     Py_DECREF(o); o = 0;
127424   }
127425   return o;
127426 }
127427
127428 static struct PyMethodDef __pyx_methods_4lxml_5etree_CustomElementClassLookup[] = {
127429   {__Pyx_NAMESTR("lookup"), (PyCFunction)__pyx_pf_4lxml_5etree_24CustomElementClassLookup_lookup, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_24CustomElementClassLookup_lookup)},
127430   {0, 0, 0, 0}
127431 };
127432
127433 static PyNumberMethods __pyx_tp_as_number_CustomElementClassLookup = {
127434   0, /*nb_add*/
127435   0, /*nb_subtract*/
127436   0, /*nb_multiply*/
127437   #if PY_MAJOR_VERSION < 3
127438   0, /*nb_divide*/
127439   #endif
127440   0, /*nb_remainder*/
127441   0, /*nb_divmod*/
127442   0, /*nb_power*/
127443   0, /*nb_negative*/
127444   0, /*nb_positive*/
127445   0, /*nb_absolute*/
127446   0, /*nb_nonzero*/
127447   0, /*nb_invert*/
127448   0, /*nb_lshift*/
127449   0, /*nb_rshift*/
127450   0, /*nb_and*/
127451   0, /*nb_xor*/
127452   0, /*nb_or*/
127453   #if PY_MAJOR_VERSION < 3
127454   0, /*nb_coerce*/
127455   #endif
127456   0, /*nb_int*/
127457   #if PY_MAJOR_VERSION >= 3
127458   0, /*reserved*/
127459   #else
127460   0, /*nb_long*/
127461   #endif
127462   0, /*nb_float*/
127463   #if PY_MAJOR_VERSION < 3
127464   0, /*nb_oct*/
127465   #endif
127466   #if PY_MAJOR_VERSION < 3
127467   0, /*nb_hex*/
127468   #endif
127469   0, /*nb_inplace_add*/
127470   0, /*nb_inplace_subtract*/
127471   0, /*nb_inplace_multiply*/
127472   #if PY_MAJOR_VERSION < 3
127473   0, /*nb_inplace_divide*/
127474   #endif
127475   0, /*nb_inplace_remainder*/
127476   0, /*nb_inplace_power*/
127477   0, /*nb_inplace_lshift*/
127478   0, /*nb_inplace_rshift*/
127479   0, /*nb_inplace_and*/
127480   0, /*nb_inplace_xor*/
127481   0, /*nb_inplace_or*/
127482   0, /*nb_floor_divide*/
127483   0, /*nb_true_divide*/
127484   0, /*nb_inplace_floor_divide*/
127485   0, /*nb_inplace_true_divide*/
127486   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
127487   0, /*nb_index*/
127488   #endif
127489 };
127490
127491 static PySequenceMethods __pyx_tp_as_sequence_CustomElementClassLookup = {
127492   0, /*sq_length*/
127493   0, /*sq_concat*/
127494   0, /*sq_repeat*/
127495   0, /*sq_item*/
127496   0, /*sq_slice*/
127497   0, /*sq_ass_item*/
127498   0, /*sq_ass_slice*/
127499   0, /*sq_contains*/
127500   0, /*sq_inplace_concat*/
127501   0, /*sq_inplace_repeat*/
127502 };
127503
127504 static PyMappingMethods __pyx_tp_as_mapping_CustomElementClassLookup = {
127505   0, /*mp_length*/
127506   0, /*mp_subscript*/
127507   0, /*mp_ass_subscript*/
127508 };
127509
127510 static PyBufferProcs __pyx_tp_as_buffer_CustomElementClassLookup = {
127511   #if PY_MAJOR_VERSION < 3
127512   0, /*bf_getreadbuffer*/
127513   #endif
127514   #if PY_MAJOR_VERSION < 3
127515   0, /*bf_getwritebuffer*/
127516   #endif
127517   #if PY_MAJOR_VERSION < 3
127518   0, /*bf_getsegcount*/
127519   #endif
127520   #if PY_MAJOR_VERSION < 3
127521   0, /*bf_getcharbuffer*/
127522   #endif
127523   #if PY_VERSION_HEX >= 0x02060000
127524   0, /*bf_getbuffer*/
127525   #endif
127526   #if PY_VERSION_HEX >= 0x02060000
127527   0, /*bf_releasebuffer*/
127528   #endif
127529 };
127530
127531 PyTypeObject __pyx_type_4lxml_5etree_CustomElementClassLookup = {
127532   PyVarObject_HEAD_INIT(0, 0)
127533   __Pyx_NAMESTR("lxml.etree.CustomElementClassLookup"), /*tp_name*/
127534   sizeof(struct __pyx_obj_4lxml_5etree_CustomElementClassLookup), /*tp_basicsize*/
127535   0, /*tp_itemsize*/
127536   __pyx_tp_dealloc_4lxml_5etree_FallbackElementClassLookup, /*tp_dealloc*/
127537   0, /*tp_print*/
127538   0, /*tp_getattr*/
127539   0, /*tp_setattr*/
127540   0, /*tp_compare*/
127541   0, /*tp_repr*/
127542   &__pyx_tp_as_number_CustomElementClassLookup, /*tp_as_number*/
127543   &__pyx_tp_as_sequence_CustomElementClassLookup, /*tp_as_sequence*/
127544   &__pyx_tp_as_mapping_CustomElementClassLookup, /*tp_as_mapping*/
127545   0, /*tp_hash*/
127546   0, /*tp_call*/
127547   0, /*tp_str*/
127548   0, /*tp_getattro*/
127549   0, /*tp_setattro*/
127550   &__pyx_tp_as_buffer_CustomElementClassLookup, /*tp_as_buffer*/
127551   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
127552   __Pyx_DOCSTR("CustomElementClassLookup(self, fallback=None)\n    Element class lookup based on a subclass method.\n\n    You can inherit from this class and override the method::\n\n        lookup(self, type, doc, namespace, name)\n\n    to lookup the element class for a node. Arguments of the method:\n    * type:      one of 'element', 'comment', 'PI', 'entity'\n    * doc:       document that the node is in\n    * namespace: namespace URI of the node (or None for comments/PIs/entities)\n    * name:      name of the element/entity, None for comments, target for PIs\n\n    If you return None from this method, the fallback will be called.\n    "), /*tp_doc*/
127553   __pyx_tp_traverse_4lxml_5etree_FallbackElementClassLookup, /*tp_traverse*/
127554   __pyx_tp_clear_4lxml_5etree_FallbackElementClassLookup, /*tp_clear*/
127555   0, /*tp_richcompare*/
127556   0, /*tp_weaklistoffset*/
127557   0, /*tp_iter*/
127558   0, /*tp_iternext*/
127559   __pyx_methods_4lxml_5etree_CustomElementClassLookup, /*tp_methods*/
127560   0, /*tp_members*/
127561   0, /*tp_getset*/
127562   0, /*tp_base*/
127563   0, /*tp_dict*/
127564   0, /*tp_descr_get*/
127565   0, /*tp_descr_set*/
127566   0, /*tp_dictoffset*/
127567   0, /*tp_init*/
127568   0, /*tp_alloc*/
127569   __pyx_tp_new_4lxml_5etree_CustomElementClassLookup, /*tp_new*/
127570   0, /*tp_free*/
127571   0, /*tp_is_gc*/
127572   0, /*tp_bases*/
127573   0, /*tp_mro*/
127574   0, /*tp_cache*/
127575   0, /*tp_subclasses*/
127576   0, /*tp_weaklist*/
127577 };
127578 static struct __pyx_vtabstruct_4lxml_5etree_PythonElementClassLookup __pyx_vtable_4lxml_5etree_PythonElementClassLookup;
127579
127580 static PyObject *__pyx_tp_new_4lxml_5etree_PythonElementClassLookup(PyTypeObject *t, PyObject *a, PyObject *k) {
127581   struct __pyx_obj_4lxml_5etree_PythonElementClassLookup *p;
127582   PyObject *o = __pyx_tp_new_4lxml_5etree_FallbackElementClassLookup(t, a, k);
127583   if (!o) return 0;
127584   p = ((struct __pyx_obj_4lxml_5etree_PythonElementClassLookup *)o);
127585   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup*)__pyx_vtabptr_4lxml_5etree_PythonElementClassLookup;
127586   if (__pyx_pf_4lxml_5etree_24PythonElementClassLookup___cinit__(o, __pyx_empty_tuple, NULL) < 0) {
127587     Py_DECREF(o); o = 0;
127588   }
127589   return o;
127590 }
127591
127592 static struct PyMethodDef __pyx_methods_4lxml_5etree_PythonElementClassLookup[] = {
127593   {__Pyx_NAMESTR("lookup"), (PyCFunction)__pyx_pf_4lxml_5etree_24PythonElementClassLookup_lookup, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_24PythonElementClassLookup_lookup)},
127594   {0, 0, 0, 0}
127595 };
127596
127597 static PyNumberMethods __pyx_tp_as_number_PythonElementClassLookup = {
127598   0, /*nb_add*/
127599   0, /*nb_subtract*/
127600   0, /*nb_multiply*/
127601   #if PY_MAJOR_VERSION < 3
127602   0, /*nb_divide*/
127603   #endif
127604   0, /*nb_remainder*/
127605   0, /*nb_divmod*/
127606   0, /*nb_power*/
127607   0, /*nb_negative*/
127608   0, /*nb_positive*/
127609   0, /*nb_absolute*/
127610   0, /*nb_nonzero*/
127611   0, /*nb_invert*/
127612   0, /*nb_lshift*/
127613   0, /*nb_rshift*/
127614   0, /*nb_and*/
127615   0, /*nb_xor*/
127616   0, /*nb_or*/
127617   #if PY_MAJOR_VERSION < 3
127618   0, /*nb_coerce*/
127619   #endif
127620   0, /*nb_int*/
127621   #if PY_MAJOR_VERSION >= 3
127622   0, /*reserved*/
127623   #else
127624   0, /*nb_long*/
127625   #endif
127626   0, /*nb_float*/
127627   #if PY_MAJOR_VERSION < 3
127628   0, /*nb_oct*/
127629   #endif
127630   #if PY_MAJOR_VERSION < 3
127631   0, /*nb_hex*/
127632   #endif
127633   0, /*nb_inplace_add*/
127634   0, /*nb_inplace_subtract*/
127635   0, /*nb_inplace_multiply*/
127636   #if PY_MAJOR_VERSION < 3
127637   0, /*nb_inplace_divide*/
127638   #endif
127639   0, /*nb_inplace_remainder*/
127640   0, /*nb_inplace_power*/
127641   0, /*nb_inplace_lshift*/
127642   0, /*nb_inplace_rshift*/
127643   0, /*nb_inplace_and*/
127644   0, /*nb_inplace_xor*/
127645   0, /*nb_inplace_or*/
127646   0, /*nb_floor_divide*/
127647   0, /*nb_true_divide*/
127648   0, /*nb_inplace_floor_divide*/
127649   0, /*nb_inplace_true_divide*/
127650   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
127651   0, /*nb_index*/
127652   #endif
127653 };
127654
127655 static PySequenceMethods __pyx_tp_as_sequence_PythonElementClassLookup = {
127656   0, /*sq_length*/
127657   0, /*sq_concat*/
127658   0, /*sq_repeat*/
127659   0, /*sq_item*/
127660   0, /*sq_slice*/
127661   0, /*sq_ass_item*/
127662   0, /*sq_ass_slice*/
127663   0, /*sq_contains*/
127664   0, /*sq_inplace_concat*/
127665   0, /*sq_inplace_repeat*/
127666 };
127667
127668 static PyMappingMethods __pyx_tp_as_mapping_PythonElementClassLookup = {
127669   0, /*mp_length*/
127670   0, /*mp_subscript*/
127671   0, /*mp_ass_subscript*/
127672 };
127673
127674 static PyBufferProcs __pyx_tp_as_buffer_PythonElementClassLookup = {
127675   #if PY_MAJOR_VERSION < 3
127676   0, /*bf_getreadbuffer*/
127677   #endif
127678   #if PY_MAJOR_VERSION < 3
127679   0, /*bf_getwritebuffer*/
127680   #endif
127681   #if PY_MAJOR_VERSION < 3
127682   0, /*bf_getsegcount*/
127683   #endif
127684   #if PY_MAJOR_VERSION < 3
127685   0, /*bf_getcharbuffer*/
127686   #endif
127687   #if PY_VERSION_HEX >= 0x02060000
127688   0, /*bf_getbuffer*/
127689   #endif
127690   #if PY_VERSION_HEX >= 0x02060000
127691   0, /*bf_releasebuffer*/
127692   #endif
127693 };
127694
127695 PyTypeObject __pyx_type_4lxml_5etree_PythonElementClassLookup = {
127696   PyVarObject_HEAD_INIT(0, 0)
127697   __Pyx_NAMESTR("lxml.etree.PythonElementClassLookup"), /*tp_name*/
127698   sizeof(struct __pyx_obj_4lxml_5etree_PythonElementClassLookup), /*tp_basicsize*/
127699   0, /*tp_itemsize*/
127700   __pyx_tp_dealloc_4lxml_5etree_FallbackElementClassLookup, /*tp_dealloc*/
127701   0, /*tp_print*/
127702   0, /*tp_getattr*/
127703   0, /*tp_setattr*/
127704   0, /*tp_compare*/
127705   0, /*tp_repr*/
127706   &__pyx_tp_as_number_PythonElementClassLookup, /*tp_as_number*/
127707   &__pyx_tp_as_sequence_PythonElementClassLookup, /*tp_as_sequence*/
127708   &__pyx_tp_as_mapping_PythonElementClassLookup, /*tp_as_mapping*/
127709   0, /*tp_hash*/
127710   0, /*tp_call*/
127711   0, /*tp_str*/
127712   0, /*tp_getattro*/
127713   0, /*tp_setattro*/
127714   &__pyx_tp_as_buffer_PythonElementClassLookup, /*tp_as_buffer*/
127715   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
127716   __Pyx_DOCSTR("PythonElementClassLookup(self, fallback=None)\n    Element class lookup based on a subclass method.\n\n    This class lookup scheme allows access to the entire XML tree in\n    read-only mode.  To use it, re-implement the ``lookup(self, doc,\n    root)`` method in a subclass::\n\n        >>> from lxml import etree, pyclasslookup\n        >>>\n        >>> class MyElementClass(etree.ElementBase):\n        ...     honkey = True\n        ...\n        >>> class MyLookup(pyclasslookup.PythonElementClassLookup):\n        ...     def lookup(self, doc, root):\n        ...         if root.tag == \"sometag\":\n        ...             return MyElementClass\n        ...         else:\n        ...             for child in root:\n        ...                 if child.tag == \"someothertag\":\n        ...                     return MyElementClass\n        ...         # delegate to default\n        ...         return None\n\n    If you return None from this method, the fallback will be called.\n\n    The first argument is the opaque document instance that contains\n    the Element.  The second argument is a lightweight Element proxy\n    implementation that is only valid during the lookup.  Do not try\n    to keep a reference to it.  Once the lookup is done, the proxy\n    will be invalid.\n\n    Also, you cannot wrap such a read-only Element in an ElementTree,\n    and you must take care not to keep a reference to them outside of\n    the `lookup()` method.\n\n    Note that the API of the Element objects is not complete.  It is\n    purely read-only and does not support all features of the normal\n    `lxml.etree` API (such as XPath, extended slicing or some\n    iteration methods).\n\n    See http://codespeak.net/lxml/element_classes.html\n    "), /*tp_doc*/
127717   __pyx_tp_traverse_4lxml_5etree_FallbackElementClassLookup, /*tp_traverse*/
127718   __pyx_tp_clear_4lxml_5etree_FallbackElementClassLookup, /*tp_clear*/
127719   0, /*tp_richcompare*/
127720   0, /*tp_weaklistoffset*/
127721   0, /*tp_iter*/
127722   0, /*tp_iternext*/
127723   __pyx_methods_4lxml_5etree_PythonElementClassLookup, /*tp_methods*/
127724   0, /*tp_members*/
127725   0, /*tp_getset*/
127726   0, /*tp_base*/
127727   0, /*tp_dict*/
127728   0, /*tp_descr_get*/
127729   0, /*tp_descr_set*/
127730   0, /*tp_dictoffset*/
127731   0, /*tp_init*/
127732   0, /*tp_alloc*/
127733   __pyx_tp_new_4lxml_5etree_PythonElementClassLookup, /*tp_new*/
127734   0, /*tp_free*/
127735   0, /*tp_is_gc*/
127736   0, /*tp_bases*/
127737   0, /*tp_mro*/
127738   0, /*tp_cache*/
127739   0, /*tp_subclasses*/
127740   0, /*tp_weaklist*/
127741 };
127742 static struct __pyx_vtabstruct_4lxml_5etree__NamespaceRegistry __pyx_vtable_4lxml_5etree__NamespaceRegistry;
127743
127744 static PyObject *__pyx_tp_new_4lxml_5etree__NamespaceRegistry(PyTypeObject *t, PyObject *a, PyObject *k) {
127745   struct __pyx_obj_4lxml_5etree__NamespaceRegistry *p;
127746   PyObject *o = (*t->tp_alloc)(t, 0);
127747   if (!o) return 0;
127748   p = ((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)o);
127749   p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__NamespaceRegistry;
127750   p->_ns_uri = Py_None; Py_INCREF(Py_None);
127751   p->_ns_uri_utf = Py_None; Py_INCREF(Py_None);
127752   p->_entries = ((PyObject *)Py_None); Py_INCREF(Py_None);
127753   return o;
127754 }
127755
127756 static void __pyx_tp_dealloc_4lxml_5etree__NamespaceRegistry(PyObject *o) {
127757   struct __pyx_obj_4lxml_5etree__NamespaceRegistry *p = (struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)o;
127758   Py_XDECREF(p->_ns_uri);
127759   Py_XDECREF(p->_ns_uri_utf);
127760   Py_XDECREF(((PyObject *)p->_entries));
127761   (*Py_TYPE(o)->tp_free)(o);
127762 }
127763
127764 static int __pyx_tp_traverse_4lxml_5etree__NamespaceRegistry(PyObject *o, visitproc v, void *a) {
127765   int e;
127766   struct __pyx_obj_4lxml_5etree__NamespaceRegistry *p = (struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)o;
127767   if (p->_ns_uri) {
127768     e = (*v)(p->_ns_uri, a); if (e) return e;
127769   }
127770   if (p->_ns_uri_utf) {
127771     e = (*v)(p->_ns_uri_utf, a); if (e) return e;
127772   }
127773   if (p->_entries) {
127774     e = (*v)(p->_entries, a); if (e) return e;
127775   }
127776   return 0;
127777 }
127778
127779 static int __pyx_tp_clear_4lxml_5etree__NamespaceRegistry(PyObject *o) {
127780   struct __pyx_obj_4lxml_5etree__NamespaceRegistry *p = (struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)o;
127781   PyObject* tmp;
127782   tmp = ((PyObject*)p->_ns_uri);
127783   p->_ns_uri = Py_None; Py_INCREF(Py_None);
127784   Py_XDECREF(tmp);
127785   tmp = ((PyObject*)p->_ns_uri_utf);
127786   p->_ns_uri_utf = Py_None; Py_INCREF(Py_None);
127787   Py_XDECREF(tmp);
127788   tmp = ((PyObject*)p->_entries);
127789   p->_entries = ((PyObject *)Py_None); Py_INCREF(Py_None);
127790   Py_XDECREF(tmp);
127791   return 0;
127792 }
127793 static PyObject *__pyx_sq_item_4lxml_5etree__NamespaceRegistry(PyObject *o, Py_ssize_t i) {
127794   PyObject *r;
127795   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
127796   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
127797   Py_DECREF(x);
127798   return r;
127799 }
127800
127801 static int __pyx_mp_ass_subscript_4lxml_5etree__NamespaceRegistry(PyObject *o, PyObject *i, PyObject *v) {
127802   if (v) {
127803     PyErr_Format(PyExc_NotImplementedError,
127804       "Subscript assignment not supported by %s", Py_TYPE(o)->tp_name);
127805     return -1;
127806   }
127807   else {
127808     return __pyx_pf_4lxml_5etree_18_NamespaceRegistry___delitem__(o, i);
127809   }
127810 }
127811
127812 static struct PyMethodDef __pyx_methods_4lxml_5etree__NamespaceRegistry[] = {
127813   {__Pyx_NAMESTR("update"), (PyCFunction)__pyx_pf_4lxml_5etree_18_NamespaceRegistry_update, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_18_NamespaceRegistry_update)},
127814   {__Pyx_NAMESTR("__getitem__"), (PyCFunction)__pyx_pf_4lxml_5etree_18_NamespaceRegistry___getitem__, METH_O|METH_COEXIST, __Pyx_DOCSTR(0)},
127815   {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_4lxml_5etree_18_NamespaceRegistry___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
127816   {__Pyx_NAMESTR("items"), (PyCFunction)__pyx_pf_4lxml_5etree_18_NamespaceRegistry_items, METH_NOARGS, __Pyx_DOCSTR(0)},
127817   {__Pyx_NAMESTR("iteritems"), (PyCFunction)__pyx_pf_4lxml_5etree_18_NamespaceRegistry_iteritems, METH_NOARGS, __Pyx_DOCSTR(0)},
127818   {__Pyx_NAMESTR("clear"), (PyCFunction)__pyx_pf_4lxml_5etree_18_NamespaceRegistry_clear, METH_NOARGS, __Pyx_DOCSTR(0)},
127819   {0, 0, 0, 0}
127820 };
127821
127822 static PyNumberMethods __pyx_tp_as_number__NamespaceRegistry = {
127823   0, /*nb_add*/
127824   0, /*nb_subtract*/
127825   0, /*nb_multiply*/
127826   #if PY_MAJOR_VERSION < 3
127827   0, /*nb_divide*/
127828   #endif
127829   0, /*nb_remainder*/
127830   0, /*nb_divmod*/
127831   0, /*nb_power*/
127832   0, /*nb_negative*/
127833   0, /*nb_positive*/
127834   0, /*nb_absolute*/
127835   0, /*nb_nonzero*/
127836   0, /*nb_invert*/
127837   0, /*nb_lshift*/
127838   0, /*nb_rshift*/
127839   0, /*nb_and*/
127840   0, /*nb_xor*/
127841   0, /*nb_or*/
127842   #if PY_MAJOR_VERSION < 3
127843   0, /*nb_coerce*/
127844   #endif
127845   0, /*nb_int*/
127846   #if PY_MAJOR_VERSION >= 3
127847   0, /*reserved*/
127848   #else
127849   0, /*nb_long*/
127850   #endif
127851   0, /*nb_float*/
127852   #if PY_MAJOR_VERSION < 3
127853   0, /*nb_oct*/
127854   #endif
127855   #if PY_MAJOR_VERSION < 3
127856   0, /*nb_hex*/
127857   #endif
127858   0, /*nb_inplace_add*/
127859   0, /*nb_inplace_subtract*/
127860   0, /*nb_inplace_multiply*/
127861   #if PY_MAJOR_VERSION < 3
127862   0, /*nb_inplace_divide*/
127863   #endif
127864   0, /*nb_inplace_remainder*/
127865   0, /*nb_inplace_power*/
127866   0, /*nb_inplace_lshift*/
127867   0, /*nb_inplace_rshift*/
127868   0, /*nb_inplace_and*/
127869   0, /*nb_inplace_xor*/
127870   0, /*nb_inplace_or*/
127871   0, /*nb_floor_divide*/
127872   0, /*nb_true_divide*/
127873   0, /*nb_inplace_floor_divide*/
127874   0, /*nb_inplace_true_divide*/
127875   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
127876   0, /*nb_index*/
127877   #endif
127878 };
127879
127880 static PySequenceMethods __pyx_tp_as_sequence__NamespaceRegistry = {
127881   0, /*sq_length*/
127882   0, /*sq_concat*/
127883   0, /*sq_repeat*/
127884   __pyx_sq_item_4lxml_5etree__NamespaceRegistry, /*sq_item*/
127885   0, /*sq_slice*/
127886   0, /*sq_ass_item*/
127887   0, /*sq_ass_slice*/
127888   0, /*sq_contains*/
127889   0, /*sq_inplace_concat*/
127890   0, /*sq_inplace_repeat*/
127891 };
127892
127893 static PyMappingMethods __pyx_tp_as_mapping__NamespaceRegistry = {
127894   0, /*mp_length*/
127895   __pyx_pf_4lxml_5etree_18_NamespaceRegistry___getitem__, /*mp_subscript*/
127896   __pyx_mp_ass_subscript_4lxml_5etree__NamespaceRegistry, /*mp_ass_subscript*/
127897 };
127898
127899 static PyBufferProcs __pyx_tp_as_buffer__NamespaceRegistry = {
127900   #if PY_MAJOR_VERSION < 3
127901   0, /*bf_getreadbuffer*/
127902   #endif
127903   #if PY_MAJOR_VERSION < 3
127904   0, /*bf_getwritebuffer*/
127905   #endif
127906   #if PY_MAJOR_VERSION < 3
127907   0, /*bf_getsegcount*/
127908   #endif
127909   #if PY_MAJOR_VERSION < 3
127910   0, /*bf_getcharbuffer*/
127911   #endif
127912   #if PY_VERSION_HEX >= 0x02060000
127913   0, /*bf_getbuffer*/
127914   #endif
127915   #if PY_VERSION_HEX >= 0x02060000
127916   0, /*bf_releasebuffer*/
127917   #endif
127918 };
127919
127920 PyTypeObject __pyx_type_4lxml_5etree__NamespaceRegistry = {
127921   PyVarObject_HEAD_INIT(0, 0)
127922   __Pyx_NAMESTR("lxml.etree._NamespaceRegistry"), /*tp_name*/
127923   sizeof(struct __pyx_obj_4lxml_5etree__NamespaceRegistry), /*tp_basicsize*/
127924   0, /*tp_itemsize*/
127925   __pyx_tp_dealloc_4lxml_5etree__NamespaceRegistry, /*tp_dealloc*/
127926   0, /*tp_print*/
127927   0, /*tp_getattr*/
127928   0, /*tp_setattr*/
127929   0, /*tp_compare*/
127930   0, /*tp_repr*/
127931   &__pyx_tp_as_number__NamespaceRegistry, /*tp_as_number*/
127932   &__pyx_tp_as_sequence__NamespaceRegistry, /*tp_as_sequence*/
127933   &__pyx_tp_as_mapping__NamespaceRegistry, /*tp_as_mapping*/
127934   0, /*tp_hash*/
127935   0, /*tp_call*/
127936   0, /*tp_str*/
127937   0, /*tp_getattro*/
127938   0, /*tp_setattro*/
127939   &__pyx_tp_as_buffer__NamespaceRegistry, /*tp_as_buffer*/
127940   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
127941   __Pyx_DOCSTR("Dictionary-like namespace registry"), /*tp_doc*/
127942   __pyx_tp_traverse_4lxml_5etree__NamespaceRegistry, /*tp_traverse*/
127943   __pyx_tp_clear_4lxml_5etree__NamespaceRegistry, /*tp_clear*/
127944   0, /*tp_richcompare*/
127945   0, /*tp_weaklistoffset*/
127946   __pyx_pf_4lxml_5etree_18_NamespaceRegistry___iter__, /*tp_iter*/
127947   0, /*tp_iternext*/
127948   __pyx_methods_4lxml_5etree__NamespaceRegistry, /*tp_methods*/
127949   0, /*tp_members*/
127950   0, /*tp_getset*/
127951   0, /*tp_base*/
127952   0, /*tp_dict*/
127953   0, /*tp_descr_get*/
127954   0, /*tp_descr_set*/
127955   0, /*tp_dictoffset*/
127956   __pyx_pf_4lxml_5etree_18_NamespaceRegistry___init__, /*tp_init*/
127957   0, /*tp_alloc*/
127958   __pyx_tp_new_4lxml_5etree__NamespaceRegistry, /*tp_new*/
127959   0, /*tp_free*/
127960   0, /*tp_is_gc*/
127961   0, /*tp_bases*/
127962   0, /*tp_mro*/
127963   0, /*tp_cache*/
127964   0, /*tp_subclasses*/
127965   0, /*tp_weaklist*/
127966 };
127967 static struct __pyx_vtabstruct_4lxml_5etree__ClassNamespaceRegistry __pyx_vtable_4lxml_5etree__ClassNamespaceRegistry;
127968
127969 static PyObject *__pyx_tp_new_4lxml_5etree__ClassNamespaceRegistry(PyTypeObject *t, PyObject *a, PyObject *k) {
127970   struct __pyx_obj_4lxml_5etree__ClassNamespaceRegistry *p;
127971   PyObject *o = __pyx_tp_new_4lxml_5etree__NamespaceRegistry(t, a, k);
127972   if (!o) return 0;
127973   p = ((struct __pyx_obj_4lxml_5etree__ClassNamespaceRegistry *)o);
127974   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__NamespaceRegistry*)__pyx_vtabptr_4lxml_5etree__ClassNamespaceRegistry;
127975   return o;
127976 }
127977
127978 static int __pyx_mp_ass_subscript_4lxml_5etree__ClassNamespaceRegistry(PyObject *o, PyObject *i, PyObject *v) {
127979   if (v) {
127980     return __pyx_pf_4lxml_5etree_23_ClassNamespaceRegistry___setitem__(o, i, v);
127981   }
127982   else {
127983     if (__pyx_ptype_4lxml_5etree__NamespaceRegistry->tp_as_mapping && __pyx_ptype_4lxml_5etree__NamespaceRegistry->tp_as_mapping->mp_ass_subscript)
127984       return __pyx_ptype_4lxml_5etree__NamespaceRegistry->tp_as_mapping->mp_ass_subscript(o, i, v);
127985     PyErr_Format(PyExc_NotImplementedError,
127986       "Subscript deletion not supported by %s", Py_TYPE(o)->tp_name);
127987     return -1;
127988   }
127989 }
127990
127991 static struct PyMethodDef __pyx_methods_4lxml_5etree__ClassNamespaceRegistry[] = {
127992   {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_4lxml_5etree_23_ClassNamespaceRegistry___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
127993   {0, 0, 0, 0}
127994 };
127995
127996 static PyNumberMethods __pyx_tp_as_number__ClassNamespaceRegistry = {
127997   0, /*nb_add*/
127998   0, /*nb_subtract*/
127999   0, /*nb_multiply*/
128000   #if PY_MAJOR_VERSION < 3
128001   0, /*nb_divide*/
128002   #endif
128003   0, /*nb_remainder*/
128004   0, /*nb_divmod*/
128005   0, /*nb_power*/
128006   0, /*nb_negative*/
128007   0, /*nb_positive*/
128008   0, /*nb_absolute*/
128009   0, /*nb_nonzero*/
128010   0, /*nb_invert*/
128011   0, /*nb_lshift*/
128012   0, /*nb_rshift*/
128013   0, /*nb_and*/
128014   0, /*nb_xor*/
128015   0, /*nb_or*/
128016   #if PY_MAJOR_VERSION < 3
128017   0, /*nb_coerce*/
128018   #endif
128019   0, /*nb_int*/
128020   #if PY_MAJOR_VERSION >= 3
128021   0, /*reserved*/
128022   #else
128023   0, /*nb_long*/
128024   #endif
128025   0, /*nb_float*/
128026   #if PY_MAJOR_VERSION < 3
128027   0, /*nb_oct*/
128028   #endif
128029   #if PY_MAJOR_VERSION < 3
128030   0, /*nb_hex*/
128031   #endif
128032   0, /*nb_inplace_add*/
128033   0, /*nb_inplace_subtract*/
128034   0, /*nb_inplace_multiply*/
128035   #if PY_MAJOR_VERSION < 3
128036   0, /*nb_inplace_divide*/
128037   #endif
128038   0, /*nb_inplace_remainder*/
128039   0, /*nb_inplace_power*/
128040   0, /*nb_inplace_lshift*/
128041   0, /*nb_inplace_rshift*/
128042   0, /*nb_inplace_and*/
128043   0, /*nb_inplace_xor*/
128044   0, /*nb_inplace_or*/
128045   0, /*nb_floor_divide*/
128046   0, /*nb_true_divide*/
128047   0, /*nb_inplace_floor_divide*/
128048   0, /*nb_inplace_true_divide*/
128049   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
128050   0, /*nb_index*/
128051   #endif
128052 };
128053
128054 static PySequenceMethods __pyx_tp_as_sequence__ClassNamespaceRegistry = {
128055   0, /*sq_length*/
128056   0, /*sq_concat*/
128057   0, /*sq_repeat*/
128058   0, /*sq_item*/
128059   0, /*sq_slice*/
128060   0, /*sq_ass_item*/
128061   0, /*sq_ass_slice*/
128062   0, /*sq_contains*/
128063   0, /*sq_inplace_concat*/
128064   0, /*sq_inplace_repeat*/
128065 };
128066
128067 static PyMappingMethods __pyx_tp_as_mapping__ClassNamespaceRegistry = {
128068   0, /*mp_length*/
128069   0, /*mp_subscript*/
128070   __pyx_mp_ass_subscript_4lxml_5etree__ClassNamespaceRegistry, /*mp_ass_subscript*/
128071 };
128072
128073 static PyBufferProcs __pyx_tp_as_buffer__ClassNamespaceRegistry = {
128074   #if PY_MAJOR_VERSION < 3
128075   0, /*bf_getreadbuffer*/
128076   #endif
128077   #if PY_MAJOR_VERSION < 3
128078   0, /*bf_getwritebuffer*/
128079   #endif
128080   #if PY_MAJOR_VERSION < 3
128081   0, /*bf_getsegcount*/
128082   #endif
128083   #if PY_MAJOR_VERSION < 3
128084   0, /*bf_getcharbuffer*/
128085   #endif
128086   #if PY_VERSION_HEX >= 0x02060000
128087   0, /*bf_getbuffer*/
128088   #endif
128089   #if PY_VERSION_HEX >= 0x02060000
128090   0, /*bf_releasebuffer*/
128091   #endif
128092 };
128093
128094 PyTypeObject __pyx_type_4lxml_5etree__ClassNamespaceRegistry = {
128095   PyVarObject_HEAD_INIT(0, 0)
128096   __Pyx_NAMESTR("lxml.etree._ClassNamespaceRegistry"), /*tp_name*/
128097   sizeof(struct __pyx_obj_4lxml_5etree__ClassNamespaceRegistry), /*tp_basicsize*/
128098   0, /*tp_itemsize*/
128099   __pyx_tp_dealloc_4lxml_5etree__NamespaceRegistry, /*tp_dealloc*/
128100   0, /*tp_print*/
128101   0, /*tp_getattr*/
128102   0, /*tp_setattr*/
128103   0, /*tp_compare*/
128104   __pyx_pf_4lxml_5etree_23_ClassNamespaceRegistry___repr__, /*tp_repr*/
128105   &__pyx_tp_as_number__ClassNamespaceRegistry, /*tp_as_number*/
128106   &__pyx_tp_as_sequence__ClassNamespaceRegistry, /*tp_as_sequence*/
128107   &__pyx_tp_as_mapping__ClassNamespaceRegistry, /*tp_as_mapping*/
128108   0, /*tp_hash*/
128109   0, /*tp_call*/
128110   0, /*tp_str*/
128111   0, /*tp_getattro*/
128112   0, /*tp_setattro*/
128113   &__pyx_tp_as_buffer__ClassNamespaceRegistry, /*tp_as_buffer*/
128114   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
128115   __Pyx_DOCSTR("Dictionary-like registry for namespace implementation classes"), /*tp_doc*/
128116   __pyx_tp_traverse_4lxml_5etree__NamespaceRegistry, /*tp_traverse*/
128117   __pyx_tp_clear_4lxml_5etree__NamespaceRegistry, /*tp_clear*/
128118   0, /*tp_richcompare*/
128119   0, /*tp_weaklistoffset*/
128120   0, /*tp_iter*/
128121   0, /*tp_iternext*/
128122   __pyx_methods_4lxml_5etree__ClassNamespaceRegistry, /*tp_methods*/
128123   0, /*tp_members*/
128124   0, /*tp_getset*/
128125   0, /*tp_base*/
128126   0, /*tp_dict*/
128127   0, /*tp_descr_get*/
128128   0, /*tp_descr_set*/
128129   0, /*tp_dictoffset*/
128130   0, /*tp_init*/
128131   0, /*tp_alloc*/
128132   __pyx_tp_new_4lxml_5etree__ClassNamespaceRegistry, /*tp_new*/
128133   0, /*tp_free*/
128134   0, /*tp_is_gc*/
128135   0, /*tp_bases*/
128136   0, /*tp_mro*/
128137   0, /*tp_cache*/
128138   0, /*tp_subclasses*/
128139   0, /*tp_weaklist*/
128140 };
128141 static struct __pyx_vtabstruct_4lxml_5etree_ElementNamespaceClassLookup __pyx_vtable_4lxml_5etree_ElementNamespaceClassLookup;
128142
128143 static PyObject *__pyx_tp_new_4lxml_5etree_ElementNamespaceClassLookup(PyTypeObject *t, PyObject *a, PyObject *k) {
128144   struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *p;
128145   PyObject *o = __pyx_tp_new_4lxml_5etree_FallbackElementClassLookup(t, a, k);
128146   if (!o) return 0;
128147   p = ((struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *)o);
128148   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup*)__pyx_vtabptr_4lxml_5etree_ElementNamespaceClassLookup;
128149   p->_namespace_registries = Py_None; Py_INCREF(Py_None);
128150   return o;
128151 }
128152
128153 static void __pyx_tp_dealloc_4lxml_5etree_ElementNamespaceClassLookup(PyObject *o) {
128154   struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *p = (struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *)o;
128155   Py_XDECREF(p->_namespace_registries);
128156   __pyx_tp_dealloc_4lxml_5etree_FallbackElementClassLookup(o);
128157 }
128158
128159 static int __pyx_tp_traverse_4lxml_5etree_ElementNamespaceClassLookup(PyObject *o, visitproc v, void *a) {
128160   int e;
128161   struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *p = (struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *)o;
128162   e = __pyx_tp_traverse_4lxml_5etree_FallbackElementClassLookup(o, v, a); if (e) return e;
128163   if (p->_namespace_registries) {
128164     e = (*v)(p->_namespace_registries, a); if (e) return e;
128165   }
128166   return 0;
128167 }
128168
128169 static int __pyx_tp_clear_4lxml_5etree_ElementNamespaceClassLookup(PyObject *o) {
128170   struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *p = (struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *)o;
128171   PyObject* tmp;
128172   __pyx_tp_clear_4lxml_5etree_FallbackElementClassLookup(o);
128173   tmp = ((PyObject*)p->_namespace_registries);
128174   p->_namespace_registries = Py_None; Py_INCREF(Py_None);
128175   Py_XDECREF(tmp);
128176   return 0;
128177 }
128178
128179 static struct PyMethodDef __pyx_methods_4lxml_5etree_ElementNamespaceClassLookup[] = {
128180   {__Pyx_NAMESTR("get_namespace"), (PyCFunction)__pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup_get_namespace, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_27ElementNamespaceClassLookup_get_namespace)},
128181   {0, 0, 0, 0}
128182 };
128183
128184 static PyNumberMethods __pyx_tp_as_number_ElementNamespaceClassLookup = {
128185   0, /*nb_add*/
128186   0, /*nb_subtract*/
128187   0, /*nb_multiply*/
128188   #if PY_MAJOR_VERSION < 3
128189   0, /*nb_divide*/
128190   #endif
128191   0, /*nb_remainder*/
128192   0, /*nb_divmod*/
128193   0, /*nb_power*/
128194   0, /*nb_negative*/
128195   0, /*nb_positive*/
128196   0, /*nb_absolute*/
128197   0, /*nb_nonzero*/
128198   0, /*nb_invert*/
128199   0, /*nb_lshift*/
128200   0, /*nb_rshift*/
128201   0, /*nb_and*/
128202   0, /*nb_xor*/
128203   0, /*nb_or*/
128204   #if PY_MAJOR_VERSION < 3
128205   0, /*nb_coerce*/
128206   #endif
128207   0, /*nb_int*/
128208   #if PY_MAJOR_VERSION >= 3
128209   0, /*reserved*/
128210   #else
128211   0, /*nb_long*/
128212   #endif
128213   0, /*nb_float*/
128214   #if PY_MAJOR_VERSION < 3
128215   0, /*nb_oct*/
128216   #endif
128217   #if PY_MAJOR_VERSION < 3
128218   0, /*nb_hex*/
128219   #endif
128220   0, /*nb_inplace_add*/
128221   0, /*nb_inplace_subtract*/
128222   0, /*nb_inplace_multiply*/
128223   #if PY_MAJOR_VERSION < 3
128224   0, /*nb_inplace_divide*/
128225   #endif
128226   0, /*nb_inplace_remainder*/
128227   0, /*nb_inplace_power*/
128228   0, /*nb_inplace_lshift*/
128229   0, /*nb_inplace_rshift*/
128230   0, /*nb_inplace_and*/
128231   0, /*nb_inplace_xor*/
128232   0, /*nb_inplace_or*/
128233   0, /*nb_floor_divide*/
128234   0, /*nb_true_divide*/
128235   0, /*nb_inplace_floor_divide*/
128236   0, /*nb_inplace_true_divide*/
128237   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
128238   0, /*nb_index*/
128239   #endif
128240 };
128241
128242 static PySequenceMethods __pyx_tp_as_sequence_ElementNamespaceClassLookup = {
128243   0, /*sq_length*/
128244   0, /*sq_concat*/
128245   0, /*sq_repeat*/
128246   0, /*sq_item*/
128247   0, /*sq_slice*/
128248   0, /*sq_ass_item*/
128249   0, /*sq_ass_slice*/
128250   0, /*sq_contains*/
128251   0, /*sq_inplace_concat*/
128252   0, /*sq_inplace_repeat*/
128253 };
128254
128255 static PyMappingMethods __pyx_tp_as_mapping_ElementNamespaceClassLookup = {
128256   0, /*mp_length*/
128257   0, /*mp_subscript*/
128258   0, /*mp_ass_subscript*/
128259 };
128260
128261 static PyBufferProcs __pyx_tp_as_buffer_ElementNamespaceClassLookup = {
128262   #if PY_MAJOR_VERSION < 3
128263   0, /*bf_getreadbuffer*/
128264   #endif
128265   #if PY_MAJOR_VERSION < 3
128266   0, /*bf_getwritebuffer*/
128267   #endif
128268   #if PY_MAJOR_VERSION < 3
128269   0, /*bf_getsegcount*/
128270   #endif
128271   #if PY_MAJOR_VERSION < 3
128272   0, /*bf_getcharbuffer*/
128273   #endif
128274   #if PY_VERSION_HEX >= 0x02060000
128275   0, /*bf_getbuffer*/
128276   #endif
128277   #if PY_VERSION_HEX >= 0x02060000
128278   0, /*bf_releasebuffer*/
128279   #endif
128280 };
128281
128282 PyTypeObject __pyx_type_4lxml_5etree_ElementNamespaceClassLookup = {
128283   PyVarObject_HEAD_INIT(0, 0)
128284   __Pyx_NAMESTR("lxml.etree.ElementNamespaceClassLookup"), /*tp_name*/
128285   sizeof(struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup), /*tp_basicsize*/
128286   0, /*tp_itemsize*/
128287   __pyx_tp_dealloc_4lxml_5etree_ElementNamespaceClassLookup, /*tp_dealloc*/
128288   0, /*tp_print*/
128289   0, /*tp_getattr*/
128290   0, /*tp_setattr*/
128291   0, /*tp_compare*/
128292   0, /*tp_repr*/
128293   &__pyx_tp_as_number_ElementNamespaceClassLookup, /*tp_as_number*/
128294   &__pyx_tp_as_sequence_ElementNamespaceClassLookup, /*tp_as_sequence*/
128295   &__pyx_tp_as_mapping_ElementNamespaceClassLookup, /*tp_as_mapping*/
128296   0, /*tp_hash*/
128297   0, /*tp_call*/
128298   0, /*tp_str*/
128299   0, /*tp_getattro*/
128300   0, /*tp_setattro*/
128301   &__pyx_tp_as_buffer_ElementNamespaceClassLookup, /*tp_as_buffer*/
128302   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
128303   __Pyx_DOCSTR("ElementNamespaceClassLookup(self, fallback=None)\n\n    Element class lookup scheme that searches the Element class in the\n    Namespace registry.\n    "), /*tp_doc*/
128304   __pyx_tp_traverse_4lxml_5etree_ElementNamespaceClassLookup, /*tp_traverse*/
128305   __pyx_tp_clear_4lxml_5etree_ElementNamespaceClassLookup, /*tp_clear*/
128306   0, /*tp_richcompare*/
128307   0, /*tp_weaklistoffset*/
128308   0, /*tp_iter*/
128309   0, /*tp_iternext*/
128310   __pyx_methods_4lxml_5etree_ElementNamespaceClassLookup, /*tp_methods*/
128311   0, /*tp_members*/
128312   0, /*tp_getset*/
128313   0, /*tp_base*/
128314   0, /*tp_dict*/
128315   0, /*tp_descr_get*/
128316   0, /*tp_descr_set*/
128317   0, /*tp_dictoffset*/
128318   __pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup___init__, /*tp_init*/
128319   0, /*tp_alloc*/
128320   __pyx_tp_new_4lxml_5etree_ElementNamespaceClassLookup, /*tp_new*/
128321   0, /*tp_free*/
128322   0, /*tp_is_gc*/
128323   0, /*tp_bases*/
128324   0, /*tp_mro*/
128325   0, /*tp_cache*/
128326   0, /*tp_subclasses*/
128327   0, /*tp_weaklist*/
128328 };
128329 static struct __pyx_vtabstruct_4lxml_5etree__FunctionNamespaceRegistry __pyx_vtable_4lxml_5etree__FunctionNamespaceRegistry;
128330
128331 static PyObject *__pyx_tp_new_4lxml_5etree__FunctionNamespaceRegistry(PyTypeObject *t, PyObject *a, PyObject *k) {
128332   struct __pyx_obj_4lxml_5etree__FunctionNamespaceRegistry *p;
128333   PyObject *o = __pyx_tp_new_4lxml_5etree__NamespaceRegistry(t, a, k);
128334   if (!o) return 0;
128335   p = ((struct __pyx_obj_4lxml_5etree__FunctionNamespaceRegistry *)o);
128336   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__NamespaceRegistry*)__pyx_vtabptr_4lxml_5etree__FunctionNamespaceRegistry;
128337   return o;
128338 }
128339
128340 static int __pyx_mp_ass_subscript_4lxml_5etree__FunctionNamespaceRegistry(PyObject *o, PyObject *i, PyObject *v) {
128341   if (v) {
128342     return __pyx_pf_4lxml_5etree_26_FunctionNamespaceRegistry___setitem__(o, i, v);
128343   }
128344   else {
128345     if (__pyx_ptype_4lxml_5etree__NamespaceRegistry->tp_as_mapping && __pyx_ptype_4lxml_5etree__NamespaceRegistry->tp_as_mapping->mp_ass_subscript)
128346       return __pyx_ptype_4lxml_5etree__NamespaceRegistry->tp_as_mapping->mp_ass_subscript(o, i, v);
128347     PyErr_Format(PyExc_NotImplementedError,
128348       "Subscript deletion not supported by %s", Py_TYPE(o)->tp_name);
128349     return -1;
128350   }
128351 }
128352
128353 static struct PyMethodDef __pyx_methods_4lxml_5etree__FunctionNamespaceRegistry[] = {
128354   {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_4lxml_5etree_26_FunctionNamespaceRegistry___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
128355   {0, 0, 0, 0}
128356 };
128357
128358 static PyNumberMethods __pyx_tp_as_number__FunctionNamespaceRegistry = {
128359   0, /*nb_add*/
128360   0, /*nb_subtract*/
128361   0, /*nb_multiply*/
128362   #if PY_MAJOR_VERSION < 3
128363   0, /*nb_divide*/
128364   #endif
128365   0, /*nb_remainder*/
128366   0, /*nb_divmod*/
128367   0, /*nb_power*/
128368   0, /*nb_negative*/
128369   0, /*nb_positive*/
128370   0, /*nb_absolute*/
128371   0, /*nb_nonzero*/
128372   0, /*nb_invert*/
128373   0, /*nb_lshift*/
128374   0, /*nb_rshift*/
128375   0, /*nb_and*/
128376   0, /*nb_xor*/
128377   0, /*nb_or*/
128378   #if PY_MAJOR_VERSION < 3
128379   0, /*nb_coerce*/
128380   #endif
128381   0, /*nb_int*/
128382   #if PY_MAJOR_VERSION >= 3
128383   0, /*reserved*/
128384   #else
128385   0, /*nb_long*/
128386   #endif
128387   0, /*nb_float*/
128388   #if PY_MAJOR_VERSION < 3
128389   0, /*nb_oct*/
128390   #endif
128391   #if PY_MAJOR_VERSION < 3
128392   0, /*nb_hex*/
128393   #endif
128394   0, /*nb_inplace_add*/
128395   0, /*nb_inplace_subtract*/
128396   0, /*nb_inplace_multiply*/
128397   #if PY_MAJOR_VERSION < 3
128398   0, /*nb_inplace_divide*/
128399   #endif
128400   0, /*nb_inplace_remainder*/
128401   0, /*nb_inplace_power*/
128402   0, /*nb_inplace_lshift*/
128403   0, /*nb_inplace_rshift*/
128404   0, /*nb_inplace_and*/
128405   0, /*nb_inplace_xor*/
128406   0, /*nb_inplace_or*/
128407   0, /*nb_floor_divide*/
128408   0, /*nb_true_divide*/
128409   0, /*nb_inplace_floor_divide*/
128410   0, /*nb_inplace_true_divide*/
128411   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
128412   0, /*nb_index*/
128413   #endif
128414 };
128415
128416 static PySequenceMethods __pyx_tp_as_sequence__FunctionNamespaceRegistry = {
128417   0, /*sq_length*/
128418   0, /*sq_concat*/
128419   0, /*sq_repeat*/
128420   0, /*sq_item*/
128421   0, /*sq_slice*/
128422   0, /*sq_ass_item*/
128423   0, /*sq_ass_slice*/
128424   0, /*sq_contains*/
128425   0, /*sq_inplace_concat*/
128426   0, /*sq_inplace_repeat*/
128427 };
128428
128429 static PyMappingMethods __pyx_tp_as_mapping__FunctionNamespaceRegistry = {
128430   0, /*mp_length*/
128431   0, /*mp_subscript*/
128432   __pyx_mp_ass_subscript_4lxml_5etree__FunctionNamespaceRegistry, /*mp_ass_subscript*/
128433 };
128434
128435 static PyBufferProcs __pyx_tp_as_buffer__FunctionNamespaceRegistry = {
128436   #if PY_MAJOR_VERSION < 3
128437   0, /*bf_getreadbuffer*/
128438   #endif
128439   #if PY_MAJOR_VERSION < 3
128440   0, /*bf_getwritebuffer*/
128441   #endif
128442   #if PY_MAJOR_VERSION < 3
128443   0, /*bf_getsegcount*/
128444   #endif
128445   #if PY_MAJOR_VERSION < 3
128446   0, /*bf_getcharbuffer*/
128447   #endif
128448   #if PY_VERSION_HEX >= 0x02060000
128449   0, /*bf_getbuffer*/
128450   #endif
128451   #if PY_VERSION_HEX >= 0x02060000
128452   0, /*bf_releasebuffer*/
128453   #endif
128454 };
128455
128456 PyTypeObject __pyx_type_4lxml_5etree__FunctionNamespaceRegistry = {
128457   PyVarObject_HEAD_INIT(0, 0)
128458   __Pyx_NAMESTR("lxml.etree._FunctionNamespaceRegistry"), /*tp_name*/
128459   sizeof(struct __pyx_obj_4lxml_5etree__FunctionNamespaceRegistry), /*tp_basicsize*/
128460   0, /*tp_itemsize*/
128461   __pyx_tp_dealloc_4lxml_5etree__NamespaceRegistry, /*tp_dealloc*/
128462   0, /*tp_print*/
128463   0, /*tp_getattr*/
128464   0, /*tp_setattr*/
128465   0, /*tp_compare*/
128466   __pyx_pf_4lxml_5etree_26_FunctionNamespaceRegistry___repr__, /*tp_repr*/
128467   &__pyx_tp_as_number__FunctionNamespaceRegistry, /*tp_as_number*/
128468   &__pyx_tp_as_sequence__FunctionNamespaceRegistry, /*tp_as_sequence*/
128469   &__pyx_tp_as_mapping__FunctionNamespaceRegistry, /*tp_as_mapping*/
128470   0, /*tp_hash*/
128471   0, /*tp_call*/
128472   0, /*tp_str*/
128473   0, /*tp_getattro*/
128474   0, /*tp_setattro*/
128475   &__pyx_tp_as_buffer__FunctionNamespaceRegistry, /*tp_as_buffer*/
128476   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
128477   0, /*tp_doc*/
128478   __pyx_tp_traverse_4lxml_5etree__NamespaceRegistry, /*tp_traverse*/
128479   __pyx_tp_clear_4lxml_5etree__NamespaceRegistry, /*tp_clear*/
128480   0, /*tp_richcompare*/
128481   0, /*tp_weaklistoffset*/
128482   0, /*tp_iter*/
128483   0, /*tp_iternext*/
128484   __pyx_methods_4lxml_5etree__FunctionNamespaceRegistry, /*tp_methods*/
128485   0, /*tp_members*/
128486   0, /*tp_getset*/
128487   0, /*tp_base*/
128488   0, /*tp_dict*/
128489   0, /*tp_descr_get*/
128490   0, /*tp_descr_set*/
128491   0, /*tp_dictoffset*/
128492   0, /*tp_init*/
128493   0, /*tp_alloc*/
128494   __pyx_tp_new_4lxml_5etree__FunctionNamespaceRegistry, /*tp_new*/
128495   0, /*tp_free*/
128496   0, /*tp_is_gc*/
128497   0, /*tp_bases*/
128498   0, /*tp_mro*/
128499   0, /*tp_cache*/
128500   0, /*tp_subclasses*/
128501   0, /*tp_weaklist*/
128502 };
128503 static struct __pyx_vtabstruct_4lxml_5etree__XPathFunctionNamespaceRegistry __pyx_vtable_4lxml_5etree__XPathFunctionNamespaceRegistry;
128504
128505 static PyObject *__pyx_tp_new_4lxml_5etree__XPathFunctionNamespaceRegistry(PyTypeObject *t, PyObject *a, PyObject *k) {
128506   struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *p;
128507   PyObject *o = __pyx_tp_new_4lxml_5etree__NamespaceRegistry(t, a, k);
128508   if (!o) return 0;
128509   p = ((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)o);
128510   p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__NamespaceRegistry*)__pyx_vtabptr_4lxml_5etree__XPathFunctionNamespaceRegistry;
128511   p->_prefix = Py_None; Py_INCREF(Py_None);
128512   p->_prefix_utf = Py_None; Py_INCREF(Py_None);
128513   return o;
128514 }
128515
128516 static void __pyx_tp_dealloc_4lxml_5etree__XPathFunctionNamespaceRegistry(PyObject *o) {
128517   struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *p = (struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)o;
128518   Py_XDECREF(p->_prefix);
128519   Py_XDECREF(p->_prefix_utf);
128520   __pyx_tp_dealloc_4lxml_5etree__NamespaceRegistry(o);
128521 }
128522
128523 static int __pyx_tp_traverse_4lxml_5etree__XPathFunctionNamespaceRegistry(PyObject *o, visitproc v, void *a) {
128524   int e;
128525   struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *p = (struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)o;
128526   e = __pyx_tp_traverse_4lxml_5etree__NamespaceRegistry(o, v, a); if (e) return e;
128527   if (p->_prefix) {
128528     e = (*v)(p->_prefix, a); if (e) return e;
128529   }
128530   if (p->_prefix_utf) {
128531     e = (*v)(p->_prefix_utf, a); if (e) return e;
128532   }
128533   return 0;
128534 }
128535
128536 static int __pyx_tp_clear_4lxml_5etree__XPathFunctionNamespaceRegistry(PyObject *o) {
128537   struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *p = (struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)o;
128538   PyObject* tmp;
128539   __pyx_tp_clear_4lxml_5etree__NamespaceRegistry(o);
128540   tmp = ((PyObject*)p->_prefix);
128541   p->_prefix = Py_None; Py_INCREF(Py_None);
128542   Py_XDECREF(tmp);
128543   tmp = ((PyObject*)p->_prefix_utf);
128544   p->_prefix_utf = Py_None; Py_INCREF(Py_None);
128545   Py_XDECREF(tmp);
128546   return 0;
128547 }
128548
128549 static PyObject *__pyx_getprop_4lxml_5etree_31_XPathFunctionNamespaceRegistry_prefix(PyObject *o, void *x) {
128550   return __pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix___get__(o);
128551 }
128552
128553 static int __pyx_setprop_4lxml_5etree_31_XPathFunctionNamespaceRegistry_prefix(PyObject *o, PyObject *v, void *x) {
128554   if (v) {
128555     return __pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix___set__(o, v);
128556   }
128557   else {
128558     return __pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix___del__(o);
128559   }
128560 }
128561
128562 static struct PyMethodDef __pyx_methods_4lxml_5etree__XPathFunctionNamespaceRegistry[] = {
128563   {0, 0, 0, 0}
128564 };
128565
128566 static struct PyGetSetDef __pyx_getsets_4lxml_5etree__XPathFunctionNamespaceRegistry[] = {
128567   {(char *)"prefix", __pyx_getprop_4lxml_5etree_31_XPathFunctionNamespaceRegistry_prefix, __pyx_setprop_4lxml_5etree_31_XPathFunctionNamespaceRegistry_prefix, __pyx_k_24, 0},
128568   {0, 0, 0, 0, 0}
128569 };
128570
128571 static PyNumberMethods __pyx_tp_as_number__XPathFunctionNamespaceRegistry = {
128572   0, /*nb_add*/
128573   0, /*nb_subtract*/
128574   0, /*nb_multiply*/
128575   #if PY_MAJOR_VERSION < 3
128576   0, /*nb_divide*/
128577   #endif
128578   0, /*nb_remainder*/
128579   0, /*nb_divmod*/
128580   0, /*nb_power*/
128581   0, /*nb_negative*/
128582   0, /*nb_positive*/
128583   0, /*nb_absolute*/
128584   0, /*nb_nonzero*/
128585   0, /*nb_invert*/
128586   0, /*nb_lshift*/
128587   0, /*nb_rshift*/
128588   0, /*nb_and*/
128589   0, /*nb_xor*/
128590   0, /*nb_or*/
128591   #if PY_MAJOR_VERSION < 3
128592   0, /*nb_coerce*/
128593   #endif
128594   0, /*nb_int*/
128595   #if PY_MAJOR_VERSION >= 3
128596   0, /*reserved*/
128597   #else
128598   0, /*nb_long*/
128599   #endif
128600   0, /*nb_float*/
128601   #if PY_MAJOR_VERSION < 3
128602   0, /*nb_oct*/
128603   #endif
128604   #if PY_MAJOR_VERSION < 3
128605   0, /*nb_hex*/
128606   #endif
128607   0, /*nb_inplace_add*/
128608   0, /*nb_inplace_subtract*/
128609   0, /*nb_inplace_multiply*/
128610   #if PY_MAJOR_VERSION < 3
128611   0, /*nb_inplace_divide*/
128612   #endif
128613   0, /*nb_inplace_remainder*/
128614   0, /*nb_inplace_power*/
128615   0, /*nb_inplace_lshift*/
128616   0, /*nb_inplace_rshift*/
128617   0, /*nb_inplace_and*/
128618   0, /*nb_inplace_xor*/
128619   0, /*nb_inplace_or*/
128620   0, /*nb_floor_divide*/
128621   0, /*nb_true_divide*/
128622   0, /*nb_inplace_floor_divide*/
128623   0, /*nb_inplace_true_divide*/
128624   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
128625   0, /*nb_index*/
128626   #endif
128627 };
128628
128629 static PySequenceMethods __pyx_tp_as_sequence__XPathFunctionNamespaceRegistry = {
128630   0, /*sq_length*/
128631   0, /*sq_concat*/
128632   0, /*sq_repeat*/
128633   0, /*sq_item*/
128634   0, /*sq_slice*/
128635   0, /*sq_ass_item*/
128636   0, /*sq_ass_slice*/
128637   0, /*sq_contains*/
128638   0, /*sq_inplace_concat*/
128639   0, /*sq_inplace_repeat*/
128640 };
128641
128642 static PyMappingMethods __pyx_tp_as_mapping__XPathFunctionNamespaceRegistry = {
128643   0, /*mp_length*/
128644   0, /*mp_subscript*/
128645   0, /*mp_ass_subscript*/
128646 };
128647
128648 static PyBufferProcs __pyx_tp_as_buffer__XPathFunctionNamespaceRegistry = {
128649   #if PY_MAJOR_VERSION < 3
128650   0, /*bf_getreadbuffer*/
128651   #endif
128652   #if PY_MAJOR_VERSION < 3
128653   0, /*bf_getwritebuffer*/
128654   #endif
128655   #if PY_MAJOR_VERSION < 3
128656   0, /*bf_getsegcount*/
128657   #endif
128658   #if PY_MAJOR_VERSION < 3
128659   0, /*bf_getcharbuffer*/
128660   #endif
128661   #if PY_VERSION_HEX >= 0x02060000
128662   0, /*bf_getbuffer*/
128663   #endif
128664   #if PY_VERSION_HEX >= 0x02060000
128665   0, /*bf_releasebuffer*/
128666   #endif
128667 };
128668
128669 PyTypeObject __pyx_type_4lxml_5etree__XPathFunctionNamespaceRegistry = {
128670   PyVarObject_HEAD_INIT(0, 0)
128671   __Pyx_NAMESTR("lxml.etree._XPathFunctionNamespaceRegistry"), /*tp_name*/
128672   sizeof(struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry), /*tp_basicsize*/
128673   0, /*tp_itemsize*/
128674   __pyx_tp_dealloc_4lxml_5etree__XPathFunctionNamespaceRegistry, /*tp_dealloc*/
128675   0, /*tp_print*/
128676   0, /*tp_getattr*/
128677   0, /*tp_setattr*/
128678   0, /*tp_compare*/
128679   0, /*tp_repr*/
128680   &__pyx_tp_as_number__XPathFunctionNamespaceRegistry, /*tp_as_number*/
128681   &__pyx_tp_as_sequence__XPathFunctionNamespaceRegistry, /*tp_as_sequence*/
128682   &__pyx_tp_as_mapping__XPathFunctionNamespaceRegistry, /*tp_as_mapping*/
128683   0, /*tp_hash*/
128684   0, /*tp_call*/
128685   0, /*tp_str*/
128686   0, /*tp_getattro*/
128687   0, /*tp_setattro*/
128688   &__pyx_tp_as_buffer__XPathFunctionNamespaceRegistry, /*tp_as_buffer*/
128689   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
128690   0, /*tp_doc*/
128691   __pyx_tp_traverse_4lxml_5etree__XPathFunctionNamespaceRegistry, /*tp_traverse*/
128692   __pyx_tp_clear_4lxml_5etree__XPathFunctionNamespaceRegistry, /*tp_clear*/
128693   0, /*tp_richcompare*/
128694   0, /*tp_weaklistoffset*/
128695   0, /*tp_iter*/
128696   0, /*tp_iternext*/
128697   __pyx_methods_4lxml_5etree__XPathFunctionNamespaceRegistry, /*tp_methods*/
128698   0, /*tp_members*/
128699   __pyx_getsets_4lxml_5etree__XPathFunctionNamespaceRegistry, /*tp_getset*/
128700   0, /*tp_base*/
128701   0, /*tp_dict*/
128702   0, /*tp_descr_get*/
128703   0, /*tp_descr_set*/
128704   0, /*tp_dictoffset*/
128705   0, /*tp_init*/
128706   0, /*tp_alloc*/
128707   __pyx_tp_new_4lxml_5etree__XPathFunctionNamespaceRegistry, /*tp_new*/
128708   0, /*tp_free*/
128709   0, /*tp_is_gc*/
128710   0, /*tp_bases*/
128711   0, /*tp_mro*/
128712   0, /*tp_cache*/
128713   0, /*tp_subclasses*/
128714   0, /*tp_weaklist*/
128715 };
128716
128717 static PyObject *__pyx_tp_new_4lxml_5etree__InputDocument(PyTypeObject *t, PyObject *a, PyObject *k) {
128718   struct __pyx_obj_4lxml_5etree__InputDocument *p;
128719   PyObject *o = (*t->tp_alloc)(t, 0);
128720   if (!o) return 0;
128721   p = ((struct __pyx_obj_4lxml_5etree__InputDocument *)o);
128722   p->_data_bytes = Py_None; Py_INCREF(Py_None);
128723   p->_filename = Py_None; Py_INCREF(Py_None);
128724   p->_file = Py_None; Py_INCREF(Py_None);
128725   return o;
128726 }
128727
128728 static void __pyx_tp_dealloc_4lxml_5etree__InputDocument(PyObject *o) {
128729   struct __pyx_obj_4lxml_5etree__InputDocument *p = (struct __pyx_obj_4lxml_5etree__InputDocument *)o;
128730   Py_XDECREF(p->_data_bytes);
128731   Py_XDECREF(p->_filename);
128732   Py_XDECREF(p->_file);
128733   (*Py_TYPE(o)->tp_free)(o);
128734 }
128735
128736 static int __pyx_tp_traverse_4lxml_5etree__InputDocument(PyObject *o, visitproc v, void *a) {
128737   int e;
128738   struct __pyx_obj_4lxml_5etree__InputDocument *p = (struct __pyx_obj_4lxml_5etree__InputDocument *)o;
128739   if (p->_data_bytes) {
128740     e = (*v)(p->_data_bytes, a); if (e) return e;
128741   }
128742   if (p->_filename) {
128743     e = (*v)(p->_filename, a); if (e) return e;
128744   }
128745   if (p->_file) {
128746     e = (*v)(p->_file, a); if (e) return e;
128747   }
128748   return 0;
128749 }
128750
128751 static int __pyx_tp_clear_4lxml_5etree__InputDocument(PyObject *o) {
128752   struct __pyx_obj_4lxml_5etree__InputDocument *p = (struct __pyx_obj_4lxml_5etree__InputDocument *)o;
128753   PyObject* tmp;
128754   tmp = ((PyObject*)p->_data_bytes);
128755   p->_data_bytes = Py_None; Py_INCREF(Py_None);
128756   Py_XDECREF(tmp);
128757   tmp = ((PyObject*)p->_filename);
128758   p->_filename = Py_None; Py_INCREF(Py_None);
128759   Py_XDECREF(tmp);
128760   tmp = ((PyObject*)p->_file);
128761   p->_file = Py_None; Py_INCREF(Py_None);
128762   Py_XDECREF(tmp);
128763   return 0;
128764 }
128765
128766 static struct PyMethodDef __pyx_methods_4lxml_5etree__InputDocument[] = {
128767   {0, 0, 0, 0}
128768 };
128769
128770 static PyNumberMethods __pyx_tp_as_number__InputDocument = {
128771   0, /*nb_add*/
128772   0, /*nb_subtract*/
128773   0, /*nb_multiply*/
128774   #if PY_MAJOR_VERSION < 3
128775   0, /*nb_divide*/
128776   #endif
128777   0, /*nb_remainder*/
128778   0, /*nb_divmod*/
128779   0, /*nb_power*/
128780   0, /*nb_negative*/
128781   0, /*nb_positive*/
128782   0, /*nb_absolute*/
128783   0, /*nb_nonzero*/
128784   0, /*nb_invert*/
128785   0, /*nb_lshift*/
128786   0, /*nb_rshift*/
128787   0, /*nb_and*/
128788   0, /*nb_xor*/
128789   0, /*nb_or*/
128790   #if PY_MAJOR_VERSION < 3
128791   0, /*nb_coerce*/
128792   #endif
128793   0, /*nb_int*/
128794   #if PY_MAJOR_VERSION >= 3
128795   0, /*reserved*/
128796   #else
128797   0, /*nb_long*/
128798   #endif
128799   0, /*nb_float*/
128800   #if PY_MAJOR_VERSION < 3
128801   0, /*nb_oct*/
128802   #endif
128803   #if PY_MAJOR_VERSION < 3
128804   0, /*nb_hex*/
128805   #endif
128806   0, /*nb_inplace_add*/
128807   0, /*nb_inplace_subtract*/
128808   0, /*nb_inplace_multiply*/
128809   #if PY_MAJOR_VERSION < 3
128810   0, /*nb_inplace_divide*/
128811   #endif
128812   0, /*nb_inplace_remainder*/
128813   0, /*nb_inplace_power*/
128814   0, /*nb_inplace_lshift*/
128815   0, /*nb_inplace_rshift*/
128816   0, /*nb_inplace_and*/
128817   0, /*nb_inplace_xor*/
128818   0, /*nb_inplace_or*/
128819   0, /*nb_floor_divide*/
128820   0, /*nb_true_divide*/
128821   0, /*nb_inplace_floor_divide*/
128822   0, /*nb_inplace_true_divide*/
128823   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
128824   0, /*nb_index*/
128825   #endif
128826 };
128827
128828 static PySequenceMethods __pyx_tp_as_sequence__InputDocument = {
128829   0, /*sq_length*/
128830   0, /*sq_concat*/
128831   0, /*sq_repeat*/
128832   0, /*sq_item*/
128833   0, /*sq_slice*/
128834   0, /*sq_ass_item*/
128835   0, /*sq_ass_slice*/
128836   0, /*sq_contains*/
128837   0, /*sq_inplace_concat*/
128838   0, /*sq_inplace_repeat*/
128839 };
128840
128841 static PyMappingMethods __pyx_tp_as_mapping__InputDocument = {
128842   0, /*mp_length*/
128843   0, /*mp_subscript*/
128844   0, /*mp_ass_subscript*/
128845 };
128846
128847 static PyBufferProcs __pyx_tp_as_buffer__InputDocument = {
128848   #if PY_MAJOR_VERSION < 3
128849   0, /*bf_getreadbuffer*/
128850   #endif
128851   #if PY_MAJOR_VERSION < 3
128852   0, /*bf_getwritebuffer*/
128853   #endif
128854   #if PY_MAJOR_VERSION < 3
128855   0, /*bf_getsegcount*/
128856   #endif
128857   #if PY_MAJOR_VERSION < 3
128858   0, /*bf_getcharbuffer*/
128859   #endif
128860   #if PY_VERSION_HEX >= 0x02060000
128861   0, /*bf_getbuffer*/
128862   #endif
128863   #if PY_VERSION_HEX >= 0x02060000
128864   0, /*bf_releasebuffer*/
128865   #endif
128866 };
128867
128868 PyTypeObject __pyx_type_4lxml_5etree__InputDocument = {
128869   PyVarObject_HEAD_INIT(0, 0)
128870   __Pyx_NAMESTR("lxml.etree._InputDocument"), /*tp_name*/
128871   sizeof(struct __pyx_obj_4lxml_5etree__InputDocument), /*tp_basicsize*/
128872   0, /*tp_itemsize*/
128873   __pyx_tp_dealloc_4lxml_5etree__InputDocument, /*tp_dealloc*/
128874   0, /*tp_print*/
128875   0, /*tp_getattr*/
128876   0, /*tp_setattr*/
128877   0, /*tp_compare*/
128878   0, /*tp_repr*/
128879   &__pyx_tp_as_number__InputDocument, /*tp_as_number*/
128880   &__pyx_tp_as_sequence__InputDocument, /*tp_as_sequence*/
128881   &__pyx_tp_as_mapping__InputDocument, /*tp_as_mapping*/
128882   0, /*tp_hash*/
128883   0, /*tp_call*/
128884   0, /*tp_str*/
128885   0, /*tp_getattro*/
128886   0, /*tp_setattro*/
128887   &__pyx_tp_as_buffer__InputDocument, /*tp_as_buffer*/
128888   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
128889   0, /*tp_doc*/
128890   __pyx_tp_traverse_4lxml_5etree__InputDocument, /*tp_traverse*/
128891   __pyx_tp_clear_4lxml_5etree__InputDocument, /*tp_clear*/
128892   0, /*tp_richcompare*/
128893   0, /*tp_weaklistoffset*/
128894   0, /*tp_iter*/
128895   0, /*tp_iternext*/
128896   __pyx_methods_4lxml_5etree__InputDocument, /*tp_methods*/
128897   0, /*tp_members*/
128898   0, /*tp_getset*/
128899   0, /*tp_base*/
128900   0, /*tp_dict*/
128901   0, /*tp_descr_get*/
128902   0, /*tp_descr_set*/
128903   0, /*tp_dictoffset*/
128904   0, /*tp_init*/
128905   0, /*tp_alloc*/
128906   __pyx_tp_new_4lxml_5etree__InputDocument, /*tp_new*/
128907   0, /*tp_free*/
128908   0, /*tp_is_gc*/
128909   0, /*tp_bases*/
128910   0, /*tp_mro*/
128911   0, /*tp_cache*/
128912   0, /*tp_subclasses*/
128913   0, /*tp_weaklist*/
128914 };
128915
128916 static PyObject *__pyx_tp_new_4lxml_5etree_Resolver(PyTypeObject *t, PyObject *a, PyObject *k) {
128917   PyObject *o = (*t->tp_alloc)(t, 0);
128918   if (!o) return 0;
128919   return o;
128920 }
128921
128922 static void __pyx_tp_dealloc_4lxml_5etree_Resolver(PyObject *o) {
128923   (*Py_TYPE(o)->tp_free)(o);
128924 }
128925
128926 static struct PyMethodDef __pyx_methods_4lxml_5etree_Resolver[] = {
128927   {__Pyx_NAMESTR("resolve"), (PyCFunction)__pyx_pf_4lxml_5etree_8Resolver_resolve, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8Resolver_resolve)},
128928   {__Pyx_NAMESTR("resolve_empty"), (PyCFunction)__pyx_pf_4lxml_5etree_8Resolver_resolve_empty, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8Resolver_resolve_empty)},
128929   {__Pyx_NAMESTR("resolve_string"), (PyCFunction)__pyx_pf_4lxml_5etree_8Resolver_resolve_string, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8Resolver_resolve_string)},
128930   {__Pyx_NAMESTR("resolve_filename"), (PyCFunction)__pyx_pf_4lxml_5etree_8Resolver_resolve_filename, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8Resolver_resolve_filename)},
128931   {__Pyx_NAMESTR("resolve_file"), (PyCFunction)__pyx_pf_4lxml_5etree_8Resolver_resolve_file, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8Resolver_resolve_file)},
128932   {0, 0, 0, 0}
128933 };
128934
128935 static PyNumberMethods __pyx_tp_as_number_Resolver = {
128936   0, /*nb_add*/
128937   0, /*nb_subtract*/
128938   0, /*nb_multiply*/
128939   #if PY_MAJOR_VERSION < 3
128940   0, /*nb_divide*/
128941   #endif
128942   0, /*nb_remainder*/
128943   0, /*nb_divmod*/
128944   0, /*nb_power*/
128945   0, /*nb_negative*/
128946   0, /*nb_positive*/
128947   0, /*nb_absolute*/
128948   0, /*nb_nonzero*/
128949   0, /*nb_invert*/
128950   0, /*nb_lshift*/
128951   0, /*nb_rshift*/
128952   0, /*nb_and*/
128953   0, /*nb_xor*/
128954   0, /*nb_or*/
128955   #if PY_MAJOR_VERSION < 3
128956   0, /*nb_coerce*/
128957   #endif
128958   0, /*nb_int*/
128959   #if PY_MAJOR_VERSION >= 3
128960   0, /*reserved*/
128961   #else
128962   0, /*nb_long*/
128963   #endif
128964   0, /*nb_float*/
128965   #if PY_MAJOR_VERSION < 3
128966   0, /*nb_oct*/
128967   #endif
128968   #if PY_MAJOR_VERSION < 3
128969   0, /*nb_hex*/
128970   #endif
128971   0, /*nb_inplace_add*/
128972   0, /*nb_inplace_subtract*/
128973   0, /*nb_inplace_multiply*/
128974   #if PY_MAJOR_VERSION < 3
128975   0, /*nb_inplace_divide*/
128976   #endif
128977   0, /*nb_inplace_remainder*/
128978   0, /*nb_inplace_power*/
128979   0, /*nb_inplace_lshift*/
128980   0, /*nb_inplace_rshift*/
128981   0, /*nb_inplace_and*/
128982   0, /*nb_inplace_xor*/
128983   0, /*nb_inplace_or*/
128984   0, /*nb_floor_divide*/
128985   0, /*nb_true_divide*/
128986   0, /*nb_inplace_floor_divide*/
128987   0, /*nb_inplace_true_divide*/
128988   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
128989   0, /*nb_index*/
128990   #endif
128991 };
128992
128993 static PySequenceMethods __pyx_tp_as_sequence_Resolver = {
128994   0, /*sq_length*/
128995   0, /*sq_concat*/
128996   0, /*sq_repeat*/
128997   0, /*sq_item*/
128998   0, /*sq_slice*/
128999   0, /*sq_ass_item*/
129000   0, /*sq_ass_slice*/
129001   0, /*sq_contains*/
129002   0, /*sq_inplace_concat*/
129003   0, /*sq_inplace_repeat*/
129004 };
129005
129006 static PyMappingMethods __pyx_tp_as_mapping_Resolver = {
129007   0, /*mp_length*/
129008   0, /*mp_subscript*/
129009   0, /*mp_ass_subscript*/
129010 };
129011
129012 static PyBufferProcs __pyx_tp_as_buffer_Resolver = {
129013   #if PY_MAJOR_VERSION < 3
129014   0, /*bf_getreadbuffer*/
129015   #endif
129016   #if PY_MAJOR_VERSION < 3
129017   0, /*bf_getwritebuffer*/
129018   #endif
129019   #if PY_MAJOR_VERSION < 3
129020   0, /*bf_getsegcount*/
129021   #endif
129022   #if PY_MAJOR_VERSION < 3
129023   0, /*bf_getcharbuffer*/
129024   #endif
129025   #if PY_VERSION_HEX >= 0x02060000
129026   0, /*bf_getbuffer*/
129027   #endif
129028   #if PY_VERSION_HEX >= 0x02060000
129029   0, /*bf_releasebuffer*/
129030   #endif
129031 };
129032
129033 PyTypeObject __pyx_type_4lxml_5etree_Resolver = {
129034   PyVarObject_HEAD_INIT(0, 0)
129035   __Pyx_NAMESTR("lxml.etree.Resolver"), /*tp_name*/
129036   sizeof(struct __pyx_obj_4lxml_5etree_Resolver), /*tp_basicsize*/
129037   0, /*tp_itemsize*/
129038   __pyx_tp_dealloc_4lxml_5etree_Resolver, /*tp_dealloc*/
129039   0, /*tp_print*/
129040   0, /*tp_getattr*/
129041   0, /*tp_setattr*/
129042   0, /*tp_compare*/
129043   0, /*tp_repr*/
129044   &__pyx_tp_as_number_Resolver, /*tp_as_number*/
129045   &__pyx_tp_as_sequence_Resolver, /*tp_as_sequence*/
129046   &__pyx_tp_as_mapping_Resolver, /*tp_as_mapping*/
129047   0, /*tp_hash*/
129048   0, /*tp_call*/
129049   0, /*tp_str*/
129050   0, /*tp_getattro*/
129051   0, /*tp_setattro*/
129052   &__pyx_tp_as_buffer_Resolver, /*tp_as_buffer*/
129053   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
129054   __Pyx_DOCSTR("This is the base class of all resolvers."), /*tp_doc*/
129055   0, /*tp_traverse*/
129056   0, /*tp_clear*/
129057   0, /*tp_richcompare*/
129058   0, /*tp_weaklistoffset*/
129059   0, /*tp_iter*/
129060   0, /*tp_iternext*/
129061   __pyx_methods_4lxml_5etree_Resolver, /*tp_methods*/
129062   0, /*tp_members*/
129063   0, /*tp_getset*/
129064   0, /*tp_base*/
129065   0, /*tp_dict*/
129066   0, /*tp_descr_get*/
129067   0, /*tp_descr_set*/
129068   0, /*tp_dictoffset*/
129069   0, /*tp_init*/
129070   0, /*tp_alloc*/
129071   __pyx_tp_new_4lxml_5etree_Resolver, /*tp_new*/
129072   0, /*tp_free*/
129073   0, /*tp_is_gc*/
129074   0, /*tp_bases*/
129075   0, /*tp_mro*/
129076   0, /*tp_cache*/
129077   0, /*tp_subclasses*/
129078   0, /*tp_weaklist*/
129079 };
129080 static struct __pyx_vtabstruct_4lxml_5etree__ResolverRegistry __pyx_vtable_4lxml_5etree__ResolverRegistry;
129081
129082 static PyObject *__pyx_tp_new_4lxml_5etree__ResolverRegistry(PyTypeObject *t, PyObject *a, PyObject *k) {
129083   struct __pyx_obj_4lxml_5etree__ResolverRegistry *p;
129084   PyObject *o = (*t->tp_alloc)(t, 0);
129085   if (!o) return 0;
129086   p = ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)o);
129087   p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__ResolverRegistry;
129088   p->_resolvers = Py_None; Py_INCREF(Py_None);
129089   p->_default_resolver = ((struct __pyx_obj_4lxml_5etree_Resolver *)Py_None); Py_INCREF(Py_None);
129090   return o;
129091 }
129092
129093 static void __pyx_tp_dealloc_4lxml_5etree__ResolverRegistry(PyObject *o) {
129094   struct __pyx_obj_4lxml_5etree__ResolverRegistry *p = (struct __pyx_obj_4lxml_5etree__ResolverRegistry *)o;
129095   Py_XDECREF(p->_resolvers);
129096   Py_XDECREF(((PyObject *)p->_default_resolver));
129097   (*Py_TYPE(o)->tp_free)(o);
129098 }
129099
129100 static int __pyx_tp_traverse_4lxml_5etree__ResolverRegistry(PyObject *o, visitproc v, void *a) {
129101   int e;
129102   struct __pyx_obj_4lxml_5etree__ResolverRegistry *p = (struct __pyx_obj_4lxml_5etree__ResolverRegistry *)o;
129103   if (p->_resolvers) {
129104     e = (*v)(p->_resolvers, a); if (e) return e;
129105   }
129106   if (p->_default_resolver) {
129107     e = (*v)(((PyObject*)p->_default_resolver), a); if (e) return e;
129108   }
129109   return 0;
129110 }
129111
129112 static int __pyx_tp_clear_4lxml_5etree__ResolverRegistry(PyObject *o) {
129113   struct __pyx_obj_4lxml_5etree__ResolverRegistry *p = (struct __pyx_obj_4lxml_5etree__ResolverRegistry *)o;
129114   PyObject* tmp;
129115   tmp = ((PyObject*)p->_resolvers);
129116   p->_resolvers = Py_None; Py_INCREF(Py_None);
129117   Py_XDECREF(tmp);
129118   tmp = ((PyObject*)p->_default_resolver);
129119   p->_default_resolver = ((struct __pyx_obj_4lxml_5etree_Resolver *)Py_None); Py_INCREF(Py_None);
129120   Py_XDECREF(tmp);
129121   return 0;
129122 }
129123
129124 static struct PyMethodDef __pyx_methods_4lxml_5etree__ResolverRegistry[] = {
129125   {__Pyx_NAMESTR("add"), (PyCFunction)__pyx_pf_4lxml_5etree_17_ResolverRegistry_add, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_17_ResolverRegistry_add)},
129126   {__Pyx_NAMESTR("remove"), (PyCFunction)__pyx_pf_4lxml_5etree_17_ResolverRegistry_remove, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_17_ResolverRegistry_remove)},
129127   {__Pyx_NAMESTR("copy"), (PyCFunction)__pyx_pf_4lxml_5etree_17_ResolverRegistry_copy, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_17_ResolverRegistry_copy)},
129128   {__Pyx_NAMESTR("resolve"), (PyCFunction)__pyx_pf_4lxml_5etree_17_ResolverRegistry_resolve, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_17_ResolverRegistry_resolve)},
129129   {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_4lxml_5etree_17_ResolverRegistry___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
129130   {0, 0, 0, 0}
129131 };
129132
129133 static PyNumberMethods __pyx_tp_as_number__ResolverRegistry = {
129134   0, /*nb_add*/
129135   0, /*nb_subtract*/
129136   0, /*nb_multiply*/
129137   #if PY_MAJOR_VERSION < 3
129138   0, /*nb_divide*/
129139   #endif
129140   0, /*nb_remainder*/
129141   0, /*nb_divmod*/
129142   0, /*nb_power*/
129143   0, /*nb_negative*/
129144   0, /*nb_positive*/
129145   0, /*nb_absolute*/
129146   0, /*nb_nonzero*/
129147   0, /*nb_invert*/
129148   0, /*nb_lshift*/
129149   0, /*nb_rshift*/
129150   0, /*nb_and*/
129151   0, /*nb_xor*/
129152   0, /*nb_or*/
129153   #if PY_MAJOR_VERSION < 3
129154   0, /*nb_coerce*/
129155   #endif
129156   0, /*nb_int*/
129157   #if PY_MAJOR_VERSION >= 3
129158   0, /*reserved*/
129159   #else
129160   0, /*nb_long*/
129161   #endif
129162   0, /*nb_float*/
129163   #if PY_MAJOR_VERSION < 3
129164   0, /*nb_oct*/
129165   #endif
129166   #if PY_MAJOR_VERSION < 3
129167   0, /*nb_hex*/
129168   #endif
129169   0, /*nb_inplace_add*/
129170   0, /*nb_inplace_subtract*/
129171   0, /*nb_inplace_multiply*/
129172   #if PY_MAJOR_VERSION < 3
129173   0, /*nb_inplace_divide*/
129174   #endif
129175   0, /*nb_inplace_remainder*/
129176   0, /*nb_inplace_power*/
129177   0, /*nb_inplace_lshift*/
129178   0, /*nb_inplace_rshift*/
129179   0, /*nb_inplace_and*/
129180   0, /*nb_inplace_xor*/
129181   0, /*nb_inplace_or*/
129182   0, /*nb_floor_divide*/
129183   0, /*nb_true_divide*/
129184   0, /*nb_inplace_floor_divide*/
129185   0, /*nb_inplace_true_divide*/
129186   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
129187   0, /*nb_index*/
129188   #endif
129189 };
129190
129191 static PySequenceMethods __pyx_tp_as_sequence__ResolverRegistry = {
129192   0, /*sq_length*/
129193   0, /*sq_concat*/
129194   0, /*sq_repeat*/
129195   0, /*sq_item*/
129196   0, /*sq_slice*/
129197   0, /*sq_ass_item*/
129198   0, /*sq_ass_slice*/
129199   0, /*sq_contains*/
129200   0, /*sq_inplace_concat*/
129201   0, /*sq_inplace_repeat*/
129202 };
129203
129204 static PyMappingMethods __pyx_tp_as_mapping__ResolverRegistry = {
129205   0, /*mp_length*/
129206   0, /*mp_subscript*/
129207   0, /*mp_ass_subscript*/
129208 };
129209
129210 static PyBufferProcs __pyx_tp_as_buffer__ResolverRegistry = {
129211   #if PY_MAJOR_VERSION < 3
129212   0, /*bf_getreadbuffer*/
129213   #endif
129214   #if PY_MAJOR_VERSION < 3
129215   0, /*bf_getwritebuffer*/
129216   #endif
129217   #if PY_MAJOR_VERSION < 3
129218   0, /*bf_getsegcount*/
129219   #endif
129220   #if PY_MAJOR_VERSION < 3
129221   0, /*bf_getcharbuffer*/
129222   #endif
129223   #if PY_VERSION_HEX >= 0x02060000
129224   0, /*bf_getbuffer*/
129225   #endif
129226   #if PY_VERSION_HEX >= 0x02060000
129227   0, /*bf_releasebuffer*/
129228   #endif
129229 };
129230
129231 PyTypeObject __pyx_type_4lxml_5etree__ResolverRegistry = {
129232   PyVarObject_HEAD_INIT(0, 0)
129233   __Pyx_NAMESTR("lxml.etree._ResolverRegistry"), /*tp_name*/
129234   sizeof(struct __pyx_obj_4lxml_5etree__ResolverRegistry), /*tp_basicsize*/
129235   0, /*tp_itemsize*/
129236   __pyx_tp_dealloc_4lxml_5etree__ResolverRegistry, /*tp_dealloc*/
129237   0, /*tp_print*/
129238   0, /*tp_getattr*/
129239   0, /*tp_setattr*/
129240   0, /*tp_compare*/
129241   __pyx_pf_4lxml_5etree_17_ResolverRegistry___repr__, /*tp_repr*/
129242   &__pyx_tp_as_number__ResolverRegistry, /*tp_as_number*/
129243   &__pyx_tp_as_sequence__ResolverRegistry, /*tp_as_sequence*/
129244   &__pyx_tp_as_mapping__ResolverRegistry, /*tp_as_mapping*/
129245   0, /*tp_hash*/
129246   0, /*tp_call*/
129247   0, /*tp_str*/
129248   0, /*tp_getattro*/
129249   0, /*tp_setattro*/
129250   &__pyx_tp_as_buffer__ResolverRegistry, /*tp_as_buffer*/
129251   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
129252   0, /*tp_doc*/
129253   __pyx_tp_traverse_4lxml_5etree__ResolverRegistry, /*tp_traverse*/
129254   __pyx_tp_clear_4lxml_5etree__ResolverRegistry, /*tp_clear*/
129255   0, /*tp_richcompare*/
129256   0, /*tp_weaklistoffset*/
129257   0, /*tp_iter*/
129258   0, /*tp_iternext*/
129259   __pyx_methods_4lxml_5etree__ResolverRegistry, /*tp_methods*/
129260   0, /*tp_members*/
129261   0, /*tp_getset*/
129262   0, /*tp_base*/
129263   0, /*tp_dict*/
129264   0, /*tp_descr_get*/
129265   0, /*tp_descr_set*/
129266   0, /*tp_dictoffset*/
129267   __pyx_pf_4lxml_5etree_17_ResolverRegistry___init__, /*tp_init*/
129268   0, /*tp_alloc*/
129269   __pyx_tp_new_4lxml_5etree__ResolverRegistry, /*tp_new*/
129270   0, /*tp_free*/
129271   0, /*tp_is_gc*/
129272   0, /*tp_bases*/
129273   0, /*tp_mro*/
129274   0, /*tp_cache*/
129275   0, /*tp_subclasses*/
129276   0, /*tp_weaklist*/
129277 };
129278 static struct __pyx_vtabstruct_4lxml_5etree__ResolverContext __pyx_vtable_4lxml_5etree__ResolverContext;
129279
129280 static PyObject *__pyx_tp_new_4lxml_5etree__ResolverContext(PyTypeObject *t, PyObject *a, PyObject *k) {
129281   struct __pyx_obj_4lxml_5etree__ResolverContext *p;
129282   PyObject *o = __pyx_tp_new_4lxml_5etree__ExceptionContext(t, a, k);
129283   if (!o) return 0;
129284   p = ((struct __pyx_obj_4lxml_5etree__ResolverContext *)o);
129285   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext*)__pyx_vtabptr_4lxml_5etree__ResolverContext;
129286   p->_resolvers = ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)Py_None); Py_INCREF(Py_None);
129287   p->_storage = ((struct __pyx_obj_4lxml_5etree__TempStore *)Py_None); Py_INCREF(Py_None);
129288   return o;
129289 }
129290
129291 static void __pyx_tp_dealloc_4lxml_5etree__ResolverContext(PyObject *o) {
129292   struct __pyx_obj_4lxml_5etree__ResolverContext *p = (struct __pyx_obj_4lxml_5etree__ResolverContext *)o;
129293   Py_XDECREF(((PyObject *)p->_resolvers));
129294   Py_XDECREF(((PyObject *)p->_storage));
129295   __pyx_tp_dealloc_4lxml_5etree__ExceptionContext(o);
129296 }
129297
129298 static int __pyx_tp_traverse_4lxml_5etree__ResolverContext(PyObject *o, visitproc v, void *a) {
129299   int e;
129300   struct __pyx_obj_4lxml_5etree__ResolverContext *p = (struct __pyx_obj_4lxml_5etree__ResolverContext *)o;
129301   e = __pyx_tp_traverse_4lxml_5etree__ExceptionContext(o, v, a); if (e) return e;
129302   if (p->_resolvers) {
129303     e = (*v)(((PyObject*)p->_resolvers), a); if (e) return e;
129304   }
129305   if (p->_storage) {
129306     e = (*v)(((PyObject*)p->_storage), a); if (e) return e;
129307   }
129308   return 0;
129309 }
129310
129311 static int __pyx_tp_clear_4lxml_5etree__ResolverContext(PyObject *o) {
129312   struct __pyx_obj_4lxml_5etree__ResolverContext *p = (struct __pyx_obj_4lxml_5etree__ResolverContext *)o;
129313   PyObject* tmp;
129314   __pyx_tp_clear_4lxml_5etree__ExceptionContext(o);
129315   tmp = ((PyObject*)p->_resolvers);
129316   p->_resolvers = ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)Py_None); Py_INCREF(Py_None);
129317   Py_XDECREF(tmp);
129318   tmp = ((PyObject*)p->_storage);
129319   p->_storage = ((struct __pyx_obj_4lxml_5etree__TempStore *)Py_None); Py_INCREF(Py_None);
129320   Py_XDECREF(tmp);
129321   return 0;
129322 }
129323
129324 static struct PyMethodDef __pyx_methods_4lxml_5etree__ResolverContext[] = {
129325   {0, 0, 0, 0}
129326 };
129327
129328 static PyNumberMethods __pyx_tp_as_number__ResolverContext = {
129329   0, /*nb_add*/
129330   0, /*nb_subtract*/
129331   0, /*nb_multiply*/
129332   #if PY_MAJOR_VERSION < 3
129333   0, /*nb_divide*/
129334   #endif
129335   0, /*nb_remainder*/
129336   0, /*nb_divmod*/
129337   0, /*nb_power*/
129338   0, /*nb_negative*/
129339   0, /*nb_positive*/
129340   0, /*nb_absolute*/
129341   0, /*nb_nonzero*/
129342   0, /*nb_invert*/
129343   0, /*nb_lshift*/
129344   0, /*nb_rshift*/
129345   0, /*nb_and*/
129346   0, /*nb_xor*/
129347   0, /*nb_or*/
129348   #if PY_MAJOR_VERSION < 3
129349   0, /*nb_coerce*/
129350   #endif
129351   0, /*nb_int*/
129352   #if PY_MAJOR_VERSION >= 3
129353   0, /*reserved*/
129354   #else
129355   0, /*nb_long*/
129356   #endif
129357   0, /*nb_float*/
129358   #if PY_MAJOR_VERSION < 3
129359   0, /*nb_oct*/
129360   #endif
129361   #if PY_MAJOR_VERSION < 3
129362   0, /*nb_hex*/
129363   #endif
129364   0, /*nb_inplace_add*/
129365   0, /*nb_inplace_subtract*/
129366   0, /*nb_inplace_multiply*/
129367   #if PY_MAJOR_VERSION < 3
129368   0, /*nb_inplace_divide*/
129369   #endif
129370   0, /*nb_inplace_remainder*/
129371   0, /*nb_inplace_power*/
129372   0, /*nb_inplace_lshift*/
129373   0, /*nb_inplace_rshift*/
129374   0, /*nb_inplace_and*/
129375   0, /*nb_inplace_xor*/
129376   0, /*nb_inplace_or*/
129377   0, /*nb_floor_divide*/
129378   0, /*nb_true_divide*/
129379   0, /*nb_inplace_floor_divide*/
129380   0, /*nb_inplace_true_divide*/
129381   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
129382   0, /*nb_index*/
129383   #endif
129384 };
129385
129386 static PySequenceMethods __pyx_tp_as_sequence__ResolverContext = {
129387   0, /*sq_length*/
129388   0, /*sq_concat*/
129389   0, /*sq_repeat*/
129390   0, /*sq_item*/
129391   0, /*sq_slice*/
129392   0, /*sq_ass_item*/
129393   0, /*sq_ass_slice*/
129394   0, /*sq_contains*/
129395   0, /*sq_inplace_concat*/
129396   0, /*sq_inplace_repeat*/
129397 };
129398
129399 static PyMappingMethods __pyx_tp_as_mapping__ResolverContext = {
129400   0, /*mp_length*/
129401   0, /*mp_subscript*/
129402   0, /*mp_ass_subscript*/
129403 };
129404
129405 static PyBufferProcs __pyx_tp_as_buffer__ResolverContext = {
129406   #if PY_MAJOR_VERSION < 3
129407   0, /*bf_getreadbuffer*/
129408   #endif
129409   #if PY_MAJOR_VERSION < 3
129410   0, /*bf_getwritebuffer*/
129411   #endif
129412   #if PY_MAJOR_VERSION < 3
129413   0, /*bf_getsegcount*/
129414   #endif
129415   #if PY_MAJOR_VERSION < 3
129416   0, /*bf_getcharbuffer*/
129417   #endif
129418   #if PY_VERSION_HEX >= 0x02060000
129419   0, /*bf_getbuffer*/
129420   #endif
129421   #if PY_VERSION_HEX >= 0x02060000
129422   0, /*bf_releasebuffer*/
129423   #endif
129424 };
129425
129426 PyTypeObject __pyx_type_4lxml_5etree__ResolverContext = {
129427   PyVarObject_HEAD_INIT(0, 0)
129428   __Pyx_NAMESTR("lxml.etree._ResolverContext"), /*tp_name*/
129429   sizeof(struct __pyx_obj_4lxml_5etree__ResolverContext), /*tp_basicsize*/
129430   0, /*tp_itemsize*/
129431   __pyx_tp_dealloc_4lxml_5etree__ResolverContext, /*tp_dealloc*/
129432   0, /*tp_print*/
129433   0, /*tp_getattr*/
129434   0, /*tp_setattr*/
129435   0, /*tp_compare*/
129436   0, /*tp_repr*/
129437   &__pyx_tp_as_number__ResolverContext, /*tp_as_number*/
129438   &__pyx_tp_as_sequence__ResolverContext, /*tp_as_sequence*/
129439   &__pyx_tp_as_mapping__ResolverContext, /*tp_as_mapping*/
129440   0, /*tp_hash*/
129441   0, /*tp_call*/
129442   0, /*tp_str*/
129443   0, /*tp_getattro*/
129444   0, /*tp_setattro*/
129445   &__pyx_tp_as_buffer__ResolverContext, /*tp_as_buffer*/
129446   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
129447   0, /*tp_doc*/
129448   __pyx_tp_traverse_4lxml_5etree__ResolverContext, /*tp_traverse*/
129449   __pyx_tp_clear_4lxml_5etree__ResolverContext, /*tp_clear*/
129450   0, /*tp_richcompare*/
129451   0, /*tp_weaklistoffset*/
129452   0, /*tp_iter*/
129453   0, /*tp_iternext*/
129454   __pyx_methods_4lxml_5etree__ResolverContext, /*tp_methods*/
129455   0, /*tp_members*/
129456   0, /*tp_getset*/
129457   0, /*tp_base*/
129458   0, /*tp_dict*/
129459   0, /*tp_descr_get*/
129460   0, /*tp_descr_set*/
129461   0, /*tp_dictoffset*/
129462   0, /*tp_init*/
129463   0, /*tp_alloc*/
129464   __pyx_tp_new_4lxml_5etree__ResolverContext, /*tp_new*/
129465   0, /*tp_free*/
129466   0, /*tp_is_gc*/
129467   0, /*tp_bases*/
129468   0, /*tp_mro*/
129469   0, /*tp_cache*/
129470   0, /*tp_subclasses*/
129471   0, /*tp_weaklist*/
129472 };
129473 static struct __pyx_vtabstruct_4lxml_5etree__ParserContext __pyx_vtable_4lxml_5etree__ParserContext;
129474
129475 static PyObject *__pyx_tp_new_4lxml_5etree__ParserContext(PyTypeObject *t, PyObject *a, PyObject *k) {
129476   struct __pyx_obj_4lxml_5etree__ParserContext *p;
129477   PyObject *o = __pyx_tp_new_4lxml_5etree__ResolverContext(t, a, k);
129478   if (!o) return 0;
129479   p = ((struct __pyx_obj_4lxml_5etree__ParserContext *)o);
129480   p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext*)__pyx_vtabptr_4lxml_5etree__ParserContext;
129481   p->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
129482   p->_validator = ((struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *)Py_None); Py_INCREF(Py_None);
129483   return o;
129484 }
129485
129486 static void __pyx_tp_dealloc_4lxml_5etree__ParserContext(PyObject *o) {
129487   struct __pyx_obj_4lxml_5etree__ParserContext *p = (struct __pyx_obj_4lxml_5etree__ParserContext *)o;
129488   {
129489     PyObject *etype, *eval, *etb;
129490     PyErr_Fetch(&etype, &eval, &etb);
129491     ++Py_REFCNT(o);
129492     __pyx_pf_4lxml_5etree_14_ParserContext___dealloc__(o);
129493     if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
129494     --Py_REFCNT(o);
129495     PyErr_Restore(etype, eval, etb);
129496   }
129497   Py_XDECREF(((PyObject *)p->_error_log));
129498   Py_XDECREF(((PyObject *)p->_validator));
129499   __pyx_tp_dealloc_4lxml_5etree__ResolverContext(o);
129500 }
129501
129502 static int __pyx_tp_traverse_4lxml_5etree__ParserContext(PyObject *o, visitproc v, void *a) {
129503   int e;
129504   struct __pyx_obj_4lxml_5etree__ParserContext *p = (struct __pyx_obj_4lxml_5etree__ParserContext *)o;
129505   e = __pyx_tp_traverse_4lxml_5etree__ResolverContext(o, v, a); if (e) return e;
129506   if (p->_error_log) {
129507     e = (*v)(((PyObject*)p->_error_log), a); if (e) return e;
129508   }
129509   if (p->_validator) {
129510     e = (*v)(((PyObject*)p->_validator), a); if (e) return e;
129511   }
129512   return 0;
129513 }
129514
129515 static int __pyx_tp_clear_4lxml_5etree__ParserContext(PyObject *o) {
129516   struct __pyx_obj_4lxml_5etree__ParserContext *p = (struct __pyx_obj_4lxml_5etree__ParserContext *)o;
129517   PyObject* tmp;
129518   __pyx_tp_clear_4lxml_5etree__ResolverContext(o);
129519   tmp = ((PyObject*)p->_error_log);
129520   p->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
129521   Py_XDECREF(tmp);
129522   tmp = ((PyObject*)p->_validator);
129523   p->_validator = ((struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *)Py_None); Py_INCREF(Py_None);
129524   Py_XDECREF(tmp);
129525   return 0;
129526 }
129527
129528 static struct PyMethodDef __pyx_methods_4lxml_5etree__ParserContext[] = {
129529   {0, 0, 0, 0}
129530 };
129531
129532 static PyNumberMethods __pyx_tp_as_number__ParserContext = {
129533   0, /*nb_add*/
129534   0, /*nb_subtract*/
129535   0, /*nb_multiply*/
129536   #if PY_MAJOR_VERSION < 3
129537   0, /*nb_divide*/
129538   #endif
129539   0, /*nb_remainder*/
129540   0, /*nb_divmod*/
129541   0, /*nb_power*/
129542   0, /*nb_negative*/
129543   0, /*nb_positive*/
129544   0, /*nb_absolute*/
129545   0, /*nb_nonzero*/
129546   0, /*nb_invert*/
129547   0, /*nb_lshift*/
129548   0, /*nb_rshift*/
129549   0, /*nb_and*/
129550   0, /*nb_xor*/
129551   0, /*nb_or*/
129552   #if PY_MAJOR_VERSION < 3
129553   0, /*nb_coerce*/
129554   #endif
129555   0, /*nb_int*/
129556   #if PY_MAJOR_VERSION >= 3
129557   0, /*reserved*/
129558   #else
129559   0, /*nb_long*/
129560   #endif
129561   0, /*nb_float*/
129562   #if PY_MAJOR_VERSION < 3
129563   0, /*nb_oct*/
129564   #endif
129565   #if PY_MAJOR_VERSION < 3
129566   0, /*nb_hex*/
129567   #endif
129568   0, /*nb_inplace_add*/
129569   0, /*nb_inplace_subtract*/
129570   0, /*nb_inplace_multiply*/
129571   #if PY_MAJOR_VERSION < 3
129572   0, /*nb_inplace_divide*/
129573   #endif
129574   0, /*nb_inplace_remainder*/
129575   0, /*nb_inplace_power*/
129576   0, /*nb_inplace_lshift*/
129577   0, /*nb_inplace_rshift*/
129578   0, /*nb_inplace_and*/
129579   0, /*nb_inplace_xor*/
129580   0, /*nb_inplace_or*/
129581   0, /*nb_floor_divide*/
129582   0, /*nb_true_divide*/
129583   0, /*nb_inplace_floor_divide*/
129584   0, /*nb_inplace_true_divide*/
129585   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
129586   0, /*nb_index*/
129587   #endif
129588 };
129589
129590 static PySequenceMethods __pyx_tp_as_sequence__ParserContext = {
129591   0, /*sq_length*/
129592   0, /*sq_concat*/
129593   0, /*sq_repeat*/
129594   0, /*sq_item*/
129595   0, /*sq_slice*/
129596   0, /*sq_ass_item*/
129597   0, /*sq_ass_slice*/
129598   0, /*sq_contains*/
129599   0, /*sq_inplace_concat*/
129600   0, /*sq_inplace_repeat*/
129601 };
129602
129603 static PyMappingMethods __pyx_tp_as_mapping__ParserContext = {
129604   0, /*mp_length*/
129605   0, /*mp_subscript*/
129606   0, /*mp_ass_subscript*/
129607 };
129608
129609 static PyBufferProcs __pyx_tp_as_buffer__ParserContext = {
129610   #if PY_MAJOR_VERSION < 3
129611   0, /*bf_getreadbuffer*/
129612   #endif
129613   #if PY_MAJOR_VERSION < 3
129614   0, /*bf_getwritebuffer*/
129615   #endif
129616   #if PY_MAJOR_VERSION < 3
129617   0, /*bf_getsegcount*/
129618   #endif
129619   #if PY_MAJOR_VERSION < 3
129620   0, /*bf_getcharbuffer*/
129621   #endif
129622   #if PY_VERSION_HEX >= 0x02060000
129623   0, /*bf_getbuffer*/
129624   #endif
129625   #if PY_VERSION_HEX >= 0x02060000
129626   0, /*bf_releasebuffer*/
129627   #endif
129628 };
129629
129630 PyTypeObject __pyx_type_4lxml_5etree__ParserContext = {
129631   PyVarObject_HEAD_INIT(0, 0)
129632   __Pyx_NAMESTR("lxml.etree._ParserContext"), /*tp_name*/
129633   sizeof(struct __pyx_obj_4lxml_5etree__ParserContext), /*tp_basicsize*/
129634   0, /*tp_itemsize*/
129635   __pyx_tp_dealloc_4lxml_5etree__ParserContext, /*tp_dealloc*/
129636   0, /*tp_print*/
129637   0, /*tp_getattr*/
129638   0, /*tp_setattr*/
129639   0, /*tp_compare*/
129640   0, /*tp_repr*/
129641   &__pyx_tp_as_number__ParserContext, /*tp_as_number*/
129642   &__pyx_tp_as_sequence__ParserContext, /*tp_as_sequence*/
129643   &__pyx_tp_as_mapping__ParserContext, /*tp_as_mapping*/
129644   0, /*tp_hash*/
129645   0, /*tp_call*/
129646   0, /*tp_str*/
129647   0, /*tp_getattro*/
129648   0, /*tp_setattro*/
129649   &__pyx_tp_as_buffer__ParserContext, /*tp_as_buffer*/
129650   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
129651   0, /*tp_doc*/
129652   __pyx_tp_traverse_4lxml_5etree__ParserContext, /*tp_traverse*/
129653   __pyx_tp_clear_4lxml_5etree__ParserContext, /*tp_clear*/
129654   0, /*tp_richcompare*/
129655   0, /*tp_weaklistoffset*/
129656   0, /*tp_iter*/
129657   0, /*tp_iternext*/
129658   __pyx_methods_4lxml_5etree__ParserContext, /*tp_methods*/
129659   0, /*tp_members*/
129660   0, /*tp_getset*/
129661   0, /*tp_base*/
129662   0, /*tp_dict*/
129663   0, /*tp_descr_get*/
129664   0, /*tp_descr_set*/
129665   0, /*tp_dictoffset*/
129666   0, /*tp_init*/
129667   0, /*tp_alloc*/
129668   __pyx_tp_new_4lxml_5etree__ParserContext, /*tp_new*/
129669   0, /*tp_free*/
129670   0, /*tp_is_gc*/
129671   0, /*tp_bases*/
129672   0, /*tp_mro*/
129673   0, /*tp_cache*/
129674   0, /*tp_subclasses*/
129675   0, /*tp_weaklist*/
129676 };
129677 static struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext __pyx_vtable_4lxml_5etree__SaxParserContext;
129678
129679 static PyObject *__pyx_tp_new_4lxml_5etree__SaxParserContext(PyTypeObject *t, PyObject *a, PyObject *k) {
129680   struct __pyx_obj_4lxml_5etree__SaxParserContext *p;
129681   PyObject *o = __pyx_tp_new_4lxml_5etree__ParserContext(t, a, k);
129682   if (!o) return 0;
129683   p = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)o);
129684   p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext*)__pyx_vtabptr_4lxml_5etree__SaxParserContext;
129685   p->_target = ((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)Py_None); Py_INCREF(Py_None);
129686   return o;
129687 }
129688
129689 static void __pyx_tp_dealloc_4lxml_5etree__SaxParserContext(PyObject *o) {
129690   struct __pyx_obj_4lxml_5etree__SaxParserContext *p = (struct __pyx_obj_4lxml_5etree__SaxParserContext *)o;
129691   Py_XDECREF(((PyObject *)p->_target));
129692   __pyx_tp_dealloc_4lxml_5etree__ParserContext(o);
129693 }
129694
129695 static int __pyx_tp_traverse_4lxml_5etree__SaxParserContext(PyObject *o, visitproc v, void *a) {
129696   int e;
129697   struct __pyx_obj_4lxml_5etree__SaxParserContext *p = (struct __pyx_obj_4lxml_5etree__SaxParserContext *)o;
129698   e = __pyx_tp_traverse_4lxml_5etree__ParserContext(o, v, a); if (e) return e;
129699   if (p->_target) {
129700     e = (*v)(((PyObject*)p->_target), a); if (e) return e;
129701   }
129702   return 0;
129703 }
129704
129705 static int __pyx_tp_clear_4lxml_5etree__SaxParserContext(PyObject *o) {
129706   struct __pyx_obj_4lxml_5etree__SaxParserContext *p = (struct __pyx_obj_4lxml_5etree__SaxParserContext *)o;
129707   PyObject* tmp;
129708   __pyx_tp_clear_4lxml_5etree__ParserContext(o);
129709   tmp = ((PyObject*)p->_target);
129710   p->_target = ((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)Py_None); Py_INCREF(Py_None);
129711   Py_XDECREF(tmp);
129712   return 0;
129713 }
129714
129715 static struct PyMethodDef __pyx_methods_4lxml_5etree__SaxParserContext[] = {
129716   {0, 0, 0, 0}
129717 };
129718
129719 static PyNumberMethods __pyx_tp_as_number__SaxParserContext = {
129720   0, /*nb_add*/
129721   0, /*nb_subtract*/
129722   0, /*nb_multiply*/
129723   #if PY_MAJOR_VERSION < 3
129724   0, /*nb_divide*/
129725   #endif
129726   0, /*nb_remainder*/
129727   0, /*nb_divmod*/
129728   0, /*nb_power*/
129729   0, /*nb_negative*/
129730   0, /*nb_positive*/
129731   0, /*nb_absolute*/
129732   0, /*nb_nonzero*/
129733   0, /*nb_invert*/
129734   0, /*nb_lshift*/
129735   0, /*nb_rshift*/
129736   0, /*nb_and*/
129737   0, /*nb_xor*/
129738   0, /*nb_or*/
129739   #if PY_MAJOR_VERSION < 3
129740   0, /*nb_coerce*/
129741   #endif
129742   0, /*nb_int*/
129743   #if PY_MAJOR_VERSION >= 3
129744   0, /*reserved*/
129745   #else
129746   0, /*nb_long*/
129747   #endif
129748   0, /*nb_float*/
129749   #if PY_MAJOR_VERSION < 3
129750   0, /*nb_oct*/
129751   #endif
129752   #if PY_MAJOR_VERSION < 3
129753   0, /*nb_hex*/
129754   #endif
129755   0, /*nb_inplace_add*/
129756   0, /*nb_inplace_subtract*/
129757   0, /*nb_inplace_multiply*/
129758   #if PY_MAJOR_VERSION < 3
129759   0, /*nb_inplace_divide*/
129760   #endif
129761   0, /*nb_inplace_remainder*/
129762   0, /*nb_inplace_power*/
129763   0, /*nb_inplace_lshift*/
129764   0, /*nb_inplace_rshift*/
129765   0, /*nb_inplace_and*/
129766   0, /*nb_inplace_xor*/
129767   0, /*nb_inplace_or*/
129768   0, /*nb_floor_divide*/
129769   0, /*nb_true_divide*/
129770   0, /*nb_inplace_floor_divide*/
129771   0, /*nb_inplace_true_divide*/
129772   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
129773   0, /*nb_index*/
129774   #endif
129775 };
129776
129777 static PySequenceMethods __pyx_tp_as_sequence__SaxParserContext = {
129778   0, /*sq_length*/
129779   0, /*sq_concat*/
129780   0, /*sq_repeat*/
129781   0, /*sq_item*/
129782   0, /*sq_slice*/
129783   0, /*sq_ass_item*/
129784   0, /*sq_ass_slice*/
129785   0, /*sq_contains*/
129786   0, /*sq_inplace_concat*/
129787   0, /*sq_inplace_repeat*/
129788 };
129789
129790 static PyMappingMethods __pyx_tp_as_mapping__SaxParserContext = {
129791   0, /*mp_length*/
129792   0, /*mp_subscript*/
129793   0, /*mp_ass_subscript*/
129794 };
129795
129796 static PyBufferProcs __pyx_tp_as_buffer__SaxParserContext = {
129797   #if PY_MAJOR_VERSION < 3
129798   0, /*bf_getreadbuffer*/
129799   #endif
129800   #if PY_MAJOR_VERSION < 3
129801   0, /*bf_getwritebuffer*/
129802   #endif
129803   #if PY_MAJOR_VERSION < 3
129804   0, /*bf_getsegcount*/
129805   #endif
129806   #if PY_MAJOR_VERSION < 3
129807   0, /*bf_getcharbuffer*/
129808   #endif
129809   #if PY_VERSION_HEX >= 0x02060000
129810   0, /*bf_getbuffer*/
129811   #endif
129812   #if PY_VERSION_HEX >= 0x02060000
129813   0, /*bf_releasebuffer*/
129814   #endif
129815 };
129816
129817 PyTypeObject __pyx_type_4lxml_5etree__SaxParserContext = {
129818   PyVarObject_HEAD_INIT(0, 0)
129819   __Pyx_NAMESTR("lxml.etree._SaxParserContext"), /*tp_name*/
129820   sizeof(struct __pyx_obj_4lxml_5etree__SaxParserContext), /*tp_basicsize*/
129821   0, /*tp_itemsize*/
129822   __pyx_tp_dealloc_4lxml_5etree__SaxParserContext, /*tp_dealloc*/
129823   0, /*tp_print*/
129824   0, /*tp_getattr*/
129825   0, /*tp_setattr*/
129826   0, /*tp_compare*/
129827   0, /*tp_repr*/
129828   &__pyx_tp_as_number__SaxParserContext, /*tp_as_number*/
129829   &__pyx_tp_as_sequence__SaxParserContext, /*tp_as_sequence*/
129830   &__pyx_tp_as_mapping__SaxParserContext, /*tp_as_mapping*/
129831   0, /*tp_hash*/
129832   0, /*tp_call*/
129833   0, /*tp_str*/
129834   0, /*tp_getattro*/
129835   0, /*tp_setattro*/
129836   &__pyx_tp_as_buffer__SaxParserContext, /*tp_as_buffer*/
129837   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
129838   __Pyx_DOCSTR("This class maps SAX2 events to method calls.\n    "), /*tp_doc*/
129839   __pyx_tp_traverse_4lxml_5etree__SaxParserContext, /*tp_traverse*/
129840   __pyx_tp_clear_4lxml_5etree__SaxParserContext, /*tp_clear*/
129841   0, /*tp_richcompare*/
129842   0, /*tp_weaklistoffset*/
129843   0, /*tp_iter*/
129844   0, /*tp_iternext*/
129845   __pyx_methods_4lxml_5etree__SaxParserContext, /*tp_methods*/
129846   0, /*tp_members*/
129847   0, /*tp_getset*/
129848   0, /*tp_base*/
129849   0, /*tp_dict*/
129850   0, /*tp_descr_get*/
129851   0, /*tp_descr_set*/
129852   0, /*tp_dictoffset*/
129853   0, /*tp_init*/
129854   0, /*tp_alloc*/
129855   __pyx_tp_new_4lxml_5etree__SaxParserContext, /*tp_new*/
129856   0, /*tp_free*/
129857   0, /*tp_is_gc*/
129858   0, /*tp_bases*/
129859   0, /*tp_mro*/
129860   0, /*tp_cache*/
129861   0, /*tp_subclasses*/
129862   0, /*tp_weaklist*/
129863 };
129864 static struct __pyx_vtabstruct_4lxml_5etree__TargetParserContext __pyx_vtable_4lxml_5etree__TargetParserContext;
129865
129866 static PyObject *__pyx_tp_new_4lxml_5etree__TargetParserContext(PyTypeObject *t, PyObject *a, PyObject *k) {
129867   struct __pyx_obj_4lxml_5etree__TargetParserContext *p;
129868   PyObject *o = __pyx_tp_new_4lxml_5etree__SaxParserContext(t, a, k);
129869   if (!o) return 0;
129870   p = ((struct __pyx_obj_4lxml_5etree__TargetParserContext *)o);
129871   p->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext*)__pyx_vtabptr_4lxml_5etree__TargetParserContext;
129872   p->_python_target = Py_None; Py_INCREF(Py_None);
129873   return o;
129874 }
129875
129876 static void __pyx_tp_dealloc_4lxml_5etree__TargetParserContext(PyObject *o) {
129877   struct __pyx_obj_4lxml_5etree__TargetParserContext *p = (struct __pyx_obj_4lxml_5etree__TargetParserContext *)o;
129878   Py_XDECREF(p->_python_target);
129879   __pyx_tp_dealloc_4lxml_5etree__SaxParserContext(o);
129880 }
129881
129882 static int __pyx_tp_traverse_4lxml_5etree__TargetParserContext(PyObject *o, visitproc v, void *a) {
129883   int e;
129884   struct __pyx_obj_4lxml_5etree__TargetParserContext *p = (struct __pyx_obj_4lxml_5etree__TargetParserContext *)o;
129885   e = __pyx_tp_traverse_4lxml_5etree__SaxParserContext(o, v, a); if (e) return e;
129886   if (p->_python_target) {
129887     e = (*v)(p->_python_target, a); if (e) return e;
129888   }
129889   return 0;
129890 }
129891
129892 static int __pyx_tp_clear_4lxml_5etree__TargetParserContext(PyObject *o) {
129893   struct __pyx_obj_4lxml_5etree__TargetParserContext *p = (struct __pyx_obj_4lxml_5etree__TargetParserContext *)o;
129894   PyObject* tmp;
129895   __pyx_tp_clear_4lxml_5etree__SaxParserContext(o);
129896   tmp = ((PyObject*)p->_python_target);
129897   p->_python_target = Py_None; Py_INCREF(Py_None);
129898   Py_XDECREF(tmp);
129899   return 0;
129900 }
129901
129902 static struct PyMethodDef __pyx_methods_4lxml_5etree__TargetParserContext[] = {
129903   {0, 0, 0, 0}
129904 };
129905
129906 static PyNumberMethods __pyx_tp_as_number__TargetParserContext = {
129907   0, /*nb_add*/
129908   0, /*nb_subtract*/
129909   0, /*nb_multiply*/
129910   #if PY_MAJOR_VERSION < 3
129911   0, /*nb_divide*/
129912   #endif
129913   0, /*nb_remainder*/
129914   0, /*nb_divmod*/
129915   0, /*nb_power*/
129916   0, /*nb_negative*/
129917   0, /*nb_positive*/
129918   0, /*nb_absolute*/
129919   0, /*nb_nonzero*/
129920   0, /*nb_invert*/
129921   0, /*nb_lshift*/
129922   0, /*nb_rshift*/
129923   0, /*nb_and*/
129924   0, /*nb_xor*/
129925   0, /*nb_or*/
129926   #if PY_MAJOR_VERSION < 3
129927   0, /*nb_coerce*/
129928   #endif
129929   0, /*nb_int*/
129930   #if PY_MAJOR_VERSION >= 3
129931   0, /*reserved*/
129932   #else
129933   0, /*nb_long*/
129934   #endif
129935   0, /*nb_float*/
129936   #if PY_MAJOR_VERSION < 3
129937   0, /*nb_oct*/
129938   #endif
129939   #if PY_MAJOR_VERSION < 3
129940   0, /*nb_hex*/
129941   #endif
129942   0, /*nb_inplace_add*/
129943   0, /*nb_inplace_subtract*/
129944   0, /*nb_inplace_multiply*/
129945   #if PY_MAJOR_VERSION < 3
129946   0, /*nb_inplace_divide*/
129947   #endif
129948   0, /*nb_inplace_remainder*/
129949   0, /*nb_inplace_power*/
129950   0, /*nb_inplace_lshift*/
129951   0, /*nb_inplace_rshift*/
129952   0, /*nb_inplace_and*/
129953   0, /*nb_inplace_xor*/
129954   0, /*nb_inplace_or*/
129955   0, /*nb_floor_divide*/
129956   0, /*nb_true_divide*/
129957   0, /*nb_inplace_floor_divide*/
129958   0, /*nb_inplace_true_divide*/
129959   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
129960   0, /*nb_index*/
129961   #endif
129962 };
129963
129964 static PySequenceMethods __pyx_tp_as_sequence__TargetParserContext = {
129965   0, /*sq_length*/
129966   0, /*sq_concat*/
129967   0, /*sq_repeat*/
129968   0, /*sq_item*/
129969   0, /*sq_slice*/
129970   0, /*sq_ass_item*/
129971   0, /*sq_ass_slice*/
129972   0, /*sq_contains*/
129973   0, /*sq_inplace_concat*/
129974   0, /*sq_inplace_repeat*/
129975 };
129976
129977 static PyMappingMethods __pyx_tp_as_mapping__TargetParserContext = {
129978   0, /*mp_length*/
129979   0, /*mp_subscript*/
129980   0, /*mp_ass_subscript*/
129981 };
129982
129983 static PyBufferProcs __pyx_tp_as_buffer__TargetParserContext = {
129984   #if PY_MAJOR_VERSION < 3
129985   0, /*bf_getreadbuffer*/
129986   #endif
129987   #if PY_MAJOR_VERSION < 3
129988   0, /*bf_getwritebuffer*/
129989   #endif
129990   #if PY_MAJOR_VERSION < 3
129991   0, /*bf_getsegcount*/
129992   #endif
129993   #if PY_MAJOR_VERSION < 3
129994   0, /*bf_getcharbuffer*/
129995   #endif
129996   #if PY_VERSION_HEX >= 0x02060000
129997   0, /*bf_getbuffer*/
129998   #endif
129999   #if PY_VERSION_HEX >= 0x02060000
130000   0, /*bf_releasebuffer*/
130001   #endif
130002 };
130003
130004 PyTypeObject __pyx_type_4lxml_5etree__TargetParserContext = {
130005   PyVarObject_HEAD_INIT(0, 0)
130006   __Pyx_NAMESTR("lxml.etree._TargetParserContext"), /*tp_name*/
130007   sizeof(struct __pyx_obj_4lxml_5etree__TargetParserContext), /*tp_basicsize*/
130008   0, /*tp_itemsize*/
130009   __pyx_tp_dealloc_4lxml_5etree__TargetParserContext, /*tp_dealloc*/
130010   0, /*tp_print*/
130011   0, /*tp_getattr*/
130012   0, /*tp_setattr*/
130013   0, /*tp_compare*/
130014   0, /*tp_repr*/
130015   &__pyx_tp_as_number__TargetParserContext, /*tp_as_number*/
130016   &__pyx_tp_as_sequence__TargetParserContext, /*tp_as_sequence*/
130017   &__pyx_tp_as_mapping__TargetParserContext, /*tp_as_mapping*/
130018   0, /*tp_hash*/
130019   0, /*tp_call*/
130020   0, /*tp_str*/
130021   0, /*tp_getattro*/
130022   0, /*tp_setattro*/
130023   &__pyx_tp_as_buffer__TargetParserContext, /*tp_as_buffer*/
130024   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
130025   __Pyx_DOCSTR("This class maps SAX2 events to the ET parser target interface.\n    "), /*tp_doc*/
130026   __pyx_tp_traverse_4lxml_5etree__TargetParserContext, /*tp_traverse*/
130027   __pyx_tp_clear_4lxml_5etree__TargetParserContext, /*tp_clear*/
130028   0, /*tp_richcompare*/
130029   0, /*tp_weaklistoffset*/
130030   0, /*tp_iter*/
130031   0, /*tp_iternext*/
130032   __pyx_methods_4lxml_5etree__TargetParserContext, /*tp_methods*/
130033   0, /*tp_members*/
130034   0, /*tp_getset*/
130035   0, /*tp_base*/
130036   0, /*tp_dict*/
130037   0, /*tp_descr_get*/
130038   0, /*tp_descr_set*/
130039   0, /*tp_dictoffset*/
130040   0, /*tp_init*/
130041   0, /*tp_alloc*/
130042   __pyx_tp_new_4lxml_5etree__TargetParserContext, /*tp_new*/
130043   0, /*tp_free*/
130044   0, /*tp_is_gc*/
130045   0, /*tp_bases*/
130046   0, /*tp_mro*/
130047   0, /*tp_cache*/
130048   0, /*tp_subclasses*/
130049   0, /*tp_weaklist*/
130050 };
130051 static struct __pyx_vtabstruct_4lxml_5etree__ParserSchemaValidationContext __pyx_vtable_4lxml_5etree__ParserSchemaValidationContext;
130052
130053 static PyObject *__pyx_tp_new_4lxml_5etree__ParserSchemaValidationContext(PyTypeObject *t, PyObject *a, PyObject *k) {
130054   struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *p;
130055   PyObject *o = (*t->tp_alloc)(t, 0);
130056   if (!o) return 0;
130057   p = ((struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *)o);
130058   p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__ParserSchemaValidationContext;
130059   p->_schema = ((struct __pyx_obj_4lxml_5etree_XMLSchema *)Py_None); Py_INCREF(Py_None);
130060   return o;
130061 }
130062
130063 static void __pyx_tp_dealloc_4lxml_5etree__ParserSchemaValidationContext(PyObject *o) {
130064   struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *p = (struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *)o;
130065   {
130066     PyObject *etype, *eval, *etb;
130067     PyErr_Fetch(&etype, &eval, &etb);
130068     ++Py_REFCNT(o);
130069     __pyx_pf_4lxml_5etree_30_ParserSchemaValidationContext___dealloc__(o);
130070     if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
130071     --Py_REFCNT(o);
130072     PyErr_Restore(etype, eval, etb);
130073   }
130074   Py_XDECREF(((PyObject *)p->_schema));
130075   (*Py_TYPE(o)->tp_free)(o);
130076 }
130077
130078 static int __pyx_tp_traverse_4lxml_5etree__ParserSchemaValidationContext(PyObject *o, visitproc v, void *a) {
130079   int e;
130080   struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *p = (struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *)o;
130081   if (p->_schema) {
130082     e = (*v)(((PyObject*)p->_schema), a); if (e) return e;
130083   }
130084   return 0;
130085 }
130086
130087 static int __pyx_tp_clear_4lxml_5etree__ParserSchemaValidationContext(PyObject *o) {
130088   struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *p = (struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *)o;
130089   PyObject* tmp;
130090   tmp = ((PyObject*)p->_schema);
130091   p->_schema = ((struct __pyx_obj_4lxml_5etree_XMLSchema *)Py_None); Py_INCREF(Py_None);
130092   Py_XDECREF(tmp);
130093   return 0;
130094 }
130095
130096 static struct PyMethodDef __pyx_methods_4lxml_5etree__ParserSchemaValidationContext[] = {
130097   {0, 0, 0, 0}
130098 };
130099
130100 static PyNumberMethods __pyx_tp_as_number__ParserSchemaValidationContext = {
130101   0, /*nb_add*/
130102   0, /*nb_subtract*/
130103   0, /*nb_multiply*/
130104   #if PY_MAJOR_VERSION < 3
130105   0, /*nb_divide*/
130106   #endif
130107   0, /*nb_remainder*/
130108   0, /*nb_divmod*/
130109   0, /*nb_power*/
130110   0, /*nb_negative*/
130111   0, /*nb_positive*/
130112   0, /*nb_absolute*/
130113   0, /*nb_nonzero*/
130114   0, /*nb_invert*/
130115   0, /*nb_lshift*/
130116   0, /*nb_rshift*/
130117   0, /*nb_and*/
130118   0, /*nb_xor*/
130119   0, /*nb_or*/
130120   #if PY_MAJOR_VERSION < 3
130121   0, /*nb_coerce*/
130122   #endif
130123   0, /*nb_int*/
130124   #if PY_MAJOR_VERSION >= 3
130125   0, /*reserved*/
130126   #else
130127   0, /*nb_long*/
130128   #endif
130129   0, /*nb_float*/
130130   #if PY_MAJOR_VERSION < 3
130131   0, /*nb_oct*/
130132   #endif
130133   #if PY_MAJOR_VERSION < 3
130134   0, /*nb_hex*/
130135   #endif
130136   0, /*nb_inplace_add*/
130137   0, /*nb_inplace_subtract*/
130138   0, /*nb_inplace_multiply*/
130139   #if PY_MAJOR_VERSION < 3
130140   0, /*nb_inplace_divide*/
130141   #endif
130142   0, /*nb_inplace_remainder*/
130143   0, /*nb_inplace_power*/
130144   0, /*nb_inplace_lshift*/
130145   0, /*nb_inplace_rshift*/
130146   0, /*nb_inplace_and*/
130147   0, /*nb_inplace_xor*/
130148   0, /*nb_inplace_or*/
130149   0, /*nb_floor_divide*/
130150   0, /*nb_true_divide*/
130151   0, /*nb_inplace_floor_divide*/
130152   0, /*nb_inplace_true_divide*/
130153   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
130154   0, /*nb_index*/
130155   #endif
130156 };
130157
130158 static PySequenceMethods __pyx_tp_as_sequence__ParserSchemaValidationContext = {
130159   0, /*sq_length*/
130160   0, /*sq_concat*/
130161   0, /*sq_repeat*/
130162   0, /*sq_item*/
130163   0, /*sq_slice*/
130164   0, /*sq_ass_item*/
130165   0, /*sq_ass_slice*/
130166   0, /*sq_contains*/
130167   0, /*sq_inplace_concat*/
130168   0, /*sq_inplace_repeat*/
130169 };
130170
130171 static PyMappingMethods __pyx_tp_as_mapping__ParserSchemaValidationContext = {
130172   0, /*mp_length*/
130173   0, /*mp_subscript*/
130174   0, /*mp_ass_subscript*/
130175 };
130176
130177 static PyBufferProcs __pyx_tp_as_buffer__ParserSchemaValidationContext = {
130178   #if PY_MAJOR_VERSION < 3
130179   0, /*bf_getreadbuffer*/
130180   #endif
130181   #if PY_MAJOR_VERSION < 3
130182   0, /*bf_getwritebuffer*/
130183   #endif
130184   #if PY_MAJOR_VERSION < 3
130185   0, /*bf_getsegcount*/
130186   #endif
130187   #if PY_MAJOR_VERSION < 3
130188   0, /*bf_getcharbuffer*/
130189   #endif
130190   #if PY_VERSION_HEX >= 0x02060000
130191   0, /*bf_getbuffer*/
130192   #endif
130193   #if PY_VERSION_HEX >= 0x02060000
130194   0, /*bf_releasebuffer*/
130195   #endif
130196 };
130197
130198 PyTypeObject __pyx_type_4lxml_5etree__ParserSchemaValidationContext = {
130199   PyVarObject_HEAD_INIT(0, 0)
130200   __Pyx_NAMESTR("lxml.etree._ParserSchemaValidationContext"), /*tp_name*/
130201   sizeof(struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext), /*tp_basicsize*/
130202   0, /*tp_itemsize*/
130203   __pyx_tp_dealloc_4lxml_5etree__ParserSchemaValidationContext, /*tp_dealloc*/
130204   0, /*tp_print*/
130205   0, /*tp_getattr*/
130206   0, /*tp_setattr*/
130207   0, /*tp_compare*/
130208   0, /*tp_repr*/
130209   &__pyx_tp_as_number__ParserSchemaValidationContext, /*tp_as_number*/
130210   &__pyx_tp_as_sequence__ParserSchemaValidationContext, /*tp_as_sequence*/
130211   &__pyx_tp_as_mapping__ParserSchemaValidationContext, /*tp_as_mapping*/
130212   0, /*tp_hash*/
130213   0, /*tp_call*/
130214   0, /*tp_str*/
130215   0, /*tp_getattro*/
130216   0, /*tp_setattro*/
130217   &__pyx_tp_as_buffer__ParserSchemaValidationContext, /*tp_as_buffer*/
130218   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
130219   0, /*tp_doc*/
130220   __pyx_tp_traverse_4lxml_5etree__ParserSchemaValidationContext, /*tp_traverse*/
130221   __pyx_tp_clear_4lxml_5etree__ParserSchemaValidationContext, /*tp_clear*/
130222   0, /*tp_richcompare*/
130223   0, /*tp_weaklistoffset*/
130224   0, /*tp_iter*/
130225   0, /*tp_iternext*/
130226   __pyx_methods_4lxml_5etree__ParserSchemaValidationContext, /*tp_methods*/
130227   0, /*tp_members*/
130228   0, /*tp_getset*/
130229   0, /*tp_base*/
130230   0, /*tp_dict*/
130231   0, /*tp_descr_get*/
130232   0, /*tp_descr_set*/
130233   0, /*tp_dictoffset*/
130234   0, /*tp_init*/
130235   0, /*tp_alloc*/
130236   __pyx_tp_new_4lxml_5etree__ParserSchemaValidationContext, /*tp_new*/
130237   0, /*tp_free*/
130238   0, /*tp_is_gc*/
130239   0, /*tp_bases*/
130240   0, /*tp_mro*/
130241   0, /*tp_cache*/
130242   0, /*tp_subclasses*/
130243   0, /*tp_weaklist*/
130244 };
130245
130246 static PyObject *__pyx_tp_new_4lxml_5etree__Validator(PyTypeObject *t, PyObject *a, PyObject *k) {
130247   struct __pyx_obj_4lxml_5etree__Validator *p;
130248   PyObject *o = (*t->tp_alloc)(t, 0);
130249   if (!o) return 0;
130250   p = ((struct __pyx_obj_4lxml_5etree__Validator *)o);
130251   p->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
130252   return o;
130253 }
130254
130255 static void __pyx_tp_dealloc_4lxml_5etree__Validator(PyObject *o) {
130256   struct __pyx_obj_4lxml_5etree__Validator *p = (struct __pyx_obj_4lxml_5etree__Validator *)o;
130257   Py_XDECREF(((PyObject *)p->_error_log));
130258   (*Py_TYPE(o)->tp_free)(o);
130259 }
130260
130261 static int __pyx_tp_traverse_4lxml_5etree__Validator(PyObject *o, visitproc v, void *a) {
130262   int e;
130263   struct __pyx_obj_4lxml_5etree__Validator *p = (struct __pyx_obj_4lxml_5etree__Validator *)o;
130264   if (p->_error_log) {
130265     e = (*v)(((PyObject*)p->_error_log), a); if (e) return e;
130266   }
130267   return 0;
130268 }
130269
130270 static int __pyx_tp_clear_4lxml_5etree__Validator(PyObject *o) {
130271   struct __pyx_obj_4lxml_5etree__Validator *p = (struct __pyx_obj_4lxml_5etree__Validator *)o;
130272   PyObject* tmp;
130273   tmp = ((PyObject*)p->_error_log);
130274   p->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
130275   Py_XDECREF(tmp);
130276   return 0;
130277 }
130278
130279 static PyObject *__pyx_getprop_4lxml_5etree_10_Validator_error_log(PyObject *o, void *x) {
130280   return __pyx_pf_4lxml_5etree_10_Validator_9error_log___get__(o);
130281 }
130282
130283 static struct PyMethodDef __pyx_methods_4lxml_5etree__Validator[] = {
130284   {__Pyx_NAMESTR("validate"), (PyCFunction)__pyx_pf_4lxml_5etree_10_Validator_validate, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_10_Validator_validate)},
130285   {__Pyx_NAMESTR("assertValid"), (PyCFunction)__pyx_pf_4lxml_5etree_10_Validator_assertValid, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_10_Validator_assertValid)},
130286   {__Pyx_NAMESTR("assert_"), (PyCFunction)__pyx_pf_4lxml_5etree_10_Validator_assert_, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_10_Validator_assert_)},
130287   {0, 0, 0, 0}
130288 };
130289
130290 static struct PyGetSetDef __pyx_getsets_4lxml_5etree__Validator[] = {
130291   {(char *)"error_log", __pyx_getprop_4lxml_5etree_10_Validator_error_log, 0, __pyx_k_35, 0},
130292   {0, 0, 0, 0, 0}
130293 };
130294
130295 static PyNumberMethods __pyx_tp_as_number__Validator = {
130296   0, /*nb_add*/
130297   0, /*nb_subtract*/
130298   0, /*nb_multiply*/
130299   #if PY_MAJOR_VERSION < 3
130300   0, /*nb_divide*/
130301   #endif
130302   0, /*nb_remainder*/
130303   0, /*nb_divmod*/
130304   0, /*nb_power*/
130305   0, /*nb_negative*/
130306   0, /*nb_positive*/
130307   0, /*nb_absolute*/
130308   0, /*nb_nonzero*/
130309   0, /*nb_invert*/
130310   0, /*nb_lshift*/
130311   0, /*nb_rshift*/
130312   0, /*nb_and*/
130313   0, /*nb_xor*/
130314   0, /*nb_or*/
130315   #if PY_MAJOR_VERSION < 3
130316   0, /*nb_coerce*/
130317   #endif
130318   0, /*nb_int*/
130319   #if PY_MAJOR_VERSION >= 3
130320   0, /*reserved*/
130321   #else
130322   0, /*nb_long*/
130323   #endif
130324   0, /*nb_float*/
130325   #if PY_MAJOR_VERSION < 3
130326   0, /*nb_oct*/
130327   #endif
130328   #if PY_MAJOR_VERSION < 3
130329   0, /*nb_hex*/
130330   #endif
130331   0, /*nb_inplace_add*/
130332   0, /*nb_inplace_subtract*/
130333   0, /*nb_inplace_multiply*/
130334   #if PY_MAJOR_VERSION < 3
130335   0, /*nb_inplace_divide*/
130336   #endif
130337   0, /*nb_inplace_remainder*/
130338   0, /*nb_inplace_power*/
130339   0, /*nb_inplace_lshift*/
130340   0, /*nb_inplace_rshift*/
130341   0, /*nb_inplace_and*/
130342   0, /*nb_inplace_xor*/
130343   0, /*nb_inplace_or*/
130344   0, /*nb_floor_divide*/
130345   0, /*nb_true_divide*/
130346   0, /*nb_inplace_floor_divide*/
130347   0, /*nb_inplace_true_divide*/
130348   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
130349   0, /*nb_index*/
130350   #endif
130351 };
130352
130353 static PySequenceMethods __pyx_tp_as_sequence__Validator = {
130354   0, /*sq_length*/
130355   0, /*sq_concat*/
130356   0, /*sq_repeat*/
130357   0, /*sq_item*/
130358   0, /*sq_slice*/
130359   0, /*sq_ass_item*/
130360   0, /*sq_ass_slice*/
130361   0, /*sq_contains*/
130362   0, /*sq_inplace_concat*/
130363   0, /*sq_inplace_repeat*/
130364 };
130365
130366 static PyMappingMethods __pyx_tp_as_mapping__Validator = {
130367   0, /*mp_length*/
130368   0, /*mp_subscript*/
130369   0, /*mp_ass_subscript*/
130370 };
130371
130372 static PyBufferProcs __pyx_tp_as_buffer__Validator = {
130373   #if PY_MAJOR_VERSION < 3
130374   0, /*bf_getreadbuffer*/
130375   #endif
130376   #if PY_MAJOR_VERSION < 3
130377   0, /*bf_getwritebuffer*/
130378   #endif
130379   #if PY_MAJOR_VERSION < 3
130380   0, /*bf_getsegcount*/
130381   #endif
130382   #if PY_MAJOR_VERSION < 3
130383   0, /*bf_getcharbuffer*/
130384   #endif
130385   #if PY_VERSION_HEX >= 0x02060000
130386   0, /*bf_getbuffer*/
130387   #endif
130388   #if PY_VERSION_HEX >= 0x02060000
130389   0, /*bf_releasebuffer*/
130390   #endif
130391 };
130392
130393 PyTypeObject __pyx_type_4lxml_5etree__Validator = {
130394   PyVarObject_HEAD_INIT(0, 0)
130395   __Pyx_NAMESTR("lxml.etree._Validator"), /*tp_name*/
130396   sizeof(struct __pyx_obj_4lxml_5etree__Validator), /*tp_basicsize*/
130397   0, /*tp_itemsize*/
130398   __pyx_tp_dealloc_4lxml_5etree__Validator, /*tp_dealloc*/
130399   0, /*tp_print*/
130400   0, /*tp_getattr*/
130401   0, /*tp_setattr*/
130402   0, /*tp_compare*/
130403   0, /*tp_repr*/
130404   &__pyx_tp_as_number__Validator, /*tp_as_number*/
130405   &__pyx_tp_as_sequence__Validator, /*tp_as_sequence*/
130406   &__pyx_tp_as_mapping__Validator, /*tp_as_mapping*/
130407   0, /*tp_hash*/
130408   0, /*tp_call*/
130409   0, /*tp_str*/
130410   0, /*tp_getattro*/
130411   0, /*tp_setattro*/
130412   &__pyx_tp_as_buffer__Validator, /*tp_as_buffer*/
130413   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
130414   __Pyx_DOCSTR("Base class for XML validators."), /*tp_doc*/
130415   __pyx_tp_traverse_4lxml_5etree__Validator, /*tp_traverse*/
130416   __pyx_tp_clear_4lxml_5etree__Validator, /*tp_clear*/
130417   0, /*tp_richcompare*/
130418   0, /*tp_weaklistoffset*/
130419   0, /*tp_iter*/
130420   0, /*tp_iternext*/
130421   __pyx_methods_4lxml_5etree__Validator, /*tp_methods*/
130422   0, /*tp_members*/
130423   __pyx_getsets_4lxml_5etree__Validator, /*tp_getset*/
130424   0, /*tp_base*/
130425   0, /*tp_dict*/
130426   0, /*tp_descr_get*/
130427   0, /*tp_descr_set*/
130428   0, /*tp_dictoffset*/
130429   __pyx_pf_4lxml_5etree_10_Validator___init__, /*tp_init*/
130430   0, /*tp_alloc*/
130431   __pyx_tp_new_4lxml_5etree__Validator, /*tp_new*/
130432   0, /*tp_free*/
130433   0, /*tp_is_gc*/
130434   0, /*tp_bases*/
130435   0, /*tp_mro*/
130436   0, /*tp_cache*/
130437   0, /*tp_subclasses*/
130438   0, /*tp_weaklist*/
130439 };
130440 static struct __pyx_vtabstruct_4lxml_5etree_XMLSchema __pyx_vtable_4lxml_5etree_XMLSchema;
130441
130442 static PyObject *__pyx_tp_new_4lxml_5etree_XMLSchema(PyTypeObject *t, PyObject *a, PyObject *k) {
130443   struct __pyx_obj_4lxml_5etree_XMLSchema *p;
130444   PyObject *o = __pyx_tp_new_4lxml_5etree__Validator(t, a, k);
130445   if (!o) return 0;
130446   p = ((struct __pyx_obj_4lxml_5etree_XMLSchema *)o);
130447   p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree_XMLSchema;
130448   return o;
130449 }
130450
130451 static void __pyx_tp_dealloc_4lxml_5etree_XMLSchema(PyObject *o) {
130452   {
130453     PyObject *etype, *eval, *etb;
130454     PyErr_Fetch(&etype, &eval, &etb);
130455     ++Py_REFCNT(o);
130456     __pyx_pf_4lxml_5etree_9XMLSchema___dealloc__(o);
130457     if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
130458     --Py_REFCNT(o);
130459     PyErr_Restore(etype, eval, etb);
130460   }
130461   __pyx_tp_dealloc_4lxml_5etree__Validator(o);
130462 }
130463
130464 static struct PyMethodDef __pyx_methods_4lxml_5etree_XMLSchema[] = {
130465   {__Pyx_NAMESTR("__call__"), (PyCFunction)__pyx_pf_4lxml_5etree_9XMLSchema___call__, METH_VARARGS|METH_KEYWORDS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_9XMLSchema___call__)},
130466   {0, 0, 0, 0}
130467 };
130468
130469 static PyNumberMethods __pyx_tp_as_number_XMLSchema = {
130470   0, /*nb_add*/
130471   0, /*nb_subtract*/
130472   0, /*nb_multiply*/
130473   #if PY_MAJOR_VERSION < 3
130474   0, /*nb_divide*/
130475   #endif
130476   0, /*nb_remainder*/
130477   0, /*nb_divmod*/
130478   0, /*nb_power*/
130479   0, /*nb_negative*/
130480   0, /*nb_positive*/
130481   0, /*nb_absolute*/
130482   0, /*nb_nonzero*/
130483   0, /*nb_invert*/
130484   0, /*nb_lshift*/
130485   0, /*nb_rshift*/
130486   0, /*nb_and*/
130487   0, /*nb_xor*/
130488   0, /*nb_or*/
130489   #if PY_MAJOR_VERSION < 3
130490   0, /*nb_coerce*/
130491   #endif
130492   0, /*nb_int*/
130493   #if PY_MAJOR_VERSION >= 3
130494   0, /*reserved*/
130495   #else
130496   0, /*nb_long*/
130497   #endif
130498   0, /*nb_float*/
130499   #if PY_MAJOR_VERSION < 3
130500   0, /*nb_oct*/
130501   #endif
130502   #if PY_MAJOR_VERSION < 3
130503   0, /*nb_hex*/
130504   #endif
130505   0, /*nb_inplace_add*/
130506   0, /*nb_inplace_subtract*/
130507   0, /*nb_inplace_multiply*/
130508   #if PY_MAJOR_VERSION < 3
130509   0, /*nb_inplace_divide*/
130510   #endif
130511   0, /*nb_inplace_remainder*/
130512   0, /*nb_inplace_power*/
130513   0, /*nb_inplace_lshift*/
130514   0, /*nb_inplace_rshift*/
130515   0, /*nb_inplace_and*/
130516   0, /*nb_inplace_xor*/
130517   0, /*nb_inplace_or*/
130518   0, /*nb_floor_divide*/
130519   0, /*nb_true_divide*/
130520   0, /*nb_inplace_floor_divide*/
130521   0, /*nb_inplace_true_divide*/
130522   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
130523   0, /*nb_index*/
130524   #endif
130525 };
130526
130527 static PySequenceMethods __pyx_tp_as_sequence_XMLSchema = {
130528   0, /*sq_length*/
130529   0, /*sq_concat*/
130530   0, /*sq_repeat*/
130531   0, /*sq_item*/
130532   0, /*sq_slice*/
130533   0, /*sq_ass_item*/
130534   0, /*sq_ass_slice*/
130535   0, /*sq_contains*/
130536   0, /*sq_inplace_concat*/
130537   0, /*sq_inplace_repeat*/
130538 };
130539
130540 static PyMappingMethods __pyx_tp_as_mapping_XMLSchema = {
130541   0, /*mp_length*/
130542   0, /*mp_subscript*/
130543   0, /*mp_ass_subscript*/
130544 };
130545
130546 static PyBufferProcs __pyx_tp_as_buffer_XMLSchema = {
130547   #if PY_MAJOR_VERSION < 3
130548   0, /*bf_getreadbuffer*/
130549   #endif
130550   #if PY_MAJOR_VERSION < 3
130551   0, /*bf_getwritebuffer*/
130552   #endif
130553   #if PY_MAJOR_VERSION < 3
130554   0, /*bf_getsegcount*/
130555   #endif
130556   #if PY_MAJOR_VERSION < 3
130557   0, /*bf_getcharbuffer*/
130558   #endif
130559   #if PY_VERSION_HEX >= 0x02060000
130560   0, /*bf_getbuffer*/
130561   #endif
130562   #if PY_VERSION_HEX >= 0x02060000
130563   0, /*bf_releasebuffer*/
130564   #endif
130565 };
130566
130567 PyTypeObject __pyx_type_4lxml_5etree_XMLSchema = {
130568   PyVarObject_HEAD_INIT(0, 0)
130569   __Pyx_NAMESTR("lxml.etree.XMLSchema"), /*tp_name*/
130570   sizeof(struct __pyx_obj_4lxml_5etree_XMLSchema), /*tp_basicsize*/
130571   0, /*tp_itemsize*/
130572   __pyx_tp_dealloc_4lxml_5etree_XMLSchema, /*tp_dealloc*/
130573   0, /*tp_print*/
130574   0, /*tp_getattr*/
130575   0, /*tp_setattr*/
130576   0, /*tp_compare*/
130577   0, /*tp_repr*/
130578   &__pyx_tp_as_number_XMLSchema, /*tp_as_number*/
130579   &__pyx_tp_as_sequence_XMLSchema, /*tp_as_sequence*/
130580   &__pyx_tp_as_mapping_XMLSchema, /*tp_as_mapping*/
130581   0, /*tp_hash*/
130582   __pyx_pf_4lxml_5etree_9XMLSchema___call__, /*tp_call*/
130583   0, /*tp_str*/
130584   0, /*tp_getattro*/
130585   0, /*tp_setattro*/
130586   &__pyx_tp_as_buffer_XMLSchema, /*tp_as_buffer*/
130587   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
130588   __Pyx_DOCSTR("XMLSchema(self, etree=None, file=None)\n    Turn a document into an XML Schema validator.\n\n    Either pass a schema as Element or ElementTree, or pass a file or\n    filename through the ``file`` keyword argument.\n\n    Passing the ``attribute_defaults`` boolean option will make the\n    schema insert default/fixed attributes into validated documents.\n    "), /*tp_doc*/
130589   __pyx_tp_traverse_4lxml_5etree__Validator, /*tp_traverse*/
130590   __pyx_tp_clear_4lxml_5etree__Validator, /*tp_clear*/
130591   0, /*tp_richcompare*/
130592   0, /*tp_weaklistoffset*/
130593   0, /*tp_iter*/
130594   0, /*tp_iternext*/
130595   __pyx_methods_4lxml_5etree_XMLSchema, /*tp_methods*/
130596   0, /*tp_members*/
130597   0, /*tp_getset*/
130598   0, /*tp_base*/
130599   0, /*tp_dict*/
130600   0, /*tp_descr_get*/
130601   0, /*tp_descr_set*/
130602   0, /*tp_dictoffset*/
130603   __pyx_pf_4lxml_5etree_9XMLSchema___init__, /*tp_init*/
130604   0, /*tp_alloc*/
130605   __pyx_tp_new_4lxml_5etree_XMLSchema, /*tp_new*/
130606   0, /*tp_free*/
130607   0, /*tp_is_gc*/
130608   0, /*tp_bases*/
130609   0, /*tp_mro*/
130610   0, /*tp_cache*/
130611   0, /*tp_subclasses*/
130612   0, /*tp_weaklist*/
130613 };
130614 static struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext __pyx_vtable_4lxml_5etree__ParserDictionaryContext;
130615
130616 static PyObject *__pyx_tp_new_4lxml_5etree__ParserDictionaryContext(PyTypeObject *t, PyObject *a, PyObject *k) {
130617   struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *p;
130618   PyObject *o = (*t->tp_alloc)(t, 0);
130619   if (!o) return 0;
130620   p = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)o);
130621   p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__ParserDictionaryContext;
130622   p->_default_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);
130623   p->_implied_parser_contexts = ((PyObject *)Py_None); Py_INCREF(Py_None);
130624   return o;
130625 }
130626
130627 static void __pyx_tp_dealloc_4lxml_5etree__ParserDictionaryContext(PyObject *o) {
130628   struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *p = (struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)o;
130629   {
130630     PyObject *etype, *eval, *etb;
130631     PyErr_Fetch(&etype, &eval, &etb);
130632     ++Py_REFCNT(o);
130633     __pyx_pf_4lxml_5etree_24_ParserDictionaryContext___dealloc__(o);
130634     if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
130635     --Py_REFCNT(o);
130636     PyErr_Restore(etype, eval, etb);
130637   }
130638   Py_XDECREF(((PyObject *)p->_default_parser));
130639   Py_XDECREF(((PyObject *)p->_implied_parser_contexts));
130640   (*Py_TYPE(o)->tp_free)(o);
130641 }
130642
130643 static int __pyx_tp_traverse_4lxml_5etree__ParserDictionaryContext(PyObject *o, visitproc v, void *a) {
130644   int e;
130645   struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *p = (struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)o;
130646   if (p->_default_parser) {
130647     e = (*v)(((PyObject*)p->_default_parser), a); if (e) return e;
130648   }
130649   if (p->_implied_parser_contexts) {
130650     e = (*v)(p->_implied_parser_contexts, a); if (e) return e;
130651   }
130652   return 0;
130653 }
130654
130655 static int __pyx_tp_clear_4lxml_5etree__ParserDictionaryContext(PyObject *o) {
130656   struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *p = (struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)o;
130657   PyObject* tmp;
130658   tmp = ((PyObject*)p->_default_parser);
130659   p->_default_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);
130660   Py_XDECREF(tmp);
130661   tmp = ((PyObject*)p->_implied_parser_contexts);
130662   p->_implied_parser_contexts = ((PyObject *)Py_None); Py_INCREF(Py_None);
130663   Py_XDECREF(tmp);
130664   return 0;
130665 }
130666
130667 static struct PyMethodDef __pyx_methods_4lxml_5etree__ParserDictionaryContext[] = {
130668   {0, 0, 0, 0}
130669 };
130670
130671 static PyNumberMethods __pyx_tp_as_number__ParserDictionaryContext = {
130672   0, /*nb_add*/
130673   0, /*nb_subtract*/
130674   0, /*nb_multiply*/
130675   #if PY_MAJOR_VERSION < 3
130676   0, /*nb_divide*/
130677   #endif
130678   0, /*nb_remainder*/
130679   0, /*nb_divmod*/
130680   0, /*nb_power*/
130681   0, /*nb_negative*/
130682   0, /*nb_positive*/
130683   0, /*nb_absolute*/
130684   0, /*nb_nonzero*/
130685   0, /*nb_invert*/
130686   0, /*nb_lshift*/
130687   0, /*nb_rshift*/
130688   0, /*nb_and*/
130689   0, /*nb_xor*/
130690   0, /*nb_or*/
130691   #if PY_MAJOR_VERSION < 3
130692   0, /*nb_coerce*/
130693   #endif
130694   0, /*nb_int*/
130695   #if PY_MAJOR_VERSION >= 3
130696   0, /*reserved*/
130697   #else
130698   0, /*nb_long*/
130699   #endif
130700   0, /*nb_float*/
130701   #if PY_MAJOR_VERSION < 3
130702   0, /*nb_oct*/
130703   #endif
130704   #if PY_MAJOR_VERSION < 3
130705   0, /*nb_hex*/
130706   #endif
130707   0, /*nb_inplace_add*/
130708   0, /*nb_inplace_subtract*/
130709   0, /*nb_inplace_multiply*/
130710   #if PY_MAJOR_VERSION < 3
130711   0, /*nb_inplace_divide*/
130712   #endif
130713   0, /*nb_inplace_remainder*/
130714   0, /*nb_inplace_power*/
130715   0, /*nb_inplace_lshift*/
130716   0, /*nb_inplace_rshift*/
130717   0, /*nb_inplace_and*/
130718   0, /*nb_inplace_xor*/
130719   0, /*nb_inplace_or*/
130720   0, /*nb_floor_divide*/
130721   0, /*nb_true_divide*/
130722   0, /*nb_inplace_floor_divide*/
130723   0, /*nb_inplace_true_divide*/
130724   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
130725   0, /*nb_index*/
130726   #endif
130727 };
130728
130729 static PySequenceMethods __pyx_tp_as_sequence__ParserDictionaryContext = {
130730   0, /*sq_length*/
130731   0, /*sq_concat*/
130732   0, /*sq_repeat*/
130733   0, /*sq_item*/
130734   0, /*sq_slice*/
130735   0, /*sq_ass_item*/
130736   0, /*sq_ass_slice*/
130737   0, /*sq_contains*/
130738   0, /*sq_inplace_concat*/
130739   0, /*sq_inplace_repeat*/
130740 };
130741
130742 static PyMappingMethods __pyx_tp_as_mapping__ParserDictionaryContext = {
130743   0, /*mp_length*/
130744   0, /*mp_subscript*/
130745   0, /*mp_ass_subscript*/
130746 };
130747
130748 static PyBufferProcs __pyx_tp_as_buffer__ParserDictionaryContext = {
130749   #if PY_MAJOR_VERSION < 3
130750   0, /*bf_getreadbuffer*/
130751   #endif
130752   #if PY_MAJOR_VERSION < 3
130753   0, /*bf_getwritebuffer*/
130754   #endif
130755   #if PY_MAJOR_VERSION < 3
130756   0, /*bf_getsegcount*/
130757   #endif
130758   #if PY_MAJOR_VERSION < 3
130759   0, /*bf_getcharbuffer*/
130760   #endif
130761   #if PY_VERSION_HEX >= 0x02060000
130762   0, /*bf_getbuffer*/
130763   #endif
130764   #if PY_VERSION_HEX >= 0x02060000
130765   0, /*bf_releasebuffer*/
130766   #endif
130767 };
130768
130769 PyTypeObject __pyx_type_4lxml_5etree__ParserDictionaryContext = {
130770   PyVarObject_HEAD_INIT(0, 0)
130771   __Pyx_NAMESTR("lxml.etree._ParserDictionaryContext"), /*tp_name*/
130772   sizeof(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext), /*tp_basicsize*/
130773   0, /*tp_itemsize*/
130774   __pyx_tp_dealloc_4lxml_5etree__ParserDictionaryContext, /*tp_dealloc*/
130775   0, /*tp_print*/
130776   0, /*tp_getattr*/
130777   0, /*tp_setattr*/
130778   0, /*tp_compare*/
130779   0, /*tp_repr*/
130780   &__pyx_tp_as_number__ParserDictionaryContext, /*tp_as_number*/
130781   &__pyx_tp_as_sequence__ParserDictionaryContext, /*tp_as_sequence*/
130782   &__pyx_tp_as_mapping__ParserDictionaryContext, /*tp_as_mapping*/
130783   0, /*tp_hash*/
130784   0, /*tp_call*/
130785   0, /*tp_str*/
130786   0, /*tp_getattro*/
130787   0, /*tp_setattro*/
130788   &__pyx_tp_as_buffer__ParserDictionaryContext, /*tp_as_buffer*/
130789   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
130790   0, /*tp_doc*/
130791   __pyx_tp_traverse_4lxml_5etree__ParserDictionaryContext, /*tp_traverse*/
130792   __pyx_tp_clear_4lxml_5etree__ParserDictionaryContext, /*tp_clear*/
130793   0, /*tp_richcompare*/
130794   0, /*tp_weaklistoffset*/
130795   0, /*tp_iter*/
130796   0, /*tp_iternext*/
130797   __pyx_methods_4lxml_5etree__ParserDictionaryContext, /*tp_methods*/
130798   0, /*tp_members*/
130799   0, /*tp_getset*/
130800   0, /*tp_base*/
130801   0, /*tp_dict*/
130802   0, /*tp_descr_get*/
130803   0, /*tp_descr_set*/
130804   0, /*tp_dictoffset*/
130805   __pyx_pf_4lxml_5etree_24_ParserDictionaryContext___init__, /*tp_init*/
130806   0, /*tp_alloc*/
130807   __pyx_tp_new_4lxml_5etree__ParserDictionaryContext, /*tp_new*/
130808   0, /*tp_free*/
130809   0, /*tp_is_gc*/
130810   0, /*tp_bases*/
130811   0, /*tp_mro*/
130812   0, /*tp_cache*/
130813   0, /*tp_subclasses*/
130814   0, /*tp_weaklist*/
130815 };
130816 static struct __pyx_vtabstruct_4lxml_5etree__FileReaderContext __pyx_vtable_4lxml_5etree__FileReaderContext;
130817
130818 static PyObject *__pyx_tp_new_4lxml_5etree__FileReaderContext(PyTypeObject *t, PyObject *a, PyObject *k) {
130819   struct __pyx_obj_4lxml_5etree__FileReaderContext *p;
130820   PyObject *o = (*t->tp_alloc)(t, 0);
130821   if (!o) return 0;
130822   p = ((struct __pyx_obj_4lxml_5etree__FileReaderContext *)o);
130823   p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__FileReaderContext;
130824   p->_filelike = Py_None; Py_INCREF(Py_None);
130825   p->_encoding = Py_None; Py_INCREF(Py_None);
130826   p->_url = Py_None; Py_INCREF(Py_None);
130827   p->_bytes = Py_None; Py_INCREF(Py_None);
130828   p->_exc_context = ((struct __pyx_obj_4lxml_5etree__ExceptionContext *)Py_None); Py_INCREF(Py_None);
130829   return o;
130830 }
130831
130832 static void __pyx_tp_dealloc_4lxml_5etree__FileReaderContext(PyObject *o) {
130833   struct __pyx_obj_4lxml_5etree__FileReaderContext *p = (struct __pyx_obj_4lxml_5etree__FileReaderContext *)o;
130834   Py_XDECREF(p->_filelike);
130835   Py_XDECREF(p->_encoding);
130836   Py_XDECREF(p->_url);
130837   Py_XDECREF(p->_bytes);
130838   Py_XDECREF(((PyObject *)p->_exc_context));
130839   (*Py_TYPE(o)->tp_free)(o);
130840 }
130841
130842 static int __pyx_tp_traverse_4lxml_5etree__FileReaderContext(PyObject *o, visitproc v, void *a) {
130843   int e;
130844   struct __pyx_obj_4lxml_5etree__FileReaderContext *p = (struct __pyx_obj_4lxml_5etree__FileReaderContext *)o;
130845   if (p->_filelike) {
130846     e = (*v)(p->_filelike, a); if (e) return e;
130847   }
130848   if (p->_encoding) {
130849     e = (*v)(p->_encoding, a); if (e) return e;
130850   }
130851   if (p->_url) {
130852     e = (*v)(p->_url, a); if (e) return e;
130853   }
130854   if (p->_bytes) {
130855     e = (*v)(p->_bytes, a); if (e) return e;
130856   }
130857   if (p->_exc_context) {
130858     e = (*v)(((PyObject*)p->_exc_context), a); if (e) return e;
130859   }
130860   return 0;
130861 }
130862
130863 static int __pyx_tp_clear_4lxml_5etree__FileReaderContext(PyObject *o) {
130864   struct __pyx_obj_4lxml_5etree__FileReaderContext *p = (struct __pyx_obj_4lxml_5etree__FileReaderContext *)o;
130865   PyObject* tmp;
130866   tmp = ((PyObject*)p->_filelike);
130867   p->_filelike = Py_None; Py_INCREF(Py_None);
130868   Py_XDECREF(tmp);
130869   tmp = ((PyObject*)p->_encoding);
130870   p->_encoding = Py_None; Py_INCREF(Py_None);
130871   Py_XDECREF(tmp);
130872   tmp = ((PyObject*)p->_url);
130873   p->_url = Py_None; Py_INCREF(Py_None);
130874   Py_XDECREF(tmp);
130875   tmp = ((PyObject*)p->_bytes);
130876   p->_bytes = Py_None; Py_INCREF(Py_None);
130877   Py_XDECREF(tmp);
130878   tmp = ((PyObject*)p->_exc_context);
130879   p->_exc_context = ((struct __pyx_obj_4lxml_5etree__ExceptionContext *)Py_None); Py_INCREF(Py_None);
130880   Py_XDECREF(tmp);
130881   return 0;
130882 }
130883
130884 static struct PyMethodDef __pyx_methods_4lxml_5etree__FileReaderContext[] = {
130885   {0, 0, 0, 0}
130886 };
130887
130888 static PyNumberMethods __pyx_tp_as_number__FileReaderContext = {
130889   0, /*nb_add*/
130890   0, /*nb_subtract*/
130891   0, /*nb_multiply*/
130892   #if PY_MAJOR_VERSION < 3
130893   0, /*nb_divide*/
130894   #endif
130895   0, /*nb_remainder*/
130896   0, /*nb_divmod*/
130897   0, /*nb_power*/
130898   0, /*nb_negative*/
130899   0, /*nb_positive*/
130900   0, /*nb_absolute*/
130901   0, /*nb_nonzero*/
130902   0, /*nb_invert*/
130903   0, /*nb_lshift*/
130904   0, /*nb_rshift*/
130905   0, /*nb_and*/
130906   0, /*nb_xor*/
130907   0, /*nb_or*/
130908   #if PY_MAJOR_VERSION < 3
130909   0, /*nb_coerce*/
130910   #endif
130911   0, /*nb_int*/
130912   #if PY_MAJOR_VERSION >= 3
130913   0, /*reserved*/
130914   #else
130915   0, /*nb_long*/
130916   #endif
130917   0, /*nb_float*/
130918   #if PY_MAJOR_VERSION < 3
130919   0, /*nb_oct*/
130920   #endif
130921   #if PY_MAJOR_VERSION < 3
130922   0, /*nb_hex*/
130923   #endif
130924   0, /*nb_inplace_add*/
130925   0, /*nb_inplace_subtract*/
130926   0, /*nb_inplace_multiply*/
130927   #if PY_MAJOR_VERSION < 3
130928   0, /*nb_inplace_divide*/
130929   #endif
130930   0, /*nb_inplace_remainder*/
130931   0, /*nb_inplace_power*/
130932   0, /*nb_inplace_lshift*/
130933   0, /*nb_inplace_rshift*/
130934   0, /*nb_inplace_and*/
130935   0, /*nb_inplace_xor*/
130936   0, /*nb_inplace_or*/
130937   0, /*nb_floor_divide*/
130938   0, /*nb_true_divide*/
130939   0, /*nb_inplace_floor_divide*/
130940   0, /*nb_inplace_true_divide*/
130941   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
130942   0, /*nb_index*/
130943   #endif
130944 };
130945
130946 static PySequenceMethods __pyx_tp_as_sequence__FileReaderContext = {
130947   0, /*sq_length*/
130948   0, /*sq_concat*/
130949   0, /*sq_repeat*/
130950   0, /*sq_item*/
130951   0, /*sq_slice*/
130952   0, /*sq_ass_item*/
130953   0, /*sq_ass_slice*/
130954   0, /*sq_contains*/
130955   0, /*sq_inplace_concat*/
130956   0, /*sq_inplace_repeat*/
130957 };
130958
130959 static PyMappingMethods __pyx_tp_as_mapping__FileReaderContext = {
130960   0, /*mp_length*/
130961   0, /*mp_subscript*/
130962   0, /*mp_ass_subscript*/
130963 };
130964
130965 static PyBufferProcs __pyx_tp_as_buffer__FileReaderContext = {
130966   #if PY_MAJOR_VERSION < 3
130967   0, /*bf_getreadbuffer*/
130968   #endif
130969   #if PY_MAJOR_VERSION < 3
130970   0, /*bf_getwritebuffer*/
130971   #endif
130972   #if PY_MAJOR_VERSION < 3
130973   0, /*bf_getsegcount*/
130974   #endif
130975   #if PY_MAJOR_VERSION < 3
130976   0, /*bf_getcharbuffer*/
130977   #endif
130978   #if PY_VERSION_HEX >= 0x02060000
130979   0, /*bf_getbuffer*/
130980   #endif
130981   #if PY_VERSION_HEX >= 0x02060000
130982   0, /*bf_releasebuffer*/
130983   #endif
130984 };
130985
130986 PyTypeObject __pyx_type_4lxml_5etree__FileReaderContext = {
130987   PyVarObject_HEAD_INIT(0, 0)
130988   __Pyx_NAMESTR("lxml.etree._FileReaderContext"), /*tp_name*/
130989   sizeof(struct __pyx_obj_4lxml_5etree__FileReaderContext), /*tp_basicsize*/
130990   0, /*tp_itemsize*/
130991   __pyx_tp_dealloc_4lxml_5etree__FileReaderContext, /*tp_dealloc*/
130992   0, /*tp_print*/
130993   0, /*tp_getattr*/
130994   0, /*tp_setattr*/
130995   0, /*tp_compare*/
130996   0, /*tp_repr*/
130997   &__pyx_tp_as_number__FileReaderContext, /*tp_as_number*/
130998   &__pyx_tp_as_sequence__FileReaderContext, /*tp_as_sequence*/
130999   &__pyx_tp_as_mapping__FileReaderContext, /*tp_as_mapping*/
131000   0, /*tp_hash*/
131001   0, /*tp_call*/
131002   0, /*tp_str*/
131003   0, /*tp_getattro*/
131004   0, /*tp_setattro*/
131005   &__pyx_tp_as_buffer__FileReaderContext, /*tp_as_buffer*/
131006   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
131007   0, /*tp_doc*/
131008   __pyx_tp_traverse_4lxml_5etree__FileReaderContext, /*tp_traverse*/
131009   __pyx_tp_clear_4lxml_5etree__FileReaderContext, /*tp_clear*/
131010   0, /*tp_richcompare*/
131011   0, /*tp_weaklistoffset*/
131012   0, /*tp_iter*/
131013   0, /*tp_iternext*/
131014   __pyx_methods_4lxml_5etree__FileReaderContext, /*tp_methods*/
131015   0, /*tp_members*/
131016   0, /*tp_getset*/
131017   0, /*tp_base*/
131018   0, /*tp_dict*/
131019   0, /*tp_descr_get*/
131020   0, /*tp_descr_set*/
131021   0, /*tp_dictoffset*/
131022   __pyx_pf_4lxml_5etree_18_FileReaderContext___init__, /*tp_init*/
131023   0, /*tp_alloc*/
131024   __pyx_tp_new_4lxml_5etree__FileReaderContext, /*tp_new*/
131025   0, /*tp_free*/
131026   0, /*tp_is_gc*/
131027   0, /*tp_bases*/
131028   0, /*tp_mro*/
131029   0, /*tp_cache*/
131030   0, /*tp_subclasses*/
131031   0, /*tp_weaklist*/
131032 };
131033 static struct __pyx_vtabstruct_4lxml_5etree__FeedParser __pyx_vtable_4lxml_5etree__FeedParser;
131034
131035 static PyObject *__pyx_tp_new_4lxml_5etree__FeedParser(PyTypeObject *t, PyObject *a, PyObject *k) {
131036   struct __pyx_obj_4lxml_5etree__FeedParser *p;
131037   PyObject *o = __pyx_tp_new_4lxml_5etree__BaseParser(t, a, k);
131038   if (!o) return 0;
131039   p = ((struct __pyx_obj_4lxml_5etree__FeedParser *)o);
131040   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__BaseParser*)__pyx_vtabptr_4lxml_5etree__FeedParser;
131041   return o;
131042 }
131043
131044 static PyObject *__pyx_getprop_4lxml_5etree_11_FeedParser_feed_error_log(PyObject *o, void *x) {
131045   return __pyx_pf_4lxml_5etree_11_FeedParser_14feed_error_log___get__(o);
131046 }
131047
131048 static struct PyMethodDef __pyx_methods_4lxml_5etree__FeedParser[] = {
131049   {__Pyx_NAMESTR("feed"), (PyCFunction)__pyx_pf_4lxml_5etree_11_FeedParser_feed, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_11_FeedParser_feed)},
131050   {__Pyx_NAMESTR("close"), (PyCFunction)__pyx_pf_4lxml_5etree_11_FeedParser_close, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_11_FeedParser_close)},
131051   {0, 0, 0, 0}
131052 };
131053
131054 static struct PyGetSetDef __pyx_getsets_4lxml_5etree__FeedParser[] = {
131055   {(char *)"feed_error_log", __pyx_getprop_4lxml_5etree_11_FeedParser_feed_error_log, 0, __pyx_k_30, 0},
131056   {0, 0, 0, 0, 0}
131057 };
131058
131059 static PyNumberMethods __pyx_tp_as_number__FeedParser = {
131060   0, /*nb_add*/
131061   0, /*nb_subtract*/
131062   0, /*nb_multiply*/
131063   #if PY_MAJOR_VERSION < 3
131064   0, /*nb_divide*/
131065   #endif
131066   0, /*nb_remainder*/
131067   0, /*nb_divmod*/
131068   0, /*nb_power*/
131069   0, /*nb_negative*/
131070   0, /*nb_positive*/
131071   0, /*nb_absolute*/
131072   0, /*nb_nonzero*/
131073   0, /*nb_invert*/
131074   0, /*nb_lshift*/
131075   0, /*nb_rshift*/
131076   0, /*nb_and*/
131077   0, /*nb_xor*/
131078   0, /*nb_or*/
131079   #if PY_MAJOR_VERSION < 3
131080   0, /*nb_coerce*/
131081   #endif
131082   0, /*nb_int*/
131083   #if PY_MAJOR_VERSION >= 3
131084   0, /*reserved*/
131085   #else
131086   0, /*nb_long*/
131087   #endif
131088   0, /*nb_float*/
131089   #if PY_MAJOR_VERSION < 3
131090   0, /*nb_oct*/
131091   #endif
131092   #if PY_MAJOR_VERSION < 3
131093   0, /*nb_hex*/
131094   #endif
131095   0, /*nb_inplace_add*/
131096   0, /*nb_inplace_subtract*/
131097   0, /*nb_inplace_multiply*/
131098   #if PY_MAJOR_VERSION < 3
131099   0, /*nb_inplace_divide*/
131100   #endif
131101   0, /*nb_inplace_remainder*/
131102   0, /*nb_inplace_power*/
131103   0, /*nb_inplace_lshift*/
131104   0, /*nb_inplace_rshift*/
131105   0, /*nb_inplace_and*/
131106   0, /*nb_inplace_xor*/
131107   0, /*nb_inplace_or*/
131108   0, /*nb_floor_divide*/
131109   0, /*nb_true_divide*/
131110   0, /*nb_inplace_floor_divide*/
131111   0, /*nb_inplace_true_divide*/
131112   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
131113   0, /*nb_index*/
131114   #endif
131115 };
131116
131117 static PySequenceMethods __pyx_tp_as_sequence__FeedParser = {
131118   0, /*sq_length*/
131119   0, /*sq_concat*/
131120   0, /*sq_repeat*/
131121   0, /*sq_item*/
131122   0, /*sq_slice*/
131123   0, /*sq_ass_item*/
131124   0, /*sq_ass_slice*/
131125   0, /*sq_contains*/
131126   0, /*sq_inplace_concat*/
131127   0, /*sq_inplace_repeat*/
131128 };
131129
131130 static PyMappingMethods __pyx_tp_as_mapping__FeedParser = {
131131   0, /*mp_length*/
131132   0, /*mp_subscript*/
131133   0, /*mp_ass_subscript*/
131134 };
131135
131136 static PyBufferProcs __pyx_tp_as_buffer__FeedParser = {
131137   #if PY_MAJOR_VERSION < 3
131138   0, /*bf_getreadbuffer*/
131139   #endif
131140   #if PY_MAJOR_VERSION < 3
131141   0, /*bf_getwritebuffer*/
131142   #endif
131143   #if PY_MAJOR_VERSION < 3
131144   0, /*bf_getsegcount*/
131145   #endif
131146   #if PY_MAJOR_VERSION < 3
131147   0, /*bf_getcharbuffer*/
131148   #endif
131149   #if PY_VERSION_HEX >= 0x02060000
131150   0, /*bf_getbuffer*/
131151   #endif
131152   #if PY_VERSION_HEX >= 0x02060000
131153   0, /*bf_releasebuffer*/
131154   #endif
131155 };
131156
131157 PyTypeObject __pyx_type_4lxml_5etree__FeedParser = {
131158   PyVarObject_HEAD_INIT(0, 0)
131159   __Pyx_NAMESTR("lxml.etree._FeedParser"), /*tp_name*/
131160   sizeof(struct __pyx_obj_4lxml_5etree__FeedParser), /*tp_basicsize*/
131161   0, /*tp_itemsize*/
131162   __pyx_tp_dealloc_4lxml_5etree__BaseParser, /*tp_dealloc*/
131163   0, /*tp_print*/
131164   0, /*tp_getattr*/
131165   0, /*tp_setattr*/
131166   0, /*tp_compare*/
131167   0, /*tp_repr*/
131168   &__pyx_tp_as_number__FeedParser, /*tp_as_number*/
131169   &__pyx_tp_as_sequence__FeedParser, /*tp_as_sequence*/
131170   &__pyx_tp_as_mapping__FeedParser, /*tp_as_mapping*/
131171   0, /*tp_hash*/
131172   0, /*tp_call*/
131173   0, /*tp_str*/
131174   0, /*tp_getattro*/
131175   0, /*tp_setattro*/
131176   &__pyx_tp_as_buffer__FeedParser, /*tp_as_buffer*/
131177   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
131178   0, /*tp_doc*/
131179   __pyx_tp_traverse_4lxml_5etree__BaseParser, /*tp_traverse*/
131180   __pyx_tp_clear_4lxml_5etree__BaseParser, /*tp_clear*/
131181   0, /*tp_richcompare*/
131182   0, /*tp_weaklistoffset*/
131183   0, /*tp_iter*/
131184   0, /*tp_iternext*/
131185   __pyx_methods_4lxml_5etree__FeedParser, /*tp_methods*/
131186   0, /*tp_members*/
131187   __pyx_getsets_4lxml_5etree__FeedParser, /*tp_getset*/
131188   0, /*tp_base*/
131189   0, /*tp_dict*/
131190   0, /*tp_descr_get*/
131191   0, /*tp_descr_set*/
131192   0, /*tp_dictoffset*/
131193   0, /*tp_init*/
131194   0, /*tp_alloc*/
131195   __pyx_tp_new_4lxml_5etree__FeedParser, /*tp_new*/
131196   0, /*tp_free*/
131197   0, /*tp_is_gc*/
131198   0, /*tp_bases*/
131199   0, /*tp_mro*/
131200   0, /*tp_cache*/
131201   0, /*tp_subclasses*/
131202   0, /*tp_weaklist*/
131203 };
131204 static struct __pyx_vtabstruct_4lxml_5etree_XMLParser __pyx_vtable_4lxml_5etree_XMLParser;
131205
131206 static PyObject *__pyx_tp_new_4lxml_5etree_XMLParser(PyTypeObject *t, PyObject *a, PyObject *k) {
131207   struct __pyx_obj_4lxml_5etree_XMLParser *p;
131208   PyObject *o = __pyx_tp_new_4lxml_5etree__BaseParser(t, a, k);
131209   if (!o) return 0;
131210   p = ((struct __pyx_obj_4lxml_5etree_XMLParser *)o);
131211   p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__BaseParser*)__pyx_vtabptr_4lxml_5etree_XMLParser;
131212   return o;
131213 }
131214
131215 static struct PyMethodDef __pyx_methods_4lxml_5etree_XMLParser[] = {
131216   {0, 0, 0, 0}
131217 };
131218
131219 static PyNumberMethods __pyx_tp_as_number_XMLParser = {
131220   0, /*nb_add*/
131221   0, /*nb_subtract*/
131222   0, /*nb_multiply*/
131223   #if PY_MAJOR_VERSION < 3
131224   0, /*nb_divide*/
131225   #endif
131226   0, /*nb_remainder*/
131227   0, /*nb_divmod*/
131228   0, /*nb_power*/
131229   0, /*nb_negative*/
131230   0, /*nb_positive*/
131231   0, /*nb_absolute*/
131232   0, /*nb_nonzero*/
131233   0, /*nb_invert*/
131234   0, /*nb_lshift*/
131235   0, /*nb_rshift*/
131236   0, /*nb_and*/
131237   0, /*nb_xor*/
131238   0, /*nb_or*/
131239   #if PY_MAJOR_VERSION < 3
131240   0, /*nb_coerce*/
131241   #endif
131242   0, /*nb_int*/
131243   #if PY_MAJOR_VERSION >= 3
131244   0, /*reserved*/
131245   #else
131246   0, /*nb_long*/
131247   #endif
131248   0, /*nb_float*/
131249   #if PY_MAJOR_VERSION < 3
131250   0, /*nb_oct*/
131251   #endif
131252   #if PY_MAJOR_VERSION < 3
131253   0, /*nb_hex*/
131254   #endif
131255   0, /*nb_inplace_add*/
131256   0, /*nb_inplace_subtract*/
131257   0, /*nb_inplace_multiply*/
131258   #if PY_MAJOR_VERSION < 3
131259   0, /*nb_inplace_divide*/
131260   #endif
131261   0, /*nb_inplace_remainder*/
131262   0, /*nb_inplace_power*/
131263   0, /*nb_inplace_lshift*/
131264   0, /*nb_inplace_rshift*/
131265   0, /*nb_inplace_and*/
131266   0, /*nb_inplace_xor*/
131267   0, /*nb_inplace_or*/
131268   0, /*nb_floor_divide*/
131269   0, /*nb_true_divide*/
131270   0, /*nb_inplace_floor_divide*/
131271   0, /*nb_inplace_true_divide*/
131272   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
131273   0, /*nb_index*/
131274   #endif
131275 };
131276
131277 static PySequenceMethods __pyx_tp_as_sequence_XMLParser = {
131278   0, /*sq_length*/
131279   0, /*sq_concat*/
131280   0, /*sq_repeat*/
131281   0, /*sq_item*/
131282   0, /*sq_slice*/
131283   0, /*sq_ass_item*/
131284   0, /*sq_ass_slice*/
131285   0, /*sq_contains*/
131286   0, /*sq_inplace_concat*/
131287   0, /*sq_inplace_repeat*/
131288 };
131289
131290 static PyMappingMethods __pyx_tp_as_mapping_XMLParser = {
131291   0, /*mp_length*/
131292   0, /*mp_subscript*/
131293   0, /*mp_ass_subscript*/
131294 };
131295
131296 static PyBufferProcs __pyx_tp_as_buffer_XMLParser = {
131297   #if PY_MAJOR_VERSION < 3
131298   0, /*bf_getreadbuffer*/
131299   #endif
131300   #if PY_MAJOR_VERSION < 3
131301   0, /*bf_getwritebuffer*/
131302   #endif
131303   #if PY_MAJOR_VERSION < 3
131304   0, /*bf_getsegcount*/
131305   #endif
131306   #if PY_MAJOR_VERSION < 3
131307   0, /*bf_getcharbuffer*/
131308   #endif
131309   #if PY_VERSION_HEX >= 0x02060000
131310   0, /*bf_getbuffer*/
131311   #endif
131312   #if PY_VERSION_HEX >= 0x02060000
131313   0, /*bf_releasebuffer*/
131314   #endif
131315 };
131316
131317 PyTypeObject __pyx_type_4lxml_5etree_XMLParser = {
131318   PyVarObject_HEAD_INIT(0, 0)
131319   __Pyx_NAMESTR("lxml.etree.XMLParser"), /*tp_name*/
131320   sizeof(struct __pyx_obj_4lxml_5etree_XMLParser), /*tp_basicsize*/
131321   0, /*tp_itemsize*/
131322   __pyx_tp_dealloc_4lxml_5etree__BaseParser, /*tp_dealloc*/
131323   0, /*tp_print*/
131324   0, /*tp_getattr*/
131325   0, /*tp_setattr*/
131326   0, /*tp_compare*/
131327   0, /*tp_repr*/
131328   &__pyx_tp_as_number_XMLParser, /*tp_as_number*/
131329   &__pyx_tp_as_sequence_XMLParser, /*tp_as_sequence*/
131330   &__pyx_tp_as_mapping_XMLParser, /*tp_as_mapping*/
131331   0, /*tp_hash*/
131332   0, /*tp_call*/
131333   0, /*tp_str*/
131334   0, /*tp_getattro*/
131335   0, /*tp_setattro*/
131336   &__pyx_tp_as_buffer_XMLParser, /*tp_as_buffer*/
131337   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
131338   __Pyx_DOCSTR("XMLParser(self, encoding=None, attribute_defaults=False, dtd_validation=False, load_dtd=False, no_network=True, ns_clean=False, recover=False, XMLSchema schema=None, remove_blank_text=False, resolve_entities=True, remove_comments=False, remove_pis=False, strip_cdata=True, target=None, compact=True)\n\n    The XML parser.\n\n    Parsers can be supplied as additional argument to various parse\n    functions of the lxml API.  A default parser is always available\n    and can be replaced by a call to the global function\n    'set_default_parser'.  New parsers can be created at any time\n    without a major run-time overhead.\n\n    The keyword arguments in the constructor are mainly based on the\n    libxml2 parser configuration.  A DTD will also be loaded if DTD\n    validation or attribute default values are requested (unless you\n    additionally provide an XMLSchema from which the default\n    attributes can be read).\n\n    Available boolean keyword arguments:\n\n    - attribute_defaults - inject default attributes from DTD or XMLSchema\n    - dtd_validation     - validate against a DTD referenced by the document\n    - load_dtd           - use DTD for parsing\n    - no_network         - prevent network access for related files (default: True)\n    - ns_clean           - clean up redundant namespace declarations\n    - recover            - try hard to parse through broken XML\n    - remove_blank_text  - discard blank text nodes\n    - remove_comments    - discard comments\n    - remove_pis         - discard processing instructions\n    - strip_cdata        - replace CDATA sections by normal text content (default: True)\n    - compact            - safe memory for short text content (default: True)\n    - resolve_entities   - replace entities by their text value (default: True)\n    - huge_tree          - disable security restrictions and support very deep trees\n                           and very long text content (only affects libxml2 2.7+)\n\n    Other keyword arguments:\n\n    - encoding - override the document encoding\n    - target   - a parser target object that will receive the parse events\n    - schema   - an XMLSchema to validate against\n\n    Note that you should avoid sharing parsers between threads.  While this is\n    not harmful, it is more efficient to use separate parsers.  This does not\n    apply to the default parser.\n    "), /*tp_doc*/
131339   __pyx_tp_traverse_4lxml_5etree__BaseParser, /*tp_traverse*/
131340   __pyx_tp_clear_4lxml_5etree__BaseParser, /*tp_clear*/
131341   0, /*tp_richcompare*/
131342   0, /*tp_weaklistoffset*/
131343   0, /*tp_iter*/
131344   0, /*tp_iternext*/
131345   __pyx_methods_4lxml_5etree_XMLParser, /*tp_methods*/
131346   0, /*tp_members*/
131347   0, /*tp_getset*/
131348   0, /*tp_base*/
131349   0, /*tp_dict*/
131350   0, /*tp_descr_get*/
131351   0, /*tp_descr_set*/
131352   0, /*tp_dictoffset*/
131353   __pyx_pf_4lxml_5etree_9XMLParser___init__, /*tp_init*/
131354   0, /*tp_alloc*/
131355   __pyx_tp_new_4lxml_5etree_XMLParser, /*tp_new*/
131356   0, /*tp_free*/
131357   0, /*tp_is_gc*/
131358   0, /*tp_bases*/
131359   0, /*tp_mro*/
131360   0, /*tp_cache*/
131361   0, /*tp_subclasses*/
131362   0, /*tp_weaklist*/
131363 };
131364 static struct __pyx_vtabstruct_4lxml_5etree_ETCompatXMLParser __pyx_vtable_4lxml_5etree_ETCompatXMLParser;
131365
131366 static PyObject *__pyx_tp_new_4lxml_5etree_ETCompatXMLParser(PyTypeObject *t, PyObject *a, PyObject *k) {
131367   struct __pyx_obj_4lxml_5etree_ETCompatXMLParser *p;
131368   PyObject *o = __pyx_tp_new_4lxml_5etree__BaseParser(t, a, k);
131369   if (!o) return 0;
131370   p = ((struct __pyx_obj_4lxml_5etree_ETCompatXMLParser *)o);
131371   p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__BaseParser*)__pyx_vtabptr_4lxml_5etree_ETCompatXMLParser;
131372   return o;
131373 }
131374
131375 static struct PyMethodDef __pyx_methods_4lxml_5etree_ETCompatXMLParser[] = {
131376   {0, 0, 0, 0}
131377 };
131378
131379 static PyNumberMethods __pyx_tp_as_number_ETCompatXMLParser = {
131380   0, /*nb_add*/
131381   0, /*nb_subtract*/
131382   0, /*nb_multiply*/
131383   #if PY_MAJOR_VERSION < 3
131384   0, /*nb_divide*/
131385   #endif
131386   0, /*nb_remainder*/
131387   0, /*nb_divmod*/
131388   0, /*nb_power*/
131389   0, /*nb_negative*/
131390   0, /*nb_positive*/
131391   0, /*nb_absolute*/
131392   0, /*nb_nonzero*/
131393   0, /*nb_invert*/
131394   0, /*nb_lshift*/
131395   0, /*nb_rshift*/
131396   0, /*nb_and*/
131397   0, /*nb_xor*/
131398   0, /*nb_or*/
131399   #if PY_MAJOR_VERSION < 3
131400   0, /*nb_coerce*/
131401   #endif
131402   0, /*nb_int*/
131403   #if PY_MAJOR_VERSION >= 3
131404   0, /*reserved*/
131405   #else
131406   0, /*nb_long*/
131407   #endif
131408   0, /*nb_float*/
131409   #if PY_MAJOR_VERSION < 3
131410   0, /*nb_oct*/
131411   #endif
131412   #if PY_MAJOR_VERSION < 3
131413   0, /*nb_hex*/
131414   #endif
131415   0, /*nb_inplace_add*/
131416   0, /*nb_inplace_subtract*/
131417   0, /*nb_inplace_multiply*/
131418   #if PY_MAJOR_VERSION < 3
131419   0, /*nb_inplace_divide*/
131420   #endif
131421   0, /*nb_inplace_remainder*/
131422   0, /*nb_inplace_power*/
131423   0, /*nb_inplace_lshift*/
131424   0, /*nb_inplace_rshift*/
131425   0, /*nb_inplace_and*/
131426   0, /*nb_inplace_xor*/
131427   0, /*nb_inplace_or*/
131428   0, /*nb_floor_divide*/
131429   0, /*nb_true_divide*/
131430   0, /*nb_inplace_floor_divide*/
131431   0, /*nb_inplace_true_divide*/
131432   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
131433   0, /*nb_index*/
131434   #endif
131435 };
131436
131437 static PySequenceMethods __pyx_tp_as_sequence_ETCompatXMLParser = {
131438   0, /*sq_length*/
131439   0, /*sq_concat*/
131440   0, /*sq_repeat*/
131441   0, /*sq_item*/
131442   0, /*sq_slice*/
131443   0, /*sq_ass_item*/
131444   0, /*sq_ass_slice*/
131445   0, /*sq_contains*/
131446   0, /*sq_inplace_concat*/
131447   0, /*sq_inplace_repeat*/
131448 };
131449
131450 static PyMappingMethods __pyx_tp_as_mapping_ETCompatXMLParser = {
131451   0, /*mp_length*/
131452   0, /*mp_subscript*/
131453   0, /*mp_ass_subscript*/
131454 };
131455
131456 static PyBufferProcs __pyx_tp_as_buffer_ETCompatXMLParser = {
131457   #if PY_MAJOR_VERSION < 3
131458   0, /*bf_getreadbuffer*/
131459   #endif
131460   #if PY_MAJOR_VERSION < 3
131461   0, /*bf_getwritebuffer*/
131462   #endif
131463   #if PY_MAJOR_VERSION < 3
131464   0, /*bf_getsegcount*/
131465   #endif
131466   #if PY_MAJOR_VERSION < 3
131467   0, /*bf_getcharbuffer*/
131468   #endif
131469   #if PY_VERSION_HEX >= 0x02060000
131470   0, /*bf_getbuffer*/
131471   #endif
131472   #if PY_VERSION_HEX >= 0x02060000
131473   0, /*bf_releasebuffer*/
131474   #endif
131475 };
131476
131477 PyTypeObject __pyx_type_4lxml_5etree_ETCompatXMLParser = {
131478   PyVarObject_HEAD_INIT(0, 0)
131479   __Pyx_NAMESTR("lxml.etree.ETCompatXMLParser"), /*tp_name*/
131480   sizeof(struct __pyx_obj_4lxml_5etree_ETCompatXMLParser), /*tp_basicsize*/
131481   0, /*tp_itemsize*/
131482   __pyx_tp_dealloc_4lxml_5etree__BaseParser, /*tp_dealloc*/
131483   0, /*tp_print*/
131484   0, /*tp_getattr*/
131485   0, /*tp_setattr*/
131486   0, /*tp_compare*/
131487   0, /*tp_repr*/
131488   &__pyx_tp_as_number_ETCompatXMLParser, /*tp_as_number*/
131489   &__pyx_tp_as_sequence_ETCompatXMLParser, /*tp_as_sequence*/
131490   &__pyx_tp_as_mapping_ETCompatXMLParser, /*tp_as_mapping*/
131491   0, /*tp_hash*/
131492   0, /*tp_call*/
131493   0, /*tp_str*/
131494   0, /*tp_getattro*/
131495   0, /*tp_setattro*/
131496   &__pyx_tp_as_buffer_ETCompatXMLParser, /*tp_as_buffer*/
131497   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
131498   __Pyx_DOCSTR("ETCompatXMLParser(self, encoding=None, attribute_defaults=False,                  dtd_validation=False, load_dtd=False, no_network=True,                  ns_clean=False, recover=False, schema=None,                  remove_blank_text=False, resolve_entities=True,                  remove_comments=True, remove_pis=True, strip_cdata=True,                  target=None, compact=True)\n\n    An XML parser with an ElementTree compatible default setup.\n\n    See the XMLParser class for details.\n\n    This parser has ``remove_comments`` and ``remove_pis`` enabled by default\n    and thus ignores comments and processing instructions.\n    "), /*tp_doc*/
131499   __pyx_tp_traverse_4lxml_5etree__BaseParser, /*tp_traverse*/
131500   __pyx_tp_clear_4lxml_5etree__BaseParser, /*tp_clear*/
131501   0, /*tp_richcompare*/
131502   0, /*tp_weaklistoffset*/
131503   0, /*tp_iter*/
131504   0, /*tp_iternext*/
131505   __pyx_methods_4lxml_5etree_ETCompatXMLParser, /*tp_methods*/
131506   0, /*tp_members*/
131507   0, /*tp_getset*/
131508   0, /*tp_base*/
131509   0, /*tp_dict*/
131510   0, /*tp_descr_get*/
131511   0, /*tp_descr_set*/
131512   0, /*tp_dictoffset*/
131513   __pyx_pf_4lxml_5etree_17ETCompatXMLParser___init__, /*tp_init*/
131514   0, /*tp_alloc*/
131515   __pyx_tp_new_4lxml_5etree_ETCompatXMLParser, /*tp_new*/
131516   0, /*tp_free*/
131517   0, /*tp_is_gc*/
131518   0, /*tp_bases*/
131519   0, /*tp_mro*/
131520   0, /*tp_cache*/
131521   0, /*tp_subclasses*/
131522   0, /*tp_weaklist*/
131523 };
131524 static struct __pyx_vtabstruct_4lxml_5etree_HTMLParser __pyx_vtable_4lxml_5etree_HTMLParser;
131525
131526 static PyObject *__pyx_tp_new_4lxml_5etree_HTMLParser(PyTypeObject *t, PyObject *a, PyObject *k) {
131527   struct __pyx_obj_4lxml_5etree_HTMLParser *p;
131528   PyObject *o = __pyx_tp_new_4lxml_5etree__BaseParser(t, a, k);
131529   if (!o) return 0;
131530   p = ((struct __pyx_obj_4lxml_5etree_HTMLParser *)o);
131531   p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__BaseParser*)__pyx_vtabptr_4lxml_5etree_HTMLParser;
131532   return o;
131533 }
131534
131535 static struct PyMethodDef __pyx_methods_4lxml_5etree_HTMLParser[] = {
131536   {0, 0, 0, 0}
131537 };
131538
131539 static PyNumberMethods __pyx_tp_as_number_HTMLParser = {
131540   0, /*nb_add*/
131541   0, /*nb_subtract*/
131542   0, /*nb_multiply*/
131543   #if PY_MAJOR_VERSION < 3
131544   0, /*nb_divide*/
131545   #endif
131546   0, /*nb_remainder*/
131547   0, /*nb_divmod*/
131548   0, /*nb_power*/
131549   0, /*nb_negative*/
131550   0, /*nb_positive*/
131551   0, /*nb_absolute*/
131552   0, /*nb_nonzero*/
131553   0, /*nb_invert*/
131554   0, /*nb_lshift*/
131555   0, /*nb_rshift*/
131556   0, /*nb_and*/
131557   0, /*nb_xor*/
131558   0, /*nb_or*/
131559   #if PY_MAJOR_VERSION < 3
131560   0, /*nb_coerce*/
131561   #endif
131562   0, /*nb_int*/
131563   #if PY_MAJOR_VERSION >= 3
131564   0, /*reserved*/
131565   #else
131566   0, /*nb_long*/
131567   #endif
131568   0, /*nb_float*/
131569   #if PY_MAJOR_VERSION < 3
131570   0, /*nb_oct*/
131571   #endif
131572   #if PY_MAJOR_VERSION < 3
131573   0, /*nb_hex*/
131574   #endif
131575   0, /*nb_inplace_add*/
131576   0, /*nb_inplace_subtract*/
131577   0, /*nb_inplace_multiply*/
131578   #if PY_MAJOR_VERSION < 3
131579   0, /*nb_inplace_divide*/
131580   #endif
131581   0, /*nb_inplace_remainder*/
131582   0, /*nb_inplace_power*/
131583   0, /*nb_inplace_lshift*/
131584   0, /*nb_inplace_rshift*/
131585   0, /*nb_inplace_and*/
131586   0, /*nb_inplace_xor*/
131587   0, /*nb_inplace_or*/
131588   0, /*nb_floor_divide*/
131589   0, /*nb_true_divide*/
131590   0, /*nb_inplace_floor_divide*/
131591   0, /*nb_inplace_true_divide*/
131592   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
131593   0, /*nb_index*/
131594   #endif
131595 };
131596
131597 static PySequenceMethods __pyx_tp_as_sequence_HTMLParser = {
131598   0, /*sq_length*/
131599   0, /*sq_concat*/
131600   0, /*sq_repeat*/
131601   0, /*sq_item*/
131602   0, /*sq_slice*/
131603   0, /*sq_ass_item*/
131604   0, /*sq_ass_slice*/
131605   0, /*sq_contains*/
131606   0, /*sq_inplace_concat*/
131607   0, /*sq_inplace_repeat*/
131608 };
131609
131610 static PyMappingMethods __pyx_tp_as_mapping_HTMLParser = {
131611   0, /*mp_length*/
131612   0, /*mp_subscript*/
131613   0, /*mp_ass_subscript*/
131614 };
131615
131616 static PyBufferProcs __pyx_tp_as_buffer_HTMLParser = {
131617   #if PY_MAJOR_VERSION < 3
131618   0, /*bf_getreadbuffer*/
131619   #endif
131620   #if PY_MAJOR_VERSION < 3
131621   0, /*bf_getwritebuffer*/
131622   #endif
131623   #if PY_MAJOR_VERSION < 3
131624   0, /*bf_getsegcount*/
131625   #endif
131626   #if PY_MAJOR_VERSION < 3
131627   0, /*bf_getcharbuffer*/
131628   #endif
131629   #if PY_VERSION_HEX >= 0x02060000
131630   0, /*bf_getbuffer*/
131631   #endif
131632   #if PY_VERSION_HEX >= 0x02060000
131633   0, /*bf_releasebuffer*/
131634   #endif
131635 };
131636
131637 PyTypeObject __pyx_type_4lxml_5etree_HTMLParser = {
131638   PyVarObject_HEAD_INIT(0, 0)
131639   __Pyx_NAMESTR("lxml.etree.HTMLParser"), /*tp_name*/
131640   sizeof(struct __pyx_obj_4lxml_5etree_HTMLParser), /*tp_basicsize*/
131641   0, /*tp_itemsize*/
131642   __pyx_tp_dealloc_4lxml_5etree__BaseParser, /*tp_dealloc*/
131643   0, /*tp_print*/
131644   0, /*tp_getattr*/
131645   0, /*tp_setattr*/
131646   0, /*tp_compare*/
131647   0, /*tp_repr*/
131648   &__pyx_tp_as_number_HTMLParser, /*tp_as_number*/
131649   &__pyx_tp_as_sequence_HTMLParser, /*tp_as_sequence*/
131650   &__pyx_tp_as_mapping_HTMLParser, /*tp_as_mapping*/
131651   0, /*tp_hash*/
131652   0, /*tp_call*/
131653   0, /*tp_str*/
131654   0, /*tp_getattro*/
131655   0, /*tp_setattro*/
131656   &__pyx_tp_as_buffer_HTMLParser, /*tp_as_buffer*/
131657   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
131658   __Pyx_DOCSTR("HTMLParser(self, encoding=None, remove_blank_text=False,                    remove_comments=False, remove_pis=False, strip_cdata=True,                    no_network=True, target=None, XMLSchema schema=None,                    recover=True, compact=True)\n\n    The HTML parser.\n\n    This parser allows reading HTML into a normal XML tree.  By\n    default, it can read broken (non well-formed) HTML, depending on\n    the capabilities of libxml2.  Use the 'recover' option to switch\n    this off.\n\n    Available boolean keyword arguments:\n\n    - recover            - try hard to parse through broken HTML (default: True)\n    - no_network         - prevent network access for related files (default: True)\n    - remove_blank_text  - discard empty text nodes\n    - remove_comments    - discard comments\n    - remove_pis         - discard processing instructions\n    - strip_cdata        - replace CDATA sections by normal text content (default: True)\n    - compact            - safe memory for short text content (default: True)\n\n    Other keyword arguments:\n\n    - encoding - override the document encoding\n    - target   - a parser target object that will receive the parse events\n    - schema   - an XMLSchema to validate against\n\n    Note that you should avoid sharing parsers between threads for performance\n    reasons.\n    "), /*tp_doc*/
131659   __pyx_tp_traverse_4lxml_5etree__BaseParser, /*tp_traverse*/
131660   __pyx_tp_clear_4lxml_5etree__BaseParser, /*tp_clear*/
131661   0, /*tp_richcompare*/
131662   0, /*tp_weaklistoffset*/
131663   0, /*tp_iter*/
131664   0, /*tp_iternext*/
131665   __pyx_methods_4lxml_5etree_HTMLParser, /*tp_methods*/
131666   0, /*tp_members*/
131667   0, /*tp_getset*/
131668   0, /*tp_base*/
131669   0, /*tp_dict*/
131670   0, /*tp_descr_get*/
131671   0, /*tp_descr_set*/
131672   0, /*tp_dictoffset*/
131673   __pyx_pf_4lxml_5etree_10HTMLParser___init__, /*tp_init*/
131674   0, /*tp_alloc*/
131675   __pyx_tp_new_4lxml_5etree_HTMLParser, /*tp_new*/
131676   0, /*tp_free*/
131677   0, /*tp_is_gc*/
131678   0, /*tp_bases*/
131679   0, /*tp_mro*/
131680   0, /*tp_cache*/
131681   0, /*tp_subclasses*/
131682   0, /*tp_weaklist*/
131683 };
131684 static struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget __pyx_vtable_4lxml_5etree__SaxParserTarget;
131685
131686 static PyObject *__pyx_tp_new_4lxml_5etree__SaxParserTarget(PyTypeObject *t, PyObject *a, PyObject *k) {
131687   struct __pyx_obj_4lxml_5etree__SaxParserTarget *p;
131688   PyObject *o = (*t->tp_alloc)(t, 0);
131689   if (!o) return 0;
131690   p = ((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)o);
131691   p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__SaxParserTarget;
131692   if (__pyx_pf_4lxml_5etree_16_SaxParserTarget___cinit__(o, __pyx_empty_tuple, NULL) < 0) {
131693     Py_DECREF(o); o = 0;
131694   }
131695   return o;
131696 }
131697
131698 static void __pyx_tp_dealloc_4lxml_5etree__SaxParserTarget(PyObject *o) {
131699   (*Py_TYPE(o)->tp_free)(o);
131700 }
131701
131702 static struct PyMethodDef __pyx_methods_4lxml_5etree__SaxParserTarget[] = {
131703   {0, 0, 0, 0}
131704 };
131705
131706 static PyNumberMethods __pyx_tp_as_number__SaxParserTarget = {
131707   0, /*nb_add*/
131708   0, /*nb_subtract*/
131709   0, /*nb_multiply*/
131710   #if PY_MAJOR_VERSION < 3
131711   0, /*nb_divide*/
131712   #endif
131713   0, /*nb_remainder*/
131714   0, /*nb_divmod*/
131715   0, /*nb_power*/
131716   0, /*nb_negative*/
131717   0, /*nb_positive*/
131718   0, /*nb_absolute*/
131719   0, /*nb_nonzero*/
131720   0, /*nb_invert*/
131721   0, /*nb_lshift*/
131722   0, /*nb_rshift*/
131723   0, /*nb_and*/
131724   0, /*nb_xor*/
131725   0, /*nb_or*/
131726   #if PY_MAJOR_VERSION < 3
131727   0, /*nb_coerce*/
131728   #endif
131729   0, /*nb_int*/
131730   #if PY_MAJOR_VERSION >= 3
131731   0, /*reserved*/
131732   #else
131733   0, /*nb_long*/
131734   #endif
131735   0, /*nb_float*/
131736   #if PY_MAJOR_VERSION < 3
131737   0, /*nb_oct*/
131738   #endif
131739   #if PY_MAJOR_VERSION < 3
131740   0, /*nb_hex*/
131741   #endif
131742   0, /*nb_inplace_add*/
131743   0, /*nb_inplace_subtract*/
131744   0, /*nb_inplace_multiply*/
131745   #if PY_MAJOR_VERSION < 3
131746   0, /*nb_inplace_divide*/
131747   #endif
131748   0, /*nb_inplace_remainder*/
131749   0, /*nb_inplace_power*/
131750   0, /*nb_inplace_lshift*/
131751   0, /*nb_inplace_rshift*/
131752   0, /*nb_inplace_and*/
131753   0, /*nb_inplace_xor*/
131754   0, /*nb_inplace_or*/
131755   0, /*nb_floor_divide*/
131756   0, /*nb_true_divide*/
131757   0, /*nb_inplace_floor_divide*/
131758   0, /*nb_inplace_true_divide*/
131759   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
131760   0, /*nb_index*/
131761   #endif
131762 };
131763
131764 static PySequenceMethods __pyx_tp_as_sequence__SaxParserTarget = {
131765   0, /*sq_length*/
131766   0, /*sq_concat*/
131767   0, /*sq_repeat*/
131768   0, /*sq_item*/
131769   0, /*sq_slice*/
131770   0, /*sq_ass_item*/
131771   0, /*sq_ass_slice*/
131772   0, /*sq_contains*/
131773   0, /*sq_inplace_concat*/
131774   0, /*sq_inplace_repeat*/
131775 };
131776
131777 static PyMappingMethods __pyx_tp_as_mapping__SaxParserTarget = {
131778   0, /*mp_length*/
131779   0, /*mp_subscript*/
131780   0, /*mp_ass_subscript*/
131781 };
131782
131783 static PyBufferProcs __pyx_tp_as_buffer__SaxParserTarget = {
131784   #if PY_MAJOR_VERSION < 3
131785   0, /*bf_getreadbuffer*/
131786   #endif
131787   #if PY_MAJOR_VERSION < 3
131788   0, /*bf_getwritebuffer*/
131789   #endif
131790   #if PY_MAJOR_VERSION < 3
131791   0, /*bf_getsegcount*/
131792   #endif
131793   #if PY_MAJOR_VERSION < 3
131794   0, /*bf_getcharbuffer*/
131795   #endif
131796   #if PY_VERSION_HEX >= 0x02060000
131797   0, /*bf_getbuffer*/
131798   #endif
131799   #if PY_VERSION_HEX >= 0x02060000
131800   0, /*bf_releasebuffer*/
131801   #endif
131802 };
131803
131804 PyTypeObject __pyx_type_4lxml_5etree__SaxParserTarget = {
131805   PyVarObject_HEAD_INIT(0, 0)
131806   __Pyx_NAMESTR("lxml.etree._SaxParserTarget"), /*tp_name*/
131807   sizeof(struct __pyx_obj_4lxml_5etree__SaxParserTarget), /*tp_basicsize*/
131808   0, /*tp_itemsize*/
131809   __pyx_tp_dealloc_4lxml_5etree__SaxParserTarget, /*tp_dealloc*/
131810   0, /*tp_print*/
131811   0, /*tp_getattr*/
131812   0, /*tp_setattr*/
131813   0, /*tp_compare*/
131814   0, /*tp_repr*/
131815   &__pyx_tp_as_number__SaxParserTarget, /*tp_as_number*/
131816   &__pyx_tp_as_sequence__SaxParserTarget, /*tp_as_sequence*/
131817   &__pyx_tp_as_mapping__SaxParserTarget, /*tp_as_mapping*/
131818   0, /*tp_hash*/
131819   0, /*tp_call*/
131820   0, /*tp_str*/
131821   0, /*tp_getattro*/
131822   0, /*tp_setattro*/
131823   &__pyx_tp_as_buffer__SaxParserTarget, /*tp_as_buffer*/
131824   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
131825   0, /*tp_doc*/
131826   0, /*tp_traverse*/
131827   0, /*tp_clear*/
131828   0, /*tp_richcompare*/
131829   0, /*tp_weaklistoffset*/
131830   0, /*tp_iter*/
131831   0, /*tp_iternext*/
131832   __pyx_methods_4lxml_5etree__SaxParserTarget, /*tp_methods*/
131833   0, /*tp_members*/
131834   0, /*tp_getset*/
131835   0, /*tp_base*/
131836   0, /*tp_dict*/
131837   0, /*tp_descr_get*/
131838   0, /*tp_descr_set*/
131839   0, /*tp_dictoffset*/
131840   0, /*tp_init*/
131841   0, /*tp_alloc*/
131842   __pyx_tp_new_4lxml_5etree__SaxParserTarget, /*tp_new*/
131843   0, /*tp_free*/
131844   0, /*tp_is_gc*/
131845   0, /*tp_bases*/
131846   0, /*tp_mro*/
131847   0, /*tp_cache*/
131848   0, /*tp_subclasses*/
131849   0, /*tp_weaklist*/
131850 };
131851 static struct __pyx_vtabstruct_4lxml_5etree_TreeBuilder __pyx_vtable_4lxml_5etree_TreeBuilder;
131852
131853 static PyObject *__pyx_tp_new_4lxml_5etree_TreeBuilder(PyTypeObject *t, PyObject *a, PyObject *k) {
131854   struct __pyx_obj_4lxml_5etree_TreeBuilder *p;
131855   PyObject *o = __pyx_tp_new_4lxml_5etree__SaxParserTarget(t, a, k);
131856   if (!o) return 0;
131857   p = ((struct __pyx_obj_4lxml_5etree_TreeBuilder *)o);
131858   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget*)__pyx_vtabptr_4lxml_5etree_TreeBuilder;
131859   p->_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);
131860   p->_factory = Py_None; Py_INCREF(Py_None);
131861   p->_data = ((PyObject *)Py_None); Py_INCREF(Py_None);
131862   p->_element_stack = ((PyObject *)Py_None); Py_INCREF(Py_None);
131863   p->_element_stack_pop = Py_None; Py_INCREF(Py_None);
131864   p->_last = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
131865   return o;
131866 }
131867
131868 static void __pyx_tp_dealloc_4lxml_5etree_TreeBuilder(PyObject *o) {
131869   struct __pyx_obj_4lxml_5etree_TreeBuilder *p = (struct __pyx_obj_4lxml_5etree_TreeBuilder *)o;
131870   Py_XDECREF(((PyObject *)p->_parser));
131871   Py_XDECREF(p->_factory);
131872   Py_XDECREF(((PyObject *)p->_data));
131873   Py_XDECREF(((PyObject *)p->_element_stack));
131874   Py_XDECREF(p->_element_stack_pop);
131875   Py_XDECREF(((PyObject *)p->_last));
131876   __pyx_tp_dealloc_4lxml_5etree__SaxParserTarget(o);
131877 }
131878
131879 static int __pyx_tp_traverse_4lxml_5etree_TreeBuilder(PyObject *o, visitproc v, void *a) {
131880   int e;
131881   struct __pyx_obj_4lxml_5etree_TreeBuilder *p = (struct __pyx_obj_4lxml_5etree_TreeBuilder *)o;
131882   if (__pyx_ptype_4lxml_5etree__SaxParserTarget->tp_traverse) {
131883     e = __pyx_ptype_4lxml_5etree__SaxParserTarget->tp_traverse(o, v, a); if (e) return e;
131884   }
131885   if (p->_parser) {
131886     e = (*v)(((PyObject*)p->_parser), a); if (e) return e;
131887   }
131888   if (p->_factory) {
131889     e = (*v)(p->_factory, a); if (e) return e;
131890   }
131891   if (p->_data) {
131892     e = (*v)(p->_data, a); if (e) return e;
131893   }
131894   if (p->_element_stack) {
131895     e = (*v)(p->_element_stack, a); if (e) return e;
131896   }
131897   if (p->_element_stack_pop) {
131898     e = (*v)(p->_element_stack_pop, a); if (e) return e;
131899   }
131900   if (p->_last) {
131901     e = (*v)(((PyObject*)p->_last), a); if (e) return e;
131902   }
131903   return 0;
131904 }
131905
131906 static int __pyx_tp_clear_4lxml_5etree_TreeBuilder(PyObject *o) {
131907   struct __pyx_obj_4lxml_5etree_TreeBuilder *p = (struct __pyx_obj_4lxml_5etree_TreeBuilder *)o;
131908   PyObject* tmp;
131909   if (__pyx_ptype_4lxml_5etree__SaxParserTarget->tp_clear) {
131910     __pyx_ptype_4lxml_5etree__SaxParserTarget->tp_clear(o);
131911   }
131912   tmp = ((PyObject*)p->_parser);
131913   p->_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);
131914   Py_XDECREF(tmp);
131915   tmp = ((PyObject*)p->_factory);
131916   p->_factory = Py_None; Py_INCREF(Py_None);
131917   Py_XDECREF(tmp);
131918   tmp = ((PyObject*)p->_data);
131919   p->_data = ((PyObject *)Py_None); Py_INCREF(Py_None);
131920   Py_XDECREF(tmp);
131921   tmp = ((PyObject*)p->_element_stack);
131922   p->_element_stack = ((PyObject *)Py_None); Py_INCREF(Py_None);
131923   Py_XDECREF(tmp);
131924   tmp = ((PyObject*)p->_element_stack_pop);
131925   p->_element_stack_pop = Py_None; Py_INCREF(Py_None);
131926   Py_XDECREF(tmp);
131927   tmp = ((PyObject*)p->_last);
131928   p->_last = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
131929   Py_XDECREF(tmp);
131930   return 0;
131931 }
131932
131933 static struct PyMethodDef __pyx_methods_4lxml_5etree_TreeBuilder[] = {
131934   {__Pyx_NAMESTR("close"), (PyCFunction)__pyx_pf_4lxml_5etree_11TreeBuilder_close, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_11TreeBuilder_close)},
131935   {__Pyx_NAMESTR("data"), (PyCFunction)__pyx_pf_4lxml_5etree_11TreeBuilder_data, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_11TreeBuilder_data)},
131936   {__Pyx_NAMESTR("start"), (PyCFunction)__pyx_pf_4lxml_5etree_11TreeBuilder_start, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_11TreeBuilder_start)},
131937   {__Pyx_NAMESTR("end"), (PyCFunction)__pyx_pf_4lxml_5etree_11TreeBuilder_end, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_11TreeBuilder_end)},
131938   {__Pyx_NAMESTR("pi"), (PyCFunction)__pyx_pf_4lxml_5etree_11TreeBuilder_pi, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_11TreeBuilder_pi)},
131939   {__Pyx_NAMESTR("comment"), (PyCFunction)__pyx_pf_4lxml_5etree_11TreeBuilder_comment, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_11TreeBuilder_comment)},
131940   {0, 0, 0, 0}
131941 };
131942
131943 static PyNumberMethods __pyx_tp_as_number_TreeBuilder = {
131944   0, /*nb_add*/
131945   0, /*nb_subtract*/
131946   0, /*nb_multiply*/
131947   #if PY_MAJOR_VERSION < 3
131948   0, /*nb_divide*/
131949   #endif
131950   0, /*nb_remainder*/
131951   0, /*nb_divmod*/
131952   0, /*nb_power*/
131953   0, /*nb_negative*/
131954   0, /*nb_positive*/
131955   0, /*nb_absolute*/
131956   0, /*nb_nonzero*/
131957   0, /*nb_invert*/
131958   0, /*nb_lshift*/
131959   0, /*nb_rshift*/
131960   0, /*nb_and*/
131961   0, /*nb_xor*/
131962   0, /*nb_or*/
131963   #if PY_MAJOR_VERSION < 3
131964   0, /*nb_coerce*/
131965   #endif
131966   0, /*nb_int*/
131967   #if PY_MAJOR_VERSION >= 3
131968   0, /*reserved*/
131969   #else
131970   0, /*nb_long*/
131971   #endif
131972   0, /*nb_float*/
131973   #if PY_MAJOR_VERSION < 3
131974   0, /*nb_oct*/
131975   #endif
131976   #if PY_MAJOR_VERSION < 3
131977   0, /*nb_hex*/
131978   #endif
131979   0, /*nb_inplace_add*/
131980   0, /*nb_inplace_subtract*/
131981   0, /*nb_inplace_multiply*/
131982   #if PY_MAJOR_VERSION < 3
131983   0, /*nb_inplace_divide*/
131984   #endif
131985   0, /*nb_inplace_remainder*/
131986   0, /*nb_inplace_power*/
131987   0, /*nb_inplace_lshift*/
131988   0, /*nb_inplace_rshift*/
131989   0, /*nb_inplace_and*/
131990   0, /*nb_inplace_xor*/
131991   0, /*nb_inplace_or*/
131992   0, /*nb_floor_divide*/
131993   0, /*nb_true_divide*/
131994   0, /*nb_inplace_floor_divide*/
131995   0, /*nb_inplace_true_divide*/
131996   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
131997   0, /*nb_index*/
131998   #endif
131999 };
132000
132001 static PySequenceMethods __pyx_tp_as_sequence_TreeBuilder = {
132002   0, /*sq_length*/
132003   0, /*sq_concat*/
132004   0, /*sq_repeat*/
132005   0, /*sq_item*/
132006   0, /*sq_slice*/
132007   0, /*sq_ass_item*/
132008   0, /*sq_ass_slice*/
132009   0, /*sq_contains*/
132010   0, /*sq_inplace_concat*/
132011   0, /*sq_inplace_repeat*/
132012 };
132013
132014 static PyMappingMethods __pyx_tp_as_mapping_TreeBuilder = {
132015   0, /*mp_length*/
132016   0, /*mp_subscript*/
132017   0, /*mp_ass_subscript*/
132018 };
132019
132020 static PyBufferProcs __pyx_tp_as_buffer_TreeBuilder = {
132021   #if PY_MAJOR_VERSION < 3
132022   0, /*bf_getreadbuffer*/
132023   #endif
132024   #if PY_MAJOR_VERSION < 3
132025   0, /*bf_getwritebuffer*/
132026   #endif
132027   #if PY_MAJOR_VERSION < 3
132028   0, /*bf_getsegcount*/
132029   #endif
132030   #if PY_MAJOR_VERSION < 3
132031   0, /*bf_getcharbuffer*/
132032   #endif
132033   #if PY_VERSION_HEX >= 0x02060000
132034   0, /*bf_getbuffer*/
132035   #endif
132036   #if PY_VERSION_HEX >= 0x02060000
132037   0, /*bf_releasebuffer*/
132038   #endif
132039 };
132040
132041 PyTypeObject __pyx_type_4lxml_5etree_TreeBuilder = {
132042   PyVarObject_HEAD_INIT(0, 0)
132043   __Pyx_NAMESTR("lxml.etree.TreeBuilder"), /*tp_name*/
132044   sizeof(struct __pyx_obj_4lxml_5etree_TreeBuilder), /*tp_basicsize*/
132045   0, /*tp_itemsize*/
132046   __pyx_tp_dealloc_4lxml_5etree_TreeBuilder, /*tp_dealloc*/
132047   0, /*tp_print*/
132048   0, /*tp_getattr*/
132049   0, /*tp_setattr*/
132050   0, /*tp_compare*/
132051   0, /*tp_repr*/
132052   &__pyx_tp_as_number_TreeBuilder, /*tp_as_number*/
132053   &__pyx_tp_as_sequence_TreeBuilder, /*tp_as_sequence*/
132054   &__pyx_tp_as_mapping_TreeBuilder, /*tp_as_mapping*/
132055   0, /*tp_hash*/
132056   0, /*tp_call*/
132057   0, /*tp_str*/
132058   0, /*tp_getattro*/
132059   0, /*tp_setattro*/
132060   &__pyx_tp_as_buffer_TreeBuilder, /*tp_as_buffer*/
132061   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
132062   __Pyx_DOCSTR("TreeBuilder(self, element_factory=None, parser=None)\n    Parser target that builds a tree.\n\n    The final tree is returned by the ``close()`` method.\n    "), /*tp_doc*/
132063   __pyx_tp_traverse_4lxml_5etree_TreeBuilder, /*tp_traverse*/
132064   __pyx_tp_clear_4lxml_5etree_TreeBuilder, /*tp_clear*/
132065   0, /*tp_richcompare*/
132066   0, /*tp_weaklistoffset*/
132067   0, /*tp_iter*/
132068   0, /*tp_iternext*/
132069   __pyx_methods_4lxml_5etree_TreeBuilder, /*tp_methods*/
132070   0, /*tp_members*/
132071   0, /*tp_getset*/
132072   0, /*tp_base*/
132073   0, /*tp_dict*/
132074   0, /*tp_descr_get*/
132075   0, /*tp_descr_set*/
132076   0, /*tp_dictoffset*/
132077   __pyx_pf_4lxml_5etree_11TreeBuilder___init__, /*tp_init*/
132078   0, /*tp_alloc*/
132079   __pyx_tp_new_4lxml_5etree_TreeBuilder, /*tp_new*/
132080   0, /*tp_free*/
132081   0, /*tp_is_gc*/
132082   0, /*tp_bases*/
132083   0, /*tp_mro*/
132084   0, /*tp_cache*/
132085   0, /*tp_subclasses*/
132086   0, /*tp_weaklist*/
132087 };
132088 static struct __pyx_vtabstruct_4lxml_5etree__PythonSaxParserTarget __pyx_vtable_4lxml_5etree__PythonSaxParserTarget;
132089
132090 static PyObject *__pyx_tp_new_4lxml_5etree__PythonSaxParserTarget(PyTypeObject *t, PyObject *a, PyObject *k) {
132091   struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *p;
132092   PyObject *o = __pyx_tp_new_4lxml_5etree__SaxParserTarget(t, a, k);
132093   if (!o) return 0;
132094   p = ((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)o);
132095   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget*)__pyx_vtabptr_4lxml_5etree__PythonSaxParserTarget;
132096   p->_target_start = Py_None; Py_INCREF(Py_None);
132097   p->_target_end = Py_None; Py_INCREF(Py_None);
132098   p->_target_data = Py_None; Py_INCREF(Py_None);
132099   p->_target_doctype = Py_None; Py_INCREF(Py_None);
132100   p->_target_pi = Py_None; Py_INCREF(Py_None);
132101   p->_target_comment = Py_None; Py_INCREF(Py_None);
132102   return o;
132103 }
132104
132105 static void __pyx_tp_dealloc_4lxml_5etree__PythonSaxParserTarget(PyObject *o) {
132106   struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *p = (struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)o;
132107   Py_XDECREF(p->_target_start);
132108   Py_XDECREF(p->_target_end);
132109   Py_XDECREF(p->_target_data);
132110   Py_XDECREF(p->_target_doctype);
132111   Py_XDECREF(p->_target_pi);
132112   Py_XDECREF(p->_target_comment);
132113   __pyx_tp_dealloc_4lxml_5etree__SaxParserTarget(o);
132114 }
132115
132116 static int __pyx_tp_traverse_4lxml_5etree__PythonSaxParserTarget(PyObject *o, visitproc v, void *a) {
132117   int e;
132118   struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *p = (struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)o;
132119   if (__pyx_ptype_4lxml_5etree__SaxParserTarget->tp_traverse) {
132120     e = __pyx_ptype_4lxml_5etree__SaxParserTarget->tp_traverse(o, v, a); if (e) return e;
132121   }
132122   if (p->_target_start) {
132123     e = (*v)(p->_target_start, a); if (e) return e;
132124   }
132125   if (p->_target_end) {
132126     e = (*v)(p->_target_end, a); if (e) return e;
132127   }
132128   if (p->_target_data) {
132129     e = (*v)(p->_target_data, a); if (e) return e;
132130   }
132131   if (p->_target_doctype) {
132132     e = (*v)(p->_target_doctype, a); if (e) return e;
132133   }
132134   if (p->_target_pi) {
132135     e = (*v)(p->_target_pi, a); if (e) return e;
132136   }
132137   if (p->_target_comment) {
132138     e = (*v)(p->_target_comment, a); if (e) return e;
132139   }
132140   return 0;
132141 }
132142
132143 static int __pyx_tp_clear_4lxml_5etree__PythonSaxParserTarget(PyObject *o) {
132144   struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *p = (struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)o;
132145   PyObject* tmp;
132146   if (__pyx_ptype_4lxml_5etree__SaxParserTarget->tp_clear) {
132147     __pyx_ptype_4lxml_5etree__SaxParserTarget->tp_clear(o);
132148   }
132149   tmp = ((PyObject*)p->_target_start);
132150   p->_target_start = Py_None; Py_INCREF(Py_None);
132151   Py_XDECREF(tmp);
132152   tmp = ((PyObject*)p->_target_end);
132153   p->_target_end = Py_None; Py_INCREF(Py_None);
132154   Py_XDECREF(tmp);
132155   tmp = ((PyObject*)p->_target_data);
132156   p->_target_data = Py_None; Py_INCREF(Py_None);
132157   Py_XDECREF(tmp);
132158   tmp = ((PyObject*)p->_target_doctype);
132159   p->_target_doctype = Py_None; Py_INCREF(Py_None);
132160   Py_XDECREF(tmp);
132161   tmp = ((PyObject*)p->_target_pi);
132162   p->_target_pi = Py_None; Py_INCREF(Py_None);
132163   Py_XDECREF(tmp);
132164   tmp = ((PyObject*)p->_target_comment);
132165   p->_target_comment = Py_None; Py_INCREF(Py_None);
132166   Py_XDECREF(tmp);
132167   return 0;
132168 }
132169
132170 static struct PyMethodDef __pyx_methods_4lxml_5etree__PythonSaxParserTarget[] = {
132171   {0, 0, 0, 0}
132172 };
132173
132174 static PyNumberMethods __pyx_tp_as_number__PythonSaxParserTarget = {
132175   0, /*nb_add*/
132176   0, /*nb_subtract*/
132177   0, /*nb_multiply*/
132178   #if PY_MAJOR_VERSION < 3
132179   0, /*nb_divide*/
132180   #endif
132181   0, /*nb_remainder*/
132182   0, /*nb_divmod*/
132183   0, /*nb_power*/
132184   0, /*nb_negative*/
132185   0, /*nb_positive*/
132186   0, /*nb_absolute*/
132187   0, /*nb_nonzero*/
132188   0, /*nb_invert*/
132189   0, /*nb_lshift*/
132190   0, /*nb_rshift*/
132191   0, /*nb_and*/
132192   0, /*nb_xor*/
132193   0, /*nb_or*/
132194   #if PY_MAJOR_VERSION < 3
132195   0, /*nb_coerce*/
132196   #endif
132197   0, /*nb_int*/
132198   #if PY_MAJOR_VERSION >= 3
132199   0, /*reserved*/
132200   #else
132201   0, /*nb_long*/
132202   #endif
132203   0, /*nb_float*/
132204   #if PY_MAJOR_VERSION < 3
132205   0, /*nb_oct*/
132206   #endif
132207   #if PY_MAJOR_VERSION < 3
132208   0, /*nb_hex*/
132209   #endif
132210   0, /*nb_inplace_add*/
132211   0, /*nb_inplace_subtract*/
132212   0, /*nb_inplace_multiply*/
132213   #if PY_MAJOR_VERSION < 3
132214   0, /*nb_inplace_divide*/
132215   #endif
132216   0, /*nb_inplace_remainder*/
132217   0, /*nb_inplace_power*/
132218   0, /*nb_inplace_lshift*/
132219   0, /*nb_inplace_rshift*/
132220   0, /*nb_inplace_and*/
132221   0, /*nb_inplace_xor*/
132222   0, /*nb_inplace_or*/
132223   0, /*nb_floor_divide*/
132224   0, /*nb_true_divide*/
132225   0, /*nb_inplace_floor_divide*/
132226   0, /*nb_inplace_true_divide*/
132227   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
132228   0, /*nb_index*/
132229   #endif
132230 };
132231
132232 static PySequenceMethods __pyx_tp_as_sequence__PythonSaxParserTarget = {
132233   0, /*sq_length*/
132234   0, /*sq_concat*/
132235   0, /*sq_repeat*/
132236   0, /*sq_item*/
132237   0, /*sq_slice*/
132238   0, /*sq_ass_item*/
132239   0, /*sq_ass_slice*/
132240   0, /*sq_contains*/
132241   0, /*sq_inplace_concat*/
132242   0, /*sq_inplace_repeat*/
132243 };
132244
132245 static PyMappingMethods __pyx_tp_as_mapping__PythonSaxParserTarget = {
132246   0, /*mp_length*/
132247   0, /*mp_subscript*/
132248   0, /*mp_ass_subscript*/
132249 };
132250
132251 static PyBufferProcs __pyx_tp_as_buffer__PythonSaxParserTarget = {
132252   #if PY_MAJOR_VERSION < 3
132253   0, /*bf_getreadbuffer*/
132254   #endif
132255   #if PY_MAJOR_VERSION < 3
132256   0, /*bf_getwritebuffer*/
132257   #endif
132258   #if PY_MAJOR_VERSION < 3
132259   0, /*bf_getsegcount*/
132260   #endif
132261   #if PY_MAJOR_VERSION < 3
132262   0, /*bf_getcharbuffer*/
132263   #endif
132264   #if PY_VERSION_HEX >= 0x02060000
132265   0, /*bf_getbuffer*/
132266   #endif
132267   #if PY_VERSION_HEX >= 0x02060000
132268   0, /*bf_releasebuffer*/
132269   #endif
132270 };
132271
132272 PyTypeObject __pyx_type_4lxml_5etree__PythonSaxParserTarget = {
132273   PyVarObject_HEAD_INIT(0, 0)
132274   __Pyx_NAMESTR("lxml.etree._PythonSaxParserTarget"), /*tp_name*/
132275   sizeof(struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget), /*tp_basicsize*/
132276   0, /*tp_itemsize*/
132277   __pyx_tp_dealloc_4lxml_5etree__PythonSaxParserTarget, /*tp_dealloc*/
132278   0, /*tp_print*/
132279   0, /*tp_getattr*/
132280   0, /*tp_setattr*/
132281   0, /*tp_compare*/
132282   0, /*tp_repr*/
132283   &__pyx_tp_as_number__PythonSaxParserTarget, /*tp_as_number*/
132284   &__pyx_tp_as_sequence__PythonSaxParserTarget, /*tp_as_sequence*/
132285   &__pyx_tp_as_mapping__PythonSaxParserTarget, /*tp_as_mapping*/
132286   0, /*tp_hash*/
132287   0, /*tp_call*/
132288   0, /*tp_str*/
132289   0, /*tp_getattro*/
132290   0, /*tp_setattro*/
132291   &__pyx_tp_as_buffer__PythonSaxParserTarget, /*tp_as_buffer*/
132292   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
132293   0, /*tp_doc*/
132294   __pyx_tp_traverse_4lxml_5etree__PythonSaxParserTarget, /*tp_traverse*/
132295   __pyx_tp_clear_4lxml_5etree__PythonSaxParserTarget, /*tp_clear*/
132296   0, /*tp_richcompare*/
132297   0, /*tp_weaklistoffset*/
132298   0, /*tp_iter*/
132299   0, /*tp_iternext*/
132300   __pyx_methods_4lxml_5etree__PythonSaxParserTarget, /*tp_methods*/
132301   0, /*tp_members*/
132302   0, /*tp_getset*/
132303   0, /*tp_base*/
132304   0, /*tp_dict*/
132305   0, /*tp_descr_get*/
132306   0, /*tp_descr_set*/
132307   0, /*tp_dictoffset*/
132308   __pyx_pf_4lxml_5etree_22_PythonSaxParserTarget___init__, /*tp_init*/
132309   0, /*tp_alloc*/
132310   __pyx_tp_new_4lxml_5etree__PythonSaxParserTarget, /*tp_new*/
132311   0, /*tp_free*/
132312   0, /*tp_is_gc*/
132313   0, /*tp_bases*/
132314   0, /*tp_mro*/
132315   0, /*tp_cache*/
132316   0, /*tp_subclasses*/
132317   0, /*tp_weaklist*/
132318 };
132319 static struct __pyx_vtabstruct_4lxml_5etree__FilelikeWriter __pyx_vtable_4lxml_5etree__FilelikeWriter;
132320
132321 static PyObject *__pyx_tp_new_4lxml_5etree__FilelikeWriter(PyTypeObject *t, PyObject *a, PyObject *k) {
132322   struct __pyx_obj_4lxml_5etree__FilelikeWriter *p;
132323   PyObject *o = (*t->tp_alloc)(t, 0);
132324   if (!o) return 0;
132325   p = ((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)o);
132326   p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__FilelikeWriter;
132327   p->_filelike = Py_None; Py_INCREF(Py_None);
132328   p->_close_filelike = Py_None; Py_INCREF(Py_None);
132329   p->_exc_context = ((struct __pyx_obj_4lxml_5etree__ExceptionContext *)Py_None); Py_INCREF(Py_None);
132330   p->error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
132331   return o;
132332 }
132333
132334 static void __pyx_tp_dealloc_4lxml_5etree__FilelikeWriter(PyObject *o) {
132335   struct __pyx_obj_4lxml_5etree__FilelikeWriter *p = (struct __pyx_obj_4lxml_5etree__FilelikeWriter *)o;
132336   Py_XDECREF(p->_filelike);
132337   Py_XDECREF(p->_close_filelike);
132338   Py_XDECREF(((PyObject *)p->_exc_context));
132339   Py_XDECREF(((PyObject *)p->error_log));
132340   (*Py_TYPE(o)->tp_free)(o);
132341 }
132342
132343 static int __pyx_tp_traverse_4lxml_5etree__FilelikeWriter(PyObject *o, visitproc v, void *a) {
132344   int e;
132345   struct __pyx_obj_4lxml_5etree__FilelikeWriter *p = (struct __pyx_obj_4lxml_5etree__FilelikeWriter *)o;
132346   if (p->_filelike) {
132347     e = (*v)(p->_filelike, a); if (e) return e;
132348   }
132349   if (p->_close_filelike) {
132350     e = (*v)(p->_close_filelike, a); if (e) return e;
132351   }
132352   if (p->_exc_context) {
132353     e = (*v)(((PyObject*)p->_exc_context), a); if (e) return e;
132354   }
132355   if (p->error_log) {
132356     e = (*v)(((PyObject*)p->error_log), a); if (e) return e;
132357   }
132358   return 0;
132359 }
132360
132361 static int __pyx_tp_clear_4lxml_5etree__FilelikeWriter(PyObject *o) {
132362   struct __pyx_obj_4lxml_5etree__FilelikeWriter *p = (struct __pyx_obj_4lxml_5etree__FilelikeWriter *)o;
132363   PyObject* tmp;
132364   tmp = ((PyObject*)p->_filelike);
132365   p->_filelike = Py_None; Py_INCREF(Py_None);
132366   Py_XDECREF(tmp);
132367   tmp = ((PyObject*)p->_close_filelike);
132368   p->_close_filelike = Py_None; Py_INCREF(Py_None);
132369   Py_XDECREF(tmp);
132370   tmp = ((PyObject*)p->_exc_context);
132371   p->_exc_context = ((struct __pyx_obj_4lxml_5etree__ExceptionContext *)Py_None); Py_INCREF(Py_None);
132372   Py_XDECREF(tmp);
132373   tmp = ((PyObject*)p->error_log);
132374   p->error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
132375   Py_XDECREF(tmp);
132376   return 0;
132377 }
132378
132379 static struct PyMethodDef __pyx_methods_4lxml_5etree__FilelikeWriter[] = {
132380   {0, 0, 0, 0}
132381 };
132382
132383 static PyNumberMethods __pyx_tp_as_number__FilelikeWriter = {
132384   0, /*nb_add*/
132385   0, /*nb_subtract*/
132386   0, /*nb_multiply*/
132387   #if PY_MAJOR_VERSION < 3
132388   0, /*nb_divide*/
132389   #endif
132390   0, /*nb_remainder*/
132391   0, /*nb_divmod*/
132392   0, /*nb_power*/
132393   0, /*nb_negative*/
132394   0, /*nb_positive*/
132395   0, /*nb_absolute*/
132396   0, /*nb_nonzero*/
132397   0, /*nb_invert*/
132398   0, /*nb_lshift*/
132399   0, /*nb_rshift*/
132400   0, /*nb_and*/
132401   0, /*nb_xor*/
132402   0, /*nb_or*/
132403   #if PY_MAJOR_VERSION < 3
132404   0, /*nb_coerce*/
132405   #endif
132406   0, /*nb_int*/
132407   #if PY_MAJOR_VERSION >= 3
132408   0, /*reserved*/
132409   #else
132410   0, /*nb_long*/
132411   #endif
132412   0, /*nb_float*/
132413   #if PY_MAJOR_VERSION < 3
132414   0, /*nb_oct*/
132415   #endif
132416   #if PY_MAJOR_VERSION < 3
132417   0, /*nb_hex*/
132418   #endif
132419   0, /*nb_inplace_add*/
132420   0, /*nb_inplace_subtract*/
132421   0, /*nb_inplace_multiply*/
132422   #if PY_MAJOR_VERSION < 3
132423   0, /*nb_inplace_divide*/
132424   #endif
132425   0, /*nb_inplace_remainder*/
132426   0, /*nb_inplace_power*/
132427   0, /*nb_inplace_lshift*/
132428   0, /*nb_inplace_rshift*/
132429   0, /*nb_inplace_and*/
132430   0, /*nb_inplace_xor*/
132431   0, /*nb_inplace_or*/
132432   0, /*nb_floor_divide*/
132433   0, /*nb_true_divide*/
132434   0, /*nb_inplace_floor_divide*/
132435   0, /*nb_inplace_true_divide*/
132436   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
132437   0, /*nb_index*/
132438   #endif
132439 };
132440
132441 static PySequenceMethods __pyx_tp_as_sequence__FilelikeWriter = {
132442   0, /*sq_length*/
132443   0, /*sq_concat*/
132444   0, /*sq_repeat*/
132445   0, /*sq_item*/
132446   0, /*sq_slice*/
132447   0, /*sq_ass_item*/
132448   0, /*sq_ass_slice*/
132449   0, /*sq_contains*/
132450   0, /*sq_inplace_concat*/
132451   0, /*sq_inplace_repeat*/
132452 };
132453
132454 static PyMappingMethods __pyx_tp_as_mapping__FilelikeWriter = {
132455   0, /*mp_length*/
132456   0, /*mp_subscript*/
132457   0, /*mp_ass_subscript*/
132458 };
132459
132460 static PyBufferProcs __pyx_tp_as_buffer__FilelikeWriter = {
132461   #if PY_MAJOR_VERSION < 3
132462   0, /*bf_getreadbuffer*/
132463   #endif
132464   #if PY_MAJOR_VERSION < 3
132465   0, /*bf_getwritebuffer*/
132466   #endif
132467   #if PY_MAJOR_VERSION < 3
132468   0, /*bf_getsegcount*/
132469   #endif
132470   #if PY_MAJOR_VERSION < 3
132471   0, /*bf_getcharbuffer*/
132472   #endif
132473   #if PY_VERSION_HEX >= 0x02060000
132474   0, /*bf_getbuffer*/
132475   #endif
132476   #if PY_VERSION_HEX >= 0x02060000
132477   0, /*bf_releasebuffer*/
132478   #endif
132479 };
132480
132481 PyTypeObject __pyx_type_4lxml_5etree__FilelikeWriter = {
132482   PyVarObject_HEAD_INIT(0, 0)
132483   __Pyx_NAMESTR("lxml.etree._FilelikeWriter"), /*tp_name*/
132484   sizeof(struct __pyx_obj_4lxml_5etree__FilelikeWriter), /*tp_basicsize*/
132485   0, /*tp_itemsize*/
132486   __pyx_tp_dealloc_4lxml_5etree__FilelikeWriter, /*tp_dealloc*/
132487   0, /*tp_print*/
132488   0, /*tp_getattr*/
132489   0, /*tp_setattr*/
132490   0, /*tp_compare*/
132491   0, /*tp_repr*/
132492   &__pyx_tp_as_number__FilelikeWriter, /*tp_as_number*/
132493   &__pyx_tp_as_sequence__FilelikeWriter, /*tp_as_sequence*/
132494   &__pyx_tp_as_mapping__FilelikeWriter, /*tp_as_mapping*/
132495   0, /*tp_hash*/
132496   0, /*tp_call*/
132497   0, /*tp_str*/
132498   0, /*tp_getattro*/
132499   0, /*tp_setattro*/
132500   &__pyx_tp_as_buffer__FilelikeWriter, /*tp_as_buffer*/
132501   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
132502   0, /*tp_doc*/
132503   __pyx_tp_traverse_4lxml_5etree__FilelikeWriter, /*tp_traverse*/
132504   __pyx_tp_clear_4lxml_5etree__FilelikeWriter, /*tp_clear*/
132505   0, /*tp_richcompare*/
132506   0, /*tp_weaklistoffset*/
132507   0, /*tp_iter*/
132508   0, /*tp_iternext*/
132509   __pyx_methods_4lxml_5etree__FilelikeWriter, /*tp_methods*/
132510   0, /*tp_members*/
132511   0, /*tp_getset*/
132512   0, /*tp_base*/
132513   0, /*tp_dict*/
132514   0, /*tp_descr_get*/
132515   0, /*tp_descr_set*/
132516   0, /*tp_dictoffset*/
132517   __pyx_pf_4lxml_5etree_15_FilelikeWriter___init__, /*tp_init*/
132518   0, /*tp_alloc*/
132519   __pyx_tp_new_4lxml_5etree__FilelikeWriter, /*tp_new*/
132520   0, /*tp_free*/
132521   0, /*tp_is_gc*/
132522   0, /*tp_bases*/
132523   0, /*tp_mro*/
132524   0, /*tp_cache*/
132525   0, /*tp_subclasses*/
132526   0, /*tp_weaklist*/
132527 };
132528 static struct __pyx_vtabstruct_4lxml_5etree__IterparseContext __pyx_vtable_4lxml_5etree__IterparseContext;
132529
132530 static PyObject *__pyx_tp_new_4lxml_5etree__IterparseContext(PyTypeObject *t, PyObject *a, PyObject *k) {
132531   struct __pyx_obj_4lxml_5etree__IterparseContext *p;
132532   PyObject *o = __pyx_tp_new_4lxml_5etree__ParserContext(t, a, k);
132533   if (!o) return 0;
132534   p = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)o);
132535   p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext*)__pyx_vtabptr_4lxml_5etree__IterparseContext;
132536   p->_root = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
132537   p->_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
132538   p->_events = ((PyObject *)Py_None); Py_INCREF(Py_None);
132539   p->_ns_stack = ((PyObject *)Py_None); Py_INCREF(Py_None);
132540   p->_pop_ns = Py_None; Py_INCREF(Py_None);
132541   p->_node_stack = ((PyObject *)Py_None); Py_INCREF(Py_None);
132542   p->_pop_node = Py_None; Py_INCREF(Py_None);
132543   p->_tag_tuple = ((PyObject *)Py_None); Py_INCREF(Py_None);
132544   return o;
132545 }
132546
132547 static void __pyx_tp_dealloc_4lxml_5etree__IterparseContext(PyObject *o) {
132548   struct __pyx_obj_4lxml_5etree__IterparseContext *p = (struct __pyx_obj_4lxml_5etree__IterparseContext *)o;
132549   Py_XDECREF(((PyObject *)p->_root));
132550   Py_XDECREF(((PyObject *)p->_doc));
132551   Py_XDECREF(((PyObject *)p->_events));
132552   Py_XDECREF(((PyObject *)p->_ns_stack));
132553   Py_XDECREF(p->_pop_ns);
132554   Py_XDECREF(((PyObject *)p->_node_stack));
132555   Py_XDECREF(p->_pop_node);
132556   Py_XDECREF(((PyObject *)p->_tag_tuple));
132557   __pyx_tp_dealloc_4lxml_5etree__ParserContext(o);
132558 }
132559
132560 static int __pyx_tp_traverse_4lxml_5etree__IterparseContext(PyObject *o, visitproc v, void *a) {
132561   int e;
132562   struct __pyx_obj_4lxml_5etree__IterparseContext *p = (struct __pyx_obj_4lxml_5etree__IterparseContext *)o;
132563   e = __pyx_tp_traverse_4lxml_5etree__ParserContext(o, v, a); if (e) return e;
132564   if (p->_root) {
132565     e = (*v)(((PyObject*)p->_root), a); if (e) return e;
132566   }
132567   if (p->_doc) {
132568     e = (*v)(((PyObject*)p->_doc), a); if (e) return e;
132569   }
132570   if (p->_events) {
132571     e = (*v)(p->_events, a); if (e) return e;
132572   }
132573   if (p->_ns_stack) {
132574     e = (*v)(p->_ns_stack, a); if (e) return e;
132575   }
132576   if (p->_pop_ns) {
132577     e = (*v)(p->_pop_ns, a); if (e) return e;
132578   }
132579   if (p->_node_stack) {
132580     e = (*v)(p->_node_stack, a); if (e) return e;
132581   }
132582   if (p->_pop_node) {
132583     e = (*v)(p->_pop_node, a); if (e) return e;
132584   }
132585   if (p->_tag_tuple) {
132586     e = (*v)(p->_tag_tuple, a); if (e) return e;
132587   }
132588   return 0;
132589 }
132590
132591 static int __pyx_tp_clear_4lxml_5etree__IterparseContext(PyObject *o) {
132592   struct __pyx_obj_4lxml_5etree__IterparseContext *p = (struct __pyx_obj_4lxml_5etree__IterparseContext *)o;
132593   PyObject* tmp;
132594   __pyx_tp_clear_4lxml_5etree__ParserContext(o);
132595   tmp = ((PyObject*)p->_root);
132596   p->_root = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
132597   Py_XDECREF(tmp);
132598   tmp = ((PyObject*)p->_doc);
132599   p->_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
132600   Py_XDECREF(tmp);
132601   tmp = ((PyObject*)p->_events);
132602   p->_events = ((PyObject *)Py_None); Py_INCREF(Py_None);
132603   Py_XDECREF(tmp);
132604   tmp = ((PyObject*)p->_ns_stack);
132605   p->_ns_stack = ((PyObject *)Py_None); Py_INCREF(Py_None);
132606   Py_XDECREF(tmp);
132607   tmp = ((PyObject*)p->_pop_ns);
132608   p->_pop_ns = Py_None; Py_INCREF(Py_None);
132609   Py_XDECREF(tmp);
132610   tmp = ((PyObject*)p->_node_stack);
132611   p->_node_stack = ((PyObject *)Py_None); Py_INCREF(Py_None);
132612   Py_XDECREF(tmp);
132613   tmp = ((PyObject*)p->_pop_node);
132614   p->_pop_node = Py_None; Py_INCREF(Py_None);
132615   Py_XDECREF(tmp);
132616   tmp = ((PyObject*)p->_tag_tuple);
132617   p->_tag_tuple = ((PyObject *)Py_None); Py_INCREF(Py_None);
132618   Py_XDECREF(tmp);
132619   return 0;
132620 }
132621
132622 static struct PyMethodDef __pyx_methods_4lxml_5etree__IterparseContext[] = {
132623   {0, 0, 0, 0}
132624 };
132625
132626 static PyNumberMethods __pyx_tp_as_number__IterparseContext = {
132627   0, /*nb_add*/
132628   0, /*nb_subtract*/
132629   0, /*nb_multiply*/
132630   #if PY_MAJOR_VERSION < 3
132631   0, /*nb_divide*/
132632   #endif
132633   0, /*nb_remainder*/
132634   0, /*nb_divmod*/
132635   0, /*nb_power*/
132636   0, /*nb_negative*/
132637   0, /*nb_positive*/
132638   0, /*nb_absolute*/
132639   0, /*nb_nonzero*/
132640   0, /*nb_invert*/
132641   0, /*nb_lshift*/
132642   0, /*nb_rshift*/
132643   0, /*nb_and*/
132644   0, /*nb_xor*/
132645   0, /*nb_or*/
132646   #if PY_MAJOR_VERSION < 3
132647   0, /*nb_coerce*/
132648   #endif
132649   0, /*nb_int*/
132650   #if PY_MAJOR_VERSION >= 3
132651   0, /*reserved*/
132652   #else
132653   0, /*nb_long*/
132654   #endif
132655   0, /*nb_float*/
132656   #if PY_MAJOR_VERSION < 3
132657   0, /*nb_oct*/
132658   #endif
132659   #if PY_MAJOR_VERSION < 3
132660   0, /*nb_hex*/
132661   #endif
132662   0, /*nb_inplace_add*/
132663   0, /*nb_inplace_subtract*/
132664   0, /*nb_inplace_multiply*/
132665   #if PY_MAJOR_VERSION < 3
132666   0, /*nb_inplace_divide*/
132667   #endif
132668   0, /*nb_inplace_remainder*/
132669   0, /*nb_inplace_power*/
132670   0, /*nb_inplace_lshift*/
132671   0, /*nb_inplace_rshift*/
132672   0, /*nb_inplace_and*/
132673   0, /*nb_inplace_xor*/
132674   0, /*nb_inplace_or*/
132675   0, /*nb_floor_divide*/
132676   0, /*nb_true_divide*/
132677   0, /*nb_inplace_floor_divide*/
132678   0, /*nb_inplace_true_divide*/
132679   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
132680   0, /*nb_index*/
132681   #endif
132682 };
132683
132684 static PySequenceMethods __pyx_tp_as_sequence__IterparseContext = {
132685   0, /*sq_length*/
132686   0, /*sq_concat*/
132687   0, /*sq_repeat*/
132688   0, /*sq_item*/
132689   0, /*sq_slice*/
132690   0, /*sq_ass_item*/
132691   0, /*sq_ass_slice*/
132692   0, /*sq_contains*/
132693   0, /*sq_inplace_concat*/
132694   0, /*sq_inplace_repeat*/
132695 };
132696
132697 static PyMappingMethods __pyx_tp_as_mapping__IterparseContext = {
132698   0, /*mp_length*/
132699   0, /*mp_subscript*/
132700   0, /*mp_ass_subscript*/
132701 };
132702
132703 static PyBufferProcs __pyx_tp_as_buffer__IterparseContext = {
132704   #if PY_MAJOR_VERSION < 3
132705   0, /*bf_getreadbuffer*/
132706   #endif
132707   #if PY_MAJOR_VERSION < 3
132708   0, /*bf_getwritebuffer*/
132709   #endif
132710   #if PY_MAJOR_VERSION < 3
132711   0, /*bf_getsegcount*/
132712   #endif
132713   #if PY_MAJOR_VERSION < 3
132714   0, /*bf_getcharbuffer*/
132715   #endif
132716   #if PY_VERSION_HEX >= 0x02060000
132717   0, /*bf_getbuffer*/
132718   #endif
132719   #if PY_VERSION_HEX >= 0x02060000
132720   0, /*bf_releasebuffer*/
132721   #endif
132722 };
132723
132724 PyTypeObject __pyx_type_4lxml_5etree__IterparseContext = {
132725   PyVarObject_HEAD_INIT(0, 0)
132726   __Pyx_NAMESTR("lxml.etree._IterparseContext"), /*tp_name*/
132727   sizeof(struct __pyx_obj_4lxml_5etree__IterparseContext), /*tp_basicsize*/
132728   0, /*tp_itemsize*/
132729   __pyx_tp_dealloc_4lxml_5etree__IterparseContext, /*tp_dealloc*/
132730   0, /*tp_print*/
132731   0, /*tp_getattr*/
132732   0, /*tp_setattr*/
132733   0, /*tp_compare*/
132734   0, /*tp_repr*/
132735   &__pyx_tp_as_number__IterparseContext, /*tp_as_number*/
132736   &__pyx_tp_as_sequence__IterparseContext, /*tp_as_sequence*/
132737   &__pyx_tp_as_mapping__IterparseContext, /*tp_as_mapping*/
132738   0, /*tp_hash*/
132739   0, /*tp_call*/
132740   0, /*tp_str*/
132741   0, /*tp_getattro*/
132742   0, /*tp_setattro*/
132743   &__pyx_tp_as_buffer__IterparseContext, /*tp_as_buffer*/
132744   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
132745   0, /*tp_doc*/
132746   __pyx_tp_traverse_4lxml_5etree__IterparseContext, /*tp_traverse*/
132747   __pyx_tp_clear_4lxml_5etree__IterparseContext, /*tp_clear*/
132748   0, /*tp_richcompare*/
132749   0, /*tp_weaklistoffset*/
132750   0, /*tp_iter*/
132751   0, /*tp_iternext*/
132752   __pyx_methods_4lxml_5etree__IterparseContext, /*tp_methods*/
132753   0, /*tp_members*/
132754   0, /*tp_getset*/
132755   0, /*tp_base*/
132756   0, /*tp_dict*/
132757   0, /*tp_descr_get*/
132758   0, /*tp_descr_set*/
132759   0, /*tp_dictoffset*/
132760   __pyx_pf_4lxml_5etree_17_IterparseContext___init__, /*tp_init*/
132761   0, /*tp_alloc*/
132762   __pyx_tp_new_4lxml_5etree__IterparseContext, /*tp_new*/
132763   0, /*tp_free*/
132764   0, /*tp_is_gc*/
132765   0, /*tp_bases*/
132766   0, /*tp_mro*/
132767   0, /*tp_cache*/
132768   0, /*tp_subclasses*/
132769   0, /*tp_weaklist*/
132770 };
132771 static struct __pyx_vtabstruct_4lxml_5etree_iterparse __pyx_vtable_4lxml_5etree_iterparse;
132772
132773 static PyObject *__pyx_tp_new_4lxml_5etree_iterparse(PyTypeObject *t, PyObject *a, PyObject *k) {
132774   struct __pyx_obj_4lxml_5etree_iterparse *p;
132775   PyObject *o = __pyx_tp_new_4lxml_5etree__BaseParser(t, a, k);
132776   if (!o) return 0;
132777   p = ((struct __pyx_obj_4lxml_5etree_iterparse *)o);
132778   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__BaseParser*)__pyx_vtabptr_4lxml_5etree_iterparse;
132779   p->_tag = Py_None; Py_INCREF(Py_None);
132780   p->_events = Py_None; Py_INCREF(Py_None);
132781   p->root = Py_None; Py_INCREF(Py_None);
132782   p->_source = Py_None; Py_INCREF(Py_None);
132783   p->_buffer = Py_None; Py_INCREF(Py_None);
132784   return o;
132785 }
132786
132787 static void __pyx_tp_dealloc_4lxml_5etree_iterparse(PyObject *o) {
132788   struct __pyx_obj_4lxml_5etree_iterparse *p = (struct __pyx_obj_4lxml_5etree_iterparse *)o;
132789   Py_XDECREF(p->_tag);
132790   Py_XDECREF(p->_events);
132791   Py_XDECREF(p->root);
132792   Py_XDECREF(p->_source);
132793   Py_XDECREF(p->_buffer);
132794   __pyx_tp_dealloc_4lxml_5etree__BaseParser(o);
132795 }
132796
132797 static int __pyx_tp_traverse_4lxml_5etree_iterparse(PyObject *o, visitproc v, void *a) {
132798   int e;
132799   struct __pyx_obj_4lxml_5etree_iterparse *p = (struct __pyx_obj_4lxml_5etree_iterparse *)o;
132800   e = __pyx_tp_traverse_4lxml_5etree__BaseParser(o, v, a); if (e) return e;
132801   if (p->_tag) {
132802     e = (*v)(p->_tag, a); if (e) return e;
132803   }
132804   if (p->_events) {
132805     e = (*v)(p->_events, a); if (e) return e;
132806   }
132807   if (p->root) {
132808     e = (*v)(p->root, a); if (e) return e;
132809   }
132810   if (p->_source) {
132811     e = (*v)(p->_source, a); if (e) return e;
132812   }
132813   if (p->_buffer) {
132814     e = (*v)(p->_buffer, a); if (e) return e;
132815   }
132816   return 0;
132817 }
132818
132819 static int __pyx_tp_clear_4lxml_5etree_iterparse(PyObject *o) {
132820   struct __pyx_obj_4lxml_5etree_iterparse *p = (struct __pyx_obj_4lxml_5etree_iterparse *)o;
132821   PyObject* tmp;
132822   __pyx_tp_clear_4lxml_5etree__BaseParser(o);
132823   tmp = ((PyObject*)p->_tag);
132824   p->_tag = Py_None; Py_INCREF(Py_None);
132825   Py_XDECREF(tmp);
132826   tmp = ((PyObject*)p->_events);
132827   p->_events = Py_None; Py_INCREF(Py_None);
132828   Py_XDECREF(tmp);
132829   tmp = ((PyObject*)p->root);
132830   p->root = Py_None; Py_INCREF(Py_None);
132831   Py_XDECREF(tmp);
132832   tmp = ((PyObject*)p->_source);
132833   p->_source = Py_None; Py_INCREF(Py_None);
132834   Py_XDECREF(tmp);
132835   tmp = ((PyObject*)p->_buffer);
132836   p->_buffer = Py_None; Py_INCREF(Py_None);
132837   Py_XDECREF(tmp);
132838   return 0;
132839 }
132840
132841 static PyObject *__pyx_getprop_4lxml_5etree_9iterparse_error_log(PyObject *o, void *x) {
132842   return __pyx_pf_4lxml_5etree_9iterparse_9error_log___get__(o);
132843 }
132844
132845 static struct PyMethodDef __pyx_methods_4lxml_5etree_iterparse[] = {
132846   {__Pyx_NAMESTR("copy"), (PyCFunction)__pyx_pf_4lxml_5etree_9iterparse_copy, METH_NOARGS, __Pyx_DOCSTR(0)},
132847   {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_4lxml_5etree_9iterparse___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
132848   {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_4lxml_5etree_9iterparse___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
132849   {0, 0, 0, 0}
132850 };
132851
132852 static struct PyMemberDef __pyx_members_4lxml_5etree_iterparse[] = {
132853   {(char *)"root", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree_iterparse, root), READONLY, 0},
132854   {0, 0, 0, 0, 0}
132855 };
132856
132857 static struct PyGetSetDef __pyx_getsets_4lxml_5etree_iterparse[] = {
132858   {(char *)"error_log", __pyx_getprop_4lxml_5etree_9iterparse_error_log, 0, __pyx_k_31, 0},
132859   {0, 0, 0, 0, 0}
132860 };
132861
132862 static PyNumberMethods __pyx_tp_as_number_iterparse = {
132863   0, /*nb_add*/
132864   0, /*nb_subtract*/
132865   0, /*nb_multiply*/
132866   #if PY_MAJOR_VERSION < 3
132867   0, /*nb_divide*/
132868   #endif
132869   0, /*nb_remainder*/
132870   0, /*nb_divmod*/
132871   0, /*nb_power*/
132872   0, /*nb_negative*/
132873   0, /*nb_positive*/
132874   0, /*nb_absolute*/
132875   0, /*nb_nonzero*/
132876   0, /*nb_invert*/
132877   0, /*nb_lshift*/
132878   0, /*nb_rshift*/
132879   0, /*nb_and*/
132880   0, /*nb_xor*/
132881   0, /*nb_or*/
132882   #if PY_MAJOR_VERSION < 3
132883   0, /*nb_coerce*/
132884   #endif
132885   0, /*nb_int*/
132886   #if PY_MAJOR_VERSION >= 3
132887   0, /*reserved*/
132888   #else
132889   0, /*nb_long*/
132890   #endif
132891   0, /*nb_float*/
132892   #if PY_MAJOR_VERSION < 3
132893   0, /*nb_oct*/
132894   #endif
132895   #if PY_MAJOR_VERSION < 3
132896   0, /*nb_hex*/
132897   #endif
132898   0, /*nb_inplace_add*/
132899   0, /*nb_inplace_subtract*/
132900   0, /*nb_inplace_multiply*/
132901   #if PY_MAJOR_VERSION < 3
132902   0, /*nb_inplace_divide*/
132903   #endif
132904   0, /*nb_inplace_remainder*/
132905   0, /*nb_inplace_power*/
132906   0, /*nb_inplace_lshift*/
132907   0, /*nb_inplace_rshift*/
132908   0, /*nb_inplace_and*/
132909   0, /*nb_inplace_xor*/
132910   0, /*nb_inplace_or*/
132911   0, /*nb_floor_divide*/
132912   0, /*nb_true_divide*/
132913   0, /*nb_inplace_floor_divide*/
132914   0, /*nb_inplace_true_divide*/
132915   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
132916   0, /*nb_index*/
132917   #endif
132918 };
132919
132920 static PySequenceMethods __pyx_tp_as_sequence_iterparse = {
132921   0, /*sq_length*/
132922   0, /*sq_concat*/
132923   0, /*sq_repeat*/
132924   0, /*sq_item*/
132925   0, /*sq_slice*/
132926   0, /*sq_ass_item*/
132927   0, /*sq_ass_slice*/
132928   0, /*sq_contains*/
132929   0, /*sq_inplace_concat*/
132930   0, /*sq_inplace_repeat*/
132931 };
132932
132933 static PyMappingMethods __pyx_tp_as_mapping_iterparse = {
132934   0, /*mp_length*/
132935   0, /*mp_subscript*/
132936   0, /*mp_ass_subscript*/
132937 };
132938
132939 static PyBufferProcs __pyx_tp_as_buffer_iterparse = {
132940   #if PY_MAJOR_VERSION < 3
132941   0, /*bf_getreadbuffer*/
132942   #endif
132943   #if PY_MAJOR_VERSION < 3
132944   0, /*bf_getwritebuffer*/
132945   #endif
132946   #if PY_MAJOR_VERSION < 3
132947   0, /*bf_getsegcount*/
132948   #endif
132949   #if PY_MAJOR_VERSION < 3
132950   0, /*bf_getcharbuffer*/
132951   #endif
132952   #if PY_VERSION_HEX >= 0x02060000
132953   0, /*bf_getbuffer*/
132954   #endif
132955   #if PY_VERSION_HEX >= 0x02060000
132956   0, /*bf_releasebuffer*/
132957   #endif
132958 };
132959
132960 PyTypeObject __pyx_type_4lxml_5etree_iterparse = {
132961   PyVarObject_HEAD_INIT(0, 0)
132962   __Pyx_NAMESTR("lxml.etree.iterparse"), /*tp_name*/
132963   sizeof(struct __pyx_obj_4lxml_5etree_iterparse), /*tp_basicsize*/
132964   0, /*tp_itemsize*/
132965   __pyx_tp_dealloc_4lxml_5etree_iterparse, /*tp_dealloc*/
132966   0, /*tp_print*/
132967   0, /*tp_getattr*/
132968   0, /*tp_setattr*/
132969   0, /*tp_compare*/
132970   0, /*tp_repr*/
132971   &__pyx_tp_as_number_iterparse, /*tp_as_number*/
132972   &__pyx_tp_as_sequence_iterparse, /*tp_as_sequence*/
132973   &__pyx_tp_as_mapping_iterparse, /*tp_as_mapping*/
132974   0, /*tp_hash*/
132975   0, /*tp_call*/
132976   0, /*tp_str*/
132977   0, /*tp_getattro*/
132978   0, /*tp_setattro*/
132979   &__pyx_tp_as_buffer_iterparse, /*tp_as_buffer*/
132980   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
132981   __Pyx_DOCSTR("iterparse(self, source, events=(\"end\",), tag=None, attribute_defaults=False, dtd_validation=False, load_dtd=False, no_network=True, remove_blank_text=False, remove_comments=False, remove_pis=False, encoding=None, html=False, huge_tree=False, schema=None)\n\nIncremental parser.\n\nParses XML into a tree and generates tuples (event, element) in a\nSAX-like fashion. ``event`` is any of 'start', 'end', 'start-ns',\n'end-ns'.\n\nFor 'start' and 'end', ``element`` is the Element that the parser just\nfound opening or closing.  For 'start-ns', it is a tuple (prefix, URI) of\na new namespace declaration.  For 'end-ns', it is simply None.  Note that\nall start and end events are guaranteed to be properly nested.\n\nThe keyword argument ``events`` specifies a sequence of event type names\nthat should be generated.  By default, only 'end' events will be\ngenerated.\n\nThe additional ``tag`` argument restricts the 'start' and 'end' events to\nthose elements that match the given tag.  By default, events are generated\nfor all elements.  Note that the 'start-ns' and 'end-ns' events are not\nimpacted by this restriction.\n\nThe other keyword arguments in the constructor are mainly based on the\nlibxml2 parser configuration.  A DTD will also be loaded if validation or\nattribute default values are requested.\n\nAvailable boolean keyword arguments:\n - attribute_defaults: read default attributes from DTD\n - dtd_validation: validate (if DTD is available)\n - load_dtd: use DTD for parsing\n - no_network: prevent network access for related files\n - remove_blank_text: discard blank text nodes\n - remove_comments: discard comments\n - remove_pis: discard processing instructions\n - strip_cdata: replace CDATA sections by normal text content (default: True)\n - compact: safe memory for short text content (default: True)\n - resolve_entities: replace entities by their text value (default: True)\n - huge_tree: disable security restrictions and support very deep trees\n              and very long text content (only affects libxml2 2.7+)\n\nOther keyword arguments:\n - encoding: override the document encoding\n - schema: an XMLSchema to validate against\n"), /*tp_doc*/
132982   __pyx_tp_traverse_4lxml_5etree_iterparse, /*tp_traverse*/
132983   __pyx_tp_clear_4lxml_5etree_iterparse, /*tp_clear*/
132984   0, /*tp_richcompare*/
132985   0, /*tp_weaklistoffset*/
132986   __pyx_pf_4lxml_5etree_9iterparse___iter__, /*tp_iter*/
132987   __pyx_pf_4lxml_5etree_9iterparse___next__, /*tp_iternext*/
132988   __pyx_methods_4lxml_5etree_iterparse, /*tp_methods*/
132989   __pyx_members_4lxml_5etree_iterparse, /*tp_members*/
132990   __pyx_getsets_4lxml_5etree_iterparse, /*tp_getset*/
132991   0, /*tp_base*/
132992   0, /*tp_dict*/
132993   0, /*tp_descr_get*/
132994   0, /*tp_descr_set*/
132995   0, /*tp_dictoffset*/
132996   __pyx_pf_4lxml_5etree_9iterparse___init__, /*tp_init*/
132997   0, /*tp_alloc*/
132998   __pyx_tp_new_4lxml_5etree_iterparse, /*tp_new*/
132999   0, /*tp_free*/
133000   0, /*tp_is_gc*/
133001   0, /*tp_bases*/
133002   0, /*tp_mro*/
133003   0, /*tp_cache*/
133004   0, /*tp_subclasses*/
133005   0, /*tp_weaklist*/
133006 };
133007 static struct __pyx_vtabstruct_4lxml_5etree_iterwalk __pyx_vtable_4lxml_5etree_iterwalk;
133008
133009 static PyObject *__pyx_tp_new_4lxml_5etree_iterwalk(PyTypeObject *t, PyObject *a, PyObject *k) {
133010   struct __pyx_obj_4lxml_5etree_iterwalk *p;
133011   PyObject *o = (*t->tp_alloc)(t, 0);
133012   if (!o) return 0;
133013   p = ((struct __pyx_obj_4lxml_5etree_iterwalk *)o);
133014   p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree_iterwalk;
133015   p->_node_stack = ((PyObject *)Py_None); Py_INCREF(Py_None);
133016   p->_pop_node = Py_None; Py_INCREF(Py_None);
133017   p->_events = ((PyObject *)Py_None); Py_INCREF(Py_None);
133018   p->_pop_event = Py_None; Py_INCREF(Py_None);
133019   p->_tag_tuple = ((PyObject *)Py_None); Py_INCREF(Py_None);
133020   return o;
133021 }
133022
133023 static void __pyx_tp_dealloc_4lxml_5etree_iterwalk(PyObject *o) {
133024   struct __pyx_obj_4lxml_5etree_iterwalk *p = (struct __pyx_obj_4lxml_5etree_iterwalk *)o;
133025   Py_XDECREF(((PyObject *)p->_node_stack));
133026   Py_XDECREF(p->_pop_node);
133027   Py_XDECREF(((PyObject *)p->_events));
133028   Py_XDECREF(p->_pop_event);
133029   Py_XDECREF(((PyObject *)p->_tag_tuple));
133030   (*Py_TYPE(o)->tp_free)(o);
133031 }
133032
133033 static int __pyx_tp_traverse_4lxml_5etree_iterwalk(PyObject *o, visitproc v, void *a) {
133034   int e;
133035   struct __pyx_obj_4lxml_5etree_iterwalk *p = (struct __pyx_obj_4lxml_5etree_iterwalk *)o;
133036   if (p->_node_stack) {
133037     e = (*v)(p->_node_stack, a); if (e) return e;
133038   }
133039   if (p->_pop_node) {
133040     e = (*v)(p->_pop_node, a); if (e) return e;
133041   }
133042   if (p->_events) {
133043     e = (*v)(p->_events, a); if (e) return e;
133044   }
133045   if (p->_pop_event) {
133046     e = (*v)(p->_pop_event, a); if (e) return e;
133047   }
133048   if (p->_tag_tuple) {
133049     e = (*v)(p->_tag_tuple, a); if (e) return e;
133050   }
133051   return 0;
133052 }
133053
133054 static int __pyx_tp_clear_4lxml_5etree_iterwalk(PyObject *o) {
133055   struct __pyx_obj_4lxml_5etree_iterwalk *p = (struct __pyx_obj_4lxml_5etree_iterwalk *)o;
133056   PyObject* tmp;
133057   tmp = ((PyObject*)p->_node_stack);
133058   p->_node_stack = ((PyObject *)Py_None); Py_INCREF(Py_None);
133059   Py_XDECREF(tmp);
133060   tmp = ((PyObject*)p->_pop_node);
133061   p->_pop_node = Py_None; Py_INCREF(Py_None);
133062   Py_XDECREF(tmp);
133063   tmp = ((PyObject*)p->_events);
133064   p->_events = ((PyObject *)Py_None); Py_INCREF(Py_None);
133065   Py_XDECREF(tmp);
133066   tmp = ((PyObject*)p->_pop_event);
133067   p->_pop_event = Py_None; Py_INCREF(Py_None);
133068   Py_XDECREF(tmp);
133069   tmp = ((PyObject*)p->_tag_tuple);
133070   p->_tag_tuple = ((PyObject *)Py_None); Py_INCREF(Py_None);
133071   Py_XDECREF(tmp);
133072   return 0;
133073 }
133074
133075 static struct PyMethodDef __pyx_methods_4lxml_5etree_iterwalk[] = {
133076   {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_4lxml_5etree_8iterwalk___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
133077   {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_4lxml_5etree_8iterwalk___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
133078   {0, 0, 0, 0}
133079 };
133080
133081 static PyNumberMethods __pyx_tp_as_number_iterwalk = {
133082   0, /*nb_add*/
133083   0, /*nb_subtract*/
133084   0, /*nb_multiply*/
133085   #if PY_MAJOR_VERSION < 3
133086   0, /*nb_divide*/
133087   #endif
133088   0, /*nb_remainder*/
133089   0, /*nb_divmod*/
133090   0, /*nb_power*/
133091   0, /*nb_negative*/
133092   0, /*nb_positive*/
133093   0, /*nb_absolute*/
133094   0, /*nb_nonzero*/
133095   0, /*nb_invert*/
133096   0, /*nb_lshift*/
133097   0, /*nb_rshift*/
133098   0, /*nb_and*/
133099   0, /*nb_xor*/
133100   0, /*nb_or*/
133101   #if PY_MAJOR_VERSION < 3
133102   0, /*nb_coerce*/
133103   #endif
133104   0, /*nb_int*/
133105   #if PY_MAJOR_VERSION >= 3
133106   0, /*reserved*/
133107   #else
133108   0, /*nb_long*/
133109   #endif
133110   0, /*nb_float*/
133111   #if PY_MAJOR_VERSION < 3
133112   0, /*nb_oct*/
133113   #endif
133114   #if PY_MAJOR_VERSION < 3
133115   0, /*nb_hex*/
133116   #endif
133117   0, /*nb_inplace_add*/
133118   0, /*nb_inplace_subtract*/
133119   0, /*nb_inplace_multiply*/
133120   #if PY_MAJOR_VERSION < 3
133121   0, /*nb_inplace_divide*/
133122   #endif
133123   0, /*nb_inplace_remainder*/
133124   0, /*nb_inplace_power*/
133125   0, /*nb_inplace_lshift*/
133126   0, /*nb_inplace_rshift*/
133127   0, /*nb_inplace_and*/
133128   0, /*nb_inplace_xor*/
133129   0, /*nb_inplace_or*/
133130   0, /*nb_floor_divide*/
133131   0, /*nb_true_divide*/
133132   0, /*nb_inplace_floor_divide*/
133133   0, /*nb_inplace_true_divide*/
133134   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
133135   0, /*nb_index*/
133136   #endif
133137 };
133138
133139 static PySequenceMethods __pyx_tp_as_sequence_iterwalk = {
133140   0, /*sq_length*/
133141   0, /*sq_concat*/
133142   0, /*sq_repeat*/
133143   0, /*sq_item*/
133144   0, /*sq_slice*/
133145   0, /*sq_ass_item*/
133146   0, /*sq_ass_slice*/
133147   0, /*sq_contains*/
133148   0, /*sq_inplace_concat*/
133149   0, /*sq_inplace_repeat*/
133150 };
133151
133152 static PyMappingMethods __pyx_tp_as_mapping_iterwalk = {
133153   0, /*mp_length*/
133154   0, /*mp_subscript*/
133155   0, /*mp_ass_subscript*/
133156 };
133157
133158 static PyBufferProcs __pyx_tp_as_buffer_iterwalk = {
133159   #if PY_MAJOR_VERSION < 3
133160   0, /*bf_getreadbuffer*/
133161   #endif
133162   #if PY_MAJOR_VERSION < 3
133163   0, /*bf_getwritebuffer*/
133164   #endif
133165   #if PY_MAJOR_VERSION < 3
133166   0, /*bf_getsegcount*/
133167   #endif
133168   #if PY_MAJOR_VERSION < 3
133169   0, /*bf_getcharbuffer*/
133170   #endif
133171   #if PY_VERSION_HEX >= 0x02060000
133172   0, /*bf_getbuffer*/
133173   #endif
133174   #if PY_VERSION_HEX >= 0x02060000
133175   0, /*bf_releasebuffer*/
133176   #endif
133177 };
133178
133179 PyTypeObject __pyx_type_4lxml_5etree_iterwalk = {
133180   PyVarObject_HEAD_INIT(0, 0)
133181   __Pyx_NAMESTR("lxml.etree.iterwalk"), /*tp_name*/
133182   sizeof(struct __pyx_obj_4lxml_5etree_iterwalk), /*tp_basicsize*/
133183   0, /*tp_itemsize*/
133184   __pyx_tp_dealloc_4lxml_5etree_iterwalk, /*tp_dealloc*/
133185   0, /*tp_print*/
133186   0, /*tp_getattr*/
133187   0, /*tp_setattr*/
133188   0, /*tp_compare*/
133189   0, /*tp_repr*/
133190   &__pyx_tp_as_number_iterwalk, /*tp_as_number*/
133191   &__pyx_tp_as_sequence_iterwalk, /*tp_as_sequence*/
133192   &__pyx_tp_as_mapping_iterwalk, /*tp_as_mapping*/
133193   0, /*tp_hash*/
133194   0, /*tp_call*/
133195   0, /*tp_str*/
133196   0, /*tp_getattro*/
133197   0, /*tp_setattro*/
133198   &__pyx_tp_as_buffer_iterwalk, /*tp_as_buffer*/
133199   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
133200   __Pyx_DOCSTR("iterwalk(self, element_or_tree, events=(\"end\",), tag=None)\n\n    A tree walker that generates events from an existing tree as if it\n    was parsing XML data with ``iterparse()``.\n    "), /*tp_doc*/
133201   __pyx_tp_traverse_4lxml_5etree_iterwalk, /*tp_traverse*/
133202   __pyx_tp_clear_4lxml_5etree_iterwalk, /*tp_clear*/
133203   0, /*tp_richcompare*/
133204   0, /*tp_weaklistoffset*/
133205   __pyx_pf_4lxml_5etree_8iterwalk___iter__, /*tp_iter*/
133206   __pyx_pf_4lxml_5etree_8iterwalk___next__, /*tp_iternext*/
133207   __pyx_methods_4lxml_5etree_iterwalk, /*tp_methods*/
133208   0, /*tp_members*/
133209   0, /*tp_getset*/
133210   0, /*tp_base*/
133211   0, /*tp_dict*/
133212   0, /*tp_descr_get*/
133213   0, /*tp_descr_set*/
133214   0, /*tp_dictoffset*/
133215   __pyx_pf_4lxml_5etree_8iterwalk___init__, /*tp_init*/
133216   0, /*tp_alloc*/
133217   __pyx_tp_new_4lxml_5etree_iterwalk, /*tp_new*/
133218   0, /*tp_free*/
133219   0, /*tp_is_gc*/
133220   0, /*tp_bases*/
133221   0, /*tp_mro*/
133222   0, /*tp_cache*/
133223   0, /*tp_subclasses*/
133224   0, /*tp_weaklist*/
133225 };
133226 static struct __pyx_vtabstruct_4lxml_5etree__IDDict __pyx_vtable_4lxml_5etree__IDDict;
133227
133228 static PyObject *__pyx_tp_new_4lxml_5etree__IDDict(PyTypeObject *t, PyObject *a, PyObject *k) {
133229   struct __pyx_obj_4lxml_5etree__IDDict *p;
133230   PyObject *o = (*t->tp_alloc)(t, 0);
133231   if (!o) return 0;
133232   p = ((struct __pyx_obj_4lxml_5etree__IDDict *)o);
133233   p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__IDDict;
133234   p->_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
133235   p->_keys = Py_None; Py_INCREF(Py_None);
133236   p->_items = Py_None; Py_INCREF(Py_None);
133237   return o;
133238 }
133239
133240 static void __pyx_tp_dealloc_4lxml_5etree__IDDict(PyObject *o) {
133241   struct __pyx_obj_4lxml_5etree__IDDict *p = (struct __pyx_obj_4lxml_5etree__IDDict *)o;
133242   Py_XDECREF(((PyObject *)p->_doc));
133243   Py_XDECREF(p->_keys);
133244   Py_XDECREF(p->_items);
133245   (*Py_TYPE(o)->tp_free)(o);
133246 }
133247
133248 static int __pyx_tp_traverse_4lxml_5etree__IDDict(PyObject *o, visitproc v, void *a) {
133249   int e;
133250   struct __pyx_obj_4lxml_5etree__IDDict *p = (struct __pyx_obj_4lxml_5etree__IDDict *)o;
133251   if (p->_doc) {
133252     e = (*v)(((PyObject*)p->_doc), a); if (e) return e;
133253   }
133254   if (p->_keys) {
133255     e = (*v)(p->_keys, a); if (e) return e;
133256   }
133257   if (p->_items) {
133258     e = (*v)(p->_items, a); if (e) return e;
133259   }
133260   return 0;
133261 }
133262
133263 static int __pyx_tp_clear_4lxml_5etree__IDDict(PyObject *o) {
133264   struct __pyx_obj_4lxml_5etree__IDDict *p = (struct __pyx_obj_4lxml_5etree__IDDict *)o;
133265   PyObject* tmp;
133266   tmp = ((PyObject*)p->_doc);
133267   p->_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
133268   Py_XDECREF(tmp);
133269   tmp = ((PyObject*)p->_keys);
133270   p->_keys = Py_None; Py_INCREF(Py_None);
133271   Py_XDECREF(tmp);
133272   tmp = ((PyObject*)p->_items);
133273   p->_items = Py_None; Py_INCREF(Py_None);
133274   Py_XDECREF(tmp);
133275   return 0;
133276 }
133277 static PyObject *__pyx_sq_item_4lxml_5etree__IDDict(PyObject *o, Py_ssize_t i) {
133278   PyObject *r;
133279   PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
133280   r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
133281   Py_DECREF(x);
133282   return r;
133283 }
133284
133285 static struct PyMethodDef __pyx_methods_4lxml_5etree__IDDict[] = {
133286   {__Pyx_NAMESTR("copy"), (PyCFunction)__pyx_pf_4lxml_5etree_7_IDDict_copy, METH_NOARGS, __Pyx_DOCSTR(0)},
133287   {__Pyx_NAMESTR("__getitem__"), (PyCFunction)__pyx_pf_4lxml_5etree_7_IDDict___getitem__, METH_O|METH_COEXIST, __Pyx_DOCSTR(0)},
133288   {__Pyx_NAMESTR("get"), (PyCFunction)__pyx_pf_4lxml_5etree_7_IDDict_get, METH_O, __Pyx_DOCSTR(0)},
133289   {__Pyx_NAMESTR("has_key"), (PyCFunction)__pyx_pf_4lxml_5etree_7_IDDict_has_key, METH_O, __Pyx_DOCSTR(0)},
133290   {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_4lxml_5etree_7_IDDict___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
133291   {__Pyx_NAMESTR("keys"), (PyCFunction)__pyx_pf_4lxml_5etree_7_IDDict_keys, METH_NOARGS, __Pyx_DOCSTR(0)},
133292   {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_4lxml_5etree_7_IDDict___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
133293   {__Pyx_NAMESTR("iterkeys"), (PyCFunction)__pyx_pf_4lxml_5etree_7_IDDict_iterkeys, METH_NOARGS, __Pyx_DOCSTR(0)},
133294   {__Pyx_NAMESTR("items"), (PyCFunction)__pyx_pf_4lxml_5etree_7_IDDict_items, METH_NOARGS, __Pyx_DOCSTR(0)},
133295   {__Pyx_NAMESTR("iteritems"), (PyCFunction)__pyx_pf_4lxml_5etree_7_IDDict_iteritems, METH_NOARGS, __Pyx_DOCSTR(0)},
133296   {__Pyx_NAMESTR("values"), (PyCFunction)__pyx_pf_4lxml_5etree_7_IDDict_values, METH_NOARGS, __Pyx_DOCSTR(0)},
133297   {__Pyx_NAMESTR("itervalues"), (PyCFunction)__pyx_pf_4lxml_5etree_7_IDDict_itervalues, METH_NOARGS, __Pyx_DOCSTR(0)},
133298   {0, 0, 0, 0}
133299 };
133300
133301 static PyNumberMethods __pyx_tp_as_number__IDDict = {
133302   0, /*nb_add*/
133303   0, /*nb_subtract*/
133304   0, /*nb_multiply*/
133305   #if PY_MAJOR_VERSION < 3
133306   0, /*nb_divide*/
133307   #endif
133308   0, /*nb_remainder*/
133309   0, /*nb_divmod*/
133310   0, /*nb_power*/
133311   0, /*nb_negative*/
133312   0, /*nb_positive*/
133313   0, /*nb_absolute*/
133314   0, /*nb_nonzero*/
133315   0, /*nb_invert*/
133316   0, /*nb_lshift*/
133317   0, /*nb_rshift*/
133318   0, /*nb_and*/
133319   0, /*nb_xor*/
133320   0, /*nb_or*/
133321   #if PY_MAJOR_VERSION < 3
133322   0, /*nb_coerce*/
133323   #endif
133324   0, /*nb_int*/
133325   #if PY_MAJOR_VERSION >= 3
133326   0, /*reserved*/
133327   #else
133328   0, /*nb_long*/
133329   #endif
133330   0, /*nb_float*/
133331   #if PY_MAJOR_VERSION < 3
133332   0, /*nb_oct*/
133333   #endif
133334   #if PY_MAJOR_VERSION < 3
133335   0, /*nb_hex*/
133336   #endif
133337   0, /*nb_inplace_add*/
133338   0, /*nb_inplace_subtract*/
133339   0, /*nb_inplace_multiply*/
133340   #if PY_MAJOR_VERSION < 3
133341   0, /*nb_inplace_divide*/
133342   #endif
133343   0, /*nb_inplace_remainder*/
133344   0, /*nb_inplace_power*/
133345   0, /*nb_inplace_lshift*/
133346   0, /*nb_inplace_rshift*/
133347   0, /*nb_inplace_and*/
133348   0, /*nb_inplace_xor*/
133349   0, /*nb_inplace_or*/
133350   0, /*nb_floor_divide*/
133351   0, /*nb_true_divide*/
133352   0, /*nb_inplace_floor_divide*/
133353   0, /*nb_inplace_true_divide*/
133354   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
133355   0, /*nb_index*/
133356   #endif
133357 };
133358
133359 static PySequenceMethods __pyx_tp_as_sequence__IDDict = {
133360   __pyx_pf_4lxml_5etree_7_IDDict___len__, /*sq_length*/
133361   0, /*sq_concat*/
133362   0, /*sq_repeat*/
133363   __pyx_sq_item_4lxml_5etree__IDDict, /*sq_item*/
133364   0, /*sq_slice*/
133365   0, /*sq_ass_item*/
133366   0, /*sq_ass_slice*/
133367   __pyx_pf_4lxml_5etree_7_IDDict___contains__, /*sq_contains*/
133368   0, /*sq_inplace_concat*/
133369   0, /*sq_inplace_repeat*/
133370 };
133371
133372 static PyMappingMethods __pyx_tp_as_mapping__IDDict = {
133373   __pyx_pf_4lxml_5etree_7_IDDict___len__, /*mp_length*/
133374   __pyx_pf_4lxml_5etree_7_IDDict___getitem__, /*mp_subscript*/
133375   0, /*mp_ass_subscript*/
133376 };
133377
133378 static PyBufferProcs __pyx_tp_as_buffer__IDDict = {
133379   #if PY_MAJOR_VERSION < 3
133380   0, /*bf_getreadbuffer*/
133381   #endif
133382   #if PY_MAJOR_VERSION < 3
133383   0, /*bf_getwritebuffer*/
133384   #endif
133385   #if PY_MAJOR_VERSION < 3
133386   0, /*bf_getsegcount*/
133387   #endif
133388   #if PY_MAJOR_VERSION < 3
133389   0, /*bf_getcharbuffer*/
133390   #endif
133391   #if PY_VERSION_HEX >= 0x02060000
133392   0, /*bf_getbuffer*/
133393   #endif
133394   #if PY_VERSION_HEX >= 0x02060000
133395   0, /*bf_releasebuffer*/
133396   #endif
133397 };
133398
133399 PyTypeObject __pyx_type_4lxml_5etree__IDDict = {
133400   PyVarObject_HEAD_INIT(0, 0)
133401   __Pyx_NAMESTR("lxml.etree._IDDict"), /*tp_name*/
133402   sizeof(struct __pyx_obj_4lxml_5etree__IDDict), /*tp_basicsize*/
133403   0, /*tp_itemsize*/
133404   __pyx_tp_dealloc_4lxml_5etree__IDDict, /*tp_dealloc*/
133405   0, /*tp_print*/
133406   0, /*tp_getattr*/
133407   0, /*tp_setattr*/
133408   0, /*tp_compare*/
133409   __pyx_pf_4lxml_5etree_7_IDDict___repr__, /*tp_repr*/
133410   &__pyx_tp_as_number__IDDict, /*tp_as_number*/
133411   &__pyx_tp_as_sequence__IDDict, /*tp_as_sequence*/
133412   &__pyx_tp_as_mapping__IDDict, /*tp_as_mapping*/
133413   0, /*tp_hash*/
133414   0, /*tp_call*/
133415   0, /*tp_str*/
133416   0, /*tp_getattro*/
133417   0, /*tp_setattro*/
133418   &__pyx_tp_as_buffer__IDDict, /*tp_as_buffer*/
133419   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
133420   __Pyx_DOCSTR("IDDict(self, etree)\n    A dictionary-like proxy class that mapps ID attributes to elements.\n\n    The dictionary must be instantiated with the root element of a parsed XML\n    document, otherwise the behaviour is undefined.  Elements and XML trees\n    that were created or modified 'by hand' are not supported.\n    "), /*tp_doc*/
133421   __pyx_tp_traverse_4lxml_5etree__IDDict, /*tp_traverse*/
133422   __pyx_tp_clear_4lxml_5etree__IDDict, /*tp_clear*/
133423   0, /*tp_richcompare*/
133424   0, /*tp_weaklistoffset*/
133425   __pyx_pf_4lxml_5etree_7_IDDict___iter__, /*tp_iter*/
133426   0, /*tp_iternext*/
133427   __pyx_methods_4lxml_5etree__IDDict, /*tp_methods*/
133428   0, /*tp_members*/
133429   0, /*tp_getset*/
133430   0, /*tp_base*/
133431   0, /*tp_dict*/
133432   0, /*tp_descr_get*/
133433   0, /*tp_descr_set*/
133434   0, /*tp_dictoffset*/
133435   __pyx_pf_4lxml_5etree_7_IDDict___init__, /*tp_init*/
133436   0, /*tp_alloc*/
133437   __pyx_tp_new_4lxml_5etree__IDDict, /*tp_new*/
133438   0, /*tp_free*/
133439   0, /*tp_is_gc*/
133440   0, /*tp_bases*/
133441   0, /*tp_mro*/
133442   0, /*tp_cache*/
133443   0, /*tp_subclasses*/
133444   0, /*tp_weaklist*/
133445 };
133446
133447 static PyObject *__pyx_tp_new_4lxml_5etree_XInclude(PyTypeObject *t, PyObject *a, PyObject *k) {
133448   struct __pyx_obj_4lxml_5etree_XInclude *p;
133449   PyObject *o = (*t->tp_alloc)(t, 0);
133450   if (!o) return 0;
133451   p = ((struct __pyx_obj_4lxml_5etree_XInclude *)o);
133452   p->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
133453   return o;
133454 }
133455
133456 static void __pyx_tp_dealloc_4lxml_5etree_XInclude(PyObject *o) {
133457   struct __pyx_obj_4lxml_5etree_XInclude *p = (struct __pyx_obj_4lxml_5etree_XInclude *)o;
133458   Py_XDECREF(((PyObject *)p->_error_log));
133459   (*Py_TYPE(o)->tp_free)(o);
133460 }
133461
133462 static int __pyx_tp_traverse_4lxml_5etree_XInclude(PyObject *o, visitproc v, void *a) {
133463   int e;
133464   struct __pyx_obj_4lxml_5etree_XInclude *p = (struct __pyx_obj_4lxml_5etree_XInclude *)o;
133465   if (p->_error_log) {
133466     e = (*v)(((PyObject*)p->_error_log), a); if (e) return e;
133467   }
133468   return 0;
133469 }
133470
133471 static int __pyx_tp_clear_4lxml_5etree_XInclude(PyObject *o) {
133472   struct __pyx_obj_4lxml_5etree_XInclude *p = (struct __pyx_obj_4lxml_5etree_XInclude *)o;
133473   PyObject* tmp;
133474   tmp = ((PyObject*)p->_error_log);
133475   p->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
133476   Py_XDECREF(tmp);
133477   return 0;
133478 }
133479
133480 static PyObject *__pyx_getprop_4lxml_5etree_8XInclude_error_log(PyObject *o, void *x) {
133481   return __pyx_pf_4lxml_5etree_8XInclude_9error_log___get__(o);
133482 }
133483
133484 static struct PyMethodDef __pyx_methods_4lxml_5etree_XInclude[] = {
133485   {__Pyx_NAMESTR("__call__"), (PyCFunction)__pyx_pf_4lxml_5etree_8XInclude___call__, METH_VARARGS|METH_KEYWORDS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_8XInclude___call__)},
133486   {0, 0, 0, 0}
133487 };
133488
133489 static struct PyGetSetDef __pyx_getsets_4lxml_5etree_XInclude[] = {
133490   {(char *)"error_log", __pyx_getprop_4lxml_5etree_8XInclude_error_log, 0, 0, 0},
133491   {0, 0, 0, 0, 0}
133492 };
133493
133494 static PyNumberMethods __pyx_tp_as_number_XInclude = {
133495   0, /*nb_add*/
133496   0, /*nb_subtract*/
133497   0, /*nb_multiply*/
133498   #if PY_MAJOR_VERSION < 3
133499   0, /*nb_divide*/
133500   #endif
133501   0, /*nb_remainder*/
133502   0, /*nb_divmod*/
133503   0, /*nb_power*/
133504   0, /*nb_negative*/
133505   0, /*nb_positive*/
133506   0, /*nb_absolute*/
133507   0, /*nb_nonzero*/
133508   0, /*nb_invert*/
133509   0, /*nb_lshift*/
133510   0, /*nb_rshift*/
133511   0, /*nb_and*/
133512   0, /*nb_xor*/
133513   0, /*nb_or*/
133514   #if PY_MAJOR_VERSION < 3
133515   0, /*nb_coerce*/
133516   #endif
133517   0, /*nb_int*/
133518   #if PY_MAJOR_VERSION >= 3
133519   0, /*reserved*/
133520   #else
133521   0, /*nb_long*/
133522   #endif
133523   0, /*nb_float*/
133524   #if PY_MAJOR_VERSION < 3
133525   0, /*nb_oct*/
133526   #endif
133527   #if PY_MAJOR_VERSION < 3
133528   0, /*nb_hex*/
133529   #endif
133530   0, /*nb_inplace_add*/
133531   0, /*nb_inplace_subtract*/
133532   0, /*nb_inplace_multiply*/
133533   #if PY_MAJOR_VERSION < 3
133534   0, /*nb_inplace_divide*/
133535   #endif
133536   0, /*nb_inplace_remainder*/
133537   0, /*nb_inplace_power*/
133538   0, /*nb_inplace_lshift*/
133539   0, /*nb_inplace_rshift*/
133540   0, /*nb_inplace_and*/
133541   0, /*nb_inplace_xor*/
133542   0, /*nb_inplace_or*/
133543   0, /*nb_floor_divide*/
133544   0, /*nb_true_divide*/
133545   0, /*nb_inplace_floor_divide*/
133546   0, /*nb_inplace_true_divide*/
133547   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
133548   0, /*nb_index*/
133549   #endif
133550 };
133551
133552 static PySequenceMethods __pyx_tp_as_sequence_XInclude = {
133553   0, /*sq_length*/
133554   0, /*sq_concat*/
133555   0, /*sq_repeat*/
133556   0, /*sq_item*/
133557   0, /*sq_slice*/
133558   0, /*sq_ass_item*/
133559   0, /*sq_ass_slice*/
133560   0, /*sq_contains*/
133561   0, /*sq_inplace_concat*/
133562   0, /*sq_inplace_repeat*/
133563 };
133564
133565 static PyMappingMethods __pyx_tp_as_mapping_XInclude = {
133566   0, /*mp_length*/
133567   0, /*mp_subscript*/
133568   0, /*mp_ass_subscript*/
133569 };
133570
133571 static PyBufferProcs __pyx_tp_as_buffer_XInclude = {
133572   #if PY_MAJOR_VERSION < 3
133573   0, /*bf_getreadbuffer*/
133574   #endif
133575   #if PY_MAJOR_VERSION < 3
133576   0, /*bf_getwritebuffer*/
133577   #endif
133578   #if PY_MAJOR_VERSION < 3
133579   0, /*bf_getsegcount*/
133580   #endif
133581   #if PY_MAJOR_VERSION < 3
133582   0, /*bf_getcharbuffer*/
133583   #endif
133584   #if PY_VERSION_HEX >= 0x02060000
133585   0, /*bf_getbuffer*/
133586   #endif
133587   #if PY_VERSION_HEX >= 0x02060000
133588   0, /*bf_releasebuffer*/
133589   #endif
133590 };
133591
133592 PyTypeObject __pyx_type_4lxml_5etree_XInclude = {
133593   PyVarObject_HEAD_INIT(0, 0)
133594   __Pyx_NAMESTR("lxml.etree.XInclude"), /*tp_name*/
133595   sizeof(struct __pyx_obj_4lxml_5etree_XInclude), /*tp_basicsize*/
133596   0, /*tp_itemsize*/
133597   __pyx_tp_dealloc_4lxml_5etree_XInclude, /*tp_dealloc*/
133598   0, /*tp_print*/
133599   0, /*tp_getattr*/
133600   0, /*tp_setattr*/
133601   0, /*tp_compare*/
133602   0, /*tp_repr*/
133603   &__pyx_tp_as_number_XInclude, /*tp_as_number*/
133604   &__pyx_tp_as_sequence_XInclude, /*tp_as_sequence*/
133605   &__pyx_tp_as_mapping_XInclude, /*tp_as_mapping*/
133606   0, /*tp_hash*/
133607   __pyx_pf_4lxml_5etree_8XInclude___call__, /*tp_call*/
133608   0, /*tp_str*/
133609   0, /*tp_getattro*/
133610   0, /*tp_setattro*/
133611   &__pyx_tp_as_buffer_XInclude, /*tp_as_buffer*/
133612   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
133613   __Pyx_DOCSTR("XInclude(self)\n    XInclude processor.\n\n    Create an instance and call it on an Element to run XInclude\n    processing.\n    "), /*tp_doc*/
133614   __pyx_tp_traverse_4lxml_5etree_XInclude, /*tp_traverse*/
133615   __pyx_tp_clear_4lxml_5etree_XInclude, /*tp_clear*/
133616   0, /*tp_richcompare*/
133617   0, /*tp_weaklistoffset*/
133618   0, /*tp_iter*/
133619   0, /*tp_iternext*/
133620   __pyx_methods_4lxml_5etree_XInclude, /*tp_methods*/
133621   0, /*tp_members*/
133622   __pyx_getsets_4lxml_5etree_XInclude, /*tp_getset*/
133623   0, /*tp_base*/
133624   0, /*tp_dict*/
133625   0, /*tp_descr_get*/
133626   0, /*tp_descr_set*/
133627   0, /*tp_dictoffset*/
133628   __pyx_pf_4lxml_5etree_8XInclude___init__, /*tp_init*/
133629   0, /*tp_alloc*/
133630   __pyx_tp_new_4lxml_5etree_XInclude, /*tp_new*/
133631   0, /*tp_free*/
133632   0, /*tp_is_gc*/
133633   0, /*tp_bases*/
133634   0, /*tp_mro*/
133635   0, /*tp_cache*/
133636   0, /*tp_subclasses*/
133637   0, /*tp_weaklist*/
133638 };
133639 static struct __pyx_vtabstruct_4lxml_5etree__ExsltRegExp __pyx_vtable_4lxml_5etree__ExsltRegExp;
133640
133641 static PyObject *__pyx_tp_new_4lxml_5etree__ExsltRegExp(PyTypeObject *t, PyObject *a, PyObject *k) {
133642   struct __pyx_obj_4lxml_5etree__ExsltRegExp *p;
133643   PyObject *o = (*t->tp_alloc)(t, 0);
133644   if (!o) return 0;
133645   p = ((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)o);
133646   p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__ExsltRegExp;
133647   p->_compile_map = ((PyObject *)Py_None); Py_INCREF(Py_None);
133648   return o;
133649 }
133650
133651 static void __pyx_tp_dealloc_4lxml_5etree__ExsltRegExp(PyObject *o) {
133652   struct __pyx_obj_4lxml_5etree__ExsltRegExp *p = (struct __pyx_obj_4lxml_5etree__ExsltRegExp *)o;
133653   Py_XDECREF(((PyObject *)p->_compile_map));
133654   (*Py_TYPE(o)->tp_free)(o);
133655 }
133656
133657 static int __pyx_tp_traverse_4lxml_5etree__ExsltRegExp(PyObject *o, visitproc v, void *a) {
133658   int e;
133659   struct __pyx_obj_4lxml_5etree__ExsltRegExp *p = (struct __pyx_obj_4lxml_5etree__ExsltRegExp *)o;
133660   if (p->_compile_map) {
133661     e = (*v)(p->_compile_map, a); if (e) return e;
133662   }
133663   return 0;
133664 }
133665
133666 static int __pyx_tp_clear_4lxml_5etree__ExsltRegExp(PyObject *o) {
133667   struct __pyx_obj_4lxml_5etree__ExsltRegExp *p = (struct __pyx_obj_4lxml_5etree__ExsltRegExp *)o;
133668   PyObject* tmp;
133669   tmp = ((PyObject*)p->_compile_map);
133670   p->_compile_map = ((PyObject *)Py_None); Py_INCREF(Py_None);
133671   Py_XDECREF(tmp);
133672   return 0;
133673 }
133674
133675 static struct PyMethodDef __pyx_methods_4lxml_5etree__ExsltRegExp[] = {
133676   {__Pyx_NAMESTR("test"), (PyCFunction)__pyx_pf_4lxml_5etree_12_ExsltRegExp_test, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
133677   {__Pyx_NAMESTR("match"), (PyCFunction)__pyx_pf_4lxml_5etree_12_ExsltRegExp_match, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
133678   {__Pyx_NAMESTR("replace"), (PyCFunction)__pyx_pf_4lxml_5etree_12_ExsltRegExp_replace, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
133679   {0, 0, 0, 0}
133680 };
133681
133682 static PyNumberMethods __pyx_tp_as_number__ExsltRegExp = {
133683   0, /*nb_add*/
133684   0, /*nb_subtract*/
133685   0, /*nb_multiply*/
133686   #if PY_MAJOR_VERSION < 3
133687   0, /*nb_divide*/
133688   #endif
133689   0, /*nb_remainder*/
133690   0, /*nb_divmod*/
133691   0, /*nb_power*/
133692   0, /*nb_negative*/
133693   0, /*nb_positive*/
133694   0, /*nb_absolute*/
133695   0, /*nb_nonzero*/
133696   0, /*nb_invert*/
133697   0, /*nb_lshift*/
133698   0, /*nb_rshift*/
133699   0, /*nb_and*/
133700   0, /*nb_xor*/
133701   0, /*nb_or*/
133702   #if PY_MAJOR_VERSION < 3
133703   0, /*nb_coerce*/
133704   #endif
133705   0, /*nb_int*/
133706   #if PY_MAJOR_VERSION >= 3
133707   0, /*reserved*/
133708   #else
133709   0, /*nb_long*/
133710   #endif
133711   0, /*nb_float*/
133712   #if PY_MAJOR_VERSION < 3
133713   0, /*nb_oct*/
133714   #endif
133715   #if PY_MAJOR_VERSION < 3
133716   0, /*nb_hex*/
133717   #endif
133718   0, /*nb_inplace_add*/
133719   0, /*nb_inplace_subtract*/
133720   0, /*nb_inplace_multiply*/
133721   #if PY_MAJOR_VERSION < 3
133722   0, /*nb_inplace_divide*/
133723   #endif
133724   0, /*nb_inplace_remainder*/
133725   0, /*nb_inplace_power*/
133726   0, /*nb_inplace_lshift*/
133727   0, /*nb_inplace_rshift*/
133728   0, /*nb_inplace_and*/
133729   0, /*nb_inplace_xor*/
133730   0, /*nb_inplace_or*/
133731   0, /*nb_floor_divide*/
133732   0, /*nb_true_divide*/
133733   0, /*nb_inplace_floor_divide*/
133734   0, /*nb_inplace_true_divide*/
133735   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
133736   0, /*nb_index*/
133737   #endif
133738 };
133739
133740 static PySequenceMethods __pyx_tp_as_sequence__ExsltRegExp = {
133741   0, /*sq_length*/
133742   0, /*sq_concat*/
133743   0, /*sq_repeat*/
133744   0, /*sq_item*/
133745   0, /*sq_slice*/
133746   0, /*sq_ass_item*/
133747   0, /*sq_ass_slice*/
133748   0, /*sq_contains*/
133749   0, /*sq_inplace_concat*/
133750   0, /*sq_inplace_repeat*/
133751 };
133752
133753 static PyMappingMethods __pyx_tp_as_mapping__ExsltRegExp = {
133754   0, /*mp_length*/
133755   0, /*mp_subscript*/
133756   0, /*mp_ass_subscript*/
133757 };
133758
133759 static PyBufferProcs __pyx_tp_as_buffer__ExsltRegExp = {
133760   #if PY_MAJOR_VERSION < 3
133761   0, /*bf_getreadbuffer*/
133762   #endif
133763   #if PY_MAJOR_VERSION < 3
133764   0, /*bf_getwritebuffer*/
133765   #endif
133766   #if PY_MAJOR_VERSION < 3
133767   0, /*bf_getsegcount*/
133768   #endif
133769   #if PY_MAJOR_VERSION < 3
133770   0, /*bf_getcharbuffer*/
133771   #endif
133772   #if PY_VERSION_HEX >= 0x02060000
133773   0, /*bf_getbuffer*/
133774   #endif
133775   #if PY_VERSION_HEX >= 0x02060000
133776   0, /*bf_releasebuffer*/
133777   #endif
133778 };
133779
133780 PyTypeObject __pyx_type_4lxml_5etree__ExsltRegExp = {
133781   PyVarObject_HEAD_INIT(0, 0)
133782   __Pyx_NAMESTR("lxml.etree._ExsltRegExp"), /*tp_name*/
133783   sizeof(struct __pyx_obj_4lxml_5etree__ExsltRegExp), /*tp_basicsize*/
133784   0, /*tp_itemsize*/
133785   __pyx_tp_dealloc_4lxml_5etree__ExsltRegExp, /*tp_dealloc*/
133786   0, /*tp_print*/
133787   0, /*tp_getattr*/
133788   0, /*tp_setattr*/
133789   0, /*tp_compare*/
133790   0, /*tp_repr*/
133791   &__pyx_tp_as_number__ExsltRegExp, /*tp_as_number*/
133792   &__pyx_tp_as_sequence__ExsltRegExp, /*tp_as_sequence*/
133793   &__pyx_tp_as_mapping__ExsltRegExp, /*tp_as_mapping*/
133794   0, /*tp_hash*/
133795   0, /*tp_call*/
133796   0, /*tp_str*/
133797   0, /*tp_getattro*/
133798   0, /*tp_setattro*/
133799   &__pyx_tp_as_buffer__ExsltRegExp, /*tp_as_buffer*/
133800   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
133801   0, /*tp_doc*/
133802   __pyx_tp_traverse_4lxml_5etree__ExsltRegExp, /*tp_traverse*/
133803   __pyx_tp_clear_4lxml_5etree__ExsltRegExp, /*tp_clear*/
133804   0, /*tp_richcompare*/
133805   0, /*tp_weaklistoffset*/
133806   0, /*tp_iter*/
133807   0, /*tp_iternext*/
133808   __pyx_methods_4lxml_5etree__ExsltRegExp, /*tp_methods*/
133809   0, /*tp_members*/
133810   0, /*tp_getset*/
133811   0, /*tp_base*/
133812   0, /*tp_dict*/
133813   0, /*tp_descr_get*/
133814   0, /*tp_descr_set*/
133815   0, /*tp_dictoffset*/
133816   __pyx_pf_4lxml_5etree_12_ExsltRegExp___init__, /*tp_init*/
133817   0, /*tp_alloc*/
133818   __pyx_tp_new_4lxml_5etree__ExsltRegExp, /*tp_new*/
133819   0, /*tp_free*/
133820   0, /*tp_is_gc*/
133821   0, /*tp_bases*/
133822   0, /*tp_mro*/
133823   0, /*tp_cache*/
133824   0, /*tp_subclasses*/
133825   0, /*tp_weaklist*/
133826 };
133827 static struct __pyx_vtabstruct_4lxml_5etree__BaseContext __pyx_vtable_4lxml_5etree__BaseContext;
133828
133829 static PyObject *__pyx_tp_new_4lxml_5etree__BaseContext(PyTypeObject *t, PyObject *a, PyObject *k) {
133830   struct __pyx_obj_4lxml_5etree__BaseContext *p;
133831   PyObject *o = (*t->tp_alloc)(t, 0);
133832   if (!o) return 0;
133833   p = ((struct __pyx_obj_4lxml_5etree__BaseContext *)o);
133834   p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__BaseContext;
133835   p->_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
133836   p->_extensions = ((PyObject *)Py_None); Py_INCREF(Py_None);
133837   p->_namespaces = ((PyObject *)Py_None); Py_INCREF(Py_None);
133838   p->_global_namespaces = ((PyObject *)Py_None); Py_INCREF(Py_None);
133839   p->_utf_refs = ((PyObject *)Py_None); Py_INCREF(Py_None);
133840   p->_function_cache = ((PyObject *)Py_None); Py_INCREF(Py_None);
133841   p->_eval_context_dict = ((PyObject *)Py_None); Py_INCREF(Py_None);
133842   p->_temp_refs = ((struct __pyx_obj_4lxml_5etree__TempStore *)Py_None); Py_INCREF(Py_None);
133843   p->_exc = ((struct __pyx_obj_4lxml_5etree__ExceptionContext *)Py_None); Py_INCREF(Py_None);
133844   return o;
133845 }
133846
133847 static void __pyx_tp_dealloc_4lxml_5etree__BaseContext(PyObject *o) {
133848   struct __pyx_obj_4lxml_5etree__BaseContext *p = (struct __pyx_obj_4lxml_5etree__BaseContext *)o;
133849   Py_XDECREF(((PyObject *)p->_doc));
133850   Py_XDECREF(((PyObject *)p->_extensions));
133851   Py_XDECREF(((PyObject *)p->_namespaces));
133852   Py_XDECREF(((PyObject *)p->_global_namespaces));
133853   Py_XDECREF(((PyObject *)p->_utf_refs));
133854   Py_XDECREF(((PyObject *)p->_function_cache));
133855   Py_XDECREF(((PyObject *)p->_eval_context_dict));
133856   Py_XDECREF(((PyObject *)p->_temp_refs));
133857   Py_XDECREF(((PyObject *)p->_exc));
133858   (*Py_TYPE(o)->tp_free)(o);
133859 }
133860
133861 static int __pyx_tp_traverse_4lxml_5etree__BaseContext(PyObject *o, visitproc v, void *a) {
133862   int e;
133863   struct __pyx_obj_4lxml_5etree__BaseContext *p = (struct __pyx_obj_4lxml_5etree__BaseContext *)o;
133864   if (p->_doc) {
133865     e = (*v)(((PyObject*)p->_doc), a); if (e) return e;
133866   }
133867   if (p->_extensions) {
133868     e = (*v)(p->_extensions, a); if (e) return e;
133869   }
133870   if (p->_namespaces) {
133871     e = (*v)(p->_namespaces, a); if (e) return e;
133872   }
133873   if (p->_global_namespaces) {
133874     e = (*v)(p->_global_namespaces, a); if (e) return e;
133875   }
133876   if (p->_utf_refs) {
133877     e = (*v)(p->_utf_refs, a); if (e) return e;
133878   }
133879   if (p->_function_cache) {
133880     e = (*v)(p->_function_cache, a); if (e) return e;
133881   }
133882   if (p->_eval_context_dict) {
133883     e = (*v)(p->_eval_context_dict, a); if (e) return e;
133884   }
133885   if (p->_temp_refs) {
133886     e = (*v)(((PyObject*)p->_temp_refs), a); if (e) return e;
133887   }
133888   if (p->_exc) {
133889     e = (*v)(((PyObject*)p->_exc), a); if (e) return e;
133890   }
133891   return 0;
133892 }
133893
133894 static int __pyx_tp_clear_4lxml_5etree__BaseContext(PyObject *o) {
133895   struct __pyx_obj_4lxml_5etree__BaseContext *p = (struct __pyx_obj_4lxml_5etree__BaseContext *)o;
133896   PyObject* tmp;
133897   tmp = ((PyObject*)p->_doc);
133898   p->_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
133899   Py_XDECREF(tmp);
133900   tmp = ((PyObject*)p->_extensions);
133901   p->_extensions = ((PyObject *)Py_None); Py_INCREF(Py_None);
133902   Py_XDECREF(tmp);
133903   tmp = ((PyObject*)p->_namespaces);
133904   p->_namespaces = ((PyObject *)Py_None); Py_INCREF(Py_None);
133905   Py_XDECREF(tmp);
133906   tmp = ((PyObject*)p->_global_namespaces);
133907   p->_global_namespaces = ((PyObject *)Py_None); Py_INCREF(Py_None);
133908   Py_XDECREF(tmp);
133909   tmp = ((PyObject*)p->_utf_refs);
133910   p->_utf_refs = ((PyObject *)Py_None); Py_INCREF(Py_None);
133911   Py_XDECREF(tmp);
133912   tmp = ((PyObject*)p->_function_cache);
133913   p->_function_cache = ((PyObject *)Py_None); Py_INCREF(Py_None);
133914   Py_XDECREF(tmp);
133915   tmp = ((PyObject*)p->_eval_context_dict);
133916   p->_eval_context_dict = ((PyObject *)Py_None); Py_INCREF(Py_None);
133917   Py_XDECREF(tmp);
133918   tmp = ((PyObject*)p->_temp_refs);
133919   p->_temp_refs = ((struct __pyx_obj_4lxml_5etree__TempStore *)Py_None); Py_INCREF(Py_None);
133920   Py_XDECREF(tmp);
133921   tmp = ((PyObject*)p->_exc);
133922   p->_exc = ((struct __pyx_obj_4lxml_5etree__ExceptionContext *)Py_None); Py_INCREF(Py_None);
133923   Py_XDECREF(tmp);
133924   return 0;
133925 }
133926
133927 static PyObject *__pyx_getprop_4lxml_5etree_12_BaseContext_context_node(PyObject *o, void *x) {
133928   return __pyx_pf_4lxml_5etree_12_BaseContext_12context_node___get__(o);
133929 }
133930
133931 static PyObject *__pyx_getprop_4lxml_5etree_12_BaseContext_eval_context(PyObject *o, void *x) {
133932   return __pyx_pf_4lxml_5etree_12_BaseContext_12eval_context___get__(o);
133933 }
133934
133935 static struct PyMethodDef __pyx_methods_4lxml_5etree__BaseContext[] = {
133936   {0, 0, 0, 0}
133937 };
133938
133939 static struct PyGetSetDef __pyx_getsets_4lxml_5etree__BaseContext[] = {
133940   {(char *)"context_node", __pyx_getprop_4lxml_5etree_12_BaseContext_context_node, 0, 0, 0},
133941   {(char *)"eval_context", __pyx_getprop_4lxml_5etree_12_BaseContext_eval_context, 0, 0, 0},
133942   {0, 0, 0, 0, 0}
133943 };
133944
133945 static PyNumberMethods __pyx_tp_as_number__BaseContext = {
133946   0, /*nb_add*/
133947   0, /*nb_subtract*/
133948   0, /*nb_multiply*/
133949   #if PY_MAJOR_VERSION < 3
133950   0, /*nb_divide*/
133951   #endif
133952   0, /*nb_remainder*/
133953   0, /*nb_divmod*/
133954   0, /*nb_power*/
133955   0, /*nb_negative*/
133956   0, /*nb_positive*/
133957   0, /*nb_absolute*/
133958   0, /*nb_nonzero*/
133959   0, /*nb_invert*/
133960   0, /*nb_lshift*/
133961   0, /*nb_rshift*/
133962   0, /*nb_and*/
133963   0, /*nb_xor*/
133964   0, /*nb_or*/
133965   #if PY_MAJOR_VERSION < 3
133966   0, /*nb_coerce*/
133967   #endif
133968   0, /*nb_int*/
133969   #if PY_MAJOR_VERSION >= 3
133970   0, /*reserved*/
133971   #else
133972   0, /*nb_long*/
133973   #endif
133974   0, /*nb_float*/
133975   #if PY_MAJOR_VERSION < 3
133976   0, /*nb_oct*/
133977   #endif
133978   #if PY_MAJOR_VERSION < 3
133979   0, /*nb_hex*/
133980   #endif
133981   0, /*nb_inplace_add*/
133982   0, /*nb_inplace_subtract*/
133983   0, /*nb_inplace_multiply*/
133984   #if PY_MAJOR_VERSION < 3
133985   0, /*nb_inplace_divide*/
133986   #endif
133987   0, /*nb_inplace_remainder*/
133988   0, /*nb_inplace_power*/
133989   0, /*nb_inplace_lshift*/
133990   0, /*nb_inplace_rshift*/
133991   0, /*nb_inplace_and*/
133992   0, /*nb_inplace_xor*/
133993   0, /*nb_inplace_or*/
133994   0, /*nb_floor_divide*/
133995   0, /*nb_true_divide*/
133996   0, /*nb_inplace_floor_divide*/
133997   0, /*nb_inplace_true_divide*/
133998   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
133999   0, /*nb_index*/
134000   #endif
134001 };
134002
134003 static PySequenceMethods __pyx_tp_as_sequence__BaseContext = {
134004   0, /*sq_length*/
134005   0, /*sq_concat*/
134006   0, /*sq_repeat*/
134007   0, /*sq_item*/
134008   0, /*sq_slice*/
134009   0, /*sq_ass_item*/
134010   0, /*sq_ass_slice*/
134011   0, /*sq_contains*/
134012   0, /*sq_inplace_concat*/
134013   0, /*sq_inplace_repeat*/
134014 };
134015
134016 static PyMappingMethods __pyx_tp_as_mapping__BaseContext = {
134017   0, /*mp_length*/
134018   0, /*mp_subscript*/
134019   0, /*mp_ass_subscript*/
134020 };
134021
134022 static PyBufferProcs __pyx_tp_as_buffer__BaseContext = {
134023   #if PY_MAJOR_VERSION < 3
134024   0, /*bf_getreadbuffer*/
134025   #endif
134026   #if PY_MAJOR_VERSION < 3
134027   0, /*bf_getwritebuffer*/
134028   #endif
134029   #if PY_MAJOR_VERSION < 3
134030   0, /*bf_getsegcount*/
134031   #endif
134032   #if PY_MAJOR_VERSION < 3
134033   0, /*bf_getcharbuffer*/
134034   #endif
134035   #if PY_VERSION_HEX >= 0x02060000
134036   0, /*bf_getbuffer*/
134037   #endif
134038   #if PY_VERSION_HEX >= 0x02060000
134039   0, /*bf_releasebuffer*/
134040   #endif
134041 };
134042
134043 PyTypeObject __pyx_type_4lxml_5etree__BaseContext = {
134044   PyVarObject_HEAD_INIT(0, 0)
134045   __Pyx_NAMESTR("lxml.etree._BaseContext"), /*tp_name*/
134046   sizeof(struct __pyx_obj_4lxml_5etree__BaseContext), /*tp_basicsize*/
134047   0, /*tp_itemsize*/
134048   __pyx_tp_dealloc_4lxml_5etree__BaseContext, /*tp_dealloc*/
134049   0, /*tp_print*/
134050   0, /*tp_getattr*/
134051   0, /*tp_setattr*/
134052   0, /*tp_compare*/
134053   0, /*tp_repr*/
134054   &__pyx_tp_as_number__BaseContext, /*tp_as_number*/
134055   &__pyx_tp_as_sequence__BaseContext, /*tp_as_sequence*/
134056   &__pyx_tp_as_mapping__BaseContext, /*tp_as_mapping*/
134057   0, /*tp_hash*/
134058   0, /*tp_call*/
134059   0, /*tp_str*/
134060   0, /*tp_getattro*/
134061   0, /*tp_setattro*/
134062   &__pyx_tp_as_buffer__BaseContext, /*tp_as_buffer*/
134063   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
134064   0, /*tp_doc*/
134065   __pyx_tp_traverse_4lxml_5etree__BaseContext, /*tp_traverse*/
134066   __pyx_tp_clear_4lxml_5etree__BaseContext, /*tp_clear*/
134067   0, /*tp_richcompare*/
134068   0, /*tp_weaklistoffset*/
134069   0, /*tp_iter*/
134070   0, /*tp_iternext*/
134071   __pyx_methods_4lxml_5etree__BaseContext, /*tp_methods*/
134072   0, /*tp_members*/
134073   __pyx_getsets_4lxml_5etree__BaseContext, /*tp_getset*/
134074   0, /*tp_base*/
134075   0, /*tp_dict*/
134076   0, /*tp_descr_get*/
134077   0, /*tp_descr_set*/
134078   0, /*tp_dictoffset*/
134079   __pyx_pf_4lxml_5etree_12_BaseContext___init__, /*tp_init*/
134080   0, /*tp_alloc*/
134081   __pyx_tp_new_4lxml_5etree__BaseContext, /*tp_new*/
134082   0, /*tp_free*/
134083   0, /*tp_is_gc*/
134084   0, /*tp_bases*/
134085   0, /*tp_mro*/
134086   0, /*tp_cache*/
134087   0, /*tp_subclasses*/
134088   0, /*tp_weaklist*/
134089 };
134090
134091 static PyObject *__pyx_tp_new_4lxml_5etree__ElementUnicodeResult(PyTypeObject *t, PyObject *a, PyObject *k) {
134092   struct __pyx_obj_4lxml_5etree__ElementUnicodeResult *p;
134093   PyObject *o = __pyx_ptype_4lxml_6python_unicode->tp_new(t, a, k);
134094   if (!o) return 0;
134095   p = ((struct __pyx_obj_4lxml_5etree__ElementUnicodeResult *)o);
134096   p->_parent = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
134097   p->is_tail = Py_None; Py_INCREF(Py_None);
134098   p->is_text = Py_None; Py_INCREF(Py_None);
134099   p->is_attribute = Py_None; Py_INCREF(Py_None);
134100   return o;
134101 }
134102
134103 static void __pyx_tp_dealloc_4lxml_5etree__ElementUnicodeResult(PyObject *o) {
134104   struct __pyx_obj_4lxml_5etree__ElementUnicodeResult *p = (struct __pyx_obj_4lxml_5etree__ElementUnicodeResult *)o;
134105   Py_XDECREF(((PyObject *)p->_parent));
134106   Py_XDECREF(p->is_tail);
134107   Py_XDECREF(p->is_text);
134108   Py_XDECREF(p->is_attribute);
134109   __pyx_ptype_4lxml_6python_unicode->tp_dealloc(o);
134110 }
134111
134112 static int __pyx_tp_traverse_4lxml_5etree__ElementUnicodeResult(PyObject *o, visitproc v, void *a) {
134113   int e;
134114   struct __pyx_obj_4lxml_5etree__ElementUnicodeResult *p = (struct __pyx_obj_4lxml_5etree__ElementUnicodeResult *)o;
134115   if (__pyx_ptype_4lxml_6python_unicode->tp_traverse) {
134116     e = __pyx_ptype_4lxml_6python_unicode->tp_traverse(o, v, a); if (e) return e;
134117   }
134118   if (p->_parent) {
134119     e = (*v)(((PyObject*)p->_parent), a); if (e) return e;
134120   }
134121   if (p->is_tail) {
134122     e = (*v)(p->is_tail, a); if (e) return e;
134123   }
134124   if (p->is_text) {
134125     e = (*v)(p->is_text, a); if (e) return e;
134126   }
134127   if (p->is_attribute) {
134128     e = (*v)(p->is_attribute, a); if (e) return e;
134129   }
134130   return 0;
134131 }
134132
134133 static int __pyx_tp_clear_4lxml_5etree__ElementUnicodeResult(PyObject *o) {
134134   struct __pyx_obj_4lxml_5etree__ElementUnicodeResult *p = (struct __pyx_obj_4lxml_5etree__ElementUnicodeResult *)o;
134135   PyObject* tmp;
134136   if (__pyx_ptype_4lxml_6python_unicode->tp_clear) {
134137     __pyx_ptype_4lxml_6python_unicode->tp_clear(o);
134138   }
134139   tmp = ((PyObject*)p->_parent);
134140   p->_parent = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
134141   Py_XDECREF(tmp);
134142   tmp = ((PyObject*)p->is_tail);
134143   p->is_tail = Py_None; Py_INCREF(Py_None);
134144   Py_XDECREF(tmp);
134145   tmp = ((PyObject*)p->is_text);
134146   p->is_text = Py_None; Py_INCREF(Py_None);
134147   Py_XDECREF(tmp);
134148   tmp = ((PyObject*)p->is_attribute);
134149   p->is_attribute = Py_None; Py_INCREF(Py_None);
134150   Py_XDECREF(tmp);
134151   return 0;
134152 }
134153
134154 static struct PyMethodDef __pyx_methods_4lxml_5etree__ElementUnicodeResult[] = {
134155   {__Pyx_NAMESTR("getparent"), (PyCFunction)__pyx_pf_4lxml_5etree_21_ElementUnicodeResult_getparent, METH_NOARGS, __Pyx_DOCSTR(0)},
134156   {0, 0, 0, 0}
134157 };
134158
134159 static struct PyMemberDef __pyx_members_4lxml_5etree__ElementUnicodeResult[] = {
134160   {(char *)"is_tail", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree__ElementUnicodeResult, is_tail), READONLY, 0},
134161   {(char *)"is_text", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree__ElementUnicodeResult, is_text), READONLY, 0},
134162   {(char *)"is_attribute", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree__ElementUnicodeResult, is_attribute), READONLY, 0},
134163   {0, 0, 0, 0, 0}
134164 };
134165
134166 static PyNumberMethods __pyx_tp_as_number__ElementUnicodeResult = {
134167   0, /*nb_add*/
134168   0, /*nb_subtract*/
134169   0, /*nb_multiply*/
134170   #if PY_MAJOR_VERSION < 3
134171   0, /*nb_divide*/
134172   #endif
134173   0, /*nb_remainder*/
134174   0, /*nb_divmod*/
134175   0, /*nb_power*/
134176   0, /*nb_negative*/
134177   0, /*nb_positive*/
134178   0, /*nb_absolute*/
134179   0, /*nb_nonzero*/
134180   0, /*nb_invert*/
134181   0, /*nb_lshift*/
134182   0, /*nb_rshift*/
134183   0, /*nb_and*/
134184   0, /*nb_xor*/
134185   0, /*nb_or*/
134186   #if PY_MAJOR_VERSION < 3
134187   0, /*nb_coerce*/
134188   #endif
134189   0, /*nb_int*/
134190   #if PY_MAJOR_VERSION >= 3
134191   0, /*reserved*/
134192   #else
134193   0, /*nb_long*/
134194   #endif
134195   0, /*nb_float*/
134196   #if PY_MAJOR_VERSION < 3
134197   0, /*nb_oct*/
134198   #endif
134199   #if PY_MAJOR_VERSION < 3
134200   0, /*nb_hex*/
134201   #endif
134202   0, /*nb_inplace_add*/
134203   0, /*nb_inplace_subtract*/
134204   0, /*nb_inplace_multiply*/
134205   #if PY_MAJOR_VERSION < 3
134206   0, /*nb_inplace_divide*/
134207   #endif
134208   0, /*nb_inplace_remainder*/
134209   0, /*nb_inplace_power*/
134210   0, /*nb_inplace_lshift*/
134211   0, /*nb_inplace_rshift*/
134212   0, /*nb_inplace_and*/
134213   0, /*nb_inplace_xor*/
134214   0, /*nb_inplace_or*/
134215   0, /*nb_floor_divide*/
134216   0, /*nb_true_divide*/
134217   0, /*nb_inplace_floor_divide*/
134218   0, /*nb_inplace_true_divide*/
134219   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
134220   0, /*nb_index*/
134221   #endif
134222 };
134223
134224 static PySequenceMethods __pyx_tp_as_sequence__ElementUnicodeResult = {
134225   0, /*sq_length*/
134226   0, /*sq_concat*/
134227   0, /*sq_repeat*/
134228   0, /*sq_item*/
134229   0, /*sq_slice*/
134230   0, /*sq_ass_item*/
134231   0, /*sq_ass_slice*/
134232   0, /*sq_contains*/
134233   0, /*sq_inplace_concat*/
134234   0, /*sq_inplace_repeat*/
134235 };
134236
134237 static PyMappingMethods __pyx_tp_as_mapping__ElementUnicodeResult = {
134238   0, /*mp_length*/
134239   0, /*mp_subscript*/
134240   0, /*mp_ass_subscript*/
134241 };
134242
134243 static PyBufferProcs __pyx_tp_as_buffer__ElementUnicodeResult = {
134244   #if PY_MAJOR_VERSION < 3
134245   0, /*bf_getreadbuffer*/
134246   #endif
134247   #if PY_MAJOR_VERSION < 3
134248   0, /*bf_getwritebuffer*/
134249   #endif
134250   #if PY_MAJOR_VERSION < 3
134251   0, /*bf_getsegcount*/
134252   #endif
134253   #if PY_MAJOR_VERSION < 3
134254   0, /*bf_getcharbuffer*/
134255   #endif
134256   #if PY_VERSION_HEX >= 0x02060000
134257   0, /*bf_getbuffer*/
134258   #endif
134259   #if PY_VERSION_HEX >= 0x02060000
134260   0, /*bf_releasebuffer*/
134261   #endif
134262 };
134263
134264 PyTypeObject __pyx_type_4lxml_5etree__ElementUnicodeResult = {
134265   PyVarObject_HEAD_INIT(0, 0)
134266   __Pyx_NAMESTR("lxml.etree._ElementUnicodeResult"), /*tp_name*/
134267   sizeof(struct __pyx_obj_4lxml_5etree__ElementUnicodeResult), /*tp_basicsize*/
134268   0, /*tp_itemsize*/
134269   __pyx_tp_dealloc_4lxml_5etree__ElementUnicodeResult, /*tp_dealloc*/
134270   0, /*tp_print*/
134271   0, /*tp_getattr*/
134272   0, /*tp_setattr*/
134273   0, /*tp_compare*/
134274   0, /*tp_repr*/
134275   &__pyx_tp_as_number__ElementUnicodeResult, /*tp_as_number*/
134276   &__pyx_tp_as_sequence__ElementUnicodeResult, /*tp_as_sequence*/
134277   &__pyx_tp_as_mapping__ElementUnicodeResult, /*tp_as_mapping*/
134278   0, /*tp_hash*/
134279   0, /*tp_call*/
134280   0, /*tp_str*/
134281   0, /*tp_getattro*/
134282   0, /*tp_setattro*/
134283   &__pyx_tp_as_buffer__ElementUnicodeResult, /*tp_as_buffer*/
134284   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
134285   0, /*tp_doc*/
134286   __pyx_tp_traverse_4lxml_5etree__ElementUnicodeResult, /*tp_traverse*/
134287   __pyx_tp_clear_4lxml_5etree__ElementUnicodeResult, /*tp_clear*/
134288   0, /*tp_richcompare*/
134289   0, /*tp_weaklistoffset*/
134290   0, /*tp_iter*/
134291   0, /*tp_iternext*/
134292   __pyx_methods_4lxml_5etree__ElementUnicodeResult, /*tp_methods*/
134293   __pyx_members_4lxml_5etree__ElementUnicodeResult, /*tp_members*/
134294   0, /*tp_getset*/
134295   0, /*tp_base*/
134296   0, /*tp_dict*/
134297   0, /*tp_descr_get*/
134298   0, /*tp_descr_set*/
134299   0, /*tp_dictoffset*/
134300   0, /*tp_init*/
134301   0, /*tp_alloc*/
134302   __pyx_tp_new_4lxml_5etree__ElementUnicodeResult, /*tp_new*/
134303   0, /*tp_free*/
134304   0, /*tp_is_gc*/
134305   0, /*tp_bases*/
134306   0, /*tp_mro*/
134307   0, /*tp_cache*/
134308   0, /*tp_subclasses*/
134309   0, /*tp_weaklist*/
134310 };
134311 static struct __pyx_vtabstruct_4lxml_5etree__XPathContext __pyx_vtable_4lxml_5etree__XPathContext;
134312
134313 static PyObject *__pyx_tp_new_4lxml_5etree__XPathContext(PyTypeObject *t, PyObject *a, PyObject *k) {
134314   struct __pyx_obj_4lxml_5etree__XPathContext *p;
134315   PyObject *o = __pyx_tp_new_4lxml_5etree__BaseContext(t, a, k);
134316   if (!o) return 0;
134317   p = ((struct __pyx_obj_4lxml_5etree__XPathContext *)o);
134318   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__BaseContext*)__pyx_vtabptr_4lxml_5etree__XPathContext;
134319   p->_variables = Py_None; Py_INCREF(Py_None);
134320   return o;
134321 }
134322
134323 static void __pyx_tp_dealloc_4lxml_5etree__XPathContext(PyObject *o) {
134324   struct __pyx_obj_4lxml_5etree__XPathContext *p = (struct __pyx_obj_4lxml_5etree__XPathContext *)o;
134325   Py_XDECREF(p->_variables);
134326   __pyx_tp_dealloc_4lxml_5etree__BaseContext(o);
134327 }
134328
134329 static int __pyx_tp_traverse_4lxml_5etree__XPathContext(PyObject *o, visitproc v, void *a) {
134330   int e;
134331   struct __pyx_obj_4lxml_5etree__XPathContext *p = (struct __pyx_obj_4lxml_5etree__XPathContext *)o;
134332   e = __pyx_tp_traverse_4lxml_5etree__BaseContext(o, v, a); if (e) return e;
134333   if (p->_variables) {
134334     e = (*v)(p->_variables, a); if (e) return e;
134335   }
134336   return 0;
134337 }
134338
134339 static int __pyx_tp_clear_4lxml_5etree__XPathContext(PyObject *o) {
134340   struct __pyx_obj_4lxml_5etree__XPathContext *p = (struct __pyx_obj_4lxml_5etree__XPathContext *)o;
134341   PyObject* tmp;
134342   __pyx_tp_clear_4lxml_5etree__BaseContext(o);
134343   tmp = ((PyObject*)p->_variables);
134344   p->_variables = Py_None; Py_INCREF(Py_None);
134345   Py_XDECREF(tmp);
134346   return 0;
134347 }
134348
134349 static struct PyMethodDef __pyx_methods_4lxml_5etree__XPathContext[] = {
134350   {0, 0, 0, 0}
134351 };
134352
134353 static PyNumberMethods __pyx_tp_as_number__XPathContext = {
134354   0, /*nb_add*/
134355   0, /*nb_subtract*/
134356   0, /*nb_multiply*/
134357   #if PY_MAJOR_VERSION < 3
134358   0, /*nb_divide*/
134359   #endif
134360   0, /*nb_remainder*/
134361   0, /*nb_divmod*/
134362   0, /*nb_power*/
134363   0, /*nb_negative*/
134364   0, /*nb_positive*/
134365   0, /*nb_absolute*/
134366   0, /*nb_nonzero*/
134367   0, /*nb_invert*/
134368   0, /*nb_lshift*/
134369   0, /*nb_rshift*/
134370   0, /*nb_and*/
134371   0, /*nb_xor*/
134372   0, /*nb_or*/
134373   #if PY_MAJOR_VERSION < 3
134374   0, /*nb_coerce*/
134375   #endif
134376   0, /*nb_int*/
134377   #if PY_MAJOR_VERSION >= 3
134378   0, /*reserved*/
134379   #else
134380   0, /*nb_long*/
134381   #endif
134382   0, /*nb_float*/
134383   #if PY_MAJOR_VERSION < 3
134384   0, /*nb_oct*/
134385   #endif
134386   #if PY_MAJOR_VERSION < 3
134387   0, /*nb_hex*/
134388   #endif
134389   0, /*nb_inplace_add*/
134390   0, /*nb_inplace_subtract*/
134391   0, /*nb_inplace_multiply*/
134392   #if PY_MAJOR_VERSION < 3
134393   0, /*nb_inplace_divide*/
134394   #endif
134395   0, /*nb_inplace_remainder*/
134396   0, /*nb_inplace_power*/
134397   0, /*nb_inplace_lshift*/
134398   0, /*nb_inplace_rshift*/
134399   0, /*nb_inplace_and*/
134400   0, /*nb_inplace_xor*/
134401   0, /*nb_inplace_or*/
134402   0, /*nb_floor_divide*/
134403   0, /*nb_true_divide*/
134404   0, /*nb_inplace_floor_divide*/
134405   0, /*nb_inplace_true_divide*/
134406   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
134407   0, /*nb_index*/
134408   #endif
134409 };
134410
134411 static PySequenceMethods __pyx_tp_as_sequence__XPathContext = {
134412   0, /*sq_length*/
134413   0, /*sq_concat*/
134414   0, /*sq_repeat*/
134415   0, /*sq_item*/
134416   0, /*sq_slice*/
134417   0, /*sq_ass_item*/
134418   0, /*sq_ass_slice*/
134419   0, /*sq_contains*/
134420   0, /*sq_inplace_concat*/
134421   0, /*sq_inplace_repeat*/
134422 };
134423
134424 static PyMappingMethods __pyx_tp_as_mapping__XPathContext = {
134425   0, /*mp_length*/
134426   0, /*mp_subscript*/
134427   0, /*mp_ass_subscript*/
134428 };
134429
134430 static PyBufferProcs __pyx_tp_as_buffer__XPathContext = {
134431   #if PY_MAJOR_VERSION < 3
134432   0, /*bf_getreadbuffer*/
134433   #endif
134434   #if PY_MAJOR_VERSION < 3
134435   0, /*bf_getwritebuffer*/
134436   #endif
134437   #if PY_MAJOR_VERSION < 3
134438   0, /*bf_getsegcount*/
134439   #endif
134440   #if PY_MAJOR_VERSION < 3
134441   0, /*bf_getcharbuffer*/
134442   #endif
134443   #if PY_VERSION_HEX >= 0x02060000
134444   0, /*bf_getbuffer*/
134445   #endif
134446   #if PY_VERSION_HEX >= 0x02060000
134447   0, /*bf_releasebuffer*/
134448   #endif
134449 };
134450
134451 PyTypeObject __pyx_type_4lxml_5etree__XPathContext = {
134452   PyVarObject_HEAD_INIT(0, 0)
134453   __Pyx_NAMESTR("lxml.etree._XPathContext"), /*tp_name*/
134454   sizeof(struct __pyx_obj_4lxml_5etree__XPathContext), /*tp_basicsize*/
134455   0, /*tp_itemsize*/
134456   __pyx_tp_dealloc_4lxml_5etree__XPathContext, /*tp_dealloc*/
134457   0, /*tp_print*/
134458   0, /*tp_getattr*/
134459   0, /*tp_setattr*/
134460   0, /*tp_compare*/
134461   0, /*tp_repr*/
134462   &__pyx_tp_as_number__XPathContext, /*tp_as_number*/
134463   &__pyx_tp_as_sequence__XPathContext, /*tp_as_sequence*/
134464   &__pyx_tp_as_mapping__XPathContext, /*tp_as_mapping*/
134465   0, /*tp_hash*/
134466   0, /*tp_call*/
134467   0, /*tp_str*/
134468   0, /*tp_getattro*/
134469   0, /*tp_setattro*/
134470   &__pyx_tp_as_buffer__XPathContext, /*tp_as_buffer*/
134471   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
134472   0, /*tp_doc*/
134473   __pyx_tp_traverse_4lxml_5etree__XPathContext, /*tp_traverse*/
134474   __pyx_tp_clear_4lxml_5etree__XPathContext, /*tp_clear*/
134475   0, /*tp_richcompare*/
134476   0, /*tp_weaklistoffset*/
134477   0, /*tp_iter*/
134478   0, /*tp_iternext*/
134479   __pyx_methods_4lxml_5etree__XPathContext, /*tp_methods*/
134480   0, /*tp_members*/
134481   0, /*tp_getset*/
134482   0, /*tp_base*/
134483   0, /*tp_dict*/
134484   0, /*tp_descr_get*/
134485   0, /*tp_descr_set*/
134486   0, /*tp_dictoffset*/
134487   __pyx_pf_4lxml_5etree_13_XPathContext___init__, /*tp_init*/
134488   0, /*tp_alloc*/
134489   __pyx_tp_new_4lxml_5etree__XPathContext, /*tp_new*/
134490   0, /*tp_free*/
134491   0, /*tp_is_gc*/
134492   0, /*tp_bases*/
134493   0, /*tp_mro*/
134494   0, /*tp_cache*/
134495   0, /*tp_subclasses*/
134496   0, /*tp_weaklist*/
134497 };
134498 static struct __pyx_vtabstruct_4lxml_5etree__XPathEvaluatorBase __pyx_vtable_4lxml_5etree__XPathEvaluatorBase;
134499
134500 static PyObject *__pyx_tp_new_4lxml_5etree__XPathEvaluatorBase(PyTypeObject *t, PyObject *a, PyObject *k) {
134501   struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *p;
134502   PyObject *o = (*t->tp_alloc)(t, 0);
134503   if (!o) return 0;
134504   p = ((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)o);
134505   p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__XPathEvaluatorBase;
134506   p->_context = ((struct __pyx_obj_4lxml_5etree__XPathContext *)Py_None); Py_INCREF(Py_None);
134507   p->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
134508   return o;
134509 }
134510
134511 static void __pyx_tp_dealloc_4lxml_5etree__XPathEvaluatorBase(PyObject *o) {
134512   struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *p = (struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)o;
134513   {
134514     PyObject *etype, *eval, *etb;
134515     PyErr_Fetch(&etype, &eval, &etb);
134516     ++Py_REFCNT(o);
134517     __pyx_pf_4lxml_5etree_19_XPathEvaluatorBase___dealloc__(o);
134518     if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
134519     --Py_REFCNT(o);
134520     PyErr_Restore(etype, eval, etb);
134521   }
134522   Py_XDECREF(((PyObject *)p->_context));
134523   Py_XDECREF(((PyObject *)p->_error_log));
134524   (*Py_TYPE(o)->tp_free)(o);
134525 }
134526
134527 static int __pyx_tp_traverse_4lxml_5etree__XPathEvaluatorBase(PyObject *o, visitproc v, void *a) {
134528   int e;
134529   struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *p = (struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)o;
134530   if (p->_context) {
134531     e = (*v)(((PyObject*)p->_context), a); if (e) return e;
134532   }
134533   if (p->_error_log) {
134534     e = (*v)(((PyObject*)p->_error_log), a); if (e) return e;
134535   }
134536   return 0;
134537 }
134538
134539 static int __pyx_tp_clear_4lxml_5etree__XPathEvaluatorBase(PyObject *o) {
134540   struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *p = (struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)o;
134541   PyObject* tmp;
134542   tmp = ((PyObject*)p->_context);
134543   p->_context = ((struct __pyx_obj_4lxml_5etree__XPathContext *)Py_None); Py_INCREF(Py_None);
134544   Py_XDECREF(tmp);
134545   tmp = ((PyObject*)p->_error_log);
134546   p->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
134547   Py_XDECREF(tmp);
134548   return 0;
134549 }
134550
134551 static PyObject *__pyx_getprop_4lxml_5etree_19_XPathEvaluatorBase_error_log(PyObject *o, void *x) {
134552   return __pyx_pf_4lxml_5etree_19_XPathEvaluatorBase_9error_log___get__(o);
134553 }
134554
134555 static struct PyMethodDef __pyx_methods_4lxml_5etree__XPathEvaluatorBase[] = {
134556   {__Pyx_NAMESTR("evaluate"), (PyCFunction)__pyx_pf_4lxml_5etree_19_XPathEvaluatorBase_evaluate, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_19_XPathEvaluatorBase_evaluate)},
134557   {0, 0, 0, 0}
134558 };
134559
134560 static struct PyGetSetDef __pyx_getsets_4lxml_5etree__XPathEvaluatorBase[] = {
134561   {(char *)"error_log", __pyx_getprop_4lxml_5etree_19_XPathEvaluatorBase_error_log, 0, 0, 0},
134562   {0, 0, 0, 0, 0}
134563 };
134564
134565 static PyNumberMethods __pyx_tp_as_number__XPathEvaluatorBase = {
134566   0, /*nb_add*/
134567   0, /*nb_subtract*/
134568   0, /*nb_multiply*/
134569   #if PY_MAJOR_VERSION < 3
134570   0, /*nb_divide*/
134571   #endif
134572   0, /*nb_remainder*/
134573   0, /*nb_divmod*/
134574   0, /*nb_power*/
134575   0, /*nb_negative*/
134576   0, /*nb_positive*/
134577   0, /*nb_absolute*/
134578   0, /*nb_nonzero*/
134579   0, /*nb_invert*/
134580   0, /*nb_lshift*/
134581   0, /*nb_rshift*/
134582   0, /*nb_and*/
134583   0, /*nb_xor*/
134584   0, /*nb_or*/
134585   #if PY_MAJOR_VERSION < 3
134586   0, /*nb_coerce*/
134587   #endif
134588   0, /*nb_int*/
134589   #if PY_MAJOR_VERSION >= 3
134590   0, /*reserved*/
134591   #else
134592   0, /*nb_long*/
134593   #endif
134594   0, /*nb_float*/
134595   #if PY_MAJOR_VERSION < 3
134596   0, /*nb_oct*/
134597   #endif
134598   #if PY_MAJOR_VERSION < 3
134599   0, /*nb_hex*/
134600   #endif
134601   0, /*nb_inplace_add*/
134602   0, /*nb_inplace_subtract*/
134603   0, /*nb_inplace_multiply*/
134604   #if PY_MAJOR_VERSION < 3
134605   0, /*nb_inplace_divide*/
134606   #endif
134607   0, /*nb_inplace_remainder*/
134608   0, /*nb_inplace_power*/
134609   0, /*nb_inplace_lshift*/
134610   0, /*nb_inplace_rshift*/
134611   0, /*nb_inplace_and*/
134612   0, /*nb_inplace_xor*/
134613   0, /*nb_inplace_or*/
134614   0, /*nb_floor_divide*/
134615   0, /*nb_true_divide*/
134616   0, /*nb_inplace_floor_divide*/
134617   0, /*nb_inplace_true_divide*/
134618   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
134619   0, /*nb_index*/
134620   #endif
134621 };
134622
134623 static PySequenceMethods __pyx_tp_as_sequence__XPathEvaluatorBase = {
134624   0, /*sq_length*/
134625   0, /*sq_concat*/
134626   0, /*sq_repeat*/
134627   0, /*sq_item*/
134628   0, /*sq_slice*/
134629   0, /*sq_ass_item*/
134630   0, /*sq_ass_slice*/
134631   0, /*sq_contains*/
134632   0, /*sq_inplace_concat*/
134633   0, /*sq_inplace_repeat*/
134634 };
134635
134636 static PyMappingMethods __pyx_tp_as_mapping__XPathEvaluatorBase = {
134637   0, /*mp_length*/
134638   0, /*mp_subscript*/
134639   0, /*mp_ass_subscript*/
134640 };
134641
134642 static PyBufferProcs __pyx_tp_as_buffer__XPathEvaluatorBase = {
134643   #if PY_MAJOR_VERSION < 3
134644   0, /*bf_getreadbuffer*/
134645   #endif
134646   #if PY_MAJOR_VERSION < 3
134647   0, /*bf_getwritebuffer*/
134648   #endif
134649   #if PY_MAJOR_VERSION < 3
134650   0, /*bf_getsegcount*/
134651   #endif
134652   #if PY_MAJOR_VERSION < 3
134653   0, /*bf_getcharbuffer*/
134654   #endif
134655   #if PY_VERSION_HEX >= 0x02060000
134656   0, /*bf_getbuffer*/
134657   #endif
134658   #if PY_VERSION_HEX >= 0x02060000
134659   0, /*bf_releasebuffer*/
134660   #endif
134661 };
134662
134663 PyTypeObject __pyx_type_4lxml_5etree__XPathEvaluatorBase = {
134664   PyVarObject_HEAD_INIT(0, 0)
134665   __Pyx_NAMESTR("lxml.etree._XPathEvaluatorBase"), /*tp_name*/
134666   sizeof(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase), /*tp_basicsize*/
134667   0, /*tp_itemsize*/
134668   __pyx_tp_dealloc_4lxml_5etree__XPathEvaluatorBase, /*tp_dealloc*/
134669   0, /*tp_print*/
134670   0, /*tp_getattr*/
134671   0, /*tp_setattr*/
134672   0, /*tp_compare*/
134673   0, /*tp_repr*/
134674   &__pyx_tp_as_number__XPathEvaluatorBase, /*tp_as_number*/
134675   &__pyx_tp_as_sequence__XPathEvaluatorBase, /*tp_as_sequence*/
134676   &__pyx_tp_as_mapping__XPathEvaluatorBase, /*tp_as_mapping*/
134677   0, /*tp_hash*/
134678   0, /*tp_call*/
134679   0, /*tp_str*/
134680   0, /*tp_getattro*/
134681   0, /*tp_setattro*/
134682   &__pyx_tp_as_buffer__XPathEvaluatorBase, /*tp_as_buffer*/
134683   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
134684   0, /*tp_doc*/
134685   __pyx_tp_traverse_4lxml_5etree__XPathEvaluatorBase, /*tp_traverse*/
134686   __pyx_tp_clear_4lxml_5etree__XPathEvaluatorBase, /*tp_clear*/
134687   0, /*tp_richcompare*/
134688   0, /*tp_weaklistoffset*/
134689   0, /*tp_iter*/
134690   0, /*tp_iternext*/
134691   __pyx_methods_4lxml_5etree__XPathEvaluatorBase, /*tp_methods*/
134692   0, /*tp_members*/
134693   __pyx_getsets_4lxml_5etree__XPathEvaluatorBase, /*tp_getset*/
134694   0, /*tp_base*/
134695   0, /*tp_dict*/
134696   0, /*tp_descr_get*/
134697   0, /*tp_descr_set*/
134698   0, /*tp_dictoffset*/
134699   __pyx_pf_4lxml_5etree_19_XPathEvaluatorBase___init__, /*tp_init*/
134700   0, /*tp_alloc*/
134701   __pyx_tp_new_4lxml_5etree__XPathEvaluatorBase, /*tp_new*/
134702   0, /*tp_free*/
134703   0, /*tp_is_gc*/
134704   0, /*tp_bases*/
134705   0, /*tp_mro*/
134706   0, /*tp_cache*/
134707   0, /*tp_subclasses*/
134708   0, /*tp_weaklist*/
134709 };
134710 static struct __pyx_vtabstruct_4lxml_5etree_XPathElementEvaluator __pyx_vtable_4lxml_5etree_XPathElementEvaluator;
134711
134712 static PyObject *__pyx_tp_new_4lxml_5etree_XPathElementEvaluator(PyTypeObject *t, PyObject *a, PyObject *k) {
134713   struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *p;
134714   PyObject *o = __pyx_tp_new_4lxml_5etree__XPathEvaluatorBase(t, a, k);
134715   if (!o) return 0;
134716   p = ((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)o);
134717   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__XPathEvaluatorBase*)__pyx_vtabptr_4lxml_5etree_XPathElementEvaluator;
134718   p->_element = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
134719   return o;
134720 }
134721
134722 static void __pyx_tp_dealloc_4lxml_5etree_XPathElementEvaluator(PyObject *o) {
134723   struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *p = (struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)o;
134724   Py_XDECREF(((PyObject *)p->_element));
134725   __pyx_tp_dealloc_4lxml_5etree__XPathEvaluatorBase(o);
134726 }
134727
134728 static int __pyx_tp_traverse_4lxml_5etree_XPathElementEvaluator(PyObject *o, visitproc v, void *a) {
134729   int e;
134730   struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *p = (struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)o;
134731   e = __pyx_tp_traverse_4lxml_5etree__XPathEvaluatorBase(o, v, a); if (e) return e;
134732   if (p->_element) {
134733     e = (*v)(((PyObject*)p->_element), a); if (e) return e;
134734   }
134735   return 0;
134736 }
134737
134738 static int __pyx_tp_clear_4lxml_5etree_XPathElementEvaluator(PyObject *o) {
134739   struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *p = (struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)o;
134740   PyObject* tmp;
134741   __pyx_tp_clear_4lxml_5etree__XPathEvaluatorBase(o);
134742   tmp = ((PyObject*)p->_element);
134743   p->_element = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
134744   Py_XDECREF(tmp);
134745   return 0;
134746 }
134747
134748 static struct PyMethodDef __pyx_methods_4lxml_5etree_XPathElementEvaluator[] = {
134749   {__Pyx_NAMESTR("register_namespace"), (PyCFunction)__pyx_pf_4lxml_5etree_21XPathElementEvaluator_register_namespace, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_21XPathElementEvaluator_register_namespace)},
134750   {__Pyx_NAMESTR("register_namespaces"), (PyCFunction)__pyx_pf_4lxml_5etree_21XPathElementEvaluator_register_namespaces, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_21XPathElementEvaluator_register_namespaces)},
134751   {__Pyx_NAMESTR("__call__"), (PyCFunction)__pyx_pf_4lxml_5etree_21XPathElementEvaluator___call__, METH_VARARGS|METH_KEYWORDS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_21XPathElementEvaluator___call__)},
134752   {0, 0, 0, 0}
134753 };
134754
134755 static PyNumberMethods __pyx_tp_as_number_XPathElementEvaluator = {
134756   0, /*nb_add*/
134757   0, /*nb_subtract*/
134758   0, /*nb_multiply*/
134759   #if PY_MAJOR_VERSION < 3
134760   0, /*nb_divide*/
134761   #endif
134762   0, /*nb_remainder*/
134763   0, /*nb_divmod*/
134764   0, /*nb_power*/
134765   0, /*nb_negative*/
134766   0, /*nb_positive*/
134767   0, /*nb_absolute*/
134768   0, /*nb_nonzero*/
134769   0, /*nb_invert*/
134770   0, /*nb_lshift*/
134771   0, /*nb_rshift*/
134772   0, /*nb_and*/
134773   0, /*nb_xor*/
134774   0, /*nb_or*/
134775   #if PY_MAJOR_VERSION < 3
134776   0, /*nb_coerce*/
134777   #endif
134778   0, /*nb_int*/
134779   #if PY_MAJOR_VERSION >= 3
134780   0, /*reserved*/
134781   #else
134782   0, /*nb_long*/
134783   #endif
134784   0, /*nb_float*/
134785   #if PY_MAJOR_VERSION < 3
134786   0, /*nb_oct*/
134787   #endif
134788   #if PY_MAJOR_VERSION < 3
134789   0, /*nb_hex*/
134790   #endif
134791   0, /*nb_inplace_add*/
134792   0, /*nb_inplace_subtract*/
134793   0, /*nb_inplace_multiply*/
134794   #if PY_MAJOR_VERSION < 3
134795   0, /*nb_inplace_divide*/
134796   #endif
134797   0, /*nb_inplace_remainder*/
134798   0, /*nb_inplace_power*/
134799   0, /*nb_inplace_lshift*/
134800   0, /*nb_inplace_rshift*/
134801   0, /*nb_inplace_and*/
134802   0, /*nb_inplace_xor*/
134803   0, /*nb_inplace_or*/
134804   0, /*nb_floor_divide*/
134805   0, /*nb_true_divide*/
134806   0, /*nb_inplace_floor_divide*/
134807   0, /*nb_inplace_true_divide*/
134808   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
134809   0, /*nb_index*/
134810   #endif
134811 };
134812
134813 static PySequenceMethods __pyx_tp_as_sequence_XPathElementEvaluator = {
134814   0, /*sq_length*/
134815   0, /*sq_concat*/
134816   0, /*sq_repeat*/
134817   0, /*sq_item*/
134818   0, /*sq_slice*/
134819   0, /*sq_ass_item*/
134820   0, /*sq_ass_slice*/
134821   0, /*sq_contains*/
134822   0, /*sq_inplace_concat*/
134823   0, /*sq_inplace_repeat*/
134824 };
134825
134826 static PyMappingMethods __pyx_tp_as_mapping_XPathElementEvaluator = {
134827   0, /*mp_length*/
134828   0, /*mp_subscript*/
134829   0, /*mp_ass_subscript*/
134830 };
134831
134832 static PyBufferProcs __pyx_tp_as_buffer_XPathElementEvaluator = {
134833   #if PY_MAJOR_VERSION < 3
134834   0, /*bf_getreadbuffer*/
134835   #endif
134836   #if PY_MAJOR_VERSION < 3
134837   0, /*bf_getwritebuffer*/
134838   #endif
134839   #if PY_MAJOR_VERSION < 3
134840   0, /*bf_getsegcount*/
134841   #endif
134842   #if PY_MAJOR_VERSION < 3
134843   0, /*bf_getcharbuffer*/
134844   #endif
134845   #if PY_VERSION_HEX >= 0x02060000
134846   0, /*bf_getbuffer*/
134847   #endif
134848   #if PY_VERSION_HEX >= 0x02060000
134849   0, /*bf_releasebuffer*/
134850   #endif
134851 };
134852
134853 PyTypeObject __pyx_type_4lxml_5etree_XPathElementEvaluator = {
134854   PyVarObject_HEAD_INIT(0, 0)
134855   __Pyx_NAMESTR("lxml.etree.XPathElementEvaluator"), /*tp_name*/
134856   sizeof(struct __pyx_obj_4lxml_5etree_XPathElementEvaluator), /*tp_basicsize*/
134857   0, /*tp_itemsize*/
134858   __pyx_tp_dealloc_4lxml_5etree_XPathElementEvaluator, /*tp_dealloc*/
134859   0, /*tp_print*/
134860   0, /*tp_getattr*/
134861   0, /*tp_setattr*/
134862   0, /*tp_compare*/
134863   0, /*tp_repr*/
134864   &__pyx_tp_as_number_XPathElementEvaluator, /*tp_as_number*/
134865   &__pyx_tp_as_sequence_XPathElementEvaluator, /*tp_as_sequence*/
134866   &__pyx_tp_as_mapping_XPathElementEvaluator, /*tp_as_mapping*/
134867   0, /*tp_hash*/
134868   __pyx_pf_4lxml_5etree_21XPathElementEvaluator___call__, /*tp_call*/
134869   0, /*tp_str*/
134870   0, /*tp_getattro*/
134871   0, /*tp_setattro*/
134872   &__pyx_tp_as_buffer_XPathElementEvaluator, /*tp_as_buffer*/
134873   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
134874   __Pyx_DOCSTR("XPathElementEvaluator(self, element, namespaces=None, extensions=None, regexp=True, smart_strings=True)\n    Create an XPath evaluator for an element.\n\n    Absolute XPath expressions (starting with '/') will be evaluated against\n    the ElementTree as returned by getroottree().\n\n    Additional namespace declarations can be passed with the\n    'namespace' keyword argument.  EXSLT regular expression support\n    can be disabled with the 'regexp' boolean keyword (defaults to\n    True).  Smart strings will be returned for string results unless\n    you pass ``smart_strings=False``.\n    "), /*tp_doc*/
134875   __pyx_tp_traverse_4lxml_5etree_XPathElementEvaluator, /*tp_traverse*/
134876   __pyx_tp_clear_4lxml_5etree_XPathElementEvaluator, /*tp_clear*/
134877   0, /*tp_richcompare*/
134878   0, /*tp_weaklistoffset*/
134879   0, /*tp_iter*/
134880   0, /*tp_iternext*/
134881   __pyx_methods_4lxml_5etree_XPathElementEvaluator, /*tp_methods*/
134882   0, /*tp_members*/
134883   0, /*tp_getset*/
134884   0, /*tp_base*/
134885   0, /*tp_dict*/
134886   0, /*tp_descr_get*/
134887   0, /*tp_descr_set*/
134888   0, /*tp_dictoffset*/
134889   __pyx_pf_4lxml_5etree_21XPathElementEvaluator___init__, /*tp_init*/
134890   0, /*tp_alloc*/
134891   __pyx_tp_new_4lxml_5etree_XPathElementEvaluator, /*tp_new*/
134892   0, /*tp_free*/
134893   0, /*tp_is_gc*/
134894   0, /*tp_bases*/
134895   0, /*tp_mro*/
134896   0, /*tp_cache*/
134897   0, /*tp_subclasses*/
134898   0, /*tp_weaklist*/
134899 };
134900 static struct __pyx_vtabstruct_4lxml_5etree_XPathDocumentEvaluator __pyx_vtable_4lxml_5etree_XPathDocumentEvaluator;
134901
134902 static PyObject *__pyx_tp_new_4lxml_5etree_XPathDocumentEvaluator(PyTypeObject *t, PyObject *a, PyObject *k) {
134903   struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *p;
134904   PyObject *o = __pyx_tp_new_4lxml_5etree_XPathElementEvaluator(t, a, k);
134905   if (!o) return 0;
134906   p = ((struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *)o);
134907   p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__XPathEvaluatorBase*)__pyx_vtabptr_4lxml_5etree_XPathDocumentEvaluator;
134908   return o;
134909 }
134910
134911 static struct PyMethodDef __pyx_methods_4lxml_5etree_XPathDocumentEvaluator[] = {
134912   {__Pyx_NAMESTR("__call__"), (PyCFunction)__pyx_pf_4lxml_5etree_22XPathDocumentEvaluator___call__, METH_VARARGS|METH_KEYWORDS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_22XPathDocumentEvaluator___call__)},
134913   {0, 0, 0, 0}
134914 };
134915
134916 static PyNumberMethods __pyx_tp_as_number_XPathDocumentEvaluator = {
134917   0, /*nb_add*/
134918   0, /*nb_subtract*/
134919   0, /*nb_multiply*/
134920   #if PY_MAJOR_VERSION < 3
134921   0, /*nb_divide*/
134922   #endif
134923   0, /*nb_remainder*/
134924   0, /*nb_divmod*/
134925   0, /*nb_power*/
134926   0, /*nb_negative*/
134927   0, /*nb_positive*/
134928   0, /*nb_absolute*/
134929   0, /*nb_nonzero*/
134930   0, /*nb_invert*/
134931   0, /*nb_lshift*/
134932   0, /*nb_rshift*/
134933   0, /*nb_and*/
134934   0, /*nb_xor*/
134935   0, /*nb_or*/
134936   #if PY_MAJOR_VERSION < 3
134937   0, /*nb_coerce*/
134938   #endif
134939   0, /*nb_int*/
134940   #if PY_MAJOR_VERSION >= 3
134941   0, /*reserved*/
134942   #else
134943   0, /*nb_long*/
134944   #endif
134945   0, /*nb_float*/
134946   #if PY_MAJOR_VERSION < 3
134947   0, /*nb_oct*/
134948   #endif
134949   #if PY_MAJOR_VERSION < 3
134950   0, /*nb_hex*/
134951   #endif
134952   0, /*nb_inplace_add*/
134953   0, /*nb_inplace_subtract*/
134954   0, /*nb_inplace_multiply*/
134955   #if PY_MAJOR_VERSION < 3
134956   0, /*nb_inplace_divide*/
134957   #endif
134958   0, /*nb_inplace_remainder*/
134959   0, /*nb_inplace_power*/
134960   0, /*nb_inplace_lshift*/
134961   0, /*nb_inplace_rshift*/
134962   0, /*nb_inplace_and*/
134963   0, /*nb_inplace_xor*/
134964   0, /*nb_inplace_or*/
134965   0, /*nb_floor_divide*/
134966   0, /*nb_true_divide*/
134967   0, /*nb_inplace_floor_divide*/
134968   0, /*nb_inplace_true_divide*/
134969   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
134970   0, /*nb_index*/
134971   #endif
134972 };
134973
134974 static PySequenceMethods __pyx_tp_as_sequence_XPathDocumentEvaluator = {
134975   0, /*sq_length*/
134976   0, /*sq_concat*/
134977   0, /*sq_repeat*/
134978   0, /*sq_item*/
134979   0, /*sq_slice*/
134980   0, /*sq_ass_item*/
134981   0, /*sq_ass_slice*/
134982   0, /*sq_contains*/
134983   0, /*sq_inplace_concat*/
134984   0, /*sq_inplace_repeat*/
134985 };
134986
134987 static PyMappingMethods __pyx_tp_as_mapping_XPathDocumentEvaluator = {
134988   0, /*mp_length*/
134989   0, /*mp_subscript*/
134990   0, /*mp_ass_subscript*/
134991 };
134992
134993 static PyBufferProcs __pyx_tp_as_buffer_XPathDocumentEvaluator = {
134994   #if PY_MAJOR_VERSION < 3
134995   0, /*bf_getreadbuffer*/
134996   #endif
134997   #if PY_MAJOR_VERSION < 3
134998   0, /*bf_getwritebuffer*/
134999   #endif
135000   #if PY_MAJOR_VERSION < 3
135001   0, /*bf_getsegcount*/
135002   #endif
135003   #if PY_MAJOR_VERSION < 3
135004   0, /*bf_getcharbuffer*/
135005   #endif
135006   #if PY_VERSION_HEX >= 0x02060000
135007   0, /*bf_getbuffer*/
135008   #endif
135009   #if PY_VERSION_HEX >= 0x02060000
135010   0, /*bf_releasebuffer*/
135011   #endif
135012 };
135013
135014 PyTypeObject __pyx_type_4lxml_5etree_XPathDocumentEvaluator = {
135015   PyVarObject_HEAD_INIT(0, 0)
135016   __Pyx_NAMESTR("lxml.etree.XPathDocumentEvaluator"), /*tp_name*/
135017   sizeof(struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator), /*tp_basicsize*/
135018   0, /*tp_itemsize*/
135019   __pyx_tp_dealloc_4lxml_5etree_XPathElementEvaluator, /*tp_dealloc*/
135020   0, /*tp_print*/
135021   0, /*tp_getattr*/
135022   0, /*tp_setattr*/
135023   0, /*tp_compare*/
135024   0, /*tp_repr*/
135025   &__pyx_tp_as_number_XPathDocumentEvaluator, /*tp_as_number*/
135026   &__pyx_tp_as_sequence_XPathDocumentEvaluator, /*tp_as_sequence*/
135027   &__pyx_tp_as_mapping_XPathDocumentEvaluator, /*tp_as_mapping*/
135028   0, /*tp_hash*/
135029   __pyx_pf_4lxml_5etree_22XPathDocumentEvaluator___call__, /*tp_call*/
135030   0, /*tp_str*/
135031   0, /*tp_getattro*/
135032   0, /*tp_setattro*/
135033   &__pyx_tp_as_buffer_XPathDocumentEvaluator, /*tp_as_buffer*/
135034   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
135035   __Pyx_DOCSTR("XPathDocumentEvaluator(self, etree, namespaces=None, extensions=None, regexp=True, smart_strings=True)\n    Create an XPath evaluator for an ElementTree.\n\n    Additional namespace declarations can be passed with the\n    'namespace' keyword argument.  EXSLT regular expression support\n    can be disabled with the 'regexp' boolean keyword (defaults to\n    True).  Smart strings will be returned for string results unless\n    you pass ``smart_strings=False``.\n    "), /*tp_doc*/
135036   __pyx_tp_traverse_4lxml_5etree_XPathElementEvaluator, /*tp_traverse*/
135037   __pyx_tp_clear_4lxml_5etree_XPathElementEvaluator, /*tp_clear*/
135038   0, /*tp_richcompare*/
135039   0, /*tp_weaklistoffset*/
135040   0, /*tp_iter*/
135041   0, /*tp_iternext*/
135042   __pyx_methods_4lxml_5etree_XPathDocumentEvaluator, /*tp_methods*/
135043   0, /*tp_members*/
135044   0, /*tp_getset*/
135045   0, /*tp_base*/
135046   0, /*tp_dict*/
135047   0, /*tp_descr_get*/
135048   0, /*tp_descr_set*/
135049   0, /*tp_dictoffset*/
135050   __pyx_pf_4lxml_5etree_22XPathDocumentEvaluator___init__, /*tp_init*/
135051   0, /*tp_alloc*/
135052   __pyx_tp_new_4lxml_5etree_XPathDocumentEvaluator, /*tp_new*/
135053   0, /*tp_free*/
135054   0, /*tp_is_gc*/
135055   0, /*tp_bases*/
135056   0, /*tp_mro*/
135057   0, /*tp_cache*/
135058   0, /*tp_subclasses*/
135059   0, /*tp_weaklist*/
135060 };
135061 static struct __pyx_vtabstruct_4lxml_5etree_XPath __pyx_vtable_4lxml_5etree_XPath;
135062
135063 static PyObject *__pyx_tp_new_4lxml_5etree_XPath(PyTypeObject *t, PyObject *a, PyObject *k) {
135064   struct __pyx_obj_4lxml_5etree_XPath *p;
135065   PyObject *o = __pyx_tp_new_4lxml_5etree__XPathEvaluatorBase(t, a, k);
135066   if (!o) return 0;
135067   p = ((struct __pyx_obj_4lxml_5etree_XPath *)o);
135068   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__XPathEvaluatorBase*)__pyx_vtabptr_4lxml_5etree_XPath;
135069   p->path = Py_None; Py_INCREF(Py_None);
135070   return o;
135071 }
135072
135073 static void __pyx_tp_dealloc_4lxml_5etree_XPath(PyObject *o) {
135074   struct __pyx_obj_4lxml_5etree_XPath *p = (struct __pyx_obj_4lxml_5etree_XPath *)o;
135075   {
135076     PyObject *etype, *eval, *etb;
135077     PyErr_Fetch(&etype, &eval, &etb);
135078     ++Py_REFCNT(o);
135079     __pyx_pf_4lxml_5etree_5XPath___dealloc__(o);
135080     if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
135081     --Py_REFCNT(o);
135082     PyErr_Restore(etype, eval, etb);
135083   }
135084   Py_XDECREF(p->path);
135085   __pyx_tp_dealloc_4lxml_5etree__XPathEvaluatorBase(o);
135086 }
135087
135088 static int __pyx_tp_traverse_4lxml_5etree_XPath(PyObject *o, visitproc v, void *a) {
135089   int e;
135090   struct __pyx_obj_4lxml_5etree_XPath *p = (struct __pyx_obj_4lxml_5etree_XPath *)o;
135091   e = __pyx_tp_traverse_4lxml_5etree__XPathEvaluatorBase(o, v, a); if (e) return e;
135092   if (p->path) {
135093     e = (*v)(p->path, a); if (e) return e;
135094   }
135095   return 0;
135096 }
135097
135098 static int __pyx_tp_clear_4lxml_5etree_XPath(PyObject *o) {
135099   struct __pyx_obj_4lxml_5etree_XPath *p = (struct __pyx_obj_4lxml_5etree_XPath *)o;
135100   PyObject* tmp;
135101   __pyx_tp_clear_4lxml_5etree__XPathEvaluatorBase(o);
135102   tmp = ((PyObject*)p->path);
135103   p->path = Py_None; Py_INCREF(Py_None);
135104   Py_XDECREF(tmp);
135105   return 0;
135106 }
135107
135108 static struct PyMethodDef __pyx_methods_4lxml_5etree_XPath[] = {
135109   {__Pyx_NAMESTR("__call__"), (PyCFunction)__pyx_pf_4lxml_5etree_5XPath___call__, METH_VARARGS|METH_KEYWORDS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_5XPath___call__)},
135110   {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_4lxml_5etree_5XPath___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
135111   {0, 0, 0, 0}
135112 };
135113
135114 static struct PyMemberDef __pyx_members_4lxml_5etree_XPath[] = {
135115   {(char *)"path", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree_XPath, path), READONLY, 0},
135116   {0, 0, 0, 0, 0}
135117 };
135118
135119 static PyNumberMethods __pyx_tp_as_number_XPath = {
135120   0, /*nb_add*/
135121   0, /*nb_subtract*/
135122   0, /*nb_multiply*/
135123   #if PY_MAJOR_VERSION < 3
135124   0, /*nb_divide*/
135125   #endif
135126   0, /*nb_remainder*/
135127   0, /*nb_divmod*/
135128   0, /*nb_power*/
135129   0, /*nb_negative*/
135130   0, /*nb_positive*/
135131   0, /*nb_absolute*/
135132   0, /*nb_nonzero*/
135133   0, /*nb_invert*/
135134   0, /*nb_lshift*/
135135   0, /*nb_rshift*/
135136   0, /*nb_and*/
135137   0, /*nb_xor*/
135138   0, /*nb_or*/
135139   #if PY_MAJOR_VERSION < 3
135140   0, /*nb_coerce*/
135141   #endif
135142   0, /*nb_int*/
135143   #if PY_MAJOR_VERSION >= 3
135144   0, /*reserved*/
135145   #else
135146   0, /*nb_long*/
135147   #endif
135148   0, /*nb_float*/
135149   #if PY_MAJOR_VERSION < 3
135150   0, /*nb_oct*/
135151   #endif
135152   #if PY_MAJOR_VERSION < 3
135153   0, /*nb_hex*/
135154   #endif
135155   0, /*nb_inplace_add*/
135156   0, /*nb_inplace_subtract*/
135157   0, /*nb_inplace_multiply*/
135158   #if PY_MAJOR_VERSION < 3
135159   0, /*nb_inplace_divide*/
135160   #endif
135161   0, /*nb_inplace_remainder*/
135162   0, /*nb_inplace_power*/
135163   0, /*nb_inplace_lshift*/
135164   0, /*nb_inplace_rshift*/
135165   0, /*nb_inplace_and*/
135166   0, /*nb_inplace_xor*/
135167   0, /*nb_inplace_or*/
135168   0, /*nb_floor_divide*/
135169   0, /*nb_true_divide*/
135170   0, /*nb_inplace_floor_divide*/
135171   0, /*nb_inplace_true_divide*/
135172   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
135173   0, /*nb_index*/
135174   #endif
135175 };
135176
135177 static PySequenceMethods __pyx_tp_as_sequence_XPath = {
135178   0, /*sq_length*/
135179   0, /*sq_concat*/
135180   0, /*sq_repeat*/
135181   0, /*sq_item*/
135182   0, /*sq_slice*/
135183   0, /*sq_ass_item*/
135184   0, /*sq_ass_slice*/
135185   0, /*sq_contains*/
135186   0, /*sq_inplace_concat*/
135187   0, /*sq_inplace_repeat*/
135188 };
135189
135190 static PyMappingMethods __pyx_tp_as_mapping_XPath = {
135191   0, /*mp_length*/
135192   0, /*mp_subscript*/
135193   0, /*mp_ass_subscript*/
135194 };
135195
135196 static PyBufferProcs __pyx_tp_as_buffer_XPath = {
135197   #if PY_MAJOR_VERSION < 3
135198   0, /*bf_getreadbuffer*/
135199   #endif
135200   #if PY_MAJOR_VERSION < 3
135201   0, /*bf_getwritebuffer*/
135202   #endif
135203   #if PY_MAJOR_VERSION < 3
135204   0, /*bf_getsegcount*/
135205   #endif
135206   #if PY_MAJOR_VERSION < 3
135207   0, /*bf_getcharbuffer*/
135208   #endif
135209   #if PY_VERSION_HEX >= 0x02060000
135210   0, /*bf_getbuffer*/
135211   #endif
135212   #if PY_VERSION_HEX >= 0x02060000
135213   0, /*bf_releasebuffer*/
135214   #endif
135215 };
135216
135217 PyTypeObject __pyx_type_4lxml_5etree_XPath = {
135218   PyVarObject_HEAD_INIT(0, 0)
135219   __Pyx_NAMESTR("lxml.etree.XPath"), /*tp_name*/
135220   sizeof(struct __pyx_obj_4lxml_5etree_XPath), /*tp_basicsize*/
135221   0, /*tp_itemsize*/
135222   __pyx_tp_dealloc_4lxml_5etree_XPath, /*tp_dealloc*/
135223   0, /*tp_print*/
135224   0, /*tp_getattr*/
135225   0, /*tp_setattr*/
135226   0, /*tp_compare*/
135227   __pyx_pf_4lxml_5etree_5XPath___repr__, /*tp_repr*/
135228   &__pyx_tp_as_number_XPath, /*tp_as_number*/
135229   &__pyx_tp_as_sequence_XPath, /*tp_as_sequence*/
135230   &__pyx_tp_as_mapping_XPath, /*tp_as_mapping*/
135231   0, /*tp_hash*/
135232   __pyx_pf_4lxml_5etree_5XPath___call__, /*tp_call*/
135233   0, /*tp_str*/
135234   0, /*tp_getattro*/
135235   0, /*tp_setattro*/
135236   &__pyx_tp_as_buffer_XPath, /*tp_as_buffer*/
135237   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
135238   __Pyx_DOCSTR("XPath(self, path, namespaces=None, extensions=None, regexp=True, smart_strings=True)\n    A compiled XPath expression that can be called on Elements and ElementTrees.\n\n    Besides the XPath expression, you can pass prefix-namespace\n    mappings and extension functions to the constructor through the\n    keyword arguments ``namespaces`` and ``extensions``.  EXSLT\n    regular expression support can be disabled with the 'regexp'\n    boolean keyword (defaults to True).  Smart strings will be\n    returned for string results unless you pass\n    ``smart_strings=False``.\n    "), /*tp_doc*/
135239   __pyx_tp_traverse_4lxml_5etree_XPath, /*tp_traverse*/
135240   __pyx_tp_clear_4lxml_5etree_XPath, /*tp_clear*/
135241   0, /*tp_richcompare*/
135242   0, /*tp_weaklistoffset*/
135243   0, /*tp_iter*/
135244   0, /*tp_iternext*/
135245   __pyx_methods_4lxml_5etree_XPath, /*tp_methods*/
135246   __pyx_members_4lxml_5etree_XPath, /*tp_members*/
135247   0, /*tp_getset*/
135248   0, /*tp_base*/
135249   0, /*tp_dict*/
135250   0, /*tp_descr_get*/
135251   0, /*tp_descr_set*/
135252   0, /*tp_dictoffset*/
135253   __pyx_pf_4lxml_5etree_5XPath___init__, /*tp_init*/
135254   0, /*tp_alloc*/
135255   __pyx_tp_new_4lxml_5etree_XPath, /*tp_new*/
135256   0, /*tp_free*/
135257   0, /*tp_is_gc*/
135258   0, /*tp_bases*/
135259   0, /*tp_mro*/
135260   0, /*tp_cache*/
135261   0, /*tp_subclasses*/
135262   0, /*tp_weaklist*/
135263 };
135264 static struct __pyx_vtabstruct_4lxml_5etree_ETXPath __pyx_vtable_4lxml_5etree_ETXPath;
135265
135266 static PyObject *__pyx_tp_new_4lxml_5etree_ETXPath(PyTypeObject *t, PyObject *a, PyObject *k) {
135267   struct __pyx_obj_4lxml_5etree_ETXPath *p;
135268   PyObject *o = __pyx_tp_new_4lxml_5etree_XPath(t, a, k);
135269   if (!o) return 0;
135270   p = ((struct __pyx_obj_4lxml_5etree_ETXPath *)o);
135271   p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__XPathEvaluatorBase*)__pyx_vtabptr_4lxml_5etree_ETXPath;
135272   return o;
135273 }
135274
135275 static struct PyMethodDef __pyx_methods_4lxml_5etree_ETXPath[] = {
135276   {0, 0, 0, 0}
135277 };
135278
135279 static PyNumberMethods __pyx_tp_as_number_ETXPath = {
135280   0, /*nb_add*/
135281   0, /*nb_subtract*/
135282   0, /*nb_multiply*/
135283   #if PY_MAJOR_VERSION < 3
135284   0, /*nb_divide*/
135285   #endif
135286   0, /*nb_remainder*/
135287   0, /*nb_divmod*/
135288   0, /*nb_power*/
135289   0, /*nb_negative*/
135290   0, /*nb_positive*/
135291   0, /*nb_absolute*/
135292   0, /*nb_nonzero*/
135293   0, /*nb_invert*/
135294   0, /*nb_lshift*/
135295   0, /*nb_rshift*/
135296   0, /*nb_and*/
135297   0, /*nb_xor*/
135298   0, /*nb_or*/
135299   #if PY_MAJOR_VERSION < 3
135300   0, /*nb_coerce*/
135301   #endif
135302   0, /*nb_int*/
135303   #if PY_MAJOR_VERSION >= 3
135304   0, /*reserved*/
135305   #else
135306   0, /*nb_long*/
135307   #endif
135308   0, /*nb_float*/
135309   #if PY_MAJOR_VERSION < 3
135310   0, /*nb_oct*/
135311   #endif
135312   #if PY_MAJOR_VERSION < 3
135313   0, /*nb_hex*/
135314   #endif
135315   0, /*nb_inplace_add*/
135316   0, /*nb_inplace_subtract*/
135317   0, /*nb_inplace_multiply*/
135318   #if PY_MAJOR_VERSION < 3
135319   0, /*nb_inplace_divide*/
135320   #endif
135321   0, /*nb_inplace_remainder*/
135322   0, /*nb_inplace_power*/
135323   0, /*nb_inplace_lshift*/
135324   0, /*nb_inplace_rshift*/
135325   0, /*nb_inplace_and*/
135326   0, /*nb_inplace_xor*/
135327   0, /*nb_inplace_or*/
135328   0, /*nb_floor_divide*/
135329   0, /*nb_true_divide*/
135330   0, /*nb_inplace_floor_divide*/
135331   0, /*nb_inplace_true_divide*/
135332   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
135333   0, /*nb_index*/
135334   #endif
135335 };
135336
135337 static PySequenceMethods __pyx_tp_as_sequence_ETXPath = {
135338   0, /*sq_length*/
135339   0, /*sq_concat*/
135340   0, /*sq_repeat*/
135341   0, /*sq_item*/
135342   0, /*sq_slice*/
135343   0, /*sq_ass_item*/
135344   0, /*sq_ass_slice*/
135345   0, /*sq_contains*/
135346   0, /*sq_inplace_concat*/
135347   0, /*sq_inplace_repeat*/
135348 };
135349
135350 static PyMappingMethods __pyx_tp_as_mapping_ETXPath = {
135351   0, /*mp_length*/
135352   0, /*mp_subscript*/
135353   0, /*mp_ass_subscript*/
135354 };
135355
135356 static PyBufferProcs __pyx_tp_as_buffer_ETXPath = {
135357   #if PY_MAJOR_VERSION < 3
135358   0, /*bf_getreadbuffer*/
135359   #endif
135360   #if PY_MAJOR_VERSION < 3
135361   0, /*bf_getwritebuffer*/
135362   #endif
135363   #if PY_MAJOR_VERSION < 3
135364   0, /*bf_getsegcount*/
135365   #endif
135366   #if PY_MAJOR_VERSION < 3
135367   0, /*bf_getcharbuffer*/
135368   #endif
135369   #if PY_VERSION_HEX >= 0x02060000
135370   0, /*bf_getbuffer*/
135371   #endif
135372   #if PY_VERSION_HEX >= 0x02060000
135373   0, /*bf_releasebuffer*/
135374   #endif
135375 };
135376
135377 PyTypeObject __pyx_type_4lxml_5etree_ETXPath = {
135378   PyVarObject_HEAD_INIT(0, 0)
135379   __Pyx_NAMESTR("lxml.etree.ETXPath"), /*tp_name*/
135380   sizeof(struct __pyx_obj_4lxml_5etree_ETXPath), /*tp_basicsize*/
135381   0, /*tp_itemsize*/
135382   __pyx_tp_dealloc_4lxml_5etree_XPath, /*tp_dealloc*/
135383   0, /*tp_print*/
135384   0, /*tp_getattr*/
135385   0, /*tp_setattr*/
135386   0, /*tp_compare*/
135387   0, /*tp_repr*/
135388   &__pyx_tp_as_number_ETXPath, /*tp_as_number*/
135389   &__pyx_tp_as_sequence_ETXPath, /*tp_as_sequence*/
135390   &__pyx_tp_as_mapping_ETXPath, /*tp_as_mapping*/
135391   0, /*tp_hash*/
135392   0, /*tp_call*/
135393   0, /*tp_str*/
135394   0, /*tp_getattro*/
135395   0, /*tp_setattro*/
135396   &__pyx_tp_as_buffer_ETXPath, /*tp_as_buffer*/
135397   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
135398   __Pyx_DOCSTR("ETXPath(self, path, extensions=None, regexp=True)\n    Special XPath class that supports the ElementTree {uri} notation for namespaces.\n\n    Note that this class does not accept the ``namespace`` keyword\n    argument. All namespaces must be passed as part of the path\n    string.  Smart strings will be returned for string results unless\n    you pass ``smart_strings=False``.\n    "), /*tp_doc*/
135399   __pyx_tp_traverse_4lxml_5etree_XPath, /*tp_traverse*/
135400   __pyx_tp_clear_4lxml_5etree_XPath, /*tp_clear*/
135401   0, /*tp_richcompare*/
135402   0, /*tp_weaklistoffset*/
135403   0, /*tp_iter*/
135404   0, /*tp_iternext*/
135405   __pyx_methods_4lxml_5etree_ETXPath, /*tp_methods*/
135406   0, /*tp_members*/
135407   0, /*tp_getset*/
135408   0, /*tp_base*/
135409   0, /*tp_dict*/
135410   0, /*tp_descr_get*/
135411   0, /*tp_descr_set*/
135412   0, /*tp_dictoffset*/
135413   __pyx_pf_4lxml_5etree_7ETXPath___init__, /*tp_init*/
135414   0, /*tp_alloc*/
135415   __pyx_tp_new_4lxml_5etree_ETXPath, /*tp_new*/
135416   0, /*tp_free*/
135417   0, /*tp_is_gc*/
135418   0, /*tp_bases*/
135419   0, /*tp_mro*/
135420   0, /*tp_cache*/
135421   0, /*tp_subclasses*/
135422   0, /*tp_weaklist*/
135423 };
135424 static struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext __pyx_vtable_4lxml_5etree__XSLTResolverContext;
135425
135426 static PyObject *__pyx_tp_new_4lxml_5etree__XSLTResolverContext(PyTypeObject *t, PyObject *a, PyObject *k) {
135427   struct __pyx_obj_4lxml_5etree__XSLTResolverContext *p;
135428   PyObject *o = __pyx_tp_new_4lxml_5etree__ResolverContext(t, a, k);
135429   if (!o) return 0;
135430   p = ((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)o);
135431   p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext*)__pyx_vtabptr_4lxml_5etree__XSLTResolverContext;
135432   p->_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);
135433   return o;
135434 }
135435
135436 static void __pyx_tp_dealloc_4lxml_5etree__XSLTResolverContext(PyObject *o) {
135437   struct __pyx_obj_4lxml_5etree__XSLTResolverContext *p = (struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)o;
135438   Py_XDECREF(((PyObject *)p->_parser));
135439   __pyx_tp_dealloc_4lxml_5etree__ResolverContext(o);
135440 }
135441
135442 static int __pyx_tp_traverse_4lxml_5etree__XSLTResolverContext(PyObject *o, visitproc v, void *a) {
135443   int e;
135444   struct __pyx_obj_4lxml_5etree__XSLTResolverContext *p = (struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)o;
135445   e = __pyx_tp_traverse_4lxml_5etree__ResolverContext(o, v, a); if (e) return e;
135446   if (p->_parser) {
135447     e = (*v)(((PyObject*)p->_parser), a); if (e) return e;
135448   }
135449   return 0;
135450 }
135451
135452 static int __pyx_tp_clear_4lxml_5etree__XSLTResolverContext(PyObject *o) {
135453   struct __pyx_obj_4lxml_5etree__XSLTResolverContext *p = (struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)o;
135454   PyObject* tmp;
135455   __pyx_tp_clear_4lxml_5etree__ResolverContext(o);
135456   tmp = ((PyObject*)p->_parser);
135457   p->_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);
135458   Py_XDECREF(tmp);
135459   return 0;
135460 }
135461
135462 static struct PyMethodDef __pyx_methods_4lxml_5etree__XSLTResolverContext[] = {
135463   {0, 0, 0, 0}
135464 };
135465
135466 static PyNumberMethods __pyx_tp_as_number__XSLTResolverContext = {
135467   0, /*nb_add*/
135468   0, /*nb_subtract*/
135469   0, /*nb_multiply*/
135470   #if PY_MAJOR_VERSION < 3
135471   0, /*nb_divide*/
135472   #endif
135473   0, /*nb_remainder*/
135474   0, /*nb_divmod*/
135475   0, /*nb_power*/
135476   0, /*nb_negative*/
135477   0, /*nb_positive*/
135478   0, /*nb_absolute*/
135479   0, /*nb_nonzero*/
135480   0, /*nb_invert*/
135481   0, /*nb_lshift*/
135482   0, /*nb_rshift*/
135483   0, /*nb_and*/
135484   0, /*nb_xor*/
135485   0, /*nb_or*/
135486   #if PY_MAJOR_VERSION < 3
135487   0, /*nb_coerce*/
135488   #endif
135489   0, /*nb_int*/
135490   #if PY_MAJOR_VERSION >= 3
135491   0, /*reserved*/
135492   #else
135493   0, /*nb_long*/
135494   #endif
135495   0, /*nb_float*/
135496   #if PY_MAJOR_VERSION < 3
135497   0, /*nb_oct*/
135498   #endif
135499   #if PY_MAJOR_VERSION < 3
135500   0, /*nb_hex*/
135501   #endif
135502   0, /*nb_inplace_add*/
135503   0, /*nb_inplace_subtract*/
135504   0, /*nb_inplace_multiply*/
135505   #if PY_MAJOR_VERSION < 3
135506   0, /*nb_inplace_divide*/
135507   #endif
135508   0, /*nb_inplace_remainder*/
135509   0, /*nb_inplace_power*/
135510   0, /*nb_inplace_lshift*/
135511   0, /*nb_inplace_rshift*/
135512   0, /*nb_inplace_and*/
135513   0, /*nb_inplace_xor*/
135514   0, /*nb_inplace_or*/
135515   0, /*nb_floor_divide*/
135516   0, /*nb_true_divide*/
135517   0, /*nb_inplace_floor_divide*/
135518   0, /*nb_inplace_true_divide*/
135519   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
135520   0, /*nb_index*/
135521   #endif
135522 };
135523
135524 static PySequenceMethods __pyx_tp_as_sequence__XSLTResolverContext = {
135525   0, /*sq_length*/
135526   0, /*sq_concat*/
135527   0, /*sq_repeat*/
135528   0, /*sq_item*/
135529   0, /*sq_slice*/
135530   0, /*sq_ass_item*/
135531   0, /*sq_ass_slice*/
135532   0, /*sq_contains*/
135533   0, /*sq_inplace_concat*/
135534   0, /*sq_inplace_repeat*/
135535 };
135536
135537 static PyMappingMethods __pyx_tp_as_mapping__XSLTResolverContext = {
135538   0, /*mp_length*/
135539   0, /*mp_subscript*/
135540   0, /*mp_ass_subscript*/
135541 };
135542
135543 static PyBufferProcs __pyx_tp_as_buffer__XSLTResolverContext = {
135544   #if PY_MAJOR_VERSION < 3
135545   0, /*bf_getreadbuffer*/
135546   #endif
135547   #if PY_MAJOR_VERSION < 3
135548   0, /*bf_getwritebuffer*/
135549   #endif
135550   #if PY_MAJOR_VERSION < 3
135551   0, /*bf_getsegcount*/
135552   #endif
135553   #if PY_MAJOR_VERSION < 3
135554   0, /*bf_getcharbuffer*/
135555   #endif
135556   #if PY_VERSION_HEX >= 0x02060000
135557   0, /*bf_getbuffer*/
135558   #endif
135559   #if PY_VERSION_HEX >= 0x02060000
135560   0, /*bf_releasebuffer*/
135561   #endif
135562 };
135563
135564 PyTypeObject __pyx_type_4lxml_5etree__XSLTResolverContext = {
135565   PyVarObject_HEAD_INIT(0, 0)
135566   __Pyx_NAMESTR("lxml.etree._XSLTResolverContext"), /*tp_name*/
135567   sizeof(struct __pyx_obj_4lxml_5etree__XSLTResolverContext), /*tp_basicsize*/
135568   0, /*tp_itemsize*/
135569   __pyx_tp_dealloc_4lxml_5etree__XSLTResolverContext, /*tp_dealloc*/
135570   0, /*tp_print*/
135571   0, /*tp_getattr*/
135572   0, /*tp_setattr*/
135573   0, /*tp_compare*/
135574   0, /*tp_repr*/
135575   &__pyx_tp_as_number__XSLTResolverContext, /*tp_as_number*/
135576   &__pyx_tp_as_sequence__XSLTResolverContext, /*tp_as_sequence*/
135577   &__pyx_tp_as_mapping__XSLTResolverContext, /*tp_as_mapping*/
135578   0, /*tp_hash*/
135579   0, /*tp_call*/
135580   0, /*tp_str*/
135581   0, /*tp_getattro*/
135582   0, /*tp_setattro*/
135583   &__pyx_tp_as_buffer__XSLTResolverContext, /*tp_as_buffer*/
135584   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
135585   0, /*tp_doc*/
135586   __pyx_tp_traverse_4lxml_5etree__XSLTResolverContext, /*tp_traverse*/
135587   __pyx_tp_clear_4lxml_5etree__XSLTResolverContext, /*tp_clear*/
135588   0, /*tp_richcompare*/
135589   0, /*tp_weaklistoffset*/
135590   0, /*tp_iter*/
135591   0, /*tp_iternext*/
135592   __pyx_methods_4lxml_5etree__XSLTResolverContext, /*tp_methods*/
135593   0, /*tp_members*/
135594   0, /*tp_getset*/
135595   0, /*tp_base*/
135596   0, /*tp_dict*/
135597   0, /*tp_descr_get*/
135598   0, /*tp_descr_set*/
135599   0, /*tp_dictoffset*/
135600   0, /*tp_init*/
135601   0, /*tp_alloc*/
135602   __pyx_tp_new_4lxml_5etree__XSLTResolverContext, /*tp_new*/
135603   0, /*tp_free*/
135604   0, /*tp_is_gc*/
135605   0, /*tp_bases*/
135606   0, /*tp_mro*/
135607   0, /*tp_cache*/
135608   0, /*tp_subclasses*/
135609   0, /*tp_weaklist*/
135610 };
135611 static struct __pyx_vtabstruct_4lxml_5etree_XSLTAccessControl __pyx_vtable_4lxml_5etree_XSLTAccessControl;
135612
135613 static PyObject *__pyx_tp_new_4lxml_5etree_XSLTAccessControl(PyTypeObject *t, PyObject *a, PyObject *k) {
135614   struct __pyx_obj_4lxml_5etree_XSLTAccessControl *p;
135615   PyObject *o = (*t->tp_alloc)(t, 0);
135616   if (!o) return 0;
135617   p = ((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)o);
135618   p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree_XSLTAccessControl;
135619   return o;
135620 }
135621
135622 static void __pyx_tp_dealloc_4lxml_5etree_XSLTAccessControl(PyObject *o) {
135623   {
135624     PyObject *etype, *eval, *etb;
135625     PyErr_Fetch(&etype, &eval, &etb);
135626     ++Py_REFCNT(o);
135627     __pyx_pf_4lxml_5etree_17XSLTAccessControl___dealloc__(o);
135628     if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
135629     --Py_REFCNT(o);
135630     PyErr_Restore(etype, eval, etb);
135631   }
135632   (*Py_TYPE(o)->tp_free)(o);
135633 }
135634
135635 static PyObject *__pyx_getprop_4lxml_5etree_17XSLTAccessControl_options(PyObject *o, void *x) {
135636   return __pyx_pf_4lxml_5etree_17XSLTAccessControl_7options___get__(o);
135637 }
135638
135639 static struct PyMethodDef __pyx_methods_4lxml_5etree_XSLTAccessControl[] = {
135640   {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_4lxml_5etree_17XSLTAccessControl___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
135641   {0, 0, 0, 0}
135642 };
135643
135644 static struct PyGetSetDef __pyx_getsets_4lxml_5etree_XSLTAccessControl[] = {
135645   {(char *)"options", __pyx_getprop_4lxml_5etree_17XSLTAccessControl_options, 0, __pyx_k_32, 0},
135646   {0, 0, 0, 0, 0}
135647 };
135648
135649 static PyNumberMethods __pyx_tp_as_number_XSLTAccessControl = {
135650   0, /*nb_add*/
135651   0, /*nb_subtract*/
135652   0, /*nb_multiply*/
135653   #if PY_MAJOR_VERSION < 3
135654   0, /*nb_divide*/
135655   #endif
135656   0, /*nb_remainder*/
135657   0, /*nb_divmod*/
135658   0, /*nb_power*/
135659   0, /*nb_negative*/
135660   0, /*nb_positive*/
135661   0, /*nb_absolute*/
135662   0, /*nb_nonzero*/
135663   0, /*nb_invert*/
135664   0, /*nb_lshift*/
135665   0, /*nb_rshift*/
135666   0, /*nb_and*/
135667   0, /*nb_xor*/
135668   0, /*nb_or*/
135669   #if PY_MAJOR_VERSION < 3
135670   0, /*nb_coerce*/
135671   #endif
135672   0, /*nb_int*/
135673   #if PY_MAJOR_VERSION >= 3
135674   0, /*reserved*/
135675   #else
135676   0, /*nb_long*/
135677   #endif
135678   0, /*nb_float*/
135679   #if PY_MAJOR_VERSION < 3
135680   0, /*nb_oct*/
135681   #endif
135682   #if PY_MAJOR_VERSION < 3
135683   0, /*nb_hex*/
135684   #endif
135685   0, /*nb_inplace_add*/
135686   0, /*nb_inplace_subtract*/
135687   0, /*nb_inplace_multiply*/
135688   #if PY_MAJOR_VERSION < 3
135689   0, /*nb_inplace_divide*/
135690   #endif
135691   0, /*nb_inplace_remainder*/
135692   0, /*nb_inplace_power*/
135693   0, /*nb_inplace_lshift*/
135694   0, /*nb_inplace_rshift*/
135695   0, /*nb_inplace_and*/
135696   0, /*nb_inplace_xor*/
135697   0, /*nb_inplace_or*/
135698   0, /*nb_floor_divide*/
135699   0, /*nb_true_divide*/
135700   0, /*nb_inplace_floor_divide*/
135701   0, /*nb_inplace_true_divide*/
135702   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
135703   0, /*nb_index*/
135704   #endif
135705 };
135706
135707 static PySequenceMethods __pyx_tp_as_sequence_XSLTAccessControl = {
135708   0, /*sq_length*/
135709   0, /*sq_concat*/
135710   0, /*sq_repeat*/
135711   0, /*sq_item*/
135712   0, /*sq_slice*/
135713   0, /*sq_ass_item*/
135714   0, /*sq_ass_slice*/
135715   0, /*sq_contains*/
135716   0, /*sq_inplace_concat*/
135717   0, /*sq_inplace_repeat*/
135718 };
135719
135720 static PyMappingMethods __pyx_tp_as_mapping_XSLTAccessControl = {
135721   0, /*mp_length*/
135722   0, /*mp_subscript*/
135723   0, /*mp_ass_subscript*/
135724 };
135725
135726 static PyBufferProcs __pyx_tp_as_buffer_XSLTAccessControl = {
135727   #if PY_MAJOR_VERSION < 3
135728   0, /*bf_getreadbuffer*/
135729   #endif
135730   #if PY_MAJOR_VERSION < 3
135731   0, /*bf_getwritebuffer*/
135732   #endif
135733   #if PY_MAJOR_VERSION < 3
135734   0, /*bf_getsegcount*/
135735   #endif
135736   #if PY_MAJOR_VERSION < 3
135737   0, /*bf_getcharbuffer*/
135738   #endif
135739   #if PY_VERSION_HEX >= 0x02060000
135740   0, /*bf_getbuffer*/
135741   #endif
135742   #if PY_VERSION_HEX >= 0x02060000
135743   0, /*bf_releasebuffer*/
135744   #endif
135745 };
135746
135747 PyTypeObject __pyx_type_4lxml_5etree_XSLTAccessControl = {
135748   PyVarObject_HEAD_INIT(0, 0)
135749   __Pyx_NAMESTR("lxml.etree.XSLTAccessControl"), /*tp_name*/
135750   sizeof(struct __pyx_obj_4lxml_5etree_XSLTAccessControl), /*tp_basicsize*/
135751   0, /*tp_itemsize*/
135752   __pyx_tp_dealloc_4lxml_5etree_XSLTAccessControl, /*tp_dealloc*/
135753   0, /*tp_print*/
135754   0, /*tp_getattr*/
135755   0, /*tp_setattr*/
135756   0, /*tp_compare*/
135757   __pyx_pf_4lxml_5etree_17XSLTAccessControl___repr__, /*tp_repr*/
135758   &__pyx_tp_as_number_XSLTAccessControl, /*tp_as_number*/
135759   &__pyx_tp_as_sequence_XSLTAccessControl, /*tp_as_sequence*/
135760   &__pyx_tp_as_mapping_XSLTAccessControl, /*tp_as_mapping*/
135761   0, /*tp_hash*/
135762   0, /*tp_call*/
135763   0, /*tp_str*/
135764   0, /*tp_getattro*/
135765   0, /*tp_setattro*/
135766   &__pyx_tp_as_buffer_XSLTAccessControl, /*tp_as_buffer*/
135767   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
135768   __Pyx_DOCSTR("XSLTAccessControl(self, read_file=True, write_file=True, create_dir=True, read_network=True, write_network=True)\n\n    Access control for XSLT: reading/writing files, directories and\n    network I/O.  Access to a type of resource is granted or denied by\n    passing any of the following boolean keyword arguments.  All of\n    them default to True to allow access.\n\n    - read_file\n    - write_file\n    - create_dir\n    - read_network\n    - write_network\n\n    For convenience, there is also a class member `DENY_ALL` that\n    provides an XSLTAccessControl instance that is readily configured\n    to deny everything, and a `DENY_WRITE` member that denies all\n    write access but allows read access.\n\n    See `XSLT`.\n    "), /*tp_doc*/
135769   0, /*tp_traverse*/
135770   0, /*tp_clear*/
135771   0, /*tp_richcompare*/
135772   0, /*tp_weaklistoffset*/
135773   0, /*tp_iter*/
135774   0, /*tp_iternext*/
135775   __pyx_methods_4lxml_5etree_XSLTAccessControl, /*tp_methods*/
135776   0, /*tp_members*/
135777   __pyx_getsets_4lxml_5etree_XSLTAccessControl, /*tp_getset*/
135778   0, /*tp_base*/
135779   0, /*tp_dict*/
135780   0, /*tp_descr_get*/
135781   0, /*tp_descr_set*/
135782   0, /*tp_dictoffset*/
135783   __pyx_pf_4lxml_5etree_17XSLTAccessControl___init__, /*tp_init*/
135784   0, /*tp_alloc*/
135785   __pyx_tp_new_4lxml_5etree_XSLTAccessControl, /*tp_new*/
135786   0, /*tp_free*/
135787   0, /*tp_is_gc*/
135788   0, /*tp_bases*/
135789   0, /*tp_mro*/
135790   0, /*tp_cache*/
135791   0, /*tp_subclasses*/
135792   0, /*tp_weaklist*/
135793 };
135794 static struct __pyx_vtabstruct_4lxml_5etree__XSLTContext __pyx_vtable_4lxml_5etree__XSLTContext;
135795
135796 static PyObject *__pyx_tp_new_4lxml_5etree__XSLTContext(PyTypeObject *t, PyObject *a, PyObject *k) {
135797   struct __pyx_obj_4lxml_5etree__XSLTContext *p;
135798   PyObject *o = __pyx_tp_new_4lxml_5etree__BaseContext(t, a, k);
135799   if (!o) return 0;
135800   p = ((struct __pyx_obj_4lxml_5etree__XSLTContext *)o);
135801   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__BaseContext*)__pyx_vtabptr_4lxml_5etree__XSLTContext;
135802   p->_extension_element_proxy = ((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)Py_None); Py_INCREF(Py_None);
135803   p->_extension_elements = ((PyObject *)Py_None); Py_INCREF(Py_None);
135804   return o;
135805 }
135806
135807 static void __pyx_tp_dealloc_4lxml_5etree__XSLTContext(PyObject *o) {
135808   struct __pyx_obj_4lxml_5etree__XSLTContext *p = (struct __pyx_obj_4lxml_5etree__XSLTContext *)o;
135809   Py_XDECREF(((PyObject *)p->_extension_element_proxy));
135810   Py_XDECREF(((PyObject *)p->_extension_elements));
135811   __pyx_tp_dealloc_4lxml_5etree__BaseContext(o);
135812 }
135813
135814 static int __pyx_tp_traverse_4lxml_5etree__XSLTContext(PyObject *o, visitproc v, void *a) {
135815   int e;
135816   struct __pyx_obj_4lxml_5etree__XSLTContext *p = (struct __pyx_obj_4lxml_5etree__XSLTContext *)o;
135817   e = __pyx_tp_traverse_4lxml_5etree__BaseContext(o, v, a); if (e) return e;
135818   if (p->_extension_element_proxy) {
135819     e = (*v)(((PyObject*)p->_extension_element_proxy), a); if (e) return e;
135820   }
135821   if (p->_extension_elements) {
135822     e = (*v)(p->_extension_elements, a); if (e) return e;
135823   }
135824   return 0;
135825 }
135826
135827 static int __pyx_tp_clear_4lxml_5etree__XSLTContext(PyObject *o) {
135828   struct __pyx_obj_4lxml_5etree__XSLTContext *p = (struct __pyx_obj_4lxml_5etree__XSLTContext *)o;
135829   PyObject* tmp;
135830   __pyx_tp_clear_4lxml_5etree__BaseContext(o);
135831   tmp = ((PyObject*)p->_extension_element_proxy);
135832   p->_extension_element_proxy = ((struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *)Py_None); Py_INCREF(Py_None);
135833   Py_XDECREF(tmp);
135834   tmp = ((PyObject*)p->_extension_elements);
135835   p->_extension_elements = ((PyObject *)Py_None); Py_INCREF(Py_None);
135836   Py_XDECREF(tmp);
135837   return 0;
135838 }
135839
135840 static struct PyMethodDef __pyx_methods_4lxml_5etree__XSLTContext[] = {
135841   {0, 0, 0, 0}
135842 };
135843
135844 static PyNumberMethods __pyx_tp_as_number__XSLTContext = {
135845   0, /*nb_add*/
135846   0, /*nb_subtract*/
135847   0, /*nb_multiply*/
135848   #if PY_MAJOR_VERSION < 3
135849   0, /*nb_divide*/
135850   #endif
135851   0, /*nb_remainder*/
135852   0, /*nb_divmod*/
135853   0, /*nb_power*/
135854   0, /*nb_negative*/
135855   0, /*nb_positive*/
135856   0, /*nb_absolute*/
135857   0, /*nb_nonzero*/
135858   0, /*nb_invert*/
135859   0, /*nb_lshift*/
135860   0, /*nb_rshift*/
135861   0, /*nb_and*/
135862   0, /*nb_xor*/
135863   0, /*nb_or*/
135864   #if PY_MAJOR_VERSION < 3
135865   0, /*nb_coerce*/
135866   #endif
135867   0, /*nb_int*/
135868   #if PY_MAJOR_VERSION >= 3
135869   0, /*reserved*/
135870   #else
135871   0, /*nb_long*/
135872   #endif
135873   0, /*nb_float*/
135874   #if PY_MAJOR_VERSION < 3
135875   0, /*nb_oct*/
135876   #endif
135877   #if PY_MAJOR_VERSION < 3
135878   0, /*nb_hex*/
135879   #endif
135880   0, /*nb_inplace_add*/
135881   0, /*nb_inplace_subtract*/
135882   0, /*nb_inplace_multiply*/
135883   #if PY_MAJOR_VERSION < 3
135884   0, /*nb_inplace_divide*/
135885   #endif
135886   0, /*nb_inplace_remainder*/
135887   0, /*nb_inplace_power*/
135888   0, /*nb_inplace_lshift*/
135889   0, /*nb_inplace_rshift*/
135890   0, /*nb_inplace_and*/
135891   0, /*nb_inplace_xor*/
135892   0, /*nb_inplace_or*/
135893   0, /*nb_floor_divide*/
135894   0, /*nb_true_divide*/
135895   0, /*nb_inplace_floor_divide*/
135896   0, /*nb_inplace_true_divide*/
135897   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
135898   0, /*nb_index*/
135899   #endif
135900 };
135901
135902 static PySequenceMethods __pyx_tp_as_sequence__XSLTContext = {
135903   0, /*sq_length*/
135904   0, /*sq_concat*/
135905   0, /*sq_repeat*/
135906   0, /*sq_item*/
135907   0, /*sq_slice*/
135908   0, /*sq_ass_item*/
135909   0, /*sq_ass_slice*/
135910   0, /*sq_contains*/
135911   0, /*sq_inplace_concat*/
135912   0, /*sq_inplace_repeat*/
135913 };
135914
135915 static PyMappingMethods __pyx_tp_as_mapping__XSLTContext = {
135916   0, /*mp_length*/
135917   0, /*mp_subscript*/
135918   0, /*mp_ass_subscript*/
135919 };
135920
135921 static PyBufferProcs __pyx_tp_as_buffer__XSLTContext = {
135922   #if PY_MAJOR_VERSION < 3
135923   0, /*bf_getreadbuffer*/
135924   #endif
135925   #if PY_MAJOR_VERSION < 3
135926   0, /*bf_getwritebuffer*/
135927   #endif
135928   #if PY_MAJOR_VERSION < 3
135929   0, /*bf_getsegcount*/
135930   #endif
135931   #if PY_MAJOR_VERSION < 3
135932   0, /*bf_getcharbuffer*/
135933   #endif
135934   #if PY_VERSION_HEX >= 0x02060000
135935   0, /*bf_getbuffer*/
135936   #endif
135937   #if PY_VERSION_HEX >= 0x02060000
135938   0, /*bf_releasebuffer*/
135939   #endif
135940 };
135941
135942 PyTypeObject __pyx_type_4lxml_5etree__XSLTContext = {
135943   PyVarObject_HEAD_INIT(0, 0)
135944   __Pyx_NAMESTR("lxml.etree._XSLTContext"), /*tp_name*/
135945   sizeof(struct __pyx_obj_4lxml_5etree__XSLTContext), /*tp_basicsize*/
135946   0, /*tp_itemsize*/
135947   __pyx_tp_dealloc_4lxml_5etree__XSLTContext, /*tp_dealloc*/
135948   0, /*tp_print*/
135949   0, /*tp_getattr*/
135950   0, /*tp_setattr*/
135951   0, /*tp_compare*/
135952   0, /*tp_repr*/
135953   &__pyx_tp_as_number__XSLTContext, /*tp_as_number*/
135954   &__pyx_tp_as_sequence__XSLTContext, /*tp_as_sequence*/
135955   &__pyx_tp_as_mapping__XSLTContext, /*tp_as_mapping*/
135956   0, /*tp_hash*/
135957   0, /*tp_call*/
135958   0, /*tp_str*/
135959   0, /*tp_getattro*/
135960   0, /*tp_setattro*/
135961   &__pyx_tp_as_buffer__XSLTContext, /*tp_as_buffer*/
135962   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
135963   0, /*tp_doc*/
135964   __pyx_tp_traverse_4lxml_5etree__XSLTContext, /*tp_traverse*/
135965   __pyx_tp_clear_4lxml_5etree__XSLTContext, /*tp_clear*/
135966   0, /*tp_richcompare*/
135967   0, /*tp_weaklistoffset*/
135968   0, /*tp_iter*/
135969   0, /*tp_iternext*/
135970   __pyx_methods_4lxml_5etree__XSLTContext, /*tp_methods*/
135971   0, /*tp_members*/
135972   0, /*tp_getset*/
135973   0, /*tp_base*/
135974   0, /*tp_dict*/
135975   0, /*tp_descr_get*/
135976   0, /*tp_descr_set*/
135977   0, /*tp_dictoffset*/
135978   __pyx_pf_4lxml_5etree_12_XSLTContext___init__, /*tp_init*/
135979   0, /*tp_alloc*/
135980   __pyx_tp_new_4lxml_5etree__XSLTContext, /*tp_new*/
135981   0, /*tp_free*/
135982   0, /*tp_is_gc*/
135983   0, /*tp_bases*/
135984   0, /*tp_mro*/
135985   0, /*tp_cache*/
135986   0, /*tp_subclasses*/
135987   0, /*tp_weaklist*/
135988 };
135989
135990 static PyObject *__pyx_tp_new_4lxml_5etree__XSLTQuotedStringParam(PyTypeObject *t, PyObject *a, PyObject *k) {
135991   struct __pyx_obj_4lxml_5etree__XSLTQuotedStringParam *p;
135992   PyObject *o = (*t->tp_alloc)(t, 0);
135993   if (!o) return 0;
135994   p = ((struct __pyx_obj_4lxml_5etree__XSLTQuotedStringParam *)o);
135995   p->strval = ((PyObject *)Py_None); Py_INCREF(Py_None);
135996   return o;
135997 }
135998
135999 static void __pyx_tp_dealloc_4lxml_5etree__XSLTQuotedStringParam(PyObject *o) {
136000   struct __pyx_obj_4lxml_5etree__XSLTQuotedStringParam *p = (struct __pyx_obj_4lxml_5etree__XSLTQuotedStringParam *)o;
136001   Py_XDECREF(((PyObject *)p->strval));
136002   (*Py_TYPE(o)->tp_free)(o);
136003 }
136004
136005 static int __pyx_tp_traverse_4lxml_5etree__XSLTQuotedStringParam(PyObject *o, visitproc v, void *a) {
136006   int e;
136007   struct __pyx_obj_4lxml_5etree__XSLTQuotedStringParam *p = (struct __pyx_obj_4lxml_5etree__XSLTQuotedStringParam *)o;
136008   if (p->strval) {
136009     e = (*v)(p->strval, a); if (e) return e;
136010   }
136011   return 0;
136012 }
136013
136014 static int __pyx_tp_clear_4lxml_5etree__XSLTQuotedStringParam(PyObject *o) {
136015   struct __pyx_obj_4lxml_5etree__XSLTQuotedStringParam *p = (struct __pyx_obj_4lxml_5etree__XSLTQuotedStringParam *)o;
136016   PyObject* tmp;
136017   tmp = ((PyObject*)p->strval);
136018   p->strval = ((PyObject *)Py_None); Py_INCREF(Py_None);
136019   Py_XDECREF(tmp);
136020   return 0;
136021 }
136022
136023 static struct PyMethodDef __pyx_methods_4lxml_5etree__XSLTQuotedStringParam[] = {
136024   {0, 0, 0, 0}
136025 };
136026
136027 static PyNumberMethods __pyx_tp_as_number__XSLTQuotedStringParam = {
136028   0, /*nb_add*/
136029   0, /*nb_subtract*/
136030   0, /*nb_multiply*/
136031   #if PY_MAJOR_VERSION < 3
136032   0, /*nb_divide*/
136033   #endif
136034   0, /*nb_remainder*/
136035   0, /*nb_divmod*/
136036   0, /*nb_power*/
136037   0, /*nb_negative*/
136038   0, /*nb_positive*/
136039   0, /*nb_absolute*/
136040   0, /*nb_nonzero*/
136041   0, /*nb_invert*/
136042   0, /*nb_lshift*/
136043   0, /*nb_rshift*/
136044   0, /*nb_and*/
136045   0, /*nb_xor*/
136046   0, /*nb_or*/
136047   #if PY_MAJOR_VERSION < 3
136048   0, /*nb_coerce*/
136049   #endif
136050   0, /*nb_int*/
136051   #if PY_MAJOR_VERSION >= 3
136052   0, /*reserved*/
136053   #else
136054   0, /*nb_long*/
136055   #endif
136056   0, /*nb_float*/
136057   #if PY_MAJOR_VERSION < 3
136058   0, /*nb_oct*/
136059   #endif
136060   #if PY_MAJOR_VERSION < 3
136061   0, /*nb_hex*/
136062   #endif
136063   0, /*nb_inplace_add*/
136064   0, /*nb_inplace_subtract*/
136065   0, /*nb_inplace_multiply*/
136066   #if PY_MAJOR_VERSION < 3
136067   0, /*nb_inplace_divide*/
136068   #endif
136069   0, /*nb_inplace_remainder*/
136070   0, /*nb_inplace_power*/
136071   0, /*nb_inplace_lshift*/
136072   0, /*nb_inplace_rshift*/
136073   0, /*nb_inplace_and*/
136074   0, /*nb_inplace_xor*/
136075   0, /*nb_inplace_or*/
136076   0, /*nb_floor_divide*/
136077   0, /*nb_true_divide*/
136078   0, /*nb_inplace_floor_divide*/
136079   0, /*nb_inplace_true_divide*/
136080   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
136081   0, /*nb_index*/
136082   #endif
136083 };
136084
136085 static PySequenceMethods __pyx_tp_as_sequence__XSLTQuotedStringParam = {
136086   0, /*sq_length*/
136087   0, /*sq_concat*/
136088   0, /*sq_repeat*/
136089   0, /*sq_item*/
136090   0, /*sq_slice*/
136091   0, /*sq_ass_item*/
136092   0, /*sq_ass_slice*/
136093   0, /*sq_contains*/
136094   0, /*sq_inplace_concat*/
136095   0, /*sq_inplace_repeat*/
136096 };
136097
136098 static PyMappingMethods __pyx_tp_as_mapping__XSLTQuotedStringParam = {
136099   0, /*mp_length*/
136100   0, /*mp_subscript*/
136101   0, /*mp_ass_subscript*/
136102 };
136103
136104 static PyBufferProcs __pyx_tp_as_buffer__XSLTQuotedStringParam = {
136105   #if PY_MAJOR_VERSION < 3
136106   0, /*bf_getreadbuffer*/
136107   #endif
136108   #if PY_MAJOR_VERSION < 3
136109   0, /*bf_getwritebuffer*/
136110   #endif
136111   #if PY_MAJOR_VERSION < 3
136112   0, /*bf_getsegcount*/
136113   #endif
136114   #if PY_MAJOR_VERSION < 3
136115   0, /*bf_getcharbuffer*/
136116   #endif
136117   #if PY_VERSION_HEX >= 0x02060000
136118   0, /*bf_getbuffer*/
136119   #endif
136120   #if PY_VERSION_HEX >= 0x02060000
136121   0, /*bf_releasebuffer*/
136122   #endif
136123 };
136124
136125 PyTypeObject __pyx_type_4lxml_5etree__XSLTQuotedStringParam = {
136126   PyVarObject_HEAD_INIT(0, 0)
136127   __Pyx_NAMESTR("lxml.etree._XSLTQuotedStringParam"), /*tp_name*/
136128   sizeof(struct __pyx_obj_4lxml_5etree__XSLTQuotedStringParam), /*tp_basicsize*/
136129   0, /*tp_itemsize*/
136130   __pyx_tp_dealloc_4lxml_5etree__XSLTQuotedStringParam, /*tp_dealloc*/
136131   0, /*tp_print*/
136132   0, /*tp_getattr*/
136133   0, /*tp_setattr*/
136134   0, /*tp_compare*/
136135   0, /*tp_repr*/
136136   &__pyx_tp_as_number__XSLTQuotedStringParam, /*tp_as_number*/
136137   &__pyx_tp_as_sequence__XSLTQuotedStringParam, /*tp_as_sequence*/
136138   &__pyx_tp_as_mapping__XSLTQuotedStringParam, /*tp_as_mapping*/
136139   0, /*tp_hash*/
136140   0, /*tp_call*/
136141   0, /*tp_str*/
136142   0, /*tp_getattro*/
136143   0, /*tp_setattro*/
136144   &__pyx_tp_as_buffer__XSLTQuotedStringParam, /*tp_as_buffer*/
136145   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
136146   __Pyx_DOCSTR("A wrapper class for literal XSLT string parameters that require\n    quote escaping.\n    "), /*tp_doc*/
136147   __pyx_tp_traverse_4lxml_5etree__XSLTQuotedStringParam, /*tp_traverse*/
136148   __pyx_tp_clear_4lxml_5etree__XSLTQuotedStringParam, /*tp_clear*/
136149   0, /*tp_richcompare*/
136150   0, /*tp_weaklistoffset*/
136151   0, /*tp_iter*/
136152   0, /*tp_iternext*/
136153   __pyx_methods_4lxml_5etree__XSLTQuotedStringParam, /*tp_methods*/
136154   0, /*tp_members*/
136155   0, /*tp_getset*/
136156   0, /*tp_base*/
136157   0, /*tp_dict*/
136158   0, /*tp_descr_get*/
136159   0, /*tp_descr_set*/
136160   0, /*tp_dictoffset*/
136161   __pyx_pf_4lxml_5etree_22_XSLTQuotedStringParam___init__, /*tp_init*/
136162   0, /*tp_alloc*/
136163   __pyx_tp_new_4lxml_5etree__XSLTQuotedStringParam, /*tp_new*/
136164   0, /*tp_free*/
136165   0, /*tp_is_gc*/
136166   0, /*tp_bases*/
136167   0, /*tp_mro*/
136168   0, /*tp_cache*/
136169   0, /*tp_subclasses*/
136170   0, /*tp_weaklist*/
136171 };
136172 static struct __pyx_vtabstruct_4lxml_5etree_XSLT __pyx_vtable_4lxml_5etree_XSLT;
136173
136174 static PyObject *__pyx_tp_new_4lxml_5etree_XSLT(PyTypeObject *t, PyObject *a, PyObject *k) {
136175   struct __pyx_obj_4lxml_5etree_XSLT *p;
136176   PyObject *o = (*t->tp_alloc)(t, 0);
136177   if (!o) return 0;
136178   p = ((struct __pyx_obj_4lxml_5etree_XSLT *)o);
136179   p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree_XSLT;
136180   p->_context = ((struct __pyx_obj_4lxml_5etree__XSLTContext *)Py_None); Py_INCREF(Py_None);
136181   p->_xslt_resolver_context = ((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)Py_None); Py_INCREF(Py_None);
136182   p->_access_control = ((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)Py_None); Py_INCREF(Py_None);
136183   p->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
136184   return o;
136185 }
136186
136187 static void __pyx_tp_dealloc_4lxml_5etree_XSLT(PyObject *o) {
136188   struct __pyx_obj_4lxml_5etree_XSLT *p = (struct __pyx_obj_4lxml_5etree_XSLT *)o;
136189   {
136190     PyObject *etype, *eval, *etb;
136191     PyErr_Fetch(&etype, &eval, &etb);
136192     ++Py_REFCNT(o);
136193     __pyx_pf_4lxml_5etree_4XSLT___dealloc__(o);
136194     if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
136195     --Py_REFCNT(o);
136196     PyErr_Restore(etype, eval, etb);
136197   }
136198   Py_XDECREF(((PyObject *)p->_context));
136199   Py_XDECREF(((PyObject *)p->_xslt_resolver_context));
136200   Py_XDECREF(((PyObject *)p->_access_control));
136201   Py_XDECREF(((PyObject *)p->_error_log));
136202   (*Py_TYPE(o)->tp_free)(o);
136203 }
136204
136205 static int __pyx_tp_traverse_4lxml_5etree_XSLT(PyObject *o, visitproc v, void *a) {
136206   int e;
136207   struct __pyx_obj_4lxml_5etree_XSLT *p = (struct __pyx_obj_4lxml_5etree_XSLT *)o;
136208   if (p->_context) {
136209     e = (*v)(((PyObject*)p->_context), a); if (e) return e;
136210   }
136211   if (p->_xslt_resolver_context) {
136212     e = (*v)(((PyObject*)p->_xslt_resolver_context), a); if (e) return e;
136213   }
136214   if (p->_access_control) {
136215     e = (*v)(((PyObject*)p->_access_control), a); if (e) return e;
136216   }
136217   if (p->_error_log) {
136218     e = (*v)(((PyObject*)p->_error_log), a); if (e) return e;
136219   }
136220   return 0;
136221 }
136222
136223 static int __pyx_tp_clear_4lxml_5etree_XSLT(PyObject *o) {
136224   struct __pyx_obj_4lxml_5etree_XSLT *p = (struct __pyx_obj_4lxml_5etree_XSLT *)o;
136225   PyObject* tmp;
136226   tmp = ((PyObject*)p->_context);
136227   p->_context = ((struct __pyx_obj_4lxml_5etree__XSLTContext *)Py_None); Py_INCREF(Py_None);
136228   Py_XDECREF(tmp);
136229   tmp = ((PyObject*)p->_xslt_resolver_context);
136230   p->_xslt_resolver_context = ((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)Py_None); Py_INCREF(Py_None);
136231   Py_XDECREF(tmp);
136232   tmp = ((PyObject*)p->_access_control);
136233   p->_access_control = ((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)Py_None); Py_INCREF(Py_None);
136234   Py_XDECREF(tmp);
136235   tmp = ((PyObject*)p->_error_log);
136236   p->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
136237   Py_XDECREF(tmp);
136238   return 0;
136239 }
136240
136241 static PyObject *__pyx_getprop_4lxml_5etree_4XSLT_error_log(PyObject *o, void *x) {
136242   return __pyx_pf_4lxml_5etree_4XSLT_9error_log___get__(o);
136243 }
136244
136245 static struct PyMethodDef __pyx_methods_4lxml_5etree_XSLT[] = {
136246   {__Pyx_NAMESTR("strparam"), (PyCFunction)__pyx_pf_4lxml_5etree_4XSLT_strparam, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_4XSLT_strparam)},
136247   {__Pyx_NAMESTR("apply"), (PyCFunction)__pyx_pf_4lxml_5etree_4XSLT_apply, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_4XSLT_apply)},
136248   {__Pyx_NAMESTR("tostring"), (PyCFunction)__pyx_pf_4lxml_5etree_4XSLT_tostring, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_4XSLT_tostring)},
136249   {__Pyx_NAMESTR("__deepcopy__"), (PyCFunction)__pyx_pf_4lxml_5etree_4XSLT___deepcopy__, METH_O, __Pyx_DOCSTR(0)},
136250   {__Pyx_NAMESTR("__copy__"), (PyCFunction)__pyx_pf_4lxml_5etree_4XSLT___copy__, METH_NOARGS, __Pyx_DOCSTR(0)},
136251   {__Pyx_NAMESTR("__call__"), (PyCFunction)__pyx_pf_4lxml_5etree_4XSLT___call__, METH_VARARGS|METH_KEYWORDS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_4XSLT___call__)},
136252   {0, 0, 0, 0}
136253 };
136254
136255 static struct PyGetSetDef __pyx_getsets_4lxml_5etree_XSLT[] = {
136256   {(char *)"error_log", __pyx_getprop_4lxml_5etree_4XSLT_error_log, 0, __pyx_k_33, 0},
136257   {0, 0, 0, 0, 0}
136258 };
136259
136260 static PyNumberMethods __pyx_tp_as_number_XSLT = {
136261   0, /*nb_add*/
136262   0, /*nb_subtract*/
136263   0, /*nb_multiply*/
136264   #if PY_MAJOR_VERSION < 3
136265   0, /*nb_divide*/
136266   #endif
136267   0, /*nb_remainder*/
136268   0, /*nb_divmod*/
136269   0, /*nb_power*/
136270   0, /*nb_negative*/
136271   0, /*nb_positive*/
136272   0, /*nb_absolute*/
136273   0, /*nb_nonzero*/
136274   0, /*nb_invert*/
136275   0, /*nb_lshift*/
136276   0, /*nb_rshift*/
136277   0, /*nb_and*/
136278   0, /*nb_xor*/
136279   0, /*nb_or*/
136280   #if PY_MAJOR_VERSION < 3
136281   0, /*nb_coerce*/
136282   #endif
136283   0, /*nb_int*/
136284   #if PY_MAJOR_VERSION >= 3
136285   0, /*reserved*/
136286   #else
136287   0, /*nb_long*/
136288   #endif
136289   0, /*nb_float*/
136290   #if PY_MAJOR_VERSION < 3
136291   0, /*nb_oct*/
136292   #endif
136293   #if PY_MAJOR_VERSION < 3
136294   0, /*nb_hex*/
136295   #endif
136296   0, /*nb_inplace_add*/
136297   0, /*nb_inplace_subtract*/
136298   0, /*nb_inplace_multiply*/
136299   #if PY_MAJOR_VERSION < 3
136300   0, /*nb_inplace_divide*/
136301   #endif
136302   0, /*nb_inplace_remainder*/
136303   0, /*nb_inplace_power*/
136304   0, /*nb_inplace_lshift*/
136305   0, /*nb_inplace_rshift*/
136306   0, /*nb_inplace_and*/
136307   0, /*nb_inplace_xor*/
136308   0, /*nb_inplace_or*/
136309   0, /*nb_floor_divide*/
136310   0, /*nb_true_divide*/
136311   0, /*nb_inplace_floor_divide*/
136312   0, /*nb_inplace_true_divide*/
136313   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
136314   0, /*nb_index*/
136315   #endif
136316 };
136317
136318 static PySequenceMethods __pyx_tp_as_sequence_XSLT = {
136319   0, /*sq_length*/
136320   0, /*sq_concat*/
136321   0, /*sq_repeat*/
136322   0, /*sq_item*/
136323   0, /*sq_slice*/
136324   0, /*sq_ass_item*/
136325   0, /*sq_ass_slice*/
136326   0, /*sq_contains*/
136327   0, /*sq_inplace_concat*/
136328   0, /*sq_inplace_repeat*/
136329 };
136330
136331 static PyMappingMethods __pyx_tp_as_mapping_XSLT = {
136332   0, /*mp_length*/
136333   0, /*mp_subscript*/
136334   0, /*mp_ass_subscript*/
136335 };
136336
136337 static PyBufferProcs __pyx_tp_as_buffer_XSLT = {
136338   #if PY_MAJOR_VERSION < 3
136339   0, /*bf_getreadbuffer*/
136340   #endif
136341   #if PY_MAJOR_VERSION < 3
136342   0, /*bf_getwritebuffer*/
136343   #endif
136344   #if PY_MAJOR_VERSION < 3
136345   0, /*bf_getsegcount*/
136346   #endif
136347   #if PY_MAJOR_VERSION < 3
136348   0, /*bf_getcharbuffer*/
136349   #endif
136350   #if PY_VERSION_HEX >= 0x02060000
136351   0, /*bf_getbuffer*/
136352   #endif
136353   #if PY_VERSION_HEX >= 0x02060000
136354   0, /*bf_releasebuffer*/
136355   #endif
136356 };
136357
136358 PyTypeObject __pyx_type_4lxml_5etree_XSLT = {
136359   PyVarObject_HEAD_INIT(0, 0)
136360   __Pyx_NAMESTR("lxml.etree.XSLT"), /*tp_name*/
136361   sizeof(struct __pyx_obj_4lxml_5etree_XSLT), /*tp_basicsize*/
136362   0, /*tp_itemsize*/
136363   __pyx_tp_dealloc_4lxml_5etree_XSLT, /*tp_dealloc*/
136364   0, /*tp_print*/
136365   0, /*tp_getattr*/
136366   0, /*tp_setattr*/
136367   0, /*tp_compare*/
136368   0, /*tp_repr*/
136369   &__pyx_tp_as_number_XSLT, /*tp_as_number*/
136370   &__pyx_tp_as_sequence_XSLT, /*tp_as_sequence*/
136371   &__pyx_tp_as_mapping_XSLT, /*tp_as_mapping*/
136372   0, /*tp_hash*/
136373   __pyx_pf_4lxml_5etree_4XSLT___call__, /*tp_call*/
136374   0, /*tp_str*/
136375   0, /*tp_getattro*/
136376   0, /*tp_setattro*/
136377   &__pyx_tp_as_buffer_XSLT, /*tp_as_buffer*/
136378   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
136379   __Pyx_DOCSTR("XSLT(self, xslt_input, extensions=None, regexp=True, access_control=None)\n\n    Turn an XSL document into an XSLT object.\n\n    Calling this object on a tree or Element will execute the XSLT::\n\n      >>> transform = etree.XSLT(xsl_tree)\n      >>> result = transform(xml_tree)\n\n    Keyword arguments of the constructor:\n\n    - extensions: a dict mapping ``(namespace, name)`` pairs to\n      extension functions or extension elements\n    - regexp: enable exslt regular expression support in XPath\n      (default: True)\n    - access_control: access restrictions for network or file\n      system (see `XSLTAccessControl`)\n\n    Keyword arguments of the XSLT call:\n\n    - profile_run: enable XSLT profiling (default: False)\n\n    Other keyword arguments of the call are passed to the stylesheet\n    as parameters.\n    "), /*tp_doc*/
136380   __pyx_tp_traverse_4lxml_5etree_XSLT, /*tp_traverse*/
136381   __pyx_tp_clear_4lxml_5etree_XSLT, /*tp_clear*/
136382   0, /*tp_richcompare*/
136383   0, /*tp_weaklistoffset*/
136384   0, /*tp_iter*/
136385   0, /*tp_iternext*/
136386   __pyx_methods_4lxml_5etree_XSLT, /*tp_methods*/
136387   0, /*tp_members*/
136388   __pyx_getsets_4lxml_5etree_XSLT, /*tp_getset*/
136389   0, /*tp_base*/
136390   0, /*tp_dict*/
136391   0, /*tp_descr_get*/
136392   0, /*tp_descr_set*/
136393   0, /*tp_dictoffset*/
136394   __pyx_pf_4lxml_5etree_4XSLT___init__, /*tp_init*/
136395   0, /*tp_alloc*/
136396   __pyx_tp_new_4lxml_5etree_XSLT, /*tp_new*/
136397   0, /*tp_free*/
136398   0, /*tp_is_gc*/
136399   0, /*tp_bases*/
136400   0, /*tp_mro*/
136401   0, /*tp_cache*/
136402   0, /*tp_subclasses*/
136403   0, /*tp_weaklist*/
136404 };
136405 static struct __pyx_vtabstruct_4lxml_5etree__XSLTResultTree __pyx_vtable_4lxml_5etree__XSLTResultTree;
136406
136407 static PyObject *__pyx_tp_new_4lxml_5etree__XSLTResultTree(PyTypeObject *t, PyObject *a, PyObject *k) {
136408   struct __pyx_obj_4lxml_5etree__XSLTResultTree *p;
136409   PyObject *o = __pyx_tp_new_4lxml_5etree__ElementTree(t, a, k);
136410   if (!o) return 0;
136411   p = ((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)o);
136412   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree__ElementTree*)__pyx_vtabptr_4lxml_5etree__XSLTResultTree;
136413   p->_xslt = ((struct __pyx_obj_4lxml_5etree_XSLT *)Py_None); Py_INCREF(Py_None);
136414   p->_profile = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
136415   return o;
136416 }
136417
136418 static void __pyx_tp_dealloc_4lxml_5etree__XSLTResultTree(PyObject *o) {
136419   struct __pyx_obj_4lxml_5etree__XSLTResultTree *p = (struct __pyx_obj_4lxml_5etree__XSLTResultTree *)o;
136420   Py_XDECREF(((PyObject *)p->_xslt));
136421   Py_XDECREF(((PyObject *)p->_profile));
136422   __pyx_tp_dealloc_4lxml_5etree__ElementTree(o);
136423 }
136424
136425 static int __pyx_tp_traverse_4lxml_5etree__XSLTResultTree(PyObject *o, visitproc v, void *a) {
136426   int e;
136427   struct __pyx_obj_4lxml_5etree__XSLTResultTree *p = (struct __pyx_obj_4lxml_5etree__XSLTResultTree *)o;
136428   e = __pyx_tp_traverse_4lxml_5etree__ElementTree(o, v, a); if (e) return e;
136429   if (p->_xslt) {
136430     e = (*v)(((PyObject*)p->_xslt), a); if (e) return e;
136431   }
136432   if (p->_profile) {
136433     e = (*v)(((PyObject*)p->_profile), a); if (e) return e;
136434   }
136435   return 0;
136436 }
136437
136438 static int __pyx_tp_clear_4lxml_5etree__XSLTResultTree(PyObject *o) {
136439   struct __pyx_obj_4lxml_5etree__XSLTResultTree *p = (struct __pyx_obj_4lxml_5etree__XSLTResultTree *)o;
136440   PyObject* tmp;
136441   __pyx_tp_clear_4lxml_5etree__ElementTree(o);
136442   tmp = ((PyObject*)p->_xslt);
136443   p->_xslt = ((struct __pyx_obj_4lxml_5etree_XSLT *)Py_None); Py_INCREF(Py_None);
136444   Py_XDECREF(tmp);
136445   tmp = ((PyObject*)p->_profile);
136446   p->_profile = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
136447   Py_XDECREF(tmp);
136448   return 0;
136449 }
136450
136451 static PyObject *__pyx_getprop_4lxml_5etree_15_XSLTResultTree_xslt_profile(PyObject *o, void *x) {
136452   return __pyx_pf_4lxml_5etree_15_XSLTResultTree_12xslt_profile___get__(o);
136453 }
136454
136455 static int __pyx_setprop_4lxml_5etree_15_XSLTResultTree_xslt_profile(PyObject *o, PyObject *v, void *x) {
136456   if (v) {
136457     PyErr_SetString(PyExc_NotImplementedError, "__set__");
136458     return -1;
136459   }
136460   else {
136461     return __pyx_pf_4lxml_5etree_15_XSLTResultTree_12xslt_profile___del__(o);
136462   }
136463 }
136464
136465 static struct PyMethodDef __pyx_methods_4lxml_5etree__XSLTResultTree[] = {
136466   {__Pyx_NAMESTR("__str__"), (PyCFunction)__pyx_pf_4lxml_5etree_15_XSLTResultTree___str__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
136467   {__Pyx_NAMESTR("__unicode__"), (PyCFunction)__pyx_pf_4lxml_5etree_15_XSLTResultTree___unicode__, METH_NOARGS, __Pyx_DOCSTR(0)},
136468   {0, 0, 0, 0}
136469 };
136470
136471 static struct PyGetSetDef __pyx_getsets_4lxml_5etree__XSLTResultTree[] = {
136472   {(char *)"xslt_profile", __pyx_getprop_4lxml_5etree_15_XSLTResultTree_xslt_profile, __pyx_setprop_4lxml_5etree_15_XSLTResultTree_xslt_profile, __pyx_k_34, 0},
136473   {0, 0, 0, 0, 0}
136474 };
136475
136476 static PyNumberMethods __pyx_tp_as_number__XSLTResultTree = {
136477   0, /*nb_add*/
136478   0, /*nb_subtract*/
136479   0, /*nb_multiply*/
136480   #if PY_MAJOR_VERSION < 3
136481   0, /*nb_divide*/
136482   #endif
136483   0, /*nb_remainder*/
136484   0, /*nb_divmod*/
136485   0, /*nb_power*/
136486   0, /*nb_negative*/
136487   0, /*nb_positive*/
136488   0, /*nb_absolute*/
136489   0, /*nb_nonzero*/
136490   0, /*nb_invert*/
136491   0, /*nb_lshift*/
136492   0, /*nb_rshift*/
136493   0, /*nb_and*/
136494   0, /*nb_xor*/
136495   0, /*nb_or*/
136496   #if PY_MAJOR_VERSION < 3
136497   0, /*nb_coerce*/
136498   #endif
136499   0, /*nb_int*/
136500   #if PY_MAJOR_VERSION >= 3
136501   0, /*reserved*/
136502   #else
136503   0, /*nb_long*/
136504   #endif
136505   0, /*nb_float*/
136506   #if PY_MAJOR_VERSION < 3
136507   0, /*nb_oct*/
136508   #endif
136509   #if PY_MAJOR_VERSION < 3
136510   0, /*nb_hex*/
136511   #endif
136512   0, /*nb_inplace_add*/
136513   0, /*nb_inplace_subtract*/
136514   0, /*nb_inplace_multiply*/
136515   #if PY_MAJOR_VERSION < 3
136516   0, /*nb_inplace_divide*/
136517   #endif
136518   0, /*nb_inplace_remainder*/
136519   0, /*nb_inplace_power*/
136520   0, /*nb_inplace_lshift*/
136521   0, /*nb_inplace_rshift*/
136522   0, /*nb_inplace_and*/
136523   0, /*nb_inplace_xor*/
136524   0, /*nb_inplace_or*/
136525   0, /*nb_floor_divide*/
136526   0, /*nb_true_divide*/
136527   0, /*nb_inplace_floor_divide*/
136528   0, /*nb_inplace_true_divide*/
136529   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
136530   0, /*nb_index*/
136531   #endif
136532 };
136533
136534 static PySequenceMethods __pyx_tp_as_sequence__XSLTResultTree = {
136535   0, /*sq_length*/
136536   0, /*sq_concat*/
136537   0, /*sq_repeat*/
136538   0, /*sq_item*/
136539   0, /*sq_slice*/
136540   0, /*sq_ass_item*/
136541   0, /*sq_ass_slice*/
136542   0, /*sq_contains*/
136543   0, /*sq_inplace_concat*/
136544   0, /*sq_inplace_repeat*/
136545 };
136546
136547 static PyMappingMethods __pyx_tp_as_mapping__XSLTResultTree = {
136548   0, /*mp_length*/
136549   0, /*mp_subscript*/
136550   0, /*mp_ass_subscript*/
136551 };
136552
136553 static PyBufferProcs __pyx_tp_as_buffer__XSLTResultTree = {
136554   #if PY_MAJOR_VERSION < 3
136555   0, /*bf_getreadbuffer*/
136556   #endif
136557   #if PY_MAJOR_VERSION < 3
136558   0, /*bf_getwritebuffer*/
136559   #endif
136560   #if PY_MAJOR_VERSION < 3
136561   0, /*bf_getsegcount*/
136562   #endif
136563   #if PY_MAJOR_VERSION < 3
136564   0, /*bf_getcharbuffer*/
136565   #endif
136566   #if PY_VERSION_HEX >= 0x02060000
136567   __pyx_pf_4lxml_5etree_15_XSLTResultTree___getbuffer__, /*bf_getbuffer*/
136568   #endif
136569   #if PY_VERSION_HEX >= 0x02060000
136570   __pyx_pf_4lxml_5etree_15_XSLTResultTree___releasebuffer__, /*bf_releasebuffer*/
136571   #endif
136572 };
136573
136574 PyTypeObject __pyx_type_4lxml_5etree__XSLTResultTree = {
136575   PyVarObject_HEAD_INIT(0, 0)
136576   __Pyx_NAMESTR("lxml.etree._XSLTResultTree"), /*tp_name*/
136577   sizeof(struct __pyx_obj_4lxml_5etree__XSLTResultTree), /*tp_basicsize*/
136578   0, /*tp_itemsize*/
136579   __pyx_tp_dealloc_4lxml_5etree__XSLTResultTree, /*tp_dealloc*/
136580   0, /*tp_print*/
136581   0, /*tp_getattr*/
136582   0, /*tp_setattr*/
136583   0, /*tp_compare*/
136584   0, /*tp_repr*/
136585   &__pyx_tp_as_number__XSLTResultTree, /*tp_as_number*/
136586   &__pyx_tp_as_sequence__XSLTResultTree, /*tp_as_sequence*/
136587   &__pyx_tp_as_mapping__XSLTResultTree, /*tp_as_mapping*/
136588   0, /*tp_hash*/
136589   0, /*tp_call*/
136590   __pyx_pf_4lxml_5etree_15_XSLTResultTree___str__, /*tp_str*/
136591   0, /*tp_getattro*/
136592   0, /*tp_setattro*/
136593   &__pyx_tp_as_buffer__XSLTResultTree, /*tp_as_buffer*/
136594   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
136595   0, /*tp_doc*/
136596   __pyx_tp_traverse_4lxml_5etree__XSLTResultTree, /*tp_traverse*/
136597   __pyx_tp_clear_4lxml_5etree__XSLTResultTree, /*tp_clear*/
136598   0, /*tp_richcompare*/
136599   0, /*tp_weaklistoffset*/
136600   0, /*tp_iter*/
136601   0, /*tp_iternext*/
136602   __pyx_methods_4lxml_5etree__XSLTResultTree, /*tp_methods*/
136603   0, /*tp_members*/
136604   __pyx_getsets_4lxml_5etree__XSLTResultTree, /*tp_getset*/
136605   0, /*tp_base*/
136606   0, /*tp_dict*/
136607   0, /*tp_descr_get*/
136608   0, /*tp_descr_set*/
136609   0, /*tp_dictoffset*/
136610   0, /*tp_init*/
136611   0, /*tp_alloc*/
136612   __pyx_tp_new_4lxml_5etree__XSLTResultTree, /*tp_new*/
136613   0, /*tp_free*/
136614   0, /*tp_is_gc*/
136615   0, /*tp_bases*/
136616   0, /*tp_mro*/
136617   0, /*tp_cache*/
136618   0, /*tp_subclasses*/
136619   0, /*tp_weaklist*/
136620 };
136621 static struct __pyx_vtabstruct_4lxml_5etree__XSLTProcessingInstruction __pyx_vtable_4lxml_5etree__XSLTProcessingInstruction;
136622
136623 static PyObject *__pyx_tp_new_4lxml_5etree__XSLTProcessingInstruction(PyTypeObject *t, PyObject *a, PyObject *k) {
136624   struct __pyx_obj_4lxml_5etree__XSLTProcessingInstruction *p;
136625   PyObject *o = __pyx_tp_new_4lxml_5etree__Element(t, a, k);
136626   if (!o) return 0;
136627   p = ((struct __pyx_obj_4lxml_5etree__XSLTProcessingInstruction *)o);
136628   p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement*)__pyx_vtabptr_4lxml_5etree__XSLTProcessingInstruction;
136629   return o;
136630 }
136631
136632 static struct PyMethodDef __pyx_methods_4lxml_5etree__XSLTProcessingInstruction[] = {
136633   {__Pyx_NAMESTR("parseXSL"), (PyCFunction)__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL)},
136634   {__Pyx_NAMESTR("set"), (PyCFunction)__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_set, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
136635   {__Pyx_NAMESTR("get"), (PyCFunction)__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_get, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
136636   {0, 0, 0, 0}
136637 };
136638
136639 static PyNumberMethods __pyx_tp_as_number__XSLTProcessingInstruction = {
136640   0, /*nb_add*/
136641   0, /*nb_subtract*/
136642   0, /*nb_multiply*/
136643   #if PY_MAJOR_VERSION < 3
136644   0, /*nb_divide*/
136645   #endif
136646   0, /*nb_remainder*/
136647   0, /*nb_divmod*/
136648   0, /*nb_power*/
136649   0, /*nb_negative*/
136650   0, /*nb_positive*/
136651   0, /*nb_absolute*/
136652   0, /*nb_nonzero*/
136653   0, /*nb_invert*/
136654   0, /*nb_lshift*/
136655   0, /*nb_rshift*/
136656   0, /*nb_and*/
136657   0, /*nb_xor*/
136658   0, /*nb_or*/
136659   #if PY_MAJOR_VERSION < 3
136660   0, /*nb_coerce*/
136661   #endif
136662   0, /*nb_int*/
136663   #if PY_MAJOR_VERSION >= 3
136664   0, /*reserved*/
136665   #else
136666   0, /*nb_long*/
136667   #endif
136668   0, /*nb_float*/
136669   #if PY_MAJOR_VERSION < 3
136670   0, /*nb_oct*/
136671   #endif
136672   #if PY_MAJOR_VERSION < 3
136673   0, /*nb_hex*/
136674   #endif
136675   0, /*nb_inplace_add*/
136676   0, /*nb_inplace_subtract*/
136677   0, /*nb_inplace_multiply*/
136678   #if PY_MAJOR_VERSION < 3
136679   0, /*nb_inplace_divide*/
136680   #endif
136681   0, /*nb_inplace_remainder*/
136682   0, /*nb_inplace_power*/
136683   0, /*nb_inplace_lshift*/
136684   0, /*nb_inplace_rshift*/
136685   0, /*nb_inplace_and*/
136686   0, /*nb_inplace_xor*/
136687   0, /*nb_inplace_or*/
136688   0, /*nb_floor_divide*/
136689   0, /*nb_true_divide*/
136690   0, /*nb_inplace_floor_divide*/
136691   0, /*nb_inplace_true_divide*/
136692   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
136693   0, /*nb_index*/
136694   #endif
136695 };
136696
136697 static PySequenceMethods __pyx_tp_as_sequence__XSLTProcessingInstruction = {
136698   0, /*sq_length*/
136699   0, /*sq_concat*/
136700   0, /*sq_repeat*/
136701   0, /*sq_item*/
136702   0, /*sq_slice*/
136703   0, /*sq_ass_item*/
136704   0, /*sq_ass_slice*/
136705   0, /*sq_contains*/
136706   0, /*sq_inplace_concat*/
136707   0, /*sq_inplace_repeat*/
136708 };
136709
136710 static PyMappingMethods __pyx_tp_as_mapping__XSLTProcessingInstruction = {
136711   0, /*mp_length*/
136712   0, /*mp_subscript*/
136713   0, /*mp_ass_subscript*/
136714 };
136715
136716 static PyBufferProcs __pyx_tp_as_buffer__XSLTProcessingInstruction = {
136717   #if PY_MAJOR_VERSION < 3
136718   0, /*bf_getreadbuffer*/
136719   #endif
136720   #if PY_MAJOR_VERSION < 3
136721   0, /*bf_getwritebuffer*/
136722   #endif
136723   #if PY_MAJOR_VERSION < 3
136724   0, /*bf_getsegcount*/
136725   #endif
136726   #if PY_MAJOR_VERSION < 3
136727   0, /*bf_getcharbuffer*/
136728   #endif
136729   #if PY_VERSION_HEX >= 0x02060000
136730   0, /*bf_getbuffer*/
136731   #endif
136732   #if PY_VERSION_HEX >= 0x02060000
136733   0, /*bf_releasebuffer*/
136734   #endif
136735 };
136736
136737 PyTypeObject __pyx_type_4lxml_5etree__XSLTProcessingInstruction = {
136738   PyVarObject_HEAD_INIT(0, 0)
136739   __Pyx_NAMESTR("lxml.etree._XSLTProcessingInstruction"), /*tp_name*/
136740   sizeof(struct __pyx_obj_4lxml_5etree__XSLTProcessingInstruction), /*tp_basicsize*/
136741   0, /*tp_itemsize*/
136742   __pyx_tp_dealloc_4lxml_5etree__Element, /*tp_dealloc*/
136743   0, /*tp_print*/
136744   0, /*tp_getattr*/
136745   0, /*tp_setattr*/
136746   0, /*tp_compare*/
136747   0, /*tp_repr*/
136748   &__pyx_tp_as_number__XSLTProcessingInstruction, /*tp_as_number*/
136749   &__pyx_tp_as_sequence__XSLTProcessingInstruction, /*tp_as_sequence*/
136750   &__pyx_tp_as_mapping__XSLTProcessingInstruction, /*tp_as_mapping*/
136751   0, /*tp_hash*/
136752   0, /*tp_call*/
136753   0, /*tp_str*/
136754   0, /*tp_getattro*/
136755   0, /*tp_setattro*/
136756   &__pyx_tp_as_buffer__XSLTProcessingInstruction, /*tp_as_buffer*/
136757   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
136758   0, /*tp_doc*/
136759   __pyx_tp_traverse_4lxml_5etree__Element, /*tp_traverse*/
136760   __pyx_tp_clear_4lxml_5etree__Element, /*tp_clear*/
136761   0, /*tp_richcompare*/
136762   0, /*tp_weaklistoffset*/
136763   0, /*tp_iter*/
136764   0, /*tp_iternext*/
136765   __pyx_methods_4lxml_5etree__XSLTProcessingInstruction, /*tp_methods*/
136766   0, /*tp_members*/
136767   0, /*tp_getset*/
136768   0, /*tp_base*/
136769   0, /*tp_dict*/
136770   0, /*tp_descr_get*/
136771   0, /*tp_descr_set*/
136772   0, /*tp_dictoffset*/
136773   0, /*tp_init*/
136774   0, /*tp_alloc*/
136775   __pyx_tp_new_4lxml_5etree__XSLTProcessingInstruction, /*tp_new*/
136776   0, /*tp_free*/
136777   0, /*tp_is_gc*/
136778   0, /*tp_bases*/
136779   0, /*tp_mro*/
136780   0, /*tp_cache*/
136781   0, /*tp_subclasses*/
136782   0, /*tp_weaklist*/
136783 };
136784
136785 static PyObject *__pyx_tp_new_4lxml_5etree_XSLTExtension(PyTypeObject *t, PyObject *a, PyObject *k) {
136786   PyObject *o = (*t->tp_alloc)(t, 0);
136787   if (!o) return 0;
136788   return o;
136789 }
136790
136791 static void __pyx_tp_dealloc_4lxml_5etree_XSLTExtension(PyObject *o) {
136792   (*Py_TYPE(o)->tp_free)(o);
136793 }
136794
136795 static struct PyMethodDef __pyx_methods_4lxml_5etree_XSLTExtension[] = {
136796   {__Pyx_NAMESTR("execute"), (PyCFunction)__pyx_pf_4lxml_5etree_13XSLTExtension_execute, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_13XSLTExtension_execute)},
136797   {__Pyx_NAMESTR("apply_templates"), (PyCFunction)__pyx_pf_4lxml_5etree_13XSLTExtension_apply_templates, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_13XSLTExtension_apply_templates)},
136798   {0, 0, 0, 0}
136799 };
136800
136801 static PyNumberMethods __pyx_tp_as_number_XSLTExtension = {
136802   0, /*nb_add*/
136803   0, /*nb_subtract*/
136804   0, /*nb_multiply*/
136805   #if PY_MAJOR_VERSION < 3
136806   0, /*nb_divide*/
136807   #endif
136808   0, /*nb_remainder*/
136809   0, /*nb_divmod*/
136810   0, /*nb_power*/
136811   0, /*nb_negative*/
136812   0, /*nb_positive*/
136813   0, /*nb_absolute*/
136814   0, /*nb_nonzero*/
136815   0, /*nb_invert*/
136816   0, /*nb_lshift*/
136817   0, /*nb_rshift*/
136818   0, /*nb_and*/
136819   0, /*nb_xor*/
136820   0, /*nb_or*/
136821   #if PY_MAJOR_VERSION < 3
136822   0, /*nb_coerce*/
136823   #endif
136824   0, /*nb_int*/
136825   #if PY_MAJOR_VERSION >= 3
136826   0, /*reserved*/
136827   #else
136828   0, /*nb_long*/
136829   #endif
136830   0, /*nb_float*/
136831   #if PY_MAJOR_VERSION < 3
136832   0, /*nb_oct*/
136833   #endif
136834   #if PY_MAJOR_VERSION < 3
136835   0, /*nb_hex*/
136836   #endif
136837   0, /*nb_inplace_add*/
136838   0, /*nb_inplace_subtract*/
136839   0, /*nb_inplace_multiply*/
136840   #if PY_MAJOR_VERSION < 3
136841   0, /*nb_inplace_divide*/
136842   #endif
136843   0, /*nb_inplace_remainder*/
136844   0, /*nb_inplace_power*/
136845   0, /*nb_inplace_lshift*/
136846   0, /*nb_inplace_rshift*/
136847   0, /*nb_inplace_and*/
136848   0, /*nb_inplace_xor*/
136849   0, /*nb_inplace_or*/
136850   0, /*nb_floor_divide*/
136851   0, /*nb_true_divide*/
136852   0, /*nb_inplace_floor_divide*/
136853   0, /*nb_inplace_true_divide*/
136854   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
136855   0, /*nb_index*/
136856   #endif
136857 };
136858
136859 static PySequenceMethods __pyx_tp_as_sequence_XSLTExtension = {
136860   0, /*sq_length*/
136861   0, /*sq_concat*/
136862   0, /*sq_repeat*/
136863   0, /*sq_item*/
136864   0, /*sq_slice*/
136865   0, /*sq_ass_item*/
136866   0, /*sq_ass_slice*/
136867   0, /*sq_contains*/
136868   0, /*sq_inplace_concat*/
136869   0, /*sq_inplace_repeat*/
136870 };
136871
136872 static PyMappingMethods __pyx_tp_as_mapping_XSLTExtension = {
136873   0, /*mp_length*/
136874   0, /*mp_subscript*/
136875   0, /*mp_ass_subscript*/
136876 };
136877
136878 static PyBufferProcs __pyx_tp_as_buffer_XSLTExtension = {
136879   #if PY_MAJOR_VERSION < 3
136880   0, /*bf_getreadbuffer*/
136881   #endif
136882   #if PY_MAJOR_VERSION < 3
136883   0, /*bf_getwritebuffer*/
136884   #endif
136885   #if PY_MAJOR_VERSION < 3
136886   0, /*bf_getsegcount*/
136887   #endif
136888   #if PY_MAJOR_VERSION < 3
136889   0, /*bf_getcharbuffer*/
136890   #endif
136891   #if PY_VERSION_HEX >= 0x02060000
136892   0, /*bf_getbuffer*/
136893   #endif
136894   #if PY_VERSION_HEX >= 0x02060000
136895   0, /*bf_releasebuffer*/
136896   #endif
136897 };
136898
136899 PyTypeObject __pyx_type_4lxml_5etree_XSLTExtension = {
136900   PyVarObject_HEAD_INIT(0, 0)
136901   __Pyx_NAMESTR("lxml.etree.XSLTExtension"), /*tp_name*/
136902   sizeof(struct __pyx_obj_4lxml_5etree_XSLTExtension), /*tp_basicsize*/
136903   0, /*tp_itemsize*/
136904   __pyx_tp_dealloc_4lxml_5etree_XSLTExtension, /*tp_dealloc*/
136905   0, /*tp_print*/
136906   0, /*tp_getattr*/
136907   0, /*tp_setattr*/
136908   0, /*tp_compare*/
136909   0, /*tp_repr*/
136910   &__pyx_tp_as_number_XSLTExtension, /*tp_as_number*/
136911   &__pyx_tp_as_sequence_XSLTExtension, /*tp_as_sequence*/
136912   &__pyx_tp_as_mapping_XSLTExtension, /*tp_as_mapping*/
136913   0, /*tp_hash*/
136914   0, /*tp_call*/
136915   0, /*tp_str*/
136916   0, /*tp_getattro*/
136917   0, /*tp_setattro*/
136918   &__pyx_tp_as_buffer_XSLTExtension, /*tp_as_buffer*/
136919   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
136920   __Pyx_DOCSTR("Base class of an XSLT extension element.\n    "), /*tp_doc*/
136921   0, /*tp_traverse*/
136922   0, /*tp_clear*/
136923   0, /*tp_richcompare*/
136924   0, /*tp_weaklistoffset*/
136925   0, /*tp_iter*/
136926   0, /*tp_iternext*/
136927   __pyx_methods_4lxml_5etree_XSLTExtension, /*tp_methods*/
136928   0, /*tp_members*/
136929   0, /*tp_getset*/
136930   0, /*tp_base*/
136931   0, /*tp_dict*/
136932   0, /*tp_descr_get*/
136933   0, /*tp_descr_set*/
136934   0, /*tp_dictoffset*/
136935   0, /*tp_init*/
136936   0, /*tp_alloc*/
136937   __pyx_tp_new_4lxml_5etree_XSLTExtension, /*tp_new*/
136938   0, /*tp_free*/
136939   0, /*tp_is_gc*/
136940   0, /*tp_bases*/
136941   0, /*tp_mro*/
136942   0, /*tp_cache*/
136943   0, /*tp_subclasses*/
136944   0, /*tp_weaklist*/
136945 };
136946
136947 static PyObject *__pyx_tp_new_4lxml_5etree_DTD(PyTypeObject *t, PyObject *a, PyObject *k) {
136948   PyObject *o = __pyx_tp_new_4lxml_5etree__Validator(t, a, k);
136949   if (!o) return 0;
136950   return o;
136951 }
136952
136953 static void __pyx_tp_dealloc_4lxml_5etree_DTD(PyObject *o) {
136954   {
136955     PyObject *etype, *eval, *etb;
136956     PyErr_Fetch(&etype, &eval, &etb);
136957     ++Py_REFCNT(o);
136958     __pyx_pf_4lxml_5etree_3DTD___dealloc__(o);
136959     if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
136960     --Py_REFCNT(o);
136961     PyErr_Restore(etype, eval, etb);
136962   }
136963   __pyx_tp_dealloc_4lxml_5etree__Validator(o);
136964 }
136965
136966 static struct PyMethodDef __pyx_methods_4lxml_5etree_DTD[] = {
136967   {__Pyx_NAMESTR("__call__"), (PyCFunction)__pyx_pf_4lxml_5etree_3DTD___call__, METH_VARARGS|METH_KEYWORDS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_3DTD___call__)},
136968   {0, 0, 0, 0}
136969 };
136970
136971 static PyNumberMethods __pyx_tp_as_number_DTD = {
136972   0, /*nb_add*/
136973   0, /*nb_subtract*/
136974   0, /*nb_multiply*/
136975   #if PY_MAJOR_VERSION < 3
136976   0, /*nb_divide*/
136977   #endif
136978   0, /*nb_remainder*/
136979   0, /*nb_divmod*/
136980   0, /*nb_power*/
136981   0, /*nb_negative*/
136982   0, /*nb_positive*/
136983   0, /*nb_absolute*/
136984   0, /*nb_nonzero*/
136985   0, /*nb_invert*/
136986   0, /*nb_lshift*/
136987   0, /*nb_rshift*/
136988   0, /*nb_and*/
136989   0, /*nb_xor*/
136990   0, /*nb_or*/
136991   #if PY_MAJOR_VERSION < 3
136992   0, /*nb_coerce*/
136993   #endif
136994   0, /*nb_int*/
136995   #if PY_MAJOR_VERSION >= 3
136996   0, /*reserved*/
136997   #else
136998   0, /*nb_long*/
136999   #endif
137000   0, /*nb_float*/
137001   #if PY_MAJOR_VERSION < 3
137002   0, /*nb_oct*/
137003   #endif
137004   #if PY_MAJOR_VERSION < 3
137005   0, /*nb_hex*/
137006   #endif
137007   0, /*nb_inplace_add*/
137008   0, /*nb_inplace_subtract*/
137009   0, /*nb_inplace_multiply*/
137010   #if PY_MAJOR_VERSION < 3
137011   0, /*nb_inplace_divide*/
137012   #endif
137013   0, /*nb_inplace_remainder*/
137014   0, /*nb_inplace_power*/
137015   0, /*nb_inplace_lshift*/
137016   0, /*nb_inplace_rshift*/
137017   0, /*nb_inplace_and*/
137018   0, /*nb_inplace_xor*/
137019   0, /*nb_inplace_or*/
137020   0, /*nb_floor_divide*/
137021   0, /*nb_true_divide*/
137022   0, /*nb_inplace_floor_divide*/
137023   0, /*nb_inplace_true_divide*/
137024   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
137025   0, /*nb_index*/
137026   #endif
137027 };
137028
137029 static PySequenceMethods __pyx_tp_as_sequence_DTD = {
137030   0, /*sq_length*/
137031   0, /*sq_concat*/
137032   0, /*sq_repeat*/
137033   0, /*sq_item*/
137034   0, /*sq_slice*/
137035   0, /*sq_ass_item*/
137036   0, /*sq_ass_slice*/
137037   0, /*sq_contains*/
137038   0, /*sq_inplace_concat*/
137039   0, /*sq_inplace_repeat*/
137040 };
137041
137042 static PyMappingMethods __pyx_tp_as_mapping_DTD = {
137043   0, /*mp_length*/
137044   0, /*mp_subscript*/
137045   0, /*mp_ass_subscript*/
137046 };
137047
137048 static PyBufferProcs __pyx_tp_as_buffer_DTD = {
137049   #if PY_MAJOR_VERSION < 3
137050   0, /*bf_getreadbuffer*/
137051   #endif
137052   #if PY_MAJOR_VERSION < 3
137053   0, /*bf_getwritebuffer*/
137054   #endif
137055   #if PY_MAJOR_VERSION < 3
137056   0, /*bf_getsegcount*/
137057   #endif
137058   #if PY_MAJOR_VERSION < 3
137059   0, /*bf_getcharbuffer*/
137060   #endif
137061   #if PY_VERSION_HEX >= 0x02060000
137062   0, /*bf_getbuffer*/
137063   #endif
137064   #if PY_VERSION_HEX >= 0x02060000
137065   0, /*bf_releasebuffer*/
137066   #endif
137067 };
137068
137069 PyTypeObject __pyx_type_4lxml_5etree_DTD = {
137070   PyVarObject_HEAD_INIT(0, 0)
137071   __Pyx_NAMESTR("lxml.etree.DTD"), /*tp_name*/
137072   sizeof(struct __pyx_obj_4lxml_5etree_DTD), /*tp_basicsize*/
137073   0, /*tp_itemsize*/
137074   __pyx_tp_dealloc_4lxml_5etree_DTD, /*tp_dealloc*/
137075   0, /*tp_print*/
137076   0, /*tp_getattr*/
137077   0, /*tp_setattr*/
137078   0, /*tp_compare*/
137079   0, /*tp_repr*/
137080   &__pyx_tp_as_number_DTD, /*tp_as_number*/
137081   &__pyx_tp_as_sequence_DTD, /*tp_as_sequence*/
137082   &__pyx_tp_as_mapping_DTD, /*tp_as_mapping*/
137083   0, /*tp_hash*/
137084   __pyx_pf_4lxml_5etree_3DTD___call__, /*tp_call*/
137085   0, /*tp_str*/
137086   0, /*tp_getattro*/
137087   0, /*tp_setattro*/
137088   &__pyx_tp_as_buffer_DTD, /*tp_as_buffer*/
137089   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
137090   __Pyx_DOCSTR("DTD(self, file=None, external_id=None)\n    A DTD validator.\n\n    Can load from filesystem directly given a filename or file-like object.\n    Alternatively, pass the keyword parameter ``external_id`` to load from a\n    catalog.\n    "), /*tp_doc*/
137091   __pyx_tp_traverse_4lxml_5etree__Validator, /*tp_traverse*/
137092   __pyx_tp_clear_4lxml_5etree__Validator, /*tp_clear*/
137093   0, /*tp_richcompare*/
137094   0, /*tp_weaklistoffset*/
137095   0, /*tp_iter*/
137096   0, /*tp_iternext*/
137097   __pyx_methods_4lxml_5etree_DTD, /*tp_methods*/
137098   0, /*tp_members*/
137099   0, /*tp_getset*/
137100   0, /*tp_base*/
137101   0, /*tp_dict*/
137102   0, /*tp_descr_get*/
137103   0, /*tp_descr_set*/
137104   0, /*tp_dictoffset*/
137105   __pyx_pf_4lxml_5etree_3DTD___init__, /*tp_init*/
137106   0, /*tp_alloc*/
137107   __pyx_tp_new_4lxml_5etree_DTD, /*tp_new*/
137108   0, /*tp_free*/
137109   0, /*tp_is_gc*/
137110   0, /*tp_bases*/
137111   0, /*tp_mro*/
137112   0, /*tp_cache*/
137113   0, /*tp_subclasses*/
137114   0, /*tp_weaklist*/
137115 };
137116
137117 static PyObject *__pyx_tp_new_4lxml_5etree_RelaxNG(PyTypeObject *t, PyObject *a, PyObject *k) {
137118   PyObject *o = __pyx_tp_new_4lxml_5etree__Validator(t, a, k);
137119   if (!o) return 0;
137120   return o;
137121 }
137122
137123 static void __pyx_tp_dealloc_4lxml_5etree_RelaxNG(PyObject *o) {
137124   {
137125     PyObject *etype, *eval, *etb;
137126     PyErr_Fetch(&etype, &eval, &etb);
137127     ++Py_REFCNT(o);
137128     __pyx_pf_4lxml_5etree_7RelaxNG___dealloc__(o);
137129     if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
137130     --Py_REFCNT(o);
137131     PyErr_Restore(etype, eval, etb);
137132   }
137133   __pyx_tp_dealloc_4lxml_5etree__Validator(o);
137134 }
137135
137136 static struct PyMethodDef __pyx_methods_4lxml_5etree_RelaxNG[] = {
137137   {__Pyx_NAMESTR("__call__"), (PyCFunction)__pyx_pf_4lxml_5etree_7RelaxNG___call__, METH_VARARGS|METH_KEYWORDS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_7RelaxNG___call__)},
137138   {0, 0, 0, 0}
137139 };
137140
137141 static PyNumberMethods __pyx_tp_as_number_RelaxNG = {
137142   0, /*nb_add*/
137143   0, /*nb_subtract*/
137144   0, /*nb_multiply*/
137145   #if PY_MAJOR_VERSION < 3
137146   0, /*nb_divide*/
137147   #endif
137148   0, /*nb_remainder*/
137149   0, /*nb_divmod*/
137150   0, /*nb_power*/
137151   0, /*nb_negative*/
137152   0, /*nb_positive*/
137153   0, /*nb_absolute*/
137154   0, /*nb_nonzero*/
137155   0, /*nb_invert*/
137156   0, /*nb_lshift*/
137157   0, /*nb_rshift*/
137158   0, /*nb_and*/
137159   0, /*nb_xor*/
137160   0, /*nb_or*/
137161   #if PY_MAJOR_VERSION < 3
137162   0, /*nb_coerce*/
137163   #endif
137164   0, /*nb_int*/
137165   #if PY_MAJOR_VERSION >= 3
137166   0, /*reserved*/
137167   #else
137168   0, /*nb_long*/
137169   #endif
137170   0, /*nb_float*/
137171   #if PY_MAJOR_VERSION < 3
137172   0, /*nb_oct*/
137173   #endif
137174   #if PY_MAJOR_VERSION < 3
137175   0, /*nb_hex*/
137176   #endif
137177   0, /*nb_inplace_add*/
137178   0, /*nb_inplace_subtract*/
137179   0, /*nb_inplace_multiply*/
137180   #if PY_MAJOR_VERSION < 3
137181   0, /*nb_inplace_divide*/
137182   #endif
137183   0, /*nb_inplace_remainder*/
137184   0, /*nb_inplace_power*/
137185   0, /*nb_inplace_lshift*/
137186   0, /*nb_inplace_rshift*/
137187   0, /*nb_inplace_and*/
137188   0, /*nb_inplace_xor*/
137189   0, /*nb_inplace_or*/
137190   0, /*nb_floor_divide*/
137191   0, /*nb_true_divide*/
137192   0, /*nb_inplace_floor_divide*/
137193   0, /*nb_inplace_true_divide*/
137194   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
137195   0, /*nb_index*/
137196   #endif
137197 };
137198
137199 static PySequenceMethods __pyx_tp_as_sequence_RelaxNG = {
137200   0, /*sq_length*/
137201   0, /*sq_concat*/
137202   0, /*sq_repeat*/
137203   0, /*sq_item*/
137204   0, /*sq_slice*/
137205   0, /*sq_ass_item*/
137206   0, /*sq_ass_slice*/
137207   0, /*sq_contains*/
137208   0, /*sq_inplace_concat*/
137209   0, /*sq_inplace_repeat*/
137210 };
137211
137212 static PyMappingMethods __pyx_tp_as_mapping_RelaxNG = {
137213   0, /*mp_length*/
137214   0, /*mp_subscript*/
137215   0, /*mp_ass_subscript*/
137216 };
137217
137218 static PyBufferProcs __pyx_tp_as_buffer_RelaxNG = {
137219   #if PY_MAJOR_VERSION < 3
137220   0, /*bf_getreadbuffer*/
137221   #endif
137222   #if PY_MAJOR_VERSION < 3
137223   0, /*bf_getwritebuffer*/
137224   #endif
137225   #if PY_MAJOR_VERSION < 3
137226   0, /*bf_getsegcount*/
137227   #endif
137228   #if PY_MAJOR_VERSION < 3
137229   0, /*bf_getcharbuffer*/
137230   #endif
137231   #if PY_VERSION_HEX >= 0x02060000
137232   0, /*bf_getbuffer*/
137233   #endif
137234   #if PY_VERSION_HEX >= 0x02060000
137235   0, /*bf_releasebuffer*/
137236   #endif
137237 };
137238
137239 PyTypeObject __pyx_type_4lxml_5etree_RelaxNG = {
137240   PyVarObject_HEAD_INIT(0, 0)
137241   __Pyx_NAMESTR("lxml.etree.RelaxNG"), /*tp_name*/
137242   sizeof(struct __pyx_obj_4lxml_5etree_RelaxNG), /*tp_basicsize*/
137243   0, /*tp_itemsize*/
137244   __pyx_tp_dealloc_4lxml_5etree_RelaxNG, /*tp_dealloc*/
137245   0, /*tp_print*/
137246   0, /*tp_getattr*/
137247   0, /*tp_setattr*/
137248   0, /*tp_compare*/
137249   0, /*tp_repr*/
137250   &__pyx_tp_as_number_RelaxNG, /*tp_as_number*/
137251   &__pyx_tp_as_sequence_RelaxNG, /*tp_as_sequence*/
137252   &__pyx_tp_as_mapping_RelaxNG, /*tp_as_mapping*/
137253   0, /*tp_hash*/
137254   __pyx_pf_4lxml_5etree_7RelaxNG___call__, /*tp_call*/
137255   0, /*tp_str*/
137256   0, /*tp_getattro*/
137257   0, /*tp_setattro*/
137258   &__pyx_tp_as_buffer_RelaxNG, /*tp_as_buffer*/
137259   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
137260   __Pyx_DOCSTR("RelaxNG(self, etree=None, file=None)\n    Turn a document into a Relax NG validator.\n\n    Either pass a schema as Element or ElementTree, or pass a file or\n    filename through the ``file`` keyword argument.\n    "), /*tp_doc*/
137261   __pyx_tp_traverse_4lxml_5etree__Validator, /*tp_traverse*/
137262   __pyx_tp_clear_4lxml_5etree__Validator, /*tp_clear*/
137263   0, /*tp_richcompare*/
137264   0, /*tp_weaklistoffset*/
137265   0, /*tp_iter*/
137266   0, /*tp_iternext*/
137267   __pyx_methods_4lxml_5etree_RelaxNG, /*tp_methods*/
137268   0, /*tp_members*/
137269   0, /*tp_getset*/
137270   0, /*tp_base*/
137271   0, /*tp_dict*/
137272   0, /*tp_descr_get*/
137273   0, /*tp_descr_set*/
137274   0, /*tp_dictoffset*/
137275   __pyx_pf_4lxml_5etree_7RelaxNG___init__, /*tp_init*/
137276   0, /*tp_alloc*/
137277   __pyx_tp_new_4lxml_5etree_RelaxNG, /*tp_new*/
137278   0, /*tp_free*/
137279   0, /*tp_is_gc*/
137280   0, /*tp_bases*/
137281   0, /*tp_mro*/
137282   0, /*tp_cache*/
137283   0, /*tp_subclasses*/
137284   0, /*tp_weaklist*/
137285 };
137286
137287 static PyObject *__pyx_tp_new_4lxml_5etree_Schematron(PyTypeObject *t, PyObject *a, PyObject *k) {
137288   PyObject *o = __pyx_tp_new_4lxml_5etree__Validator(t, a, k);
137289   if (!o) return 0;
137290   return o;
137291 }
137292
137293 static void __pyx_tp_dealloc_4lxml_5etree_Schematron(PyObject *o) {
137294   {
137295     PyObject *etype, *eval, *etb;
137296     PyErr_Fetch(&etype, &eval, &etb);
137297     ++Py_REFCNT(o);
137298     __pyx_pf_4lxml_5etree_10Schematron___dealloc__(o);
137299     if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
137300     --Py_REFCNT(o);
137301     PyErr_Restore(etype, eval, etb);
137302   }
137303   __pyx_tp_dealloc_4lxml_5etree__Validator(o);
137304 }
137305
137306 static struct PyMethodDef __pyx_methods_4lxml_5etree_Schematron[] = {
137307   {__Pyx_NAMESTR("__call__"), (PyCFunction)__pyx_pf_4lxml_5etree_10Schematron___call__, METH_VARARGS|METH_KEYWORDS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_10Schematron___call__)},
137308   {0, 0, 0, 0}
137309 };
137310
137311 static PyNumberMethods __pyx_tp_as_number_Schematron = {
137312   0, /*nb_add*/
137313   0, /*nb_subtract*/
137314   0, /*nb_multiply*/
137315   #if PY_MAJOR_VERSION < 3
137316   0, /*nb_divide*/
137317   #endif
137318   0, /*nb_remainder*/
137319   0, /*nb_divmod*/
137320   0, /*nb_power*/
137321   0, /*nb_negative*/
137322   0, /*nb_positive*/
137323   0, /*nb_absolute*/
137324   0, /*nb_nonzero*/
137325   0, /*nb_invert*/
137326   0, /*nb_lshift*/
137327   0, /*nb_rshift*/
137328   0, /*nb_and*/
137329   0, /*nb_xor*/
137330   0, /*nb_or*/
137331   #if PY_MAJOR_VERSION < 3
137332   0, /*nb_coerce*/
137333   #endif
137334   0, /*nb_int*/
137335   #if PY_MAJOR_VERSION >= 3
137336   0, /*reserved*/
137337   #else
137338   0, /*nb_long*/
137339   #endif
137340   0, /*nb_float*/
137341   #if PY_MAJOR_VERSION < 3
137342   0, /*nb_oct*/
137343   #endif
137344   #if PY_MAJOR_VERSION < 3
137345   0, /*nb_hex*/
137346   #endif
137347   0, /*nb_inplace_add*/
137348   0, /*nb_inplace_subtract*/
137349   0, /*nb_inplace_multiply*/
137350   #if PY_MAJOR_VERSION < 3
137351   0, /*nb_inplace_divide*/
137352   #endif
137353   0, /*nb_inplace_remainder*/
137354   0, /*nb_inplace_power*/
137355   0, /*nb_inplace_lshift*/
137356   0, /*nb_inplace_rshift*/
137357   0, /*nb_inplace_and*/
137358   0, /*nb_inplace_xor*/
137359   0, /*nb_inplace_or*/
137360   0, /*nb_floor_divide*/
137361   0, /*nb_true_divide*/
137362   0, /*nb_inplace_floor_divide*/
137363   0, /*nb_inplace_true_divide*/
137364   #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
137365   0, /*nb_index*/
137366   #endif
137367 };
137368
137369 static PySequenceMethods __pyx_tp_as_sequence_Schematron = {
137370   0, /*sq_length*/
137371   0, /*sq_concat*/
137372   0, /*sq_repeat*/
137373   0, /*sq_item*/
137374   0, /*sq_slice*/
137375   0, /*sq_ass_item*/
137376   0, /*sq_ass_slice*/
137377   0, /*sq_contains*/
137378   0, /*sq_inplace_concat*/
137379   0, /*sq_inplace_repeat*/
137380 };
137381
137382 static PyMappingMethods __pyx_tp_as_mapping_Schematron = {
137383   0, /*mp_length*/
137384   0, /*mp_subscript*/
137385   0, /*mp_ass_subscript*/
137386 };
137387
137388 static PyBufferProcs __pyx_tp_as_buffer_Schematron = {
137389   #if PY_MAJOR_VERSION < 3
137390   0, /*bf_getreadbuffer*/
137391   #endif
137392   #if PY_MAJOR_VERSION < 3
137393   0, /*bf_getwritebuffer*/
137394   #endif
137395   #if PY_MAJOR_VERSION < 3
137396   0, /*bf_getsegcount*/
137397   #endif
137398   #if PY_MAJOR_VERSION < 3
137399   0, /*bf_getcharbuffer*/
137400   #endif
137401   #if PY_VERSION_HEX >= 0x02060000
137402   0, /*bf_getbuffer*/
137403   #endif
137404   #if PY_VERSION_HEX >= 0x02060000
137405   0, /*bf_releasebuffer*/
137406   #endif
137407 };
137408
137409 PyTypeObject __pyx_type_4lxml_5etree_Schematron = {
137410   PyVarObject_HEAD_INIT(0, 0)
137411   __Pyx_NAMESTR("lxml.etree.Schematron"), /*tp_name*/
137412   sizeof(struct __pyx_obj_4lxml_5etree_Schematron), /*tp_basicsize*/
137413   0, /*tp_itemsize*/
137414   __pyx_tp_dealloc_4lxml_5etree_Schematron, /*tp_dealloc*/
137415   0, /*tp_print*/
137416   0, /*tp_getattr*/
137417   0, /*tp_setattr*/
137418   0, /*tp_compare*/
137419   0, /*tp_repr*/
137420   &__pyx_tp_as_number_Schematron, /*tp_as_number*/
137421   &__pyx_tp_as_sequence_Schematron, /*tp_as_sequence*/
137422   &__pyx_tp_as_mapping_Schematron, /*tp_as_mapping*/
137423   0, /*tp_hash*/
137424   __pyx_pf_4lxml_5etree_10Schematron___call__, /*tp_call*/
137425   0, /*tp_str*/
137426   0, /*tp_getattro*/
137427   0, /*tp_setattro*/
137428   &__pyx_tp_as_buffer_Schematron, /*tp_as_buffer*/
137429   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
137430   __Pyx_DOCSTR("Schematron(self, etree=None, file=None)\n    A Schematron validator.\n\n    Pass a root Element or an ElementTree to turn it into a validator.\n    Alternatively, pass a filename as keyword argument 'file' to parse from\n    the file system.\n\n    Schematron is a less well known, but very powerful schema language.  The main\n    idea is to use the capabilities of XPath to put restrictions on the structure\n    and the content of XML documents.  Here is a simple example::\n\n      >>> schematron = etree.Schematron(etree.XML('''\n      ... <schema xmlns=\"http://www.ascc.net/xml/schematron\" >\n      ...   <pattern name=\"id is the only permited attribute name\">\n      ...     <rule context=\"*\">\n      ...       <report test=\"@*[not(name()='id')]\">Attribute\n      ...         <name path=\"@*[not(name()='id')]\"/> is forbidden<name/>\n      ...       </report>\n      ...     </rule>\n      ...   </pattern>\n      ... </schema>\n      ... '''))\n\n      >>> xml = etree.XML('''\n      ... <AAA name=\"aaa\">\n      ...   <BBB id=\"bbb\"/>\n      ...   <CCC color=\"ccc\"/>\n      ... </AAA>\n      ... ''')\n\n      >>> schematron.validate(xml)\n      0\n\n      >>> xml = etree.XML('''\n      ... <AAA id=\"aaa\">\n      ...   <BBB id=\"bbb\"/>\n      ...   <CCC/>\n      ... </AAA>\n      ... ''')\n\n      >>> schematron.validate(xml)\n      1\n\n    Schematron was added to libxml2 in version 2.6.21.  Before version 2.6.32,\n    however, Schematron lacked support for error reporting other than to stderr.\n    This version is therefore required to retrieve validation warnings and\n    errors in lxml.\n    "), /*tp_doc*/
137431   __pyx_tp_traverse_4lxml_5etree__Validator, /*tp_traverse*/
137432   __pyx_tp_clear_4lxml_5etree__Validator, /*tp_clear*/
137433   0, /*tp_richcompare*/
137434   0, /*tp_weaklistoffset*/
137435   0, /*tp_iter*/
137436   0, /*tp_iternext*/
137437   __pyx_methods_4lxml_5etree_Schematron, /*tp_methods*/
137438   0, /*tp_members*/
137439   0, /*tp_getset*/
137440   0, /*tp_base*/
137441   0, /*tp_dict*/
137442   0, /*tp_descr_get*/
137443   0, /*tp_descr_set*/
137444   0, /*tp_dictoffset*/
137445   __pyx_pf_4lxml_5etree_10Schematron___init__, /*tp_init*/
137446   0, /*tp_alloc*/
137447   __pyx_tp_new_4lxml_5etree_Schematron, /*tp_new*/
137448   0, /*tp_free*/
137449   0, /*tp_is_gc*/
137450   0, /*tp_bases*/
137451   0, /*tp_mro*/
137452   0, /*tp_cache*/
137453   0, /*tp_subclasses*/
137454   0, /*tp_weaklist*/
137455 };
137456
137457 static struct PyMethodDef __pyx_methods[] = {
137458   {__Pyx_NAMESTR("clear_error_log"), (PyCFunction)__pyx_pf_4lxml_5etree_clear_error_log, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_clear_error_log)},
137459   {__Pyx_NAMESTR("use_global_python_log"), (PyCFunction)__pyx_pf_4lxml_5etree_use_global_python_log, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_use_global_python_log)},
137460   {__Pyx_NAMESTR("Element"), (PyCFunction)__pyx_pf_4lxml_5etree_Element, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_Element)},
137461   {__Pyx_NAMESTR("Comment"), (PyCFunction)__pyx_pf_4lxml_5etree_Comment, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_Comment)},
137462   {__Pyx_NAMESTR("ProcessingInstruction"), (PyCFunction)__pyx_pf_4lxml_5etree_ProcessingInstruction, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_ProcessingInstruction)},
137463   {__Pyx_NAMESTR("Entity"), (PyCFunction)__pyx_pf_4lxml_5etree_Entity, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_Entity)},
137464   {__Pyx_NAMESTR("SubElement"), (PyCFunction)__pyx_pf_4lxml_5etree_SubElement, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_SubElement)},
137465   {__Pyx_NAMESTR("ElementTree"), (PyCFunction)__pyx_pf_4lxml_5etree_ElementTree, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_ElementTree)},
137466   {__Pyx_NAMESTR("HTML"), (PyCFunction)__pyx_pf_4lxml_5etree_HTML, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_HTML)},
137467   {__Pyx_NAMESTR("XML"), (PyCFunction)__pyx_pf_4lxml_5etree_XML, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_XML)},
137468   {__Pyx_NAMESTR("fromstring"), (PyCFunction)__pyx_pf_4lxml_5etree_fromstring, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_fromstring)},
137469   {__Pyx_NAMESTR("fromstringlist"), (PyCFunction)__pyx_pf_4lxml_5etree_fromstringlist, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_fromstringlist)},
137470   {__Pyx_NAMESTR("iselement"), (PyCFunction)__pyx_pf_4lxml_5etree_iselement, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_iselement)},
137471   {__Pyx_NAMESTR("dump"), (PyCFunction)__pyx_pf_4lxml_5etree_dump, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_dump)},
137472   {__Pyx_NAMESTR("tostring"), (PyCFunction)__pyx_pf_4lxml_5etree_tostring, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_tostring)},
137473   {__Pyx_NAMESTR("tostringlist"), (PyCFunction)__pyx_pf_4lxml_5etree_tostringlist, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_tostringlist)},
137474   {__Pyx_NAMESTR("tounicode"), (PyCFunction)__pyx_pf_4lxml_5etree_tounicode, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_tounicode)},
137475   {__Pyx_NAMESTR("parse"), (PyCFunction)__pyx_pf_4lxml_5etree_parse, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_parse)},
137476   {__Pyx_NAMESTR("set_element_class_lookup"), (PyCFunction)__pyx_pf_4lxml_5etree_set_element_class_lookup, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_set_element_class_lookup)},
137477   {__Pyx_NAMESTR("FunctionNamespace"), (PyCFunction)__pyx_pf_4lxml_5etree_FunctionNamespace, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_FunctionNamespace)},
137478   {__Pyx_NAMESTR("set_default_parser"), (PyCFunction)__pyx_pf_4lxml_5etree_set_default_parser, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_set_default_parser)},
137479   {__Pyx_NAMESTR("get_default_parser"), (PyCFunction)__pyx_pf_4lxml_5etree_get_default_parser, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_get_default_parser)},
137480   {__Pyx_NAMESTR("XMLID"), (PyCFunction)__pyx_pf_4lxml_5etree_XMLID, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_XMLID)},
137481   {__Pyx_NAMESTR("XMLDTDID"), (PyCFunction)__pyx_pf_4lxml_5etree_XMLDTDID, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_XMLDTDID)},
137482   {__Pyx_NAMESTR("parseid"), (PyCFunction)__pyx_pf_4lxml_5etree_parseid, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_parseid)},
137483   {__Pyx_NAMESTR("cleanup_namespaces"), (PyCFunction)__pyx_pf_4lxml_5etree_cleanup_namespaces, METH_O, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_cleanup_namespaces)},
137484   {__Pyx_NAMESTR("strip_attributes"), (PyCFunction)__pyx_pf_4lxml_5etree_strip_attributes, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_strip_attributes)},
137485   {__Pyx_NAMESTR("strip_elements"), (PyCFunction)__pyx_pf_4lxml_5etree_strip_elements, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_strip_elements)},
137486   {__Pyx_NAMESTR("strip_tags"), (PyCFunction)__pyx_pf_4lxml_5etree_strip_tags, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_strip_tags)},
137487   {__Pyx_NAMESTR("Extension"), (PyCFunction)__pyx_pf_4lxml_5etree_Extension, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_Extension)},
137488   {__Pyx_NAMESTR("XPathEvaluator"), (PyCFunction)__pyx_pf_4lxml_5etree_XPathEvaluator, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_4lxml_5etree_XPathEvaluator)},
137489   {0, 0, 0, 0}
137490 };
137491
137492 static void __pyx_init_filenames(void); /*proto*/
137493
137494 #if PY_MAJOR_VERSION >= 3
137495 static struct PyModuleDef __pyx_moduledef = {
137496     PyModuleDef_HEAD_INIT,
137497     __Pyx_NAMESTR("etree"),
137498     __Pyx_DOCSTR(__pyx_mdoc), /* m_doc */
137499     -1, /* m_size */
137500     __pyx_methods /* m_methods */,
137501     NULL, /* m_reload */
137502     NULL, /* m_traverse */
137503     NULL, /* m_clear */
137504     NULL /* m_free */
137505 };
137506 #endif
137507
137508 static __Pyx_StringTabEntry __pyx_string_tab[] = {
137509   {&__pyx_kp___main__, __pyx_k___main__, sizeof(__pyx_k___main__), 1, 1, 1},
137510   {&__pyx_kp___init__, __pyx_k___init__, sizeof(__pyx_k___init__), 1, 1, 1},
137511   {&__pyx_kp___repr__, __pyx_k___repr__, sizeof(__pyx_k___repr__), 1, 1, 1},
137512   {&__pyx_kp_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 1, 1, 1},
137513   {&__pyx_kp___iter__, __pyx_k___iter__, sizeof(__pyx_k___iter__), 1, 1, 1},
137514   {&__pyx_kp___getitem__, __pyx_k___getitem__, sizeof(__pyx_k___getitem__), 1, 1, 1},
137515   {&__pyx_kp___len__, __pyx_k___len__, sizeof(__pyx_k___len__), 1, 1, 1},
137516   {&__pyx_kp___contains__, __pyx_k___contains__, sizeof(__pyx_k___contains__), 1, 1, 1},
137517   {&__pyx_kp___nonzero__, __pyx_k___nonzero__, sizeof(__pyx_k___nonzero__), 1, 1, 1},
137518   {&__pyx_kp_filter_domains, __pyx_k_filter_domains, sizeof(__pyx_k_filter_domains), 1, 1, 1},
137519   {&__pyx_kp_filter_types, __pyx_k_filter_types, sizeof(__pyx_k_filter_types), 1, 1, 1},
137520   {&__pyx_kp_filter_levels, __pyx_k_filter_levels, sizeof(__pyx_k_filter_levels), 1, 1, 1},
137521   {&__pyx_kp_filter_from_level, __pyx_k_filter_from_level, sizeof(__pyx_k_filter_from_level), 1, 1, 1},
137522   {&__pyx_kp_filter_from_fatals, __pyx_k_filter_from_fatals, sizeof(__pyx_k_filter_from_fatals), 1, 1, 1},
137523   {&__pyx_kp_filter_from_errors, __pyx_k_filter_from_errors, sizeof(__pyx_k_filter_from_errors), 1, 1, 1},
137524   {&__pyx_kp_1, __pyx_k_1, sizeof(__pyx_k_1), 1, 1, 1},
137525   {&__pyx_kp_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 1, 1, 1},
137526   {&__pyx_kp_receive, __pyx_k_receive, sizeof(__pyx_k_receive), 1, 1, 1},
137527   {&__pyx_kp_log, __pyx_k_log, sizeof(__pyx_k_log), 1, 1, 1},
137528   {&__pyx_kp___dealloc__, __pyx_k___dealloc__, sizeof(__pyx_k___dealloc__), 1, 1, 1},
137529   {&__pyx_kp__init, __pyx_k__init, sizeof(__pyx_k__init), 1, 1, 1},
137530   {&__pyx_kp___setitem__, __pyx_k___setitem__, sizeof(__pyx_k___setitem__), 1, 1, 1},
137531   {&__pyx_kp___delitem__, __pyx_k___delitem__, sizeof(__pyx_k___delitem__), 1, 1, 1},
137532   {&__pyx_kp___deepcopy__, __pyx_k___deepcopy__, sizeof(__pyx_k___deepcopy__), 1, 1, 1},
137533   {&__pyx_kp___copy__, __pyx_k___copy__, sizeof(__pyx_k___copy__), 1, 1, 1},
137534   {&__pyx_kp_set, __pyx_k_set, sizeof(__pyx_k_set), 1, 1, 1},
137535   {&__pyx_kp_append, __pyx_k_append, sizeof(__pyx_k_append), 1, 1, 1},
137536   {&__pyx_kp_addnext, __pyx_k_addnext, sizeof(__pyx_k_addnext), 1, 1, 1},
137537   {&__pyx_kp_addprevious, __pyx_k_addprevious, sizeof(__pyx_k_addprevious), 1, 1, 1},
137538   {&__pyx_kp_extend, __pyx_k_extend, sizeof(__pyx_k_extend), 1, 1, 1},
137539   {&__pyx_kp_insert, __pyx_k_insert, sizeof(__pyx_k_insert), 1, 1, 1},
137540   {&__pyx_kp_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 1, 1, 1},
137541   {&__pyx_kp_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 1, 1, 1},
137542   {&__pyx_kp___reversed__, __pyx_k___reversed__, sizeof(__pyx_k___reversed__), 1, 1, 1},
137543   {&__pyx_kp_index, __pyx_k_index, sizeof(__pyx_k_index), 1, 1, 1},
137544   {&__pyx_kp_get, __pyx_k_get, sizeof(__pyx_k_get), 1, 1, 1},
137545   {&__pyx_kp_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 1, 1, 1},
137546   {&__pyx_kp_values, __pyx_k_values, sizeof(__pyx_k_values), 1, 1, 1},
137547   {&__pyx_kp_items, __pyx_k_items, sizeof(__pyx_k_items), 1, 1, 1},
137548   {&__pyx_kp_getchildren, __pyx_k_getchildren, sizeof(__pyx_k_getchildren), 1, 1, 1},
137549   {&__pyx_kp_getparent, __pyx_k_getparent, sizeof(__pyx_k_getparent), 1, 1, 1},
137550   {&__pyx_kp_getnext, __pyx_k_getnext, sizeof(__pyx_k_getnext), 1, 1, 1},
137551   {&__pyx_kp_getprevious, __pyx_k_getprevious, sizeof(__pyx_k_getprevious), 1, 1, 1},
137552   {&__pyx_kp_itersiblings, __pyx_k_itersiblings, sizeof(__pyx_k_itersiblings), 1, 1, 1},
137553   {&__pyx_kp_iterancestors, __pyx_k_iterancestors, sizeof(__pyx_k_iterancestors), 1, 1, 1},
137554   {&__pyx_kp_iterdescendants, __pyx_k_iterdescendants, sizeof(__pyx_k_iterdescendants), 1, 1, 1},
137555   {&__pyx_kp_iterchildren, __pyx_k_iterchildren, sizeof(__pyx_k_iterchildren), 1, 1, 1},
137556   {&__pyx_kp_getroottree, __pyx_k_getroottree, sizeof(__pyx_k_getroottree), 1, 1, 1},
137557   {&__pyx_kp_getiterator, __pyx_k_getiterator, sizeof(__pyx_k_getiterator), 1, 1, 1},
137558   {&__pyx_kp_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 1, 1, 1},
137559   {&__pyx_kp_itertext, __pyx_k_itertext, sizeof(__pyx_k_itertext), 1, 1, 1},
137560   {&__pyx_kp_makeelement, __pyx_k_makeelement, sizeof(__pyx_k_makeelement), 1, 1, 1},
137561   {&__pyx_kp_find, __pyx_k_find, sizeof(__pyx_k_find), 1, 1, 1},
137562   {&__pyx_kp_findtext, __pyx_k_findtext, sizeof(__pyx_k_findtext), 1, 1, 1},
137563   {&__pyx_kp_findall, __pyx_k_findall, sizeof(__pyx_k_findall), 1, 1, 1},
137564   {&__pyx_kp_iterfind, __pyx_k_iterfind, sizeof(__pyx_k_iterfind), 1, 1, 1},
137565   {&__pyx_kp_xpath, __pyx_k_xpath, sizeof(__pyx_k_xpath), 1, 1, 1},
137566   {&__pyx_kp___str__, __pyx_k___str__, sizeof(__pyx_k___str__), 1, 1, 1},
137567   {&__pyx_kp___hash__, __pyx_k___hash__, sizeof(__pyx_k___hash__), 1, 1, 1},
137568   {&__pyx_kp___richcmp__, __pyx_k___richcmp__, sizeof(__pyx_k___richcmp__), 1, 1, 1},
137569   {&__pyx_kp_parse, __pyx_k_parse, sizeof(__pyx_k_parse), 1, 1, 1},
137570   {&__pyx_kp__setroot, __pyx_k__setroot, sizeof(__pyx_k__setroot), 1, 1, 1},
137571   {&__pyx_kp_getroot, __pyx_k_getroot, sizeof(__pyx_k_getroot), 1, 1, 1},
137572   {&__pyx_kp_write, __pyx_k_write, sizeof(__pyx_k_write), 1, 1, 1},
137573   {&__pyx_kp_getpath, __pyx_k_getpath, sizeof(__pyx_k_getpath), 1, 1, 1},
137574   {&__pyx_kp_xslt, __pyx_k_xslt, sizeof(__pyx_k_xslt), 1, 1, 1},
137575   {&__pyx_kp_relaxng, __pyx_k_relaxng, sizeof(__pyx_k_relaxng), 1, 1, 1},
137576   {&__pyx_kp_xmlschema, __pyx_k_xmlschema, sizeof(__pyx_k_xmlschema), 1, 1, 1},
137577   {&__pyx_kp_xinclude, __pyx_k_xinclude, sizeof(__pyx_k_xinclude), 1, 1, 1},
137578   {&__pyx_kp_22, __pyx_k_22, sizeof(__pyx_k_22), 1, 1, 1},
137579   {&__pyx_kp_update, __pyx_k_update, sizeof(__pyx_k_update), 1, 1, 1},
137580   {&__pyx_kp_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 1, 1, 1},
137581   {&__pyx_kp_iterkeys, __pyx_k_iterkeys, sizeof(__pyx_k_iterkeys), 1, 1, 1},
137582   {&__pyx_kp_itervalues, __pyx_k_itervalues, sizeof(__pyx_k_itervalues), 1, 1, 1},
137583   {&__pyx_kp_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 1, 1, 1},
137584   {&__pyx_kp_has_key, __pyx_k_has_key, sizeof(__pyx_k_has_key), 1, 1, 1},
137585   {&__pyx_kp___next__, __pyx_k___next__, sizeof(__pyx_k___next__), 1, 1, 1},
137586   {&__pyx_kp___cinit__, __pyx_k___cinit__, sizeof(__pyx_k___cinit__), 1, 1, 1},
137587   {&__pyx_kp_set_fallback, __pyx_k_set_fallback, sizeof(__pyx_k_set_fallback), 1, 1, 1},
137588   {&__pyx_kp_lookup, __pyx_k_lookup, sizeof(__pyx_k_lookup), 1, 1, 1},
137589   {&__pyx_kp_get_namespace, __pyx_k_get_namespace, sizeof(__pyx_k_get_namespace), 1, 1, 1},
137590   {&__pyx_kp_resolve, __pyx_k_resolve, sizeof(__pyx_k_resolve), 1, 1, 1},
137591   {&__pyx_kp_resolve_empty, __pyx_k_resolve_empty, sizeof(__pyx_k_resolve_empty), 1, 1, 1},
137592   {&__pyx_kp_resolve_string, __pyx_k_resolve_string, sizeof(__pyx_k_resolve_string), 1, 1, 1},
137593   {&__pyx_kp_resolve_filename, __pyx_k_resolve_filename, sizeof(__pyx_k_resolve_filename), 1, 1, 1},
137594   {&__pyx_kp_resolve_file, __pyx_k_resolve_file, sizeof(__pyx_k_resolve_file), 1, 1, 1},
137595   {&__pyx_kp_add, __pyx_k_add, sizeof(__pyx_k_add), 1, 1, 1},
137596   {&__pyx_kp_28, __pyx_k_28, sizeof(__pyx_k_28), 1, 1, 1},
137597   {&__pyx_kp_29, __pyx_k_29, sizeof(__pyx_k_29), 1, 1, 1},
137598   {&__pyx_kp_feed, __pyx_k_feed, sizeof(__pyx_k_feed), 1, 1, 1},
137599   {&__pyx_kp_close, __pyx_k_close, sizeof(__pyx_k_close), 1, 1, 1},
137600   {&__pyx_kp_data, __pyx_k_data, sizeof(__pyx_k_data), 1, 1, 1},
137601   {&__pyx_kp_start, __pyx_k_start, sizeof(__pyx_k_start), 1, 1, 1},
137602   {&__pyx_kp_end, __pyx_k_end, sizeof(__pyx_k_end), 1, 1, 1},
137603   {&__pyx_kp_pi, __pyx_k_pi, sizeof(__pyx_k_pi), 1, 1, 1},
137604   {&__pyx_kp_comment, __pyx_k_comment, sizeof(__pyx_k_comment), 1, 1, 1},
137605   {&__pyx_kp___call__, __pyx_k___call__, sizeof(__pyx_k___call__), 1, 1, 1},
137606   {&__pyx_kp_test, __pyx_k_test, sizeof(__pyx_k_test), 1, 1, 1},
137607   {&__pyx_kp_match, __pyx_k_match, sizeof(__pyx_k_match), 1, 1, 1},
137608   {&__pyx_kp_evaluate, __pyx_k_evaluate, sizeof(__pyx_k_evaluate), 1, 1, 1},
137609   {&__pyx_kp_register_namespace, __pyx_k_register_namespace, sizeof(__pyx_k_register_namespace), 1, 1, 1},
137610   {&__pyx_kp_register_namespaces, __pyx_k_register_namespaces, sizeof(__pyx_k_register_namespaces), 1, 1, 1},
137611   {&__pyx_kp_DENY_ALL, __pyx_k_DENY_ALL, sizeof(__pyx_k_DENY_ALL), 1, 1, 1},
137612   {&__pyx_kp_DENY_WRITE, __pyx_k_DENY_WRITE, sizeof(__pyx_k_DENY_WRITE), 1, 1, 1},
137613   {&__pyx_kp_strparam, __pyx_k_strparam, sizeof(__pyx_k_strparam), 1, 1, 1},
137614   {&__pyx_kp_apply, __pyx_k_apply, sizeof(__pyx_k_apply), 1, 1, 1},
137615   {&__pyx_kp_tostring, __pyx_k_tostring, sizeof(__pyx_k_tostring), 1, 1, 1},
137616   {&__pyx_kp___unicode__, __pyx_k___unicode__, sizeof(__pyx_k___unicode__), 1, 1, 1},
137617   {&__pyx_kp___getbuffer__, __pyx_k___getbuffer__, sizeof(__pyx_k___getbuffer__), 1, 1, 1},
137618   {&__pyx_kp___releasebuffer__, __pyx_k___releasebuffer__, sizeof(__pyx_k___releasebuffer__), 1, 1, 1},
137619   {&__pyx_kp_parseXSL, __pyx_k_parseXSL, sizeof(__pyx_k_parseXSL), 1, 1, 1},
137620   {&__pyx_kp_execute, __pyx_k_execute, sizeof(__pyx_k_execute), 1, 1, 1},
137621   {&__pyx_kp_apply_templates, __pyx_k_apply_templates, sizeof(__pyx_k_apply_templates), 1, 1, 1},
137622   {&__pyx_kp_validate, __pyx_k_validate, sizeof(__pyx_k_validate), 1, 1, 1},
137623   {&__pyx_kp_assertValid, __pyx_k_assertValid, sizeof(__pyx_k_assertValid), 1, 1, 1},
137624   {&__pyx_kp_assert_, __pyx_k_assert_, sizeof(__pyx_k_assert_), 1, 1, 1},
137625   {&__pyx_kp_self, __pyx_k_self, sizeof(__pyx_k_self), 1, 1, 1},
137626   {&__pyx_kp_message, __pyx_k_message, sizeof(__pyx_k_message), 1, 1, 1},
137627   {&__pyx_kp_error_log, __pyx_k_error_log, sizeof(__pyx_k_error_log), 1, 1, 1},
137628   {&__pyx_kp_first_error, __pyx_k_first_error, sizeof(__pyx_k_first_error), 1, 1, 1},
137629   {&__pyx_kp_last_error, __pyx_k_last_error, sizeof(__pyx_k_last_error), 1, 1, 1},
137630   {&__pyx_kp_entries, __pyx_k_entries, sizeof(__pyx_k_entries), 1, 1, 1},
137631   {&__pyx_kp_error_type, __pyx_k_error_type, sizeof(__pyx_k_error_type), 1, 1, 1},
137632   {&__pyx_kp_domains, __pyx_k_domains, sizeof(__pyx_k_domains), 1, 1, 1},
137633   {&__pyx_kp_types, __pyx_k_types, sizeof(__pyx_k_types), 1, 1, 1},
137634   {&__pyx_kp_levels, __pyx_k_levels, sizeof(__pyx_k_levels), 1, 1, 1},
137635   {&__pyx_kp_level, __pyx_k_level, sizeof(__pyx_k_level), 1, 1, 1},
137636   {&__pyx_kp_entry, __pyx_k_entry, sizeof(__pyx_k_entry), 1, 1, 1},
137637   {&__pyx_kp_max_len, __pyx_k_max_len, sizeof(__pyx_k_max_len), 1, 1, 1},
137638   {&__pyx_kp_logger_name, __pyx_k_logger_name, sizeof(__pyx_k_logger_name), 1, 1, 1},
137639   {&__pyx_kp_log_entry, __pyx_k_log_entry, sizeof(__pyx_k_log_entry), 1, 1, 1},
137640   {&__pyx_kp_tree, __pyx_k_tree, sizeof(__pyx_k_tree), 1, 1, 1},
137641   {&__pyx_kp_url, __pyx_k_url, sizeof(__pyx_k_url), 1, 1, 1},
137642   {&__pyx_kp_x, __pyx_k_x, sizeof(__pyx_k_x), 1, 1, 1},
137643   {&__pyx_kp_value, __pyx_k_value, sizeof(__pyx_k_value), 1, 1, 1},
137644   {&__pyx_kp_memo, __pyx_k_memo, sizeof(__pyx_k_memo), 1, 1, 1},
137645   {&__pyx_kp_key, __pyx_k_key, sizeof(__pyx_k_key), 1, 1, 1},
137646   {&__pyx_kp_element, __pyx_k_element, sizeof(__pyx_k_element), 1, 1, 1},
137647   {&__pyx_kp_elements, __pyx_k_elements, sizeof(__pyx_k_elements), 1, 1, 1},
137648   {&__pyx_kp_old_element, __pyx_k_old_element, sizeof(__pyx_k_old_element), 1, 1, 1},
137649   {&__pyx_kp_new_element, __pyx_k_new_element, sizeof(__pyx_k_new_element), 1, 1, 1},
137650   {&__pyx_kp_line, __pyx_k_line, sizeof(__pyx_k_line), 1, 1, 1},
137651   {&__pyx_kp_child, __pyx_k_child, sizeof(__pyx_k_child), 1, 1, 1},
137652   {&__pyx_kp_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 1, 1, 1},
137653   {&__pyx_kp_default, __pyx_k_default, sizeof(__pyx_k_default), 1, 1, 1},
137654   {&__pyx_kp_tag, __pyx_k_tag, sizeof(__pyx_k_tag), 1, 1, 1},
137655   {&__pyx_kp_preceding, __pyx_k_preceding, sizeof(__pyx_k_preceding), 1, 1, 1},
137656   {&__pyx_kp_reversed, __pyx_k_reversed, sizeof(__pyx_k_reversed), 1, 1, 1},
137657   {&__pyx_kp_with_tail, __pyx_k_with_tail, sizeof(__pyx_k_with_tail), 1, 1, 1},
137658   {&__pyx_kp__tag, __pyx_k__tag, sizeof(__pyx_k__tag), 1, 1, 1},
137659   {&__pyx_kp_attrib, __pyx_k_attrib, sizeof(__pyx_k_attrib), 1, 1, 1},
137660   {&__pyx_kp_nsmap, __pyx_k_nsmap, sizeof(__pyx_k_nsmap), 1, 1, 1},
137661   {&__pyx_kp_path, __pyx_k_path, sizeof(__pyx_k_path), 1, 1, 1},
137662   {&__pyx_kp__path, __pyx_k__path, sizeof(__pyx_k__path), 1, 1, 1},
137663   {&__pyx_kp_namespaces, __pyx_k_namespaces, sizeof(__pyx_k_namespaces), 1, 1, 1},
137664   {&__pyx_kp_extensions, __pyx_k_extensions, sizeof(__pyx_k_extensions), 1, 1, 1},
137665   {&__pyx_kp_smart_strings, __pyx_k_smart_strings, sizeof(__pyx_k_smart_strings), 1, 1, 1},
137666   {&__pyx_kp_36, __pyx_k_36, sizeof(__pyx_k_36), 1, 1, 1},
137667   {&__pyx_kp_one, __pyx_k_one, sizeof(__pyx_k_one), 1, 1, 1},
137668   {&__pyx_kp_other, __pyx_k_other, sizeof(__pyx_k_other), 1, 1, 1},
137669   {&__pyx_kp_op, __pyx_k_op, sizeof(__pyx_k_op), 1, 1, 1},
137670   {&__pyx_kp_source, __pyx_k_source, sizeof(__pyx_k_source), 1, 1, 1},
137671   {&__pyx_kp_parser, __pyx_k_parser, sizeof(__pyx_k_parser), 1, 1, 1},
137672   {&__pyx_kp_base_url, __pyx_k_base_url, sizeof(__pyx_k_base_url), 1, 1, 1},
137673   {&__pyx_kp_root, __pyx_k_root, sizeof(__pyx_k_root), 1, 1, 1},
137674   {&__pyx_kp_file, __pyx_k_file, sizeof(__pyx_k_file), 1, 1, 1},
137675   {&__pyx_kp_encoding, __pyx_k_encoding, sizeof(__pyx_k_encoding), 1, 1, 1},
137676   {&__pyx_kp_method, __pyx_k_method, sizeof(__pyx_k_method), 1, 1, 1},
137677   {&__pyx_kp_pretty_print, __pyx_k_pretty_print, sizeof(__pyx_k_pretty_print), 1, 1, 1},
137678   {&__pyx_kp_xml_declaration, __pyx_k_xml_declaration, sizeof(__pyx_k_xml_declaration), 1, 1, 1},
137679   {&__pyx_kp_standalone, __pyx_k_standalone, sizeof(__pyx_k_standalone), 1, 1, 1},
137680   {&__pyx_kp_compression, __pyx_k_compression, sizeof(__pyx_k_compression), 1, 1, 1},
137681   {&__pyx_kp__xslt, __pyx_k__xslt, sizeof(__pyx_k__xslt), 1, 1, 1},
137682   {&__pyx_kp_access_control, __pyx_k_access_control, sizeof(__pyx_k_access_control), 1, 1, 1},
137683   {&__pyx_kp_exclusive, __pyx_k_exclusive, sizeof(__pyx_k_exclusive), 1, 1, 1},
137684   {&__pyx_kp_with_comments, __pyx_k_with_comments, sizeof(__pyx_k_with_comments), 1, 1, 1},
137685   {&__pyx_kp_sequence_or_dict, __pyx_k_sequence_or_dict, sizeof(__pyx_k_sequence_or_dict), 1, 1, 1},
137686   {&__pyx_kp_node, __pyx_k_node, sizeof(__pyx_k_node), 1, 1, 1},
137687   {&__pyx_kp_inclusive, __pyx_k_inclusive, sizeof(__pyx_k_inclusive), 1, 1, 1},
137688   {&__pyx_kp_text, __pyx_k_text, sizeof(__pyx_k_text), 1, 1, 1},
137689   {&__pyx_kp_target, __pyx_k_target, sizeof(__pyx_k_target), 1, 1, 1},
137690   {&__pyx_kp_name, __pyx_k_name, sizeof(__pyx_k_name), 1, 1, 1},
137691   {&__pyx_kp__parent, __pyx_k__parent, sizeof(__pyx_k__parent), 1, 1, 1},
137692   {&__pyx_kp_strings, __pyx_k_strings, sizeof(__pyx_k_strings), 1, 1, 1},
137693   {&__pyx_kp_elem, __pyx_k_elem, sizeof(__pyx_k_elem), 1, 1, 1},
137694   {&__pyx_kp_element_or_tree, __pyx_k_element_or_tree, sizeof(__pyx_k_element_or_tree), 1, 1, 1},
137695   {&__pyx_kp_other_element, __pyx_k_other_element, sizeof(__pyx_k_other_element), 0, 1, 1},
137696   {&__pyx_kp_fallback, __pyx_k_fallback, sizeof(__pyx_k_fallback), 1, 1, 1},
137697   {&__pyx_kp_entity, __pyx_k_entity, sizeof(__pyx_k_entity), 1, 1, 1},
137698   {&__pyx_kp_attribute_name, __pyx_k_attribute_name, sizeof(__pyx_k_attribute_name), 1, 1, 1},
137699   {&__pyx_kp_class_mapping, __pyx_k_class_mapping, sizeof(__pyx_k_class_mapping), 1, 1, 1},
137700   {&__pyx_kp_type, __pyx_k_type, sizeof(__pyx_k_type), 1, 1, 1},
137701   {&__pyx_kp_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 1, 1, 1},
137702   {&__pyx_kp_namespace, __pyx_k_namespace, sizeof(__pyx_k_namespace), 1, 1, 1},
137703   {&__pyx_kp_ns_uri, __pyx_k_ns_uri, sizeof(__pyx_k_ns_uri), 1, 1, 1},
137704   {&__pyx_kp_class_dict_iterable, __pyx_k_class_dict_iterable, sizeof(__pyx_k_class_dict_iterable), 1, 1, 1},
137705   {&__pyx_kp_item, __pyx_k_item, sizeof(__pyx_k_item), 1, 1, 1},
137706   {&__pyx_kp_prefix, __pyx_k_prefix, sizeof(__pyx_k_prefix), 1, 1, 1},
137707   {&__pyx_kp_system_url, __pyx_k_system_url, sizeof(__pyx_k_system_url), 1, 1, 1},
137708   {&__pyx_kp_public_id, __pyx_k_public_id, sizeof(__pyx_k_public_id), 1, 1, 1},
137709   {&__pyx_kp_context, __pyx_k_context, sizeof(__pyx_k_context), 1, 1, 1},
137710   {&__pyx_kp_string, __pyx_k_string, sizeof(__pyx_k_string), 1, 1, 1},
137711   {&__pyx_kp_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 1, 1, 1},
137712   {&__pyx_kp_f, __pyx_k_f, sizeof(__pyx_k_f), 1, 1, 1},
137713   {&__pyx_kp_default_resolver, __pyx_k_default_resolver, sizeof(__pyx_k_default_resolver), 1, 1, 1},
137714   {&__pyx_kp_resolver, __pyx_k_resolver, sizeof(__pyx_k_resolver), 1, 1, 1},
137715   {&__pyx_kp_code, __pyx_k_code, sizeof(__pyx_k_code), 1, 1, 1},
137716   {&__pyx_kp_column, __pyx_k_column, sizeof(__pyx_k_column), 1, 1, 1},
137717   {&__pyx_kp_filelike, __pyx_k_filelike, sizeof(__pyx_k_filelike), 1, 1, 1},
137718   {&__pyx_kp_exc_context, __pyx_k_exc_context, sizeof(__pyx_k_exc_context), 1, 1, 1},
137719   {&__pyx_kp_parse_options, __pyx_k_parse_options, sizeof(__pyx_k_parse_options), 1, 1, 1},
137720   {&__pyx_kp_for_html, __pyx_k_for_html, sizeof(__pyx_k_for_html), 1, 1, 1},
137721   {&__pyx_kp_schema, __pyx_k_schema, sizeof(__pyx_k_schema), 1, 1, 1},
137722   {&__pyx_kp_remove_comments, __pyx_k_remove_comments, sizeof(__pyx_k_remove_comments), 1, 1, 1},
137723   {&__pyx_kp_remove_pis, __pyx_k_remove_pis, sizeof(__pyx_k_remove_pis), 1, 1, 1},
137724   {&__pyx_kp_strip_cdata, __pyx_k_strip_cdata, sizeof(__pyx_k_strip_cdata), 1, 1, 1},
137725   {&__pyx_kp_attribute_defaults, __pyx_k_attribute_defaults, sizeof(__pyx_k_attribute_defaults), 1, 1, 1},
137726   {&__pyx_kp_dtd_validation, __pyx_k_dtd_validation, sizeof(__pyx_k_dtd_validation), 1, 1, 1},
137727   {&__pyx_kp_load_dtd, __pyx_k_load_dtd, sizeof(__pyx_k_load_dtd), 1, 1, 1},
137728   {&__pyx_kp_no_network, __pyx_k_no_network, sizeof(__pyx_k_no_network), 1, 1, 1},
137729   {&__pyx_kp_ns_clean, __pyx_k_ns_clean, sizeof(__pyx_k_ns_clean), 1, 1, 1},
137730   {&__pyx_kp_recover, __pyx_k_recover, sizeof(__pyx_k_recover), 1, 1, 1},
137731   {&__pyx_kp_huge_tree, __pyx_k_huge_tree, sizeof(__pyx_k_huge_tree), 1, 1, 1},
137732   {&__pyx_kp_remove_blank_text, __pyx_k_remove_blank_text, sizeof(__pyx_k_remove_blank_text), 1, 1, 1},
137733   {&__pyx_kp_resolve_entities, __pyx_k_resolve_entities, sizeof(__pyx_k_resolve_entities), 1, 1, 1},
137734   {&__pyx_kp_compact, __pyx_k_compact, sizeof(__pyx_k_compact), 1, 1, 1},
137735   {&__pyx_kp_element_factory, __pyx_k_element_factory, sizeof(__pyx_k_element_factory), 1, 1, 1},
137736   {&__pyx_kp_attrs, __pyx_k_attrs, sizeof(__pyx_k_attrs), 1, 1, 1},
137737   {&__pyx_kp_result, __pyx_k_result, sizeof(__pyx_k_result), 1, 1, 1},
137738   {&__pyx_kp_events, __pyx_k_events, sizeof(__pyx_k_events), 1, 1, 1},
137739   {&__pyx_kp_html, __pyx_k_html, sizeof(__pyx_k_html), 1, 1, 1},
137740   {&__pyx_kp_etree, __pyx_k_etree, sizeof(__pyx_k_etree), 1, 1, 1},
137741   {&__pyx_kp_id_name, __pyx_k_id_name, sizeof(__pyx_k_id_name), 1, 1, 1},
137742   {&__pyx_kp_tree_or_element, __pyx_k_tree_or_element, sizeof(__pyx_k_tree_or_element), 1, 1, 1},
137743   {&__pyx_kp_enable_regexp, __pyx_k_enable_regexp, sizeof(__pyx_k_enable_regexp), 1, 1, 1},
137744   {&__pyx_kp_build_smart_strings, __pyx_k_build_smart_strings, sizeof(__pyx_k_build_smart_strings), 1, 1, 1},
137745   {&__pyx_kp_module, __pyx_k_module, sizeof(__pyx_k_module), 1, 1, 1},
137746   {&__pyx_kp_function_mapping, __pyx_k_function_mapping, sizeof(__pyx_k_function_mapping), 1, 1, 1},
137747   {&__pyx_kp_ns, __pyx_k_ns, sizeof(__pyx_k_ns), 1, 1, 1},
137748   {&__pyx_kp_ctxt, __pyx_k_ctxt, sizeof(__pyx_k_ctxt), 1, 1, 1},
137749   {&__pyx_kp_s, __pyx_k_s, sizeof(__pyx_k_s), 1, 1, 1},
137750   {&__pyx_kp_rexp, __pyx_k_rexp, sizeof(__pyx_k_rexp), 1, 1, 1},
137751   {&__pyx_kp_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 1, 1, 1},
137752   {&__pyx_kp_replacement, __pyx_k_replacement, sizeof(__pyx_k_replacement), 1, 1, 1},
137753   {&__pyx_kp_variables, __pyx_k_variables, sizeof(__pyx_k_variables), 1, 1, 1},
137754   {&__pyx_kp__eval_arg, __pyx_k__eval_arg, sizeof(__pyx_k__eval_arg), 1, 1, 1},
137755   {&__pyx_kp_regexp, __pyx_k_regexp, sizeof(__pyx_k_regexp), 1, 1, 1},
137756   {&__pyx_kp_uri, __pyx_k_uri, sizeof(__pyx_k_uri), 1, 1, 1},
137757   {&__pyx_kp_etree_or_element, __pyx_k_etree_or_element, sizeof(__pyx_k_etree_or_element), 1, 1, 1},
137758   {&__pyx_kp__etree_or_element, __pyx_k__etree_or_element, sizeof(__pyx_k__etree_or_element), 1, 1, 1},
137759   {&__pyx_kp_read_file, __pyx_k_read_file, sizeof(__pyx_k_read_file), 1, 1, 1},
137760   {&__pyx_kp_write_file, __pyx_k_write_file, sizeof(__pyx_k_write_file), 1, 1, 1},
137761   {&__pyx_kp_create_dir, __pyx_k_create_dir, sizeof(__pyx_k_create_dir), 1, 1, 1},
137762   {&__pyx_kp_read_network, __pyx_k_read_network, sizeof(__pyx_k_read_network), 1, 1, 1},
137763   {&__pyx_kp_write_network, __pyx_k_write_network, sizeof(__pyx_k_write_network), 1, 1, 1},
137764   {&__pyx_kp_strval, __pyx_k_strval, sizeof(__pyx_k_strval), 1, 1, 1},
137765   {&__pyx_kp_xslt_input, __pyx_k_xslt_input, sizeof(__pyx_k_xslt_input), 1, 1, 1},
137766   {&__pyx_kp__input, __pyx_k__input, sizeof(__pyx_k__input), 1, 1, 1},
137767   {&__pyx_kp_profile_run, __pyx_k_profile_run, sizeof(__pyx_k_profile_run), 1, 1, 1},
137768   {&__pyx_kp_result_tree, __pyx_k_result_tree, sizeof(__pyx_k_result_tree), 1, 1, 1},
137769   {&__pyx_kp_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 1, 1, 1},
137770   {&__pyx_kp_self_node, __pyx_k_self_node, sizeof(__pyx_k_self_node), 1, 1, 1},
137771   {&__pyx_kp_input_node, __pyx_k_input_node, sizeof(__pyx_k_input_node), 1, 1, 1},
137772   {&__pyx_kp_output_parent, __pyx_k_output_parent, sizeof(__pyx_k_output_parent), 1, 1, 1},
137773   {&__pyx_kp_external_id, __pyx_k_external_id, sizeof(__pyx_k_external_id), 1, 1, 1},
137774   {&__pyx_kp___docformat__, __pyx_k___docformat__, sizeof(__pyx_k___docformat__), 1, 1, 1},
137775   {&__pyx_kp___builtin__, __pyx_k___builtin__, sizeof(__pyx_k___builtin__), 1, 1, 1},
137776   {&__pyx_kp_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 1, 1, 1},
137777   {&__pyx_kp_builtins, __pyx_k_builtins, sizeof(__pyx_k_builtins), 1, 1, 1},
137778   {&__pyx_kp_unicode, __pyx_k_unicode, sizeof(__pyx_k_unicode), 1, 1, 1},
137779   {&__pyx_kp_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 1, 1, 1},
137780   {&__pyx_kp_str, __pyx_k_str, sizeof(__pyx_k_str), 1, 1, 1},
137781   {&__pyx_kp_38, __pyx_k_38, sizeof(__pyx_k_38), 1, 1, 1},
137782   {&__pyx_kp_abspath, __pyx_k_abspath, sizeof(__pyx_k_abspath), 1, 1, 1},
137783   {&__pyx_kp_io, __pyx_k_io, sizeof(__pyx_k_io), 1, 1, 1},
137784   {&__pyx_kp_BytesIO, __pyx_k_BytesIO, sizeof(__pyx_k_BytesIO), 1, 1, 1},
137785   {&__pyx_kp_StringIO, __pyx_k_StringIO, sizeof(__pyx_k_StringIO), 1, 1, 1},
137786   {&__pyx_kp__elementpath, __pyx_k__elementpath, sizeof(__pyx_k__elementpath), 1, 1, 1},
137787   {&__pyx_kp_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 1, 1, 1},
137788   {&__pyx_kp_re, __pyx_k_re, sizeof(__pyx_k_re), 1, 1, 1},
137789   {&__pyx_kp_gzip, __pyx_k_gzip, sizeof(__pyx_k_gzip), 1, 1, 1},
137790   {&__pyx_kp_DEBUG, __pyx_k_DEBUG, sizeof(__pyx_k_DEBUG), 1, 1, 1},
137791   {&__pyx_kp_39, __pyx_k_39, sizeof(__pyx_k_39), 1, 1, 1},
137792   {&__pyx_kp_getdefaultencoding, __pyx_k_getdefaultencoding, sizeof(__pyx_k_getdefaultencoding), 1, 1, 1},
137793   {&__pyx_kp_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 1, 0},
137794   {&__pyx_kp_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 1, 1, 1},
137795   {&__pyx_kp_43, __pyx_k_43, sizeof(__pyx_k_43), 0, 1, 0},
137796   {&__pyx_kp_45, __pyx_k_45, sizeof(__pyx_k_45), 0, 1, 0},
137797   {&__pyx_kp_47, __pyx_k_47, sizeof(__pyx_k_47), 0, 1, 0},
137798   {&__pyx_kp_49, __pyx_k_49, sizeof(__pyx_k_49), 0, 1, 0},
137799   {&__pyx_kp_51, __pyx_k_51, sizeof(__pyx_k_51), 0, 1, 0},
137800   {&__pyx_kp_53, __pyx_k_53, sizeof(__pyx_k_53), 0, 1, 0},
137801   {&__pyx_kp_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 1, 0},
137802   {&__pyx_kp_57, __pyx_k_57, sizeof(__pyx_k_57), 0, 1, 0},
137803   {&__pyx_kp_Error, __pyx_k_Error, sizeof(__pyx_k_Error), 0, 1, 1},
137804   {&__pyx_kp_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 1, 1, 1},
137805   {&__pyx_kp_LxmlError, __pyx_k_LxmlError, sizeof(__pyx_k_LxmlError), 0, 1, 1},
137806   {&__pyx_kp_LxmlSyntaxError, __pyx_k_LxmlSyntaxError, sizeof(__pyx_k_LxmlSyntaxError), 0, 1, 1},
137807   {&__pyx_kp_SyntaxError, __pyx_k_SyntaxError, sizeof(__pyx_k_SyntaxError), 1, 1, 1},
137808   {&__pyx_kp_60, __pyx_k_60, sizeof(__pyx_k_60), 0, 1, 1},
137809   {&__pyx_kp_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 1, 1, 1},
137810   {&__pyx_kp_63, __pyx_k_63, sizeof(__pyx_k_63), 1, 1, 0},
137811   {&__pyx_kp_group, __pyx_k_group, sizeof(__pyx_k_group), 1, 1, 1},
137812   {&__pyx_kp_65, __pyx_k_65, sizeof(__pyx_k_65), 1, 1, 0},
137813   {&__pyx_kp_LIBXML_VERSION, __pyx_k_LIBXML_VERSION, sizeof(__pyx_k_LIBXML_VERSION), 1, 1, 1},
137814   {&__pyx_kp_66, __pyx_k_66, sizeof(__pyx_k_66), 1, 1, 1},
137815   {&__pyx_kp_LXML_VERSION, __pyx_k_LXML_VERSION, sizeof(__pyx_k_LXML_VERSION), 1, 1, 1},
137816   {&__pyx_kp_67, __pyx_k_67, sizeof(__pyx_k_67), 1, 1, 0},
137817   {&__pyx_kp___version__, __pyx_k___version__, sizeof(__pyx_k___version__), 1, 1, 1},
137818   {&__pyx_kp_compile, __pyx_k_compile, sizeof(__pyx_k_compile), 1, 1, 1},
137819   {&__pyx_kp_U, __pyx_k_U, sizeof(__pyx_k_U), 1, 1, 1},
137820   {&__pyx_kp_sub, __pyx_k_sub, sizeof(__pyx_k_sub), 1, 1, 1},
137821   {&__pyx_kp_ErrorLevels, __pyx_k_ErrorLevels, sizeof(__pyx_k_ErrorLevels), 0, 1, 1},
137822   {&__pyx_kp_ErrorDomains, __pyx_k_ErrorDomains, sizeof(__pyx_k_ErrorDomains), 0, 1, 1},
137823   {&__pyx_kp_ErrorTypes, __pyx_k_ErrorTypes, sizeof(__pyx_k_ErrorTypes), 0, 1, 1},
137824   {&__pyx_kp_RelaxNGErrorTypes, __pyx_k_RelaxNGErrorTypes, sizeof(__pyx_k_RelaxNGErrorTypes), 0, 1, 1},
137825   {&__pyx_kp_91, __pyx_k_91, sizeof(__pyx_k_91), 1, 1, 0},
137826   {&__pyx_kp_101, __pyx_k_101, sizeof(__pyx_k_101), 1, 1, 1},
137827   {&__pyx_kp_PI, __pyx_k_PI, sizeof(__pyx_k_PI), 1, 1, 1},
137828   {&__pyx_kp_104, __pyx_k_104, sizeof(__pyx_k_104), 1, 1, 0},
137829   {&__pyx_kp_107, __pyx_k_107, sizeof(__pyx_k_107), 1, 1, 0},
137830   {&__pyx_kp_LxmlRegistryError, __pyx_k_LxmlRegistryError, sizeof(__pyx_k_LxmlRegistryError), 0, 1, 1},
137831   {&__pyx_kp_112, __pyx_k_112, sizeof(__pyx_k_112), 0, 1, 1},
137832   {&__pyx_kp_ParseError, __pyx_k_ParseError, sizeof(__pyx_k_ParseError), 0, 1, 1},
137833   {&__pyx_kp_XMLSyntaxError, __pyx_k_XMLSyntaxError, sizeof(__pyx_k_XMLSyntaxError), 0, 1, 1},
137834   {&__pyx_kp_ParserError, __pyx_k_ParserError, sizeof(__pyx_k_ParserError), 0, 1, 1},
137835   {&__pyx_kp_inspect, __pyx_k_inspect, sizeof(__pyx_k_inspect), 1, 1, 1},
137836   {&__pyx_kp_getargspec, __pyx_k_getargspec, sizeof(__pyx_k_getargspec), 1, 1, 1},
137837   {&__pyx_kp__TargetParserResult, __pyx_k__TargetParserResult, sizeof(__pyx_k__TargetParserResult), 0, 1, 1},
137838   {&__pyx_kp_SerialisationError, __pyx_k_SerialisationError, sizeof(__pyx_k_SerialisationError), 0, 1, 1},
137839   {&__pyx_kp_151, __pyx_k_151, sizeof(__pyx_k_151), 1, 1, 0},
137840   {&__pyx_kp_165, __pyx_k_165, sizeof(__pyx_k_165), 1, 1, 0},
137841   {&__pyx_kp_XIncludeError, __pyx_k_XIncludeError, sizeof(__pyx_k_XIncludeError), 0, 1, 1},
137842   {&__pyx_kp_XPathError, __pyx_k_XPathError, sizeof(__pyx_k_XPathError), 0, 1, 1},
137843   {&__pyx_kp_XPathEvalError, __pyx_k_XPathEvalError, sizeof(__pyx_k_XPathEvalError), 0, 1, 1},
137844   {&__pyx_kp_XPathFunctionError, __pyx_k_XPathFunctionError, sizeof(__pyx_k_XPathFunctionError), 0, 1, 1},
137845   {&__pyx_kp_XPathResultError, __pyx_k_XPathResultError, sizeof(__pyx_k_XPathResultError), 0, 1, 1},
137846   {&__pyx_kp_174, __pyx_k_174, sizeof(__pyx_k_174), 0, 1, 1},
137847   {&__pyx_kp_XPathSyntaxError, __pyx_k_XPathSyntaxError, sizeof(__pyx_k_XPathSyntaxError), 0, 1, 1},
137848   {&__pyx_kp_XSLTError, __pyx_k_XSLTError, sizeof(__pyx_k_XSLTError), 0, 1, 1},
137849   {&__pyx_kp_XSLTParseError, __pyx_k_XSLTParseError, sizeof(__pyx_k_XSLTParseError), 0, 1, 1},
137850   {&__pyx_kp_XSLTApplyError, __pyx_k_XSLTApplyError, sizeof(__pyx_k_XSLTApplyError), 0, 1, 1},
137851   {&__pyx_kp_XSLTSaveError, __pyx_k_XSLTSaveError, sizeof(__pyx_k_XSLTSaveError), 0, 1, 1},
137852   {&__pyx_kp_XSLTExtensionError, __pyx_k_XSLTExtensionError, sizeof(__pyx_k_XSLTExtensionError), 0, 1, 1},
137853   {&__pyx_kp_192, __pyx_k_192, sizeof(__pyx_k_192), 1, 1, 1},
137854   {&__pyx_kp_LIBXSLT_VERSION, __pyx_k_LIBXSLT_VERSION, sizeof(__pyx_k_LIBXSLT_VERSION), 1, 1, 1},
137855   {&__pyx_kp_DocumentInvalid, __pyx_k_DocumentInvalid, sizeof(__pyx_k_DocumentInvalid), 0, 1, 1},
137856   {&__pyx_kp_DTDError, __pyx_k_DTDError, sizeof(__pyx_k_DTDError), 0, 1, 1},
137857   {&__pyx_kp_DTDParseError, __pyx_k_DTDParseError, sizeof(__pyx_k_DTDParseError), 0, 1, 1},
137858   {&__pyx_kp_DTDValidateError, __pyx_k_DTDValidateError, sizeof(__pyx_k_DTDValidateError), 0, 1, 1},
137859   {&__pyx_kp_RelaxNGError, __pyx_k_RelaxNGError, sizeof(__pyx_k_RelaxNGError), 0, 1, 1},
137860   {&__pyx_kp_RelaxNGParseError, __pyx_k_RelaxNGParseError, sizeof(__pyx_k_RelaxNGParseError), 0, 1, 1},
137861   {&__pyx_kp_209, __pyx_k_209, sizeof(__pyx_k_209), 0, 1, 1},
137862   {&__pyx_kp_XMLSchemaError, __pyx_k_XMLSchemaError, sizeof(__pyx_k_XMLSchemaError), 0, 1, 1},
137863   {&__pyx_kp_XMLSchemaParseError, __pyx_k_XMLSchemaParseError, sizeof(__pyx_k_XMLSchemaParseError), 0, 1, 1},
137864   {&__pyx_kp_213, __pyx_k_213, sizeof(__pyx_k_213), 0, 1, 1},
137865   {&__pyx_kp_216, __pyx_k_216, sizeof(__pyx_k_216), 1, 1, 0},
137866   {&__pyx_kp_SchematronError, __pyx_k_SchematronError, sizeof(__pyx_k_SchematronError), 0, 1, 1},
137867   {&__pyx_kp_220, __pyx_k_220, sizeof(__pyx_k_220), 0, 1, 1},
137868   {&__pyx_kp_222, __pyx_k_222, sizeof(__pyx_k_222), 0, 1, 1},
137869   {&__pyx_kp_super, __pyx_k_super, sizeof(__pyx_k_super), 1, 1, 1},
137870   {&__pyx_kp_224, __pyx_k_224, sizeof(__pyx_k_224), 1, 1, 0},
137871   {&__pyx_kp_split, __pyx_k_split, sizeof(__pyx_k_split), 1, 1, 1},
137872   {&__pyx_kp_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 1, 1, 1},
137873   {&__pyx_kp_startswith, __pyx_k_startswith, sizeof(__pyx_k_startswith), 1, 1, 1},
137874   {&__pyx_kp_228, __pyx_k_228, sizeof(__pyx_k_228), 1, 1, 0},
137875   {&__pyx_kp_229, __pyx_k_229, sizeof(__pyx_k_229), 1, 1, 0},
137876   {&__pyx_kp_230, __pyx_k_230, sizeof(__pyx_k_230), 1, 1, 0},
137877   {&__pyx_kp_exc_info, __pyx_k_exc_info, sizeof(__pyx_k_exc_info), 1, 1, 1},
137878   {&__pyx_kp_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 1, 1, 1},
137879   {&__pyx_kp_238, __pyx_k_238, sizeof(__pyx_k_238), 1, 1, 0},
137880   {&__pyx_kp_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 1, 1, 1},
137881   {&__pyx_kp_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 1, 1, 1},
137882   {&__pyx_kp_UnicodeEncodeError, __pyx_k_UnicodeEncodeError, sizeof(__pyx_k_UnicodeEncodeError), 1, 1, 1},
137883   {&__pyx_kp_UnicodeDecodeError, __pyx_k_UnicodeDecodeError, sizeof(__pyx_k_UnicodeDecodeError), 1, 1, 1},
137884   {&__pyx_kp_275, __pyx_k_275, sizeof(__pyx_k_275), 1, 1, 0},
137885   {&__pyx_kp_276, __pyx_k_276, sizeof(__pyx_k_276), 1, 1, 0},
137886   {&__pyx_kp_277, __pyx_k_277, sizeof(__pyx_k_277), 1, 1, 0},
137887   {&__pyx_kp_python, __pyx_k_python, sizeof(__pyx_k_python), 1, 1, 1},
137888   {&__pyx_kp_278, __pyx_k_278, sizeof(__pyx_k_278), 1, 1, 1},
137889   {&__pyx_kp_279, __pyx_k_279, sizeof(__pyx_k_279), 0, 1, 0},
137890   {&__pyx_kp_level_name, __pyx_k_level_name, sizeof(__pyx_k_level_name), 1, 1, 1},
137891   {&__pyx_kp_domain_name, __pyx_k_domain_name, sizeof(__pyx_k_domain_name), 1, 1, 1},
137892   {&__pyx_kp_type_name, __pyx_k_type_name, sizeof(__pyx_k_type_name), 1, 1, 1},
137893   {&__pyx_kp__getName, __pyx_k__getName, sizeof(__pyx_k__getName), 1, 1, 1},
137894   {&__pyx_kp_283, __pyx_k_283, sizeof(__pyx_k_283), 1, 1, 0},
137895   {&__pyx_kp_RELAXNGV, __pyx_k_RELAXNGV, sizeof(__pyx_k_RELAXNGV), 1, 1, 1},
137896   {&__pyx_kp_284, __pyx_k_284, sizeof(__pyx_k_284), 1, 1, 0},
137897   {&__pyx_kp_285, __pyx_k_285, sizeof(__pyx_k_285), 1, 1, 0},
137898   {&__pyx_kp_join, __pyx_k_join, sizeof(__pyx_k_join), 1, 1, 1},
137899   {&__pyx_kp_FATAL, __pyx_k_FATAL, sizeof(__pyx_k_FATAL), 1, 1, 1},
137900   {&__pyx_kp_ERROR, __pyx_k_ERROR, sizeof(__pyx_k_ERROR), 1, 1, 1},
137901   {&__pyx_kp_WARNING, __pyx_k_WARNING, sizeof(__pyx_k_WARNING), 1, 1, 1},
137902   {&__pyx_kp__accepted_domains, __pyx_k__accepted_domains, sizeof(__pyx_k__accepted_domains), 1, 1, 1},
137903   {&__pyx_kp_domain, __pyx_k_domain, sizeof(__pyx_k_domain), 1, 1, 1},
137904   {&__pyx_kp_logging, __pyx_k_logging, sizeof(__pyx_k_logging), 1, 1, 1},
137905   {&__pyx_kp_CRITICAL, __pyx_k_CRITICAL, sizeof(__pyx_k_CRITICAL), 1, 1, 1},
137906   {&__pyx_kp_getLogger, __pyx_k_getLogger, sizeof(__pyx_k_getLogger), 1, 1, 1},
137907   {&__pyx_kp_292, __pyx_k_292, sizeof(__pyx_k_292), 1, 1, 0},
137908   {&__pyx_kp_293, __pyx_k_293, sizeof(__pyx_k_293), 1, 1, 0},
137909   {&__pyx_kp_294, __pyx_k_294, sizeof(__pyx_k_294), 1, 1, 0},
137910   {&__pyx_kp__names, __pyx_k__names, sizeof(__pyx_k__names), 1, 1, 1},
137911   {&__pyx_kp_304, __pyx_k_304, sizeof(__pyx_k_304), 0, 1, 0},
137912   {&__pyx_kp_305, __pyx_k_305, sizeof(__pyx_k_305), 0, 1, 0},
137913   {&__pyx_kp_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 1, 1, 1},
137914   {&__pyx_kp_tail, __pyx_k_tail, sizeof(__pyx_k_tail), 1, 1, 1},
137915   {&__pyx_kp_id, __pyx_k_id, sizeof(__pyx_k_id), 1, 1, 1},
137916   {&__pyx_kp_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 1, 1, 1},
137917   {&__pyx_kp_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 1, 1, 1},
137918   {&__pyx_kp_FutureWarning, __pyx_k_FutureWarning, sizeof(__pyx_k_FutureWarning), 1, 1, 1},
137919   {&__pyx_kp_Comment, __pyx_k_Comment, sizeof(__pyx_k_Comment), 1, 1, 1},
137920   {&__pyx_kp_Entity, __pyx_k_Entity, sizeof(__pyx_k_Entity), 1, 1, 1},
137921   {&__pyx_kp_349, __pyx_k_349, sizeof(__pyx_k_349), 1, 1, 0},
137922   {&__pyx_kp_350, __pyx_k_350, sizeof(__pyx_k_350), 1, 1, 0},
137923   {&__pyx_kp_upper, __pyx_k_upper, sizeof(__pyx_k_upper), 1, 1, 1},
137924   {&__pyx_kp_352, __pyx_k_352, sizeof(__pyx_k_352), 1, 1, 0},
137925   {&__pyx_kp_353, __pyx_k_353, sizeof(__pyx_k_353), 1, 1, 0},
137926   {&__pyx_kp_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 1, 1, 1},
137927   {&__pyx_kp_Element, __pyx_k_Element, sizeof(__pyx_k_Element), 1, 1, 1},
137928   {&__pyx_kp_373, __pyx_k_373, sizeof(__pyx_k_373), 1, 1, 0},
137929   {&__pyx_kp_374, __pyx_k_374, sizeof(__pyx_k_374), 1, 1, 0},
137930   {&__pyx_kp_375, __pyx_k_375, sizeof(__pyx_k_375), 1, 1, 0},
137931   {&__pyx_kp_376, __pyx_k_376, sizeof(__pyx_k_376), 1, 1, 0},
137932   {&__pyx_kp_stdout, __pyx_k_stdout, sizeof(__pyx_k_stdout), 1, 1, 1},
137933   {&__pyx_kp_382, __pyx_k_382, sizeof(__pyx_k_382), 1, 1, 0},
137934   {&__pyx_kp_384, __pyx_k_384, sizeof(__pyx_k_384), 1, 1, 0},
137935   {&__pyx_kp_386, __pyx_k_386, sizeof(__pyx_k_386), 1, 1, 0},
137936   {&__pyx_kp__doc, __pyx_k__doc, sizeof(__pyx_k__doc), 1, 1, 1},
137937   {&__pyx_kp_NAMESPACE, __pyx_k_NAMESPACE, sizeof(__pyx_k_NAMESPACE), 1, 1, 1},
137938   {&__pyx_kp_TAG, __pyx_k_TAG, sizeof(__pyx_k_TAG), 1, 1, 1},
137939   {&__pyx_kp___class__, __pyx_k___class__, sizeof(__pyx_k___class__), 1, 1, 1},
137940   {&__pyx_kp___name__, __pyx_k___name__, sizeof(__pyx_k___name__), 1, 1, 1},
137941   {&__pyx_kp_PARSER, __pyx_k_PARSER, sizeof(__pyx_k_PARSER), 1, 1, 1},
137942   {&__pyx_kp_HTML, __pyx_k_HTML, sizeof(__pyx_k_HTML), 1, 1, 1},
137943   {&__pyx_kp_408, __pyx_k_408, sizeof(__pyx_k_408), 1, 1, 0},
137944   {&__pyx_kp_409, __pyx_k_409, sizeof(__pyx_k_409), 1, 1, 0},
137945   {&__pyx_kp_410, __pyx_k_410, sizeof(__pyx_k_410), 1, 1, 0},
137946   {&__pyx_kp_411, __pyx_k_411, sizeof(__pyx_k_411), 1, 1, 0},
137947   {&__pyx_kp_412, __pyx_k_412, sizeof(__pyx_k_412), 1, 1, 0},
137948   {&__pyx_kp_413, __pyx_k_413, sizeof(__pyx_k_413), 1, 1, 0},
137949   {&__pyx_kp_414, __pyx_k_414, sizeof(__pyx_k_414), 1, 1, 0},
137950   {&__pyx_kp_read, __pyx_k_read, sizeof(__pyx_k_read), 1, 1, 1},
137951   {&__pyx_kp_discard, __pyx_k_discard, sizeof(__pyx_k_discard), 1, 1, 1},
137952   {&__pyx_kp_position, __pyx_k_position, sizeof(__pyx_k_position), 1, 1, 1},
137953   {&__pyx_kp_426, __pyx_k_426, sizeof(__pyx_k_426), 1, 1, 0},
137954   {&__pyx_kp_427, __pyx_k_427, sizeof(__pyx_k_427), 1, 1, 0},
137955   {&__pyx_kp_428, __pyx_k_428, sizeof(__pyx_k_428), 1, 1, 0},
137956   {&__pyx_kp_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 1, 1, 1},
137957   {&__pyx_kp_443, __pyx_k_443, sizeof(__pyx_k_443), 1, 1, 1},
137958   {&__pyx_kp_444, __pyx_k_444, sizeof(__pyx_k_444), 1, 1, 1},
137959   {&__pyx_kp_LookupError, __pyx_k_LookupError, sizeof(__pyx_k_LookupError), 1, 1, 1},
137960   {&__pyx_kp_455, __pyx_k_455, sizeof(__pyx_k_455), 1, 1, 0},
137961   {&__pyx_kp_456, __pyx_k_456, sizeof(__pyx_k_456), 1, 1, 0},
137962   {&__pyx_kp_tell, __pyx_k_tell, sizeof(__pyx_k_tell), 1, 1, 1},
137963   {&__pyx_kp_getvalue, __pyx_k_getvalue, sizeof(__pyx_k_getvalue), 1, 1, 1},
137964   {&__pyx_kp_457, __pyx_k_457, sizeof(__pyx_k_457), 1, 1, 0},
137965   {&__pyx_kp_doctype, __pyx_k_doctype, sizeof(__pyx_k_doctype), 1, 1, 1},
137966   {&__pyx_kp_472, __pyx_k_472, sizeof(__pyx_k_472), 1, 1, 0},
137967   {&__pyx_kp_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 1, 1, 1},
137968   {&__pyx_kp_473, __pyx_k_473, sizeof(__pyx_k_473), 1, 1, 0},
137969   {&__pyx_kp_474, __pyx_k_474, sizeof(__pyx_k_474), 1, 1, 0},
137970   {&__pyx_kp_475, __pyx_k_475, sizeof(__pyx_k_475), 1, 1, 0},
137971   {&__pyx_kp_479, __pyx_k_479, sizeof(__pyx_k_479), 1, 1, 0},
137972   {&__pyx_kp_GzipFile, __pyx_k_GzipFile, sizeof(__pyx_k_GzipFile), 1, 1, 1},
137973   {&__pyx_kp_fileobj, __pyx_k_fileobj, sizeof(__pyx_k_fileobj), 1, 1, 1},
137974   {&__pyx_kp_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 1, 1, 1},
137975   {&__pyx_kp_503, __pyx_k_503, sizeof(__pyx_k_503), 1, 1, 0},
137976   {&__pyx_kp_compresslevel, __pyx_k_compresslevel, sizeof(__pyx_k_compresslevel), 1, 1, 1},
137977   {&__pyx_kp_506, __pyx_k_506, sizeof(__pyx_k_506), 1, 1, 0},
137978   {&__pyx_kp_open, __pyx_k_open, sizeof(__pyx_k_open), 1, 1, 1},
137979   {&__pyx_kp_507, __pyx_k_507, sizeof(__pyx_k_507), 1, 1, 0},
137980   {&__pyx_kp_510, __pyx_k_510, sizeof(__pyx_k_510), 1, 1, 0},
137981   {&__pyx_kp_512, __pyx_k_512, sizeof(__pyx_k_512), 1, 1, 0},
137982   {&__pyx_kp_517, __pyx_k_517, sizeof(__pyx_k_517), 1, 1, 0},
137983   {&__pyx_kp_518, __pyx_k_518, sizeof(__pyx_k_518), 1, 1, 0},
137984   {&__pyx_kp_521, __pyx_k_521, sizeof(__pyx_k_521), 1, 1, 0},
137985   {&__pyx_kp_522, __pyx_k_522, sizeof(__pyx_k_522), 1, 1, 0},
137986   {&__pyx_kp_530, __pyx_k_530, sizeof(__pyx_k_530), 1, 1, 0},
137987   {&__pyx_kp_531, __pyx_k_531, sizeof(__pyx_k_531), 1, 1, 0},
137988   {&__pyx_kp_533, __pyx_k_533, sizeof(__pyx_k_533), 1, 1, 0},
137989   {&__pyx_kp_534, __pyx_k_534, sizeof(__pyx_k_534), 1, 1, 0},
137990   {&__pyx_kp_535, __pyx_k_535, sizeof(__pyx_k_535), 1, 1, 0},
137991   {&__pyx_kp_536, __pyx_k_536, sizeof(__pyx_k_536), 1, 1, 0},
137992   {&__pyx_kp_544, __pyx_k_544, sizeof(__pyx_k_544), 1, 1, 0},
137993   {&__pyx_kp_545, __pyx_k_545, sizeof(__pyx_k_545), 1, 1, 0},
137994   {&__pyx_kp_XML, __pyx_k_XML, sizeof(__pyx_k_XML), 1, 1, 1},
137995   {&__pyx_kp_548, __pyx_k_548, sizeof(__pyx_k_548), 1, 1, 0},
137996   {&__pyx_kp_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 1, 1, 1},
137997   {&__pyx_kp_sort, __pyx_k_sort, sizeof(__pyx_k_sort), 1, 1, 1},
137998   {&__pyx_kp_565, __pyx_k_565, sizeof(__pyx_k_565), 1, 1, 0},
137999   {&__pyx_kp_UNICODE, __pyx_k_UNICODE, sizeof(__pyx_k_UNICODE), 1, 1, 1},
138000   {&__pyx_kp_IGNORECASE, __pyx_k_IGNORECASE, sizeof(__pyx_k_IGNORECASE), 1, 1, 1},
138001   {&__pyx_kp_567, __pyx_k_567, sizeof(__pyx_k_567), 1, 1, 0},
138002   {&__pyx_kp_search, __pyx_k_search, sizeof(__pyx_k_search), 1, 1, 1},
138003   {&__pyx_kp_568, __pyx_k_568, sizeof(__pyx_k_568), 1, 1, 0},
138004   {&__pyx_kp_569, __pyx_k_569, sizeof(__pyx_k_569), 1, 1, 0},
138005   {&__pyx_kp_groups, __pyx_k_groups, sizeof(__pyx_k_groups), 1, 1, 1},
138006   {&__pyx_kp_571, __pyx_k_571, sizeof(__pyx_k_571), 1, 1, 0},
138007   {&__pyx_kp_SubElement, __pyx_k_SubElement, sizeof(__pyx_k_SubElement), 1, 1, 1},
138008   {&__pyx_kp_573, __pyx_k_573, sizeof(__pyx_k_573), 1, 1, 0},
138009   {&__pyx_kp_574, __pyx_k_574, sizeof(__pyx_k_574), 1, 1, 0},
138010   {&__pyx_kp_575, __pyx_k_575, sizeof(__pyx_k_575), 1, 1, 0},
138011   {&__pyx_kp_577, __pyx_k_577, sizeof(__pyx_k_577), 0, 1, 0},
138012   {&__pyx_kp_578, __pyx_k_578, sizeof(__pyx_k_578), 0, 1, 0},
138013   {&__pyx_kp_579, __pyx_k_579, sizeof(__pyx_k_579), 0, 1, 0},
138014   {&__pyx_kp_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 1, 1, 1},
138015   {&__pyx_kp_583, __pyx_k_583, sizeof(__pyx_k_583), 1, 1, 0},
138016   {&__pyx_kp_584, __pyx_k_584, sizeof(__pyx_k_584), 1, 1, 0},
138017   {&__pyx_kp_585, __pyx_k_585, sizeof(__pyx_k_585), 1, 1, 0},
138018   {&__pyx_kp_586, __pyx_k_586, sizeof(__pyx_k_586), 1, 1, 0},
138019   {&__pyx_kp_is_attribute, __pyx_k_is_attribute, sizeof(__pyx_k_is_attribute), 1, 1, 1},
138020   {&__pyx_kp_is_tail, __pyx_k_is_tail, sizeof(__pyx_k_is_tail), 1, 1, 1},
138021   {&__pyx_kp_is_text, __pyx_k_is_text, sizeof(__pyx_k_is_text), 1, 1, 1},
138022   {&__pyx_kp_resolvers, __pyx_k_resolvers, sizeof(__pyx_k_resolvers), 1, 1, 1},
138023   {&__pyx_kp_607, __pyx_k_607, sizeof(__pyx_k_607), 1, 1, 0},
138024   {&__pyx_kp_608, __pyx_k_608, sizeof(__pyx_k_608), 1, 1, 0},
138025   {&__pyx_kp_609, __pyx_k_609, sizeof(__pyx_k_609), 1, 1, 0},
138026   {&__pyx_kp_610, __pyx_k_610, sizeof(__pyx_k_610), 1, 1, 0},
138027   {&__pyx_kp_611, __pyx_k_611, sizeof(__pyx_k_611), 1, 1, 0},
138028   {&__pyx_kp_options, __pyx_k_options, sizeof(__pyx_k_options), 1, 1, 1},
138029   {&__pyx_kp_ElementTree, __pyx_k_ElementTree, sizeof(__pyx_k_ElementTree), 1, 1, 1},
138030   {&__pyx_kp_628, __pyx_k_628, sizeof(__pyx_k_628), 1, 1, 0},
138031   {&__pyx_kp_635, __pyx_k_635, sizeof(__pyx_k_635), 1, 1, 0},
138032   {&__pyx_kp_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 1, 1, 1},
138033   {&__pyx_kp_652, __pyx_k_652, sizeof(__pyx_k_652), 1, 1, 0},
138034   {&__pyx_kp_37, __pyx_k_37, sizeof(__pyx_k_37), 1, 0, 0},
138035   {&__pyx_kp_41, __pyx_k_41, sizeof(__pyx_k_41), 1, 0, 0},
138036   {&__pyx_kp_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 0, 0},
138037   {&__pyx_kp_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 0, 0},
138038   {&__pyx_kp_46, __pyx_k_46, sizeof(__pyx_k_46), 0, 0, 0},
138039   {&__pyx_kp_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 0},
138040   {&__pyx_kp_50, __pyx_k_50, sizeof(__pyx_k_50), 0, 0, 0},
138041   {&__pyx_kp_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 0, 0},
138042   {&__pyx_kp_54, __pyx_k_54, sizeof(__pyx_k_54), 0, 0, 0},
138043   {&__pyx_kp_56, __pyx_k_56, sizeof(__pyx_k_56), 0, 0, 0},
138044   {&__pyx_kp_58, __pyx_k_58, sizeof(__pyx_k_58), 1, 0, 0},
138045   {&__pyx_kp_59, __pyx_k_59, sizeof(__pyx_k_59), 1, 0, 0},
138046   {&__pyx_kp_61, __pyx_k_61, sizeof(__pyx_k_61), 1, 0, 0},
138047   {&__pyx_kp_62, __pyx_k_62, sizeof(__pyx_k_62), 1, 0, 0},
138048   {&__pyx_kp_64, __pyx_k_64, sizeof(__pyx_k_64), 1, 0, 0},
138049   {&__pyx_kp_68, __pyx_k_68, sizeof(__pyx_k_68), 1, 0, 0},
138050   {&__pyx_kp_69, __pyx_k_69, sizeof(__pyx_k_69), 1, 0, 0},
138051   {&__pyx_kp_70, __pyx_k_70, sizeof(__pyx_k_70), 1, 0, 0},
138052   {&__pyx_kp_71, __pyx_k_71, sizeof(__pyx_k_71), 1, 0, 0},
138053   {&__pyx_kp_72, __pyx_k_72, sizeof(__pyx_k_72), 1, 0, 0},
138054   {&__pyx_kp_73, __pyx_k_73, sizeof(__pyx_k_73), 1, 0, 0},
138055   {&__pyx_kp_74, __pyx_k_74, sizeof(__pyx_k_74), 1, 0, 0},
138056   {&__pyx_kp_75, __pyx_k_75, sizeof(__pyx_k_75), 1, 0, 0},
138057   {&__pyx_kp_76, __pyx_k_76, sizeof(__pyx_k_76), 1, 0, 0},
138058   {&__pyx_kp_77, __pyx_k_77, sizeof(__pyx_k_77), 1, 0, 0},
138059   {&__pyx_kp_78, __pyx_k_78, sizeof(__pyx_k_78), 1, 0, 0},
138060   {&__pyx_kp_79, __pyx_k_79, sizeof(__pyx_k_79), 1, 0, 0},
138061   {&__pyx_kp_80, __pyx_k_80, sizeof(__pyx_k_80), 1, 0, 0},
138062   {&__pyx_kp_81, __pyx_k_81, sizeof(__pyx_k_81), 1, 0, 0},
138063   {&__pyx_kp_82, __pyx_k_82, sizeof(__pyx_k_82), 1, 0, 0},
138064   {&__pyx_kp_83, __pyx_k_83, sizeof(__pyx_k_83), 1, 0, 0},
138065   {&__pyx_kp_84, __pyx_k_84, sizeof(__pyx_k_84), 1, 0, 0},
138066   {&__pyx_kp_85, __pyx_k_85, sizeof(__pyx_k_85), 1, 0, 0},
138067   {&__pyx_kp_86, __pyx_k_86, sizeof(__pyx_k_86), 1, 0, 0},
138068   {&__pyx_kp_111, __pyx_k_111, sizeof(__pyx_k_111), 1, 0, 0},
138069   {&__pyx_kp_113, __pyx_k_113, sizeof(__pyx_k_113), 1, 0, 0},
138070   {&__pyx_kp_114, __pyx_k_114, sizeof(__pyx_k_114), 1, 0, 0},
138071   {&__pyx_kp_115, __pyx_k_115, sizeof(__pyx_k_115), 1, 0, 0},
138072   {&__pyx_kp_116, __pyx_k_116, sizeof(__pyx_k_116), 1, 0, 0},
138073   {&__pyx_kp_150, __pyx_k_150, sizeof(__pyx_k_150), 1, 0, 0},
138074   {&__pyx_kp_167, __pyx_k_167, sizeof(__pyx_k_167), 1, 0, 0},
138075   {&__pyx_kp_168, __pyx_k_168, sizeof(__pyx_k_168), 1, 0, 0},
138076   {&__pyx_kp_169, __pyx_k_169, sizeof(__pyx_k_169), 1, 0, 0},
138077   {&__pyx_kp_170, __pyx_k_170, sizeof(__pyx_k_170), 1, 0, 0},
138078   {&__pyx_kp_171, __pyx_k_171, sizeof(__pyx_k_171), 1, 0, 0},
138079   {&__pyx_kp_183, __pyx_k_183, sizeof(__pyx_k_183), 0, 0, 0},
138080   {&__pyx_kp_184, __pyx_k_184, sizeof(__pyx_k_184), 0, 0, 0},
138081   {&__pyx_kp_187, __pyx_k_187, sizeof(__pyx_k_187), 1, 0, 0},
138082   {&__pyx_kp_188, __pyx_k_188, sizeof(__pyx_k_188), 1, 0, 0},
138083   {&__pyx_kp_189, __pyx_k_189, sizeof(__pyx_k_189), 1, 0, 0},
138084   {&__pyx_kp_190, __pyx_k_190, sizeof(__pyx_k_190), 1, 0, 0},
138085   {&__pyx_kp_191, __pyx_k_191, sizeof(__pyx_k_191), 1, 0, 0},
138086   {&__pyx_kp_201, __pyx_k_201, sizeof(__pyx_k_201), 1, 0, 0},
138087   {&__pyx_kp_202, __pyx_k_202, sizeof(__pyx_k_202), 1, 0, 0},
138088   {&__pyx_kp_203, __pyx_k_203, sizeof(__pyx_k_203), 1, 0, 0},
138089   {&__pyx_kp_204, __pyx_k_204, sizeof(__pyx_k_204), 1, 0, 0},
138090   {&__pyx_kp_205, __pyx_k_205, sizeof(__pyx_k_205), 1, 0, 0},
138091   {&__pyx_kp_206, __pyx_k_206, sizeof(__pyx_k_206), 1, 0, 0},
138092   {&__pyx_kp_207, __pyx_k_207, sizeof(__pyx_k_207), 1, 0, 0},
138093   {&__pyx_kp_208, __pyx_k_208, sizeof(__pyx_k_208), 1, 0, 0},
138094   {&__pyx_kp_210, __pyx_k_210, sizeof(__pyx_k_210), 1, 0, 0},
138095   {&__pyx_kp_211, __pyx_k_211, sizeof(__pyx_k_211), 1, 0, 0},
138096   {&__pyx_kp_212, __pyx_k_212, sizeof(__pyx_k_212), 1, 0, 0},
138097   {&__pyx_kp_214, __pyx_k_214, sizeof(__pyx_k_214), 1, 0, 0},
138098   {&__pyx_kp_215, __pyx_k_215, sizeof(__pyx_k_215), 1, 0, 0},
138099   {&__pyx_kp_217, __pyx_k_217, sizeof(__pyx_k_217), 1, 0, 0},
138100   {&__pyx_kp_219, __pyx_k_219, sizeof(__pyx_k_219), 1, 0, 0},
138101   {&__pyx_kp_221, __pyx_k_221, sizeof(__pyx_k_221), 1, 0, 0},
138102   {&__pyx_kp_223, __pyx_k_223, sizeof(__pyx_k_223), 1, 0, 0},
138103   {&__pyx_kp_225, __pyx_k_225, sizeof(__pyx_k_225), 1, 0, 0},
138104   {&__pyx_kp_226, __pyx_k_226, sizeof(__pyx_k_226), 1, 0, 0},
138105   {&__pyx_kp_227, __pyx_k_227, sizeof(__pyx_k_227), 1, 0, 0},
138106   {&__pyx_kp_231, __pyx_k_231, sizeof(__pyx_k_231), 1, 0, 0},
138107   {&__pyx_kp_232, __pyx_k_232, sizeof(__pyx_k_232), 1, 0, 0},
138108   {&__pyx_kp_233, __pyx_k_233, sizeof(__pyx_k_233), 1, 0, 0},
138109   {&__pyx_kp_234, __pyx_k_234, sizeof(__pyx_k_234), 1, 0, 0},
138110   {&__pyx_kp_235, __pyx_k_235, sizeof(__pyx_k_235), 1, 0, 0},
138111   {&__pyx_kp_236, __pyx_k_236, sizeof(__pyx_k_236), 1, 0, 0},
138112   {&__pyx_kp_237, __pyx_k_237, sizeof(__pyx_k_237), 1, 0, 0},
138113   {&__pyx_kp_239, __pyx_k_239, sizeof(__pyx_k_239), 1, 0, 0},
138114   {&__pyx_kp_240, __pyx_k_240, sizeof(__pyx_k_240), 1, 0, 0},
138115   {&__pyx_kp_241, __pyx_k_241, sizeof(__pyx_k_241), 0, 0, 0},
138116   {&__pyx_kp_242, __pyx_k_242, sizeof(__pyx_k_242), 0, 0, 0},
138117   {&__pyx_kp_243, __pyx_k_243, sizeof(__pyx_k_243), 0, 0, 0},
138118   {&__pyx_kp_244, __pyx_k_244, sizeof(__pyx_k_244), 1, 0, 0},
138119   {&__pyx_kp_245, __pyx_k_245, sizeof(__pyx_k_245), 0, 0, 0},
138120   {&__pyx_kp_246, __pyx_k_246, sizeof(__pyx_k_246), 0, 0, 0},
138121   {&__pyx_kp_248, __pyx_k_248, sizeof(__pyx_k_248), 1, 0, 0},
138122   {&__pyx_kp_249, __pyx_k_249, sizeof(__pyx_k_249), 1, 0, 0},
138123   {&__pyx_kp_250, __pyx_k_250, sizeof(__pyx_k_250), 1, 0, 0},
138124   {&__pyx_kp_251, __pyx_k_251, sizeof(__pyx_k_251), 1, 0, 0},
138125   {&__pyx_kp_252, __pyx_k_252, sizeof(__pyx_k_252), 1, 0, 0},
138126   {&__pyx_kp_253, __pyx_k_253, sizeof(__pyx_k_253), 1, 0, 0},
138127   {&__pyx_kp_254, __pyx_k_254, sizeof(__pyx_k_254), 1, 0, 0},
138128   {&__pyx_kp_255, __pyx_k_255, sizeof(__pyx_k_255), 1, 0, 0},
138129   {&__pyx_kp_256, __pyx_k_256, sizeof(__pyx_k_256), 1, 0, 0},
138130   {&__pyx_kp_258, __pyx_k_258, sizeof(__pyx_k_258), 1, 0, 0},
138131   {&__pyx_kp_260, __pyx_k_260, sizeof(__pyx_k_260), 1, 0, 0},
138132   {&__pyx_kp_261, __pyx_k_261, sizeof(__pyx_k_261), 1, 0, 0},
138133   {&__pyx_kp_262, __pyx_k_262, sizeof(__pyx_k_262), 1, 0, 0},
138134   {&__pyx_kp_263, __pyx_k_263, sizeof(__pyx_k_263), 1, 0, 0},
138135   {&__pyx_kp_264, __pyx_k_264, sizeof(__pyx_k_264), 1, 0, 0},
138136   {&__pyx_kp_266, __pyx_k_266, sizeof(__pyx_k_266), 1, 0, 0},
138137   {&__pyx_kp_268, __pyx_k_268, sizeof(__pyx_k_268), 1, 0, 0},
138138   {&__pyx_kp_270, __pyx_k_270, sizeof(__pyx_k_270), 1, 0, 0},
138139   {&__pyx_kp_280, __pyx_k_280, sizeof(__pyx_k_280), 1, 0, 0},
138140   {&__pyx_kp_281, __pyx_k_281, sizeof(__pyx_k_281), 1, 0, 0},
138141   {&__pyx_kp_282, __pyx_k_282, sizeof(__pyx_k_282), 1, 0, 0},
138142   {&__pyx_kp_286, __pyx_k_286, sizeof(__pyx_k_286), 1, 0, 0},
138143   {&__pyx_kp_287, __pyx_k_287, sizeof(__pyx_k_287), 1, 0, 0},
138144   {&__pyx_kp_288, __pyx_k_288, sizeof(__pyx_k_288), 1, 0, 0},
138145   {&__pyx_kp_289, __pyx_k_289, sizeof(__pyx_k_289), 1, 0, 0},
138146   {&__pyx_kp_290, __pyx_k_290, sizeof(__pyx_k_290), 1, 0, 0},
138147   {&__pyx_kp_291, __pyx_k_291, sizeof(__pyx_k_291), 1, 0, 0},
138148   {&__pyx_kp_302, __pyx_k_302, sizeof(__pyx_k_302), 1, 0, 0},
138149   {&__pyx_kp_306, __pyx_k_306, sizeof(__pyx_k_306), 1, 0, 0},
138150   {&__pyx_kp_308, __pyx_k_308, sizeof(__pyx_k_308), 1, 0, 0},
138151   {&__pyx_kp_309, __pyx_k_309, sizeof(__pyx_k_309), 1, 0, 0},
138152   {&__pyx_kp_310, __pyx_k_310, sizeof(__pyx_k_310), 1, 0, 0},
138153   {&__pyx_kp_311, __pyx_k_311, sizeof(__pyx_k_311), 1, 0, 0},
138154   {&__pyx_kp_312, __pyx_k_312, sizeof(__pyx_k_312), 1, 0, 0},
138155   {&__pyx_kp_313, __pyx_k_313, sizeof(__pyx_k_313), 1, 0, 0},
138156   {&__pyx_kp_314, __pyx_k_314, sizeof(__pyx_k_314), 1, 0, 0},
138157   {&__pyx_kp_315, __pyx_k_315, sizeof(__pyx_k_315), 1, 0, 0},
138158   {&__pyx_kp_316, __pyx_k_316, sizeof(__pyx_k_316), 1, 0, 0},
138159   {&__pyx_kp_317, __pyx_k_317, sizeof(__pyx_k_317), 1, 0, 0},
138160   {&__pyx_kp_318, __pyx_k_318, sizeof(__pyx_k_318), 1, 0, 0},
138161   {&__pyx_kp_319, __pyx_k_319, sizeof(__pyx_k_319), 1, 0, 0},
138162   {&__pyx_kp_320, __pyx_k_320, sizeof(__pyx_k_320), 1, 0, 0},
138163   {&__pyx_kp_323, __pyx_k_323, sizeof(__pyx_k_323), 1, 0, 0},
138164   {&__pyx_kp_324, __pyx_k_324, sizeof(__pyx_k_324), 1, 0, 0},
138165   {&__pyx_kp_325, __pyx_k_325, sizeof(__pyx_k_325), 1, 0, 0},
138166   {&__pyx_kp_326, __pyx_k_326, sizeof(__pyx_k_326), 1, 0, 0},
138167   {&__pyx_kp_327, __pyx_k_327, sizeof(__pyx_k_327), 1, 0, 0},
138168   {&__pyx_kp_328, __pyx_k_328, sizeof(__pyx_k_328), 1, 0, 0},
138169   {&__pyx_kp_329, __pyx_k_329, sizeof(__pyx_k_329), 1, 0, 0},
138170   {&__pyx_kp_330, __pyx_k_330, sizeof(__pyx_k_330), 1, 0, 0},
138171   {&__pyx_kp_331, __pyx_k_331, sizeof(__pyx_k_331), 1, 0, 0},
138172   {&__pyx_kp_332, __pyx_k_332, sizeof(__pyx_k_332), 1, 0, 0},
138173   {&__pyx_kp_333, __pyx_k_333, sizeof(__pyx_k_333), 0, 0, 0},
138174   {&__pyx_kp_334, __pyx_k_334, sizeof(__pyx_k_334), 1, 0, 0},
138175   {&__pyx_kp_335, __pyx_k_335, sizeof(__pyx_k_335), 1, 0, 0},
138176   {&__pyx_kp_336, __pyx_k_336, sizeof(__pyx_k_336), 1, 0, 0},
138177   {&__pyx_kp_337, __pyx_k_337, sizeof(__pyx_k_337), 1, 0, 0},
138178   {&__pyx_kp_338, __pyx_k_338, sizeof(__pyx_k_338), 1, 0, 0},
138179   {&__pyx_kp_339, __pyx_k_339, sizeof(__pyx_k_339), 1, 0, 0},
138180   {&__pyx_kp_340, __pyx_k_340, sizeof(__pyx_k_340), 1, 0, 0},
138181   {&__pyx_kp_341, __pyx_k_341, sizeof(__pyx_k_341), 1, 0, 0},
138182   {&__pyx_kp_342, __pyx_k_342, sizeof(__pyx_k_342), 1, 0, 0},
138183   {&__pyx_kp_343, __pyx_k_343, sizeof(__pyx_k_343), 0, 0, 0},
138184   {&__pyx_kp_346, __pyx_k_346, sizeof(__pyx_k_346), 1, 0, 0},
138185   {&__pyx_kp_347, __pyx_k_347, sizeof(__pyx_k_347), 1, 0, 0},
138186   {&__pyx_kp_348, __pyx_k_348, sizeof(__pyx_k_348), 1, 0, 0},
138187   {&__pyx_kp_351, __pyx_k_351, sizeof(__pyx_k_351), 1, 0, 0},
138188   {&__pyx_kp_354, __pyx_k_354, sizeof(__pyx_k_354), 1, 0, 0},
138189   {&__pyx_kp_355, __pyx_k_355, sizeof(__pyx_k_355), 1, 0, 0},
138190   {&__pyx_kp_356, __pyx_k_356, sizeof(__pyx_k_356), 1, 0, 0},
138191   {&__pyx_kp_357, __pyx_k_357, sizeof(__pyx_k_357), 1, 0, 0},
138192   {&__pyx_kp_358, __pyx_k_358, sizeof(__pyx_k_358), 0, 0, 0},
138193   {&__pyx_kp_359, __pyx_k_359, sizeof(__pyx_k_359), 0, 0, 0},
138194   {&__pyx_kp_360, __pyx_k_360, sizeof(__pyx_k_360), 1, 0, 0},
138195   {&__pyx_kp_361, __pyx_k_361, sizeof(__pyx_k_361), 1, 0, 0},
138196   {&__pyx_kp_362, __pyx_k_362, sizeof(__pyx_k_362), 0, 0, 0},
138197   {&__pyx_kp_363, __pyx_k_363, sizeof(__pyx_k_363), 0, 0, 0},
138198   {&__pyx_kp_364, __pyx_k_364, sizeof(__pyx_k_364), 1, 0, 0},
138199   {&__pyx_kp_365, __pyx_k_365, sizeof(__pyx_k_365), 1, 0, 0},
138200   {&__pyx_kp_366, __pyx_k_366, sizeof(__pyx_k_366), 0, 0, 0},
138201   {&__pyx_kp_367, __pyx_k_367, sizeof(__pyx_k_367), 0, 0, 0},
138202   {&__pyx_kp_368, __pyx_k_368, sizeof(__pyx_k_368), 1, 0, 0},
138203   {&__pyx_kp_369, __pyx_k_369, sizeof(__pyx_k_369), 1, 0, 0},
138204   {&__pyx_kp_370, __pyx_k_370, sizeof(__pyx_k_370), 0, 0, 0},
138205   {&__pyx_kp_371, __pyx_k_371, sizeof(__pyx_k_371), 0, 0, 0},
138206   {&__pyx_kp_372, __pyx_k_372, sizeof(__pyx_k_372), 1, 0, 0},
138207   {&__pyx_kp_377, __pyx_k_377, sizeof(__pyx_k_377), 0, 0, 0},
138208   {&__pyx_kp_378, __pyx_k_378, sizeof(__pyx_k_378), 0, 0, 0},
138209   {&__pyx_kp_379, __pyx_k_379, sizeof(__pyx_k_379), 1, 0, 0},
138210   {&__pyx_kp_380, __pyx_k_380, sizeof(__pyx_k_380), 1, 0, 0},
138211   {&__pyx_kp_381, __pyx_k_381, sizeof(__pyx_k_381), 1, 0, 0},
138212   {&__pyx_kp_383, __pyx_k_383, sizeof(__pyx_k_383), 1, 0, 0},
138213   {&__pyx_kp_385, __pyx_k_385, sizeof(__pyx_k_385), 1, 0, 0},
138214   {&__pyx_kp_387, __pyx_k_387, sizeof(__pyx_k_387), 1, 0, 0},
138215   {&__pyx_kp_388, __pyx_k_388, sizeof(__pyx_k_388), 1, 0, 0},
138216   {&__pyx_kp_389, __pyx_k_389, sizeof(__pyx_k_389), 1, 0, 0},
138217   {&__pyx_kp_390, __pyx_k_390, sizeof(__pyx_k_390), 1, 0, 0},
138218   {&__pyx_kp_391, __pyx_k_391, sizeof(__pyx_k_391), 1, 0, 0},
138219   {&__pyx_kp_392, __pyx_k_392, sizeof(__pyx_k_392), 0, 0, 0},
138220   {&__pyx_kp_395, __pyx_k_395, sizeof(__pyx_k_395), 1, 0, 0},
138221   {&__pyx_kp_396, __pyx_k_396, sizeof(__pyx_k_396), 1, 0, 0},
138222   {&__pyx_kp_397, __pyx_k_397, sizeof(__pyx_k_397), 0, 0, 0},
138223   {&__pyx_kp_398, __pyx_k_398, sizeof(__pyx_k_398), 0, 0, 0},
138224   {&__pyx_kp_399, __pyx_k_399, sizeof(__pyx_k_399), 0, 0, 0},
138225   {&__pyx_kp_400, __pyx_k_400, sizeof(__pyx_k_400), 1, 0, 0},
138226   {&__pyx_kp_401, __pyx_k_401, sizeof(__pyx_k_401), 1, 0, 0},
138227   {&__pyx_kp_402, __pyx_k_402, sizeof(__pyx_k_402), 1, 0, 0},
138228   {&__pyx_kp_403, __pyx_k_403, sizeof(__pyx_k_403), 1, 0, 0},
138229   {&__pyx_kp_407, __pyx_k_407, sizeof(__pyx_k_407), 1, 0, 0},
138230   {&__pyx_kp_415, __pyx_k_415, sizeof(__pyx_k_415), 1, 0, 0},
138231   {&__pyx_kp_416, __pyx_k_416, sizeof(__pyx_k_416), 1, 0, 0},
138232   {&__pyx_kp_417, __pyx_k_417, sizeof(__pyx_k_417), 1, 0, 0},
138233   {&__pyx_kp_418, __pyx_k_418, sizeof(__pyx_k_418), 1, 0, 0},
138234   {&__pyx_kp_419, __pyx_k_419, sizeof(__pyx_k_419), 1, 0, 0},
138235   {&__pyx_kp_420, __pyx_k_420, sizeof(__pyx_k_420), 1, 0, 0},
138236   {&__pyx_kp_421, __pyx_k_421, sizeof(__pyx_k_421), 1, 0, 0},
138237   {&__pyx_kp_422, __pyx_k_422, sizeof(__pyx_k_422), 0, 0, 0},
138238   {&__pyx_kp_423, __pyx_k_423, sizeof(__pyx_k_423), 0, 0, 0},
138239   {&__pyx_kp_424, __pyx_k_424, sizeof(__pyx_k_424), 0, 0, 0},
138240   {&__pyx_kp_425, __pyx_k_425, sizeof(__pyx_k_425), 1, 0, 0},
138241   {&__pyx_kp_436, __pyx_k_436, sizeof(__pyx_k_436), 0, 0, 0},
138242   {&__pyx_kp_437, __pyx_k_437, sizeof(__pyx_k_437), 1, 0, 0},
138243   {&__pyx_kp_438, __pyx_k_438, sizeof(__pyx_k_438), 1, 0, 0},
138244   {&__pyx_kp_439, __pyx_k_439, sizeof(__pyx_k_439), 1, 0, 0},
138245   {&__pyx_kp_440, __pyx_k_440, sizeof(__pyx_k_440), 1, 0, 0},
138246   {&__pyx_kp_441, __pyx_k_441, sizeof(__pyx_k_441), 1, 0, 0},
138247   {&__pyx_kp_442, __pyx_k_442, sizeof(__pyx_k_442), 1, 0, 0},
138248   {&__pyx_kp_446, __pyx_k_446, sizeof(__pyx_k_446), 1, 0, 0},
138249   {&__pyx_kp_447, __pyx_k_447, sizeof(__pyx_k_447), 1, 0, 0},
138250   {&__pyx_kp_449, __pyx_k_449, sizeof(__pyx_k_449), 1, 0, 0},
138251   {&__pyx_kp_450, __pyx_k_450, sizeof(__pyx_k_450), 1, 0, 0},
138252   {&__pyx_kp_451, __pyx_k_451, sizeof(__pyx_k_451), 1, 0, 0},
138253   {&__pyx_kp_452, __pyx_k_452, sizeof(__pyx_k_452), 1, 0, 0},
138254   {&__pyx_kp_453, __pyx_k_453, sizeof(__pyx_k_453), 1, 0, 0},
138255   {&__pyx_kp_458, __pyx_k_458, sizeof(__pyx_k_458), 1, 0, 0},
138256   {&__pyx_kp_459, __pyx_k_459, sizeof(__pyx_k_459), 1, 0, 0},
138257   {&__pyx_kp_460, __pyx_k_460, sizeof(__pyx_k_460), 1, 0, 0},
138258   {&__pyx_kp_461, __pyx_k_461, sizeof(__pyx_k_461), 1, 0, 0},
138259   {&__pyx_kp_462, __pyx_k_462, sizeof(__pyx_k_462), 0, 0, 0},
138260   {&__pyx_kp_464, __pyx_k_464, sizeof(__pyx_k_464), 1, 0, 0},
138261   {&__pyx_kp_465, __pyx_k_465, sizeof(__pyx_k_465), 0, 0, 0},
138262   {&__pyx_kp_466, __pyx_k_466, sizeof(__pyx_k_466), 1, 0, 0},
138263   {&__pyx_kp_467, __pyx_k_467, sizeof(__pyx_k_467), 1, 0, 0},
138264   {&__pyx_kp_468, __pyx_k_468, sizeof(__pyx_k_468), 1, 0, 0},
138265   {&__pyx_kp_469, __pyx_k_469, sizeof(__pyx_k_469), 1, 0, 0},
138266   {&__pyx_kp_470, __pyx_k_470, sizeof(__pyx_k_470), 1, 0, 0},
138267   {&__pyx_kp_471, __pyx_k_471, sizeof(__pyx_k_471), 1, 0, 0},
138268   {&__pyx_kp_476, __pyx_k_476, sizeof(__pyx_k_476), 1, 0, 0},
138269   {&__pyx_kp_477, __pyx_k_477, sizeof(__pyx_k_477), 1, 0, 0},
138270   {&__pyx_kp_478, __pyx_k_478, sizeof(__pyx_k_478), 1, 0, 0},
138271   {&__pyx_kp_482, __pyx_k_482, sizeof(__pyx_k_482), 1, 0, 0},
138272   {&__pyx_kp_483, __pyx_k_483, sizeof(__pyx_k_483), 1, 0, 0},
138273   {&__pyx_kp_485, __pyx_k_485, sizeof(__pyx_k_485), 1, 0, 0},
138274   {&__pyx_kp_504, __pyx_k_504, sizeof(__pyx_k_504), 1, 0, 0},
138275   {&__pyx_kp_505, __pyx_k_505, sizeof(__pyx_k_505), 1, 0, 0},
138276   {&__pyx_kp_508, __pyx_k_508, sizeof(__pyx_k_508), 1, 0, 0},
138277   {&__pyx_kp_509, __pyx_k_509, sizeof(__pyx_k_509), 1, 0, 0},
138278   {&__pyx_kp_511, __pyx_k_511, sizeof(__pyx_k_511), 1, 0, 0},
138279   {&__pyx_kp_513, __pyx_k_513, sizeof(__pyx_k_513), 1, 0, 0},
138280   {&__pyx_kp_514, __pyx_k_514, sizeof(__pyx_k_514), 1, 0, 0},
138281   {&__pyx_kp_515, __pyx_k_515, sizeof(__pyx_k_515), 1, 0, 0},
138282   {&__pyx_kp_519, __pyx_k_519, sizeof(__pyx_k_519), 1, 0, 0},
138283   {&__pyx_kp_520, __pyx_k_520, sizeof(__pyx_k_520), 1, 0, 0},
138284   {&__pyx_kp_523, __pyx_k_523, sizeof(__pyx_k_523), 1, 0, 0},
138285   {&__pyx_kp_524, __pyx_k_524, sizeof(__pyx_k_524), 1, 0, 0},
138286   {&__pyx_kp_525, __pyx_k_525, sizeof(__pyx_k_525), 0, 0, 0},
138287   {&__pyx_kp_526, __pyx_k_526, sizeof(__pyx_k_526), 1, 0, 0},
138288   {&__pyx_kp_527, __pyx_k_527, sizeof(__pyx_k_527), 1, 0, 0},
138289   {&__pyx_kp_528, __pyx_k_528, sizeof(__pyx_k_528), 0, 0, 0},
138290   {&__pyx_kp_529, __pyx_k_529, sizeof(__pyx_k_529), 0, 0, 0},
138291   {&__pyx_kp_532, __pyx_k_532, sizeof(__pyx_k_532), 1, 0, 0},
138292   {&__pyx_kp_537, __pyx_k_537, sizeof(__pyx_k_537), 1, 0, 0},
138293   {&__pyx_kp_538, __pyx_k_538, sizeof(__pyx_k_538), 1, 0, 0},
138294   {&__pyx_kp_539, __pyx_k_539, sizeof(__pyx_k_539), 1, 0, 0},
138295   {&__pyx_kp_540, __pyx_k_540, sizeof(__pyx_k_540), 1, 0, 0},
138296   {&__pyx_kp_541, __pyx_k_541, sizeof(__pyx_k_541), 1, 0, 0},
138297   {&__pyx_kp_542, __pyx_k_542, sizeof(__pyx_k_542), 1, 0, 0},
138298   {&__pyx_kp_543, __pyx_k_543, sizeof(__pyx_k_543), 1, 0, 0},
138299   {&__pyx_kp_546, __pyx_k_546, sizeof(__pyx_k_546), 1, 0, 0},
138300   {&__pyx_kp_547, __pyx_k_547, sizeof(__pyx_k_547), 1, 0, 0},
138301   {&__pyx_kp_549, __pyx_k_549, sizeof(__pyx_k_549), 1, 0, 0},
138302   {&__pyx_kp_550, __pyx_k_550, sizeof(__pyx_k_550), 1, 0, 0},
138303   {&__pyx_kp_551, __pyx_k_551, sizeof(__pyx_k_551), 1, 0, 0},
138304   {&__pyx_kp_552, __pyx_k_552, sizeof(__pyx_k_552), 1, 0, 0},
138305   {&__pyx_kp_553, __pyx_k_553, sizeof(__pyx_k_553), 0, 0, 0},
138306   {&__pyx_kp_554, __pyx_k_554, sizeof(__pyx_k_554), 0, 0, 0},
138307   {&__pyx_kp_555, __pyx_k_555, sizeof(__pyx_k_555), 0, 0, 0},
138308   {&__pyx_kp_172, __pyx_k_172, sizeof(__pyx_k_172), 1, 0, 0},
138309   {&__pyx_kp_173, __pyx_k_173, sizeof(__pyx_k_173), 1, 0, 0},
138310   {&__pyx_kp_556, __pyx_k_556, sizeof(__pyx_k_556), 1, 0, 0},
138311   {&__pyx_kp_557, __pyx_k_557, sizeof(__pyx_k_557), 1, 0, 0},
138312   {&__pyx_kp_558, __pyx_k_558, sizeof(__pyx_k_558), 1, 0, 0},
138313   {&__pyx_kp_559, __pyx_k_559, sizeof(__pyx_k_559), 1, 0, 0},
138314   {&__pyx_kp_560, __pyx_k_560, sizeof(__pyx_k_560), 1, 0, 0},
138315   {&__pyx_kp_561, __pyx_k_561, sizeof(__pyx_k_561), 1, 0, 0},
138316   {&__pyx_kp_562, __pyx_k_562, sizeof(__pyx_k_562), 1, 0, 0},
138317   {&__pyx_kp_563, __pyx_k_563, sizeof(__pyx_k_563), 1, 0, 0},
138318   {&__pyx_kp_564, __pyx_k_564, sizeof(__pyx_k_564), 1, 0, 0},
138319   {&__pyx_kp_566, __pyx_k_566, sizeof(__pyx_k_566), 1, 0, 0},
138320   {&__pyx_kp_570, __pyx_k_570, sizeof(__pyx_k_570), 1, 0, 0},
138321   {&__pyx_kp_572, __pyx_k_572, sizeof(__pyx_k_572), 1, 0, 0},
138322   {&__pyx_kp_576, __pyx_k_576, sizeof(__pyx_k_576), 0, 0, 0},
138323   {&__pyx_kp_580, __pyx_k_580, sizeof(__pyx_k_580), 1, 0, 0},
138324   {&__pyx_kp_581, __pyx_k_581, sizeof(__pyx_k_581), 1, 0, 0},
138325   {&__pyx_kp_582, __pyx_k_582, sizeof(__pyx_k_582), 1, 0, 0},
138326   {&__pyx_kp_587, __pyx_k_587, sizeof(__pyx_k_587), 1, 0, 0},
138327   {&__pyx_kp_588, __pyx_k_588, sizeof(__pyx_k_588), 1, 0, 0},
138328   {&__pyx_kp_589, __pyx_k_589, sizeof(__pyx_k_589), 1, 0, 0},
138329   {&__pyx_kp_590, __pyx_k_590, sizeof(__pyx_k_590), 1, 0, 0},
138330   {&__pyx_kp_591, __pyx_k_591, sizeof(__pyx_k_591), 1, 0, 0},
138331   {&__pyx_kp_592, __pyx_k_592, sizeof(__pyx_k_592), 1, 0, 0},
138332   {&__pyx_kp_593, __pyx_k_593, sizeof(__pyx_k_593), 1, 0, 0},
138333   {&__pyx_kp_594, __pyx_k_594, sizeof(__pyx_k_594), 1, 0, 0},
138334   {&__pyx_kp_595, __pyx_k_595, sizeof(__pyx_k_595), 1, 0, 0},
138335   {&__pyx_kp_596, __pyx_k_596, sizeof(__pyx_k_596), 0, 0, 0},
138336   {&__pyx_kp_602, __pyx_k_602, sizeof(__pyx_k_602), 0, 0, 0},
138337   {&__pyx_kp_606, __pyx_k_606, sizeof(__pyx_k_606), 1, 0, 0},
138338   {&__pyx_kp_612, __pyx_k_612, sizeof(__pyx_k_612), 1, 0, 0},
138339   {&__pyx_kp_613, __pyx_k_613, sizeof(__pyx_k_613), 1, 0, 0},
138340   {&__pyx_kp_614, __pyx_k_614, sizeof(__pyx_k_614), 1, 0, 0},
138341   {&__pyx_kp_615, __pyx_k_615, sizeof(__pyx_k_615), 1, 0, 0},
138342   {&__pyx_kp_616, __pyx_k_616, sizeof(__pyx_k_616), 1, 0, 0},
138343   {&__pyx_kp_617, __pyx_k_617, sizeof(__pyx_k_617), 1, 0, 0},
138344   {&__pyx_kp_618, __pyx_k_618, sizeof(__pyx_k_618), 1, 0, 0},
138345   {&__pyx_kp_619, __pyx_k_619, sizeof(__pyx_k_619), 1, 0, 0},
138346   {&__pyx_kp_620, __pyx_k_620, sizeof(__pyx_k_620), 1, 0, 0},
138347   {&__pyx_kp_621, __pyx_k_621, sizeof(__pyx_k_621), 1, 0, 0},
138348   {&__pyx_kp_622, __pyx_k_622, sizeof(__pyx_k_622), 0, 0, 0},
138349   {&__pyx_kp_623, __pyx_k_623, sizeof(__pyx_k_623), 1, 0, 0},
138350   {&__pyx_kp_627, __pyx_k_627, sizeof(__pyx_k_627), 1, 0, 0},
138351   {&__pyx_kp_629, __pyx_k_629, sizeof(__pyx_k_629), 1, 0, 0},
138352   {&__pyx_kp_630, __pyx_k_630, sizeof(__pyx_k_630), 1, 0, 0},
138353   {&__pyx_kp_631, __pyx_k_631, sizeof(__pyx_k_631), 1, 0, 0},
138354   {&__pyx_kp_632, __pyx_k_632, sizeof(__pyx_k_632), 1, 0, 0},
138355   {&__pyx_kp_633, __pyx_k_633, sizeof(__pyx_k_633), 1, 0, 0},
138356   {&__pyx_kp_634, __pyx_k_634, sizeof(__pyx_k_634), 1, 0, 0},
138357   {&__pyx_kp_636, __pyx_k_636, sizeof(__pyx_k_636), 1, 0, 0},
138358   {&__pyx_kp_637, __pyx_k_637, sizeof(__pyx_k_637), 1, 0, 0},
138359   {&__pyx_kp_638, __pyx_k_638, sizeof(__pyx_k_638), 1, 0, 0},
138360   {&__pyx_kp_639, __pyx_k_639, sizeof(__pyx_k_639), 1, 0, 0},
138361   {&__pyx_kp_640, __pyx_k_640, sizeof(__pyx_k_640), 1, 0, 0},
138362   {&__pyx_kp_641, __pyx_k_641, sizeof(__pyx_k_641), 1, 0, 0},
138363   {&__pyx_kp_642, __pyx_k_642, sizeof(__pyx_k_642), 1, 0, 0},
138364   {&__pyx_kp_643, __pyx_k_643, sizeof(__pyx_k_643), 1, 0, 0},
138365   {&__pyx_kp_645, __pyx_k_645, sizeof(__pyx_k_645), 1, 0, 0},
138366   {&__pyx_kp_646, __pyx_k_646, sizeof(__pyx_k_646), 1, 0, 0},
138367   {&__pyx_kp_647, __pyx_k_647, sizeof(__pyx_k_647), 1, 0, 0},
138368   {&__pyx_kp_650, __pyx_k_650, sizeof(__pyx_k_650), 1, 0, 0},
138369   {&__pyx_kp_651, __pyx_k_651, sizeof(__pyx_k_651), 1, 0, 0},
138370   {&__pyx_kp_653, __pyx_k_653, sizeof(__pyx_k_653), 1, 0, 0},
138371   {&__pyx_kp_654, __pyx_k_654, sizeof(__pyx_k_654), 1, 0, 0},
138372   {&__pyx_kp_655, __pyx_k_655, sizeof(__pyx_k_655), 1, 0, 0},
138373   {&__pyx_kp_656, __pyx_k_656, sizeof(__pyx_k_656), 1, 0, 0},
138374   {&__pyx_kp_657, __pyx_k_657, sizeof(__pyx_k_657), 1, 0, 0},
138375   {&__pyx_kp_658, __pyx_k_658, sizeof(__pyx_k_658), 1, 0, 0},
138376   {&__pyx_kp_660, __pyx_k_660, sizeof(__pyx_k_660), 1, 0, 0},
138377   {&__pyx_kp_661, __pyx_k_661, sizeof(__pyx_k_661), 1, 0, 0},
138378   {&__pyx_kp_662, __pyx_k_662, sizeof(__pyx_k_662), 1, 0, 0},
138379   {&__pyx_kp_663, __pyx_k_663, sizeof(__pyx_k_663), 1, 0, 0},
138380   {&__pyx_kp_664, __pyx_k_664, sizeof(__pyx_k_664), 1, 0, 0},
138381   {&__pyx_kp_666, __pyx_k_666, sizeof(__pyx_k_666), 1, 0, 0},
138382   {&__pyx_kp_667, __pyx_k_667, sizeof(__pyx_k_667), 1, 0, 0},
138383   {&__pyx_kp_668, __pyx_k_668, sizeof(__pyx_k_668), 1, 0, 0},
138384   {&__pyx_kp_669, __pyx_k_669, sizeof(__pyx_k_669), 1, 0, 0},
138385   {&__pyx_kp_670, __pyx_k_670, sizeof(__pyx_k_670), 1, 0, 0},
138386   {&__pyx_kp_671, __pyx_k_671, sizeof(__pyx_k_671), 1, 0, 0},
138387   {&__pyx_kp_672, __pyx_k_672, sizeof(__pyx_k_672), 1, 0, 0},
138388   {&__pyx_kp_673, __pyx_k_673, sizeof(__pyx_k_673), 1, 0, 0},
138389   {0, 0, 0, 0, 0, 0}
138390 };
138391 static int __Pyx_InitCachedBuiltins(void) {
138392   __pyx_builtin_ImportError = __Pyx_GetName(__pyx_b, __pyx_kp_ImportError); if (!__pyx_builtin_ImportError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138393   __pyx_builtin_AttributeError = __Pyx_GetName(__pyx_b, __pyx_kp_AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138394   __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_kp_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138395   __pyx_builtin_SyntaxError = __Pyx_GetName(__pyx_b, __pyx_kp_SyntaxError); if (!__pyx_builtin_SyntaxError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138396   __pyx_builtin_super = __Pyx_GetName(__pyx_b, __pyx_kp_super); if (!__pyx_builtin_super) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138397   __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_kp_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138398   __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_kp_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138399   __pyx_builtin_KeyError = __Pyx_GetName(__pyx_b, __pyx_kp_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138400   __pyx_builtin_UnicodeEncodeError = __Pyx_GetName(__pyx_b, __pyx_kp_UnicodeEncodeError); if (!__pyx_builtin_UnicodeEncodeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138401   __pyx_builtin_UnicodeDecodeError = __Pyx_GetName(__pyx_b, __pyx_kp_UnicodeDecodeError); if (!__pyx_builtin_UnicodeDecodeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138402   __pyx_builtin_IndexError = __Pyx_GetName(__pyx_b, __pyx_kp_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138403   __pyx_builtin_id = __Pyx_GetName(__pyx_b, __pyx_kp_id); if (!__pyx_builtin_id) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138404   __pyx_builtin_FutureWarning = __Pyx_GetName(__pyx_b, __pyx_kp_FutureWarning); if (!__pyx_builtin_FutureWarning) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138405   __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_kp_StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138406   __pyx_builtin_IOError = __Pyx_GetName(__pyx_b, __pyx_kp_IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138407   __pyx_builtin_LookupError = __Pyx_GetName(__pyx_b, __pyx_kp_LookupError); if (!__pyx_builtin_LookupError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138408   __pyx_builtin_open = __Pyx_GetName(__pyx_b, __pyx_kp_open); if (!__pyx_builtin_open) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138409   __pyx_builtin_enumerate = __Pyx_GetName(__pyx_b, __pyx_kp_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138410   __pyx_builtin_NotImplementedError = __Pyx_GetName(__pyx_b, __pyx_kp_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138411   __pyx_builtin_AssertionError = __Pyx_GetName(__pyx_b, __pyx_kp_AssertionError); if (!__pyx_builtin_AssertionError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138412   return 0;
138413   __pyx_L1_error:;
138414   return -1;
138415 }
138416
138417 static int __Pyx_InitGlobals(void) {
138418   __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
138419   __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
138420   __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
138421   __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
138422   __pyx_int_neg_300 = PyInt_FromLong(-300); if (unlikely(!__pyx_int_neg_300)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
138423   __pyx_int_neg_200 = PyInt_FromLong(-200); if (unlikely(!__pyx_int_neg_200)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
138424   __pyx_int_neg_100 = PyInt_FromLong(-100); if (unlikely(!__pyx_int_neg_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
138425   __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
138426   __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
138427   __pyx_int_32768 = PyInt_FromLong(32768); if (unlikely(!__pyx_int_32768)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
138428   #if PY_VERSION_HEX < 0x02040000
138429   if (unlikely(__Pyx_Py23SetsImport() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138430   #endif
138431   if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
138432   return 0;
138433   __pyx_L1_error:;
138434   return -1;
138435 }
138436
138437 #if PY_MAJOR_VERSION < 3
138438 PyMODINIT_FUNC initetree(void); /*proto*/
138439 PyMODINIT_FUNC initetree(void)
138440 #else
138441 PyMODINIT_FUNC PyInit_etree(void); /*proto*/
138442 PyMODINIT_FUNC PyInit_etree(void)
138443 #endif
138444 {
138445   PyObject *__pyx_1 = 0;
138446   int __pyx_2;
138447   PyObject *__pyx_3 = 0;
138448   PyObject *__pyx_4 = 0;
138449   PyObject *__pyx_t_1 = NULL;
138450   PyObject *__pyx_t_2 = NULL;
138451   PyObject *__pyx_t_3 = NULL;
138452   PyObject *__pyx_t_4 = NULL;
138453   int __pyx_t_5;
138454   int __pyx_t_6;
138455   PyObject *__pyx_t_7 = NULL;
138456   PyObject *__pyx_t_8 = NULL;
138457   PyObject *__pyx_t_9 = NULL;
138458   PyObject *__pyx_t_10 = NULL;
138459   PyObject *__pyx_t_11 = NULL;
138460   __pyx_init_filenames();
138461   #ifdef CYTHON_REFNANNY
138462   void* __pyx_refchk = NULL;
138463   __Pyx_Refnanny = __Pyx_ImportRefcountAPI("refnanny");
138464   if (!__Pyx_Refnanny) {
138465       PyErr_Clear();
138466       __Pyx_Refnanny = __Pyx_ImportRefcountAPI("Cython.Runtime.refnanny");
138467       if (!__Pyx_Refnanny)
138468           Py_FatalError("failed to import refnanny module");
138469   }
138470   __pyx_refchk = __Pyx_Refnanny->NewContext("PyMODINIT_FUNC PyInit_etree(void)", __LINE__, __FILE__);
138471   #endif
138472   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138473   #if PY_MAJOR_VERSION < 3
138474   __pyx_empty_bytes = PyString_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138475   #else
138476   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138477   #endif
138478   /*--- Library function declarations ---*/
138479   /*--- Threads initialization code ---*/
138480   #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
138481   #ifdef WITH_THREAD /* Python build with threading support? */
138482   PyEval_InitThreads();
138483   #endif
138484   #endif
138485   /*--- Module creation code ---*/
138486   #if PY_MAJOR_VERSION < 3
138487   __pyx_m = Py_InitModule4(__Pyx_NAMESTR("etree"), __pyx_methods, __pyx_mdoc, 0, PYTHON_API_VERSION);
138488   #else
138489   __pyx_m = PyModule_Create(&__pyx_moduledef);
138490   #endif
138491   if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
138492   #if PY_MAJOR_VERSION < 3
138493   Py_INCREF(__pyx_m);
138494   #endif
138495   __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
138496   if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
138497   if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
138498   if (__pyx_module_is_main_lxml__etree) {
138499     if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_kp___main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
138500   }
138501   /*--- Initialize various global constants etc. ---*/
138502   if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138503   /*--- Builtin init code ---*/
138504   if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138505   __pyx_skip_dispatch = 0;
138506   /*--- Global init code ---*/
138507   __pyx_v_4lxml_5etree__unicode = Py_None; Py_INCREF(Py_None);
138508   __pyx_v_4lxml_5etree_os_path_abspath = Py_None; Py_INCREF(Py_None);
138509   __pyx_v_4lxml_5etree_BytesIO = Py_None; Py_INCREF(Py_None);
138510   __pyx_v_4lxml_5etree_StringIO = Py_None; Py_INCREF(Py_None);
138511   __pyx_v_4lxml_5etree__elementpath = Py_None; Py_INCREF(Py_None);
138512   __pyx_v_4lxml_5etree_sys = Py_None; Py_INCREF(Py_None);
138513   __pyx_v_4lxml_5etree_re = Py_None; Py_INCREF(Py_None);
138514   __pyx_v_4lxml_5etree_gzip = Py_None; Py_INCREF(Py_None);
138515   __pyx_v_4lxml_5etree_ITER_EMPTY = Py_None; Py_INCREF(Py_None);
138516   __pyx_v_4lxml_5etree_EMPTY_READ_ONLY_DICT = Py_None; Py_INCREF(Py_None);
138517   __pyx_v_4lxml_5etree__FILENAME_ENCODING = Py_None; Py_INCREF(Py_None);
138518   __pyx_v_4lxml_5etree__DEFAULT_NAMESPACE_PREFIXES = Py_None; Py_INCREF(Py_None);
138519   __pyx_v_4lxml_5etree__LxmlError = Py_None; Py_INCREF(Py_None);
138520   __pyx_v_4lxml_5etree_error_super_init = Py_None; Py_INCREF(Py_None);
138521   __pyx_v_4lxml_5etree___RE_XML_ENCODING = Py_None; Py_INCREF(Py_None);
138522   __pyx_v_4lxml_5etree___REPLACE_XML_ENCODING = Py_None; Py_INCREF(Py_None);
138523   __pyx_v_4lxml_5etree___HAS_XML_ENCODING = Py_None; Py_INCREF(Py_None);
138524   __pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)Py_None); Py_INCREF(Py_None);
138525   __pyx_v_4lxml_5etree___ERROR_LEVELS = Py_None; Py_INCREF(Py_None);
138526   __pyx_v_4lxml_5etree___ERROR_DOMAINS = Py_None; Py_INCREF(Py_None);
138527   __pyx_v_4lxml_5etree___PARSER_ERROR_TYPES = Py_None; Py_INCREF(Py_None);
138528   __pyx_v_4lxml_5etree___RELAXNG_ERROR_TYPES = Py_None; Py_INCREF(Py_None);
138529   __pyx_v_4lxml_5etree__PREFIX_CACHE = Py_None; Py_INCREF(Py_None);
138530   __pyx_v_4lxml_5etree_ELEMENT_CLASS_LOOKUP_STATE = Py_None; Py_INCREF(Py_None);
138531   __pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP = ((struct __pyx_obj_4lxml_5etree_ParserBasedElementClassLookup *)Py_None); Py_INCREF(Py_None);
138532   __pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES = ((PyObject *)Py_None); Py_INCREF(Py_None);
138533   __pyx_v_4lxml_5etree__XMLSyntaxError = Py_None; Py_INCREF(Py_None);
138534   __pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)Py_None); Py_INCREF(Py_None);
138535   __pyx_v_4lxml_5etree___DEFAULT_XML_PARSER = ((struct __pyx_obj_4lxml_5etree_XMLParser *)Py_None); Py_INCREF(Py_None);
138536   __pyx_v_4lxml_5etree___DEFAULT_HTML_PARSER = ((struct __pyx_obj_4lxml_5etree_HTMLParser *)Py_None); Py_INCREF(Py_None);
138537   __pyx_v_4lxml_5etree_inspect_getargspec = Py_None; Py_INCREF(Py_None);
138538   __pyx_v_4lxml_5etree__find_id_attributes = Py_None; Py_INCREF(Py_None);
138539   __pyx_v_4lxml_5etree__XPATH_SYNTAX_ERRORS = Py_None; Py_INCREF(Py_None);
138540   __pyx_v_4lxml_5etree__XPATH_EVAL_ERRORS = Py_None; Py_INCREF(Py_None);
138541   __pyx_v_4lxml_5etree__replace_strings = Py_None; Py_INCREF(Py_None);
138542   __pyx_v_4lxml_5etree__find_namespaces = Py_None; Py_INCREF(Py_None);
138543   __pyx_v_4lxml_5etree_EMPTY_DICT = ((PyObject *)Py_None); Py_INCREF(Py_None);
138544   __pyx_v_4lxml_5etree__FIND_PI_ATTRIBUTES = Py_None; Py_INCREF(Py_None);
138545   __pyx_v_4lxml_5etree__RE_PI_HREF = Py_None; Py_INCREF(Py_None);
138546   __pyx_v_4lxml_5etree__FIND_PI_HREF = Py_None; Py_INCREF(Py_None);
138547   __pyx_v_4lxml_5etree__REPLACE_PI_HREF = Py_None; Py_INCREF(Py_None);
138548   __pyx_v_4lxml_5etree___findStylesheetByID = ((struct __pyx_obj_4lxml_5etree_XPath *)Py_None); Py_INCREF(Py_None);
138549   __pyx_v_4lxml_5etree__check_for_default_attributes = ((struct __pyx_obj_4lxml_5etree_XPath *)Py_None); Py_INCREF(Py_None);
138550   /*--- Function export code ---*/
138551   if (__Pyx_ExportFunction("deepcopyNodeToDocument", (void (*)(void))deepcopyNodeToDocument, "struct LxmlElement *(struct LxmlDocument *, xmlNode *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138552   if (__Pyx_ExportFunction("elementTreeFactory", (void (*)(void))elementTreeFactory, "struct LxmlElementTree *(struct LxmlElement *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138553   if (__Pyx_ExportFunction("newElementTree", (void (*)(void))newElementTree, "struct LxmlElementTree *(struct LxmlElement *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138554   if (__Pyx_ExportFunction("elementFactory", (void (*)(void))elementFactory, "struct LxmlElement *(struct LxmlDocument *, xmlNode *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138555   if (__Pyx_ExportFunction("makeElement", (void (*)(void))makeElement, "struct LxmlElement *(PyObject *, struct LxmlDocument *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138556   if (__Pyx_ExportFunction("makeSubElement", (void (*)(void))makeSubElement, "struct LxmlElement *(struct LxmlElement *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138557   if (__Pyx_ExportFunction("setElementClassLookupFunction", (void (*)(void))setElementClassLookupFunction, "void (_element_class_lookup_function, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138558   if (__Pyx_ExportFunction("lookupDefaultElementClass", (void (*)(void))lookupDefaultElementClass, "PyObject *(PyObject *, PyObject *, xmlNode *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138559   if (__Pyx_ExportFunction("lookupNamespaceElementClass", (void (*)(void))lookupNamespaceElementClass, "PyObject *(PyObject *, PyObject *, xmlNode *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138560   if (__Pyx_ExportFunction("callLookupFallback", (void (*)(void))callLookupFallback, "PyObject *(struct LxmlFallbackElementClassLookup *, struct LxmlDocument *, xmlNode *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138561   if (__Pyx_ExportFunction("tagMatches", (void (*)(void))tagMatches, "int (xmlNode *, char *, char *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138562   if (__Pyx_ExportFunction("documentOrRaise", (void (*)(void))documentOrRaise, "struct LxmlDocument *(PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138563   if (__Pyx_ExportFunction("rootNodeOrRaise", (void (*)(void))rootNodeOrRaise, "struct LxmlElement *(PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138564   if (__Pyx_ExportFunction("hasText", (void (*)(void))hasText, "int (xmlNode *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138565   if (__Pyx_ExportFunction("hasTail", (void (*)(void))hasTail, "int (xmlNode *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138566   if (__Pyx_ExportFunction("textOf", (void (*)(void))textOf, "PyObject *(xmlNode *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138567   if (__Pyx_ExportFunction("tailOf", (void (*)(void))tailOf, "PyObject *(xmlNode *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138568   if (__Pyx_ExportFunction("setNodeText", (void (*)(void))setNodeText, "int (xmlNode *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138569   if (__Pyx_ExportFunction("setTailText", (void (*)(void))setTailText, "int (xmlNode *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138570   if (__Pyx_ExportFunction("attributeValue", (void (*)(void))attributeValue, "PyObject *(xmlNode *, xmlAttr *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138571   if (__Pyx_ExportFunction("attributeValueFromNsName", (void (*)(void))attributeValueFromNsName, "PyObject *(xmlNode *, char *, char *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138572   if (__Pyx_ExportFunction("getAttributeValue", (void (*)(void))getAttributeValue, "PyObject *(struct LxmlElement *, PyObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138573   if (__Pyx_ExportFunction("iterattributes", (void (*)(void))iterattributes, "PyObject *(struct LxmlElement *, int)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138574   if (__Pyx_ExportFunction("collectAttributes", (void (*)(void))collectAttributes, "PyObject *(xmlNode *, int)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138575   if (__Pyx_ExportFunction("setAttributeValue", (void (*)(void))setAttributeValue, "int (struct LxmlElement *, PyObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138576   if (__Pyx_ExportFunction("delAttribute", (void (*)(void))delAttribute, "int (struct LxmlElement *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138577   if (__Pyx_ExportFunction("delAttributeFromNsName", (void (*)(void))delAttributeFromNsName, "int (xmlNode *, char *, char *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138578   if (__Pyx_ExportFunction("hasChild", (void (*)(void))hasChild, "int (xmlNode *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138579   if (__Pyx_ExportFunction("findChild", (void (*)(void))findChild, "xmlNode *(xmlNode *, Py_ssize_t)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138580   if (__Pyx_ExportFunction("findChildForwards", (void (*)(void))findChildForwards, "xmlNode *(xmlNode *, Py_ssize_t)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138581   if (__Pyx_ExportFunction("findChildBackwards", (void (*)(void))findChildBackwards, "xmlNode *(xmlNode *, Py_ssize_t)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138582   if (__Pyx_ExportFunction("nextElement", (void (*)(void))nextElement, "xmlNode *(xmlNode *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138583   if (__Pyx_ExportFunction("previousElement", (void (*)(void))previousElement, "xmlNode *(xmlNode *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138584   if (__Pyx_ExportFunction("appendChild", (void (*)(void))appendChild, "void (struct LxmlElement *, struct LxmlElement *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138585   if (__Pyx_ExportFunction("pyunicode", (void (*)(void))pyunicode, "PyObject *(char *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138586   if (__Pyx_ExportFunction("utf8", (void (*)(void))utf8, "PyObject *(PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138587   if (__Pyx_ExportFunction("getNsTag", (void (*)(void))getNsTag, "PyObject *(PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138588   if (__Pyx_ExportFunction("namespacedName", (void (*)(void))namespacedName, "PyObject *(xmlNode *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138589   if (__Pyx_ExportFunction("namespacedNameFromNsName", (void (*)(void))namespacedNameFromNsName, "PyObject *(char *, char *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138590   if (__Pyx_ExportFunction("iteratorStoreNext", (void (*)(void))iteratorStoreNext, "void (struct LxmlElementIterator *, struct LxmlElement *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138591   if (__Pyx_ExportFunction("initTagMatch", (void (*)(void))initTagMatch, "void (struct LxmlElementTagMatcher *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138592   if (__Pyx_ExportFunction("findOrBuildNodeNsPrefix", (void (*)(void))findOrBuildNodeNsPrefix, "xmlNs *(struct LxmlDocument *, xmlNode *, char *, char *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138593   /*--- Type init code ---*/
138594   __pyx_vtabptr_4lxml_5etree__TempStore = &__pyx_vtable_4lxml_5etree__TempStore;
138595   #if PY_MAJOR_VERSION >= 3
138596   __pyx_vtable_4lxml_5etree__TempStore.add = (int (*)(struct __pyx_obj_4lxml_5etree__TempStore *, PyObject *))__pyx_f_4lxml_5etree_10_TempStore_add;
138597   __pyx_vtable_4lxml_5etree__TempStore.clear = (int (*)(struct __pyx_obj_4lxml_5etree__TempStore *))__pyx_f_4lxml_5etree_10_TempStore_clear;
138598   #else
138599   *(void(**)(void))&__pyx_vtable_4lxml_5etree__TempStore.add = (void(*)(void))__pyx_f_4lxml_5etree_10_TempStore_add;
138600   *(void(**)(void))&__pyx_vtable_4lxml_5etree__TempStore.clear = (void(*)(void))__pyx_f_4lxml_5etree_10_TempStore_clear;
138601   #endif
138602   if (PyType_Ready(&__pyx_type_4lxml_5etree__TempStore) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138603   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__TempStore.tp_dict, __pyx_vtabptr_4lxml_5etree__TempStore) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138604   if (__Pyx_SetAttrString(__pyx_m, "_TempStore", (PyObject *)&__pyx_type_4lxml_5etree__TempStore) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138605   __pyx_ptype_4lxml_5etree__TempStore = &__pyx_type_4lxml_5etree__TempStore;
138606   __pyx_vtabptr_4lxml_5etree__ExceptionContext = &__pyx_vtable_4lxml_5etree__ExceptionContext;
138607   #if PY_MAJOR_VERSION >= 3
138608   __pyx_vtable_4lxml_5etree__ExceptionContext.clear = (void (*)(struct __pyx_obj_4lxml_5etree__ExceptionContext *))__pyx_f_4lxml_5etree_17_ExceptionContext_clear;
138609   __pyx_vtable_4lxml_5etree__ExceptionContext._store_raised = (void (*)(struct __pyx_obj_4lxml_5etree__ExceptionContext *))__pyx_f_4lxml_5etree_17_ExceptionContext__store_raised;
138610   __pyx_vtable_4lxml_5etree__ExceptionContext._store_exception = (void (*)(struct __pyx_obj_4lxml_5etree__ExceptionContext *, PyObject *))__pyx_f_4lxml_5etree_17_ExceptionContext__store_exception;
138611   __pyx_vtable_4lxml_5etree__ExceptionContext._has_raised = (int (*)(struct __pyx_obj_4lxml_5etree__ExceptionContext *))__pyx_f_4lxml_5etree_17_ExceptionContext__has_raised;
138612   __pyx_vtable_4lxml_5etree__ExceptionContext._raise_if_stored = (int (*)(struct __pyx_obj_4lxml_5etree__ExceptionContext *))__pyx_f_4lxml_5etree_17_ExceptionContext__raise_if_stored;
138613   #else
138614   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ExceptionContext.clear = (void(*)(void))__pyx_f_4lxml_5etree_17_ExceptionContext_clear;
138615   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ExceptionContext._store_raised = (void(*)(void))__pyx_f_4lxml_5etree_17_ExceptionContext__store_raised;
138616   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ExceptionContext._store_exception = (void(*)(void))__pyx_f_4lxml_5etree_17_ExceptionContext__store_exception;
138617   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ExceptionContext._has_raised = (void(*)(void))__pyx_f_4lxml_5etree_17_ExceptionContext__has_raised;
138618   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ExceptionContext._raise_if_stored = (void(*)(void))__pyx_f_4lxml_5etree_17_ExceptionContext__raise_if_stored;
138619   #endif
138620   if (PyType_Ready(&__pyx_type_4lxml_5etree__ExceptionContext) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138621   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ExceptionContext.tp_dict, __pyx_vtabptr_4lxml_5etree__ExceptionContext) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138622   if (__Pyx_SetAttrString(__pyx_m, "_ExceptionContext", (PyObject *)&__pyx_type_4lxml_5etree__ExceptionContext) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138623   __pyx_ptype_4lxml_5etree__ExceptionContext = &__pyx_type_4lxml_5etree__ExceptionContext;
138624   __pyx_vtabptr_4lxml_5etree__Document = &__pyx_vtable_4lxml_5etree__Document;
138625   #if PY_MAJOR_VERSION >= 3
138626   __pyx_vtable_4lxml_5etree__Document.getroot = (PyObject *(*)(struct LxmlDocument *))__pyx_f_4lxml_5etree_9_Document_getroot;
138627   __pyx_vtable_4lxml_5etree__Document.hasdoctype = (int (*)(struct LxmlDocument *))__pyx_f_4lxml_5etree_9_Document_hasdoctype;
138628   __pyx_vtable_4lxml_5etree__Document.getdoctype = (PyObject *(*)(struct LxmlDocument *))__pyx_f_4lxml_5etree_9_Document_getdoctype;
138629   __pyx_vtable_4lxml_5etree__Document.getxmlinfo = (PyObject *(*)(struct LxmlDocument *))__pyx_f_4lxml_5etree_9_Document_getxmlinfo;
138630   __pyx_vtable_4lxml_5etree__Document.isstandalone = (PyObject *(*)(struct LxmlDocument *))__pyx_f_4lxml_5etree_9_Document_isstandalone;
138631   __pyx_vtable_4lxml_5etree__Document.buildNewPrefix = (PyObject *(*)(struct LxmlDocument *))__pyx_f_4lxml_5etree_9_Document_buildNewPrefix;
138632   __pyx_vtable_4lxml_5etree__Document._findOrBuildNodeNs = (xmlNs *(*)(struct LxmlDocument *, xmlNode *, char *, char *))__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs;
138633   __pyx_vtable_4lxml_5etree__Document._setNodeNs = (int (*)(struct LxmlDocument *, xmlNode *, char *))__pyx_f_4lxml_5etree_9_Document__setNodeNs;
138634   #else
138635   *(void(**)(void))&__pyx_vtable_4lxml_5etree__Document.getroot = (void(*)(void))__pyx_f_4lxml_5etree_9_Document_getroot;
138636   *(void(**)(void))&__pyx_vtable_4lxml_5etree__Document.hasdoctype = (void(*)(void))__pyx_f_4lxml_5etree_9_Document_hasdoctype;
138637   *(void(**)(void))&__pyx_vtable_4lxml_5etree__Document.getdoctype = (void(*)(void))__pyx_f_4lxml_5etree_9_Document_getdoctype;
138638   *(void(**)(void))&__pyx_vtable_4lxml_5etree__Document.getxmlinfo = (void(*)(void))__pyx_f_4lxml_5etree_9_Document_getxmlinfo;
138639   *(void(**)(void))&__pyx_vtable_4lxml_5etree__Document.isstandalone = (void(*)(void))__pyx_f_4lxml_5etree_9_Document_isstandalone;
138640   *(void(**)(void))&__pyx_vtable_4lxml_5etree__Document.buildNewPrefix = (void(*)(void))__pyx_f_4lxml_5etree_9_Document_buildNewPrefix;
138641   *(void(**)(void))&__pyx_vtable_4lxml_5etree__Document._findOrBuildNodeNs = (void(*)(void))__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs;
138642   *(void(**)(void))&__pyx_vtable_4lxml_5etree__Document._setNodeNs = (void(*)(void))__pyx_f_4lxml_5etree_9_Document__setNodeNs;
138643   #endif
138644   if (PyType_Ready(&LxmlDocumentType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138645   if (__Pyx_SetVtable(LxmlDocumentType.tp_dict, __pyx_vtabptr_4lxml_5etree__Document) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138646   if (__Pyx_SetAttrString(__pyx_m, "_Document", (PyObject *)&LxmlDocumentType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138647   __pyx_ptype_4lxml_5etree__Document = &LxmlDocumentType;
138648   if (PyType_Ready(&LxmlElementType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138649   if (__Pyx_SetAttrString(__pyx_m, "_Element", (PyObject *)&LxmlElementType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138650   __pyx_ptype_4lxml_5etree__Element = &LxmlElementType;
138651   __pyx_vtabptr_4lxml_5etree__BaseParser = &__pyx_vtable_4lxml_5etree__BaseParser;
138652   #if PY_MAJOR_VERSION >= 3
138653   __pyx_vtable_4lxml_5etree__BaseParser._getParserContext = (struct __pyx_obj_4lxml_5etree__ParserContext *(*)(struct __pyx_obj_4lxml_5etree__BaseParser *))__pyx_f_4lxml_5etree_11_BaseParser__getParserContext;
138654   __pyx_vtable_4lxml_5etree__BaseParser._getPushParserContext = (struct __pyx_obj_4lxml_5etree__ParserContext *(*)(struct __pyx_obj_4lxml_5etree__BaseParser *))__pyx_f_4lxml_5etree_11_BaseParser__getPushParserContext;
138655   __pyx_vtable_4lxml_5etree__BaseParser._createContext = (struct __pyx_obj_4lxml_5etree__ParserContext *(*)(struct __pyx_obj_4lxml_5etree__BaseParser *, PyObject *))__pyx_f_4lxml_5etree_11_BaseParser__createContext;
138656   __pyx_vtable_4lxml_5etree__BaseParser._newParserCtxt = (xmlParserCtxt *(*)(struct __pyx_obj_4lxml_5etree__BaseParser *))__pyx_f_4lxml_5etree_11_BaseParser__newParserCtxt;
138657   __pyx_vtable_4lxml_5etree__BaseParser._newPushParserCtxt = (xmlParserCtxt *(*)(struct __pyx_obj_4lxml_5etree__BaseParser *))__pyx_f_4lxml_5etree_11_BaseParser__newPushParserCtxt;
138658   __pyx_vtable_4lxml_5etree__BaseParser._copy = (struct __pyx_obj_4lxml_5etree__BaseParser *(*)(struct __pyx_obj_4lxml_5etree__BaseParser *))__pyx_f_4lxml_5etree_11_BaseParser__copy;
138659   __pyx_vtable_4lxml_5etree__BaseParser._parseUnicodeDoc = (xmlDoc *(*)(struct __pyx_obj_4lxml_5etree__BaseParser *, PyObject *, char *))__pyx_f_4lxml_5etree_11_BaseParser__parseUnicodeDoc;
138660   __pyx_vtable_4lxml_5etree__BaseParser._parseDoc = (xmlDoc *(*)(struct __pyx_obj_4lxml_5etree__BaseParser *, char *, Py_ssize_t, char *))__pyx_f_4lxml_5etree_11_BaseParser__parseDoc;
138661   __pyx_vtable_4lxml_5etree__BaseParser._parseDocFromFile = (xmlDoc *(*)(struct __pyx_obj_4lxml_5etree__BaseParser *, char *))__pyx_f_4lxml_5etree_11_BaseParser__parseDocFromFile;
138662   __pyx_vtable_4lxml_5etree__BaseParser._parseDocFromFilelike = (xmlDoc *(*)(struct __pyx_obj_4lxml_5etree__BaseParser *, PyObject *, PyObject *))__pyx_f_4lxml_5etree_11_BaseParser__parseDocFromFilelike;
138663   #else
138664   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseParser._getParserContext = (void(*)(void))__pyx_f_4lxml_5etree_11_BaseParser__getParserContext;
138665   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseParser._getPushParserContext = (void(*)(void))__pyx_f_4lxml_5etree_11_BaseParser__getPushParserContext;
138666   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseParser._createContext = (void(*)(void))__pyx_f_4lxml_5etree_11_BaseParser__createContext;
138667   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseParser._newParserCtxt = (void(*)(void))__pyx_f_4lxml_5etree_11_BaseParser__newParserCtxt;
138668   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseParser._newPushParserCtxt = (void(*)(void))__pyx_f_4lxml_5etree_11_BaseParser__newPushParserCtxt;
138669   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseParser._copy = (void(*)(void))__pyx_f_4lxml_5etree_11_BaseParser__copy;
138670   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseParser._parseUnicodeDoc = (void(*)(void))__pyx_f_4lxml_5etree_11_BaseParser__parseUnicodeDoc;
138671   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseParser._parseDoc = (void(*)(void))__pyx_f_4lxml_5etree_11_BaseParser__parseDoc;
138672   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseParser._parseDocFromFile = (void(*)(void))__pyx_f_4lxml_5etree_11_BaseParser__parseDocFromFile;
138673   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseParser._parseDocFromFilelike = (void(*)(void))__pyx_f_4lxml_5etree_11_BaseParser__parseDocFromFilelike;
138674   #endif
138675   if (PyType_Ready(&__pyx_type_4lxml_5etree__BaseParser) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138676   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__BaseParser.tp_dict, __pyx_vtabptr_4lxml_5etree__BaseParser) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138677   if (__Pyx_SetAttrString(__pyx_m, "_BaseParser", (PyObject *)&__pyx_type_4lxml_5etree__BaseParser) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138678   __pyx_ptype_4lxml_5etree__BaseParser = &__pyx_type_4lxml_5etree__BaseParser;
138679   if (PyType_Ready(&__pyx_type_4lxml_5etree_QName) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138680   if (__Pyx_SetAttrString(__pyx_m, "QName", (PyObject *)&__pyx_type_4lxml_5etree_QName) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138681   __pyx_ptype_4lxml_5etree_QName = &__pyx_type_4lxml_5etree_QName;
138682   __pyx_vtabptr_4lxml_5etree__LogEntry = &__pyx_vtable_4lxml_5etree__LogEntry;
138683   #if PY_MAJOR_VERSION >= 3
138684   __pyx_vtable_4lxml_5etree__LogEntry._setError = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__LogEntry *, xmlError *))__pyx_f_4lxml_5etree_9_LogEntry__setError;
138685   __pyx_vtable_4lxml_5etree__LogEntry._setGeneric = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__LogEntry *, int, int, int, int, PyObject *, PyObject *))__pyx_f_4lxml_5etree_9_LogEntry__setGeneric;
138686   #else
138687   *(void(**)(void))&__pyx_vtable_4lxml_5etree__LogEntry._setError = (void(*)(void))__pyx_f_4lxml_5etree_9_LogEntry__setError;
138688   *(void(**)(void))&__pyx_vtable_4lxml_5etree__LogEntry._setGeneric = (void(*)(void))__pyx_f_4lxml_5etree_9_LogEntry__setGeneric;
138689   #endif
138690   if (PyType_Ready(&__pyx_type_4lxml_5etree__LogEntry) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138691   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__LogEntry.tp_dict, __pyx_vtabptr_4lxml_5etree__LogEntry) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138692   if (__Pyx_SetAttrString(__pyx_m, "_LogEntry", (PyObject *)&__pyx_type_4lxml_5etree__LogEntry) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138693   __pyx_ptype_4lxml_5etree__LogEntry = &__pyx_type_4lxml_5etree__LogEntry;
138694   __pyx_vtabptr_4lxml_5etree__BaseErrorLog = &__pyx_vtable_4lxml_5etree__BaseErrorLog;
138695   #if PY_MAJOR_VERSION >= 3
138696   __pyx_vtable_4lxml_5etree__BaseErrorLog._receive = (void (*)(struct __pyx_obj_4lxml_5etree__BaseErrorLog *, xmlError *))__pyx_f_4lxml_5etree_13_BaseErrorLog__receive;
138697   __pyx_vtable_4lxml_5etree__BaseErrorLog._receiveGeneric = (void (*)(struct __pyx_obj_4lxml_5etree__BaseErrorLog *, int, int, int, int, PyObject *, PyObject *))__pyx_f_4lxml_5etree_13_BaseErrorLog__receiveGeneric;
138698   __pyx_vtable_4lxml_5etree__BaseErrorLog._buildParseException = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__BaseErrorLog *, PyObject *, PyObject *))__pyx_f_4lxml_5etree_13_BaseErrorLog__buildParseException;
138699   __pyx_vtable_4lxml_5etree__BaseErrorLog._buildExceptionMessage = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__BaseErrorLog *, PyObject *))__pyx_f_4lxml_5etree_13_BaseErrorLog__buildExceptionMessage;
138700   #else
138701   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseErrorLog._receive = (void(*)(void))__pyx_f_4lxml_5etree_13_BaseErrorLog__receive;
138702   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseErrorLog._receiveGeneric = (void(*)(void))__pyx_f_4lxml_5etree_13_BaseErrorLog__receiveGeneric;
138703   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseErrorLog._buildParseException = (void(*)(void))__pyx_f_4lxml_5etree_13_BaseErrorLog__buildParseException;
138704   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseErrorLog._buildExceptionMessage = (void(*)(void))__pyx_f_4lxml_5etree_13_BaseErrorLog__buildExceptionMessage;
138705   #endif
138706   if (PyType_Ready(&__pyx_type_4lxml_5etree__BaseErrorLog) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138707   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__BaseErrorLog.tp_dict, __pyx_vtabptr_4lxml_5etree__BaseErrorLog) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138708   if (__Pyx_SetAttrString(__pyx_m, "_BaseErrorLog", (PyObject *)&__pyx_type_4lxml_5etree__BaseErrorLog) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138709   __pyx_ptype_4lxml_5etree__BaseErrorLog = &__pyx_type_4lxml_5etree__BaseErrorLog;
138710   __pyx_vtabptr_4lxml_5etree__ListErrorLog = &__pyx_vtable_4lxml_5etree__ListErrorLog;
138711   __pyx_vtable_4lxml_5etree__ListErrorLog.__pyx_base = *__pyx_vtabptr_4lxml_5etree__BaseErrorLog;
138712   __pyx_type_4lxml_5etree__ListErrorLog.tp_base = __pyx_ptype_4lxml_5etree__BaseErrorLog;
138713   if (PyType_Ready(&__pyx_type_4lxml_5etree__ListErrorLog) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138714   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ListErrorLog.tp_dict, __pyx_vtabptr_4lxml_5etree__ListErrorLog) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138715   if (__Pyx_SetAttrString(__pyx_m, "_ListErrorLog", (PyObject *)&__pyx_type_4lxml_5etree__ListErrorLog) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138716   __pyx_ptype_4lxml_5etree__ListErrorLog = &__pyx_type_4lxml_5etree__ListErrorLog;
138717   __pyx_vtabptr_4lxml_5etree__ErrorLog = &__pyx_vtable_4lxml_5etree__ErrorLog;
138718   __pyx_vtable_4lxml_5etree__ErrorLog.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ListErrorLog;
138719   #if PY_MAJOR_VERSION >= 3
138720   __pyx_vtable_4lxml_5etree__ErrorLog.connect = (void (*)(struct __pyx_obj_4lxml_5etree__ErrorLog *))__pyx_f_4lxml_5etree_9_ErrorLog_connect;
138721   __pyx_vtable_4lxml_5etree__ErrorLog.disconnect = (void (*)(struct __pyx_obj_4lxml_5etree__ErrorLog *))__pyx_f_4lxml_5etree_9_ErrorLog_disconnect;
138722   #else
138723   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ErrorLog.connect = (void(*)(void))__pyx_f_4lxml_5etree_9_ErrorLog_connect;
138724   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ErrorLog.disconnect = (void(*)(void))__pyx_f_4lxml_5etree_9_ErrorLog_disconnect;
138725   #endif
138726   __pyx_type_4lxml_5etree__ErrorLog.tp_base = __pyx_ptype_4lxml_5etree__ListErrorLog;
138727   if (PyType_Ready(&__pyx_type_4lxml_5etree__ErrorLog) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138728   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ErrorLog.tp_dict, __pyx_vtabptr_4lxml_5etree__ErrorLog) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138729   if (__Pyx_SetAttrString(__pyx_m, "_ErrorLog", (PyObject *)&__pyx_type_4lxml_5etree__ErrorLog) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138730   __pyx_ptype_4lxml_5etree__ErrorLog = &__pyx_type_4lxml_5etree__ErrorLog;
138731   __pyx_vtabptr_4lxml_5etree__DomainErrorLog = &__pyx_vtable_4lxml_5etree__DomainErrorLog;
138732   __pyx_vtable_4lxml_5etree__DomainErrorLog.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ErrorLog;
138733   __pyx_type_4lxml_5etree__DomainErrorLog.tp_base = __pyx_ptype_4lxml_5etree__ErrorLog;
138734   if (PyType_Ready(&__pyx_type_4lxml_5etree__DomainErrorLog) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138735   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__DomainErrorLog.tp_dict, __pyx_vtabptr_4lxml_5etree__DomainErrorLog) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138736   if (__Pyx_SetAttrString(__pyx_m, "_DomainErrorLog", (PyObject *)&__pyx_type_4lxml_5etree__DomainErrorLog) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138737   __pyx_ptype_4lxml_5etree__DomainErrorLog = &__pyx_type_4lxml_5etree__DomainErrorLog;
138738   __pyx_vtabptr_4lxml_5etree__RotatingErrorLog = &__pyx_vtable_4lxml_5etree__RotatingErrorLog;
138739   __pyx_vtable_4lxml_5etree__RotatingErrorLog.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ErrorLog;
138740   __pyx_type_4lxml_5etree__RotatingErrorLog.tp_base = __pyx_ptype_4lxml_5etree__ErrorLog;
138741   if (PyType_Ready(&__pyx_type_4lxml_5etree__RotatingErrorLog) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138742   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__RotatingErrorLog.tp_dict, __pyx_vtabptr_4lxml_5etree__RotatingErrorLog) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138743   if (__Pyx_SetAttrString(__pyx_m, "_RotatingErrorLog", (PyObject *)&__pyx_type_4lxml_5etree__RotatingErrorLog) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138744   __pyx_ptype_4lxml_5etree__RotatingErrorLog = &__pyx_type_4lxml_5etree__RotatingErrorLog;
138745   __pyx_vtabptr_4lxml_5etree_PyErrorLog = &__pyx_vtable_4lxml_5etree_PyErrorLog;
138746   __pyx_vtable_4lxml_5etree_PyErrorLog.__pyx_base = *__pyx_vtabptr_4lxml_5etree__BaseErrorLog;
138747   __pyx_type_4lxml_5etree_PyErrorLog.tp_base = __pyx_ptype_4lxml_5etree__BaseErrorLog;
138748   if (PyType_Ready(&__pyx_type_4lxml_5etree_PyErrorLog) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138749   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_PyErrorLog.tp_dict, __pyx_vtabptr_4lxml_5etree_PyErrorLog) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138750   if (__Pyx_SetAttrString(__pyx_m, "PyErrorLog", (PyObject *)&__pyx_type_4lxml_5etree_PyErrorLog) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138751   __pyx_ptype_4lxml_5etree_PyErrorLog = &__pyx_type_4lxml_5etree_PyErrorLog;
138752   if (PyType_Ready(&__pyx_type_4lxml_5etree_DocInfo) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138753   if (__Pyx_SetAttrString(__pyx_m, "DocInfo", (PyObject *)&__pyx_type_4lxml_5etree_DocInfo) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138754   __pyx_ptype_4lxml_5etree_DocInfo = &__pyx_type_4lxml_5etree_DocInfo;
138755   __pyx_vtabptr_4lxml_5etree___ContentOnlyElement = &__pyx_vtable_4lxml_5etree___ContentOnlyElement;
138756   #if PY_MAJOR_VERSION >= 3
138757   __pyx_vtable_4lxml_5etree___ContentOnlyElement._raiseImmutable = (int (*)(struct __pyx_obj_4lxml_5etree___ContentOnlyElement *))__pyx_f_4lxml_5etree_20__ContentOnlyElement__raiseImmutable;
138758   #else
138759   *(void(**)(void))&__pyx_vtable_4lxml_5etree___ContentOnlyElement._raiseImmutable = (void(*)(void))__pyx_f_4lxml_5etree_20__ContentOnlyElement__raiseImmutable;
138760   #endif
138761   __pyx_type_4lxml_5etree___ContentOnlyElement.tp_base = __pyx_ptype_4lxml_5etree__Element;
138762   if (PyType_Ready(&__pyx_type_4lxml_5etree___ContentOnlyElement) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138763   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree___ContentOnlyElement.tp_dict, __pyx_vtabptr_4lxml_5etree___ContentOnlyElement) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138764   if (__Pyx_SetAttrString(__pyx_m, "__ContentOnlyElement", (PyObject *)&__pyx_type_4lxml_5etree___ContentOnlyElement) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138765   __pyx_ptype_4lxml_5etree___ContentOnlyElement = &__pyx_type_4lxml_5etree___ContentOnlyElement;
138766   __pyx_vtabptr_4lxml_5etree__Comment = &__pyx_vtable_4lxml_5etree__Comment;
138767   __pyx_vtable_4lxml_5etree__Comment.__pyx_base = *__pyx_vtabptr_4lxml_5etree___ContentOnlyElement;
138768   __pyx_type_4lxml_5etree__Comment.tp_base = __pyx_ptype_4lxml_5etree___ContentOnlyElement;
138769   if (PyType_Ready(&__pyx_type_4lxml_5etree__Comment) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138770   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__Comment.tp_dict, __pyx_vtabptr_4lxml_5etree__Comment) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138771   if (__Pyx_SetAttrString(__pyx_m, "_Comment", (PyObject *)&__pyx_type_4lxml_5etree__Comment) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138772   __pyx_ptype_4lxml_5etree__Comment = &__pyx_type_4lxml_5etree__Comment;
138773   __pyx_vtabptr_4lxml_5etree__ProcessingInstruction = &__pyx_vtable_4lxml_5etree__ProcessingInstruction;
138774   __pyx_vtable_4lxml_5etree__ProcessingInstruction.__pyx_base = *__pyx_vtabptr_4lxml_5etree___ContentOnlyElement;
138775   __pyx_type_4lxml_5etree__ProcessingInstruction.tp_base = __pyx_ptype_4lxml_5etree___ContentOnlyElement;
138776   if (PyType_Ready(&__pyx_type_4lxml_5etree__ProcessingInstruction) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138777   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ProcessingInstruction.tp_dict, __pyx_vtabptr_4lxml_5etree__ProcessingInstruction) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138778   if (__Pyx_SetAttrString(__pyx_m, "_ProcessingInstruction", (PyObject *)&__pyx_type_4lxml_5etree__ProcessingInstruction) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138779   __pyx_ptype_4lxml_5etree__ProcessingInstruction = &__pyx_type_4lxml_5etree__ProcessingInstruction;
138780   __pyx_vtabptr_4lxml_5etree__Entity = &__pyx_vtable_4lxml_5etree__Entity;
138781   __pyx_vtable_4lxml_5etree__Entity.__pyx_base = *__pyx_vtabptr_4lxml_5etree___ContentOnlyElement;
138782   __pyx_type_4lxml_5etree__Entity.tp_base = __pyx_ptype_4lxml_5etree___ContentOnlyElement;
138783   if (PyType_Ready(&__pyx_type_4lxml_5etree__Entity) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138784   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__Entity.tp_dict, __pyx_vtabptr_4lxml_5etree__Entity) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138785   if (__Pyx_SetAttrString(__pyx_m, "_Entity", (PyObject *)&__pyx_type_4lxml_5etree__Entity) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138786   __pyx_ptype_4lxml_5etree__Entity = &__pyx_type_4lxml_5etree__Entity;
138787   __pyx_vtabptr_4lxml_5etree__ElementTree = &__pyx_vtable_4lxml_5etree__ElementTree;
138788   #if PY_MAJOR_VERSION >= 3
138789   __pyx_vtable_4lxml_5etree__ElementTree._assertHasRoot = (PyObject *(*)(struct LxmlElementTree *))__pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot;
138790   #else
138791   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ElementTree._assertHasRoot = (void(*)(void))__pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot;
138792   #endif
138793   if (PyType_Ready(&LxmlElementTreeType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138794   if (__Pyx_SetVtable(LxmlElementTreeType.tp_dict, __pyx_vtabptr_4lxml_5etree__ElementTree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138795   if (__Pyx_SetAttrString(__pyx_m, "_ElementTree", (PyObject *)&LxmlElementTreeType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138796   __pyx_ptype_4lxml_5etree__ElementTree = &LxmlElementTreeType;
138797   if (PyType_Ready(&__pyx_type_4lxml_5etree__Attrib) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138798   if (__Pyx_SetAttrString(__pyx_m, "_Attrib", (PyObject *)&__pyx_type_4lxml_5etree__Attrib) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138799   __pyx_ptype_4lxml_5etree__Attrib = &__pyx_type_4lxml_5etree__Attrib;
138800   if (PyType_Ready(&__pyx_type_4lxml_5etree__AttribIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138801   if (__Pyx_SetAttrString(__pyx_m, "_AttribIterator", (PyObject *)&__pyx_type_4lxml_5etree__AttribIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138802   __pyx_ptype_4lxml_5etree__AttribIterator = &__pyx_type_4lxml_5etree__AttribIterator;
138803   __pyx_vtabptr_4lxml_5etree__ElementTagMatcher = &__pyx_vtable_4lxml_5etree__ElementTagMatcher;
138804   #if PY_MAJOR_VERSION >= 3
138805   __pyx_vtable_4lxml_5etree__ElementTagMatcher._initTagMatch = (PyObject *(*)(struct LxmlElementTagMatcher *, PyObject *))__pyx_f_4lxml_5etree_18_ElementTagMatcher__initTagMatch;
138806   #else
138807   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ElementTagMatcher._initTagMatch = (void(*)(void))__pyx_f_4lxml_5etree_18_ElementTagMatcher__initTagMatch;
138808   #endif
138809   if (PyType_Ready(&LxmlElementTagMatcherType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138810   if (__Pyx_SetVtable(LxmlElementTagMatcherType.tp_dict, __pyx_vtabptr_4lxml_5etree__ElementTagMatcher) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138811   if (__Pyx_SetAttrString(__pyx_m, "_ElementTagMatcher", (PyObject *)&LxmlElementTagMatcherType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138812   __pyx_ptype_4lxml_5etree__ElementTagMatcher = &LxmlElementTagMatcherType;
138813   __pyx_vtabptr_4lxml_5etree__ElementIterator = &__pyx_vtable_4lxml_5etree__ElementIterator;
138814   __pyx_vtable_4lxml_5etree__ElementIterator.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ElementTagMatcher;
138815   #if PY_MAJOR_VERSION >= 3
138816   __pyx_vtable_4lxml_5etree__ElementIterator._storeNext = (void (*)(struct LxmlElementIterator *, struct LxmlElement *))__pyx_f_4lxml_5etree_16_ElementIterator__storeNext;
138817   #else
138818   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ElementIterator._storeNext = (void(*)(void))__pyx_f_4lxml_5etree_16_ElementIterator__storeNext;
138819   #endif
138820   LxmlElementIteratorType.tp_base = __pyx_ptype_4lxml_5etree__ElementTagMatcher;
138821   if (PyType_Ready(&LxmlElementIteratorType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138822   if (__Pyx_SetVtable(LxmlElementIteratorType.tp_dict, __pyx_vtabptr_4lxml_5etree__ElementIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138823   if (__Pyx_SetAttrString(__pyx_m, "_ElementIterator", (PyObject *)&LxmlElementIteratorType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138824   __pyx_ptype_4lxml_5etree__ElementIterator = &LxmlElementIteratorType;
138825   __pyx_vtabptr_4lxml_5etree_ElementChildIterator = &__pyx_vtable_4lxml_5etree_ElementChildIterator;
138826   __pyx_vtable_4lxml_5etree_ElementChildIterator.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ElementIterator;
138827   __pyx_type_4lxml_5etree_ElementChildIterator.tp_base = __pyx_ptype_4lxml_5etree__ElementIterator;
138828   if (PyType_Ready(&__pyx_type_4lxml_5etree_ElementChildIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138829   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_ElementChildIterator.tp_dict, __pyx_vtabptr_4lxml_5etree_ElementChildIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138830   if (__Pyx_SetAttrString(__pyx_m, "ElementChildIterator", (PyObject *)&__pyx_type_4lxml_5etree_ElementChildIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138831   __pyx_ptype_4lxml_5etree_ElementChildIterator = &__pyx_type_4lxml_5etree_ElementChildIterator;
138832   __pyx_vtabptr_4lxml_5etree_SiblingsIterator = &__pyx_vtable_4lxml_5etree_SiblingsIterator;
138833   __pyx_vtable_4lxml_5etree_SiblingsIterator.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ElementIterator;
138834   __pyx_type_4lxml_5etree_SiblingsIterator.tp_base = __pyx_ptype_4lxml_5etree__ElementIterator;
138835   if (PyType_Ready(&__pyx_type_4lxml_5etree_SiblingsIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138836   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_SiblingsIterator.tp_dict, __pyx_vtabptr_4lxml_5etree_SiblingsIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138837   if (__Pyx_SetAttrString(__pyx_m, "SiblingsIterator", (PyObject *)&__pyx_type_4lxml_5etree_SiblingsIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138838   __pyx_ptype_4lxml_5etree_SiblingsIterator = &__pyx_type_4lxml_5etree_SiblingsIterator;
138839   __pyx_vtabptr_4lxml_5etree_AncestorsIterator = &__pyx_vtable_4lxml_5etree_AncestorsIterator;
138840   __pyx_vtable_4lxml_5etree_AncestorsIterator.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ElementIterator;
138841   __pyx_type_4lxml_5etree_AncestorsIterator.tp_base = __pyx_ptype_4lxml_5etree__ElementIterator;
138842   if (PyType_Ready(&__pyx_type_4lxml_5etree_AncestorsIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138843   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_AncestorsIterator.tp_dict, __pyx_vtabptr_4lxml_5etree_AncestorsIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138844   if (__Pyx_SetAttrString(__pyx_m, "AncestorsIterator", (PyObject *)&__pyx_type_4lxml_5etree_AncestorsIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138845   __pyx_ptype_4lxml_5etree_AncestorsIterator = &__pyx_type_4lxml_5etree_AncestorsIterator;
138846   __pyx_vtabptr_4lxml_5etree_ElementDepthFirstIterator = &__pyx_vtable_4lxml_5etree_ElementDepthFirstIterator;
138847   __pyx_vtable_4lxml_5etree_ElementDepthFirstIterator.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ElementTagMatcher;
138848   #if PY_MAJOR_VERSION >= 3
138849   __pyx_vtable_4lxml_5etree_ElementDepthFirstIterator._nextNodeAnyTag = (xmlNode *(*)(struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *, xmlNode *))__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeAnyTag;
138850   __pyx_vtable_4lxml_5etree_ElementDepthFirstIterator._nextNodeMatchTag = (xmlNode *(*)(struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *, xmlNode *))__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeMatchTag;
138851   #else
138852   *(void(**)(void))&__pyx_vtable_4lxml_5etree_ElementDepthFirstIterator._nextNodeAnyTag = (void(*)(void))__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeAnyTag;
138853   *(void(**)(void))&__pyx_vtable_4lxml_5etree_ElementDepthFirstIterator._nextNodeMatchTag = (void(*)(void))__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeMatchTag;
138854   #endif
138855   __pyx_type_4lxml_5etree_ElementDepthFirstIterator.tp_base = __pyx_ptype_4lxml_5etree__ElementTagMatcher;
138856   if (PyType_Ready(&__pyx_type_4lxml_5etree_ElementDepthFirstIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138857   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_ElementDepthFirstIterator.tp_dict, __pyx_vtabptr_4lxml_5etree_ElementDepthFirstIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138858   if (__Pyx_SetAttrString(__pyx_m, "ElementDepthFirstIterator", (PyObject *)&__pyx_type_4lxml_5etree_ElementDepthFirstIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138859   __pyx_ptype_4lxml_5etree_ElementDepthFirstIterator = &__pyx_type_4lxml_5etree_ElementDepthFirstIterator;
138860   if (PyType_Ready(&__pyx_type_4lxml_5etree_ElementTextIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138861   if (__Pyx_SetAttrString(__pyx_m, "ElementTextIterator", (PyObject *)&__pyx_type_4lxml_5etree_ElementTextIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138862   __pyx_ptype_4lxml_5etree_ElementTextIterator = &__pyx_type_4lxml_5etree_ElementTextIterator;
138863   if (PyType_Ready(&__pyx_type_4lxml_5etree_CDATA) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138864   if (__Pyx_SetAttrString(__pyx_m, "CDATA", (PyObject *)&__pyx_type_4lxml_5etree_CDATA) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138865   __pyx_ptype_4lxml_5etree_CDATA = &__pyx_type_4lxml_5etree_CDATA;
138866   __pyx_vtabptr_4lxml_5etree__ReadOnlyElementProxy = &__pyx_vtable_4lxml_5etree__ReadOnlyElementProxy;
138867   #if PY_MAJOR_VERSION >= 3
138868   __pyx_vtable_4lxml_5etree__ReadOnlyElementProxy._assertNode = (int (*)(struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *))__pyx_f_4lxml_5etree_21_ReadOnlyElementProxy__assertNode;
138869   __pyx_vtable_4lxml_5etree__ReadOnlyElementProxy.free_after_use = (void (*)(struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *))__pyx_f_4lxml_5etree_21_ReadOnlyElementProxy_free_after_use;
138870   __pyx_vtable_4lxml_5etree__ReadOnlyElementProxy.getchildren = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__ReadOnlyElementProxy *, int __pyx_skip_dispatch))__pyx_f_4lxml_5etree_21_ReadOnlyElementProxy_getchildren;
138871   #else
138872   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ReadOnlyElementProxy._assertNode = (void(*)(void))__pyx_f_4lxml_5etree_21_ReadOnlyElementProxy__assertNode;
138873   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ReadOnlyElementProxy.free_after_use = (void(*)(void))__pyx_f_4lxml_5etree_21_ReadOnlyElementProxy_free_after_use;
138874   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ReadOnlyElementProxy.getchildren = (void(*)(void))__pyx_f_4lxml_5etree_21_ReadOnlyElementProxy_getchildren;
138875   #endif
138876   if (PyType_Ready(&__pyx_type_4lxml_5etree__ReadOnlyElementProxy) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138877   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ReadOnlyElementProxy.tp_dict, __pyx_vtabptr_4lxml_5etree__ReadOnlyElementProxy) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138878   if (__Pyx_SetAttrString(__pyx_m, "_ReadOnlyElementProxy", (PyObject *)&__pyx_type_4lxml_5etree__ReadOnlyElementProxy) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138879   __pyx_ptype_4lxml_5etree__ReadOnlyElementProxy = &__pyx_type_4lxml_5etree__ReadOnlyElementProxy;
138880   __pyx_vtabptr_4lxml_5etree__AppendOnlyElementProxy = &__pyx_vtable_4lxml_5etree__AppendOnlyElementProxy;
138881   __pyx_vtable_4lxml_5etree__AppendOnlyElementProxy.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ReadOnlyElementProxy;
138882   #if PY_MAJOR_VERSION >= 3
138883   __pyx_vtable_4lxml_5etree__AppendOnlyElementProxy.append = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__AppendOnlyElementProxy *, PyObject *, int __pyx_skip_dispatch))__pyx_f_4lxml_5etree_23_AppendOnlyElementProxy_append;
138884   #else
138885   *(void(**)(void))&__pyx_vtable_4lxml_5etree__AppendOnlyElementProxy.append = (void(*)(void))__pyx_f_4lxml_5etree_23_AppendOnlyElementProxy_append;
138886   #endif
138887   __pyx_type_4lxml_5etree__AppendOnlyElementProxy.tp_base = __pyx_ptype_4lxml_5etree__ReadOnlyElementProxy;
138888   if (PyType_Ready(&__pyx_type_4lxml_5etree__AppendOnlyElementProxy) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138889   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__AppendOnlyElementProxy.tp_dict, __pyx_vtabptr_4lxml_5etree__AppendOnlyElementProxy) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138890   if (__Pyx_SetAttrString(__pyx_m, "_AppendOnlyElementProxy", (PyObject *)&__pyx_type_4lxml_5etree__AppendOnlyElementProxy) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138891   __pyx_ptype_4lxml_5etree__AppendOnlyElementProxy = &__pyx_type_4lxml_5etree__AppendOnlyElementProxy;
138892   LxmlElementBaseType.tp_base = __pyx_ptype_4lxml_5etree__Element;
138893   if (PyType_Ready(&LxmlElementBaseType) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138894   if (__Pyx_SetAttrString(__pyx_m, "ElementBase", (PyObject *)&LxmlElementBaseType) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138895   __pyx_ptype_4lxml_5etree_ElementBase = &LxmlElementBaseType;
138896   __pyx_vtabptr_4lxml_5etree_CommentBase = &__pyx_vtable_4lxml_5etree_CommentBase;
138897   __pyx_vtable_4lxml_5etree_CommentBase.__pyx_base = *__pyx_vtabptr_4lxml_5etree__Comment;
138898   __pyx_type_4lxml_5etree_CommentBase.tp_base = __pyx_ptype_4lxml_5etree__Comment;
138899   if (PyType_Ready(&__pyx_type_4lxml_5etree_CommentBase) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138900   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_CommentBase.tp_dict, __pyx_vtabptr_4lxml_5etree_CommentBase) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138901   if (__Pyx_SetAttrString(__pyx_m, "CommentBase", (PyObject *)&__pyx_type_4lxml_5etree_CommentBase) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138902   __pyx_ptype_4lxml_5etree_CommentBase = &__pyx_type_4lxml_5etree_CommentBase;
138903   __pyx_vtabptr_4lxml_5etree_PIBase = &__pyx_vtable_4lxml_5etree_PIBase;
138904   __pyx_vtable_4lxml_5etree_PIBase.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ProcessingInstruction;
138905   __pyx_type_4lxml_5etree_PIBase.tp_base = __pyx_ptype_4lxml_5etree__ProcessingInstruction;
138906   if (PyType_Ready(&__pyx_type_4lxml_5etree_PIBase) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138907   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_PIBase.tp_dict, __pyx_vtabptr_4lxml_5etree_PIBase) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138908   if (__Pyx_SetAttrString(__pyx_m, "PIBase", (PyObject *)&__pyx_type_4lxml_5etree_PIBase) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138909   __pyx_ptype_4lxml_5etree_PIBase = &__pyx_type_4lxml_5etree_PIBase;
138910   __pyx_vtabptr_4lxml_5etree_EntityBase = &__pyx_vtable_4lxml_5etree_EntityBase;
138911   __pyx_vtable_4lxml_5etree_EntityBase.__pyx_base = *__pyx_vtabptr_4lxml_5etree__Entity;
138912   __pyx_type_4lxml_5etree_EntityBase.tp_base = __pyx_ptype_4lxml_5etree__Entity;
138913   if (PyType_Ready(&__pyx_type_4lxml_5etree_EntityBase) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138914   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_EntityBase.tp_dict, __pyx_vtabptr_4lxml_5etree_EntityBase) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138915   if (__Pyx_SetAttrString(__pyx_m, "EntityBase", (PyObject *)&__pyx_type_4lxml_5etree_EntityBase) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138916   __pyx_ptype_4lxml_5etree_EntityBase = &__pyx_type_4lxml_5etree_EntityBase;
138917   if (PyType_Ready(&LxmlElementClassLookupType) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138918   if (__Pyx_SetAttrString(__pyx_m, "ElementClassLookup", (PyObject *)&LxmlElementClassLookupType) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138919   __pyx_ptype_4lxml_5etree_ElementClassLookup = &LxmlElementClassLookupType;
138920   __pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup = &__pyx_vtable_4lxml_5etree_FallbackElementClassLookup;
138921   #if PY_MAJOR_VERSION >= 3
138922   __pyx_vtable_4lxml_5etree_FallbackElementClassLookup._setFallback = (void (*)(struct LxmlFallbackElementClassLookup *, struct LxmlElementClassLookup *))__pyx_f_4lxml_5etree_26FallbackElementClassLookup__setFallback;
138923   #else
138924   *(void(**)(void))&__pyx_vtable_4lxml_5etree_FallbackElementClassLookup._setFallback = (void(*)(void))__pyx_f_4lxml_5etree_26FallbackElementClassLookup__setFallback;
138925   #endif
138926   LxmlFallbackElementClassLookupType.tp_base = __pyx_ptype_4lxml_5etree_ElementClassLookup;
138927   if (PyType_Ready(&LxmlFallbackElementClassLookupType) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138928   if (__Pyx_SetVtable(LxmlFallbackElementClassLookupType.tp_dict, __pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138929   if (__Pyx_SetAttrString(__pyx_m, "FallbackElementClassLookup", (PyObject *)&LxmlFallbackElementClassLookupType) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138930   __pyx_ptype_4lxml_5etree_FallbackElementClassLookup = &LxmlFallbackElementClassLookupType;
138931   __pyx_type_4lxml_5etree_ElementDefaultClassLookup.tp_base = __pyx_ptype_4lxml_5etree_ElementClassLookup;
138932   if (PyType_Ready(&__pyx_type_4lxml_5etree_ElementDefaultClassLookup) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138933   if (__Pyx_SetAttrString(__pyx_m, "ElementDefaultClassLookup", (PyObject *)&__pyx_type_4lxml_5etree_ElementDefaultClassLookup) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138934   __pyx_ptype_4lxml_5etree_ElementDefaultClassLookup = &__pyx_type_4lxml_5etree_ElementDefaultClassLookup;
138935   __pyx_vtabptr_4lxml_5etree_AttributeBasedElementClassLookup = &__pyx_vtable_4lxml_5etree_AttributeBasedElementClassLookup;
138936   __pyx_vtable_4lxml_5etree_AttributeBasedElementClassLookup.__pyx_base = *__pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup;
138937   __pyx_type_4lxml_5etree_AttributeBasedElementClassLookup.tp_base = __pyx_ptype_4lxml_5etree_FallbackElementClassLookup;
138938   if (PyType_Ready(&__pyx_type_4lxml_5etree_AttributeBasedElementClassLookup) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138939   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_AttributeBasedElementClassLookup.tp_dict, __pyx_vtabptr_4lxml_5etree_AttributeBasedElementClassLookup) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138940   if (__Pyx_SetAttrString(__pyx_m, "AttributeBasedElementClassLookup", (PyObject *)&__pyx_type_4lxml_5etree_AttributeBasedElementClassLookup) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138941   __pyx_ptype_4lxml_5etree_AttributeBasedElementClassLookup = &__pyx_type_4lxml_5etree_AttributeBasedElementClassLookup;
138942   __pyx_vtabptr_4lxml_5etree_ParserBasedElementClassLookup = &__pyx_vtable_4lxml_5etree_ParserBasedElementClassLookup;
138943   __pyx_vtable_4lxml_5etree_ParserBasedElementClassLookup.__pyx_base = *__pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup;
138944   __pyx_type_4lxml_5etree_ParserBasedElementClassLookup.tp_base = __pyx_ptype_4lxml_5etree_FallbackElementClassLookup;
138945   if (PyType_Ready(&__pyx_type_4lxml_5etree_ParserBasedElementClassLookup) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138946   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_ParserBasedElementClassLookup.tp_dict, __pyx_vtabptr_4lxml_5etree_ParserBasedElementClassLookup) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138947   if (__Pyx_SetAttrString(__pyx_m, "ParserBasedElementClassLookup", (PyObject *)&__pyx_type_4lxml_5etree_ParserBasedElementClassLookup) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138948   __pyx_ptype_4lxml_5etree_ParserBasedElementClassLookup = &__pyx_type_4lxml_5etree_ParserBasedElementClassLookup;
138949   __pyx_vtabptr_4lxml_5etree_CustomElementClassLookup = &__pyx_vtable_4lxml_5etree_CustomElementClassLookup;
138950   __pyx_vtable_4lxml_5etree_CustomElementClassLookup.__pyx_base = *__pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup;
138951   __pyx_type_4lxml_5etree_CustomElementClassLookup.tp_base = __pyx_ptype_4lxml_5etree_FallbackElementClassLookup;
138952   if (PyType_Ready(&__pyx_type_4lxml_5etree_CustomElementClassLookup) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138953   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_CustomElementClassLookup.tp_dict, __pyx_vtabptr_4lxml_5etree_CustomElementClassLookup) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138954   if (__Pyx_SetAttrString(__pyx_m, "CustomElementClassLookup", (PyObject *)&__pyx_type_4lxml_5etree_CustomElementClassLookup) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138955   __pyx_ptype_4lxml_5etree_CustomElementClassLookup = &__pyx_type_4lxml_5etree_CustomElementClassLookup;
138956   __pyx_vtabptr_4lxml_5etree_PythonElementClassLookup = &__pyx_vtable_4lxml_5etree_PythonElementClassLookup;
138957   __pyx_vtable_4lxml_5etree_PythonElementClassLookup.__pyx_base = *__pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup;
138958   __pyx_type_4lxml_5etree_PythonElementClassLookup.tp_base = __pyx_ptype_4lxml_5etree_FallbackElementClassLookup;
138959   if (PyType_Ready(&__pyx_type_4lxml_5etree_PythonElementClassLookup) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138960   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_PythonElementClassLookup.tp_dict, __pyx_vtabptr_4lxml_5etree_PythonElementClassLookup) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138961   if (__Pyx_SetAttrString(__pyx_m, "PythonElementClassLookup", (PyObject *)&__pyx_type_4lxml_5etree_PythonElementClassLookup) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138962   __pyx_ptype_4lxml_5etree_PythonElementClassLookup = &__pyx_type_4lxml_5etree_PythonElementClassLookup;
138963   __pyx_vtabptr_4lxml_5etree__NamespaceRegistry = &__pyx_vtable_4lxml_5etree__NamespaceRegistry;
138964   #if PY_MAJOR_VERSION >= 3
138965   __pyx_vtable_4lxml_5etree__NamespaceRegistry._get = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__NamespaceRegistry *, PyObject *))__pyx_f_4lxml_5etree_18_NamespaceRegistry__get;
138966   __pyx_vtable_4lxml_5etree__NamespaceRegistry._getForString = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__NamespaceRegistry *, char *))__pyx_f_4lxml_5etree_18_NamespaceRegistry__getForString;
138967   #else
138968   *(void(**)(void))&__pyx_vtable_4lxml_5etree__NamespaceRegistry._get = (void(*)(void))__pyx_f_4lxml_5etree_18_NamespaceRegistry__get;
138969   *(void(**)(void))&__pyx_vtable_4lxml_5etree__NamespaceRegistry._getForString = (void(*)(void))__pyx_f_4lxml_5etree_18_NamespaceRegistry__getForString;
138970   #endif
138971   if (PyType_Ready(&__pyx_type_4lxml_5etree__NamespaceRegistry) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138972   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__NamespaceRegistry.tp_dict, __pyx_vtabptr_4lxml_5etree__NamespaceRegistry) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138973   if (__Pyx_SetAttrString(__pyx_m, "_NamespaceRegistry", (PyObject *)&__pyx_type_4lxml_5etree__NamespaceRegistry) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138974   __pyx_ptype_4lxml_5etree__NamespaceRegistry = &__pyx_type_4lxml_5etree__NamespaceRegistry;
138975   __pyx_vtabptr_4lxml_5etree__ClassNamespaceRegistry = &__pyx_vtable_4lxml_5etree__ClassNamespaceRegistry;
138976   __pyx_vtable_4lxml_5etree__ClassNamespaceRegistry.__pyx_base = *__pyx_vtabptr_4lxml_5etree__NamespaceRegistry;
138977   __pyx_type_4lxml_5etree__ClassNamespaceRegistry.tp_base = __pyx_ptype_4lxml_5etree__NamespaceRegistry;
138978   if (PyType_Ready(&__pyx_type_4lxml_5etree__ClassNamespaceRegistry) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138979   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ClassNamespaceRegistry.tp_dict, __pyx_vtabptr_4lxml_5etree__ClassNamespaceRegistry) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138980   if (__Pyx_SetAttrString(__pyx_m, "_ClassNamespaceRegistry", (PyObject *)&__pyx_type_4lxml_5etree__ClassNamespaceRegistry) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138981   __pyx_ptype_4lxml_5etree__ClassNamespaceRegistry = &__pyx_type_4lxml_5etree__ClassNamespaceRegistry;
138982   __pyx_vtabptr_4lxml_5etree_ElementNamespaceClassLookup = &__pyx_vtable_4lxml_5etree_ElementNamespaceClassLookup;
138983   __pyx_vtable_4lxml_5etree_ElementNamespaceClassLookup.__pyx_base = *__pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup;
138984   __pyx_type_4lxml_5etree_ElementNamespaceClassLookup.tp_base = __pyx_ptype_4lxml_5etree_FallbackElementClassLookup;
138985   if (PyType_Ready(&__pyx_type_4lxml_5etree_ElementNamespaceClassLookup) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138986   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_ElementNamespaceClassLookup.tp_dict, __pyx_vtabptr_4lxml_5etree_ElementNamespaceClassLookup) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138987   if (__Pyx_SetAttrString(__pyx_m, "ElementNamespaceClassLookup", (PyObject *)&__pyx_type_4lxml_5etree_ElementNamespaceClassLookup) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138988   __pyx_ptype_4lxml_5etree_ElementNamespaceClassLookup = &__pyx_type_4lxml_5etree_ElementNamespaceClassLookup;
138989   __pyx_vtabptr_4lxml_5etree__FunctionNamespaceRegistry = &__pyx_vtable_4lxml_5etree__FunctionNamespaceRegistry;
138990   __pyx_vtable_4lxml_5etree__FunctionNamespaceRegistry.__pyx_base = *__pyx_vtabptr_4lxml_5etree__NamespaceRegistry;
138991   __pyx_type_4lxml_5etree__FunctionNamespaceRegistry.tp_base = __pyx_ptype_4lxml_5etree__NamespaceRegistry;
138992   if (PyType_Ready(&__pyx_type_4lxml_5etree__FunctionNamespaceRegistry) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138993   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__FunctionNamespaceRegistry.tp_dict, __pyx_vtabptr_4lxml_5etree__FunctionNamespaceRegistry) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138994   if (__Pyx_SetAttrString(__pyx_m, "_FunctionNamespaceRegistry", (PyObject *)&__pyx_type_4lxml_5etree__FunctionNamespaceRegistry) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
138995   __pyx_ptype_4lxml_5etree__FunctionNamespaceRegistry = &__pyx_type_4lxml_5etree__FunctionNamespaceRegistry;
138996   __pyx_vtabptr_4lxml_5etree__XPathFunctionNamespaceRegistry = &__pyx_vtable_4lxml_5etree__XPathFunctionNamespaceRegistry;
138997   __pyx_vtable_4lxml_5etree__XPathFunctionNamespaceRegistry.__pyx_base = *__pyx_vtabptr_4lxml_5etree__FunctionNamespaceRegistry;
138998   __pyx_type_4lxml_5etree__XPathFunctionNamespaceRegistry.tp_base = __pyx_ptype_4lxml_5etree__FunctionNamespaceRegistry;
138999   if (PyType_Ready(&__pyx_type_4lxml_5etree__XPathFunctionNamespaceRegistry) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139000   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__XPathFunctionNamespaceRegistry.tp_dict, __pyx_vtabptr_4lxml_5etree__XPathFunctionNamespaceRegistry) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139001   if (__Pyx_SetAttrString(__pyx_m, "_XPathFunctionNamespaceRegistry", (PyObject *)&__pyx_type_4lxml_5etree__XPathFunctionNamespaceRegistry) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139002   __pyx_ptype_4lxml_5etree__XPathFunctionNamespaceRegistry = &__pyx_type_4lxml_5etree__XPathFunctionNamespaceRegistry;
139003   if (PyType_Ready(&__pyx_type_4lxml_5etree__InputDocument) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139004   if (__Pyx_SetAttrString(__pyx_m, "_InputDocument", (PyObject *)&__pyx_type_4lxml_5etree__InputDocument) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139005   __pyx_ptype_4lxml_5etree__InputDocument = &__pyx_type_4lxml_5etree__InputDocument;
139006   if (PyType_Ready(&__pyx_type_4lxml_5etree_Resolver) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139007   if (__Pyx_SetAttrString(__pyx_m, "Resolver", (PyObject *)&__pyx_type_4lxml_5etree_Resolver) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139008   __pyx_ptype_4lxml_5etree_Resolver = &__pyx_type_4lxml_5etree_Resolver;
139009   __pyx_vtabptr_4lxml_5etree__ResolverRegistry = &__pyx_vtable_4lxml_5etree__ResolverRegistry;
139010   #if PY_MAJOR_VERSION >= 3
139011   __pyx_vtable_4lxml_5etree__ResolverRegistry._copy = (struct __pyx_obj_4lxml_5etree__ResolverRegistry *(*)(struct __pyx_obj_4lxml_5etree__ResolverRegistry *))__pyx_f_4lxml_5etree_17_ResolverRegistry__copy;
139012   #else
139013   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ResolverRegistry._copy = (void(*)(void))__pyx_f_4lxml_5etree_17_ResolverRegistry__copy;
139014   #endif
139015   if (PyType_Ready(&__pyx_type_4lxml_5etree__ResolverRegistry) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139016   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ResolverRegistry.tp_dict, __pyx_vtabptr_4lxml_5etree__ResolverRegistry) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139017   if (__Pyx_SetAttrString(__pyx_m, "_ResolverRegistry", (PyObject *)&__pyx_type_4lxml_5etree__ResolverRegistry) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139018   __pyx_ptype_4lxml_5etree__ResolverRegistry = &__pyx_type_4lxml_5etree__ResolverRegistry;
139019   __pyx_vtabptr_4lxml_5etree__ResolverContext = &__pyx_vtable_4lxml_5etree__ResolverContext;
139020   __pyx_vtable_4lxml_5etree__ResolverContext.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ExceptionContext;
139021   #if PY_MAJOR_VERSION >= 3
139022   __pyx_vtable_4lxml_5etree__ResolverContext.__pyx_base.clear = (void (*)(struct __pyx_obj_4lxml_5etree__ExceptionContext *))__pyx_f_4lxml_5etree_16_ResolverContext_clear;
139023   #else
139024   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ResolverContext.__pyx_base.clear = (void(*)(void))__pyx_f_4lxml_5etree_16_ResolverContext_clear;
139025   #endif
139026   __pyx_type_4lxml_5etree__ResolverContext.tp_base = __pyx_ptype_4lxml_5etree__ExceptionContext;
139027   if (PyType_Ready(&__pyx_type_4lxml_5etree__ResolverContext) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139028   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ResolverContext.tp_dict, __pyx_vtabptr_4lxml_5etree__ResolverContext) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139029   if (__Pyx_SetAttrString(__pyx_m, "_ResolverContext", (PyObject *)&__pyx_type_4lxml_5etree__ResolverContext) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139030   __pyx_ptype_4lxml_5etree__ResolverContext = &__pyx_type_4lxml_5etree__ResolverContext;
139031   __pyx_vtabptr_4lxml_5etree__ParserContext = &__pyx_vtable_4lxml_5etree__ParserContext;
139032   __pyx_vtable_4lxml_5etree__ParserContext.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ResolverContext;
139033   #if PY_MAJOR_VERSION >= 3
139034   __pyx_vtable_4lxml_5etree__ParserContext._copy = (struct __pyx_obj_4lxml_5etree__ParserContext *(*)(struct __pyx_obj_4lxml_5etree__ParserContext *))__pyx_f_4lxml_5etree_14_ParserContext__copy;
139035   __pyx_vtable_4lxml_5etree__ParserContext._initParserContext = (void (*)(struct __pyx_obj_4lxml_5etree__ParserContext *, xmlParserCtxt *))__pyx_f_4lxml_5etree_14_ParserContext__initParserContext;
139036   __pyx_vtable_4lxml_5etree__ParserContext._resetParserContext = (void (*)(struct __pyx_obj_4lxml_5etree__ParserContext *))__pyx_f_4lxml_5etree_14_ParserContext__resetParserContext;
139037   __pyx_vtable_4lxml_5etree__ParserContext.prepare = (int (*)(struct __pyx_obj_4lxml_5etree__ParserContext *))__pyx_f_4lxml_5etree_14_ParserContext_prepare;
139038   __pyx_vtable_4lxml_5etree__ParserContext.cleanup = (int (*)(struct __pyx_obj_4lxml_5etree__ParserContext *))__pyx_f_4lxml_5etree_14_ParserContext_cleanup;
139039   __pyx_vtable_4lxml_5etree__ParserContext._handleParseResult = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__ParserContext *, struct __pyx_obj_4lxml_5etree__BaseParser *, xmlDoc *, PyObject *))__pyx_f_4lxml_5etree_14_ParserContext__handleParseResult;
139040   __pyx_vtable_4lxml_5etree__ParserContext._handleParseResultDoc = (xmlDoc *(*)(struct __pyx_obj_4lxml_5etree__ParserContext *, struct __pyx_obj_4lxml_5etree__BaseParser *, xmlDoc *, PyObject *))__pyx_f_4lxml_5etree_14_ParserContext__handleParseResultDoc;
139041   #else
139042   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserContext._copy = (void(*)(void))__pyx_f_4lxml_5etree_14_ParserContext__copy;
139043   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserContext._initParserContext = (void(*)(void))__pyx_f_4lxml_5etree_14_ParserContext__initParserContext;
139044   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserContext._resetParserContext = (void(*)(void))__pyx_f_4lxml_5etree_14_ParserContext__resetParserContext;
139045   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserContext.prepare = (void(*)(void))__pyx_f_4lxml_5etree_14_ParserContext_prepare;
139046   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserContext.cleanup = (void(*)(void))__pyx_f_4lxml_5etree_14_ParserContext_cleanup;
139047   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserContext._handleParseResult = (void(*)(void))__pyx_f_4lxml_5etree_14_ParserContext__handleParseResult;
139048   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserContext._handleParseResultDoc = (void(*)(void))__pyx_f_4lxml_5etree_14_ParserContext__handleParseResultDoc;
139049   #endif
139050   __pyx_type_4lxml_5etree__ParserContext.tp_base = __pyx_ptype_4lxml_5etree__ResolverContext;
139051   if (PyType_Ready(&__pyx_type_4lxml_5etree__ParserContext) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139052   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ParserContext.tp_dict, __pyx_vtabptr_4lxml_5etree__ParserContext) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139053   if (__Pyx_SetAttrString(__pyx_m, "_ParserContext", (PyObject *)&__pyx_type_4lxml_5etree__ParserContext) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139054   __pyx_ptype_4lxml_5etree__ParserContext = &__pyx_type_4lxml_5etree__ParserContext;
139055   __pyx_vtabptr_4lxml_5etree__SaxParserContext = &__pyx_vtable_4lxml_5etree__SaxParserContext;
139056   __pyx_vtable_4lxml_5etree__SaxParserContext.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ParserContext;
139057   #if PY_MAJOR_VERSION >= 3
139058   __pyx_vtable_4lxml_5etree__SaxParserContext.__pyx_base._initParserContext = (void (*)(struct __pyx_obj_4lxml_5etree__ParserContext *, xmlParserCtxt *))__pyx_f_4lxml_5etree_17_SaxParserContext__initParserContext;
139059   __pyx_vtable_4lxml_5etree__SaxParserContext._setSaxParserTarget = (void (*)(struct __pyx_obj_4lxml_5etree__SaxParserContext *, struct __pyx_obj_4lxml_5etree__SaxParserTarget *))__pyx_f_4lxml_5etree_17_SaxParserContext__setSaxParserTarget;
139060   __pyx_vtable_4lxml_5etree__SaxParserContext._handleSaxException = (void (*)(struct __pyx_obj_4lxml_5etree__SaxParserContext *, xmlParserCtxt *))__pyx_f_4lxml_5etree_17_SaxParserContext__handleSaxException;
139061   #else
139062   *(void(**)(void))&__pyx_vtable_4lxml_5etree__SaxParserContext.__pyx_base._initParserContext = (void(*)(void))__pyx_f_4lxml_5etree_17_SaxParserContext__initParserContext;
139063   *(void(**)(void))&__pyx_vtable_4lxml_5etree__SaxParserContext._setSaxParserTarget = (void(*)(void))__pyx_f_4lxml_5etree_17_SaxParserContext__setSaxParserTarget;
139064   *(void(**)(void))&__pyx_vtable_4lxml_5etree__SaxParserContext._handleSaxException = (void(*)(void))__pyx_f_4lxml_5etree_17_SaxParserContext__handleSaxException;
139065   #endif
139066   __pyx_type_4lxml_5etree__SaxParserContext.tp_base = __pyx_ptype_4lxml_5etree__ParserContext;
139067   if (PyType_Ready(&__pyx_type_4lxml_5etree__SaxParserContext) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139068   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__SaxParserContext.tp_dict, __pyx_vtabptr_4lxml_5etree__SaxParserContext) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139069   if (__Pyx_SetAttrString(__pyx_m, "_SaxParserContext", (PyObject *)&__pyx_type_4lxml_5etree__SaxParserContext) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139070   __pyx_ptype_4lxml_5etree__SaxParserContext = &__pyx_type_4lxml_5etree__SaxParserContext;
139071   __pyx_vtabptr_4lxml_5etree__TargetParserContext = &__pyx_vtable_4lxml_5etree__TargetParserContext;
139072   __pyx_vtable_4lxml_5etree__TargetParserContext.__pyx_base = *__pyx_vtabptr_4lxml_5etree__SaxParserContext;
139073   #if PY_MAJOR_VERSION >= 3
139074   __pyx_vtable_4lxml_5etree__TargetParserContext.__pyx_base.__pyx_base._copy = (struct __pyx_obj_4lxml_5etree__ParserContext *(*)(struct __pyx_obj_4lxml_5etree__ParserContext *))__pyx_f_4lxml_5etree_20_TargetParserContext__copy;
139075   __pyx_vtable_4lxml_5etree__TargetParserContext.__pyx_base.__pyx_base._handleParseResult = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__ParserContext *, struct __pyx_obj_4lxml_5etree__BaseParser *, xmlDoc *, PyObject *))__pyx_f_4lxml_5etree_20_TargetParserContext__handleParseResult;
139076   __pyx_vtable_4lxml_5etree__TargetParserContext.__pyx_base.__pyx_base._handleParseResultDoc = (xmlDoc *(*)(struct __pyx_obj_4lxml_5etree__ParserContext *, struct __pyx_obj_4lxml_5etree__BaseParser *, xmlDoc *, PyObject *))__pyx_f_4lxml_5etree_20_TargetParserContext__handleParseResultDoc;
139077   __pyx_vtable_4lxml_5etree__TargetParserContext._setTarget = (int (*)(struct __pyx_obj_4lxml_5etree__TargetParserContext *, PyObject *))__pyx_f_4lxml_5etree_20_TargetParserContext__setTarget;
139078   __pyx_vtable_4lxml_5etree__TargetParserContext._cleanupTargetParserContext = (void (*)(struct __pyx_obj_4lxml_5etree__TargetParserContext *, xmlDoc *))__pyx_f_4lxml_5etree_20_TargetParserContext__cleanupTargetParserContext;
139079   #else
139080   *(void(**)(void))&__pyx_vtable_4lxml_5etree__TargetParserContext.__pyx_base.__pyx_base._copy = (void(*)(void))__pyx_f_4lxml_5etree_20_TargetParserContext__copy;
139081   *(void(**)(void))&__pyx_vtable_4lxml_5etree__TargetParserContext.__pyx_base.__pyx_base._handleParseResult = (void(*)(void))__pyx_f_4lxml_5etree_20_TargetParserContext__handleParseResult;
139082   *(void(**)(void))&__pyx_vtable_4lxml_5etree__TargetParserContext.__pyx_base.__pyx_base._handleParseResultDoc = (void(*)(void))__pyx_f_4lxml_5etree_20_TargetParserContext__handleParseResultDoc;
139083   *(void(**)(void))&__pyx_vtable_4lxml_5etree__TargetParserContext._setTarget = (void(*)(void))__pyx_f_4lxml_5etree_20_TargetParserContext__setTarget;
139084   *(void(**)(void))&__pyx_vtable_4lxml_5etree__TargetParserContext._cleanupTargetParserContext = (void(*)(void))__pyx_f_4lxml_5etree_20_TargetParserContext__cleanupTargetParserContext;
139085   #endif
139086   __pyx_type_4lxml_5etree__TargetParserContext.tp_base = __pyx_ptype_4lxml_5etree__SaxParserContext;
139087   if (PyType_Ready(&__pyx_type_4lxml_5etree__TargetParserContext) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139088   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__TargetParserContext.tp_dict, __pyx_vtabptr_4lxml_5etree__TargetParserContext) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139089   if (__Pyx_SetAttrString(__pyx_m, "_TargetParserContext", (PyObject *)&__pyx_type_4lxml_5etree__TargetParserContext) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139090   __pyx_ptype_4lxml_5etree__TargetParserContext = &__pyx_type_4lxml_5etree__TargetParserContext;
139091   __pyx_vtabptr_4lxml_5etree__ParserSchemaValidationContext = &__pyx_vtable_4lxml_5etree__ParserSchemaValidationContext;
139092   #if PY_MAJOR_VERSION >= 3
139093   __pyx_vtable_4lxml_5etree__ParserSchemaValidationContext.copy = (struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *(*)(struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *))__pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_copy;
139094   __pyx_vtable_4lxml_5etree__ParserSchemaValidationContext.inject_default_attributes = (void (*)(struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *, xmlDoc *))__pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_inject_default_attributes;
139095   __pyx_vtable_4lxml_5etree__ParserSchemaValidationContext.connect = (int (*)(struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *, xmlParserCtxt *))__pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_connect;
139096   __pyx_vtable_4lxml_5etree__ParserSchemaValidationContext.disconnect = (void (*)(struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *))__pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_disconnect;
139097   __pyx_vtable_4lxml_5etree__ParserSchemaValidationContext.isvalid = (int (*)(struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *))__pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_isvalid;
139098   #else
139099   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserSchemaValidationContext.copy = (void(*)(void))__pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_copy;
139100   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserSchemaValidationContext.inject_default_attributes = (void(*)(void))__pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_inject_default_attributes;
139101   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserSchemaValidationContext.connect = (void(*)(void))__pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_connect;
139102   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserSchemaValidationContext.disconnect = (void(*)(void))__pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_disconnect;
139103   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserSchemaValidationContext.isvalid = (void(*)(void))__pyx_f_4lxml_5etree_30_ParserSchemaValidationContext_isvalid;
139104   #endif
139105   if (PyType_Ready(&__pyx_type_4lxml_5etree__ParserSchemaValidationContext) < 0) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139106   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ParserSchemaValidationContext.tp_dict, __pyx_vtabptr_4lxml_5etree__ParserSchemaValidationContext) < 0) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139107   if (__Pyx_SetAttrString(__pyx_m, "_ParserSchemaValidationContext", (PyObject *)&__pyx_type_4lxml_5etree__ParserSchemaValidationContext) < 0) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139108   __pyx_ptype_4lxml_5etree__ParserSchemaValidationContext = &__pyx_type_4lxml_5etree__ParserSchemaValidationContext;
139109   if (PyType_Ready(&__pyx_type_4lxml_5etree__Validator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139110   if (__Pyx_SetAttrString(__pyx_m, "_Validator", (PyObject *)&__pyx_type_4lxml_5etree__Validator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139111   __pyx_ptype_4lxml_5etree__Validator = &__pyx_type_4lxml_5etree__Validator;
139112   __pyx_vtabptr_4lxml_5etree_XMLSchema = &__pyx_vtable_4lxml_5etree_XMLSchema;
139113   #if PY_MAJOR_VERSION >= 3
139114   __pyx_vtable_4lxml_5etree_XMLSchema._newSaxValidator = (struct __pyx_obj_4lxml_5etree__ParserSchemaValidationContext *(*)(struct __pyx_obj_4lxml_5etree_XMLSchema *, int))__pyx_f_4lxml_5etree_9XMLSchema__newSaxValidator;
139115   #else
139116   *(void(**)(void))&__pyx_vtable_4lxml_5etree_XMLSchema._newSaxValidator = (void(*)(void))__pyx_f_4lxml_5etree_9XMLSchema__newSaxValidator;
139117   #endif
139118   __pyx_type_4lxml_5etree_XMLSchema.tp_base = __pyx_ptype_4lxml_5etree__Validator;
139119   if (PyType_Ready(&__pyx_type_4lxml_5etree_XMLSchema) < 0) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139120   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_XMLSchema.tp_dict, __pyx_vtabptr_4lxml_5etree_XMLSchema) < 0) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139121   if (__Pyx_SetAttrString(__pyx_m, "XMLSchema", (PyObject *)&__pyx_type_4lxml_5etree_XMLSchema) < 0) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139122   __pyx_ptype_4lxml_5etree_XMLSchema = &__pyx_type_4lxml_5etree_XMLSchema;
139123   __pyx_vtabptr_4lxml_5etree__ParserDictionaryContext = &__pyx_vtable_4lxml_5etree__ParserDictionaryContext;
139124   #if PY_MAJOR_VERSION >= 3
139125   __pyx_vtable_4lxml_5etree__ParserDictionaryContext.initMainParserContext = (void (*)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_initMainParserContext;
139126   __pyx_vtable_4lxml_5etree__ParserDictionaryContext._findThreadParserContext = (struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *(*)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *))__pyx_f_4lxml_5etree_24_ParserDictionaryContext__findThreadParserContext;
139127   __pyx_vtable_4lxml_5etree__ParserDictionaryContext.setDefaultParser = (void (*)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *, struct __pyx_obj_4lxml_5etree__BaseParser *))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_setDefaultParser;
139128   __pyx_vtable_4lxml_5etree__ParserDictionaryContext.getDefaultParser = (struct __pyx_obj_4lxml_5etree__BaseParser *(*)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_getDefaultParser;
139129   __pyx_vtable_4lxml_5etree__ParserDictionaryContext._getThreadDict = (xmlDict *(*)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *, xmlDict *))__pyx_f_4lxml_5etree_24_ParserDictionaryContext__getThreadDict;
139130   __pyx_vtable_4lxml_5etree__ParserDictionaryContext.initThreadDictRef = (void (*)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *, xmlDict **))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_initThreadDictRef;
139131   __pyx_vtable_4lxml_5etree__ParserDictionaryContext.initParserDict = (void (*)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *, xmlParserCtxt *))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_initParserDict;
139132   __pyx_vtable_4lxml_5etree__ParserDictionaryContext.initXPathParserDict = (void (*)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *, xmlXPathContext *))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_initXPathParserDict;
139133   __pyx_vtable_4lxml_5etree__ParserDictionaryContext.initDocDict = (void (*)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *, xmlDoc *))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_initDocDict;
139134   __pyx_vtable_4lxml_5etree__ParserDictionaryContext.findImpliedContext = (struct __pyx_obj_4lxml_5etree__ParserContext *(*)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_findImpliedContext;
139135   __pyx_vtable_4lxml_5etree__ParserDictionaryContext.pushImpliedContextFromParser = (void (*)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *, struct __pyx_obj_4lxml_5etree__BaseParser *))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_pushImpliedContextFromParser;
139136   __pyx_vtable_4lxml_5etree__ParserDictionaryContext.pushImpliedContext = (void (*)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *, struct __pyx_obj_4lxml_5etree__ParserContext *))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_pushImpliedContext;
139137   __pyx_vtable_4lxml_5etree__ParserDictionaryContext.popImpliedContext = (void (*)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_popImpliedContext;
139138   #else
139139   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserDictionaryContext.initMainParserContext = (void(*)(void))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_initMainParserContext;
139140   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserDictionaryContext._findThreadParserContext = (void(*)(void))__pyx_f_4lxml_5etree_24_ParserDictionaryContext__findThreadParserContext;
139141   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserDictionaryContext.setDefaultParser = (void(*)(void))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_setDefaultParser;
139142   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserDictionaryContext.getDefaultParser = (void(*)(void))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_getDefaultParser;
139143   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserDictionaryContext._getThreadDict = (void(*)(void))__pyx_f_4lxml_5etree_24_ParserDictionaryContext__getThreadDict;
139144   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserDictionaryContext.initThreadDictRef = (void(*)(void))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_initThreadDictRef;
139145   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserDictionaryContext.initParserDict = (void(*)(void))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_initParserDict;
139146   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserDictionaryContext.initXPathParserDict = (void(*)(void))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_initXPathParserDict;
139147   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserDictionaryContext.initDocDict = (void(*)(void))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_initDocDict;
139148   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserDictionaryContext.findImpliedContext = (void(*)(void))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_findImpliedContext;
139149   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserDictionaryContext.pushImpliedContextFromParser = (void(*)(void))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_pushImpliedContextFromParser;
139150   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserDictionaryContext.pushImpliedContext = (void(*)(void))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_pushImpliedContext;
139151   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserDictionaryContext.popImpliedContext = (void(*)(void))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_popImpliedContext;
139152   #endif
139153   if (PyType_Ready(&__pyx_type_4lxml_5etree__ParserDictionaryContext) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139154   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ParserDictionaryContext.tp_dict, __pyx_vtabptr_4lxml_5etree__ParserDictionaryContext) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139155   if (__Pyx_SetAttrString(__pyx_m, "_ParserDictionaryContext", (PyObject *)&__pyx_type_4lxml_5etree__ParserDictionaryContext) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139156   __pyx_ptype_4lxml_5etree__ParserDictionaryContext = &__pyx_type_4lxml_5etree__ParserDictionaryContext;
139157   __pyx_vtabptr_4lxml_5etree__FileReaderContext = &__pyx_vtable_4lxml_5etree__FileReaderContext;
139158   #if PY_MAJOR_VERSION >= 3
139159   __pyx_vtable_4lxml_5etree__FileReaderContext._createParserInputBuffer = (xmlParserInputBuffer *(*)(struct __pyx_obj_4lxml_5etree__FileReaderContext *))__pyx_f_4lxml_5etree_18_FileReaderContext__createParserInputBuffer;
139160   __pyx_vtable_4lxml_5etree__FileReaderContext._createParserInput = (xmlParserInput *(*)(struct __pyx_obj_4lxml_5etree__FileReaderContext *, xmlParserCtxt *))__pyx_f_4lxml_5etree_18_FileReaderContext__createParserInput;
139161   __pyx_vtable_4lxml_5etree__FileReaderContext._readDtd = (xmlDtd *(*)(struct __pyx_obj_4lxml_5etree__FileReaderContext *))__pyx_f_4lxml_5etree_18_FileReaderContext__readDtd;
139162   __pyx_vtable_4lxml_5etree__FileReaderContext._readDoc = (xmlDoc *(*)(struct __pyx_obj_4lxml_5etree__FileReaderContext *, xmlParserCtxt *, int))__pyx_f_4lxml_5etree_18_FileReaderContext__readDoc;
139163   __pyx_vtable_4lxml_5etree__FileReaderContext.copyToBuffer = (int (*)(struct __pyx_obj_4lxml_5etree__FileReaderContext *, char *, int))__pyx_f_4lxml_5etree_18_FileReaderContext_copyToBuffer;
139164   #else
139165   *(void(**)(void))&__pyx_vtable_4lxml_5etree__FileReaderContext._createParserInputBuffer = (void(*)(void))__pyx_f_4lxml_5etree_18_FileReaderContext__createParserInputBuffer;
139166   *(void(**)(void))&__pyx_vtable_4lxml_5etree__FileReaderContext._createParserInput = (void(*)(void))__pyx_f_4lxml_5etree_18_FileReaderContext__createParserInput;
139167   *(void(**)(void))&__pyx_vtable_4lxml_5etree__FileReaderContext._readDtd = (void(*)(void))__pyx_f_4lxml_5etree_18_FileReaderContext__readDtd;
139168   *(void(**)(void))&__pyx_vtable_4lxml_5etree__FileReaderContext._readDoc = (void(*)(void))__pyx_f_4lxml_5etree_18_FileReaderContext__readDoc;
139169   *(void(**)(void))&__pyx_vtable_4lxml_5etree__FileReaderContext.copyToBuffer = (void(*)(void))__pyx_f_4lxml_5etree_18_FileReaderContext_copyToBuffer;
139170   #endif
139171   if (PyType_Ready(&__pyx_type_4lxml_5etree__FileReaderContext) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139172   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__FileReaderContext.tp_dict, __pyx_vtabptr_4lxml_5etree__FileReaderContext) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139173   if (__Pyx_SetAttrString(__pyx_m, "_FileReaderContext", (PyObject *)&__pyx_type_4lxml_5etree__FileReaderContext) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139174   __pyx_ptype_4lxml_5etree__FileReaderContext = &__pyx_type_4lxml_5etree__FileReaderContext;
139175   __pyx_vtabptr_4lxml_5etree__FeedParser = &__pyx_vtable_4lxml_5etree__FeedParser;
139176   __pyx_vtable_4lxml_5etree__FeedParser.__pyx_base = *__pyx_vtabptr_4lxml_5etree__BaseParser;
139177   __pyx_type_4lxml_5etree__FeedParser.tp_base = __pyx_ptype_4lxml_5etree__BaseParser;
139178   if (PyType_Ready(&__pyx_type_4lxml_5etree__FeedParser) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139179   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__FeedParser.tp_dict, __pyx_vtabptr_4lxml_5etree__FeedParser) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139180   if (__Pyx_SetAttrString(__pyx_m, "_FeedParser", (PyObject *)&__pyx_type_4lxml_5etree__FeedParser) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139181   __pyx_ptype_4lxml_5etree__FeedParser = &__pyx_type_4lxml_5etree__FeedParser;
139182   __pyx_vtabptr_4lxml_5etree_XMLParser = &__pyx_vtable_4lxml_5etree_XMLParser;
139183   __pyx_vtable_4lxml_5etree_XMLParser.__pyx_base = *__pyx_vtabptr_4lxml_5etree__FeedParser;
139184   __pyx_type_4lxml_5etree_XMLParser.tp_base = __pyx_ptype_4lxml_5etree__FeedParser;
139185   if (PyType_Ready(&__pyx_type_4lxml_5etree_XMLParser) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139186   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_XMLParser.tp_dict, __pyx_vtabptr_4lxml_5etree_XMLParser) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139187   if (__Pyx_SetAttrString(__pyx_m, "XMLParser", (PyObject *)&__pyx_type_4lxml_5etree_XMLParser) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139188   __pyx_ptype_4lxml_5etree_XMLParser = &__pyx_type_4lxml_5etree_XMLParser;
139189   __pyx_vtabptr_4lxml_5etree_ETCompatXMLParser = &__pyx_vtable_4lxml_5etree_ETCompatXMLParser;
139190   __pyx_vtable_4lxml_5etree_ETCompatXMLParser.__pyx_base = *__pyx_vtabptr_4lxml_5etree_XMLParser;
139191   __pyx_type_4lxml_5etree_ETCompatXMLParser.tp_base = __pyx_ptype_4lxml_5etree_XMLParser;
139192   if (PyType_Ready(&__pyx_type_4lxml_5etree_ETCompatXMLParser) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139193   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_ETCompatXMLParser.tp_dict, __pyx_vtabptr_4lxml_5etree_ETCompatXMLParser) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139194   if (__Pyx_SetAttrString(__pyx_m, "ETCompatXMLParser", (PyObject *)&__pyx_type_4lxml_5etree_ETCompatXMLParser) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139195   __pyx_ptype_4lxml_5etree_ETCompatXMLParser = &__pyx_type_4lxml_5etree_ETCompatXMLParser;
139196   __pyx_vtabptr_4lxml_5etree_HTMLParser = &__pyx_vtable_4lxml_5etree_HTMLParser;
139197   __pyx_vtable_4lxml_5etree_HTMLParser.__pyx_base = *__pyx_vtabptr_4lxml_5etree__FeedParser;
139198   __pyx_type_4lxml_5etree_HTMLParser.tp_base = __pyx_ptype_4lxml_5etree__FeedParser;
139199   if (PyType_Ready(&__pyx_type_4lxml_5etree_HTMLParser) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139200   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_HTMLParser.tp_dict, __pyx_vtabptr_4lxml_5etree_HTMLParser) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139201   if (__Pyx_SetAttrString(__pyx_m, "HTMLParser", (PyObject *)&__pyx_type_4lxml_5etree_HTMLParser) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139202   __pyx_ptype_4lxml_5etree_HTMLParser = &__pyx_type_4lxml_5etree_HTMLParser;
139203   __pyx_vtabptr_4lxml_5etree__SaxParserTarget = &__pyx_vtable_4lxml_5etree__SaxParserTarget;
139204   #if PY_MAJOR_VERSION >= 3
139205   __pyx_vtable_4lxml_5etree__SaxParserTarget._handleSaxStart = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *, PyObject *, PyObject *, PyObject *))__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxStart;
139206   __pyx_vtable_4lxml_5etree__SaxParserTarget._handleSaxEnd = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *, PyObject *))__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxEnd;
139207   __pyx_vtable_4lxml_5etree__SaxParserTarget._handleSaxData = (int (*)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *, PyObject *))__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxData;
139208   __pyx_vtable_4lxml_5etree__SaxParserTarget._handleSaxDoctype = (int (*)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *, PyObject *, PyObject *, PyObject *))__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxDoctype;
139209   __pyx_vtable_4lxml_5etree__SaxParserTarget._handleSaxPi = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *, PyObject *, PyObject *))__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxPi;
139210   __pyx_vtable_4lxml_5etree__SaxParserTarget._handleSaxComment = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *, PyObject *))__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxComment;
139211   #else
139212   *(void(**)(void))&__pyx_vtable_4lxml_5etree__SaxParserTarget._handleSaxStart = (void(*)(void))__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxStart;
139213   *(void(**)(void))&__pyx_vtable_4lxml_5etree__SaxParserTarget._handleSaxEnd = (void(*)(void))__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxEnd;
139214   *(void(**)(void))&__pyx_vtable_4lxml_5etree__SaxParserTarget._handleSaxData = (void(*)(void))__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxData;
139215   *(void(**)(void))&__pyx_vtable_4lxml_5etree__SaxParserTarget._handleSaxDoctype = (void(*)(void))__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxDoctype;
139216   *(void(**)(void))&__pyx_vtable_4lxml_5etree__SaxParserTarget._handleSaxPi = (void(*)(void))__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxPi;
139217   *(void(**)(void))&__pyx_vtable_4lxml_5etree__SaxParserTarget._handleSaxComment = (void(*)(void))__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxComment;
139218   #endif
139219   if (PyType_Ready(&__pyx_type_4lxml_5etree__SaxParserTarget) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139220   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__SaxParserTarget.tp_dict, __pyx_vtabptr_4lxml_5etree__SaxParserTarget) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139221   if (__Pyx_SetAttrString(__pyx_m, "_SaxParserTarget", (PyObject *)&__pyx_type_4lxml_5etree__SaxParserTarget) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139222   __pyx_ptype_4lxml_5etree__SaxParserTarget = &__pyx_type_4lxml_5etree__SaxParserTarget;
139223   __pyx_vtabptr_4lxml_5etree_TreeBuilder = &__pyx_vtable_4lxml_5etree_TreeBuilder;
139224   __pyx_vtable_4lxml_5etree_TreeBuilder.__pyx_base = *__pyx_vtabptr_4lxml_5etree__SaxParserTarget;
139225   #if PY_MAJOR_VERSION >= 3
139226   __pyx_vtable_4lxml_5etree_TreeBuilder.__pyx_base._handleSaxStart = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *, PyObject *, PyObject *, PyObject *))__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart;
139227   __pyx_vtable_4lxml_5etree_TreeBuilder.__pyx_base._handleSaxEnd = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *, PyObject *))__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxEnd;
139228   __pyx_vtable_4lxml_5etree_TreeBuilder.__pyx_base._handleSaxData = (int (*)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *, PyObject *))__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxData;
139229   __pyx_vtable_4lxml_5etree_TreeBuilder.__pyx_base._handleSaxPi = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *, PyObject *, PyObject *))__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxPi;
139230   __pyx_vtable_4lxml_5etree_TreeBuilder.__pyx_base._handleSaxComment = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *, PyObject *))__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxComment;
139231   __pyx_vtable_4lxml_5etree_TreeBuilder._flush = (int (*)(struct __pyx_obj_4lxml_5etree_TreeBuilder *))__pyx_f_4lxml_5etree_11TreeBuilder__flush;
139232   #else
139233   *(void(**)(void))&__pyx_vtable_4lxml_5etree_TreeBuilder.__pyx_base._handleSaxStart = (void(*)(void))__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart;
139234   *(void(**)(void))&__pyx_vtable_4lxml_5etree_TreeBuilder.__pyx_base._handleSaxEnd = (void(*)(void))__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxEnd;
139235   *(void(**)(void))&__pyx_vtable_4lxml_5etree_TreeBuilder.__pyx_base._handleSaxData = (void(*)(void))__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxData;
139236   *(void(**)(void))&__pyx_vtable_4lxml_5etree_TreeBuilder.__pyx_base._handleSaxPi = (void(*)(void))__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxPi;
139237   *(void(**)(void))&__pyx_vtable_4lxml_5etree_TreeBuilder.__pyx_base._handleSaxComment = (void(*)(void))__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxComment;
139238   *(void(**)(void))&__pyx_vtable_4lxml_5etree_TreeBuilder._flush = (void(*)(void))__pyx_f_4lxml_5etree_11TreeBuilder__flush;
139239   #endif
139240   __pyx_type_4lxml_5etree_TreeBuilder.tp_base = __pyx_ptype_4lxml_5etree__SaxParserTarget;
139241   if (PyType_Ready(&__pyx_type_4lxml_5etree_TreeBuilder) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139242   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_TreeBuilder.tp_dict, __pyx_vtabptr_4lxml_5etree_TreeBuilder) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139243   if (__Pyx_SetAttrString(__pyx_m, "TreeBuilder", (PyObject *)&__pyx_type_4lxml_5etree_TreeBuilder) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139244   __pyx_ptype_4lxml_5etree_TreeBuilder = &__pyx_type_4lxml_5etree_TreeBuilder;
139245   __pyx_vtabptr_4lxml_5etree__PythonSaxParserTarget = &__pyx_vtable_4lxml_5etree__PythonSaxParserTarget;
139246   __pyx_vtable_4lxml_5etree__PythonSaxParserTarget.__pyx_base = *__pyx_vtabptr_4lxml_5etree__SaxParserTarget;
139247   #if PY_MAJOR_VERSION >= 3
139248   __pyx_vtable_4lxml_5etree__PythonSaxParserTarget.__pyx_base._handleSaxStart = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *, PyObject *, PyObject *, PyObject *))__pyx_f_4lxml_5etree_22_PythonSaxParserTarget__handleSaxStart;
139249   __pyx_vtable_4lxml_5etree__PythonSaxParserTarget.__pyx_base._handleSaxEnd = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *, PyObject *))__pyx_f_4lxml_5etree_22_PythonSaxParserTarget__handleSaxEnd;
139250   __pyx_vtable_4lxml_5etree__PythonSaxParserTarget.__pyx_base._handleSaxData = (int (*)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *, PyObject *))__pyx_f_4lxml_5etree_22_PythonSaxParserTarget__handleSaxData;
139251   __pyx_vtable_4lxml_5etree__PythonSaxParserTarget.__pyx_base._handleSaxDoctype = (int (*)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *, PyObject *, PyObject *, PyObject *))__pyx_f_4lxml_5etree_22_PythonSaxParserTarget__handleSaxDoctype;
139252   __pyx_vtable_4lxml_5etree__PythonSaxParserTarget.__pyx_base._handleSaxPi = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *, PyObject *, PyObject *))__pyx_f_4lxml_5etree_22_PythonSaxParserTarget__handleSaxPi;
139253   __pyx_vtable_4lxml_5etree__PythonSaxParserTarget.__pyx_base._handleSaxComment = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *, PyObject *))__pyx_f_4lxml_5etree_22_PythonSaxParserTarget__handleSaxComment;
139254   #else
139255   *(void(**)(void))&__pyx_vtable_4lxml_5etree__PythonSaxParserTarget.__pyx_base._handleSaxStart = (void(*)(void))__pyx_f_4lxml_5etree_22_PythonSaxParserTarget__handleSaxStart;
139256   *(void(**)(void))&__pyx_vtable_4lxml_5etree__PythonSaxParserTarget.__pyx_base._handleSaxEnd = (void(*)(void))__pyx_f_4lxml_5etree_22_PythonSaxParserTarget__handleSaxEnd;
139257   *(void(**)(void))&__pyx_vtable_4lxml_5etree__PythonSaxParserTarget.__pyx_base._handleSaxData = (void(*)(void))__pyx_f_4lxml_5etree_22_PythonSaxParserTarget__handleSaxData;
139258   *(void(**)(void))&__pyx_vtable_4lxml_5etree__PythonSaxParserTarget.__pyx_base._handleSaxDoctype = (void(*)(void))__pyx_f_4lxml_5etree_22_PythonSaxParserTarget__handleSaxDoctype;
139259   *(void(**)(void))&__pyx_vtable_4lxml_5etree__PythonSaxParserTarget.__pyx_base._handleSaxPi = (void(*)(void))__pyx_f_4lxml_5etree_22_PythonSaxParserTarget__handleSaxPi;
139260   *(void(**)(void))&__pyx_vtable_4lxml_5etree__PythonSaxParserTarget.__pyx_base._handleSaxComment = (void(*)(void))__pyx_f_4lxml_5etree_22_PythonSaxParserTarget__handleSaxComment;
139261   #endif
139262   __pyx_type_4lxml_5etree__PythonSaxParserTarget.tp_base = __pyx_ptype_4lxml_5etree__SaxParserTarget;
139263   if (PyType_Ready(&__pyx_type_4lxml_5etree__PythonSaxParserTarget) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139264   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__PythonSaxParserTarget.tp_dict, __pyx_vtabptr_4lxml_5etree__PythonSaxParserTarget) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139265   if (__Pyx_SetAttrString(__pyx_m, "_PythonSaxParserTarget", (PyObject *)&__pyx_type_4lxml_5etree__PythonSaxParserTarget) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139266   __pyx_ptype_4lxml_5etree__PythonSaxParserTarget = &__pyx_type_4lxml_5etree__PythonSaxParserTarget;
139267   __pyx_vtabptr_4lxml_5etree__FilelikeWriter = &__pyx_vtable_4lxml_5etree__FilelikeWriter;
139268   #if PY_MAJOR_VERSION >= 3
139269   __pyx_vtable_4lxml_5etree__FilelikeWriter._createOutputBuffer = (xmlOutputBuffer *(*)(struct __pyx_obj_4lxml_5etree__FilelikeWriter *, xmlCharEncodingHandler *))__pyx_f_4lxml_5etree_15_FilelikeWriter__createOutputBuffer;
139270   __pyx_vtable_4lxml_5etree__FilelikeWriter.write = (int (*)(struct __pyx_obj_4lxml_5etree__FilelikeWriter *, char *, int))__pyx_f_4lxml_5etree_15_FilelikeWriter_write;
139271   __pyx_vtable_4lxml_5etree__FilelikeWriter.close = (int (*)(struct __pyx_obj_4lxml_5etree__FilelikeWriter *))__pyx_f_4lxml_5etree_15_FilelikeWriter_close;
139272   #else
139273   *(void(**)(void))&__pyx_vtable_4lxml_5etree__FilelikeWriter._createOutputBuffer = (void(*)(void))__pyx_f_4lxml_5etree_15_FilelikeWriter__createOutputBuffer;
139274   *(void(**)(void))&__pyx_vtable_4lxml_5etree__FilelikeWriter.write = (void(*)(void))__pyx_f_4lxml_5etree_15_FilelikeWriter_write;
139275   *(void(**)(void))&__pyx_vtable_4lxml_5etree__FilelikeWriter.close = (void(*)(void))__pyx_f_4lxml_5etree_15_FilelikeWriter_close;
139276   #endif
139277   if (PyType_Ready(&__pyx_type_4lxml_5etree__FilelikeWriter) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139278   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__FilelikeWriter.tp_dict, __pyx_vtabptr_4lxml_5etree__FilelikeWriter) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139279   if (__Pyx_SetAttrString(__pyx_m, "_FilelikeWriter", (PyObject *)&__pyx_type_4lxml_5etree__FilelikeWriter) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139280   __pyx_ptype_4lxml_5etree__FilelikeWriter = &__pyx_type_4lxml_5etree__FilelikeWriter;
139281   __pyx_vtabptr_4lxml_5etree__IterparseContext = &__pyx_vtable_4lxml_5etree__IterparseContext;
139282   __pyx_vtable_4lxml_5etree__IterparseContext.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ParserContext;
139283   #if PY_MAJOR_VERSION >= 3
139284   __pyx_vtable_4lxml_5etree__IterparseContext.__pyx_base._initParserContext = (void (*)(struct __pyx_obj_4lxml_5etree__ParserContext *, xmlParserCtxt *))__pyx_f_4lxml_5etree_17_IterparseContext__initParserContext;
139285   __pyx_vtable_4lxml_5etree__IterparseContext._setEventFilter = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__IterparseContext *, PyObject *, PyObject *))__pyx_f_4lxml_5etree_17_IterparseContext__setEventFilter;
139286   __pyx_vtable_4lxml_5etree__IterparseContext.startNode = (int (*)(struct __pyx_obj_4lxml_5etree__IterparseContext *, xmlNode *))__pyx_f_4lxml_5etree_17_IterparseContext_startNode;
139287   __pyx_vtable_4lxml_5etree__IterparseContext.endNode = (int (*)(struct __pyx_obj_4lxml_5etree__IterparseContext *, xmlNode *))__pyx_f_4lxml_5etree_17_IterparseContext_endNode;
139288   __pyx_vtable_4lxml_5etree__IterparseContext.pushEvent = (int (*)(struct __pyx_obj_4lxml_5etree__IterparseContext *, PyObject *, xmlNode *))__pyx_f_4lxml_5etree_17_IterparseContext_pushEvent;
139289   __pyx_vtable_4lxml_5etree__IterparseContext._assureDocGetsFreed = (void (*)(struct __pyx_obj_4lxml_5etree__IterparseContext *))__pyx_f_4lxml_5etree_17_IterparseContext__assureDocGetsFreed;
139290   #else
139291   *(void(**)(void))&__pyx_vtable_4lxml_5etree__IterparseContext.__pyx_base._initParserContext = (void(*)(void))__pyx_f_4lxml_5etree_17_IterparseContext__initParserContext;
139292   *(void(**)(void))&__pyx_vtable_4lxml_5etree__IterparseContext._setEventFilter = (void(*)(void))__pyx_f_4lxml_5etree_17_IterparseContext__setEventFilter;
139293   *(void(**)(void))&__pyx_vtable_4lxml_5etree__IterparseContext.startNode = (void(*)(void))__pyx_f_4lxml_5etree_17_IterparseContext_startNode;
139294   *(void(**)(void))&__pyx_vtable_4lxml_5etree__IterparseContext.endNode = (void(*)(void))__pyx_f_4lxml_5etree_17_IterparseContext_endNode;
139295   *(void(**)(void))&__pyx_vtable_4lxml_5etree__IterparseContext.pushEvent = (void(*)(void))__pyx_f_4lxml_5etree_17_IterparseContext_pushEvent;
139296   *(void(**)(void))&__pyx_vtable_4lxml_5etree__IterparseContext._assureDocGetsFreed = (void(*)(void))__pyx_f_4lxml_5etree_17_IterparseContext__assureDocGetsFreed;
139297   #endif
139298   __pyx_type_4lxml_5etree__IterparseContext.tp_base = __pyx_ptype_4lxml_5etree__ParserContext;
139299   if (PyType_Ready(&__pyx_type_4lxml_5etree__IterparseContext) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139300   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__IterparseContext.tp_dict, __pyx_vtabptr_4lxml_5etree__IterparseContext) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139301   if (__Pyx_SetAttrString(__pyx_m, "_IterparseContext", (PyObject *)&__pyx_type_4lxml_5etree__IterparseContext) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139302   __pyx_ptype_4lxml_5etree__IterparseContext = &__pyx_type_4lxml_5etree__IterparseContext;
139303   __pyx_vtabptr_4lxml_5etree_iterparse = &__pyx_vtable_4lxml_5etree_iterparse;
139304   __pyx_vtable_4lxml_5etree_iterparse.__pyx_base = *__pyx_vtabptr_4lxml_5etree__BaseParser;
139305   #if PY_MAJOR_VERSION >= 3
139306   __pyx_vtable_4lxml_5etree_iterparse.__pyx_base._createContext = (struct __pyx_obj_4lxml_5etree__ParserContext *(*)(struct __pyx_obj_4lxml_5etree__BaseParser *, PyObject *))__pyx_f_4lxml_5etree_9iterparse__createContext;
139307   #else
139308   *(void(**)(void))&__pyx_vtable_4lxml_5etree_iterparse.__pyx_base._createContext = (void(*)(void))__pyx_f_4lxml_5etree_9iterparse__createContext;
139309   #endif
139310   __pyx_type_4lxml_5etree_iterparse.tp_base = __pyx_ptype_4lxml_5etree__BaseParser;
139311   if (PyType_Ready(&__pyx_type_4lxml_5etree_iterparse) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139312   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_iterparse.tp_dict, __pyx_vtabptr_4lxml_5etree_iterparse) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139313   if (__Pyx_SetAttrString(__pyx_m, "iterparse", (PyObject *)&__pyx_type_4lxml_5etree_iterparse) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139314   __pyx_ptype_4lxml_5etree_iterparse = &__pyx_type_4lxml_5etree_iterparse;
139315   __pyx_vtabptr_4lxml_5etree_iterwalk = &__pyx_vtable_4lxml_5etree_iterwalk;
139316   #if PY_MAJOR_VERSION >= 3
139317   __pyx_vtable_4lxml_5etree_iterwalk._setTagFilter = (void (*)(struct __pyx_obj_4lxml_5etree_iterwalk *, PyObject *))__pyx_f_4lxml_5etree_8iterwalk__setTagFilter;
139318   __pyx_vtable_4lxml_5etree_iterwalk._start_node = (int (*)(struct __pyx_obj_4lxml_5etree_iterwalk *, struct LxmlElement *))__pyx_f_4lxml_5etree_8iterwalk__start_node;
139319   __pyx_vtable_4lxml_5etree_iterwalk._end_node = (struct LxmlElement *(*)(struct __pyx_obj_4lxml_5etree_iterwalk *))__pyx_f_4lxml_5etree_8iterwalk__end_node;
139320   #else
139321   *(void(**)(void))&__pyx_vtable_4lxml_5etree_iterwalk._setTagFilter = (void(*)(void))__pyx_f_4lxml_5etree_8iterwalk__setTagFilter;
139322   *(void(**)(void))&__pyx_vtable_4lxml_5etree_iterwalk._start_node = (void(*)(void))__pyx_f_4lxml_5etree_8iterwalk__start_node;
139323   *(void(**)(void))&__pyx_vtable_4lxml_5etree_iterwalk._end_node = (void(*)(void))__pyx_f_4lxml_5etree_8iterwalk__end_node;
139324   #endif
139325   if (PyType_Ready(&__pyx_type_4lxml_5etree_iterwalk) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139326   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_iterwalk.tp_dict, __pyx_vtabptr_4lxml_5etree_iterwalk) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139327   if (__Pyx_SetAttrString(__pyx_m, "iterwalk", (PyObject *)&__pyx_type_4lxml_5etree_iterwalk) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139328   __pyx_ptype_4lxml_5etree_iterwalk = &__pyx_type_4lxml_5etree_iterwalk;
139329   __pyx_vtabptr_4lxml_5etree__IDDict = &__pyx_vtable_4lxml_5etree__IDDict;
139330   #if PY_MAJOR_VERSION >= 3
139331   __pyx_vtable_4lxml_5etree__IDDict._build_keys = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__IDDict *))__pyx_f_4lxml_5etree_7_IDDict__build_keys;
139332   __pyx_vtable_4lxml_5etree__IDDict._build_items = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__IDDict *))__pyx_f_4lxml_5etree_7_IDDict__build_items;
139333   #else
139334   *(void(**)(void))&__pyx_vtable_4lxml_5etree__IDDict._build_keys = (void(*)(void))__pyx_f_4lxml_5etree_7_IDDict__build_keys;
139335   *(void(**)(void))&__pyx_vtable_4lxml_5etree__IDDict._build_items = (void(*)(void))__pyx_f_4lxml_5etree_7_IDDict__build_items;
139336   #endif
139337   if (PyType_Ready(&__pyx_type_4lxml_5etree__IDDict) < 0) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139338   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__IDDict.tp_dict, __pyx_vtabptr_4lxml_5etree__IDDict) < 0) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139339   if (__Pyx_SetAttrString(__pyx_m, "_IDDict", (PyObject *)&__pyx_type_4lxml_5etree__IDDict) < 0) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139340   __pyx_ptype_4lxml_5etree__IDDict = &__pyx_type_4lxml_5etree__IDDict;
139341   if (PyType_Ready(&__pyx_type_4lxml_5etree_XInclude) < 0) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139342   if (__Pyx_SetAttrString(__pyx_m, "XInclude", (PyObject *)&__pyx_type_4lxml_5etree_XInclude) < 0) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139343   __pyx_ptype_4lxml_5etree_XInclude = &__pyx_type_4lxml_5etree_XInclude;
139344   __pyx_vtabptr_4lxml_5etree__ExsltRegExp = &__pyx_vtable_4lxml_5etree__ExsltRegExp;
139345   #if PY_MAJOR_VERSION >= 3
139346   __pyx_vtable_4lxml_5etree__ExsltRegExp._make_string = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__ExsltRegExp *, PyObject *))__pyx_f_4lxml_5etree_12_ExsltRegExp__make_string;
139347   __pyx_vtable_4lxml_5etree__ExsltRegExp._compile = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__ExsltRegExp *, PyObject *, PyObject *))__pyx_f_4lxml_5etree_12_ExsltRegExp__compile;
139348   __pyx_vtable_4lxml_5etree__ExsltRegExp._register_in_context = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__ExsltRegExp *, struct __pyx_obj_4lxml_5etree__BaseContext *))__pyx_f_4lxml_5etree_12_ExsltRegExp__register_in_context;
139349   #else
139350   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ExsltRegExp._make_string = (void(*)(void))__pyx_f_4lxml_5etree_12_ExsltRegExp__make_string;
139351   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ExsltRegExp._compile = (void(*)(void))__pyx_f_4lxml_5etree_12_ExsltRegExp__compile;
139352   *(void(**)(void))&__pyx_vtable_4lxml_5etree__ExsltRegExp._register_in_context = (void(*)(void))__pyx_f_4lxml_5etree_12_ExsltRegExp__register_in_context;
139353   #endif
139354   if (PyType_Ready(&__pyx_type_4lxml_5etree__ExsltRegExp) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139355   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ExsltRegExp.tp_dict, __pyx_vtabptr_4lxml_5etree__ExsltRegExp) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139356   if (__Pyx_SetAttrString(__pyx_m, "_ExsltRegExp", (PyObject *)&__pyx_type_4lxml_5etree__ExsltRegExp) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139357   __pyx_ptype_4lxml_5etree__ExsltRegExp = &__pyx_type_4lxml_5etree__ExsltRegExp;
139358   __pyx_vtabptr_4lxml_5etree__BaseContext = &__pyx_vtable_4lxml_5etree__BaseContext;
139359   #if PY_MAJOR_VERSION >= 3
139360   __pyx_vtable_4lxml_5etree__BaseContext._copy = (struct __pyx_obj_4lxml_5etree__BaseContext *(*)(struct __pyx_obj_4lxml_5etree__BaseContext *))__pyx_f_4lxml_5etree_12_BaseContext__copy;
139361   __pyx_vtable_4lxml_5etree__BaseContext._to_utf = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__BaseContext *, PyObject *))__pyx_f_4lxml_5etree_12_BaseContext__to_utf;
139362   __pyx_vtable_4lxml_5etree__BaseContext._set_xpath_context = (void (*)(struct __pyx_obj_4lxml_5etree__BaseContext *, xmlXPathContext *))__pyx_f_4lxml_5etree_12_BaseContext__set_xpath_context;
139363   __pyx_vtable_4lxml_5etree__BaseContext._register_context = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__BaseContext *, struct LxmlDocument *))__pyx_f_4lxml_5etree_12_BaseContext__register_context;
139364   __pyx_vtable_4lxml_5etree__BaseContext._cleanup_context = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__BaseContext *))__pyx_f_4lxml_5etree_12_BaseContext__cleanup_context;
139365   __pyx_vtable_4lxml_5etree__BaseContext._release_context = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__BaseContext *))__pyx_f_4lxml_5etree_12_BaseContext__release_context;
139366   __pyx_vtable_4lxml_5etree__BaseContext.addNamespace = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__BaseContext *, PyObject *, PyObject *))__pyx_f_4lxml_5etree_12_BaseContext_addNamespace;
139367   __pyx_vtable_4lxml_5etree__BaseContext.registerNamespace = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__BaseContext *, PyObject *, PyObject *))__pyx_f_4lxml_5etree_12_BaseContext_registerNamespace;
139368   __pyx_vtable_4lxml_5etree__BaseContext.registerLocalNamespaces = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__BaseContext *))__pyx_f_4lxml_5etree_12_BaseContext_registerLocalNamespaces;
139369   __pyx_vtable_4lxml_5etree__BaseContext.registerGlobalNamespaces = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__BaseContext *))__pyx_f_4lxml_5etree_12_BaseContext_registerGlobalNamespaces;
139370   __pyx_vtable_4lxml_5etree__BaseContext.unregisterGlobalNamespaces = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__BaseContext *))__pyx_f_4lxml_5etree_12_BaseContext_unregisterGlobalNamespaces;
139371   __pyx_vtable_4lxml_5etree__BaseContext._unregisterNamespace = (void (*)(struct __pyx_obj_4lxml_5etree__BaseContext *, PyObject *))__pyx_f_4lxml_5etree_12_BaseContext__unregisterNamespace;
139372   __pyx_vtable_4lxml_5etree__BaseContext._addLocalExtensionFunction = (void (*)(struct __pyx_obj_4lxml_5etree__BaseContext *, PyObject *, PyObject *, PyObject *))__pyx_f_4lxml_5etree_12_BaseContext__addLocalExtensionFunction;
139373   __pyx_vtable_4lxml_5etree__BaseContext.registerGlobalFunctions = (void (*)(struct __pyx_obj_4lxml_5etree__BaseContext *, void *, __pyx_t_4lxml_5etree__register_function))__pyx_f_4lxml_5etree_12_BaseContext_registerGlobalFunctions;
139374   __pyx_vtable_4lxml_5etree__BaseContext.registerLocalFunctions = (void (*)(struct __pyx_obj_4lxml_5etree__BaseContext *, void *, __pyx_t_4lxml_5etree__register_function))__pyx_f_4lxml_5etree_12_BaseContext_registerLocalFunctions;
139375   __pyx_vtable_4lxml_5etree__BaseContext.unregisterAllFunctions = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__BaseContext *, void *, __pyx_t_4lxml_5etree__register_function))__pyx_f_4lxml_5etree_12_BaseContext_unregisterAllFunctions;
139376   __pyx_vtable_4lxml_5etree__BaseContext.unregisterGlobalFunctions = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__BaseContext *, void *, __pyx_t_4lxml_5etree__register_function))__pyx_f_4lxml_5etree_12_BaseContext_unregisterGlobalFunctions;
139377   __pyx_vtable_4lxml_5etree__BaseContext._find_cached_function = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__BaseContext *, char *, char *))__pyx_f_4lxml_5etree_12_BaseContext__find_cached_function;
139378   __pyx_vtable_4lxml_5etree__BaseContext._release_temp_refs = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__BaseContext *))__pyx_f_4lxml_5etree_12_BaseContext__release_temp_refs;
139379   __pyx_vtable_4lxml_5etree__BaseContext._hold = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__BaseContext *, PyObject *))__pyx_f_4lxml_5etree_12_BaseContext__hold;
139380   #else
139381   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext._copy = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext__copy;
139382   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext._to_utf = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext__to_utf;
139383   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext._set_xpath_context = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext__set_xpath_context;
139384   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext._register_context = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext__register_context;
139385   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext._cleanup_context = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext__cleanup_context;
139386   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext._release_context = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext__release_context;
139387   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext.addNamespace = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext_addNamespace;
139388   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext.registerNamespace = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext_registerNamespace;
139389   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext.registerLocalNamespaces = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext_registerLocalNamespaces;
139390   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext.registerGlobalNamespaces = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext_registerGlobalNamespaces;
139391   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext.unregisterGlobalNamespaces = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext_unregisterGlobalNamespaces;
139392   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext._unregisterNamespace = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext__unregisterNamespace;
139393   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext._addLocalExtensionFunction = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext__addLocalExtensionFunction;
139394   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext.registerGlobalFunctions = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext_registerGlobalFunctions;
139395   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext.registerLocalFunctions = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext_registerLocalFunctions;
139396   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext.unregisterAllFunctions = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext_unregisterAllFunctions;
139397   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext.unregisterGlobalFunctions = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext_unregisterGlobalFunctions;
139398   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext._find_cached_function = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext__find_cached_function;
139399   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext._release_temp_refs = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext__release_temp_refs;
139400   *(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext._hold = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext__hold;
139401   #endif
139402   if (PyType_Ready(&__pyx_type_4lxml_5etree__BaseContext) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139403   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__BaseContext.tp_dict, __pyx_vtabptr_4lxml_5etree__BaseContext) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139404   if (__Pyx_SetAttrString(__pyx_m, "_BaseContext", (PyObject *)&__pyx_type_4lxml_5etree__BaseContext) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139405   __pyx_ptype_4lxml_5etree__BaseContext = &__pyx_type_4lxml_5etree__BaseContext;
139406   #if PY_MAJOR_VERSION >= 3
139407   __pyx_ptype_4lxml_6python_unicode = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "str", sizeof(PyUnicodeObject)); if (unlikely(!__pyx_ptype_4lxml_6python_unicode)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139408   #else
139409   __pyx_ptype_4lxml_6python_unicode = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "unicode", sizeof(PyUnicodeObject)); if (unlikely(!__pyx_ptype_4lxml_6python_unicode)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139410   #endif
139411   __pyx_type_4lxml_5etree__ElementUnicodeResult.tp_base = __pyx_ptype_4lxml_6python_unicode;
139412   if (PyType_Ready(&__pyx_type_4lxml_5etree__ElementUnicodeResult) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139413   if (__Pyx_SetAttrString(__pyx_m, "_ElementUnicodeResult", (PyObject *)&__pyx_type_4lxml_5etree__ElementUnicodeResult) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139414   __pyx_ptype_4lxml_5etree__ElementUnicodeResult = &__pyx_type_4lxml_5etree__ElementUnicodeResult;
139415   __pyx_vtabptr_4lxml_5etree__XPathContext = &__pyx_vtable_4lxml_5etree__XPathContext;
139416   __pyx_vtable_4lxml_5etree__XPathContext.__pyx_base = *__pyx_vtabptr_4lxml_5etree__BaseContext;
139417   #if PY_MAJOR_VERSION >= 3
139418   __pyx_vtable_4lxml_5etree__XPathContext.set_context = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__XPathContext *, xmlXPathContext *))__pyx_f_4lxml_5etree_13_XPathContext_set_context;
139419   __pyx_vtable_4lxml_5etree__XPathContext.register_context = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__XPathContext *, struct LxmlDocument *))__pyx_f_4lxml_5etree_13_XPathContext_register_context;
139420   __pyx_vtable_4lxml_5etree__XPathContext.unregister_context = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__XPathContext *))__pyx_f_4lxml_5etree_13_XPathContext_unregister_context;
139421   __pyx_vtable_4lxml_5etree__XPathContext.registerVariables = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__XPathContext *, PyObject *))__pyx_f_4lxml_5etree_13_XPathContext_registerVariables;
139422   __pyx_vtable_4lxml_5etree__XPathContext.registerVariable = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__XPathContext *, PyObject *, PyObject *))__pyx_f_4lxml_5etree_13_XPathContext_registerVariable;
139423   __pyx_vtable_4lxml_5etree__XPathContext._registerVariable = (void (*)(struct __pyx_obj_4lxml_5etree__XPathContext *, PyObject *, PyObject *))__pyx_f_4lxml_5etree_13_XPathContext__registerVariable;
139424   __pyx_vtable_4lxml_5etree__XPathContext._setupDict = (void (*)(struct __pyx_obj_4lxml_5etree__XPathContext *, xmlXPathContext *))__pyx_f_4lxml_5etree_13_XPathContext__setupDict;
139425   #else
139426   *(void(**)(void))&__pyx_vtable_4lxml_5etree__XPathContext.set_context = (void(*)(void))__pyx_f_4lxml_5etree_13_XPathContext_set_context;
139427   *(void(**)(void))&__pyx_vtable_4lxml_5etree__XPathContext.register_context = (void(*)(void))__pyx_f_4lxml_5etree_13_XPathContext_register_context;
139428   *(void(**)(void))&__pyx_vtable_4lxml_5etree__XPathContext.unregister_context = (void(*)(void))__pyx_f_4lxml_5etree_13_XPathContext_unregister_context;
139429   *(void(**)(void))&__pyx_vtable_4lxml_5etree__XPathContext.registerVariables = (void(*)(void))__pyx_f_4lxml_5etree_13_XPathContext_registerVariables;
139430   *(void(**)(void))&__pyx_vtable_4lxml_5etree__XPathContext.registerVariable = (void(*)(void))__pyx_f_4lxml_5etree_13_XPathContext_registerVariable;
139431   *(void(**)(void))&__pyx_vtable_4lxml_5etree__XPathContext._registerVariable = (void(*)(void))__pyx_f_4lxml_5etree_13_XPathContext__registerVariable;
139432   *(void(**)(void))&__pyx_vtable_4lxml_5etree__XPathContext._setupDict = (void(*)(void))__pyx_f_4lxml_5etree_13_XPathContext__setupDict;
139433   #endif
139434   __pyx_type_4lxml_5etree__XPathContext.tp_base = __pyx_ptype_4lxml_5etree__BaseContext;
139435   if (PyType_Ready(&__pyx_type_4lxml_5etree__XPathContext) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139436   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__XPathContext.tp_dict, __pyx_vtabptr_4lxml_5etree__XPathContext) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139437   if (__Pyx_SetAttrString(__pyx_m, "_XPathContext", (PyObject *)&__pyx_type_4lxml_5etree__XPathContext) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139438   __pyx_ptype_4lxml_5etree__XPathContext = &__pyx_type_4lxml_5etree__XPathContext;
139439   __pyx_vtabptr_4lxml_5etree__XPathEvaluatorBase = &__pyx_vtable_4lxml_5etree__XPathEvaluatorBase;
139440   #if PY_MAJOR_VERSION >= 3
139441   __pyx_vtable_4lxml_5etree__XPathEvaluatorBase.set_context = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *, xmlXPathContext *))__pyx_f_4lxml_5etree_19_XPathEvaluatorBase_set_context;
139442   __pyx_vtable_4lxml_5etree__XPathEvaluatorBase._checkAbsolutePath = (int (*)(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *, char *))__pyx_f_4lxml_5etree_19_XPathEvaluatorBase__checkAbsolutePath;
139443   __pyx_vtable_4lxml_5etree__XPathEvaluatorBase._lock = (int (*)(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *))__pyx_f_4lxml_5etree_19_XPathEvaluatorBase__lock;
139444   __pyx_vtable_4lxml_5etree__XPathEvaluatorBase._unlock = (void (*)(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *))__pyx_f_4lxml_5etree_19_XPathEvaluatorBase__unlock;
139445   __pyx_vtable_4lxml_5etree__XPathEvaluatorBase._raise_parse_error = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *))__pyx_f_4lxml_5etree_19_XPathEvaluatorBase__raise_parse_error;
139446   __pyx_vtable_4lxml_5etree__XPathEvaluatorBase._raise_eval_error = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *))__pyx_f_4lxml_5etree_19_XPathEvaluatorBase__raise_eval_error;
139447   __pyx_vtable_4lxml_5etree__XPathEvaluatorBase._handle_result = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *, xmlXPathObject *, struct LxmlDocument *))__pyx_f_4lxml_5etree_19_XPathEvaluatorBase__handle_result;
139448   #else
139449   *(void(**)(void))&__pyx_vtable_4lxml_5etree__XPathEvaluatorBase.set_context = (void(*)(void))__pyx_f_4lxml_5etree_19_XPathEvaluatorBase_set_context;
139450   *(void(**)(void))&__pyx_vtable_4lxml_5etree__XPathEvaluatorBase._checkAbsolutePath = (void(*)(void))__pyx_f_4lxml_5etree_19_XPathEvaluatorBase__checkAbsolutePath;
139451   *(void(**)(void))&__pyx_vtable_4lxml_5etree__XPathEvaluatorBase._lock = (void(*)(void))__pyx_f_4lxml_5etree_19_XPathEvaluatorBase__lock;
139452   *(void(**)(void))&__pyx_vtable_4lxml_5etree__XPathEvaluatorBase._unlock = (void(*)(void))__pyx_f_4lxml_5etree_19_XPathEvaluatorBase__unlock;
139453   *(void(**)(void))&__pyx_vtable_4lxml_5etree__XPathEvaluatorBase._raise_parse_error = (void(*)(void))__pyx_f_4lxml_5etree_19_XPathEvaluatorBase__raise_parse_error;
139454   *(void(**)(void))&__pyx_vtable_4lxml_5etree__XPathEvaluatorBase._raise_eval_error = (void(*)(void))__pyx_f_4lxml_5etree_19_XPathEvaluatorBase__raise_eval_error;
139455   *(void(**)(void))&__pyx_vtable_4lxml_5etree__XPathEvaluatorBase._handle_result = (void(*)(void))__pyx_f_4lxml_5etree_19_XPathEvaluatorBase__handle_result;
139456   #endif
139457   if (PyType_Ready(&__pyx_type_4lxml_5etree__XPathEvaluatorBase) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139458   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__XPathEvaluatorBase.tp_dict, __pyx_vtabptr_4lxml_5etree__XPathEvaluatorBase) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139459   if (__Pyx_SetAttrString(__pyx_m, "_XPathEvaluatorBase", (PyObject *)&__pyx_type_4lxml_5etree__XPathEvaluatorBase) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139460   __pyx_ptype_4lxml_5etree__XPathEvaluatorBase = &__pyx_type_4lxml_5etree__XPathEvaluatorBase;
139461   __pyx_vtabptr_4lxml_5etree_XPathElementEvaluator = &__pyx_vtable_4lxml_5etree_XPathElementEvaluator;
139462   __pyx_vtable_4lxml_5etree_XPathElementEvaluator.__pyx_base = *__pyx_vtabptr_4lxml_5etree__XPathEvaluatorBase;
139463   __pyx_type_4lxml_5etree_XPathElementEvaluator.tp_base = __pyx_ptype_4lxml_5etree__XPathEvaluatorBase;
139464   if (PyType_Ready(&__pyx_type_4lxml_5etree_XPathElementEvaluator) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139465   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_XPathElementEvaluator.tp_dict, __pyx_vtabptr_4lxml_5etree_XPathElementEvaluator) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139466   if (__Pyx_SetAttrString(__pyx_m, "XPathElementEvaluator", (PyObject *)&__pyx_type_4lxml_5etree_XPathElementEvaluator) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139467   __pyx_ptype_4lxml_5etree_XPathElementEvaluator = &__pyx_type_4lxml_5etree_XPathElementEvaluator;
139468   __pyx_vtabptr_4lxml_5etree_XPathDocumentEvaluator = &__pyx_vtable_4lxml_5etree_XPathDocumentEvaluator;
139469   __pyx_vtable_4lxml_5etree_XPathDocumentEvaluator.__pyx_base = *__pyx_vtabptr_4lxml_5etree_XPathElementEvaluator;
139470   __pyx_type_4lxml_5etree_XPathDocumentEvaluator.tp_base = __pyx_ptype_4lxml_5etree_XPathElementEvaluator;
139471   if (PyType_Ready(&__pyx_type_4lxml_5etree_XPathDocumentEvaluator) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139472   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_XPathDocumentEvaluator.tp_dict, __pyx_vtabptr_4lxml_5etree_XPathDocumentEvaluator) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139473   if (__Pyx_SetAttrString(__pyx_m, "XPathDocumentEvaluator", (PyObject *)&__pyx_type_4lxml_5etree_XPathDocumentEvaluator) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139474   __pyx_ptype_4lxml_5etree_XPathDocumentEvaluator = &__pyx_type_4lxml_5etree_XPathDocumentEvaluator;
139475   __pyx_vtabptr_4lxml_5etree_XPath = &__pyx_vtable_4lxml_5etree_XPath;
139476   __pyx_vtable_4lxml_5etree_XPath.__pyx_base = *__pyx_vtabptr_4lxml_5etree__XPathEvaluatorBase;
139477   __pyx_type_4lxml_5etree_XPath.tp_base = __pyx_ptype_4lxml_5etree__XPathEvaluatorBase;
139478   if (PyType_Ready(&__pyx_type_4lxml_5etree_XPath) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139479   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_XPath.tp_dict, __pyx_vtabptr_4lxml_5etree_XPath) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139480   if (__Pyx_SetAttrString(__pyx_m, "XPath", (PyObject *)&__pyx_type_4lxml_5etree_XPath) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139481   __pyx_ptype_4lxml_5etree_XPath = &__pyx_type_4lxml_5etree_XPath;
139482   __pyx_vtabptr_4lxml_5etree_ETXPath = &__pyx_vtable_4lxml_5etree_ETXPath;
139483   __pyx_vtable_4lxml_5etree_ETXPath.__pyx_base = *__pyx_vtabptr_4lxml_5etree_XPath;
139484   #if PY_MAJOR_VERSION >= 3
139485   __pyx_vtable_4lxml_5etree_ETXPath._nsextract_path = (PyObject *(*)(struct __pyx_obj_4lxml_5etree_ETXPath *, PyObject *))__pyx_f_4lxml_5etree_7ETXPath__nsextract_path;
139486   #else
139487   *(void(**)(void))&__pyx_vtable_4lxml_5etree_ETXPath._nsextract_path = (void(*)(void))__pyx_f_4lxml_5etree_7ETXPath__nsextract_path;
139488   #endif
139489   __pyx_type_4lxml_5etree_ETXPath.tp_base = __pyx_ptype_4lxml_5etree_XPath;
139490   if (PyType_Ready(&__pyx_type_4lxml_5etree_ETXPath) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139491   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_ETXPath.tp_dict, __pyx_vtabptr_4lxml_5etree_ETXPath) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139492   if (__Pyx_SetAttrString(__pyx_m, "ETXPath", (PyObject *)&__pyx_type_4lxml_5etree_ETXPath) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139493   __pyx_ptype_4lxml_5etree_ETXPath = &__pyx_type_4lxml_5etree_ETXPath;
139494   __pyx_vtabptr_4lxml_5etree__XSLTResolverContext = &__pyx_vtable_4lxml_5etree__XSLTResolverContext;
139495   __pyx_vtable_4lxml_5etree__XSLTResolverContext.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ResolverContext;
139496   #if PY_MAJOR_VERSION >= 3
139497   __pyx_vtable_4lxml_5etree__XSLTResolverContext._copy = (struct __pyx_obj_4lxml_5etree__XSLTResolverContext *(*)(struct __pyx_obj_4lxml_5etree__XSLTResolverContext *))__pyx_f_4lxml_5etree_20_XSLTResolverContext__copy;
139498   #else
139499   *(void(**)(void))&__pyx_vtable_4lxml_5etree__XSLTResolverContext._copy = (void(*)(void))__pyx_f_4lxml_5etree_20_XSLTResolverContext__copy;
139500   #endif
139501   __pyx_type_4lxml_5etree__XSLTResolverContext.tp_base = __pyx_ptype_4lxml_5etree__ResolverContext;
139502   if (PyType_Ready(&__pyx_type_4lxml_5etree__XSLTResolverContext) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139503   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__XSLTResolverContext.tp_dict, __pyx_vtabptr_4lxml_5etree__XSLTResolverContext) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139504   if (__Pyx_SetAttrString(__pyx_m, "_XSLTResolverContext", (PyObject *)&__pyx_type_4lxml_5etree__XSLTResolverContext) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139505   __pyx_ptype_4lxml_5etree__XSLTResolverContext = &__pyx_type_4lxml_5etree__XSLTResolverContext;
139506   __pyx_vtabptr_4lxml_5etree_XSLTAccessControl = &__pyx_vtable_4lxml_5etree_XSLTAccessControl;
139507   #if PY_MAJOR_VERSION >= 3
139508   __pyx_vtable_4lxml_5etree_XSLTAccessControl._setAccess = (PyObject *(*)(struct __pyx_obj_4lxml_5etree_XSLTAccessControl *, xsltSecurityOption, PyObject *))__pyx_f_4lxml_5etree_17XSLTAccessControl__setAccess;
139509   __pyx_vtable_4lxml_5etree_XSLTAccessControl._register_in_context = (void (*)(struct __pyx_obj_4lxml_5etree_XSLTAccessControl *, xsltTransformContext *))__pyx_f_4lxml_5etree_17XSLTAccessControl__register_in_context;
139510   __pyx_vtable_4lxml_5etree_XSLTAccessControl._optval = (PyObject *(*)(struct __pyx_obj_4lxml_5etree_XSLTAccessControl *, xsltSecurityOption))__pyx_f_4lxml_5etree_17XSLTAccessControl__optval;
139511   #else
139512   *(void(**)(void))&__pyx_vtable_4lxml_5etree_XSLTAccessControl._setAccess = (void(*)(void))__pyx_f_4lxml_5etree_17XSLTAccessControl__setAccess;
139513   *(void(**)(void))&__pyx_vtable_4lxml_5etree_XSLTAccessControl._register_in_context = (void(*)(void))__pyx_f_4lxml_5etree_17XSLTAccessControl__register_in_context;
139514   *(void(**)(void))&__pyx_vtable_4lxml_5etree_XSLTAccessControl._optval = (void(*)(void))__pyx_f_4lxml_5etree_17XSLTAccessControl__optval;
139515   #endif
139516   if (PyType_Ready(&__pyx_type_4lxml_5etree_XSLTAccessControl) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139517   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_XSLTAccessControl.tp_dict, __pyx_vtabptr_4lxml_5etree_XSLTAccessControl) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139518   if (__Pyx_SetAttrString(__pyx_m, "XSLTAccessControl", (PyObject *)&__pyx_type_4lxml_5etree_XSLTAccessControl) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139519   __pyx_ptype_4lxml_5etree_XSLTAccessControl = &__pyx_type_4lxml_5etree_XSLTAccessControl;
139520   __pyx_vtabptr_4lxml_5etree__XSLTContext = &__pyx_vtable_4lxml_5etree__XSLTContext;
139521   __pyx_vtable_4lxml_5etree__XSLTContext.__pyx_base = *__pyx_vtabptr_4lxml_5etree__BaseContext;
139522   #if PY_MAJOR_VERSION >= 3
139523   __pyx_vtable_4lxml_5etree__XSLTContext.__pyx_base._copy = (struct __pyx_obj_4lxml_5etree__BaseContext *(*)(struct __pyx_obj_4lxml_5etree__BaseContext *))__pyx_f_4lxml_5etree_12_XSLTContext__copy;
139524   __pyx_vtable_4lxml_5etree__XSLTContext.register_context = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__XSLTContext *, xsltTransformContext *, struct LxmlDocument *))__pyx_f_4lxml_5etree_12_XSLTContext_register_context;
139525   __pyx_vtable_4lxml_5etree__XSLTContext.free_context = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__XSLTContext *))__pyx_f_4lxml_5etree_12_XSLTContext_free_context;
139526   #else
139527   *(void(**)(void))&__pyx_vtable_4lxml_5etree__XSLTContext.__pyx_base._copy = (void(*)(void))__pyx_f_4lxml_5etree_12_XSLTContext__copy;
139528   *(void(**)(void))&__pyx_vtable_4lxml_5etree__XSLTContext.register_context = (void(*)(void))__pyx_f_4lxml_5etree_12_XSLTContext_register_context;
139529   *(void(**)(void))&__pyx_vtable_4lxml_5etree__XSLTContext.free_context = (void(*)(void))__pyx_f_4lxml_5etree_12_XSLTContext_free_context;
139530   #endif
139531   __pyx_type_4lxml_5etree__XSLTContext.tp_base = __pyx_ptype_4lxml_5etree__BaseContext;
139532   if (PyType_Ready(&__pyx_type_4lxml_5etree__XSLTContext) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139533   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__XSLTContext.tp_dict, __pyx_vtabptr_4lxml_5etree__XSLTContext) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139534   if (__Pyx_SetAttrString(__pyx_m, "_XSLTContext", (PyObject *)&__pyx_type_4lxml_5etree__XSLTContext) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139535   __pyx_ptype_4lxml_5etree__XSLTContext = &__pyx_type_4lxml_5etree__XSLTContext;
139536   if (PyType_Ready(&__pyx_type_4lxml_5etree__XSLTQuotedStringParam) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139537   if (__Pyx_SetAttrString(__pyx_m, "_XSLTQuotedStringParam", (PyObject *)&__pyx_type_4lxml_5etree__XSLTQuotedStringParam) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139538   __pyx_ptype_4lxml_5etree__XSLTQuotedStringParam = &__pyx_type_4lxml_5etree__XSLTQuotedStringParam;
139539   __pyx_vtabptr_4lxml_5etree_XSLT = &__pyx_vtable_4lxml_5etree_XSLT;
139540   #if PY_MAJOR_VERSION >= 3
139541   __pyx_vtable_4lxml_5etree_XSLT._run_transform = (xmlDoc *(*)(struct __pyx_obj_4lxml_5etree_XSLT *, xmlDoc *, PyObject *, struct __pyx_obj_4lxml_5etree__XSLTContext *, xsltTransformContext *))__pyx_f_4lxml_5etree_4XSLT__run_transform;
139542   #else
139543   *(void(**)(void))&__pyx_vtable_4lxml_5etree_XSLT._run_transform = (void(*)(void))__pyx_f_4lxml_5etree_4XSLT__run_transform;
139544   #endif
139545   if (PyType_Ready(&__pyx_type_4lxml_5etree_XSLT) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139546   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_XSLT.tp_dict, __pyx_vtabptr_4lxml_5etree_XSLT) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139547   if (__Pyx_SetAttrString(__pyx_m, "XSLT", (PyObject *)&__pyx_type_4lxml_5etree_XSLT) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139548   __pyx_ptype_4lxml_5etree_XSLT = &__pyx_type_4lxml_5etree_XSLT;
139549   __pyx_vtabptr_4lxml_5etree__XSLTResultTree = &__pyx_vtable_4lxml_5etree__XSLTResultTree;
139550   __pyx_vtable_4lxml_5etree__XSLTResultTree.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ElementTree;
139551   #if PY_MAJOR_VERSION >= 3
139552   __pyx_vtable_4lxml_5etree__XSLTResultTree._saveToStringAndSize = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__XSLTResultTree *, char **, int *))__pyx_f_4lxml_5etree_15_XSLTResultTree__saveToStringAndSize;
139553   #else
139554   *(void(**)(void))&__pyx_vtable_4lxml_5etree__XSLTResultTree._saveToStringAndSize = (void(*)(void))__pyx_f_4lxml_5etree_15_XSLTResultTree__saveToStringAndSize;
139555   #endif
139556   __pyx_type_4lxml_5etree__XSLTResultTree.tp_base = __pyx_ptype_4lxml_5etree__ElementTree;
139557   if (PyType_Ready(&__pyx_type_4lxml_5etree__XSLTResultTree) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139558   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__XSLTResultTree.tp_dict, __pyx_vtabptr_4lxml_5etree__XSLTResultTree) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139559   if (__Pyx_SetAttrString(__pyx_m, "_XSLTResultTree", (PyObject *)&__pyx_type_4lxml_5etree__XSLTResultTree) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139560   __pyx_ptype_4lxml_5etree__XSLTResultTree = &__pyx_type_4lxml_5etree__XSLTResultTree;
139561   __pyx_vtabptr_4lxml_5etree__XSLTProcessingInstruction = &__pyx_vtable_4lxml_5etree__XSLTProcessingInstruction;
139562   __pyx_vtable_4lxml_5etree__XSLTProcessingInstruction.__pyx_base = *__pyx_vtabptr_4lxml_5etree_PIBase;
139563   __pyx_type_4lxml_5etree__XSLTProcessingInstruction.tp_base = __pyx_ptype_4lxml_5etree_PIBase;
139564   if (PyType_Ready(&__pyx_type_4lxml_5etree__XSLTProcessingInstruction) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139565   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__XSLTProcessingInstruction.tp_dict, __pyx_vtabptr_4lxml_5etree__XSLTProcessingInstruction) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139566   if (__Pyx_SetAttrString(__pyx_m, "_XSLTProcessingInstruction", (PyObject *)&__pyx_type_4lxml_5etree__XSLTProcessingInstruction) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139567   __pyx_ptype_4lxml_5etree__XSLTProcessingInstruction = &__pyx_type_4lxml_5etree__XSLTProcessingInstruction;
139568   if (PyType_Ready(&__pyx_type_4lxml_5etree_XSLTExtension) < 0) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139569   if (__Pyx_SetAttrString(__pyx_m, "XSLTExtension", (PyObject *)&__pyx_type_4lxml_5etree_XSLTExtension) < 0) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139570   __pyx_ptype_4lxml_5etree_XSLTExtension = &__pyx_type_4lxml_5etree_XSLTExtension;
139571   __pyx_type_4lxml_5etree_DTD.tp_base = __pyx_ptype_4lxml_5etree__Validator;
139572   if (PyType_Ready(&__pyx_type_4lxml_5etree_DTD) < 0) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139573   if (__Pyx_SetAttrString(__pyx_m, "DTD", (PyObject *)&__pyx_type_4lxml_5etree_DTD) < 0) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139574   __pyx_ptype_4lxml_5etree_DTD = &__pyx_type_4lxml_5etree_DTD;
139575   __pyx_type_4lxml_5etree_RelaxNG.tp_base = __pyx_ptype_4lxml_5etree__Validator;
139576   if (PyType_Ready(&__pyx_type_4lxml_5etree_RelaxNG) < 0) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139577   if (__Pyx_SetAttrString(__pyx_m, "RelaxNG", (PyObject *)&__pyx_type_4lxml_5etree_RelaxNG) < 0) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139578   __pyx_ptype_4lxml_5etree_RelaxNG = &__pyx_type_4lxml_5etree_RelaxNG;
139579   __pyx_type_4lxml_5etree_Schematron.tp_base = __pyx_ptype_4lxml_5etree__Validator;
139580   if (PyType_Ready(&__pyx_type_4lxml_5etree_Schematron) < 0) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139581   if (__Pyx_SetAttrString(__pyx_m, "Schematron", (PyObject *)&__pyx_type_4lxml_5etree_Schematron) < 0) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139582   __pyx_ptype_4lxml_5etree_Schematron = &__pyx_type_4lxml_5etree_Schematron;
139583   /*--- Type import code ---*/
139584   __pyx_ptype_4lxml_6python_slice = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "slice", sizeof(PySliceObject)); if (unlikely(!__pyx_ptype_4lxml_6python_slice)) {__pyx_filename = __pyx_f[25]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139585   /*--- Function import code ---*/
139586   /*--- Execution code ---*/
139587
139588   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":5
139589  * """
139590  * 
139591  * __docformat__ = u"restructuredtext en"             # <<<<<<<<<<<<<<
139592  * 
139593  * cimport tree, python, config
139594  */
139595   if (PyObject_SetAttr(__pyx_m, __pyx_kp___docformat__, ((PyObject *)__pyx_kp_37)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139596
139597   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":14
139598  * cimport cstd
139599  * 
139600  * try:             # <<<<<<<<<<<<<<
139601  *     import __builtin__
139602  * except ImportError:
139603  */
139604   {
139605     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
139606     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
139607     __Pyx_XGOTREF(__pyx_save_exc_type);
139608     __Pyx_XGOTREF(__pyx_save_exc_value);
139609     __Pyx_XGOTREF(__pyx_save_exc_tb);
139610     /*try:*/ {
139611
139612       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":15
139613  * 
139614  * try:
139615  *     import __builtin__             # <<<<<<<<<<<<<<
139616  * except ImportError:
139617  *     # Python 3
139618  */
139619       __pyx_1 = __Pyx_Import(__pyx_kp___builtin__, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
139620       __Pyx_GOTREF(__pyx_1);
139621       if (PyObject_SetAttr(__pyx_m, __pyx_kp___builtin__, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L2_error;}
139622       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
139623     }
139624     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
139625     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
139626     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
139627     goto __pyx_L9_try_end;
139628     __pyx_L2_error:;
139629     __Pyx_XDECREF(__pyx_1); __pyx_1 = 0;
139630
139631     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":16
139632  * try:
139633  *     import __builtin__
139634  * except ImportError:             # <<<<<<<<<<<<<<
139635  *     # Python 3
139636  *     import builtins as __builtin__
139637  */
139638     __pyx_2 = PyErr_ExceptionMatches(__pyx_builtin_ImportError);
139639     if (__pyx_2) {
139640       __Pyx_AddTraceback("lxml.etree");
139641       if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
139642       __Pyx_GOTREF(__pyx_t_1);
139643       __Pyx_GOTREF(__pyx_t_2);
139644       __Pyx_GOTREF(__pyx_t_3);
139645
139646       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":18
139647  * except ImportError:
139648  *     # Python 3
139649  *     import builtins as __builtin__             # <<<<<<<<<<<<<<
139650  * 
139651  * cdef object _unicode
139652  */
139653       __pyx_1 = __Pyx_Import(__pyx_kp_builtins, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
139654       __Pyx_GOTREF(__pyx_1);
139655       if (PyObject_SetAttr(__pyx_m, __pyx_kp___builtin__, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L4_except_error;}
139656       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
139657       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
139658       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
139659       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
139660       goto __pyx_L3_exception_handled;
139661     }
139662     __pyx_L4_except_error:;
139663     __Pyx_XDECREF(__pyx_save_exc_type);
139664     __Pyx_XDECREF(__pyx_save_exc_value);
139665     __Pyx_XDECREF(__pyx_save_exc_tb);
139666     goto __pyx_L1_error;
139667     __pyx_L3_exception_handled:;
139668     __Pyx_XGIVEREF(__pyx_save_exc_type);
139669     __Pyx_XGIVEREF(__pyx_save_exc_value);
139670     __Pyx_XGIVEREF(__pyx_save_exc_tb);
139671     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
139672     __pyx_L9_try_end:;
139673   }
139674
139675   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":21
139676  * 
139677  * cdef object _unicode
139678  * try:             # <<<<<<<<<<<<<<
139679  *     _unicode = __builtin__.unicode
139680  * except AttributeError:
139681  */
139682   {
139683     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
139684     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
139685     __Pyx_XGOTREF(__pyx_save_exc_type);
139686     __Pyx_XGOTREF(__pyx_save_exc_value);
139687     __Pyx_XGOTREF(__pyx_save_exc_tb);
139688     /*try:*/ {
139689
139690       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":22
139691  * cdef object _unicode
139692  * try:
139693  *     _unicode = __builtin__.unicode             # <<<<<<<<<<<<<<
139694  * except AttributeError:
139695  *     # Python 3
139696  */
139697       __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp___builtin__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
139698       __Pyx_GOTREF(__pyx_1);
139699       __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_unicode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L12_error;}
139700       __Pyx_GOTREF(__pyx_t_3);
139701       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
139702       __Pyx_GOTREF(__pyx_v_4lxml_5etree__unicode);
139703       __Pyx_DECREF(__pyx_v_4lxml_5etree__unicode);
139704       __Pyx_GIVEREF(__pyx_t_3);
139705       __pyx_v_4lxml_5etree__unicode = __pyx_t_3;
139706       __pyx_t_3 = 0;
139707     }
139708     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
139709     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
139710     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
139711     goto __pyx_L19_try_end;
139712     __pyx_L12_error:;
139713     __Pyx_XDECREF(__pyx_1); __pyx_1 = 0;
139714     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
139715     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
139716     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
139717
139718     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":23
139719  * try:
139720  *     _unicode = __builtin__.unicode
139721  * except AttributeError:             # <<<<<<<<<<<<<<
139722  *     # Python 3
139723  *     _unicode = __builtin__.str
139724  */
139725     __pyx_2 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
139726     if (__pyx_2) {
139727       __Pyx_AddTraceback("lxml.etree");
139728       if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;}
139729       __Pyx_GOTREF(__pyx_t_3);
139730       __Pyx_GOTREF(__pyx_t_2);
139731       __Pyx_GOTREF(__pyx_t_1);
139732
139733       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":25
139734  * except AttributeError:
139735  *     # Python 3
139736  *     _unicode = __builtin__.str             # <<<<<<<<<<<<<<
139737  * 
139738  * del __builtin__
139739  */
139740       __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp___builtin__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;}
139741       __Pyx_GOTREF(__pyx_1);
139742       __pyx_t_4 = PyObject_GetAttr(__pyx_1, __pyx_kp_str); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L14_except_error;}
139743       __Pyx_GOTREF(__pyx_t_4);
139744       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
139745       __Pyx_GOTREF(__pyx_v_4lxml_5etree__unicode);
139746       __Pyx_DECREF(__pyx_v_4lxml_5etree__unicode);
139747       __Pyx_GIVEREF(__pyx_t_4);
139748       __pyx_v_4lxml_5etree__unicode = __pyx_t_4;
139749       __pyx_t_4 = 0;
139750       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
139751       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
139752       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
139753       goto __pyx_L13_exception_handled;
139754     }
139755     __pyx_L14_except_error:;
139756     __Pyx_XDECREF(__pyx_save_exc_type);
139757     __Pyx_XDECREF(__pyx_save_exc_value);
139758     __Pyx_XDECREF(__pyx_save_exc_tb);
139759     goto __pyx_L1_error;
139760     __pyx_L13_exception_handled:;
139761     __Pyx_XGIVEREF(__pyx_save_exc_type);
139762     __Pyx_XGIVEREF(__pyx_save_exc_value);
139763     __Pyx_XGIVEREF(__pyx_save_exc_tb);
139764     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
139765     __pyx_L19_try_end:;
139766   }
139767
139768   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":27
139769  *     _unicode = __builtin__.str
139770  * 
139771  * del __builtin__             # <<<<<<<<<<<<<<
139772  * 
139773  * cdef object os_path_abspath
139774  */
139775   if (__Pyx_DelAttrString(__pyx_m, "__builtin__") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139776
139777   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":30
139778  * 
139779  * cdef object os_path_abspath
139780  * from os.path import abspath as os_path_abspath             # <<<<<<<<<<<<<<
139781  * 
139782  * cdef object BytesIO, StringIO
139783  */
139784   __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139785   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
139786   __Pyx_INCREF(__pyx_kp_abspath);
139787   PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_abspath);
139788   __Pyx_GIVEREF(__pyx_kp_abspath);
139789   __pyx_1 = __Pyx_Import(__pyx_kp_38, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139790   __Pyx_GOTREF(__pyx_1);
139791   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
139792   __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_abspath); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139793   __Pyx_GOTREF(__pyx_3);
139794   __Pyx_GOTREF(__pyx_v_4lxml_5etree_os_path_abspath);
139795   __Pyx_DECREF(__pyx_v_4lxml_5etree_os_path_abspath);
139796   __Pyx_GIVEREF(__pyx_3);
139797   __pyx_v_4lxml_5etree_os_path_abspath = __pyx_3;
139798   __pyx_3 = 0;
139799   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
139800
139801   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":33
139802  * 
139803  * cdef object BytesIO, StringIO
139804  * try:             # <<<<<<<<<<<<<<
139805  *     from io import BytesIO, StringIO
139806  * except (ImportError, AttributeError):
139807  */
139808   {
139809     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
139810     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
139811     __Pyx_XGOTREF(__pyx_save_exc_type);
139812     __Pyx_XGOTREF(__pyx_save_exc_value);
139813     __Pyx_XGOTREF(__pyx_save_exc_tb);
139814     /*try:*/ {
139815
139816       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":34
139817  * cdef object BytesIO, StringIO
139818  * try:
139819  *     from io import BytesIO, StringIO             # <<<<<<<<<<<<<<
139820  * except (ImportError, AttributeError):
139821  *     from StringIO import StringIO, StringIO as BytesIO
139822  */
139823       __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L22_error;}
139824       __Pyx_GOTREF(((PyObject *)__pyx_t_1));
139825       __Pyx_INCREF(__pyx_kp_BytesIO);
139826       PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_BytesIO);
139827       __Pyx_GIVEREF(__pyx_kp_BytesIO);
139828       __Pyx_INCREF(__pyx_kp_StringIO);
139829       PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_StringIO);
139830       __Pyx_GIVEREF(__pyx_kp_StringIO);
139831       __pyx_1 = __Pyx_Import(__pyx_kp_io, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L22_error;}
139832       __Pyx_GOTREF(__pyx_1);
139833       __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
139834       __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_BytesIO); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L22_error;}
139835       __Pyx_GOTREF(__pyx_3);
139836       __Pyx_GOTREF(__pyx_v_4lxml_5etree_BytesIO);
139837       __Pyx_DECREF(__pyx_v_4lxml_5etree_BytesIO);
139838       __Pyx_GIVEREF(__pyx_3);
139839       __pyx_v_4lxml_5etree_BytesIO = __pyx_3;
139840       __pyx_3 = 0;
139841       __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_StringIO); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L22_error;}
139842       __Pyx_GOTREF(__pyx_3);
139843       __Pyx_GOTREF(__pyx_v_4lxml_5etree_StringIO);
139844       __Pyx_DECREF(__pyx_v_4lxml_5etree_StringIO);
139845       __Pyx_GIVEREF(__pyx_3);
139846       __pyx_v_4lxml_5etree_StringIO = __pyx_3;
139847       __pyx_3 = 0;
139848       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
139849     }
139850     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
139851     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
139852     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
139853     goto __pyx_L29_try_end;
139854     __pyx_L22_error:;
139855     __Pyx_XDECREF(__pyx_1); __pyx_1 = 0;
139856     __Pyx_XDECREF(__pyx_3); __pyx_3 = 0;
139857     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
139858     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
139859     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
139860     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
139861
139862     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":35
139863  * try:
139864  *     from io import BytesIO, StringIO
139865  * except (ImportError, AttributeError):             # <<<<<<<<<<<<<<
139866  *     from StringIO import StringIO, StringIO as BytesIO
139867  * 
139868  */
139869     __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;}
139870     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
139871     __Pyx_INCREF(__pyx_builtin_ImportError);
139872     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_ImportError);
139873     __Pyx_GIVEREF(__pyx_builtin_ImportError);
139874     __Pyx_INCREF(__pyx_builtin_AttributeError);
139875     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_builtin_AttributeError);
139876     __Pyx_GIVEREF(__pyx_builtin_AttributeError);
139877     __pyx_2 = PyErr_ExceptionMatches(((PyObject *)__pyx_t_1));
139878     __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
139879     if (__pyx_2) {
139880       __Pyx_AddTraceback("lxml.etree");
139881       if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;}
139882       __Pyx_GOTREF(__pyx_t_1);
139883       __Pyx_GOTREF(__pyx_t_2);
139884       __Pyx_GOTREF(__pyx_t_3);
139885
139886       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":36
139887  *     from io import BytesIO, StringIO
139888  * except (ImportError, AttributeError):
139889  *     from StringIO import StringIO, StringIO as BytesIO             # <<<<<<<<<<<<<<
139890  * 
139891  * cdef object _elementpath
139892  */
139893       __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;}
139894       __Pyx_GOTREF(((PyObject *)__pyx_t_4));
139895       __Pyx_INCREF(__pyx_kp_StringIO);
139896       PyList_SET_ITEM(__pyx_t_4, 0, __pyx_kp_StringIO);
139897       __Pyx_GIVEREF(__pyx_kp_StringIO);
139898       __Pyx_INCREF(__pyx_kp_StringIO);
139899       PyList_SET_ITEM(__pyx_t_4, 1, __pyx_kp_StringIO);
139900       __Pyx_GIVEREF(__pyx_kp_StringIO);
139901       __pyx_1 = __Pyx_Import(__pyx_kp_StringIO, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;}
139902       __Pyx_GOTREF(__pyx_1);
139903       __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
139904       __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_StringIO); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;}
139905       __Pyx_GOTREF(__pyx_3);
139906       __Pyx_GOTREF(__pyx_v_4lxml_5etree_StringIO);
139907       __Pyx_DECREF(__pyx_v_4lxml_5etree_StringIO);
139908       __Pyx_GIVEREF(__pyx_3);
139909       __pyx_v_4lxml_5etree_StringIO = __pyx_3;
139910       __pyx_3 = 0;
139911       __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_StringIO); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L24_except_error;}
139912       __Pyx_GOTREF(__pyx_3);
139913       __Pyx_GOTREF(__pyx_v_4lxml_5etree_BytesIO);
139914       __Pyx_DECREF(__pyx_v_4lxml_5etree_BytesIO);
139915       __Pyx_GIVEREF(__pyx_3);
139916       __pyx_v_4lxml_5etree_BytesIO = __pyx_3;
139917       __pyx_3 = 0;
139918       __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
139919       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
139920       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
139921       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
139922       goto __pyx_L23_exception_handled;
139923     }
139924     __pyx_L24_except_error:;
139925     __Pyx_XDECREF(__pyx_save_exc_type);
139926     __Pyx_XDECREF(__pyx_save_exc_value);
139927     __Pyx_XDECREF(__pyx_save_exc_tb);
139928     goto __pyx_L1_error;
139929     __pyx_L23_exception_handled:;
139930     __Pyx_XGIVEREF(__pyx_save_exc_type);
139931     __Pyx_XGIVEREF(__pyx_save_exc_value);
139932     __Pyx_XGIVEREF(__pyx_save_exc_tb);
139933     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
139934     __pyx_L29_try_end:;
139935   }
139936
139937   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":39
139938  * 
139939  * cdef object _elementpath
139940  * import _elementpath             # <<<<<<<<<<<<<<
139941  * 
139942  * cdef object sys
139943  */
139944   __pyx_1 = __Pyx_Import(__pyx_kp__elementpath, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139945   __Pyx_GOTREF(__pyx_1);
139946   __Pyx_GOTREF(__pyx_v_4lxml_5etree__elementpath);
139947   __Pyx_DECREF(__pyx_v_4lxml_5etree__elementpath);
139948   __Pyx_GIVEREF(__pyx_1);
139949   __pyx_v_4lxml_5etree__elementpath = __pyx_1;
139950   __pyx_1 = 0;
139951
139952   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":42
139953  * 
139954  * cdef object sys
139955  * import sys             # <<<<<<<<<<<<<<
139956  * 
139957  * cdef object re
139958  */
139959   __pyx_3 = __Pyx_Import(__pyx_kp_sys, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139960   __Pyx_GOTREF(__pyx_3);
139961   __Pyx_GOTREF(__pyx_v_4lxml_5etree_sys);
139962   __Pyx_DECREF(__pyx_v_4lxml_5etree_sys);
139963   __Pyx_GIVEREF(__pyx_3);
139964   __pyx_v_4lxml_5etree_sys = __pyx_3;
139965   __pyx_3 = 0;
139966
139967   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":45
139968  * 
139969  * cdef object re
139970  * import re             # <<<<<<<<<<<<<<
139971  * 
139972  * cdef object gzip
139973  */
139974   __pyx_1 = __Pyx_Import(__pyx_kp_re, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139975   __Pyx_GOTREF(__pyx_1);
139976   __Pyx_GOTREF(__pyx_v_4lxml_5etree_re);
139977   __Pyx_DECREF(__pyx_v_4lxml_5etree_re);
139978   __Pyx_GIVEREF(__pyx_1);
139979   __pyx_v_4lxml_5etree_re = __pyx_1;
139980   __pyx_1 = 0;
139981
139982   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":48
139983  * 
139984  * cdef object gzip
139985  * import gzip             # <<<<<<<<<<<<<<
139986  * 
139987  * cdef object ITER_EMPTY
139988  */
139989   __pyx_3 = __Pyx_Import(__pyx_kp_gzip, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
139990   __Pyx_GOTREF(__pyx_3);
139991   __Pyx_GOTREF(__pyx_v_4lxml_5etree_gzip);
139992   __Pyx_DECREF(__pyx_v_4lxml_5etree_gzip);
139993   __Pyx_GIVEREF(__pyx_3);
139994   __pyx_v_4lxml_5etree_gzip = __pyx_3;
139995   __pyx_3 = 0;
139996
139997   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":51
139998  * 
139999  * cdef object ITER_EMPTY
140000  * ITER_EMPTY = iter(())             # <<<<<<<<<<<<<<
140001  * 
140002  * cdef object EMPTY_READ_ONLY_DICT
140003  */
140004   __pyx_t_3 = PyObject_GetIter(((PyObject *)__pyx_empty_tuple)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140005   __Pyx_GOTREF(__pyx_t_3);
140006   __Pyx_GOTREF(__pyx_v_4lxml_5etree_ITER_EMPTY);
140007   __Pyx_DECREF(__pyx_v_4lxml_5etree_ITER_EMPTY);
140008   __Pyx_GIVEREF(__pyx_t_3);
140009   __pyx_v_4lxml_5etree_ITER_EMPTY = __pyx_t_3;
140010   __pyx_t_3 = 0;
140011
140012   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":54
140013  * 
140014  * cdef object EMPTY_READ_ONLY_DICT
140015  * EMPTY_READ_ONLY_DICT = python.PyDictProxy_New({})             # <<<<<<<<<<<<<<
140016  * 
140017  * # the rules
140018  */
140019   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140020   __Pyx_GOTREF(((PyObject *)__pyx_1));
140021   __pyx_t_3 = PyDictProxy_New(((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140022   __Pyx_GOTREF(__pyx_t_3);
140023   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
140024   __Pyx_GOTREF(__pyx_v_4lxml_5etree_EMPTY_READ_ONLY_DICT);
140025   __Pyx_DECREF(__pyx_v_4lxml_5etree_EMPTY_READ_ONLY_DICT);
140026   __Pyx_GIVEREF(__pyx_t_3);
140027   __pyx_v_4lxml_5etree_EMPTY_READ_ONLY_DICT = __pyx_t_3;
140028   __pyx_t_3 = 0;
140029
140030   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":70
140031  * 
140032  * # make the compiled-in debug state publicly available
140033  * DEBUG = __DEBUG             # <<<<<<<<<<<<<<
140034  * 
140035  * # global per-thread setup
140036  */
140037   if (PyObject_SetAttr(__pyx_m, __pyx_kp_DEBUG, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140038
140039   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":73
140040  * 
140041  * # global per-thread setup
140042  * tree.xmlThrDefIndentTreeOutput(1)             # <<<<<<<<<<<<<<
140043  * tree.xmlThrDefLineNumbersDefaultValue(1)
140044  * 
140045  */
140046   xmlThrDefIndentTreeOutput(1);
140047
140048   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":74
140049  * # global per-thread setup
140050  * tree.xmlThrDefIndentTreeOutput(1)
140051  * tree.xmlThrDefLineNumbersDefaultValue(1)             # <<<<<<<<<<<<<<
140052  * 
140053  * _initThreadLogging()
140054  */
140055   xmlThrDefLineNumbersDefaultValue(1);
140056
140057   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":76
140058  * tree.xmlThrDefLineNumbersDefaultValue(1)
140059  * 
140060  * _initThreadLogging()             # <<<<<<<<<<<<<<
140061  * 
140062  * # initialize parser (and threading)
140063  */
140064   __pyx_f_4lxml_5etree__initThreadLogging();
140065
140066   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":79
140067  * 
140068  * # initialize parser (and threading)
140069  * xmlparser.xmlInitParser()             # <<<<<<<<<<<<<<
140070  * 
140071  * # filename encoding
140072  */
140073   xmlInitParser();
140074
140075   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":83
140076  * # filename encoding
140077  * cdef object _FILENAME_ENCODING
140078  * _FILENAME_ENCODING = sys.getfilesystemencoding()             # <<<<<<<<<<<<<<
140079  * if _FILENAME_ENCODING is None:
140080  *     _FILENAME_ENCODING = sys.getdefaultencoding()
140081  */
140082   __pyx_t_3 = PyObject_GetAttr(__pyx_v_4lxml_5etree_sys, __pyx_kp_39); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140083   __Pyx_GOTREF(__pyx_t_3);
140084   __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140085   __Pyx_GOTREF(__pyx_t_2);
140086   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
140087   __Pyx_GOTREF(__pyx_v_4lxml_5etree__FILENAME_ENCODING);
140088   __Pyx_DECREF(__pyx_v_4lxml_5etree__FILENAME_ENCODING);
140089   __Pyx_GIVEREF(__pyx_t_2);
140090   __pyx_v_4lxml_5etree__FILENAME_ENCODING = __pyx_t_2;
140091   __pyx_t_2 = 0;
140092
140093   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":84
140094  * cdef object _FILENAME_ENCODING
140095  * _FILENAME_ENCODING = sys.getfilesystemencoding()
140096  * if _FILENAME_ENCODING is None:             # <<<<<<<<<<<<<<
140097  *     _FILENAME_ENCODING = sys.getdefaultencoding()
140098  * if _FILENAME_ENCODING is None:
140099  */
140100   __pyx_t_5 = (__pyx_v_4lxml_5etree__FILENAME_ENCODING == Py_None);
140101   if (__pyx_t_5) {
140102
140103     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":85
140104  * _FILENAME_ENCODING = sys.getfilesystemencoding()
140105  * if _FILENAME_ENCODING is None:
140106  *     _FILENAME_ENCODING = sys.getdefaultencoding()             # <<<<<<<<<<<<<<
140107  * if _FILENAME_ENCODING is None:
140108  *     _FILENAME_ENCODING = 'ascii'
140109  */
140110     __pyx_t_2 = PyObject_GetAttr(__pyx_v_4lxml_5etree_sys, __pyx_kp_getdefaultencoding); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140111     __Pyx_GOTREF(__pyx_t_2);
140112     __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140113     __Pyx_GOTREF(__pyx_t_3);
140114     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
140115     __Pyx_GOTREF(__pyx_v_4lxml_5etree__FILENAME_ENCODING);
140116     __Pyx_DECREF(__pyx_v_4lxml_5etree__FILENAME_ENCODING);
140117     __Pyx_GIVEREF(__pyx_t_3);
140118     __pyx_v_4lxml_5etree__FILENAME_ENCODING = __pyx_t_3;
140119     __pyx_t_3 = 0;
140120     goto __pyx_L32;
140121   }
140122   __pyx_L32:;
140123
140124   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":86
140125  * if _FILENAME_ENCODING is None:
140126  *     _FILENAME_ENCODING = sys.getdefaultencoding()
140127  * if _FILENAME_ENCODING is None:             # <<<<<<<<<<<<<<
140128  *     _FILENAME_ENCODING = 'ascii'
140129  * else:
140130  */
140131   __pyx_t_5 = (__pyx_v_4lxml_5etree__FILENAME_ENCODING == Py_None);
140132   if (__pyx_t_5) {
140133
140134     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":87
140135  *     _FILENAME_ENCODING = sys.getdefaultencoding()
140136  * if _FILENAME_ENCODING is None:
140137  *     _FILENAME_ENCODING = 'ascii'             # <<<<<<<<<<<<<<
140138  * else:
140139  *     _FILENAME_ENCODING = _FILENAME_ENCODING.encode(u"UTF-8")
140140  */
140141     __Pyx_INCREF(__pyx_kp_40);
140142     __Pyx_GOTREF(__pyx_v_4lxml_5etree__FILENAME_ENCODING);
140143     __Pyx_DECREF(__pyx_v_4lxml_5etree__FILENAME_ENCODING);
140144     __Pyx_GIVEREF(__pyx_kp_40);
140145     __pyx_v_4lxml_5etree__FILENAME_ENCODING = __pyx_kp_40;
140146     goto __pyx_L33;
140147   }
140148   /*else*/ {
140149
140150     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":89
140151  *     _FILENAME_ENCODING = 'ascii'
140152  * else:
140153  *     _FILENAME_ENCODING = _FILENAME_ENCODING.encode(u"UTF-8")             # <<<<<<<<<<<<<<
140154  * cdef char* _C_FILENAME_ENCODING
140155  * _C_FILENAME_ENCODING = _cstr(_FILENAME_ENCODING)
140156  */
140157     __pyx_t_3 = PyObject_GetAttr(__pyx_v_4lxml_5etree__FILENAME_ENCODING, __pyx_kp_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140158     __Pyx_GOTREF(__pyx_t_3);
140159     __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140160     __Pyx_GOTREF(((PyObject *)__pyx_t_2));
140161     __Pyx_INCREF(((PyObject *)__pyx_kp_41));
140162     PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_41));
140163     __Pyx_GIVEREF(((PyObject *)__pyx_kp_41));
140164     __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140165     __Pyx_GOTREF(__pyx_t_1);
140166     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
140167     __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
140168     __Pyx_GOTREF(__pyx_v_4lxml_5etree__FILENAME_ENCODING);
140169     __Pyx_DECREF(__pyx_v_4lxml_5etree__FILENAME_ENCODING);
140170     __Pyx_GIVEREF(__pyx_t_1);
140171     __pyx_v_4lxml_5etree__FILENAME_ENCODING = __pyx_t_1;
140172     __pyx_t_1 = 0;
140173   }
140174   __pyx_L33:;
140175
140176   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":91
140177  *     _FILENAME_ENCODING = _FILENAME_ENCODING.encode(u"UTF-8")
140178  * cdef char* _C_FILENAME_ENCODING
140179  * _C_FILENAME_ENCODING = _cstr(_FILENAME_ENCODING)             # <<<<<<<<<<<<<<
140180  * 
140181  * # set up some default namespace prefixes
140182  */
140183   __pyx_v_4lxml_5etree__C_FILENAME_ENCODING = PyString_AS_STRING(__pyx_v_4lxml_5etree__FILENAME_ENCODING);
140184
140185   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":95
140186  * # set up some default namespace prefixes
140187  * cdef object _DEFAULT_NAMESPACE_PREFIXES
140188  * _DEFAULT_NAMESPACE_PREFIXES = {             # <<<<<<<<<<<<<<
140189  *     "http://www.w3.org/1999/xhtml": "html",
140190  *     "http://www.w3.org/1999/XSL/Transform": "xsl",
140191  */
140192   __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140193   __Pyx_GOTREF(((PyObject *)__pyx_3));
140194
140195   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":96
140196  * cdef object _DEFAULT_NAMESPACE_PREFIXES
140197  * _DEFAULT_NAMESPACE_PREFIXES = {
140198  *     "http://www.w3.org/1999/xhtml": "html",             # <<<<<<<<<<<<<<
140199  *     "http://www.w3.org/1999/XSL/Transform": "xsl",
140200  *     "http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf",
140201  */
140202   if (PyDict_SetItem(__pyx_3, __pyx_kp_42, __pyx_kp_43) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140203
140204   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":97
140205  * _DEFAULT_NAMESPACE_PREFIXES = {
140206  *     "http://www.w3.org/1999/xhtml": "html",
140207  *     "http://www.w3.org/1999/XSL/Transform": "xsl",             # <<<<<<<<<<<<<<
140208  *     "http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf",
140209  *     "http://schemas.xmlsoap.org/wsdl/": "wsdl",
140210  */
140211   if (PyDict_SetItem(__pyx_3, __pyx_kp_44, __pyx_kp_45) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140212
140213   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":98
140214  *     "http://www.w3.org/1999/xhtml": "html",
140215  *     "http://www.w3.org/1999/XSL/Transform": "xsl",
140216  *     "http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf",             # <<<<<<<<<<<<<<
140217  *     "http://schemas.xmlsoap.org/wsdl/": "wsdl",
140218  *     # xml schema
140219  */
140220   if (PyDict_SetItem(__pyx_3, __pyx_kp_46, __pyx_kp_47) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140221
140222   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":99
140223  *     "http://www.w3.org/1999/XSL/Transform": "xsl",
140224  *     "http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf",
140225  *     "http://schemas.xmlsoap.org/wsdl/": "wsdl",             # <<<<<<<<<<<<<<
140226  *     # xml schema
140227  *     "http://www.w3.org/2001/XMLSchema": "xs",
140228  */
140229   if (PyDict_SetItem(__pyx_3, __pyx_kp_48, __pyx_kp_49) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140230
140231   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":101
140232  *     "http://schemas.xmlsoap.org/wsdl/": "wsdl",
140233  *     # xml schema
140234  *     "http://www.w3.org/2001/XMLSchema": "xs",             # <<<<<<<<<<<<<<
140235  *     "http://www.w3.org/2001/XMLSchema-instance": "xsi",
140236  *     # dublin core
140237  */
140238   if (PyDict_SetItem(__pyx_3, __pyx_kp_50, __pyx_kp_51) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140239
140240   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":102
140241  *     # xml schema
140242  *     "http://www.w3.org/2001/XMLSchema": "xs",
140243  *     "http://www.w3.org/2001/XMLSchema-instance": "xsi",             # <<<<<<<<<<<<<<
140244  *     # dublin core
140245  *     "http://purl.org/dc/elements/1.1/": "dc",
140246  */
140247   if (PyDict_SetItem(__pyx_3, __pyx_kp_52, __pyx_kp_53) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140248
140249   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":104
140250  *     "http://www.w3.org/2001/XMLSchema-instance": "xsi",
140251  *     # dublin core
140252  *     "http://purl.org/dc/elements/1.1/": "dc",             # <<<<<<<<<<<<<<
140253  *     # objectify
140254  *     "http://codespeak.net/lxml/objectify/pytype" : "py",
140255  */
140256   if (PyDict_SetItem(__pyx_3, __pyx_kp_54, __pyx_kp_55) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140257
140258   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":106
140259  *     "http://purl.org/dc/elements/1.1/": "dc",
140260  *     # objectify
140261  *     "http://codespeak.net/lxml/objectify/pytype" : "py",             # <<<<<<<<<<<<<<
140262  * }
140263  * 
140264  */
140265   if (PyDict_SetItem(__pyx_3, __pyx_kp_56, __pyx_kp_57) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140266   __Pyx_GOTREF(__pyx_v_4lxml_5etree__DEFAULT_NAMESPACE_PREFIXES);
140267   __Pyx_DECREF(__pyx_v_4lxml_5etree__DEFAULT_NAMESPACE_PREFIXES);
140268   __Pyx_GIVEREF(((PyObject *)__pyx_3));
140269   __pyx_v_4lxml_5etree__DEFAULT_NAMESPACE_PREFIXES = ((PyObject *)__pyx_3);
140270   __pyx_3 = 0;
140271
140272   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":110
140273  * 
140274  * # Error superclass for ElementTree compatibility
140275  * class Error(Exception):             # <<<<<<<<<<<<<<
140276  *     pass
140277  * 
140278  */
140279   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140280   __Pyx_GOTREF(((PyObject *)__pyx_1));
140281   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140282   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
140283   __Pyx_INCREF(__pyx_builtin_Exception);
140284   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_Exception);
140285   __Pyx_GIVEREF(__pyx_builtin_Exception);
140286   __pyx_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_1), __pyx_kp_Error, "lxml.etree"); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140287   __Pyx_GOTREF(__pyx_3);
140288   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
140289   if (PyObject_SetAttr(__pyx_m, __pyx_kp_Error, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140290   __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
140291   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
140292
140293   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":114
140294  * 
140295  * # module level superclass for all exceptions
140296  * class LxmlError(Error):             # <<<<<<<<<<<<<<
140297  *     u"""Main exception base class for lxml.  All other exceptions inherit from
140298  *     this one.
140299  */
140300   __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140301   __Pyx_GOTREF(((PyObject *)__pyx_3));
140302   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_Error); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140303   __Pyx_GOTREF(__pyx_1);
140304   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140305   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
140306   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_1);
140307   __Pyx_GIVEREF(__pyx_1);
140308   __pyx_1 = 0;
140309   if (PyDict_SetItemString(((PyObject *)__pyx_3), "__doc__", __pyx_kp_58) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140310   __pyx_1 = __Pyx_CreateClass(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_3), __pyx_kp_LxmlError, "lxml.etree"); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140311   __Pyx_GOTREF(__pyx_1);
140312   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
140313
140314   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":118
140315  *     this one.
140316  *     """
140317  *     def __init__(self, message, error_log=None):             # <<<<<<<<<<<<<<
140318  *         if python.PY_VERSION_HEX >= 0x02050000:
140319  *             # Python >= 2.5 uses new style class exceptions
140320  */
140321   __pyx_t_1 = PyCFunction_New(&__pyx_mdef_4lxml_5etree_9LxmlError___init__, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140322   __Pyx_GOTREF(__pyx_t_1);
140323   __pyx_4 = PyMethod_New(__pyx_t_1, 0, __pyx_1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140324   __Pyx_GOTREF(__pyx_4);
140325   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
140326   if (PyObject_SetAttr(__pyx_1, __pyx_kp___init__, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140327   __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
140328   if (PyObject_SetAttr(__pyx_m, __pyx_kp_LxmlError, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140329   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
140330   __Pyx_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
140331
140332   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":130
140333  * 
140334  * cdef object _LxmlError
140335  * _LxmlError = LxmlError             # <<<<<<<<<<<<<<
140336  * 
140337  * cdef object error_super_init
140338  */
140339   __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_LxmlError); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140340   __Pyx_GOTREF(__pyx_4);
140341   __Pyx_GOTREF(__pyx_v_4lxml_5etree__LxmlError);
140342   __Pyx_DECREF(__pyx_v_4lxml_5etree__LxmlError);
140343   __Pyx_GIVEREF(__pyx_4);
140344   __pyx_v_4lxml_5etree__LxmlError = __pyx_4;
140345   __pyx_4 = 0;
140346
140347   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":133
140348  * 
140349  * cdef object error_super_init
140350  * error_super_init = Error.__init__             # <<<<<<<<<<<<<<
140351  * 
140352  * 
140353  */
140354   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_Error); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140355   __Pyx_GOTREF(__pyx_1);
140356   __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp___init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140357   __Pyx_GOTREF(__pyx_t_1);
140358   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
140359   __Pyx_GOTREF(__pyx_v_4lxml_5etree_error_super_init);
140360   __Pyx_DECREF(__pyx_v_4lxml_5etree_error_super_init);
140361   __Pyx_GIVEREF(__pyx_t_1);
140362   __pyx_v_4lxml_5etree_error_super_init = __pyx_t_1;
140363   __pyx_t_1 = 0;
140364
140365   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":137
140366  * 
140367  * # superclass for all syntax errors
140368  * class LxmlSyntaxError(LxmlError, SyntaxError):             # <<<<<<<<<<<<<<
140369  *     u"""Base class for all syntax errors.
140370  *     """
140371  */
140372   __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140373   __Pyx_GOTREF(((PyObject *)__pyx_3));
140374   __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_LxmlError); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140375   __Pyx_GOTREF(__pyx_4);
140376   __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140377   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
140378   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_4);
140379   __Pyx_GIVEREF(__pyx_4);
140380   __Pyx_INCREF(__pyx_builtin_SyntaxError);
140381   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_builtin_SyntaxError);
140382   __Pyx_GIVEREF(__pyx_builtin_SyntaxError);
140383   __pyx_4 = 0;
140384   if (PyDict_SetItemString(((PyObject *)__pyx_3), "__doc__", __pyx_kp_59) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140385   __pyx_1 = __Pyx_CreateClass(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_3), __pyx_kp_LxmlSyntaxError, "lxml.etree"); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140386   __Pyx_GOTREF(__pyx_1);
140387   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
140388   if (PyObject_SetAttr(__pyx_m, __pyx_kp_LxmlSyntaxError, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140389   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
140390   __Pyx_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
140391
140392   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":142
140393  *     pass
140394  * 
140395  * class C14NError(LxmlError):             # <<<<<<<<<<<<<<
140396  *     u"""Error during C14N serialisation.
140397  *     """
140398  */
140399   __pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140400   __Pyx_GOTREF(((PyObject *)__pyx_4));
140401   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_LxmlError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140402   __Pyx_GOTREF(__pyx_1);
140403   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140404   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
140405   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_1);
140406   __Pyx_GIVEREF(__pyx_1);
140407   __pyx_1 = 0;
140408   if (PyDict_SetItemString(((PyObject *)__pyx_4), "__doc__", __pyx_kp_61) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140409   __pyx_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_4), __pyx_kp_60, "lxml.etree"); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140410   __Pyx_GOTREF(__pyx_3);
140411   __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
140412   if (PyObject_SetAttr(__pyx_m, __pyx_kp_60, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140413   __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
140414   __Pyx_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
140415
140416   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":179
140417  * 
140418  * cdef int _LIBXML_VERSION_INT
140419  * try:             # <<<<<<<<<<<<<<
140420  *     _LIBXML_VERSION_INT = int(
140421  *         re.match(u'[0-9]+', (tree.xmlParserVersion).decode(u"ASCII")).group(0))
140422  */
140423   {
140424     PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
140425     __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
140426     __Pyx_XGOTREF(__pyx_save_exc_type);
140427     __Pyx_XGOTREF(__pyx_save_exc_value);
140428     __Pyx_XGOTREF(__pyx_save_exc_tb);
140429     /*try:*/ {
140430
140431       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":181
140432  * try:
140433  *     _LIBXML_VERSION_INT = int(
140434  *         re.match(u'[0-9]+', (tree.xmlParserVersion).decode(u"ASCII")).group(0))             # <<<<<<<<<<<<<<
140435  * except Exception:
140436  *     print u"Unknown libxml2 version: %s" % (tree.xmlParserVersion).decode(u"ASCII")
140437  */
140438       __pyx_t_1 = PyObject_GetAttr(__pyx_v_4lxml_5etree_re, __pyx_kp_match); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
140439       __Pyx_GOTREF(__pyx_t_1);
140440       __pyx_t_2 = __Pyx_PyBytes_FromString(xmlParserVersion); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
140441       __Pyx_GOTREF(__pyx_t_2);
140442       __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_kp_decode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
140443       __Pyx_GOTREF(__pyx_t_3);
140444       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
140445       __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
140446       __Pyx_GOTREF(((PyObject *)__pyx_t_2));
140447       __Pyx_INCREF(((PyObject *)__pyx_kp_63));
140448       PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_63));
140449       __Pyx_GIVEREF(((PyObject *)__pyx_kp_63));
140450       __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
140451       __Pyx_GOTREF(__pyx_t_4);
140452       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
140453       __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
140454       __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
140455       __Pyx_GOTREF(((PyObject *)__pyx_t_2));
140456       __Pyx_INCREF(((PyObject *)__pyx_kp_62));
140457       PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_62));
140458       __Pyx_GIVEREF(((PyObject *)__pyx_kp_62));
140459       PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
140460       __Pyx_GIVEREF(__pyx_t_4);
140461       __pyx_t_4 = 0;
140462       __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
140463       __Pyx_GOTREF(__pyx_t_4);
140464       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
140465       __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
140466       __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_kp_group); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
140467       __Pyx_GOTREF(__pyx_t_2);
140468       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
140469       __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
140470       __Pyx_GOTREF(((PyObject *)__pyx_t_4));
140471       __Pyx_INCREF(__pyx_int_0);
140472       PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_0);
140473       __Pyx_GIVEREF(__pyx_int_0);
140474       __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
140475       __Pyx_GOTREF(__pyx_t_1);
140476       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
140477       __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
140478       __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
140479       __Pyx_GOTREF(((PyObject *)__pyx_t_4));
140480       PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
140481       __Pyx_GIVEREF(__pyx_t_1);
140482       __pyx_t_1 = 0;
140483       __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
140484       __Pyx_GOTREF(__pyx_t_1);
140485       __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
140486       __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L34_error;}
140487       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
140488       __pyx_v_4lxml_5etree__LIBXML_VERSION_INT = __pyx_t_6;
140489     }
140490     __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
140491     __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
140492     __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
140493     goto __pyx_L41_try_end;
140494     __pyx_L34_error:;
140495     __Pyx_XDECREF(__pyx_1); __pyx_1 = 0;
140496     __Pyx_XDECREF(__pyx_3); __pyx_3 = 0;
140497     __Pyx_XDECREF(__pyx_4); __pyx_4 = 0;
140498     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
140499     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
140500     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
140501     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
140502
140503     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":182
140504  *     _LIBXML_VERSION_INT = int(
140505  *         re.match(u'[0-9]+', (tree.xmlParserVersion).decode(u"ASCII")).group(0))
140506  * except Exception:             # <<<<<<<<<<<<<<
140507  *     print u"Unknown libxml2 version: %s" % (tree.xmlParserVersion).decode(u"ASCII")
140508  *     _LIBXML_VERSION_INT = 0
140509  */
140510     __pyx_2 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
140511     if (__pyx_2) {
140512       __Pyx_AddTraceback("lxml.etree");
140513       if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L36_except_error;}
140514       __Pyx_GOTREF(__pyx_t_1);
140515       __Pyx_GOTREF(__pyx_t_4);
140516       __Pyx_GOTREF(__pyx_t_2);
140517
140518       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":183
140519  *         re.match(u'[0-9]+', (tree.xmlParserVersion).decode(u"ASCII")).group(0))
140520  * except Exception:
140521  *     print u"Unknown libxml2 version: %s" % (tree.xmlParserVersion).decode(u"ASCII")             # <<<<<<<<<<<<<<
140522  *     _LIBXML_VERSION_INT = 0
140523  * 
140524  */
140525       __pyx_t_3 = __Pyx_PyBytes_FromString(xmlParserVersion); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L36_except_error;}
140526       __Pyx_GOTREF(__pyx_t_3);
140527       __pyx_t_7 = PyObject_GetAttr(__pyx_t_3, __pyx_kp_decode); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L36_except_error;}
140528       __Pyx_GOTREF(__pyx_t_7);
140529       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
140530       __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L36_except_error;}
140531       __Pyx_GOTREF(((PyObject *)__pyx_t_3));
140532       __Pyx_INCREF(((PyObject *)__pyx_kp_65));
140533       PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_65));
140534       __Pyx_GIVEREF(((PyObject *)__pyx_kp_65));
140535       __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L36_except_error;}
140536       __Pyx_GOTREF(__pyx_t_8);
140537       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
140538       __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
140539       __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_64), __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L36_except_error;}
140540       __Pyx_GOTREF(__pyx_t_3);
140541       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
140542       if (__Pyx_PrintOne(__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L36_except_error;}
140543       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
140544
140545       /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":184
140546  * except Exception:
140547  *     print u"Unknown libxml2 version: %s" % (tree.xmlParserVersion).decode(u"ASCII")
140548  *     _LIBXML_VERSION_INT = 0             # <<<<<<<<<<<<<<
140549  * 
140550  * LIBXML_VERSION = __unpackIntVersion(_LIBXML_VERSION_INT)
140551  */
140552       __pyx_v_4lxml_5etree__LIBXML_VERSION_INT = 0;
140553       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
140554       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
140555       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
140556       goto __pyx_L35_exception_handled;
140557     }
140558     __pyx_L36_except_error:;
140559     __Pyx_XDECREF(__pyx_save_exc_type);
140560     __Pyx_XDECREF(__pyx_save_exc_value);
140561     __Pyx_XDECREF(__pyx_save_exc_tb);
140562     goto __pyx_L1_error;
140563     __pyx_L35_exception_handled:;
140564     __Pyx_XGIVEREF(__pyx_save_exc_type);
140565     __Pyx_XGIVEREF(__pyx_save_exc_value);
140566     __Pyx_XGIVEREF(__pyx_save_exc_tb);
140567     __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
140568     __pyx_L41_try_end:;
140569   }
140570
140571   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":186
140572  *     _LIBXML_VERSION_INT = 0
140573  * 
140574  * LIBXML_VERSION = __unpackIntVersion(_LIBXML_VERSION_INT)             # <<<<<<<<<<<<<<
140575  * LIBXML_COMPILED_VERSION = __unpackIntVersion(tree.LIBXML_VERSION)
140576  * LXML_VERSION = __unpackDottedVersion(tree.LXML_VERSION_STRING)
140577  */
140578   __pyx_t_2 = __pyx_f_4lxml_5etree___unpackIntVersion(__pyx_v_4lxml_5etree__LIBXML_VERSION_INT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140579   __Pyx_GOTREF(__pyx_t_2);
140580   if (PyObject_SetAttr(__pyx_m, __pyx_kp_LIBXML_VERSION, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140581   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
140582
140583   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":187
140584  * 
140585  * LIBXML_VERSION = __unpackIntVersion(_LIBXML_VERSION_INT)
140586  * LIBXML_COMPILED_VERSION = __unpackIntVersion(tree.LIBXML_VERSION)             # <<<<<<<<<<<<<<
140587  * LXML_VERSION = __unpackDottedVersion(tree.LXML_VERSION_STRING)
140588  * 
140589  */
140590   __pyx_t_2 = __pyx_f_4lxml_5etree___unpackIntVersion(LIBXML_VERSION); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140591   __Pyx_GOTREF(__pyx_t_2);
140592   if (PyObject_SetAttr(__pyx_m, __pyx_kp_66, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140593   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
140594
140595   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":188
140596  * LIBXML_VERSION = __unpackIntVersion(_LIBXML_VERSION_INT)
140597  * LIBXML_COMPILED_VERSION = __unpackIntVersion(tree.LIBXML_VERSION)
140598  * LXML_VERSION = __unpackDottedVersion(tree.LXML_VERSION_STRING)             # <<<<<<<<<<<<<<
140599  * 
140600  * __version__ = (tree.LXML_VERSION_STRING).decode(u"ASCII")
140601  */
140602   __pyx_t_2 = __Pyx_PyBytes_FromString(LXML_VERSION_STRING); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140603   __Pyx_GOTREF(__pyx_t_2);
140604   __pyx_t_4 = __pyx_f_4lxml_5etree___unpackDottedVersion(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140605   __Pyx_GOTREF(__pyx_t_4);
140606   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
140607   if (PyObject_SetAttr(__pyx_m, __pyx_kp_LXML_VERSION, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140608   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
140609
140610   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":190
140611  * LXML_VERSION = __unpackDottedVersion(tree.LXML_VERSION_STRING)
140612  * 
140613  * __version__ = (tree.LXML_VERSION_STRING).decode(u"ASCII")             # <<<<<<<<<<<<<<
140614  * 
140615  * 
140616  */
140617   __pyx_t_4 = __Pyx_PyBytes_FromString(LXML_VERSION_STRING); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140618   __Pyx_GOTREF(__pyx_t_4);
140619   __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_kp_decode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140620   __Pyx_GOTREF(__pyx_t_2);
140621   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
140622   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140623   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
140624   __Pyx_INCREF(((PyObject *)__pyx_kp_67));
140625   PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_67));
140626   __Pyx_GIVEREF(((PyObject *)__pyx_kp_67));
140627   __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140628   __Pyx_GOTREF(__pyx_t_1);
140629   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
140630   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
140631   if (PyObject_SetAttr(__pyx_m, __pyx_kp___version__, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140632   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
140633
140634   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":550
140635  * 
140636  * cdef object __RE_XML_ENCODING
140637  * __RE_XML_ENCODING = re.compile(             # <<<<<<<<<<<<<<
140638  *     ur'^(\s*<\?\s*xml[^>]+)\s+encoding\s*=\s*"[^"]*"\s*', re.U)
140639  * 
140640  */
140641   __pyx_t_1 = PyObject_GetAttr(__pyx_v_4lxml_5etree_re, __pyx_kp_compile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140642   __Pyx_GOTREF(__pyx_t_1);
140643
140644   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":551
140645  * cdef object __RE_XML_ENCODING
140646  * __RE_XML_ENCODING = re.compile(
140647  *     ur'^(\s*<\?\s*xml[^>]+)\s+encoding\s*=\s*"[^"]*"\s*', re.U)             # <<<<<<<<<<<<<<
140648  * 
140649  * cdef object __REPLACE_XML_ENCODING
140650  */
140651   __pyx_t_4 = PyObject_GetAttr(__pyx_v_4lxml_5etree_re, __pyx_kp_U); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140652   __Pyx_GOTREF(__pyx_t_4);
140653   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140654   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
140655   __Pyx_INCREF(((PyObject *)__pyx_kp_68));
140656   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_68));
140657   __Pyx_GIVEREF(((PyObject *)__pyx_kp_68));
140658   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
140659   __Pyx_GIVEREF(__pyx_t_4);
140660   __pyx_t_4 = 0;
140661   __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140662   __Pyx_GOTREF(__pyx_t_4);
140663   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
140664   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
140665   __Pyx_GOTREF(__pyx_v_4lxml_5etree___RE_XML_ENCODING);
140666   __Pyx_DECREF(__pyx_v_4lxml_5etree___RE_XML_ENCODING);
140667   __Pyx_GIVEREF(__pyx_t_4);
140668   __pyx_v_4lxml_5etree___RE_XML_ENCODING = __pyx_t_4;
140669   __pyx_t_4 = 0;
140670
140671   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":554
140672  * 
140673  * cdef object __REPLACE_XML_ENCODING
140674  * __REPLACE_XML_ENCODING = __RE_XML_ENCODING.sub             # <<<<<<<<<<<<<<
140675  * 
140676  * cdef object __HAS_XML_ENCODING
140677  */
140678   __pyx_t_4 = PyObject_GetAttr(__pyx_v_4lxml_5etree___RE_XML_ENCODING, __pyx_kp_sub); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140679   __Pyx_GOTREF(__pyx_t_4);
140680   __Pyx_GOTREF(__pyx_v_4lxml_5etree___REPLACE_XML_ENCODING);
140681   __Pyx_DECREF(__pyx_v_4lxml_5etree___REPLACE_XML_ENCODING);
140682   __Pyx_GIVEREF(__pyx_t_4);
140683   __pyx_v_4lxml_5etree___REPLACE_XML_ENCODING = __pyx_t_4;
140684   __pyx_t_4 = 0;
140685
140686   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/apihelpers.pxi":557
140687  * 
140688  * cdef object __HAS_XML_ENCODING
140689  * __HAS_XML_ENCODING = __RE_XML_ENCODING.match             # <<<<<<<<<<<<<<
140690  * 
140691  * cdef object _stripEncodingDeclaration(object xml_string):
140692  */
140693   __pyx_t_4 = PyObject_GetAttr(__pyx_v_4lxml_5etree___RE_XML_ENCODING, __pyx_kp_match); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140694   __Pyx_GOTREF(__pyx_t_4);
140695   __Pyx_GOTREF(__pyx_v_4lxml_5etree___HAS_XML_ENCODING);
140696   __Pyx_DECREF(__pyx_v_4lxml_5etree___HAS_XML_ENCODING);
140697   __Pyx_GIVEREF(__pyx_t_4);
140698   __pyx_v_4lxml_5etree___HAS_XML_ENCODING = __pyx_t_4;
140699   __pyx_t_4 = 0;
140700
140701   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":438
140702  * 
140703  * cdef _BaseErrorLog __GLOBAL_ERROR_LOG
140704  * __GLOBAL_ERROR_LOG = _RotatingErrorLog(__MAX_LOG_SIZE)             # <<<<<<<<<<<<<<
140705  * 
140706  * cdef _BaseErrorLog _getGlobalErrorLog():
140707  */
140708   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140709   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
140710   __Pyx_INCREF(__pyx_int_100);
140711   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_100);
140712   __Pyx_GIVEREF(__pyx_int_100);
140713   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__RotatingErrorLog)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140714   __Pyx_GOTREF(__pyx_t_2);
140715   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
140716   if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__BaseErrorLog))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140717   __Pyx_GOTREF(((PyObject *)__pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG));
140718   __Pyx_DECREF(((PyObject *)__pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG));
140719   __Pyx_GIVEREF(__pyx_t_2);
140720   __pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_t_2);
140721   __pyx_t_2 = 0;
140722
140723   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":592
140724  * 
140725  * 
140726  * class ErrorLevels:             # <<<<<<<<<<<<<<
140727  *     u"Libxml2 error levels"
140728  * 
140729  */
140730   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140731   __Pyx_GOTREF(((PyObject *)__pyx_1));
140732   if (PyDict_SetItemString(((PyObject *)__pyx_1), "__doc__", __pyx_kp_69) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140733   __pyx_3 = __Pyx_CreateClass(((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_1), __pyx_kp_ErrorLevels, "lxml.etree"); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140734   __Pyx_GOTREF(__pyx_3);
140735   if (PyObject_SetAttr(__pyx_m, __pyx_kp_ErrorLevels, __pyx_3) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140736   __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
140737   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
140738
140739   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":595
140740  *     u"Libxml2 error levels"
140741  * 
140742  * class ErrorDomains:             # <<<<<<<<<<<<<<
140743  *     u"Libxml2 error domains"
140744  * 
140745  */
140746   __pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140747   __Pyx_GOTREF(((PyObject *)__pyx_4));
140748   if (PyDict_SetItemString(((PyObject *)__pyx_4), "__doc__", __pyx_kp_70) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140749   __pyx_3 = __Pyx_CreateClass(((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_4), __pyx_kp_ErrorDomains, "lxml.etree"); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140750   __Pyx_GOTREF(__pyx_3);
140751   if (PyObject_SetAttr(__pyx_m, __pyx_kp_ErrorDomains, __pyx_3) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140752   __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
140753   __Pyx_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
140754
140755   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":598
140756  *     u"Libxml2 error domains"
140757  * 
140758  * class ErrorTypes:             # <<<<<<<<<<<<<<
140759  *     u"Libxml2 error types"
140760  * 
140761  */
140762   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140763   __Pyx_GOTREF(((PyObject *)__pyx_1));
140764   if (PyDict_SetItemString(((PyObject *)__pyx_1), "__doc__", __pyx_kp_71) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140765   __pyx_3 = __Pyx_CreateClass(((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_1), __pyx_kp_ErrorTypes, "lxml.etree"); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140766   __Pyx_GOTREF(__pyx_3);
140767   if (PyObject_SetAttr(__pyx_m, __pyx_kp_ErrorTypes, __pyx_3) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140768   __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
140769   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
140770
140771   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":601
140772  *     u"Libxml2 error types"
140773  * 
140774  * class RelaxNGErrorTypes:             # <<<<<<<<<<<<<<
140775  *     u"Libxml2 RelaxNG error types"
140776  * 
140777  */
140778   __pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140779   __Pyx_GOTREF(((PyObject *)__pyx_4));
140780   if (PyDict_SetItemString(((PyObject *)__pyx_4), "__doc__", __pyx_kp_72) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140781   __pyx_3 = __Pyx_CreateClass(((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_4), __pyx_kp_RelaxNGErrorTypes, "lxml.etree"); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140782   __Pyx_GOTREF(__pyx_3);
140783   if (PyObject_SetAttr(__pyx_m, __pyx_kp_RelaxNGErrorTypes, __pyx_3) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140784   __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
140785   __Pyx_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
140786
140787   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":615
140788  * 
140789  * cdef object __ERROR_LEVELS
140790  * __ERROR_LEVELS = (u"""\             # <<<<<<<<<<<<<<
140791  * NONE=0
140792  * WARNING=1
140793  */
140794   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140795   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
140796   __Pyx_INCREF(((PyObject *)__pyx_kp_73));
140797   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_73));
140798   __Pyx_GIVEREF(((PyObject *)__pyx_kp_73));
140799   __Pyx_GOTREF(__pyx_v_4lxml_5etree___ERROR_LEVELS);
140800   __Pyx_DECREF(__pyx_v_4lxml_5etree___ERROR_LEVELS);
140801   __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
140802   __pyx_v_4lxml_5etree___ERROR_LEVELS = ((PyObject *)__pyx_t_2);
140803   __pyx_t_2 = 0;
140804
140805   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":623
140806  * 
140807  * cdef object __ERROR_DOMAINS
140808  * __ERROR_DOMAINS = (u"""\             # <<<<<<<<<<<<<<
140809  * NONE=0
140810  * PARSER=1
140811  */
140812   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140813   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
140814   __Pyx_INCREF(((PyObject *)__pyx_kp_74));
140815   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_74));
140816   __Pyx_GIVEREF(((PyObject *)__pyx_kp_74));
140817   __Pyx_GOTREF(__pyx_v_4lxml_5etree___ERROR_DOMAINS);
140818   __Pyx_DECREF(__pyx_v_4lxml_5etree___ERROR_DOMAINS);
140819   __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
140820   __pyx_v_4lxml_5etree___ERROR_DOMAINS = ((PyObject *)__pyx_t_2);
140821   __pyx_t_2 = 0;
140822
140823   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":1406
140824  * I18N_CONV_FAILED=6003
140825  * """,
140826  * u"""\             # <<<<<<<<<<<<<<
140827  * I18N_NO_OUTPUT=6004
140828  * CHECK_=6005
140829  */
140830   __pyx_t_2 = PyTuple_New(11); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140831   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
140832   __Pyx_INCREF(((PyObject *)__pyx_kp_75));
140833   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_75));
140834   __Pyx_GIVEREF(((PyObject *)__pyx_kp_75));
140835   __Pyx_INCREF(((PyObject *)__pyx_kp_76));
140836   PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_kp_76));
140837   __Pyx_GIVEREF(((PyObject *)__pyx_kp_76));
140838   __Pyx_INCREF(((PyObject *)__pyx_kp_77));
140839   PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_kp_77));
140840   __Pyx_GIVEREF(((PyObject *)__pyx_kp_77));
140841   __Pyx_INCREF(((PyObject *)__pyx_kp_78));
140842   PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_kp_78));
140843   __Pyx_GIVEREF(((PyObject *)__pyx_kp_78));
140844   __Pyx_INCREF(((PyObject *)__pyx_kp_79));
140845   PyTuple_SET_ITEM(__pyx_t_2, 4, ((PyObject *)__pyx_kp_79));
140846   __Pyx_GIVEREF(((PyObject *)__pyx_kp_79));
140847   __Pyx_INCREF(((PyObject *)__pyx_kp_80));
140848   PyTuple_SET_ITEM(__pyx_t_2, 5, ((PyObject *)__pyx_kp_80));
140849   __Pyx_GIVEREF(((PyObject *)__pyx_kp_80));
140850   __Pyx_INCREF(((PyObject *)__pyx_kp_81));
140851   PyTuple_SET_ITEM(__pyx_t_2, 6, ((PyObject *)__pyx_kp_81));
140852   __Pyx_GIVEREF(((PyObject *)__pyx_kp_81));
140853   __Pyx_INCREF(((PyObject *)__pyx_kp_82));
140854   PyTuple_SET_ITEM(__pyx_t_2, 7, ((PyObject *)__pyx_kp_82));
140855   __Pyx_GIVEREF(((PyObject *)__pyx_kp_82));
140856   __Pyx_INCREF(((PyObject *)__pyx_kp_83));
140857   PyTuple_SET_ITEM(__pyx_t_2, 8, ((PyObject *)__pyx_kp_83));
140858   __Pyx_GIVEREF(((PyObject *)__pyx_kp_83));
140859   __Pyx_INCREF(((PyObject *)__pyx_kp_84));
140860   PyTuple_SET_ITEM(__pyx_t_2, 9, ((PyObject *)__pyx_kp_84));
140861   __Pyx_GIVEREF(((PyObject *)__pyx_kp_84));
140862   __Pyx_INCREF(((PyObject *)__pyx_kp_85));
140863   PyTuple_SET_ITEM(__pyx_t_2, 10, ((PyObject *)__pyx_kp_85));
140864   __Pyx_GIVEREF(((PyObject *)__pyx_kp_85));
140865   __Pyx_GOTREF(__pyx_v_4lxml_5etree___PARSER_ERROR_TYPES);
140866   __Pyx_DECREF(__pyx_v_4lxml_5etree___PARSER_ERROR_TYPES);
140867   __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
140868   __pyx_v_4lxml_5etree___PARSER_ERROR_TYPES = ((PyObject *)__pyx_t_2);
140869   __pyx_t_2 = 0;
140870
140871   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":1413
140872  * 
140873  * cdef object __RELAXNG_ERROR_TYPES
140874  * __RELAXNG_ERROR_TYPES = (u"""\             # <<<<<<<<<<<<<<
140875  * RELAXNG_OK=0
140876  * RELAXNG_ERR_MEMORY=1
140877  */
140878   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140879   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
140880   __Pyx_INCREF(((PyObject *)__pyx_kp_86));
140881   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_86));
140882   __Pyx_GIVEREF(((PyObject *)__pyx_kp_86));
140883   __Pyx_GOTREF(__pyx_v_4lxml_5etree___RELAXNG_ERROR_TYPES);
140884   __Pyx_DECREF(__pyx_v_4lxml_5etree___RELAXNG_ERROR_TYPES);
140885   __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
140886   __pyx_v_4lxml_5etree___RELAXNG_ERROR_TYPES = ((PyObject *)__pyx_t_2);
140887   __pyx_t_2 = 0;
140888
140889   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlerror.pxi":1457
140890  * # --- END: GENERATED CONSTANTS ---
140891  * 
140892  * __initErrorConstants()             # <<<<<<<<<<<<<<
140893  */
140894   __pyx_f_4lxml_5etree___initErrorConstants();
140895
140896   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":392
140897  * 
140898  * cdef object _PREFIX_CACHE
140899  * _PREFIX_CACHE = __initPrefixCache()             # <<<<<<<<<<<<<<
140900  * 
140901  * cdef extern from "etree_defs.h":
140902  */
140903   __pyx_t_2 = __pyx_f_4lxml_5etree___initPrefixCache(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140904   __Pyx_GOTREF(__pyx_t_2);
140905   __Pyx_GOTREF(__pyx_v_4lxml_5etree__PREFIX_CACHE);
140906   __Pyx_DECREF(__pyx_v_4lxml_5etree__PREFIX_CACHE);
140907   __Pyx_GIVEREF(__pyx_t_2);
140908   __pyx_v_4lxml_5etree__PREFIX_CACHE = __pyx_t_2;
140909   __pyx_t_2 = 0;
140910
140911   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1159
140912  *         return _elementFactory(self._doc, c_node)
140913  * 
140914  *     def itersiblings(self, tag=None, *, preceding=False):             # <<<<<<<<<<<<<<
140915  *         u"""itersiblings(self, tag=None, preceding=False)
140916  * 
140917  */
140918   __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140919   __Pyx_GOTREF(__pyx_t_2);
140920   __pyx_k_87 = __pyx_t_2;
140921   __pyx_t_2 = 0;
140922   __Pyx_GIVEREF(__pyx_k_87);
140923
140924   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1192
140925  *         return ElementDepthFirstIterator(self, tag, inclusive=False)
140926  * 
140927  *     def iterchildren(self, tag=None, *, reversed=False):             # <<<<<<<<<<<<<<
140928  *         u"""iterchildren(self, tag=None, reversed=False)
140929  * 
140930  */
140931   __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140932   __Pyx_GOTREF(__pyx_t_2);
140933   __pyx_k_88 = __pyx_t_2;
140934   __pyx_t_2 = 0;
140935   __Pyx_GIVEREF(__pyx_k_88);
140936
140937   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1251
140938  *         return ElementDepthFirstIterator(self, tag)
140939  * 
140940  *     def itertext(self, tag=None, *, with_tail=True):             # <<<<<<<<<<<<<<
140941  *         u"""itertext(self, tag=None, with_tail=True)
140942  * 
140943  */
140944   __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140945   __Pyx_GOTREF(__pyx_t_2);
140946   __pyx_k_89 = __pyx_t_2;
140947   __pyx_t_2 = 0;
140948   __Pyx_GIVEREF(__pyx_k_89);
140949
140950   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1309
140951  * 
140952  *     def xpath(self, _path, *, namespaces=None, extensions=None,
140953  *               smart_strings=True, **_variables):             # <<<<<<<<<<<<<<
140954  *         u"""xpath(self, _path, namespaces=None, extensions=None, smart_strings=True, **_variables)
140955  * 
140956  */
140957   __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140958   __Pyx_GOTREF(__pyx_t_2);
140959   __pyx_k_90 = __pyx_t_2;
140960   __pyx_t_2 = 0;
140961   __Pyx_GIVEREF(__pyx_k_90);
140962
140963   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1641
140964  * 
140965  *     def write(self, file, *, encoding=None, method=u"xml",
140966  *               pretty_print=False, xml_declaration=None, with_tail=True,             # <<<<<<<<<<<<<<
140967  *               standalone=None, compression=0):
140968  *         u"""write(self, file, encoding=None, method="xml",
140969  */
140970   __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140971   __Pyx_GOTREF(__pyx_t_2);
140972   __pyx_k_92 = __pyx_t_2;
140973   __pyx_t_2 = 0;
140974   __Pyx_GIVEREF(__pyx_k_92);
140975   __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140976   __Pyx_GOTREF(__pyx_t_2);
140977   __pyx_k_93 = __pyx_t_2;
140978   __pyx_t_2 = 0;
140979   __Pyx_GIVEREF(__pyx_k_93);
140980
140981   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1811
140982  * 
140983  *     def xpath(self, _path, *, namespaces=None, extensions=None,
140984  *               smart_strings=True, **_variables):             # <<<<<<<<<<<<<<
140985  *         u"""xpath(self, _path, namespaces=None, extensions=None, smart_strings=True, **_variables)
140986  * 
140987  */
140988   __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
140989   __Pyx_GOTREF(__pyx_t_2);
140990   __pyx_k_94 = __pyx_t_2;
140991   __pyx_t_2 = 0;
140992   __Pyx_GIVEREF(__pyx_k_94);
140993
140994   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":1906
140995  *         XInclude()(self._context_node)
140996  * 
140997  *     def write_c14n(self, file, *, exclusive=False, with_comments=True,             # <<<<<<<<<<<<<<
140998  *                    compression=0):
140999  *         u"""write_c14n(self, file, exclusive=False, with_comments=True,
141000  */
141001   __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141002   __Pyx_GOTREF(__pyx_t_2);
141003   __pyx_k_95 = __pyx_t_2;
141004   __pyx_t_2 = 0;
141005   __Pyx_GIVEREF(__pyx_k_95);
141006   __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141007   __Pyx_GOTREF(__pyx_t_2);
141008   __pyx_k_96 = __pyx_t_2;
141009   __pyx_t_2 = 0;
141010   __Pyx_GIVEREF(__pyx_k_96);
141011
141012   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2161
141013  *     Iterates over the children of an element.
141014  *     """
141015  *     def __init__(self, _Element node not None, tag=None, *, reversed=False):             # <<<<<<<<<<<<<<
141016  *         cdef xmlNode* c_node
141017  *         self._initTagMatch(tag)
141018  */
141019   __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141020   __Pyx_GOTREF(__pyx_t_2);
141021   __pyx_k_97 = __pyx_t_2;
141022   __pyx_t_2 = 0;
141023   __Pyx_GIVEREF(__pyx_k_97);
141024
141025   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2186
141026  *     You can pass the boolean keyword ``preceding`` to specify the direction.
141027  *     """
141028  *     def __init__(self, _Element node not None, tag=None, *, preceding=False):             # <<<<<<<<<<<<<<
141029  *         self._initTagMatch(tag)
141030  *         if preceding:
141031  */
141032   __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141033   __Pyx_GOTREF(__pyx_t_2);
141034   __pyx_k_98 = __pyx_t_2;
141035   __pyx_t_2 = 0;
141036   __Pyx_GIVEREF(__pyx_k_98);
141037
141038   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2227
141039  *     cdef _Element _next_node
141040  *     cdef _Element _top_node
141041  *     def __init__(self, _Element node not None, tag=None, *, inclusive=True):             # <<<<<<<<<<<<<<
141042  *         self._top_node  = node
141043  *         self._next_node = node
141044  */
141045   __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141046   __Pyx_GOTREF(__pyx_t_2);
141047   __pyx_k_99 = __pyx_t_2;
141048   __pyx_t_2 = 0;
141049   __Pyx_GIVEREF(__pyx_k_99);
141050
141051   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2293
141052  *     cdef object _nextEvent
141053  *     cdef _Element _start_element
141054  *     def __init__(self, _Element element not None, tag=None, *, with_tail=True):             # <<<<<<<<<<<<<<
141055  *         if with_tail:
141056  *             events = (u"start", u"end")
141057  */
141058   __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141059   __Pyx_GOTREF(__pyx_t_2);
141060   __pyx_k_100 = __pyx_t_2;
141061   __pyx_t_2 = 0;
141062   __Pyx_GIVEREF(__pyx_k_100);
141063
141064   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2388
141065  *     return _elementFactory(doc, c_node)
141066  * 
141067  * PI = ProcessingInstruction             # <<<<<<<<<<<<<<
141068  * 
141069  * cdef class CDATA:
141070  */
141071   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_101); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141072   __Pyx_GOTREF(__pyx_1);
141073   if (PyObject_SetAttr(__pyx_m, __pyx_kp_PI, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141074   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
141075
141076   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2561
141077  *     return isinstance(element, _Element)
141078  * 
141079  * def dump(_Element elem not None, *, pretty_print=True, with_tail=True):             # <<<<<<<<<<<<<<
141080  *     u"""dump(elem, pretty_print=True, with_tail=True)
141081  * 
141082  */
141083   __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141084   __Pyx_GOTREF(__pyx_t_2);
141085   __pyx_k_102 = __pyx_t_2;
141086   __pyx_t_2 = 0;
141087   __Pyx_GIVEREF(__pyx_k_102);
141088   __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141089   __Pyx_GOTREF(__pyx_t_2);
141090   __pyx_k_103 = __pyx_t_2;
141091   __pyx_t_2 = 0;
141092   __Pyx_GIVEREF(__pyx_k_103);
141093
141094   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2570
141095  * 
141096  * def tostring(element_or_tree, *, encoding=None, method=u"xml",
141097  *              xml_declaration=None, pretty_print=False, with_tail=True,             # <<<<<<<<<<<<<<
141098  *              standalone=None):
141099  *     u"""tostring(element_or_tree, encoding=None, method="xml",
141100  */
141101   __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141102   __Pyx_GOTREF(__pyx_t_2);
141103   __pyx_k_105 = __pyx_t_2;
141104   __pyx_t_2 = 0;
141105   __Pyx_GIVEREF(__pyx_k_105);
141106   __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141107   __Pyx_GOTREF(__pyx_t_2);
141108   __pyx_k_106 = __pyx_t_2;
141109   __pyx_t_2 = 0;
141110   __Pyx_GIVEREF(__pyx_k_106);
141111
141112   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2646
141113  *     return [tostring(element_or_tree, *args, **kwargs)]
141114  * 
141115  * def tounicode(element_or_tree, *, method=u"xml", pretty_print=False,             # <<<<<<<<<<<<<<
141116  *               with_tail=True):
141117  *     u"""tounicode(element_or_tree, method="xml", pretty_print=False,
141118  */
141119   __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141120   __Pyx_GOTREF(__pyx_t_2);
141121   __pyx_k_108 = __pyx_t_2;
141122   __pyx_t_2 = 0;
141123   __Pyx_GIVEREF(__pyx_k_108);
141124
141125   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2647
141126  * 
141127  * def tounicode(element_or_tree, *, method=u"xml", pretty_print=False,
141128  *               with_tail=True):             # <<<<<<<<<<<<<<
141129  *     u"""tounicode(element_or_tree, method="xml", pretty_print=False,
141130  *                   with_tail=True)
141131  */
141132   __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141133   __Pyx_GOTREF(__pyx_t_2);
141134   __pyx_k_109 = __pyx_t_2;
141135   __pyx_t_2 = 0;
141136   __Pyx_GIVEREF(__pyx_k_109);
141137
141138   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/readonlytree.pxi":157
141139  *         return iter(self.getchildren())
141140  * 
141141  *     def iterchildren(self, tag=None, *, reversed=False):             # <<<<<<<<<<<<<<
141142  *         u"""iterchildren(self, tag=None, reversed=False)
141143  * 
141144  */
141145   __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141146   __Pyx_GOTREF(__pyx_t_2);
141147   __pyx_k_110 = __pyx_t_2;
141148   __pyx_t_2 = 0;
141149   __Pyx_GIVEREF(__pyx_k_110);
141150
141151   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":499
141152  * # default setup: parser delegation
141153  * cdef ParserBasedElementClassLookup DEFAULT_ELEMENT_CLASS_LOOKUP
141154  * DEFAULT_ELEMENT_CLASS_LOOKUP = ParserBasedElementClassLookup()             # <<<<<<<<<<<<<<
141155  * 
141156  * set_element_class_lookup(DEFAULT_ELEMENT_CLASS_LOOKUP)
141157  */
141158   __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_ParserBasedElementClassLookup)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141159   __Pyx_GOTREF(__pyx_t_2);
141160   if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree_ParserBasedElementClassLookup))) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141161   __Pyx_GOTREF(((PyObject *)__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP));
141162   __Pyx_DECREF(((PyObject *)__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP));
141163   __Pyx_GIVEREF(__pyx_t_2);
141164   __pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP = ((struct __pyx_obj_4lxml_5etree_ParserBasedElementClassLookup *)__pyx_t_2);
141165   __pyx_t_2 = 0;
141166
141167   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/classlookup.pxi":501
141168  * DEFAULT_ELEMENT_CLASS_LOOKUP = ParserBasedElementClassLookup()
141169  * 
141170  * set_element_class_lookup(DEFAULT_ELEMENT_CLASS_LOOKUP)             # <<<<<<<<<<<<<<
141171  */
141172   __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_29); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141173   __Pyx_GOTREF(__pyx_3);
141174   __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141175   __Pyx_GOTREF(((PyObject *)__pyx_t_2));
141176   __Pyx_INCREF(((PyObject *)__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP));
141177   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP));
141178   __Pyx_GIVEREF(((PyObject *)__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP));
141179   __pyx_t_4 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141180   __Pyx_GOTREF(__pyx_t_4);
141181   __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
141182   __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
141183   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
141184
141185   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":3
141186  * # module-level API for namespace implementations
141187  * 
141188  * class LxmlRegistryError(LxmlError):             # <<<<<<<<<<<<<<
141189  *     u"""Base class of lxml registry errors.
141190  *     """
141191  */
141192   __pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141193   __Pyx_GOTREF(((PyObject *)__pyx_4));
141194   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_LxmlError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141195   __Pyx_GOTREF(__pyx_1);
141196   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141197   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
141198   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_1);
141199   __Pyx_GIVEREF(__pyx_1);
141200   __pyx_1 = 0;
141201   if (PyDict_SetItemString(((PyObject *)__pyx_4), "__doc__", __pyx_kp_111) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141202   __pyx_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_4), __pyx_kp_LxmlRegistryError, "lxml.etree"); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141203   __Pyx_GOTREF(__pyx_3);
141204   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
141205   if (PyObject_SetAttr(__pyx_m, __pyx_kp_LxmlRegistryError, __pyx_3) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141206   __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
141207   __Pyx_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
141208
141209   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":8
141210  *     pass
141211  * 
141212  * class NamespaceRegistryError(LxmlRegistryError):             # <<<<<<<<<<<<<<
141213  *     u"""Error registering a namespace extension.
141214  *     """
141215  */
141216   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141217   __Pyx_GOTREF(((PyObject *)__pyx_1));
141218   __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_LxmlRegistryError); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141219   __Pyx_GOTREF(__pyx_3);
141220   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141221   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
141222   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_3);
141223   __Pyx_GIVEREF(__pyx_3);
141224   __pyx_3 = 0;
141225   if (PyDict_SetItemString(((PyObject *)__pyx_1), "__doc__", __pyx_kp_113) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141226   __pyx_4 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_1), __pyx_kp_112, "lxml.etree"); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141227   __Pyx_GOTREF(__pyx_4);
141228   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
141229   if (PyObject_SetAttr(__pyx_m, __pyx_kp_112, __pyx_4) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141230   __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
141231   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
141232
141233   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/nsclasses.pxi":165
141234  * 
141235  * cdef dict __FUNCTION_NAMESPACE_REGISTRIES
141236  * __FUNCTION_NAMESPACE_REGISTRIES = {}             # <<<<<<<<<<<<<<
141237  * 
141238  * def FunctionNamespace(ns_uri):
141239  */
141240   __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141241   __Pyx_GOTREF(((PyObject *)__pyx_3));
141242   __Pyx_GOTREF(((PyObject *)__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES));
141243   __Pyx_DECREF(((PyObject *)__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES));
141244   __Pyx_GIVEREF(((PyObject *)__pyx_3));
141245   __pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES = __pyx_3;
141246   __pyx_3 = 0;
141247
141248   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":13
141249  * cdef class XMLSchema(_Validator)
141250  * 
141251  * class ParseError(LxmlSyntaxError):             # <<<<<<<<<<<<<<
141252  *     u"""Syntax error while parsing an XML document.
141253  * 
141254  */
141255   __pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141256   __Pyx_GOTREF(((PyObject *)__pyx_4));
141257   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_LxmlSyntaxError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141258   __Pyx_GOTREF(__pyx_1);
141259   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141260   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
141261   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_1);
141262   __Pyx_GIVEREF(__pyx_1);
141263   __pyx_1 = 0;
141264   if (PyDict_SetItemString(((PyObject *)__pyx_4), "__doc__", __pyx_kp_114) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141265   __pyx_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_4), __pyx_kp_ParseError, "lxml.etree"); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141266   __Pyx_GOTREF(__pyx_3);
141267   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
141268   if (PyObject_SetAttr(__pyx_m, __pyx_kp_ParseError, __pyx_3) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141269   __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
141270   __Pyx_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
141271
141272   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":20
141273  *     pass
141274  * 
141275  * class XMLSyntaxError(ParseError):             # <<<<<<<<<<<<<<
141276  *     u"""Syntax error while parsing an XML document.
141277  *     """
141278  */
141279   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141280   __Pyx_GOTREF(((PyObject *)__pyx_1));
141281   __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_ParseError); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141282   __Pyx_GOTREF(__pyx_3);
141283   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141284   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
141285   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_3);
141286   __Pyx_GIVEREF(__pyx_3);
141287   __pyx_3 = 0;
141288   if (PyDict_SetItemString(((PyObject *)__pyx_1), "__doc__", __pyx_kp_115) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141289   __pyx_4 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_1), __pyx_kp_XMLSyntaxError, "lxml.etree"); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141290   __Pyx_GOTREF(__pyx_4);
141291   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
141292
141293   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":23
141294  *     u"""Syntax error while parsing an XML document.
141295  *     """
141296  *     def __init__(self, message, code, line, column):             # <<<<<<<<<<<<<<
141297  *         if python.PY_VERSION_HEX >= 0x02050000:
141298  *             # Python >= 2.5 uses new style class exceptions
141299  */
141300   __pyx_t_4 = PyCFunction_New(&__pyx_mdef_4lxml_5etree_14XMLSyntaxError___init__, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141301   __Pyx_GOTREF(__pyx_t_4);
141302   __pyx_3 = PyMethod_New(__pyx_t_4, 0, __pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141303   __Pyx_GOTREF(__pyx_3);
141304   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
141305   if (PyObject_SetAttr(__pyx_4, __pyx_kp___init__, __pyx_3) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141306   __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
141307   if (PyObject_SetAttr(__pyx_m, __pyx_kp_XMLSyntaxError, __pyx_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141308   __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
141309   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
141310
141311   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":33
141312  * 
141313  * cdef object _XMLSyntaxError
141314  * _XMLSyntaxError = XMLSyntaxError             # <<<<<<<<<<<<<<
141315  * 
141316  * class ParserError(LxmlError):
141317  */
141318   __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_XMLSyntaxError); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141319   __Pyx_GOTREF(__pyx_3);
141320   __Pyx_GOTREF(__pyx_v_4lxml_5etree__XMLSyntaxError);
141321   __Pyx_DECREF(__pyx_v_4lxml_5etree__XMLSyntaxError);
141322   __Pyx_GIVEREF(__pyx_3);
141323   __pyx_v_4lxml_5etree__XMLSyntaxError = __pyx_3;
141324   __pyx_3 = 0;
141325
141326   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":35
141327  * _XMLSyntaxError = XMLSyntaxError
141328  * 
141329  * class ParserError(LxmlError):             # <<<<<<<<<<<<<<
141330  *     u"""Internal lxml parser error.
141331  *     """
141332  */
141333   __pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141334   __Pyx_GOTREF(((PyObject *)__pyx_4));
141335   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_LxmlError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141336   __Pyx_GOTREF(__pyx_1);
141337   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141338   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
141339   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_1);
141340   __Pyx_GIVEREF(__pyx_1);
141341   __pyx_1 = 0;
141342   if (PyDict_SetItemString(((PyObject *)__pyx_4), "__doc__", __pyx_kp_116) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141343   __pyx_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_4), __pyx_kp_ParserError, "lxml.etree"); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141344   __Pyx_GOTREF(__pyx_3);
141345   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
141346   if (PyObject_SetAttr(__pyx_m, __pyx_kp_ParserError, __pyx_3) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141347   __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
141348   __Pyx_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
141349
141350   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":182
141351  * 
141352  * cdef _ParserDictionaryContext __GLOBAL_PARSER_CONTEXT
141353  * __GLOBAL_PARSER_CONTEXT = _ParserDictionaryContext()             # <<<<<<<<<<<<<<
141354  * __GLOBAL_PARSER_CONTEXT.initMainParserContext()
141355  * 
141356  */
141357   __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree__ParserDictionaryContext)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141358   __Pyx_GOTREF(__pyx_t_4);
141359   if (!(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__ParserDictionaryContext))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141360   __Pyx_GOTREF(((PyObject *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT));
141361   __Pyx_DECREF(((PyObject *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT));
141362   __Pyx_GIVEREF(__pyx_t_4);
141363   __pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)__pyx_t_4);
141364   __pyx_t_4 = 0;
141365
141366   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":183
141367  * cdef _ParserDictionaryContext __GLOBAL_PARSER_CONTEXT
141368  * __GLOBAL_PARSER_CONTEXT = _ParserDictionaryContext()
141369  * __GLOBAL_PARSER_CONTEXT.initMainParserContext()             # <<<<<<<<<<<<<<
141370  * 
141371  * cdef int _checkThreadDict(tree.xmlDict* c_dict):
141372  */
141373   ((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initMainParserContext(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT);
141374
141375   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":201
141376  * # name of Python unicode encoding as known to libxml2
141377  * cdef char* _UNICODE_ENCODING
141378  * _UNICODE_ENCODING = NULL             # <<<<<<<<<<<<<<
141379  * 
141380  * cdef void _setupPythonUnicode():
141381  */
141382   __pyx_v_4lxml_5etree__UNICODE_ENCODING = NULL;
141383
141384   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":253
141385  *         return tree.xmlGetCharEncodingName(enc)
141386  * 
141387  * _setupPythonUnicode()             # <<<<<<<<<<<<<<
141388  * 
141389  * ############################################################
141390  */
141391   __pyx_f_4lxml_5etree__setupPythonUnicode();
141392
141393   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":462
141394  * 
141395  * cdef xmlparser.xmlExternalEntityLoader __DEFAULT_ENTITY_LOADER
141396  * __DEFAULT_ENTITY_LOADER = xmlparser.xmlGetExternalEntityLoader()             # <<<<<<<<<<<<<<
141397  * 
141398  * xmlparser.xmlSetExternalEntityLoader(_local_resolver)
141399  */
141400   __pyx_v_4lxml_5etree___DEFAULT_ENTITY_LOADER = xmlGetExternalEntityLoader();
141401
141402   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":464
141403  * __DEFAULT_ENTITY_LOADER = xmlparser.xmlGetExternalEntityLoader()
141404  * 
141405  * xmlparser.xmlSetExternalEntityLoader(_local_resolver)             # <<<<<<<<<<<<<<
141406  * 
141407  * ############################################################
141408  */
141409   xmlSetExternalEntityLoader(__pyx_f_4lxml_5etree__local_resolver);
141410
141411   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1182
141412  *     xmlparser.XML_PARSE_NOCDATA |
141413  *     xmlparser.XML_PARSE_NONET   |
141414  *     xmlparser.XML_PARSE_COMPACT             # <<<<<<<<<<<<<<
141415  *     )
141416  * 
141417  */
141418   __pyx_v_4lxml_5etree__XML_DEFAULT_PARSE_OPTIONS = (((XML_PARSE_NOENT | XML_PARSE_NOCDATA) | XML_PARSE_NONET) | XML_PARSE_COMPACT);
141419
141420   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1229
141421  *     apply to the default parser.
141422  *     """
141423  *     def __init__(self, *, encoding=None, attribute_defaults=False,             # <<<<<<<<<<<<<<
141424  *                  dtd_validation=False, load_dtd=False, no_network=True,
141425  *                  ns_clean=False, recover=False, XMLSchema schema=None,
141426  */
141427   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141428   __Pyx_GOTREF(__pyx_t_4);
141429   __pyx_k_117 = __pyx_t_4;
141430   __pyx_t_4 = 0;
141431   __Pyx_GIVEREF(__pyx_k_117);
141432
141433   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1230
141434  *     """
141435  *     def __init__(self, *, encoding=None, attribute_defaults=False,
141436  *                  dtd_validation=False, load_dtd=False, no_network=True,             # <<<<<<<<<<<<<<
141437  *                  ns_clean=False, recover=False, XMLSchema schema=None,
141438  *                  huge_tree=False, remove_blank_text=False, resolve_entities=True,
141439  */
141440   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141441   __Pyx_GOTREF(__pyx_t_4);
141442   __pyx_k_118 = __pyx_t_4;
141443   __pyx_t_4 = 0;
141444   __Pyx_GIVEREF(__pyx_k_118);
141445   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141446   __Pyx_GOTREF(__pyx_t_4);
141447   __pyx_k_119 = __pyx_t_4;
141448   __pyx_t_4 = 0;
141449   __Pyx_GIVEREF(__pyx_k_119);
141450   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141451   __Pyx_GOTREF(__pyx_t_4);
141452   __pyx_k_120 = __pyx_t_4;
141453   __pyx_t_4 = 0;
141454   __Pyx_GIVEREF(__pyx_k_120);
141455
141456   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1231
141457  *     def __init__(self, *, encoding=None, attribute_defaults=False,
141458  *                  dtd_validation=False, load_dtd=False, no_network=True,
141459  *                  ns_clean=False, recover=False, XMLSchema schema=None,             # <<<<<<<<<<<<<<
141460  *                  huge_tree=False, remove_blank_text=False, resolve_entities=True,
141461  *                  remove_comments=False, remove_pis=False, strip_cdata=True,
141462  */
141463   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141464   __Pyx_GOTREF(__pyx_t_4);
141465   __pyx_k_121 = __pyx_t_4;
141466   __pyx_t_4 = 0;
141467   __Pyx_GIVEREF(__pyx_k_121);
141468   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141469   __Pyx_GOTREF(__pyx_t_4);
141470   __pyx_k_122 = __pyx_t_4;
141471   __pyx_t_4 = 0;
141472   __Pyx_GIVEREF(__pyx_k_122);
141473
141474   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1232
141475  *                  dtd_validation=False, load_dtd=False, no_network=True,
141476  *                  ns_clean=False, recover=False, XMLSchema schema=None,
141477  *                  huge_tree=False, remove_blank_text=False, resolve_entities=True,             # <<<<<<<<<<<<<<
141478  *                  remove_comments=False, remove_pis=False, strip_cdata=True,
141479  *                  target=None, compact=True):
141480  */
141481   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141482   __Pyx_GOTREF(__pyx_t_4);
141483   __pyx_k_123 = __pyx_t_4;
141484   __pyx_t_4 = 0;
141485   __Pyx_GIVEREF(__pyx_k_123);
141486   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141487   __Pyx_GOTREF(__pyx_t_4);
141488   __pyx_k_124 = __pyx_t_4;
141489   __pyx_t_4 = 0;
141490   __Pyx_GIVEREF(__pyx_k_124);
141491   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141492   __Pyx_GOTREF(__pyx_t_4);
141493   __pyx_k_125 = __pyx_t_4;
141494   __pyx_t_4 = 0;
141495   __Pyx_GIVEREF(__pyx_k_125);
141496
141497   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1233
141498  *                  ns_clean=False, recover=False, XMLSchema schema=None,
141499  *                  huge_tree=False, remove_blank_text=False, resolve_entities=True,
141500  *                  remove_comments=False, remove_pis=False, strip_cdata=True,             # <<<<<<<<<<<<<<
141501  *                  target=None, compact=True):
141502  *         cdef int parse_options
141503  */
141504   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141505   __Pyx_GOTREF(__pyx_t_4);
141506   __pyx_k_126 = __pyx_t_4;
141507   __pyx_t_4 = 0;
141508   __Pyx_GIVEREF(__pyx_k_126);
141509   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141510   __Pyx_GOTREF(__pyx_t_4);
141511   __pyx_k_127 = __pyx_t_4;
141512   __pyx_t_4 = 0;
141513   __Pyx_GIVEREF(__pyx_k_127);
141514   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141515   __Pyx_GOTREF(__pyx_t_4);
141516   __pyx_k_128 = __pyx_t_4;
141517   __pyx_t_4 = 0;
141518   __Pyx_GIVEREF(__pyx_k_128);
141519
141520   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1234
141521  *                  huge_tree=False, remove_blank_text=False, resolve_entities=True,
141522  *                  remove_comments=False, remove_pis=False, strip_cdata=True,
141523  *                  target=None, compact=True):             # <<<<<<<<<<<<<<
141524  *         cdef int parse_options
141525  *         parse_options = _XML_DEFAULT_PARSE_OPTIONS
141526  */
141527   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141528   __Pyx_GOTREF(__pyx_t_4);
141529   __pyx_k_129 = __pyx_t_4;
141530   __pyx_t_4 = 0;
141531   __Pyx_GIVEREF(__pyx_k_129);
141532
141533   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1282
141534  *     and thus ignores comments and processing instructions.
141535  *     """
141536  *     def __init__(self, *, encoding=None, attribute_defaults=False,             # <<<<<<<<<<<<<<
141537  *                  dtd_validation=False, load_dtd=False, no_network=True,
141538  *                  ns_clean=False, recover=False, schema=None,
141539  */
141540   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141541   __Pyx_GOTREF(__pyx_t_4);
141542   __pyx_k_130 = __pyx_t_4;
141543   __pyx_t_4 = 0;
141544   __Pyx_GIVEREF(__pyx_k_130);
141545
141546   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1283
141547  *     """
141548  *     def __init__(self, *, encoding=None, attribute_defaults=False,
141549  *                  dtd_validation=False, load_dtd=False, no_network=True,             # <<<<<<<<<<<<<<
141550  *                  ns_clean=False, recover=False, schema=None,
141551  *                  huge_tree=False, remove_blank_text=False, resolve_entities=True,
141552  */
141553   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141554   __Pyx_GOTREF(__pyx_t_4);
141555   __pyx_k_131 = __pyx_t_4;
141556   __pyx_t_4 = 0;
141557   __Pyx_GIVEREF(__pyx_k_131);
141558   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141559   __Pyx_GOTREF(__pyx_t_4);
141560   __pyx_k_132 = __pyx_t_4;
141561   __pyx_t_4 = 0;
141562   __Pyx_GIVEREF(__pyx_k_132);
141563   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141564   __Pyx_GOTREF(__pyx_t_4);
141565   __pyx_k_133 = __pyx_t_4;
141566   __pyx_t_4 = 0;
141567   __Pyx_GIVEREF(__pyx_k_133);
141568
141569   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1284
141570  *     def __init__(self, *, encoding=None, attribute_defaults=False,
141571  *                  dtd_validation=False, load_dtd=False, no_network=True,
141572  *                  ns_clean=False, recover=False, schema=None,             # <<<<<<<<<<<<<<
141573  *                  huge_tree=False, remove_blank_text=False, resolve_entities=True,
141574  *                  remove_comments=True, remove_pis=True, strip_cdata=True,
141575  */
141576   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141577   __Pyx_GOTREF(__pyx_t_4);
141578   __pyx_k_134 = __pyx_t_4;
141579   __pyx_t_4 = 0;
141580   __Pyx_GIVEREF(__pyx_k_134);
141581   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141582   __Pyx_GOTREF(__pyx_t_4);
141583   __pyx_k_135 = __pyx_t_4;
141584   __pyx_t_4 = 0;
141585   __Pyx_GIVEREF(__pyx_k_135);
141586
141587   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1285
141588  *                  dtd_validation=False, load_dtd=False, no_network=True,
141589  *                  ns_clean=False, recover=False, schema=None,
141590  *                  huge_tree=False, remove_blank_text=False, resolve_entities=True,             # <<<<<<<<<<<<<<
141591  *                  remove_comments=True, remove_pis=True, strip_cdata=True,
141592  *                  target=None, compact=True):
141593  */
141594   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141595   __Pyx_GOTREF(__pyx_t_4);
141596   __pyx_k_136 = __pyx_t_4;
141597   __pyx_t_4 = 0;
141598   __Pyx_GIVEREF(__pyx_k_136);
141599   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141600   __Pyx_GOTREF(__pyx_t_4);
141601   __pyx_k_137 = __pyx_t_4;
141602   __pyx_t_4 = 0;
141603   __Pyx_GIVEREF(__pyx_k_137);
141604   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141605   __Pyx_GOTREF(__pyx_t_4);
141606   __pyx_k_138 = __pyx_t_4;
141607   __pyx_t_4 = 0;
141608   __Pyx_GIVEREF(__pyx_k_138);
141609
141610   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1286
141611  *                  ns_clean=False, recover=False, schema=None,
141612  *                  huge_tree=False, remove_blank_text=False, resolve_entities=True,
141613  *                  remove_comments=True, remove_pis=True, strip_cdata=True,             # <<<<<<<<<<<<<<
141614  *                  target=None, compact=True):
141615  *         XMLParser.__init__(self,
141616  */
141617   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141618   __Pyx_GOTREF(__pyx_t_4);
141619   __pyx_k_139 = __pyx_t_4;
141620   __pyx_t_4 = 0;
141621   __Pyx_GIVEREF(__pyx_k_139);
141622   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141623   __Pyx_GOTREF(__pyx_t_4);
141624   __pyx_k_140 = __pyx_t_4;
141625   __pyx_t_4 = 0;
141626   __Pyx_GIVEREF(__pyx_k_140);
141627   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141628   __Pyx_GOTREF(__pyx_t_4);
141629   __pyx_k_141 = __pyx_t_4;
141630   __pyx_t_4 = 0;
141631   __Pyx_GIVEREF(__pyx_k_141);
141632
141633   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1287
141634  *                  huge_tree=False, remove_blank_text=False, resolve_entities=True,
141635  *                  remove_comments=True, remove_pis=True, strip_cdata=True,
141636  *                  target=None, compact=True):             # <<<<<<<<<<<<<<
141637  *         XMLParser.__init__(self,
141638  *                            attribute_defaults=attribute_defaults,
141639  */
141640   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141641   __Pyx_GOTREF(__pyx_t_4);
141642   __pyx_k_142 = __pyx_t_4;
141643   __pyx_t_4 = 0;
141644   __Pyx_GIVEREF(__pyx_k_142);
141645
141646   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1308
141647  * 
141648  * cdef XMLParser __DEFAULT_XML_PARSER
141649  * __DEFAULT_XML_PARSER = XMLParser()             # <<<<<<<<<<<<<<
141650  * 
141651  * __GLOBAL_PARSER_CONTEXT.setDefaultParser(__DEFAULT_XML_PARSER)
141652  */
141653   __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_XMLParser)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141654   __Pyx_GOTREF(__pyx_t_4);
141655   if (!(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree_XMLParser))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141656   __Pyx_GOTREF(((PyObject *)__pyx_v_4lxml_5etree___DEFAULT_XML_PARSER));
141657   __Pyx_DECREF(((PyObject *)__pyx_v_4lxml_5etree___DEFAULT_XML_PARSER));
141658   __Pyx_GIVEREF(__pyx_t_4);
141659   __pyx_v_4lxml_5etree___DEFAULT_XML_PARSER = ((struct __pyx_obj_4lxml_5etree_XMLParser *)__pyx_t_4);
141660   __pyx_t_4 = 0;
141661
141662   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1310
141663  * __DEFAULT_XML_PARSER = XMLParser()
141664  * 
141665  * __GLOBAL_PARSER_CONTEXT.setDefaultParser(__DEFAULT_XML_PARSER)             # <<<<<<<<<<<<<<
141666  * 
141667  * def set_default_parser(_BaseParser parser=None):
141668  */
141669   ((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->setDefaultParser(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_4lxml_5etree___DEFAULT_XML_PARSER));
141670
141671   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1340
141672  *     htmlparser.HTML_PARSE_RECOVER |
141673  *     htmlparser.HTML_PARSE_NONET   |
141674  *     htmlparser.HTML_PARSE_COMPACT             # <<<<<<<<<<<<<<
141675  *     )
141676  * 
141677  */
141678   __pyx_v_4lxml_5etree__HTML_DEFAULT_PARSE_OPTIONS = ((HTML_PARSE_RECOVER | HTML_PARSE_NONET) | HTML_PARSE_COMPACT);
141679
141680   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1375
141681  *     reasons.
141682  *     """
141683  *     def __init__(self, *, encoding=None, remove_blank_text=False,             # <<<<<<<<<<<<<<
141684  *                  remove_comments=False, remove_pis=False, strip_cdata=True,
141685  *                  no_network=True, target=None, XMLSchema schema=None,
141686  */
141687   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141688   __Pyx_GOTREF(__pyx_t_4);
141689   __pyx_k_143 = __pyx_t_4;
141690   __pyx_t_4 = 0;
141691   __Pyx_GIVEREF(__pyx_k_143);
141692
141693   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1376
141694  *     """
141695  *     def __init__(self, *, encoding=None, remove_blank_text=False,
141696  *                  remove_comments=False, remove_pis=False, strip_cdata=True,             # <<<<<<<<<<<<<<
141697  *                  no_network=True, target=None, XMLSchema schema=None,
141698  *                  recover=True, compact=True):
141699  */
141700   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141701   __Pyx_GOTREF(__pyx_t_4);
141702   __pyx_k_144 = __pyx_t_4;
141703   __pyx_t_4 = 0;
141704   __Pyx_GIVEREF(__pyx_k_144);
141705   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141706   __Pyx_GOTREF(__pyx_t_4);
141707   __pyx_k_145 = __pyx_t_4;
141708   __pyx_t_4 = 0;
141709   __Pyx_GIVEREF(__pyx_k_145);
141710   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141711   __Pyx_GOTREF(__pyx_t_4);
141712   __pyx_k_146 = __pyx_t_4;
141713   __pyx_t_4 = 0;
141714   __Pyx_GIVEREF(__pyx_k_146);
141715
141716   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1377
141717  *     def __init__(self, *, encoding=None, remove_blank_text=False,
141718  *                  remove_comments=False, remove_pis=False, strip_cdata=True,
141719  *                  no_network=True, target=None, XMLSchema schema=None,             # <<<<<<<<<<<<<<
141720  *                  recover=True, compact=True):
141721  *         cdef int parse_options
141722  */
141723   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141724   __Pyx_GOTREF(__pyx_t_4);
141725   __pyx_k_147 = __pyx_t_4;
141726   __pyx_t_4 = 0;
141727   __Pyx_GIVEREF(__pyx_k_147);
141728
141729   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1378
141730  *                  remove_comments=False, remove_pis=False, strip_cdata=True,
141731  *                  no_network=True, target=None, XMLSchema schema=None,
141732  *                  recover=True, compact=True):             # <<<<<<<<<<<<<<
141733  *         cdef int parse_options
141734  *         parse_options = _HTML_DEFAULT_PARSE_OPTIONS
141735  */
141736   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141737   __Pyx_GOTREF(__pyx_t_4);
141738   __pyx_k_148 = __pyx_t_4;
141739   __pyx_t_4 = 0;
141740   __Pyx_GIVEREF(__pyx_k_148);
141741   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141742   __Pyx_GOTREF(__pyx_t_4);
141743   __pyx_k_149 = __pyx_t_4;
141744   __pyx_t_4 = 0;
141745   __Pyx_GIVEREF(__pyx_k_149);
141746
141747   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parser.pxi":1395
141748  * 
141749  * cdef HTMLParser __DEFAULT_HTML_PARSER
141750  * __DEFAULT_HTML_PARSER = HTMLParser()             # <<<<<<<<<<<<<<
141751  * 
141752  * ############################################################
141753  */
141754   __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_HTMLParser)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141755   __Pyx_GOTREF(__pyx_t_4);
141756   if (!(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree_HTMLParser))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141757   __Pyx_GOTREF(((PyObject *)__pyx_v_4lxml_5etree___DEFAULT_HTML_PARSER));
141758   __Pyx_DECREF(((PyObject *)__pyx_v_4lxml_5etree___DEFAULT_HTML_PARSER));
141759   __Pyx_GIVEREF(__pyx_t_4);
141760   __pyx_v_4lxml_5etree___DEFAULT_HTML_PARSER = ((struct __pyx_obj_4lxml_5etree_HTMLParser *)__pyx_t_4);
141761   __pyx_t_4 = 0;
141762
141763   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":4
141764  * 
141765  * cdef object inspect_getargspec
141766  * from inspect import getargspec as inspect_getargspec             # <<<<<<<<<<<<<<
141767  * 
141768  * class _TargetParserResult(Exception):
141769  */
141770   __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141771   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
141772   __Pyx_INCREF(__pyx_kp_getargspec);
141773   PyList_SET_ITEM(__pyx_t_4, 0, __pyx_kp_getargspec);
141774   __Pyx_GIVEREF(__pyx_kp_getargspec);
141775   __pyx_1 = __Pyx_Import(__pyx_kp_inspect, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141776   __Pyx_GOTREF(__pyx_1);
141777   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
141778   __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_getargspec); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141779   __Pyx_GOTREF(__pyx_3);
141780   __Pyx_GOTREF(__pyx_v_4lxml_5etree_inspect_getargspec);
141781   __Pyx_DECREF(__pyx_v_4lxml_5etree_inspect_getargspec);
141782   __Pyx_GIVEREF(__pyx_3);
141783   __pyx_v_4lxml_5etree_inspect_getargspec = __pyx_3;
141784   __pyx_3 = 0;
141785   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
141786
141787   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":6
141788  * from inspect import getargspec as inspect_getargspec
141789  * 
141790  * class _TargetParserResult(Exception):             # <<<<<<<<<<<<<<
141791  *     # Admittedly, this is somewhat ugly, but it's the easiest way
141792  *     # to push the Python level parser result through the parser
141793  */
141794   __pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141795   __Pyx_GOTREF(((PyObject *)__pyx_4));
141796   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141797   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
141798   __Pyx_INCREF(__pyx_builtin_Exception);
141799   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_builtin_Exception);
141800   __Pyx_GIVEREF(__pyx_builtin_Exception);
141801   __pyx_1 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_4), __pyx_kp__TargetParserResult, "lxml.etree"); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141802   __Pyx_GOTREF(__pyx_1);
141803   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
141804
141805   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/parsertarget.pxi":10
141806  *     # to push the Python level parser result through the parser
141807  *     # machinery towards the API level functions
141808  *     def __init__(self, result):             # <<<<<<<<<<<<<<
141809  *         self.result = result
141810  * 
141811  */
141812   __pyx_t_4 = PyCFunction_New(&__pyx_mdef_4lxml_5etree_19_TargetParserResult___init__, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141813   __Pyx_GOTREF(__pyx_t_4);
141814   __pyx_3 = PyMethod_New(__pyx_t_4, 0, __pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141815   __Pyx_GOTREF(__pyx_3);
141816   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
141817   if (PyObject_SetAttr(__pyx_1, __pyx_kp___init__, __pyx_3) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141818   __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
141819   if (PyObject_SetAttr(__pyx_m, __pyx_kp__TargetParserResult, __pyx_1) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141820   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
141821   __Pyx_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
141822
141823   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/serializer.pxi":3
141824  * # XML serialization and output functions
141825  * 
141826  * class SerialisationError(LxmlError):             # <<<<<<<<<<<<<<
141827  *     u"""A libxml2 error that occurred during serialisation.
141828  *     """
141829  */
141830   __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141831   __Pyx_GOTREF(((PyObject *)__pyx_3));
141832   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_LxmlError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141833   __Pyx_GOTREF(__pyx_1);
141834   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141835   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
141836   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_1);
141837   __Pyx_GIVEREF(__pyx_1);
141838   __pyx_1 = 0;
141839   if (PyDict_SetItemString(((PyObject *)__pyx_3), "__doc__", __pyx_kp_150) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141840   __pyx_4 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_3), __pyx_kp_SerialisationError, "lxml.etree"); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141841   __Pyx_GOTREF(__pyx_4);
141842   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
141843   if (PyObject_SetAttr(__pyx_m, __pyx_kp_SerialisationError, __pyx_4) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141844   __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
141845   __Pyx_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
141846
141847   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":363
141848  *     cdef int (*_parse_chunk)(xmlparser.xmlParserCtxt* ctxt,
141849  *                              char* chunk, int size, int terminate) nogil
141850  *     def __init__(self, source, events=(u"end",), *, tag=None,             # <<<<<<<<<<<<<<
141851  *                  attribute_defaults=False, dtd_validation=False,
141852  *                  load_dtd=False, no_network=True, remove_blank_text=False,
141853  */
141854   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141855   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
141856   __Pyx_INCREF(((PyObject *)__pyx_kp_151));
141857   PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_151));
141858   __Pyx_GIVEREF(((PyObject *)__pyx_kp_151));
141859   __pyx_k_152 = ((PyObject *)__pyx_t_4);
141860   __pyx_t_4 = 0;
141861   __Pyx_GIVEREF(__pyx_k_152);
141862
141863   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":364
141864  *                              char* chunk, int size, int terminate) nogil
141865  *     def __init__(self, source, events=(u"end",), *, tag=None,
141866  *                  attribute_defaults=False, dtd_validation=False,             # <<<<<<<<<<<<<<
141867  *                  load_dtd=False, no_network=True, remove_blank_text=False,
141868  *                  compact=True, resolve_entities=True, remove_comments=False,
141869  */
141870   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141871   __Pyx_GOTREF(__pyx_t_4);
141872   __pyx_k_153 = __pyx_t_4;
141873   __pyx_t_4 = 0;
141874   __Pyx_GIVEREF(__pyx_k_153);
141875   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141876   __Pyx_GOTREF(__pyx_t_4);
141877   __pyx_k_154 = __pyx_t_4;
141878   __pyx_t_4 = 0;
141879   __Pyx_GIVEREF(__pyx_k_154);
141880
141881   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":365
141882  *     def __init__(self, source, events=(u"end",), *, tag=None,
141883  *                  attribute_defaults=False, dtd_validation=False,
141884  *                  load_dtd=False, no_network=True, remove_blank_text=False,             # <<<<<<<<<<<<<<
141885  *                  compact=True, resolve_entities=True, remove_comments=False,
141886  *                  remove_pis=False, strip_cdata=True, encoding=None,
141887  */
141888   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141889   __Pyx_GOTREF(__pyx_t_4);
141890   __pyx_k_155 = __pyx_t_4;
141891   __pyx_t_4 = 0;
141892   __Pyx_GIVEREF(__pyx_k_155);
141893   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141894   __Pyx_GOTREF(__pyx_t_4);
141895   __pyx_k_156 = __pyx_t_4;
141896   __pyx_t_4 = 0;
141897   __Pyx_GIVEREF(__pyx_k_156);
141898   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141899   __Pyx_GOTREF(__pyx_t_4);
141900   __pyx_k_157 = __pyx_t_4;
141901   __pyx_t_4 = 0;
141902   __Pyx_GIVEREF(__pyx_k_157);
141903
141904   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":366
141905  *                  attribute_defaults=False, dtd_validation=False,
141906  *                  load_dtd=False, no_network=True, remove_blank_text=False,
141907  *                  compact=True, resolve_entities=True, remove_comments=False,             # <<<<<<<<<<<<<<
141908  *                  remove_pis=False, strip_cdata=True, encoding=None,
141909  *                  html=False, huge_tree=False, XMLSchema schema=None):
141910  */
141911   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141912   __Pyx_GOTREF(__pyx_t_4);
141913   __pyx_k_158 = __pyx_t_4;
141914   __pyx_t_4 = 0;
141915   __Pyx_GIVEREF(__pyx_k_158);
141916   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141917   __Pyx_GOTREF(__pyx_t_4);
141918   __pyx_k_159 = __pyx_t_4;
141919   __pyx_t_4 = 0;
141920   __Pyx_GIVEREF(__pyx_k_159);
141921   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141922   __Pyx_GOTREF(__pyx_t_4);
141923   __pyx_k_160 = __pyx_t_4;
141924   __pyx_t_4 = 0;
141925   __Pyx_GIVEREF(__pyx_k_160);
141926
141927   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":367
141928  *                  load_dtd=False, no_network=True, remove_blank_text=False,
141929  *                  compact=True, resolve_entities=True, remove_comments=False,
141930  *                  remove_pis=False, strip_cdata=True, encoding=None,             # <<<<<<<<<<<<<<
141931  *                  html=False, huge_tree=False, XMLSchema schema=None):
141932  *         cdef _IterparseContext context
141933  */
141934   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141935   __Pyx_GOTREF(__pyx_t_4);
141936   __pyx_k_161 = __pyx_t_4;
141937   __pyx_t_4 = 0;
141938   __Pyx_GIVEREF(__pyx_k_161);
141939   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141940   __Pyx_GOTREF(__pyx_t_4);
141941   __pyx_k_162 = __pyx_t_4;
141942   __pyx_t_4 = 0;
141943   __Pyx_GIVEREF(__pyx_k_162);
141944
141945   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":368
141946  *                  compact=True, resolve_entities=True, remove_comments=False,
141947  *                  remove_pis=False, strip_cdata=True, encoding=None,
141948  *                  html=False, huge_tree=False, XMLSchema schema=None):             # <<<<<<<<<<<<<<
141949  *         cdef _IterparseContext context
141950  *         cdef char* c_encoding
141951  */
141952   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141953   __Pyx_GOTREF(__pyx_t_4);
141954   __pyx_k_163 = __pyx_t_4;
141955   __pyx_t_4 = 0;
141956   __Pyx_GIVEREF(__pyx_k_163);
141957   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141958   __Pyx_GOTREF(__pyx_t_4);
141959   __pyx_k_164 = __pyx_t_4;
141960   __pyx_t_4 = 0;
141961   __Pyx_GIVEREF(__pyx_k_164);
141962
141963   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/iterparse.pxi":543
141964  *     cdef char*  _tag_name
141965  * 
141966  *     def __init__(self, element_or_tree, events=(u"end",), tag=None):             # <<<<<<<<<<<<<<
141967  *         cdef _Element root
141968  *         cdef int ns_count
141969  */
141970   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141971   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
141972   __Pyx_INCREF(((PyObject *)__pyx_kp_165));
141973   PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_165));
141974   __Pyx_GIVEREF(((PyObject *)__pyx_kp_165));
141975   __pyx_k_166 = ((PyObject *)__pyx_t_4);
141976   __pyx_t_4 = 0;
141977   __Pyx_GIVEREF(__pyx_k_166);
141978
141979   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xinclude.pxi":5
141980  * cimport xinclude
141981  * 
141982  * class XIncludeError(LxmlError):             # <<<<<<<<<<<<<<
141983  *     u"""Error during XInclude processing.
141984  *     """
141985  */
141986   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141987   __Pyx_GOTREF(((PyObject *)__pyx_1));
141988   __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_LxmlError); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141989   __Pyx_GOTREF(__pyx_4);
141990   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141991   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
141992   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_4);
141993   __Pyx_GIVEREF(__pyx_4);
141994   __pyx_4 = 0;
141995   if (PyDict_SetItemString(((PyObject *)__pyx_1), "__doc__", __pyx_kp_167) < 0) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141996   __pyx_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_1), __pyx_kp_XIncludeError, "lxml.etree"); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
141997   __Pyx_GOTREF(__pyx_3);
141998   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
141999   if (PyObject_SetAttr(__pyx_m, __pyx_kp_XIncludeError, __pyx_3) < 0) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142000   __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
142001   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
142002
142003   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":3
142004  * # support for extension functions in XPath and XSLT
142005  * 
142006  * class XPathError(LxmlError):             # <<<<<<<<<<<<<<
142007  *     u"""Base class of all XPath errors.
142008  *     """
142009  */
142010   __pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142011   __Pyx_GOTREF(((PyObject *)__pyx_4));
142012   __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_LxmlError); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142013   __Pyx_GOTREF(__pyx_3);
142014   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142015   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
142016   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_3);
142017   __Pyx_GIVEREF(__pyx_3);
142018   __pyx_3 = 0;
142019   if (PyDict_SetItemString(((PyObject *)__pyx_4), "__doc__", __pyx_kp_168) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142020   __pyx_1 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_4), __pyx_kp_XPathError, "lxml.etree"); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142021   __Pyx_GOTREF(__pyx_1);
142022   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
142023   if (PyObject_SetAttr(__pyx_m, __pyx_kp_XPathError, __pyx_1) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142024   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
142025   __Pyx_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
142026
142027   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":8
142028  *     pass
142029  * 
142030  * class XPathEvalError(XPathError):             # <<<<<<<<<<<<<<
142031  *     u"""Error during XPath evaluation.
142032  *     """
142033  */
142034   __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142035   __Pyx_GOTREF(((PyObject *)__pyx_3));
142036   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XPathError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142037   __Pyx_GOTREF(__pyx_1);
142038   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142039   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
142040   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_1);
142041   __Pyx_GIVEREF(__pyx_1);
142042   __pyx_1 = 0;
142043   if (PyDict_SetItemString(((PyObject *)__pyx_3), "__doc__", __pyx_kp_169) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142044   __pyx_4 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_3), __pyx_kp_XPathEvalError, "lxml.etree"); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142045   __Pyx_GOTREF(__pyx_4);
142046   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
142047   if (PyObject_SetAttr(__pyx_m, __pyx_kp_XPathEvalError, __pyx_4) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142048   __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
142049   __Pyx_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
142050
142051   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":13
142052  *     pass
142053  * 
142054  * class XPathFunctionError(XPathEvalError):             # <<<<<<<<<<<<<<
142055  *     u"""Internal error looking up an XPath extension function.
142056  *     """
142057  */
142058   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142059   __Pyx_GOTREF(((PyObject *)__pyx_1));
142060   __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_XPathEvalError); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142061   __Pyx_GOTREF(__pyx_4);
142062   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142063   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
142064   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_4);
142065   __Pyx_GIVEREF(__pyx_4);
142066   __pyx_4 = 0;
142067   if (PyDict_SetItemString(((PyObject *)__pyx_1), "__doc__", __pyx_kp_170) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142068   __pyx_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_1), __pyx_kp_XPathFunctionError, "lxml.etree"); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142069   __Pyx_GOTREF(__pyx_3);
142070   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
142071   if (PyObject_SetAttr(__pyx_m, __pyx_kp_XPathFunctionError, __pyx_3) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142072   __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
142073   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
142074
142075   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":18
142076  *     pass
142077  * 
142078  * class XPathResultError(XPathEvalError):             # <<<<<<<<<<<<<<
142079  *     u"""Error handling an XPath result.
142080  *     """
142081  */
142082   __pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142083   __Pyx_GOTREF(((PyObject *)__pyx_4));
142084   __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_XPathEvalError); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142085   __Pyx_GOTREF(__pyx_3);
142086   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142087   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
142088   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_3);
142089   __Pyx_GIVEREF(__pyx_3);
142090   __pyx_3 = 0;
142091   if (PyDict_SetItemString(((PyObject *)__pyx_4), "__doc__", __pyx_kp_171) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142092   __pyx_1 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_4), __pyx_kp_XPathResultError, "lxml.etree"); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142093   __Pyx_GOTREF(__pyx_1);
142094   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
142095   if (PyObject_SetAttr(__pyx_m, __pyx_kp_XPathResultError, __pyx_1) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142096   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
142097   __Pyx_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
142098
142099   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":599
142100  *         return self._parent
142101  * 
142102  * class _ElementStringResult(str):             # <<<<<<<<<<<<<<
142103  *     # we need to use a Python class here, str cannot be C-subclassed
142104  *     # in Pyrex/Cython
142105  */
142106   __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142107   __Pyx_GOTREF(((PyObject *)__pyx_3));
142108   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142109   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
142110   __Pyx_INCREF(((PyObject *)((PyObject*)&PyString_Type)));
142111   PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)((PyObject*)&PyString_Type)));
142112   __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyString_Type)));
142113   __pyx_1 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_3), __pyx_kp_174, "lxml.etree"); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142114   __Pyx_GOTREF(__pyx_1);
142115   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
142116
142117   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/extensions.pxi":602
142118  *     # we need to use a Python class here, str cannot be C-subclassed
142119  *     # in Pyrex/Cython
142120  *     def getparent(self):             # <<<<<<<<<<<<<<
142121  *         return self._parent
142122  * 
142123  */
142124   __pyx_t_4 = PyCFunction_New(&__pyx_mdef_4lxml_5etree_20_ElementStringResult_getparent, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142125   __Pyx_GOTREF(__pyx_t_4);
142126   __pyx_4 = PyMethod_New(__pyx_t_4, 0, __pyx_1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142127   __Pyx_GOTREF(__pyx_4);
142128   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
142129   if (PyObject_SetAttr(__pyx_1, __pyx_kp_getparent, __pyx_4) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142130   __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
142131   if (PyObject_SetAttr(__pyx_m, __pyx_kp_174, __pyx_1) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142132   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
142133   __Pyx_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
142134
142135   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":3
142136  * # XPath evaluation
142137  * 
142138  * class XPathSyntaxError(LxmlSyntaxError, XPathError):             # <<<<<<<<<<<<<<
142139  *     pass
142140  * 
142141  */
142142   __pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142143   __Pyx_GOTREF(((PyObject *)__pyx_4));
142144   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_LxmlSyntaxError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142145   __Pyx_GOTREF(__pyx_1);
142146   __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_XPathError); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142147   __Pyx_GOTREF(__pyx_3);
142148   __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142149   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
142150   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_1);
142151   __Pyx_GIVEREF(__pyx_1);
142152   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_3);
142153   __Pyx_GIVEREF(__pyx_3);
142154   __pyx_1 = 0;
142155   __pyx_3 = 0;
142156   __pyx_1 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_4), __pyx_kp_XPathSyntaxError, "lxml.etree"); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142157   __Pyx_GOTREF(__pyx_1);
142158   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
142159   if (PyObject_SetAttr(__pyx_m, __pyx_kp_XPathSyntaxError, __pyx_1) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142160   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
142161   __Pyx_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
142162
142163   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":11
142164  * cdef object _XPATH_SYNTAX_ERRORS
142165  * _XPATH_SYNTAX_ERRORS = (
142166  *     xmlerror.XML_XPATH_NUMBER_ERROR,             # <<<<<<<<<<<<<<
142167  *     xmlerror.XML_XPATH_UNFINISHED_LITERAL_ERROR,
142168  *     xmlerror.XML_XPATH_VARIABLE_REF_ERROR,
142169  */
142170   __pyx_t_4 = PyInt_FromLong(XML_XPATH_NUMBER_ERROR); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142171   __Pyx_GOTREF(__pyx_t_4);
142172
142173   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":12
142174  * _XPATH_SYNTAX_ERRORS = (
142175  *     xmlerror.XML_XPATH_NUMBER_ERROR,
142176  *     xmlerror.XML_XPATH_UNFINISHED_LITERAL_ERROR,             # <<<<<<<<<<<<<<
142177  *     xmlerror.XML_XPATH_VARIABLE_REF_ERROR,
142178  *     xmlerror.XML_XPATH_INVALID_PREDICATE_ERROR,
142179  */
142180   __pyx_t_2 = PyInt_FromLong(XML_XPATH_UNFINISHED_LITERAL_ERROR); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142181   __Pyx_GOTREF(__pyx_t_2);
142182
142183   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":13
142184  *     xmlerror.XML_XPATH_NUMBER_ERROR,
142185  *     xmlerror.XML_XPATH_UNFINISHED_LITERAL_ERROR,
142186  *     xmlerror.XML_XPATH_VARIABLE_REF_ERROR,             # <<<<<<<<<<<<<<
142187  *     xmlerror.XML_XPATH_INVALID_PREDICATE_ERROR,
142188  *     xmlerror.XML_XPATH_UNCLOSED_ERROR,
142189  */
142190   __pyx_t_1 = PyInt_FromLong(XML_XPATH_VARIABLE_REF_ERROR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142191   __Pyx_GOTREF(__pyx_t_1);
142192
142193   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":14
142194  *     xmlerror.XML_XPATH_UNFINISHED_LITERAL_ERROR,
142195  *     xmlerror.XML_XPATH_VARIABLE_REF_ERROR,
142196  *     xmlerror.XML_XPATH_INVALID_PREDICATE_ERROR,             # <<<<<<<<<<<<<<
142197  *     xmlerror.XML_XPATH_UNCLOSED_ERROR,
142198  *     xmlerror.XML_XPATH_INVALID_CHAR_ERROR
142199  */
142200   __pyx_t_3 = PyInt_FromLong(XML_XPATH_INVALID_PREDICATE_ERROR); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142201   __Pyx_GOTREF(__pyx_t_3);
142202
142203   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":15
142204  *     xmlerror.XML_XPATH_VARIABLE_REF_ERROR,
142205  *     xmlerror.XML_XPATH_INVALID_PREDICATE_ERROR,
142206  *     xmlerror.XML_XPATH_UNCLOSED_ERROR,             # <<<<<<<<<<<<<<
142207  *     xmlerror.XML_XPATH_INVALID_CHAR_ERROR
142208  * )
142209  */
142210   __pyx_t_8 = PyInt_FromLong(XML_XPATH_UNCLOSED_ERROR); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142211   __Pyx_GOTREF(__pyx_t_8);
142212
142213   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":16
142214  *     xmlerror.XML_XPATH_INVALID_PREDICATE_ERROR,
142215  *     xmlerror.XML_XPATH_UNCLOSED_ERROR,
142216  *     xmlerror.XML_XPATH_INVALID_CHAR_ERROR             # <<<<<<<<<<<<<<
142217  * )
142218  * 
142219  */
142220   __pyx_t_7 = PyInt_FromLong(XML_XPATH_INVALID_CHAR_ERROR); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142221   __Pyx_GOTREF(__pyx_t_7);
142222   __pyx_t_9 = PyTuple_New(6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142223   __Pyx_GOTREF(((PyObject *)__pyx_t_9));
142224   PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4);
142225   __Pyx_GIVEREF(__pyx_t_4);
142226   PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2);
142227   __Pyx_GIVEREF(__pyx_t_2);
142228   PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_1);
142229   __Pyx_GIVEREF(__pyx_t_1);
142230   PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_3);
142231   __Pyx_GIVEREF(__pyx_t_3);
142232   PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_8);
142233   __Pyx_GIVEREF(__pyx_t_8);
142234   PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_7);
142235   __Pyx_GIVEREF(__pyx_t_7);
142236   __pyx_t_4 = 0;
142237   __pyx_t_2 = 0;
142238   __pyx_t_1 = 0;
142239   __pyx_t_3 = 0;
142240   __pyx_t_8 = 0;
142241   __pyx_t_7 = 0;
142242   __Pyx_GOTREF(__pyx_v_4lxml_5etree__XPATH_SYNTAX_ERRORS);
142243   __Pyx_DECREF(__pyx_v_4lxml_5etree__XPATH_SYNTAX_ERRORS);
142244   __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
142245   __pyx_v_4lxml_5etree__XPATH_SYNTAX_ERRORS = ((PyObject *)__pyx_t_9);
142246   __pyx_t_9 = 0;
142247
142248   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":21
142249  * cdef object _XPATH_EVAL_ERRORS
142250  * _XPATH_EVAL_ERRORS = (
142251  *     xmlerror.XML_XPATH_UNDEF_VARIABLE_ERROR,             # <<<<<<<<<<<<<<
142252  *     xmlerror.XML_XPATH_UNDEF_PREFIX_ERROR,
142253  *     xmlerror.XML_XPATH_UNKNOWN_FUNC_ERROR,
142254  */
142255   __pyx_t_9 = PyInt_FromLong(XML_XPATH_UNDEF_VARIABLE_ERROR); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142256   __Pyx_GOTREF(__pyx_t_9);
142257
142258   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":22
142259  * _XPATH_EVAL_ERRORS = (
142260  *     xmlerror.XML_XPATH_UNDEF_VARIABLE_ERROR,
142261  *     xmlerror.XML_XPATH_UNDEF_PREFIX_ERROR,             # <<<<<<<<<<<<<<
142262  *     xmlerror.XML_XPATH_UNKNOWN_FUNC_ERROR,
142263  *     xmlerror.XML_XPATH_INVALID_OPERAND,
142264  */
142265   __pyx_t_7 = PyInt_FromLong(XML_XPATH_UNDEF_PREFIX_ERROR); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142266   __Pyx_GOTREF(__pyx_t_7);
142267
142268   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":23
142269  *     xmlerror.XML_XPATH_UNDEF_VARIABLE_ERROR,
142270  *     xmlerror.XML_XPATH_UNDEF_PREFIX_ERROR,
142271  *     xmlerror.XML_XPATH_UNKNOWN_FUNC_ERROR,             # <<<<<<<<<<<<<<
142272  *     xmlerror.XML_XPATH_INVALID_OPERAND,
142273  *     xmlerror.XML_XPATH_INVALID_TYPE,
142274  */
142275   __pyx_t_8 = PyInt_FromLong(XML_XPATH_UNKNOWN_FUNC_ERROR); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142276   __Pyx_GOTREF(__pyx_t_8);
142277
142278   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":24
142279  *     xmlerror.XML_XPATH_UNDEF_PREFIX_ERROR,
142280  *     xmlerror.XML_XPATH_UNKNOWN_FUNC_ERROR,
142281  *     xmlerror.XML_XPATH_INVALID_OPERAND,             # <<<<<<<<<<<<<<
142282  *     xmlerror.XML_XPATH_INVALID_TYPE,
142283  *     xmlerror.XML_XPATH_INVALID_ARITY,
142284  */
142285   __pyx_t_3 = PyInt_FromLong(XML_XPATH_INVALID_OPERAND); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142286   __Pyx_GOTREF(__pyx_t_3);
142287
142288   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":25
142289  *     xmlerror.XML_XPATH_UNKNOWN_FUNC_ERROR,
142290  *     xmlerror.XML_XPATH_INVALID_OPERAND,
142291  *     xmlerror.XML_XPATH_INVALID_TYPE,             # <<<<<<<<<<<<<<
142292  *     xmlerror.XML_XPATH_INVALID_ARITY,
142293  *     xmlerror.XML_XPATH_INVALID_CTXT_SIZE,
142294  */
142295   __pyx_t_1 = PyInt_FromLong(XML_XPATH_INVALID_TYPE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142296   __Pyx_GOTREF(__pyx_t_1);
142297
142298   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":26
142299  *     xmlerror.XML_XPATH_INVALID_OPERAND,
142300  *     xmlerror.XML_XPATH_INVALID_TYPE,
142301  *     xmlerror.XML_XPATH_INVALID_ARITY,             # <<<<<<<<<<<<<<
142302  *     xmlerror.XML_XPATH_INVALID_CTXT_SIZE,
142303  *     xmlerror.XML_XPATH_INVALID_CTXT_POSITION
142304  */
142305   __pyx_t_2 = PyInt_FromLong(XML_XPATH_INVALID_ARITY); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142306   __Pyx_GOTREF(__pyx_t_2);
142307
142308   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":27
142309  *     xmlerror.XML_XPATH_INVALID_TYPE,
142310  *     xmlerror.XML_XPATH_INVALID_ARITY,
142311  *     xmlerror.XML_XPATH_INVALID_CTXT_SIZE,             # <<<<<<<<<<<<<<
142312  *     xmlerror.XML_XPATH_INVALID_CTXT_POSITION
142313  * )
142314  */
142315   __pyx_t_4 = PyInt_FromLong(XML_XPATH_INVALID_CTXT_SIZE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142316   __Pyx_GOTREF(__pyx_t_4);
142317
142318   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":28
142319  *     xmlerror.XML_XPATH_INVALID_ARITY,
142320  *     xmlerror.XML_XPATH_INVALID_CTXT_SIZE,
142321  *     xmlerror.XML_XPATH_INVALID_CTXT_POSITION             # <<<<<<<<<<<<<<
142322  * )
142323  * 
142324  */
142325   __pyx_t_10 = PyInt_FromLong(XML_XPATH_INVALID_CTXT_POSITION); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142326   __Pyx_GOTREF(__pyx_t_10);
142327   __pyx_t_11 = PyTuple_New(8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142328   __Pyx_GOTREF(((PyObject *)__pyx_t_11));
142329   PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9);
142330   __Pyx_GIVEREF(__pyx_t_9);
142331   PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_7);
142332   __Pyx_GIVEREF(__pyx_t_7);
142333   PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_8);
142334   __Pyx_GIVEREF(__pyx_t_8);
142335   PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_3);
142336   __Pyx_GIVEREF(__pyx_t_3);
142337   PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_t_1);
142338   __Pyx_GIVEREF(__pyx_t_1);
142339   PyTuple_SET_ITEM(__pyx_t_11, 5, __pyx_t_2);
142340   __Pyx_GIVEREF(__pyx_t_2);
142341   PyTuple_SET_ITEM(__pyx_t_11, 6, __pyx_t_4);
142342   __Pyx_GIVEREF(__pyx_t_4);
142343   PyTuple_SET_ITEM(__pyx_t_11, 7, __pyx_t_10);
142344   __Pyx_GIVEREF(__pyx_t_10);
142345   __pyx_t_9 = 0;
142346   __pyx_t_7 = 0;
142347   __pyx_t_8 = 0;
142348   __pyx_t_3 = 0;
142349   __pyx_t_1 = 0;
142350   __pyx_t_2 = 0;
142351   __pyx_t_4 = 0;
142352   __pyx_t_10 = 0;
142353   __Pyx_GOTREF(__pyx_v_4lxml_5etree__XPATH_EVAL_ERRORS);
142354   __Pyx_DECREF(__pyx_v_4lxml_5etree__XPATH_EVAL_ERRORS);
142355   __Pyx_GIVEREF(((PyObject *)__pyx_t_11));
142356   __pyx_v_4lxml_5etree__XPATH_EVAL_ERRORS = ((PyObject *)__pyx_t_11);
142357   __pyx_t_11 = 0;
142358
142359   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":97
142360  * 
142361  * cdef bint _XPATH_VERSION_WARNING_REQUIRED
142362  * if _LIBXML_VERSION_INT == 20627:             # <<<<<<<<<<<<<<
142363  *     _XPATH_VERSION_WARNING_REQUIRED = 1
142364  * else:
142365  */
142366   __pyx_t_5 = (__pyx_v_4lxml_5etree__LIBXML_VERSION_INT == 20627);
142367   if (__pyx_t_5) {
142368
142369     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":98
142370  * cdef bint _XPATH_VERSION_WARNING_REQUIRED
142371  * if _LIBXML_VERSION_INT == 20627:
142372  *     _XPATH_VERSION_WARNING_REQUIRED = 1             # <<<<<<<<<<<<<<
142373  * else:
142374  *     _XPATH_VERSION_WARNING_REQUIRED = 0
142375  */
142376     __pyx_v_4lxml_5etree__XPATH_VERSION_WARNING_REQUIRED = 1;
142377     goto __pyx_L44;
142378   }
142379   /*else*/ {
142380
142381     /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":100
142382  *     _XPATH_VERSION_WARNING_REQUIRED = 1
142383  * else:
142384  *     _XPATH_VERSION_WARNING_REQUIRED = 0             # <<<<<<<<<<<<<<
142385  * 
142386  * cdef class _XPathEvaluatorBase:
142387  */
142388     __pyx_v_4lxml_5etree__XPATH_VERSION_WARNING_REQUIRED = 0;
142389   }
142390   __pyx_L44:;
142391
142392   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":239
142393  *     cdef _Element _element
142394  *     def __init__(self, _Element element not None, *, namespaces=None,
142395  *                  extensions=None, regexp=True, smart_strings=True):             # <<<<<<<<<<<<<<
142396  *         cdef xpath.xmlXPathContext* xpathCtxt
142397  *         cdef int ns_register_status
142398  */
142399   __pyx_t_11 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142400   __Pyx_GOTREF(__pyx_t_11);
142401   __pyx_k_175 = __pyx_t_11;
142402   __pyx_t_11 = 0;
142403   __Pyx_GIVEREF(__pyx_k_175);
142404   __pyx_t_11 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142405   __Pyx_GOTREF(__pyx_t_11);
142406   __pyx_k_176 = __pyx_t_11;
142407   __pyx_t_11 = 0;
142408   __Pyx_GIVEREF(__pyx_k_176);
142409
142410   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":310
142411  *     """
142412  *     def __init__(self, _ElementTree etree not None, *, namespaces=None,
142413  *                  extensions=None, regexp=True, smart_strings=True):             # <<<<<<<<<<<<<<
142414  *         XPathElementEvaluator.__init__(
142415  *             self, etree._context_node, namespaces=namespaces,
142416  */
142417   __pyx_t_11 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142418   __Pyx_GOTREF(__pyx_t_11);
142419   __pyx_k_177 = __pyx_t_11;
142420   __pyx_t_11 = 0;
142421   __Pyx_GIVEREF(__pyx_k_177);
142422   __pyx_t_11 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142423   __Pyx_GOTREF(__pyx_t_11);
142424   __pyx_k_178 = __pyx_t_11;
142425   __pyx_t_11 = 0;
142426   __Pyx_GIVEREF(__pyx_k_178);
142427
142428   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":355
142429  * 
142430  * def XPathEvaluator(etree_or_element, *, namespaces=None, extensions=None,
142431  *                    regexp=True, smart_strings=True):             # <<<<<<<<<<<<<<
142432  *     u"""XPathEvaluator(etree_or_element, namespaces=None, extensions=None, regexp=True, smart_strings=True)
142433  * 
142434  */
142435   __pyx_t_11 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142436   __Pyx_GOTREF(__pyx_t_11);
142437   __pyx_k_179 = __pyx_t_11;
142438   __pyx_t_11 = 0;
142439   __Pyx_GIVEREF(__pyx_k_179);
142440   __pyx_t_11 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142441   __Pyx_GOTREF(__pyx_t_11);
142442   __pyx_k_180 = __pyx_t_11;
142443   __pyx_t_11 = 0;
142444   __Pyx_GIVEREF(__pyx_k_180);
142445
142446   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":395
142447  * 
142448  *     def __init__(self, path, *, namespaces=None, extensions=None,
142449  *                  regexp=True, smart_strings=True):             # <<<<<<<<<<<<<<
142450  *         cdef xpath.xmlXPathContext* xpathCtxt
142451  *         _XPathEvaluatorBase.__init__(self, namespaces, extensions,
142452  */
142453   __pyx_t_11 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142454   __Pyx_GOTREF(__pyx_t_11);
142455   __pyx_k_181 = __pyx_t_11;
142456   __pyx_t_11 = 0;
142457   __Pyx_GIVEREF(__pyx_k_181);
142458   __pyx_t_11 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142459   __Pyx_GOTREF(__pyx_t_11);
142460   __pyx_k_182 = __pyx_t_11;
142461   __pyx_t_11 = 0;
142462   __Pyx_GIVEREF(__pyx_k_182);
142463
142464   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":448
142465  * cdef object _replace_strings
142466  * cdef object _find_namespaces
142467  * _replace_strings = re.compile('("[^"]*")|(\'[^\']*\')').sub             # <<<<<<<<<<<<<<
142468  * _find_namespaces = re.compile('({[^}]+})').findall
142469  * 
142470  */
142471   __pyx_t_11 = PyObject_GetAttr(__pyx_v_4lxml_5etree_re, __pyx_kp_compile); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142472   __Pyx_GOTREF(__pyx_t_11);
142473   __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142474   __Pyx_GOTREF(((PyObject *)__pyx_t_10));
142475   __Pyx_INCREF(__pyx_kp_183);
142476   PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_kp_183);
142477   __Pyx_GIVEREF(__pyx_kp_183);
142478   __pyx_t_4 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142479   __Pyx_GOTREF(__pyx_t_4);
142480   __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
142481   __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
142482   __pyx_t_10 = PyObject_GetAttr(__pyx_t_4, __pyx_kp_sub); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142483   __Pyx_GOTREF(__pyx_t_10);
142484   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
142485   __Pyx_GOTREF(__pyx_v_4lxml_5etree__replace_strings);
142486   __Pyx_DECREF(__pyx_v_4lxml_5etree__replace_strings);
142487   __Pyx_GIVEREF(__pyx_t_10);
142488   __pyx_v_4lxml_5etree__replace_strings = __pyx_t_10;
142489   __pyx_t_10 = 0;
142490
142491   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":449
142492  * cdef object _find_namespaces
142493  * _replace_strings = re.compile('("[^"]*")|(\'[^\']*\')').sub
142494  * _find_namespaces = re.compile('({[^}]+})').findall             # <<<<<<<<<<<<<<
142495  * 
142496  * cdef class ETXPath(XPath):
142497  */
142498   __pyx_t_10 = PyObject_GetAttr(__pyx_v_4lxml_5etree_re, __pyx_kp_compile); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142499   __Pyx_GOTREF(__pyx_t_10);
142500   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142501   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
142502   __Pyx_INCREF(__pyx_kp_184);
142503   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_184);
142504   __Pyx_GIVEREF(__pyx_kp_184);
142505   __pyx_t_11 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142506   __Pyx_GOTREF(__pyx_t_11);
142507   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
142508   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
142509   __pyx_t_4 = PyObject_GetAttr(__pyx_t_11, __pyx_kp_findall); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142510   __Pyx_GOTREF(__pyx_t_4);
142511   __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
142512   __Pyx_GOTREF(__pyx_v_4lxml_5etree__find_namespaces);
142513   __Pyx_DECREF(__pyx_v_4lxml_5etree__find_namespaces);
142514   __Pyx_GIVEREF(__pyx_t_4);
142515   __pyx_v_4lxml_5etree__find_namespaces = __pyx_t_4;
142516   __pyx_t_4 = 0;
142517
142518   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xpath.pxi":460
142519  *     you pass ``smart_strings=False``.
142520  *     """
142521  *     def __init__(self, path, *, extensions=None, regexp=True, smart_strings=True):             # <<<<<<<<<<<<<<
142522  *         path, namespaces = self._nsextract_path(path)
142523  *         XPath.__init__(self, path, namespaces=namespaces,
142524  */
142525   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142526   __Pyx_GOTREF(__pyx_t_4);
142527   __pyx_k_185 = __pyx_t_4;
142528   __pyx_t_4 = 0;
142529   __Pyx_GIVEREF(__pyx_k_185);
142530   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142531   __Pyx_GOTREF(__pyx_t_4);
142532   __pyx_k_186 = __pyx_t_4;
142533   __pyx_t_4 = 0;
142534   __Pyx_GIVEREF(__pyx_k_186);
142535
142536   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":5
142537  * cimport xslt
142538  * 
142539  * class XSLTError(LxmlError):             # <<<<<<<<<<<<<<
142540  *     u"""Base class of all XSLT errors.
142541  *     """
142542  */
142543   __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142544   __Pyx_GOTREF(((PyObject *)__pyx_3));
142545   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_LxmlError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142546   __Pyx_GOTREF(__pyx_1);
142547   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142548   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
142549   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_1);
142550   __Pyx_GIVEREF(__pyx_1);
142551   __pyx_1 = 0;
142552   if (PyDict_SetItemString(((PyObject *)__pyx_3), "__doc__", __pyx_kp_187) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142553   __pyx_4 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_3), __pyx_kp_XSLTError, "lxml.etree"); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142554   __Pyx_GOTREF(__pyx_4);
142555   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
142556   if (PyObject_SetAttr(__pyx_m, __pyx_kp_XSLTError, __pyx_4) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142557   __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
142558   __Pyx_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
142559
142560   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":10
142561  *     pass
142562  * 
142563  * class XSLTParseError(XSLTError):             # <<<<<<<<<<<<<<
142564  *     u"""Error parsing a stylesheet document.
142565  *     """
142566  */
142567   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142568   __Pyx_GOTREF(((PyObject *)__pyx_1));
142569   __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_XSLTError); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142570   __Pyx_GOTREF(__pyx_4);
142571   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142572   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
142573   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_4);
142574   __Pyx_GIVEREF(__pyx_4);
142575   __pyx_4 = 0;
142576   if (PyDict_SetItemString(((PyObject *)__pyx_1), "__doc__", __pyx_kp_188) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142577   __pyx_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_1), __pyx_kp_XSLTParseError, "lxml.etree"); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142578   __Pyx_GOTREF(__pyx_3);
142579   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
142580   if (PyObject_SetAttr(__pyx_m, __pyx_kp_XSLTParseError, __pyx_3) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142581   __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
142582   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
142583
142584   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":15
142585  *     pass
142586  * 
142587  * class XSLTApplyError(XSLTError):             # <<<<<<<<<<<<<<
142588  *     u"""Error running an XSL transformation.
142589  *     """
142590  */
142591   __pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142592   __Pyx_GOTREF(((PyObject *)__pyx_4));
142593   __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_XSLTError); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142594   __Pyx_GOTREF(__pyx_3);
142595   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142596   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
142597   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_3);
142598   __Pyx_GIVEREF(__pyx_3);
142599   __pyx_3 = 0;
142600   if (PyDict_SetItemString(((PyObject *)__pyx_4), "__doc__", __pyx_kp_189) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142601   __pyx_1 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_4), __pyx_kp_XSLTApplyError, "lxml.etree"); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142602   __Pyx_GOTREF(__pyx_1);
142603   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
142604   if (PyObject_SetAttr(__pyx_m, __pyx_kp_XSLTApplyError, __pyx_1) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142605   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
142606   __Pyx_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
142607
142608   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":20
142609  *     pass
142610  * 
142611  * class XSLTSaveError(XSLTError):             # <<<<<<<<<<<<<<
142612  *     u"""Error serialising an XSLT result.
142613  *     """
142614  */
142615   __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142616   __Pyx_GOTREF(((PyObject *)__pyx_3));
142617   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XSLTError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142618   __Pyx_GOTREF(__pyx_1);
142619   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142620   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
142621   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_1);
142622   __Pyx_GIVEREF(__pyx_1);
142623   __pyx_1 = 0;
142624   if (PyDict_SetItemString(((PyObject *)__pyx_3), "__doc__", __pyx_kp_190) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142625   __pyx_4 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_3), __pyx_kp_XSLTSaveError, "lxml.etree"); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142626   __Pyx_GOTREF(__pyx_4);
142627   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
142628   if (PyObject_SetAttr(__pyx_m, __pyx_kp_XSLTSaveError, __pyx_4) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142629   __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
142630   __Pyx_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
142631
142632   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":25
142633  *     pass
142634  * 
142635  * class XSLTExtensionError(XSLTError):             # <<<<<<<<<<<<<<
142636  *     u"""Error registering an XSLT extension.
142637  *     """
142638  */
142639   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142640   __Pyx_GOTREF(((PyObject *)__pyx_1));
142641   __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_XSLTError); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142642   __Pyx_GOTREF(__pyx_4);
142643   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142644   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
142645   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_4);
142646   __Pyx_GIVEREF(__pyx_4);
142647   __pyx_4 = 0;
142648   if (PyDict_SetItemString(((PyObject *)__pyx_1), "__doc__", __pyx_kp_191) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142649   __pyx_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_1), __pyx_kp_XSLTExtensionError, "lxml.etree"); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142650   __Pyx_GOTREF(__pyx_3);
142651   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
142652   if (PyObject_SetAttr(__pyx_m, __pyx_kp_XSLTExtensionError, __pyx_3) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142653   __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
142654   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
142655
142656   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":31
142657  * 
142658  * # version information
142659  * LIBXSLT_COMPILED_VERSION = __unpackIntVersion(xslt.LIBXSLT_VERSION)             # <<<<<<<<<<<<<<
142660  * LIBXSLT_VERSION = __unpackIntVersion(xslt.xsltLibxsltVersion)
142661  * 
142662  */
142663   __pyx_t_4 = __pyx_f_4lxml_5etree___unpackIntVersion(LIBXSLT_VERSION); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142664   __Pyx_GOTREF(__pyx_t_4);
142665   if (PyObject_SetAttr(__pyx_m, __pyx_kp_192, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142666   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
142667
142668   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":32
142669  * # version information
142670  * LIBXSLT_COMPILED_VERSION = __unpackIntVersion(xslt.LIBXSLT_VERSION)
142671  * LIBXSLT_VERSION = __unpackIntVersion(xslt.xsltLibxsltVersion)             # <<<<<<<<<<<<<<
142672  * 
142673  * 
142674  */
142675   __pyx_t_4 = __pyx_f_4lxml_5etree___unpackIntVersion(xsltLibxsltVersion); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142676   __Pyx_GOTREF(__pyx_t_4);
142677   if (PyObject_SetAttr(__pyx_m, __pyx_kp_LIBXSLT_VERSION, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142678   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
142679
142680   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":160
142681  * 
142682  * cdef xslt.xsltDocLoaderFunc XSLT_DOC_DEFAULT_LOADER
142683  * XSLT_DOC_DEFAULT_LOADER = xslt.xsltDocDefaultLoader             # <<<<<<<<<<<<<<
142684  * 
142685  * xslt.xsltSetLoaderFunc(_xslt_doc_loader)
142686  */
142687   __pyx_v_4lxml_5etree_XSLT_DOC_DEFAULT_LOADER = xsltDocDefaultLoader;
142688
142689   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":162
142690  * XSLT_DOC_DEFAULT_LOADER = xslt.xsltDocDefaultLoader
142691  * 
142692  * xslt.xsltSetLoaderFunc(_xslt_doc_loader)             # <<<<<<<<<<<<<<
142693  * 
142694  * ################################################################################
142695  */
142696   xsltSetLoaderFunc(__pyx_f_4lxml_5etree__xslt_doc_loader);
142697
142698   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":189
142699  *     """
142700  *     cdef xslt.xsltSecurityPrefs* _prefs
142701  *     def __init__(self, *, read_file=True, write_file=True, create_dir=True,             # <<<<<<<<<<<<<<
142702  *                  read_network=True, write_network=True):
142703  *         self._prefs = xslt.xsltNewSecurityPrefs()
142704  */
142705   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142706   __Pyx_GOTREF(__pyx_t_4);
142707   __pyx_k_193 = __pyx_t_4;
142708   __pyx_t_4 = 0;
142709   __Pyx_GIVEREF(__pyx_k_193);
142710   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142711   __Pyx_GOTREF(__pyx_t_4);
142712   __pyx_k_194 = __pyx_t_4;
142713   __pyx_t_4 = 0;
142714   __Pyx_GIVEREF(__pyx_k_194);
142715   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142716   __Pyx_GOTREF(__pyx_t_4);
142717   __pyx_k_195 = __pyx_t_4;
142718   __pyx_t_4 = 0;
142719   __Pyx_GIVEREF(__pyx_k_195);
142720
142721   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":190
142722  *     cdef xslt.xsltSecurityPrefs* _prefs
142723  *     def __init__(self, *, read_file=True, write_file=True, create_dir=True,
142724  *                  read_network=True, write_network=True):             # <<<<<<<<<<<<<<
142725  *         self._prefs = xslt.xsltNewSecurityPrefs()
142726  *         if self._prefs is NULL:
142727  */
142728   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142729   __Pyx_GOTREF(__pyx_t_4);
142730   __pyx_k_196 = __pyx_t_4;
142731   __pyx_t_4 = 0;
142732   __Pyx_GIVEREF(__pyx_k_196);
142733   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142734   __Pyx_GOTREF(__pyx_t_4);
142735   __pyx_k_197 = __pyx_t_4;
142736   __pyx_t_4 = 0;
142737   __Pyx_GIVEREF(__pyx_k_197);
142738
142739   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":200
142740  *         self._setAccess(xslt.XSLT_SECPREF_WRITE_NETWORK, write_network)
142741  * 
142742  *     DENY_ALL = XSLTAccessControl(             # <<<<<<<<<<<<<<
142743  *         read_file=False, write_file=False, create_dir=False,
142744  *         read_network=False, write_network=False)
142745  */
142746   __pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142747   __Pyx_GOTREF(((PyObject *)__pyx_4));
142748
142749   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":201
142750  * 
142751  *     DENY_ALL = XSLTAccessControl(
142752  *         read_file=False, write_file=False, create_dir=False,             # <<<<<<<<<<<<<<
142753  *         read_network=False, write_network=False)
142754  * 
142755  */
142756   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142757   __Pyx_GOTREF(__pyx_t_4);
142758   if (PyDict_SetItem(__pyx_4, __pyx_kp_read_file, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142759   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
142760   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142761   __Pyx_GOTREF(__pyx_t_4);
142762   if (PyDict_SetItem(__pyx_4, __pyx_kp_write_file, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142763   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
142764   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142765   __Pyx_GOTREF(__pyx_t_4);
142766   if (PyDict_SetItem(__pyx_4, __pyx_kp_create_dir, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142767   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
142768
142769   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":202
142770  *     DENY_ALL = XSLTAccessControl(
142771  *         read_file=False, write_file=False, create_dir=False,
142772  *         read_network=False, write_network=False)             # <<<<<<<<<<<<<<
142773  * 
142774  *     DENY_WRITE = XSLTAccessControl(
142775  */
142776   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142777   __Pyx_GOTREF(__pyx_t_4);
142778   if (PyDict_SetItem(__pyx_4, __pyx_kp_read_network, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142779   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
142780   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142781   __Pyx_GOTREF(__pyx_t_4);
142782   if (PyDict_SetItem(__pyx_4, __pyx_kp_write_network, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142783   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
142784   __pyx_t_4 = PyEval_CallObjectWithKeywords(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_XSLTAccessControl)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_4)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142785   __Pyx_GOTREF(__pyx_t_4);
142786   __Pyx_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
142787   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLTAccessControl->tp_dict, __pyx_kp_DENY_ALL, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142788   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
142789   PyType_Modified(__pyx_ptype_4lxml_5etree_XSLTAccessControl);
142790
142791   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":204
142792  *         read_network=False, write_network=False)
142793  * 
142794  *     DENY_WRITE = XSLTAccessControl(             # <<<<<<<<<<<<<<
142795  *         read_file=True, write_file=False, create_dir=False,
142796  *         read_network=True, write_network=False)
142797  */
142798   __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142799   __Pyx_GOTREF(((PyObject *)__pyx_3));
142800
142801   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":205
142802  * 
142803  *     DENY_WRITE = XSLTAccessControl(
142804  *         read_file=True, write_file=False, create_dir=False,             # <<<<<<<<<<<<<<
142805  *         read_network=True, write_network=False)
142806  * 
142807  */
142808   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142809   __Pyx_GOTREF(__pyx_t_4);
142810   if (PyDict_SetItem(__pyx_3, __pyx_kp_read_file, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142811   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
142812   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142813   __Pyx_GOTREF(__pyx_t_4);
142814   if (PyDict_SetItem(__pyx_3, __pyx_kp_write_file, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142815   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
142816   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142817   __Pyx_GOTREF(__pyx_t_4);
142818   if (PyDict_SetItem(__pyx_3, __pyx_kp_create_dir, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142819   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
142820
142821   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":206
142822  *     DENY_WRITE = XSLTAccessControl(
142823  *         read_file=True, write_file=False, create_dir=False,
142824  *         read_network=True, write_network=False)             # <<<<<<<<<<<<<<
142825  * 
142826  *     def __dealloc__(self):
142827  */
142828   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142829   __Pyx_GOTREF(__pyx_t_4);
142830   if (PyDict_SetItem(__pyx_3, __pyx_kp_read_network, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142831   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
142832   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142833   __Pyx_GOTREF(__pyx_t_4);
142834   if (PyDict_SetItem(__pyx_3, __pyx_kp_write_network, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142835   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
142836   __pyx_t_4 = PyEval_CallObjectWithKeywords(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_XSLTAccessControl)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142837   __Pyx_GOTREF(__pyx_t_4);
142838   __Pyx_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
142839   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLTAccessControl->tp_dict, __pyx_kp_DENY_WRITE, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142840   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
142841   PyType_Modified(__pyx_ptype_4lxml_5etree_XSLTAccessControl);
142842
142843   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":268
142844  *         NULL)
142845  * 
142846  * cdef dict EMPTY_DICT = {}             # <<<<<<<<<<<<<<
142847  * 
142848  * cdef class _XSLTContext(_BaseContext):
142849  */
142850   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142851   __Pyx_GOTREF(((PyObject *)__pyx_1));
142852   __Pyx_GOTREF(((PyObject *)__pyx_v_4lxml_5etree_EMPTY_DICT));
142853   __Pyx_DECREF(((PyObject *)__pyx_v_4lxml_5etree_EMPTY_DICT));
142854   __Pyx_GIVEREF(((PyObject *)__pyx_1));
142855   __pyx_v_4lxml_5etree_EMPTY_DICT = __pyx_1;
142856   __pyx_1 = 0;
142857
142858   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":359
142859  *     cdef _ErrorLog _error_log
142860  * 
142861  *     def __init__(self, xslt_input, *, extensions=None, regexp=True,             # <<<<<<<<<<<<<<
142862  *                  access_control=None):
142863  *         cdef xslt.xsltStylesheet* c_style
142864  */
142865   __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142866   __Pyx_GOTREF(__pyx_t_4);
142867   __pyx_k_198 = __pyx_t_4;
142868   __pyx_t_4 = 0;
142869   __Pyx_GIVEREF(__pyx_k_198);
142870
142871   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":424
142872  * 
142873  *     @classmethod
142874  *     def strparam(_, strval):             # <<<<<<<<<<<<<<
142875  *         u"""strparam(strval)
142876  * 
142877  */
142878   __pyx_4 = __Pyx_GetName((PyObject *)__pyx_ptype_4lxml_5etree_XSLT, __pyx_kp_strparam); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142879   __Pyx_GOTREF(__pyx_4);
142880   __pyx_t_4 = __Pyx_Method_ClassMethod(__pyx_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142881   __Pyx_GOTREF(__pyx_t_4);
142882   __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
142883   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLT->tp_dict, __pyx_kp_strparam, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142884   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
142885   PyType_Modified(__pyx_ptype_4lxml_5etree_XSLT);
142886
142887   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":437
142888  *         return _XSLTQuotedStringParam(strval)
142889  * 
142890  *     def apply(self, _input, *, profile_run=False, **kw):             # <<<<<<<<<<<<<<
142891  *         u"""apply(self, _input,  profile_run=False, **kw)
142892  * 
142893  */
142894   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142895   __Pyx_GOTREF(__pyx_t_4);
142896   __pyx_k_199 = __pyx_t_4;
142897   __pyx_t_4 = 0;
142898   __Pyx_GIVEREF(__pyx_k_199);
142899
142900   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":458
142901  *         return _copyXSLT(self)
142902  * 
142903  *     def __call__(self, _input, *, profile_run=False, **kw):             # <<<<<<<<<<<<<<
142904  *         u"""__call__(self, _input, profile_run=False, **kw)
142905  * 
142906  */
142907   __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142908   __Pyx_GOTREF(__pyx_t_4);
142909   __pyx_k_200 = __pyx_t_4;
142910   __pyx_t_4 = 0;
142911   __Pyx_GIVEREF(__pyx_k_200);
142912
142913   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":782
142914  * # functions like "output" and "write" are a potential security risk, but we
142915  * # rely on the user to configure XSLTAccessControl as needed
142916  * xslt.xsltRegisterAllExtras()             # <<<<<<<<<<<<<<
142917  * 
142918  * # enable EXSLT support for XSLT
142919  */
142920   xsltRegisterAllExtras();
142921
142922   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":785
142923  * 
142924  * # enable EXSLT support for XSLT
142925  * xslt.exsltRegisterAll()             # <<<<<<<<<<<<<<
142926  * 
142927  * 
142928  */
142929   exsltRegisterAll();
142930
142931   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":792
142932  * 
142933  * cdef object _FIND_PI_ATTRIBUTES
142934  * _FIND_PI_ATTRIBUTES = re.compile(ur'\s+(\w+)\s*=\s*["\']([^"\']+)["\']', re.U).findall             # <<<<<<<<<<<<<<
142935  * 
142936  * cdef object _RE_PI_HREF
142937  */
142938   __pyx_t_4 = PyObject_GetAttr(__pyx_v_4lxml_5etree_re, __pyx_kp_compile); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142939   __Pyx_GOTREF(__pyx_t_4);
142940   __pyx_t_11 = PyObject_GetAttr(__pyx_v_4lxml_5etree_re, __pyx_kp_U); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142941   __Pyx_GOTREF(__pyx_t_11);
142942   __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142943   __Pyx_GOTREF(((PyObject *)__pyx_t_10));
142944   __Pyx_INCREF(((PyObject *)__pyx_kp_201));
142945   PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_kp_201));
142946   __Pyx_GIVEREF(((PyObject *)__pyx_kp_201));
142947   PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11);
142948   __Pyx_GIVEREF(__pyx_t_11);
142949   __pyx_t_11 = 0;
142950   __pyx_t_11 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142951   __Pyx_GOTREF(__pyx_t_11);
142952   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
142953   __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
142954   __pyx_t_10 = PyObject_GetAttr(__pyx_t_11, __pyx_kp_findall); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142955   __Pyx_GOTREF(__pyx_t_10);
142956   __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
142957   __Pyx_GOTREF(__pyx_v_4lxml_5etree__FIND_PI_ATTRIBUTES);
142958   __Pyx_DECREF(__pyx_v_4lxml_5etree__FIND_PI_ATTRIBUTES);
142959   __Pyx_GIVEREF(__pyx_t_10);
142960   __pyx_v_4lxml_5etree__FIND_PI_ATTRIBUTES = __pyx_t_10;
142961   __pyx_t_10 = 0;
142962
142963   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":795
142964  * 
142965  * cdef object _RE_PI_HREF
142966  * _RE_PI_HREF = re.compile(ur'\s+href\s*=\s*["\']([^"\']+)["\']')             # <<<<<<<<<<<<<<
142967  * 
142968  * cdef object _FIND_PI_HREF
142969  */
142970   __pyx_t_10 = PyObject_GetAttr(__pyx_v_4lxml_5etree_re, __pyx_kp_compile); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142971   __Pyx_GOTREF(__pyx_t_10);
142972   __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142973   __Pyx_GOTREF(((PyObject *)__pyx_t_11));
142974   __Pyx_INCREF(((PyObject *)__pyx_kp_202));
142975   PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_kp_202));
142976   __Pyx_GIVEREF(((PyObject *)__pyx_kp_202));
142977   __pyx_t_4 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142978   __Pyx_GOTREF(__pyx_t_4);
142979   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
142980   __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
142981   __Pyx_GOTREF(__pyx_v_4lxml_5etree__RE_PI_HREF);
142982   __Pyx_DECREF(__pyx_v_4lxml_5etree__RE_PI_HREF);
142983   __Pyx_GIVEREF(__pyx_t_4);
142984   __pyx_v_4lxml_5etree__RE_PI_HREF = __pyx_t_4;
142985   __pyx_t_4 = 0;
142986
142987   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":798
142988  * 
142989  * cdef object _FIND_PI_HREF
142990  * _FIND_PI_HREF = _RE_PI_HREF.findall             # <<<<<<<<<<<<<<
142991  * 
142992  * cdef object _REPLACE_PI_HREF
142993  */
142994   __pyx_t_4 = PyObject_GetAttr(__pyx_v_4lxml_5etree__RE_PI_HREF, __pyx_kp_findall); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
142995   __Pyx_GOTREF(__pyx_t_4);
142996   __Pyx_GOTREF(__pyx_v_4lxml_5etree__FIND_PI_HREF);
142997   __Pyx_DECREF(__pyx_v_4lxml_5etree__FIND_PI_HREF);
142998   __Pyx_GIVEREF(__pyx_t_4);
142999   __pyx_v_4lxml_5etree__FIND_PI_HREF = __pyx_t_4;
143000   __pyx_t_4 = 0;
143001
143002   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":801
143003  * 
143004  * cdef object _REPLACE_PI_HREF
143005  * _REPLACE_PI_HREF = _RE_PI_HREF.sub             # <<<<<<<<<<<<<<
143006  * 
143007  * cdef XPath __findStylesheetByID
143008  */
143009   __pyx_t_4 = PyObject_GetAttr(__pyx_v_4lxml_5etree__RE_PI_HREF, __pyx_kp_sub); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143010   __Pyx_GOTREF(__pyx_t_4);
143011   __Pyx_GOTREF(__pyx_v_4lxml_5etree__REPLACE_PI_HREF);
143012   __Pyx_DECREF(__pyx_v_4lxml_5etree__REPLACE_PI_HREF);
143013   __Pyx_GIVEREF(__pyx_t_4);
143014   __pyx_v_4lxml_5etree__REPLACE_PI_HREF = __pyx_t_4;
143015   __pyx_t_4 = 0;
143016
143017   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xslt.pxi":804
143018  * 
143019  * cdef XPath __findStylesheetByID
143020  * __findStylesheetByID = None             # <<<<<<<<<<<<<<
143021  * 
143022  * cdef _findStylesheetByID(_Document doc, id):
143023  */
143024   __Pyx_INCREF(Py_None);
143025   __Pyx_GOTREF(((PyObject *)__pyx_v_4lxml_5etree___findStylesheetByID));
143026   __Pyx_DECREF(((PyObject *)__pyx_v_4lxml_5etree___findStylesheetByID));
143027   __Pyx_GIVEREF(Py_None);
143028   __pyx_v_4lxml_5etree___findStylesheetByID = ((struct __pyx_obj_4lxml_5etree_XPath *)Py_None);
143029
143030   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/lxml.etree.pyx":2727
143031  * # Validation
143032  * 
143033  * class DocumentInvalid(LxmlError):             # <<<<<<<<<<<<<<
143034  *     u"""Validation error.
143035  * 
143036  */
143037   __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143038   __Pyx_GOTREF(((PyObject *)__pyx_3));
143039   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_LxmlError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143040   __Pyx_GOTREF(__pyx_1);
143041   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143042   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
143043   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_1);
143044   __Pyx_GIVEREF(__pyx_1);
143045   __pyx_1 = 0;
143046   if (PyDict_SetItemString(((PyObject *)__pyx_3), "__doc__", __pyx_kp_203) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143047   __pyx_4 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_3), __pyx_kp_DocumentInvalid, "lxml.etree"); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143048   __Pyx_GOTREF(__pyx_4);
143049   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
143050   if (PyObject_SetAttr(__pyx_m, __pyx_kp_DocumentInvalid, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143051   __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
143052   __Pyx_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
143053
143054   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":4
143055  * cimport dtdvalid
143056  * 
143057  * class DTDError(LxmlError):             # <<<<<<<<<<<<<<
143058  *     u"""Base class for DTD errors.
143059  *     """
143060  */
143061   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143062   __Pyx_GOTREF(((PyObject *)__pyx_1));
143063   __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_LxmlError); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143064   __Pyx_GOTREF(__pyx_4);
143065   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143066   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
143067   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_4);
143068   __Pyx_GIVEREF(__pyx_4);
143069   __pyx_4 = 0;
143070   if (PyDict_SetItemString(((PyObject *)__pyx_1), "__doc__", __pyx_kp_204) < 0) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143071   __pyx_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_1), __pyx_kp_DTDError, "lxml.etree"); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143072   __Pyx_GOTREF(__pyx_3);
143073   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
143074   if (PyObject_SetAttr(__pyx_m, __pyx_kp_DTDError, __pyx_3) < 0) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143075   __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
143076   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
143077
143078   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":9
143079  *     pass
143080  * 
143081  * class DTDParseError(DTDError):             # <<<<<<<<<<<<<<
143082  *     u"""Error while parsing a DTD.
143083  *     """
143084  */
143085   __pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143086   __Pyx_GOTREF(((PyObject *)__pyx_4));
143087   __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_DTDError); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143088   __Pyx_GOTREF(__pyx_3);
143089   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143090   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
143091   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_3);
143092   __Pyx_GIVEREF(__pyx_3);
143093   __pyx_3 = 0;
143094   if (PyDict_SetItemString(((PyObject *)__pyx_4), "__doc__", __pyx_kp_205) < 0) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143095   __pyx_1 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_4), __pyx_kp_DTDParseError, "lxml.etree"); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143096   __Pyx_GOTREF(__pyx_1);
143097   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
143098   if (PyObject_SetAttr(__pyx_m, __pyx_kp_DTDParseError, __pyx_1) < 0) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143099   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
143100   __Pyx_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
143101
143102   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/dtd.pxi":14
143103  *     pass
143104  * 
143105  * class DTDValidateError(DTDError):             # <<<<<<<<<<<<<<
143106  *     u"""Error while validating an XML document with a DTD.
143107  *     """
143108  */
143109   __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143110   __Pyx_GOTREF(((PyObject *)__pyx_3));
143111   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_DTDError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143112   __Pyx_GOTREF(__pyx_1);
143113   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143114   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
143115   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_1);
143116   __Pyx_GIVEREF(__pyx_1);
143117   __pyx_1 = 0;
143118   if (PyDict_SetItemString(((PyObject *)__pyx_3), "__doc__", __pyx_kp_206) < 0) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143119   __pyx_4 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_3), __pyx_kp_DTDValidateError, "lxml.etree"); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143120   __Pyx_GOTREF(__pyx_4);
143121   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
143122   if (PyObject_SetAttr(__pyx_m, __pyx_kp_DTDValidateError, __pyx_4) < 0) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143123   __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
143124   __Pyx_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
143125
143126   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":4
143127  * cimport relaxng
143128  * 
143129  * class RelaxNGError(LxmlError):             # <<<<<<<<<<<<<<
143130  *     u"""Base class for RelaxNG errors.
143131  *     """
143132  */
143133   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143134   __Pyx_GOTREF(((PyObject *)__pyx_1));
143135   __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_LxmlError); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143136   __Pyx_GOTREF(__pyx_4);
143137   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143138   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
143139   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_4);
143140   __Pyx_GIVEREF(__pyx_4);
143141   __pyx_4 = 0;
143142   if (PyDict_SetItemString(((PyObject *)__pyx_1), "__doc__", __pyx_kp_207) < 0) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143143   __pyx_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_1), __pyx_kp_RelaxNGError, "lxml.etree"); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143144   __Pyx_GOTREF(__pyx_3);
143145   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
143146   if (PyObject_SetAttr(__pyx_m, __pyx_kp_RelaxNGError, __pyx_3) < 0) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143147   __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
143148   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
143149
143150   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":9
143151  *     pass
143152  * 
143153  * class RelaxNGParseError(RelaxNGError):             # <<<<<<<<<<<<<<
143154  *     u"""Error while parsing an XML document as RelaxNG.
143155  *     """
143156  */
143157   __pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143158   __Pyx_GOTREF(((PyObject *)__pyx_4));
143159   __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_RelaxNGError); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143160   __Pyx_GOTREF(__pyx_3);
143161   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143162   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
143163   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_3);
143164   __Pyx_GIVEREF(__pyx_3);
143165   __pyx_3 = 0;
143166   if (PyDict_SetItemString(((PyObject *)__pyx_4), "__doc__", __pyx_kp_208) < 0) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143167   __pyx_1 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_4), __pyx_kp_RelaxNGParseError, "lxml.etree"); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143168   __Pyx_GOTREF(__pyx_1);
143169   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
143170   if (PyObject_SetAttr(__pyx_m, __pyx_kp_RelaxNGParseError, __pyx_1) < 0) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143171   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
143172   __Pyx_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
143173
143174   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/relaxng.pxi":14
143175  *     pass
143176  * 
143177  * class RelaxNGValidateError(RelaxNGError):             # <<<<<<<<<<<<<<
143178  *     u"""Error while validating an XML document with a RelaxNG schema.
143179  *     """
143180  */
143181   __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143182   __Pyx_GOTREF(((PyObject *)__pyx_3));
143183   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_RelaxNGError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143184   __Pyx_GOTREF(__pyx_1);
143185   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143186   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
143187   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_1);
143188   __Pyx_GIVEREF(__pyx_1);
143189   __pyx_1 = 0;
143190   if (PyDict_SetItemString(((PyObject *)__pyx_3), "__doc__", __pyx_kp_210) < 0) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143191   __pyx_4 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_3), __pyx_kp_209, "lxml.etree"); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143192   __Pyx_GOTREF(__pyx_4);
143193   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
143194   if (PyObject_SetAttr(__pyx_m, __pyx_kp_209, __pyx_4) < 0) {__pyx_filename = __pyx_f[21]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143195   __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
143196   __Pyx_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
143197
143198   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":4
143199  * cimport xmlschema
143200  * 
143201  * class XMLSchemaError(LxmlError):             # <<<<<<<<<<<<<<
143202  *     u"""Base class of all XML Schema errors
143203  *     """
143204  */
143205   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143206   __Pyx_GOTREF(((PyObject *)__pyx_1));
143207   __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_LxmlError); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143208   __Pyx_GOTREF(__pyx_4);
143209   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143210   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
143211   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_4);
143212   __Pyx_GIVEREF(__pyx_4);
143213   __pyx_4 = 0;
143214   if (PyDict_SetItemString(((PyObject *)__pyx_1), "__doc__", __pyx_kp_211) < 0) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143215   __pyx_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_1), __pyx_kp_XMLSchemaError, "lxml.etree"); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143216   __Pyx_GOTREF(__pyx_3);
143217   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
143218   if (PyObject_SetAttr(__pyx_m, __pyx_kp_XMLSchemaError, __pyx_3) < 0) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143219   __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
143220   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
143221
143222   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":9
143223  *     pass
143224  * 
143225  * class XMLSchemaParseError(XMLSchemaError):             # <<<<<<<<<<<<<<
143226  *     u"""Error while parsing an XML document as XML Schema.
143227  *     """
143228  */
143229   __pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143230   __Pyx_GOTREF(((PyObject *)__pyx_4));
143231   __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_XMLSchemaError); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143232   __Pyx_GOTREF(__pyx_3);
143233   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143234   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
143235   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_3);
143236   __Pyx_GIVEREF(__pyx_3);
143237   __pyx_3 = 0;
143238   if (PyDict_SetItemString(((PyObject *)__pyx_4), "__doc__", __pyx_kp_212) < 0) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143239   __pyx_1 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_4), __pyx_kp_XMLSchemaParseError, "lxml.etree"); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143240   __Pyx_GOTREF(__pyx_1);
143241   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
143242   if (PyObject_SetAttr(__pyx_m, __pyx_kp_XMLSchemaParseError, __pyx_1) < 0) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143243   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
143244   __Pyx_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
143245
143246   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":14
143247  *     pass
143248  * 
143249  * class XMLSchemaValidateError(XMLSchemaError):             # <<<<<<<<<<<<<<
143250  *     u"""Error while validating an XML document with an XML Schema.
143251  *     """
143252  */
143253   __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143254   __Pyx_GOTREF(((PyObject *)__pyx_3));
143255   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_XMLSchemaError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143256   __Pyx_GOTREF(__pyx_1);
143257   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143258   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
143259   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_1);
143260   __Pyx_GIVEREF(__pyx_1);
143261   __pyx_1 = 0;
143262   if (PyDict_SetItemString(((PyObject *)__pyx_3), "__doc__", __pyx_kp_214) < 0) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143263   __pyx_4 = __Pyx_CreateClass(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_3), __pyx_kp_213, "lxml.etree"); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143264   __Pyx_GOTREF(__pyx_4);
143265   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
143266   if (PyObject_SetAttr(__pyx_m, __pyx_kp_213, __pyx_4) < 0) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143267   __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
143268   __Pyx_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
143269
143270   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":23
143271  * 
143272  * cdef XPath _check_for_default_attributes = XPath(
143273  *     u"boolean(//xs:attribute[@default or @fixed][1])",             # <<<<<<<<<<<<<<
143274  *     namespaces={u'xs': u'http://www.w3.org/2001/XMLSchema'})
143275  * 
143276  */
143277   __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143278   __Pyx_GOTREF(((PyObject *)__pyx_t_4));
143279   __Pyx_INCREF(((PyObject *)__pyx_kp_215));
143280   PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_215));
143281   __Pyx_GIVEREF(((PyObject *)__pyx_kp_215));
143282   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143283   __Pyx_GOTREF(((PyObject *)__pyx_1));
143284
143285   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":24
143286  * cdef XPath _check_for_default_attributes = XPath(
143287  *     u"boolean(//xs:attribute[@default or @fixed][1])",
143288  *     namespaces={u'xs': u'http://www.w3.org/2001/XMLSchema'})             # <<<<<<<<<<<<<<
143289  * 
143290  * cdef class XMLSchema(_Validator):
143291  */
143292   __pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143293   __Pyx_GOTREF(((PyObject *)__pyx_4));
143294   if (PyDict_SetItem(__pyx_4, ((PyObject *)__pyx_kp_216), ((PyObject *)__pyx_kp_217)) < 0) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143295   if (PyDict_SetItem(__pyx_1, __pyx_kp_namespaces, ((PyObject *)__pyx_4)) < 0) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143296   __Pyx_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
143297   __pyx_t_11 = PyEval_CallObjectWithKeywords(((PyObject *)((PyObject*)__pyx_ptype_4lxml_5etree_XPath)), ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143298   __Pyx_GOTREF(__pyx_t_11);
143299   __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
143300   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
143301   if (!(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_4lxml_5etree_XPath))) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143302   __Pyx_GOTREF(((PyObject *)__pyx_v_4lxml_5etree__check_for_default_attributes));
143303   __Pyx_DECREF(((PyObject *)__pyx_v_4lxml_5etree__check_for_default_attributes));
143304   __Pyx_GIVEREF(__pyx_t_11);
143305   __pyx_v_4lxml_5etree__check_for_default_attributes = ((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_t_11);
143306   __pyx_t_11 = 0;
143307
143308   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/xmlschema.pxi":40
143309  *     cdef bint _add_attribute_defaults
143310  * 
143311  *     def __init__(self, etree=None, *, file=None, attribute_defaults=False):             # <<<<<<<<<<<<<<
143312  *         cdef _Document doc
143313  *         cdef _Element root_node
143314  */
143315   __pyx_t_11 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[22]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143316   __Pyx_GOTREF(__pyx_t_11);
143317   __pyx_k_218 = __pyx_t_11;
143318   __pyx_t_11 = 0;
143319   __Pyx_GIVEREF(__pyx_k_218);
143320
143321   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":4
143322  * cimport schematron
143323  * 
143324  * class SchematronError(LxmlError):             # <<<<<<<<<<<<<<
143325  *     u"""Base class of all Schematron errors.
143326  *     """
143327  */
143328   __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143329   __Pyx_GOTREF(((PyObject *)__pyx_3));
143330   __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_kp_LxmlError); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143331   __Pyx_GOTREF(__pyx_4);
143332   __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143333   __Pyx_GOTREF(((PyObject *)__pyx_t_11));
143334   PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_4);
143335   __Pyx_GIVEREF(__pyx_4);
143336   __pyx_4 = 0;
143337   if (PyDict_SetItemString(((PyObject *)__pyx_3), "__doc__", __pyx_kp_219) < 0) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143338   __pyx_1 = __Pyx_CreateClass(((PyObject *)__pyx_t_11), ((PyObject *)__pyx_3), __pyx_kp_SchematronError, "lxml.etree"); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143339   __Pyx_GOTREF(__pyx_1);
143340   __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
143341   if (PyObject_SetAttr(__pyx_m, __pyx_kp_SchematronError, __pyx_1) < 0) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143342   __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
143343   __Pyx_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
143344
143345   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":9
143346  *     pass
143347  * 
143348  * class SchematronParseError(SchematronError):             # <<<<<<<<<<<<<<
143349  *     u"""Error while parsing an XML document as Schematron schema.
143350  *     """
143351  */
143352   __pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143353   __Pyx_GOTREF(((PyObject *)__pyx_4));
143354   __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_SchematronError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143355   __Pyx_GOTREF(__pyx_1);
143356   __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143357   __Pyx_GOTREF(((PyObject *)__pyx_t_11));
143358   PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_1);
143359   __Pyx_GIVEREF(__pyx_1);
143360   __pyx_1 = 0;
143361   if (PyDict_SetItemString(((PyObject *)__pyx_4), "__doc__", __pyx_kp_221) < 0) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143362   __pyx_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_11), ((PyObject *)__pyx_4), __pyx_kp_220, "lxml.etree"); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143363   __Pyx_GOTREF(__pyx_3);
143364   __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
143365   if (PyObject_SetAttr(__pyx_m, __pyx_kp_220, __pyx_3) < 0) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143366   __Pyx_DECREF(__pyx_3); __pyx_3 = 0;
143367   __Pyx_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
143368
143369   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/schematron.pxi":14
143370  *     pass
143371  * 
143372  * class SchematronValidateError(SchematronError):             # <<<<<<<<<<<<<<
143373  *     u"""Error while validating an XML document with a Schematron schema.
143374  *     """
143375  */
143376   __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143377   __Pyx_GOTREF(((PyObject *)__pyx_1));
143378   __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_kp_SchematronError); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143379   __Pyx_GOTREF(__pyx_3);
143380   __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143381   __Pyx_GOTREF(((PyObject *)__pyx_t_11));
143382   PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_3);
143383   __Pyx_GIVEREF(__pyx_3);
143384   __pyx_3 = 0;
143385   if (PyDict_SetItemString(((PyObject *)__pyx_1), "__doc__", __pyx_kp_223) < 0) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143386   __pyx_4 = __Pyx_CreateClass(((PyObject *)__pyx_t_11), ((PyObject *)__pyx_1), __pyx_kp_222, "lxml.etree"); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143387   __Pyx_GOTREF(__pyx_4);
143388   __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
143389   if (PyObject_SetAttr(__pyx_m, __pyx_kp_222, __pyx_4) < 0) {__pyx_filename = __pyx_f[23]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
143390   __Pyx_DECREF(__pyx_4); __pyx_4 = 0;
143391   __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
143392
143393   /* "/home/sbehnel/source/Python/lxml/lxml-2.2/src/lxml/c14n.pxd":1
143394  * from tree cimport xmlDoc, xmlOutputBuffer             # <<<<<<<<<<<<<<
143395  * from xpath cimport xmlNodeSet
143396  * 
143397  */
143398   goto __pyx_L0;
143399   __pyx_L1_error:;
143400   __Pyx_XDECREF(__pyx_1);
143401   __Pyx_XDECREF(__pyx_3);
143402   __Pyx_XDECREF(__pyx_4);
143403   __Pyx_XDECREF(__pyx_t_1);
143404   __Pyx_XDECREF(__pyx_t_2);
143405   __Pyx_XDECREF(__pyx_t_3);
143406   __Pyx_XDECREF(__pyx_t_4);
143407   __Pyx_XDECREF(__pyx_t_7);
143408   __Pyx_XDECREF(__pyx_t_8);
143409   __Pyx_XDECREF(__pyx_t_9);
143410   __Pyx_XDECREF(__pyx_t_10);
143411   __Pyx_XDECREF(__pyx_t_11);
143412   if (__pyx_m) {
143413     __Pyx_AddTraceback("init lxml.etree");
143414     Py_DECREF(__pyx_m); __pyx_m = 0;
143415   } else if (!PyErr_Occurred()) {
143416     PyErr_SetString(PyExc_ImportError, "init lxml.etree");
143417   }
143418   __pyx_L0:;
143419   __Pyx_FinishRefcountContext();
143420   #if PY_MAJOR_VERSION < 3
143421   return;
143422   #else
143423   return __pyx_m;
143424   #endif
143425 }
143426
143427 static const char *__pyx_filenames[] = {
143428   "lxml.etree.pyx",
143429   "apihelpers.pxi",
143430   "parser.pxi",
143431   "serializer.pxi",
143432   "cleanup.pxi",
143433   "extensions.pxi",
143434   "proxy.pxi",
143435   "xmlerror.pxi",
143436   "readonlytree.pxi",
143437   "classlookup.pxi",
143438   "nsclasses.pxi",
143439   "docloader.pxi",
143440   "saxparser.pxi",
143441   "parsertarget.pxi",
143442   "iterparse.pxi",
143443   "xmlid.pxi",
143444   "xinclude.pxi",
143445   "xpath.pxi",
143446   "xslt.pxi",
143447   "xsltext.pxi",
143448   "dtd.pxi",
143449   "relaxng.pxi",
143450   "xmlschema.pxi",
143451   "schematron.pxi",
143452   "public-api.pxi",
143453   "python.pxd",
143454 };
143455
143456 /* Runtime support code */
143457
143458 static void __pyx_init_filenames(void) {
143459   __pyx_f = __pyx_filenames;
143460 }
143461
143462 static void __Pyx_RaiseDoubleKeywordsError(
143463     const char* func_name,
143464     PyObject* kw_name)
143465 {
143466     PyErr_Format(PyExc_TypeError,
143467         #if PY_MAJOR_VERSION >= 3
143468         "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
143469         #else
143470         "%s() got multiple values for keyword argument '%s'", func_name,
143471         PyString_AS_STRING(kw_name));
143472         #endif
143473 }
143474
143475 static void __Pyx_RaiseArgtupleInvalid(
143476     const char* func_name,
143477     int exact,
143478     Py_ssize_t num_min,
143479     Py_ssize_t num_max,
143480     Py_ssize_t num_found)
143481 {
143482     Py_ssize_t num_expected;
143483     const char *number, *more_or_less;
143484
143485     if (num_found < num_min) {
143486         num_expected = num_min;
143487         more_or_less = "at least";
143488     } else {
143489         num_expected = num_max;
143490         more_or_less = "at most";
143491     }
143492     if (exact) {
143493         more_or_less = "exactly";
143494     }
143495     number = (num_expected == 1) ? "" : "s";
143496     PyErr_Format(PyExc_TypeError,
143497         #if PY_VERSION_HEX < 0x02050000
143498             "%s() takes %s %d positional argument%s (%d given)",
143499         #else
143500             "%s() takes %s %zd positional argument%s (%zd given)",
143501         #endif
143502         func_name, more_or_less, num_expected, number, num_found);
143503 }
143504
143505 static int __Pyx_ParseOptionalKeywords(
143506     PyObject *kwds,
143507     PyObject **argnames[],
143508     PyObject *kwds2,
143509     PyObject *values[],
143510     Py_ssize_t num_pos_args,
143511     const char* function_name)
143512 {
143513     PyObject *key = 0, *value = 0;
143514     Py_ssize_t pos = 0;
143515     PyObject*** name;
143516     PyObject*** first_kw_arg = argnames + num_pos_args;
143517
143518     while (PyDict_Next(kwds, &pos, &key, &value)) {
143519         name = first_kw_arg;
143520         while (*name && (**name != key)) name++;
143521         if (*name) {
143522             values[name-argnames] = value;
143523         } else {
143524             #if PY_MAJOR_VERSION < 3
143525             if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
143526             #else
143527             if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) {
143528             #endif
143529                 goto invalid_keyword_type;
143530             } else {
143531                 for (name = first_kw_arg; *name; name++) {
143532                     #if PY_MAJOR_VERSION >= 3
143533                     if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
143534                         PyUnicode_Compare(**name, key) == 0) break;
143535                     #else
143536                     if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
143537                         _PyString_Eq(**name, key)) break;
143538                     #endif
143539                 }
143540                 if (*name) {
143541                     values[name-argnames] = value;
143542                 } else {
143543                     /* unexpected keyword found */
143544                     for (name=argnames; name != first_kw_arg; name++) {
143545                         if (**name == key) goto arg_passed_twice;
143546                         #if PY_MAJOR_VERSION >= 3
143547                         if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
143548                             PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
143549                         #else
143550                         if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
143551                             _PyString_Eq(**name, key)) goto arg_passed_twice;
143552                         #endif
143553                     }
143554                     if (kwds2) {
143555                         if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
143556                     } else {
143557                         goto invalid_keyword;
143558                     }
143559                 }
143560             }
143561         }
143562     }
143563     return 0;
143564 arg_passed_twice:
143565     __Pyx_RaiseDoubleKeywordsError(function_name, **name);
143566     goto bad;
143567 invalid_keyword_type:
143568     PyErr_Format(PyExc_TypeError,
143569         "%s() keywords must be strings", function_name);
143570     goto bad;
143571 invalid_keyword:
143572     PyErr_Format(PyExc_TypeError,
143573     #if PY_MAJOR_VERSION < 3
143574         "%s() got an unexpected keyword argument '%s'",
143575         function_name, PyString_AsString(key));
143576     #else
143577         "%s() got an unexpected keyword argument '%U'",
143578         function_name, key);
143579     #endif
143580 bad:
143581     return -1;
143582 }
143583
143584 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
143585     PyObject *tmp_type, *tmp_value, *tmp_tb;
143586     PyThreadState *tstate = PyThreadState_GET();
143587     *type = tstate->curexc_type;
143588     *value = tstate->curexc_value;
143589     *tb = tstate->curexc_traceback;
143590     tstate->curexc_type = 0;
143591     tstate->curexc_value = 0;
143592     tstate->curexc_traceback = 0;
143593     PyErr_NormalizeException(type, value, tb);
143594     if (PyErr_Occurred())
143595         goto bad;
143596     Py_INCREF(*type);
143597     Py_INCREF(*value);
143598     Py_INCREF(*tb);
143599     tmp_type = tstate->exc_type;
143600     tmp_value = tstate->exc_value;
143601     tmp_tb = tstate->exc_traceback;
143602     tstate->exc_type = *type;
143603     tstate->exc_value = *value;
143604     tstate->exc_traceback = *tb;
143605     /* Make sure tstate is in a consistent state when we XDECREF
143606     these objects (XDECREF may run arbitrary code). */
143607     Py_XDECREF(tmp_type);
143608     Py_XDECREF(tmp_value);
143609     Py_XDECREF(tmp_tb);
143610     return 0;
143611 bad:
143612     Py_XDECREF(*type);
143613     Py_XDECREF(*value);
143614     Py_XDECREF(*tb);
143615     return -1;
143616 }
143617
143618
143619 static INLINE int __Pyx_CheckKeywordStrings(
143620     PyObject *kwdict,
143621     const char* function_name,
143622     int kw_allowed)
143623 {
143624     PyObject* key = 0;
143625     Py_ssize_t pos = 0;
143626     while (PyDict_Next(kwdict, &pos, &key, 0)) {
143627         #if PY_MAJOR_VERSION < 3
143628         if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
143629         #else
143630         if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key)))
143631         #endif
143632             goto invalid_keyword_type;
143633     }
143634     if ((!kw_allowed) && unlikely(key))
143635         goto invalid_keyword;
143636     return 1;
143637 invalid_keyword_type:
143638     PyErr_Format(PyExc_TypeError,
143639         "%s() keywords must be strings", function_name);
143640     return 0;
143641 invalid_keyword:
143642     PyErr_Format(PyExc_TypeError,
143643     #if PY_MAJOR_VERSION < 3
143644         "%s() got an unexpected keyword argument '%s'",
143645         function_name, PyString_AsString(key));
143646     #else
143647         "%s() got an unexpected keyword argument '%U'",
143648         function_name, key);
143649     #endif
143650     return 0;
143651 }
143652
143653 static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
143654     if (!type) {
143655         PyErr_Format(PyExc_SystemError, "Missing type object");
143656         return 0;
143657     }
143658     if (obj == Py_None || PyObject_TypeCheck(obj, type))
143659         return 1;
143660     PyErr_Format(PyExc_TypeError, "Cannot convert %s to %s",
143661         Py_TYPE(obj)->tp_name, type->tp_name);
143662     return 0;
143663 }
143664
143665 static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
143666     PyObject *tmp_type, *tmp_value, *tmp_tb;
143667     PyThreadState *tstate = PyThreadState_GET();
143668
143669 #if PY_MAJOR_VERSION >= 3
143670     /* Note: this is a temporary work-around to prevent crashes in Python 3.0 */
143671     if ((tstate->exc_type != NULL) & (tstate->exc_type != Py_None)) {
143672         tmp_type = tstate->exc_type;
143673         tmp_value = tstate->exc_value;
143674         tmp_tb = tstate->exc_traceback;
143675         PyErr_NormalizeException(&type, &value, &tb);
143676         PyErr_NormalizeException(&tmp_type, &tmp_value, &tmp_tb);
143677         tstate->exc_type = 0;
143678         tstate->exc_value = 0;
143679         tstate->exc_traceback = 0;
143680         PyException_SetContext(value, tmp_value);
143681         Py_DECREF(tmp_type);
143682         Py_XDECREF(tmp_tb);
143683     }
143684 #endif
143685
143686     tmp_type = tstate->curexc_type;
143687     tmp_value = tstate->curexc_value;
143688     tmp_tb = tstate->curexc_traceback;
143689     tstate->curexc_type = type;
143690     tstate->curexc_value = value;
143691     tstate->curexc_traceback = tb;
143692     Py_XDECREF(tmp_type);
143693     Py_XDECREF(tmp_value);
143694     Py_XDECREF(tmp_tb);
143695 }
143696
143697 static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
143698     PyThreadState *tstate = PyThreadState_GET();
143699     *type = tstate->curexc_type;
143700     *value = tstate->curexc_value;
143701     *tb = tstate->curexc_traceback;
143702
143703     tstate->curexc_type = 0;
143704     tstate->curexc_value = 0;
143705     tstate->curexc_traceback = 0;
143706 }
143707
143708
143709
143710
143711 static INLINE void __Pyx_RaiseNoneNotIterableError(void) {
143712     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
143713 }
143714
143715 static INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
143716     PyErr_Format(PyExc_ValueError,
143717         #if PY_VERSION_HEX < 0x02050000
143718                  "need more than %d value%s to unpack", (int)index,
143719         #else
143720                  "need more than %zd value%s to unpack", index,
143721         #endif
143722                  (index == 1) ? "" : "s");
143723 }
143724
143725 static INLINE void __Pyx_RaiseTooManyValuesError(void) {
143726     PyErr_SetString(PyExc_ValueError, "too many values to unpack");
143727 }
143728
143729 static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
143730     if (t == Py_None) {
143731       __Pyx_RaiseNoneNotIterableError();
143732     } else if (PyTuple_GET_SIZE(t) < index) {
143733       __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
143734     } else {
143735       __Pyx_RaiseTooManyValuesError();
143736     }
143737 }
143738
143739 static INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
143740     PyThreadState *tstate = PyThreadState_GET();
143741     *type = tstate->exc_type;
143742     *value = tstate->exc_value;
143743     *tb = tstate->exc_traceback;
143744     Py_XINCREF(*type);
143745     Py_XINCREF(*value);
143746     Py_XINCREF(*tb);
143747 }
143748
143749 static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
143750     PyObject *tmp_type, *tmp_value, *tmp_tb;
143751     PyThreadState *tstate = PyThreadState_GET();
143752     tmp_type = tstate->exc_type;
143753     tmp_value = tstate->exc_value;
143754     tmp_tb = tstate->exc_traceback;
143755     tstate->exc_type = type;
143756     tstate->exc_value = value;
143757     tstate->exc_traceback = tb;
143758     Py_XDECREF(tmp_type);
143759     Py_XDECREF(tmp_value);
143760     Py_XDECREF(tmp_tb);
143761 }
143762
143763 static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
143764     const char *name, int exact)
143765 {
143766     if (!type) {
143767         PyErr_Format(PyExc_SystemError, "Missing type object");
143768         return 0;
143769     }
143770     if (none_allowed && obj == Py_None) return 1;
143771     else if (exact) {
143772         if (Py_TYPE(obj) == type) return 1;
143773     }
143774     else {
143775         if (PyObject_TypeCheck(obj, type)) return 1;
143776     }
143777     PyErr_Format(PyExc_TypeError,
143778         "Argument '%s' has incorrect type (expected %s, got %s)",
143779         name, type->tp_name, Py_TYPE(obj)->tp_name);
143780     return 0;
143781 }
143782
143783 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
143784     PyObject *__import__ = 0;
143785     PyObject *empty_list = 0;
143786     PyObject *module = 0;
143787     PyObject *global_dict = 0;
143788     PyObject *empty_dict = 0;
143789     PyObject *list;
143790     __import__ = __Pyx_GetAttrString(__pyx_b, "__import__");
143791     if (!__import__)
143792         goto bad;
143793     if (from_list)
143794         list = from_list;
143795     else {
143796         empty_list = PyList_New(0);
143797         if (!empty_list)
143798             goto bad;
143799         list = empty_list;
143800     }
143801     global_dict = PyModule_GetDict(__pyx_m);
143802     if (!global_dict)
143803         goto bad;
143804     empty_dict = PyDict_New();
143805     if (!empty_dict)
143806         goto bad;
143807     module = PyObject_CallFunctionObjArgs(__import__,
143808         name, global_dict, empty_dict, list, NULL);
143809 bad:
143810     Py_XDECREF(empty_list);
143811     Py_XDECREF(__import__);
143812     Py_XDECREF(empty_dict);
143813     return module;
143814 }
143815
143816 static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
143817     PyObject *result;
143818     result = PyObject_GetAttr(dict, name);
143819     if (!result)
143820         PyErr_SetObject(PyExc_NameError, name);
143821     return result;
143822 }
143823
143824 static PyObject *__Pyx_CreateClass(
143825     PyObject *bases, PyObject *dict, PyObject *name, const char *modname)
143826 {
143827     PyObject *py_modname;
143828     PyObject *result = 0;
143829
143830     #if PY_MAJOR_VERSION < 3
143831     py_modname = PyString_FromString(modname);
143832     #else
143833     py_modname = PyUnicode_FromString(modname);
143834     #endif
143835     if (!py_modname)
143836         goto bad;
143837     if (PyDict_SetItemString(dict, "__module__", py_modname) < 0)
143838         goto bad;
143839     #if PY_MAJOR_VERSION < 3
143840     result = PyClass_New(bases, dict, name);
143841     #else
143842     result = PyObject_CallFunctionObjArgs((PyObject *)&PyType_Type, name, bases, dict, NULL);
143843     #endif
143844 bad:
143845     Py_XDECREF(py_modname);
143846     return result;
143847 }
143848
143849 #if PY_MAJOR_VERSION < 3
143850 static PyObject *__Pyx_GetStdout(void) {
143851     PyObject *f = PySys_GetObject((char *)"stdout");
143852     if (!f) {
143853         PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
143854     }
143855     return f;
143856 }
143857
143858 static int __Pyx_Print(PyObject *arg_tuple, int newline) {
143859     PyObject *f;
143860     PyObject* v;
143861     int i;
143862
143863     if (!(f = __Pyx_GetStdout()))
143864         return -1;
143865     for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
143866         if (PyFile_SoftSpace(f, 1)) {
143867             if (PyFile_WriteString(" ", f) < 0)
143868                 return -1;
143869         }
143870         v = PyTuple_GET_ITEM(arg_tuple, i);
143871         if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
143872             return -1;
143873         if (PyString_Check(v)) {
143874             char *s = PyString_AsString(v);
143875             Py_ssize_t len = PyString_Size(v);
143876             if (len > 0 &&
143877                 isspace(Py_CHARMASK(s[len-1])) &&
143878                 s[len-1] != ' ')
143879                     PyFile_SoftSpace(f, 0);
143880         }
143881     }
143882     if (newline) {
143883         if (PyFile_WriteString("\n", f) < 0)
143884             return -1;
143885         PyFile_SoftSpace(f, 0);
143886     }
143887     return 0;
143888 }
143889
143890 #else /* Python 3 has a print function */
143891
143892 static int __Pyx_Print(PyObject *arg_tuple, int newline) {
143893     PyObject* kwargs = 0;
143894     PyObject* result = 0;
143895     PyObject* end_string;
143896     if (!__pyx_print) {
143897         __pyx_print = __Pyx_GetAttrString(__pyx_b, "print");
143898         if (!__pyx_print)
143899             return -1;
143900     }
143901     if (!newline) {
143902         if (!__pyx_print_kwargs) {
143903             __pyx_print_kwargs = PyDict_New();
143904             if (!__pyx_print_kwargs)
143905                 return -1;
143906             end_string = PyUnicode_FromStringAndSize(" ", 1);
143907             if (!end_string)
143908                 return -1;
143909             if (PyDict_SetItemString(__pyx_print_kwargs, "end", end_string) < 0) {
143910                 Py_DECREF(end_string);
143911                 return -1;
143912             }
143913             Py_DECREF(end_string);
143914         }
143915         kwargs = __pyx_print_kwargs;
143916     }
143917     result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
143918     if (!result)
143919         return -1;
143920     Py_DECREF(result);
143921     return 0;
143922 }
143923
143924 #endif
143925
143926 #if PY_MAJOR_VERSION < 3
143927
143928 static int __Pyx_PrintOne(PyObject *o) {
143929     PyObject *f;
143930     if (!(f = __Pyx_GetStdout()))
143931         return -1;
143932     if (PyFile_SoftSpace(f, 0)) {
143933         if (PyFile_WriteString(" ", f) < 0)
143934             return -1;
143935     }
143936     if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
143937         return -1;
143938     if (PyFile_WriteString("\n", f) < 0)
143939         return -1;
143940     return 0;
143941     /* the line below is just to avoid compiler
143942      * compiler warnings about unused functions */
143943     return __Pyx_Print(NULL, 0);
143944 }
143945
143946 #else /* Python 3 has a print function */
143947
143948 static int __Pyx_PrintOne(PyObject *o) {
143949     int res;
143950     PyObject* arg_tuple = PyTuple_New(1);
143951     if (unlikely(!arg_tuple))
143952         return -1;
143953     Py_INCREF(o);
143954     PyTuple_SET_ITEM(arg_tuple, 0, o);
143955     res = __Pyx_Print(arg_tuple, 1);
143956     Py_DECREF(arg_tuple);
143957     return res;
143958 }
143959
143960 #endif
143961
143962 static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
143963     /* It appears that PyMethodDescr_Type is not anywhere exposed in the Python/C API */
143964     static PyTypeObject *methoddescr_type = NULL;
143965     if (methoddescr_type == NULL) {
143966        PyObject *meth = __Pyx_GetAttrString((PyObject*)&PyList_Type, "append");
143967        if (!meth) return NULL;
143968        methoddescr_type = Py_TYPE(meth);
143969        Py_DECREF(meth);
143970     }
143971     if (PyObject_TypeCheck(method, methoddescr_type)) { /* cdef classes */
143972         PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
143973         return PyDescr_NewClassMethod(descr->d_type, descr->d_method);
143974     }
143975     else if (PyMethod_Check(method)) {                                /* python classes */
143976         return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
143977     }
143978     else if (PyCFunction_Check(method)) {
143979         return PyClassMethod_New(method);
143980     }
143981     PyErr_Format(PyExc_TypeError, "Class-level classmethod() can only be called on a method_descriptor or instance method.");
143982     return NULL;
143983 }
143984
143985 static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) {
143986     PyObject *item;
143987     if (!(item = PyIter_Next(iter))) {
143988         if (!PyErr_Occurred()) {
143989             __Pyx_RaiseNeedMoreValuesError(index);
143990         }
143991     }
143992     return item;
143993 }
143994
143995 static int __Pyx_EndUnpack(PyObject *iter) {
143996     PyObject *item;
143997     if ((item = PyIter_Next(iter))) {
143998         Py_DECREF(item);
143999         __Pyx_RaiseTooManyValuesError();
144000         return -1;
144001     }
144002     else if (!PyErr_Occurred())
144003         return 0;
144004     else
144005         return -1;
144006 }
144007
144008 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
144009     Py_XINCREF(type);
144010     Py_XINCREF(value);
144011     Py_XINCREF(tb);
144012     /* First, check the traceback argument, replacing None with NULL. */
144013     if (tb == Py_None) {
144014         Py_DECREF(tb);
144015         tb = 0;
144016     }
144017     else if (tb != NULL && !PyTraceBack_Check(tb)) {
144018         PyErr_SetString(PyExc_TypeError,
144019             "raise: arg 3 must be a traceback or None");
144020         goto raise_error;
144021     }
144022     /* Next, replace a missing value with None */
144023     if (value == NULL) {
144024         value = Py_None;
144025         Py_INCREF(value);
144026     }
144027     #if PY_VERSION_HEX < 0x02050000
144028     if (!PyClass_Check(type))
144029     #else
144030     if (!PyType_Check(type))
144031     #endif
144032     {
144033         /* Raising an instance.  The value should be a dummy. */
144034         if (value != Py_None) {
144035             PyErr_SetString(PyExc_TypeError,
144036                 "instance exception may not have a separate value");
144037             goto raise_error;
144038         }
144039         /* Normalize to raise <class>, <instance> */
144040         Py_DECREF(value);
144041         value = type;
144042         #if PY_VERSION_HEX < 0x02050000
144043             if (PyInstance_Check(type)) {
144044                 type = (PyObject*) ((PyInstanceObject*)type)->in_class;
144045                 Py_INCREF(type);
144046             }
144047             else {
144048                 type = 0;
144049                 PyErr_SetString(PyExc_TypeError,
144050                     "raise: exception must be an old-style class or instance");
144051                 goto raise_error;
144052             }
144053         #else
144054             type = (PyObject*) Py_TYPE(type);
144055             Py_INCREF(type);
144056             if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
144057                 PyErr_SetString(PyExc_TypeError,
144058                     "raise: exception class must be a subclass of BaseException");
144059                 goto raise_error;
144060             }
144061         #endif
144062     }
144063     __Pyx_ErrRestore(type, value, tb);
144064     return;
144065 raise_error:
144066     Py_XDECREF(value);
144067     Py_XDECREF(type);
144068     Py_XDECREF(tb);
144069     return;
144070 }
144071
144072 static PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
144073     PyObject *r = PyObject_GetAttr(o, n);
144074     if (!r) {
144075         if (!PyErr_ExceptionMatches(PyExc_AttributeError))
144076             goto bad;
144077         PyErr_Clear();
144078         r = d;
144079         Py_INCREF(d);
144080     }
144081     return r;
144082 bad:
144083     return 0;
144084 }
144085
144086 static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
144087     if (sizeof(unsigned char) < sizeof(long)) {
144088         long val = __Pyx_PyInt_AsLong(x);
144089         if (unlikely(val != (long)(unsigned char)val)) {
144090             if (!unlikely(val == -1 && PyErr_Occurred())) {
144091                 PyErr_SetString(PyExc_OverflowError,
144092                     (((unsigned char)-1) > ((unsigned char)0) && unlikely(val < 0)) ?
144093                     "can't convert negative value to unsigned char" :
144094                     "value too large to convert to unsigned char");
144095             }
144096             return (unsigned char)-1;
144097         }
144098         return (unsigned char)val;
144099     }
144100     return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
144101 }
144102
144103 static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
144104     if (sizeof(unsigned short) < sizeof(long)) {
144105         long val = __Pyx_PyInt_AsLong(x);
144106         if (unlikely(val != (long)(unsigned short)val)) {
144107             if (!unlikely(val == -1 && PyErr_Occurred())) {
144108                 PyErr_SetString(PyExc_OverflowError,
144109                     (((unsigned short)-1) > ((unsigned short)0) && unlikely(val < 0)) ?
144110                     "can't convert negative value to unsigned short" :
144111                     "value too large to convert to unsigned short");
144112             }
144113             return (unsigned short)-1;
144114         }
144115         return (unsigned short)val;
144116     }
144117     return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
144118 }
144119
144120 static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
144121     if (sizeof(unsigned int) < sizeof(long)) {
144122         long val = __Pyx_PyInt_AsLong(x);
144123         if (unlikely(val != (long)(unsigned int)val)) {
144124             if (!unlikely(val == -1 && PyErr_Occurred())) {
144125                 PyErr_SetString(PyExc_OverflowError,
144126                     (((unsigned int)-1) > ((unsigned int)0) && unlikely(val < 0)) ?
144127                     "can't convert negative value to unsigned int" :
144128                     "value too large to convert to unsigned int");
144129             }
144130             return (unsigned int)-1;
144131         }
144132         return (unsigned int)val;
144133     }
144134     return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
144135 }
144136
144137 static INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
144138     if (sizeof(char) < sizeof(long)) {
144139         long val = __Pyx_PyInt_AsLong(x);
144140         if (unlikely(val != (long)(char)val)) {
144141             if (!unlikely(val == -1 && PyErr_Occurred())) {
144142                 PyErr_SetString(PyExc_OverflowError,
144143                     (((char)-1) > ((char)0) && unlikely(val < 0)) ?
144144                     "can't convert negative value to char" :
144145                     "value too large to convert to char");
144146             }
144147             return (char)-1;
144148         }
144149         return (char)val;
144150     }
144151     return (char)__Pyx_PyInt_AsLong(x);
144152 }
144153
144154 static INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
144155     if (sizeof(short) < sizeof(long)) {
144156         long val = __Pyx_PyInt_AsLong(x);
144157         if (unlikely(val != (long)(short)val)) {
144158             if (!unlikely(val == -1 && PyErr_Occurred())) {
144159                 PyErr_SetString(PyExc_OverflowError,
144160                     (((short)-1) > ((short)0) && unlikely(val < 0)) ?
144161                     "can't convert negative value to short" :
144162                     "value too large to convert to short");
144163             }
144164             return (short)-1;
144165         }
144166         return (short)val;
144167     }
144168     return (short)__Pyx_PyInt_AsLong(x);
144169 }
144170
144171 static INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
144172     if (sizeof(int) < sizeof(long)) {
144173         long val = __Pyx_PyInt_AsLong(x);
144174         if (unlikely(val != (long)(int)val)) {
144175             if (!unlikely(val == -1 && PyErr_Occurred())) {
144176                 PyErr_SetString(PyExc_OverflowError,
144177                     (((int)-1) > ((int)0) && unlikely(val < 0)) ?
144178                     "can't convert negative value to int" :
144179                     "value too large to convert to int");
144180             }
144181             return (int)-1;
144182         }
144183         return (int)val;
144184     }
144185     return (int)__Pyx_PyInt_AsLong(x);
144186 }
144187
144188 static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
144189     if (sizeof(signed char) < sizeof(long)) {
144190         long val = __Pyx_PyInt_AsLong(x);
144191         if (unlikely(val != (long)(signed char)val)) {
144192             if (!unlikely(val == -1 && PyErr_Occurred())) {
144193                 PyErr_SetString(PyExc_OverflowError,
144194                     (((signed char)-1) > ((signed char)0) && unlikely(val < 0)) ?
144195                     "can't convert negative value to signed char" :
144196                     "value too large to convert to signed char");
144197             }
144198             return (signed char)-1;
144199         }
144200         return (signed char)val;
144201     }
144202     return (signed char)__Pyx_PyInt_AsSignedLong(x);
144203 }
144204
144205 static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
144206     if (sizeof(signed short) < sizeof(long)) {
144207         long val = __Pyx_PyInt_AsLong(x);
144208         if (unlikely(val != (long)(signed short)val)) {
144209             if (!unlikely(val == -1 && PyErr_Occurred())) {
144210                 PyErr_SetString(PyExc_OverflowError,
144211                     (((signed short)-1) > ((signed short)0) && unlikely(val < 0)) ?
144212                     "can't convert negative value to signed short" :
144213                     "value too large to convert to signed short");
144214             }
144215             return (signed short)-1;
144216         }
144217         return (signed short)val;
144218     }
144219     return (signed short)__Pyx_PyInt_AsSignedLong(x);
144220 }
144221
144222 static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
144223     if (sizeof(signed int) < sizeof(long)) {
144224         long val = __Pyx_PyInt_AsLong(x);
144225         if (unlikely(val != (long)(signed int)val)) {
144226             if (!unlikely(val == -1 && PyErr_Occurred())) {
144227                 PyErr_SetString(PyExc_OverflowError,
144228                     (((signed int)-1) > ((signed int)0) && unlikely(val < 0)) ?
144229                     "can't convert negative value to signed int" :
144230                     "value too large to convert to signed int");
144231             }
144232             return (signed int)-1;
144233         }
144234         return (signed int)val;
144235     }
144236     return (signed int)__Pyx_PyInt_AsSignedLong(x);
144237 }
144238
144239 static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
144240 #if PY_VERSION_HEX < 0x03000000
144241     if (likely(PyInt_Check(x))) {
144242         long val = PyInt_AS_LONG(x);
144243         if (((unsigned long)-1) > ((unsigned long)0) && unlikely(val < 0)) {
144244             PyErr_SetString(PyExc_OverflowError,
144245                             "can't convert negative value to unsigned long");
144246             return (unsigned long)-1;
144247         }
144248         return (unsigned long)val;
144249     } else
144250 #endif
144251     if (likely(PyLong_Check(x))) {
144252         if (((unsigned long)-1) > ((unsigned long)0) && unlikely(Py_SIZE(x) < 0)) {
144253             PyErr_SetString(PyExc_OverflowError,
144254                             "can't convert negative value to unsigned long");
144255             return (unsigned long)-1;
144256         }
144257         return (((unsigned long)-1) < ((unsigned long)0)) ?
144258                PyLong_AsLong(x) :
144259                PyLong_AsUnsignedLong(x);
144260     } else {
144261         unsigned long val;
144262         PyObject *tmp = __Pyx_PyNumber_Int(x);
144263         if (!tmp) return (unsigned long)-1;
144264         val = __Pyx_PyInt_AsUnsignedLong(tmp);
144265         Py_DECREF(tmp);
144266         return val;
144267     }
144268 }
144269
144270 static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
144271 #if PY_VERSION_HEX < 0x03000000
144272     if (likely(PyInt_Check(x))) {
144273         long val = PyInt_AS_LONG(x);
144274         if (((unsigned PY_LONG_LONG)-1) > ((unsigned PY_LONG_LONG)0) && unlikely(val < 0)) {
144275             PyErr_SetString(PyExc_OverflowError,
144276                             "can't convert negative value to unsigned PY_LONG_LONG");
144277             return (unsigned PY_LONG_LONG)-1;
144278         }
144279         return (unsigned PY_LONG_LONG)val;
144280     } else
144281 #endif
144282     if (likely(PyLong_Check(x))) {
144283         if (((unsigned PY_LONG_LONG)-1) > ((unsigned PY_LONG_LONG)0) && unlikely(Py_SIZE(x) < 0)) {
144284             PyErr_SetString(PyExc_OverflowError,
144285                             "can't convert negative value to unsigned PY_LONG_LONG");
144286             return (unsigned PY_LONG_LONG)-1;
144287         }
144288         return (((unsigned PY_LONG_LONG)-1) < ((unsigned PY_LONG_LONG)0)) ?
144289                PyLong_AsLongLong(x) :
144290                PyLong_AsUnsignedLongLong(x);
144291     } else {
144292         unsigned PY_LONG_LONG val;
144293         PyObject *tmp = __Pyx_PyNumber_Int(x);
144294         if (!tmp) return (unsigned PY_LONG_LONG)-1;
144295         val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
144296         Py_DECREF(tmp);
144297         return val;
144298     }
144299 }
144300
144301 static INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
144302 #if PY_VERSION_HEX < 0x03000000
144303     if (likely(PyInt_Check(x))) {
144304         long val = PyInt_AS_LONG(x);
144305         if (((long)-1) > ((long)0) && unlikely(val < 0)) {
144306             PyErr_SetString(PyExc_OverflowError,
144307                             "can't convert negative value to long");
144308             return (long)-1;
144309         }
144310         return (long)val;
144311     } else
144312 #endif
144313     if (likely(PyLong_Check(x))) {
144314         if (((long)-1) > ((long)0) && unlikely(Py_SIZE(x) < 0)) {
144315             PyErr_SetString(PyExc_OverflowError,
144316                             "can't convert negative value to long");
144317             return (long)-1;
144318         }
144319         return (((long)-1) < ((long)0)) ?
144320                PyLong_AsLong(x) :
144321                PyLong_AsUnsignedLong(x);
144322     } else {
144323         long val;
144324         PyObject *tmp = __Pyx_PyNumber_Int(x);
144325         if (!tmp) return (long)-1;
144326         val = __Pyx_PyInt_AsLong(tmp);
144327         Py_DECREF(tmp);
144328         return val;
144329     }
144330 }
144331
144332 static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
144333 #if PY_VERSION_HEX < 0x03000000
144334     if (likely(PyInt_Check(x))) {
144335         long val = PyInt_AS_LONG(x);
144336         if (((PY_LONG_LONG)-1) > ((PY_LONG_LONG)0) && unlikely(val < 0)) {
144337             PyErr_SetString(PyExc_OverflowError,
144338                             "can't convert negative value to PY_LONG_LONG");
144339             return (PY_LONG_LONG)-1;
144340         }
144341         return (PY_LONG_LONG)val;
144342     } else
144343 #endif
144344     if (likely(PyLong_Check(x))) {
144345         if (((PY_LONG_LONG)-1) > ((PY_LONG_LONG)0) && unlikely(Py_SIZE(x) < 0)) {
144346             PyErr_SetString(PyExc_OverflowError,
144347                             "can't convert negative value to PY_LONG_LONG");
144348             return (PY_LONG_LONG)-1;
144349         }
144350         return (((PY_LONG_LONG)-1) < ((PY_LONG_LONG)0)) ?
144351                PyLong_AsLongLong(x) :
144352                PyLong_AsUnsignedLongLong(x);
144353     } else {
144354         PY_LONG_LONG val;
144355         PyObject *tmp = __Pyx_PyNumber_Int(x);
144356         if (!tmp) return (PY_LONG_LONG)-1;
144357         val = __Pyx_PyInt_AsLongLong(tmp);
144358         Py_DECREF(tmp);
144359         return val;
144360     }
144361 }
144362
144363 static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
144364 #if PY_VERSION_HEX < 0x03000000
144365     if (likely(PyInt_Check(x))) {
144366         long val = PyInt_AS_LONG(x);
144367         if (((signed long)-1) > ((signed long)0) && unlikely(val < 0)) {
144368             PyErr_SetString(PyExc_OverflowError,
144369                             "can't convert negative value to signed long");
144370             return (signed long)-1;
144371         }
144372         return (signed long)val;
144373     } else
144374 #endif
144375     if (likely(PyLong_Check(x))) {
144376         if (((signed long)-1) > ((signed long)0) && unlikely(Py_SIZE(x) < 0)) {
144377             PyErr_SetString(PyExc_OverflowError,
144378                             "can't convert negative value to signed long");
144379             return (signed long)-1;
144380         }
144381         return (((signed long)-1) < ((signed long)0)) ?
144382                PyLong_AsLong(x) :
144383                PyLong_AsUnsignedLong(x);
144384     } else {
144385         signed long val;
144386         PyObject *tmp = __Pyx_PyNumber_Int(x);
144387         if (!tmp) return (signed long)-1;
144388         val = __Pyx_PyInt_AsSignedLong(tmp);
144389         Py_DECREF(tmp);
144390         return val;
144391     }
144392 }
144393
144394 static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
144395 #if PY_VERSION_HEX < 0x03000000
144396     if (likely(PyInt_Check(x))) {
144397         long val = PyInt_AS_LONG(x);
144398         if (((signed PY_LONG_LONG)-1) > ((signed PY_LONG_LONG)0) && unlikely(val < 0)) {
144399             PyErr_SetString(PyExc_OverflowError,
144400                             "can't convert negative value to signed PY_LONG_LONG");
144401             return (signed PY_LONG_LONG)-1;
144402         }
144403         return (signed PY_LONG_LONG)val;
144404     } else
144405 #endif
144406     if (likely(PyLong_Check(x))) {
144407         if (((signed PY_LONG_LONG)-1) > ((signed PY_LONG_LONG)0) && unlikely(Py_SIZE(x) < 0)) {
144408             PyErr_SetString(PyExc_OverflowError,
144409                             "can't convert negative value to signed PY_LONG_LONG");
144410             return (signed PY_LONG_LONG)-1;
144411         }
144412         return (((signed PY_LONG_LONG)-1) < ((signed PY_LONG_LONG)0)) ?
144413                PyLong_AsLongLong(x) :
144414                PyLong_AsUnsignedLongLong(x);
144415     } else {
144416         signed PY_LONG_LONG val;
144417         PyObject *tmp = __Pyx_PyNumber_Int(x);
144418         if (!tmp) return (signed PY_LONG_LONG)-1;
144419         val = __Pyx_PyInt_AsSignedLongLong(tmp);
144420         Py_DECREF(tmp);
144421         return val;
144422     }
144423 }
144424
144425 static void __Pyx_WriteUnraisable(const char *name) {
144426     PyObject *old_exc, *old_val, *old_tb;
144427     PyObject *ctx;
144428     __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
144429     #if PY_MAJOR_VERSION < 3
144430     ctx = PyString_FromString(name);
144431     #else
144432     ctx = PyUnicode_FromString(name);
144433     #endif
144434     __Pyx_ErrRestore(old_exc, old_val, old_tb);
144435     if (!ctx) {
144436         PyErr_WriteUnraisable(Py_None);
144437     } else {
144438         PyErr_WriteUnraisable(ctx);
144439         Py_DECREF(ctx);
144440     }
144441 }
144442
144443 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
144444 #if PY_VERSION_HEX < 0x02050000
144445     char *api = (char *)"__pyx_capi__";
144446 #else
144447     const char *api = "__pyx_capi__";
144448 #endif
144449     PyObject *d = 0;
144450     PyObject *cobj = 0;
144451     union {
144452         void (*fp)(void);
144453         void *p;
144454     } tmp;
144455
144456
144457     d = PyObject_GetAttrString(__pyx_m, api);
144458     if (!d) {
144459         PyErr_Clear();
144460         d = PyDict_New();
144461         if (!d)
144462             goto bad;
144463         Py_INCREF(d);
144464         if (PyModule_AddObject(__pyx_m, api, d) < 0)
144465             goto bad;
144466     }
144467     tmp.fp = f;
144468     cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
144469     if (!cobj)
144470         goto bad;
144471     if (PyDict_SetItemString(d, name, cobj) < 0)
144472         goto bad;
144473     Py_DECREF(cobj);
144474     Py_DECREF(d);
144475     return 0;
144476 bad:
144477     Py_XDECREF(cobj);
144478     Py_XDECREF(d);
144479     return -1;
144480 }
144481
144482 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
144483     PyObject *pycobj = 0;
144484     int result;
144485     
144486     pycobj = PyCObject_FromVoidPtr(vtable, 0);
144487     if (!pycobj)
144488         goto bad;
144489     if (PyDict_SetItemString(dict, "__pyx_vtable__", pycobj) < 0)
144490         goto bad;
144491     result = 0;
144492     goto done;
144493
144494 bad:
144495     result = -1;
144496 done:
144497     Py_XDECREF(pycobj);
144498     return result;
144499 }
144500
144501 #ifndef __PYX_HAVE_RT_ImportType
144502 #define __PYX_HAVE_RT_ImportType
144503 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
144504     long size)
144505 {
144506     PyObject *py_module = 0;
144507     PyObject *result = 0;
144508     PyObject *py_name = 0;
144509
144510     py_module = __Pyx_ImportModule(module_name);
144511     if (!py_module)
144512         goto bad;
144513     #if PY_MAJOR_VERSION < 3
144514     py_name = PyString_FromString(class_name);
144515     #else
144516     py_name = PyUnicode_FromString(class_name);
144517     #endif
144518     if (!py_name)
144519         goto bad;
144520     result = PyObject_GetAttr(py_module, py_name);
144521     Py_DECREF(py_name);
144522     py_name = 0;
144523     Py_DECREF(py_module);
144524     py_module = 0;
144525     if (!result)
144526         goto bad;
144527     if (!PyType_Check(result)) {
144528         PyErr_Format(PyExc_TypeError, 
144529             "%s.%s is not a type object",
144530             module_name, class_name);
144531         goto bad;
144532     }
144533     if (((PyTypeObject *)result)->tp_basicsize != size) {
144534         PyErr_Format(PyExc_ValueError, 
144535             "%s.%s does not appear to be the correct type object",
144536             module_name, class_name);
144537         goto bad;
144538     }
144539     return (PyTypeObject *)result;
144540 bad:
144541     Py_XDECREF(py_module);
144542     Py_XDECREF(result);
144543     return 0;
144544 }
144545 #endif
144546
144547 #ifndef __PYX_HAVE_RT_ImportModule
144548 #define __PYX_HAVE_RT_ImportModule
144549 static PyObject *__Pyx_ImportModule(const char *name) {
144550     PyObject *py_name = 0;
144551     PyObject *py_module = 0;
144552
144553     #if PY_MAJOR_VERSION < 3
144554     py_name = PyString_FromString(name);
144555     #else
144556     py_name = PyUnicode_FromString(name);
144557     #endif
144558     if (!py_name)
144559         goto bad;
144560     py_module = PyImport_Import(py_name);
144561     Py_DECREF(py_name);
144562     return py_module;
144563 bad:
144564     Py_XDECREF(py_name);
144565     return 0;
144566 }
144567 #endif
144568
144569 #include "compile.h"
144570 #include "frameobject.h"
144571 #include "traceback.h"
144572
144573 static void __Pyx_AddTraceback(const char *funcname) {
144574     PyObject *py_srcfile = 0;
144575     PyObject *py_funcname = 0;
144576     PyObject *py_globals = 0;
144577     PyCodeObject *py_code = 0;
144578     PyFrameObject *py_frame = 0;
144579
144580     #if PY_MAJOR_VERSION < 3
144581     py_srcfile = PyString_FromString(__pyx_filename);
144582     #else
144583     py_srcfile = PyUnicode_FromString(__pyx_filename);
144584     #endif
144585     if (!py_srcfile) goto bad;
144586     if (__pyx_clineno) {
144587         #if PY_MAJOR_VERSION < 3
144588         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
144589         #else
144590         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
144591         #endif
144592     }
144593     else {
144594         #if PY_MAJOR_VERSION < 3
144595         py_funcname = PyString_FromString(funcname);
144596         #else
144597         py_funcname = PyUnicode_FromString(funcname);
144598         #endif
144599     }
144600     if (!py_funcname) goto bad;
144601     py_globals = PyModule_GetDict(__pyx_m);
144602     if (!py_globals) goto bad;
144603     py_code = PyCode_New(
144604         0,            /*int argcount,*/
144605         #if PY_MAJOR_VERSION >= 3
144606         0,            /*int kwonlyargcount,*/
144607         #endif
144608         0,            /*int nlocals,*/
144609         0,            /*int stacksize,*/
144610         0,            /*int flags,*/
144611         __pyx_empty_bytes, /*PyObject *code,*/
144612         __pyx_empty_tuple,  /*PyObject *consts,*/
144613         __pyx_empty_tuple,  /*PyObject *names,*/
144614         __pyx_empty_tuple,  /*PyObject *varnames,*/
144615         __pyx_empty_tuple,  /*PyObject *freevars,*/
144616         __pyx_empty_tuple,  /*PyObject *cellvars,*/
144617         py_srcfile,   /*PyObject *filename,*/
144618         py_funcname,  /*PyObject *name,*/
144619         __pyx_lineno,   /*int firstlineno,*/
144620         __pyx_empty_bytes  /*PyObject *lnotab*/
144621     );
144622     if (!py_code) goto bad;
144623     py_frame = PyFrame_New(
144624         PyThreadState_GET(), /*PyThreadState *tstate,*/
144625         py_code,             /*PyCodeObject *code,*/
144626         py_globals,          /*PyObject *globals,*/
144627         0                    /*PyObject *locals*/
144628     );
144629     if (!py_frame) goto bad;
144630     py_frame->f_lineno = __pyx_lineno;
144631     PyTraceBack_Here(py_frame);
144632 bad:
144633     Py_XDECREF(py_srcfile);
144634     Py_XDECREF(py_funcname);
144635     Py_XDECREF(py_code);
144636     Py_XDECREF(py_frame);
144637 }
144638
144639 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
144640     while (t->p) {
144641         #if PY_MAJOR_VERSION < 3
144642         if (t->is_unicode && (!t->is_identifier)) {
144643             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
144644         } else if (t->intern) {
144645             *t->p = PyString_InternFromString(t->s);
144646         } else {
144647             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
144648         }
144649         #else  /* Python 3+ has unicode identifiers */
144650         if (t->is_identifier || (t->is_unicode && t->intern)) {
144651             *t->p = PyUnicode_InternFromString(t->s);
144652         } else if (t->is_unicode) {
144653             *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
144654         } else {
144655             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
144656         }
144657         #endif
144658         if (!*t->p)
144659             return -1;
144660         ++t;
144661     }
144662     return 0;
144663 }
144664
144665 /* Type Conversion Functions */
144666
144667 static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
144668    if (x == Py_True) return 1;
144669    else if ((x == Py_False) | (x == Py_None)) return 0;
144670    else return PyObject_IsTrue(x);
144671 }
144672
144673 static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
144674   PyNumberMethods *m;
144675   const char *name = NULL;
144676   PyObject *res = NULL;
144677 #if PY_VERSION_HEX < 0x03000000
144678   if (PyInt_Check(x) || PyLong_Check(x))
144679 #else
144680   if (PyLong_Check(x))
144681 #endif
144682     return Py_INCREF(x), x;
144683   m = Py_TYPE(x)->tp_as_number;
144684 #if PY_VERSION_HEX < 0x03000000
144685   if (m && m->nb_int) {
144686     name = "int";
144687     res = PyNumber_Int(x);
144688   }
144689   else if (m && m->nb_long) {
144690     name = "long";
144691     res = PyNumber_Long(x);
144692   }
144693 #else
144694   if (m && m->nb_int) {
144695     name = "int";
144696     res = PyNumber_Long(x);
144697   }
144698 #endif
144699   if (res) {
144700 #if PY_VERSION_HEX < 0x03000000
144701     if (!PyInt_Check(res) && !PyLong_Check(res)) {
144702 #else
144703     if (!PyLong_Check(res)) {
144704 #endif
144705       PyErr_Format(PyExc_TypeError,
144706                    "__%s__ returned non-%s (type %.200s)",
144707                    name, name, Py_TYPE(res)->tp_name);
144708       Py_DECREF(res);
144709       return NULL;
144710     }
144711   }
144712   else if (!PyErr_Occurred()) {
144713     PyErr_SetString(PyExc_TypeError,
144714                     "an integer is required");
144715   }
144716   return res;
144717 }
144718
144719 static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
144720   Py_ssize_t ival;
144721   PyObject* x = PyNumber_Index(b);
144722   if (!x) return -1;
144723   ival = PyInt_AsSsize_t(x);
144724   Py_DECREF(x);
144725   return ival;
144726 }
144727
144728 static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
144729 #if PY_VERSION_HEX < 0x02050000
144730    if (ival <= LONG_MAX)
144731        return PyInt_FromLong((long)ival);
144732    else {
144733        unsigned char *bytes = (unsigned char *) &ival;
144734        int one = 1; int little = (int)*(unsigned char*)&one;
144735        return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
144736    }
144737 #else
144738    return PyInt_FromSize_t(ival);
144739 #endif
144740 }
144741
144742 static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
144743    unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
144744    if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
144745        return (size_t)-1;
144746    } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
144747        PyErr_SetString(PyExc_OverflowError,
144748                        "value too large to convert to size_t");
144749        return (size_t)-1;
144750    }
144751    return (size_t)val;
144752 }
144753
144754
144755 #endif /* Py_PYTHON_H */